From 21e19a98d15f4730258a942770cc69f4a9cde477 Mon Sep 17 00:00:00 2001 From: nulli0n <73139339+nulli0n@users.noreply.github.com> Date: Mon, 1 Jan 2024 02:22:02 +0500 Subject: [PATCH 1/9] Initial commit --- LICENSE | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 675 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b695ebd --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# nightcore-spigot \ No newline at end of file From 2f03847ec2d6b314809d4c0ed2f815dde890972f Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 1 Jan 2024 02:24:43 +0500 Subject: [PATCH 2/9] release --- .gitignore | 4 + LICENSE | 674 ++++++++++++++++++ README.md | 31 + pom.xml | 117 +++ .../org/jetbrains/annotations/NotNull.java | 50 ++ .../org/jetbrains/annotations/Nullable.java | 47 ++ .../su/nightexpress/nightcore/NightCore.java | 73 ++ .../nightcore/NightCorePlugin.java | 119 ++++ .../nightcore/NightDataPlugin.java | 31 + .../nightexpress/nightcore/NightPlugin.java | 180 +++++ .../nightcore/command/CommandFlag.java | 74 ++ .../nightcore/command/CommandManager.java | 89 +++ .../nightcore/command/CommandResult.java | 79 ++ .../nightcore/command/api/NightCommand.java | 99 +++ .../command/api/NightPluginCommand.java | 19 + .../command/base/HelpSubCommand.java | 39 + .../command/base/ReloadSubCommand.java | 27 + .../command/impl/AbstractCommand.java | 234 ++++++ .../nightcore/command/impl/BaseCommand.java | 18 + .../nightcore/command/impl/PluginCommand.java | 116 +++ .../command/impl/WrappedCommand.java | 52 ++ .../nightcore/config/ConfigValue.java | 301 ++++++++ .../nightcore/config/FileConfig.java | 441 ++++++++++++ .../nightcore/config/PluginDetails.java | 122 ++++ .../nightcore/core/CoreConfig.java | 71 ++ .../nightexpress/nightcore/core/CoreLang.java | 99 +++ .../nightcore/core/CoreManager.java | 37 + .../nightcore/core/CorePerms.java | 11 + .../core/command/CheckPermCommand.java | 58 ++ .../nightcore/core/listener/CoreListener.java | 24 + .../nightcore/database/AbstractConnector.java | 43 ++ .../database/AbstractDataHandler.java | 197 +++++ .../nightcore/database/AbstractUser.java | 98 +++ .../database/AbstractUserDataHandler.java | 191 +++++ .../database/AbstractUserManager.java | 259 +++++++ .../nightcore/database/DataUser.java | 41 ++ .../nightcore/database/DatabaseConfig.java | 190 +++++ .../nightcore/database/DatabaseType.java | 7 + .../database/connection/MySQLConnector.java | 28 + .../database/connection/SQLiteConnector.java | 24 + .../database/listener/UserListener.java | 49 ++ .../serialize/ItemStackSerializer.java | 24 + .../nightcore/database/sql/SQLColumn.java | 68 ++ .../nightcore/database/sql/SQLCondition.java | 72 ++ .../nightcore/database/sql/SQLExecutor.java | 21 + .../nightcore/database/sql/SQLQueries.java | 115 +++ .../nightcore/database/sql/SQLValue.java | 29 + .../database/sql/column/ColumnFormer.java | 35 + .../database/sql/column/ColumnType.java | 23 + .../sql/executor/AlterTableExecutor.java | 112 +++ .../sql/executor/CreateTableExecutor.java | 66 ++ .../sql/executor/DeleteQueryExecutor.java | 56 ++ .../sql/executor/InsertQueryExecutor.java | 54 ++ .../sql/executor/RenameTableExecutor.java | 46 ++ .../sql/executor/SelectQueryExecutor.java | 85 +++ .../sql/executor/UpdateQueryExecutor.java | 75 ++ .../nightexpress/nightcore/dialog/Dialog.java | 193 +++++ .../nightcore/dialog/DialogHandler.java | 8 + .../nightcore/dialog/DialogListener.java | 73 ++ .../nightcore/dialog/WrappedInput.java | 92 +++ .../nightcore/integration/VaultHook.java | 162 +++++ .../nightcore/language/LangAssets.java | 120 ++++ .../nightcore/language/LangManager.java | 94 +++ .../nightcore/language/entry/LangEntry.java | 31 + .../nightcore/language/entry/LangItem.java | 227 ++++++ .../nightcore/language/entry/LangString.java | 64 ++ .../nightcore/language/entry/LangText.java | 67 ++ .../language/legacy/LegacyLangMessage.java | 179 +++++ .../language/legacy/LegacyLangString.java | 53 ++ .../language/legacy/LegacyLangText.java | 68 ++ .../language/legacy/LegacyMessageOption.java | 26 + .../language/legacy/LegacyMessageOptions.java | 86 +++ .../language/message/LangMessage.java | 231 ++++++ .../language/message/MessageOptions.java | 72 ++ .../language/message/OutputType.java | 5 + .../language/tag/MessageDecorator.java | 9 + .../nightcore/language/tag/MessageTags.java | 48 ++ .../language/tag/impl/NoPrefixTag.java | 23 + .../language/tag/impl/OutputTag.java | 53 ++ .../language/tag/impl/PlaceholderTag.java | 23 + .../nightcore/language/tag/impl/SoundTag.java | 31 + .../nightcore/manager/AbstractFileData.java | 71 ++ .../nightcore/manager/AbstractListener.java | 19 + .../nightcore/manager/AbstractManager.java | 42 ++ .../nightcore/manager/SimpeListener.java | 13 + .../nightcore/manager/SimpleManager.java | 35 + .../nightcore/menu/MenuListener.java | 83 +++ .../nightcore/menu/MenuOptions.java | 97 +++ .../nightcore/menu/MenuViewer.java | 85 +++ .../nightcore/menu/api/AutoFilled.java | 57 ++ .../nightexpress/nightcore/menu/api/Menu.java | 66 ++ .../nightcore/menu/click/ClickAction.java | 10 + .../nightcore/menu/click/ClickResult.java | 38 + .../nightcore/menu/click/ClickType.java | 45 ++ .../nightcore/menu/impl/AbstractMenu.java | 266 +++++++ .../nightcore/menu/impl/ConfigMenu.java | 178 +++++ .../nightcore/menu/impl/EditorMenu.java | 131 ++++ .../nightcore/menu/item/ItemHandler.java | 95 +++ .../nightcore/menu/item/ItemOptions.java | 115 +++ .../nightcore/menu/item/MenuItem.java | 113 +++ .../nightcore/menu/link/Linked.java | 21 + .../nightcore/menu/link/ViewLink.java | 41 ++ .../nightcore/util/BenchmarkLoop.java | 34 + .../nightcore/util/Colorizer.java | 154 ++++ .../nightexpress/nightcore/util/Colors.java | 29 + .../nightcore/util/CommandUtil.java | 85 +++ .../nightcore/util/EntityUtil.java | 80 +++ .../nightexpress/nightcore/util/FileUtil.java | 91 +++ .../nightcore/util/ItemReplacer.java | 246 +++++++ .../nightexpress/nightcore/util/ItemUtil.java | 331 +++++++++ .../su/nightexpress/nightcore/util/Lists.java | 234 ++++++ .../nightcore/util/LocationUtil.java | 81 +++ .../nightcore/util/NumberUtil.java | 118 +++ .../nightexpress/nightcore/util/PDCUtil.java | 221 ++++++ .../su/nightexpress/nightcore/util/Pair.java | 49 ++ .../nightcore/util/Placeholders.java | 72 ++ .../nightexpress/nightcore/util/Players.java | 282 ++++++++ .../nightexpress/nightcore/util/Plugins.java | 44 ++ .../nightexpress/nightcore/util/RankMap.java | 147 ++++ .../nightexpress/nightcore/util/Reflex.java | 158 ++++ .../nightcore/util/StringUtil.java | 201 ++++++ .../nightexpress/nightcore/util/TimeUtil.java | 80 +++ .../nightcore/util/TriFunction.java | 14 + .../nightexpress/nightcore/util/Version.java | 76 ++ .../util/blocktracker/PlayerBlockTracker.java | 139 ++++ .../util/blocktracker/TrackListener.java | 151 ++++ .../util/blocktracker/TrackUtil.java | 28 + .../util/blocktracker/TrackedChunk.java | 44 ++ .../util/blocktracker/TrackedWorld.java | 62 ++ .../nightcore/util/message/NexComponent.java | 158 ++++ .../nightcore/util/message/NexMessage.java | 230 ++++++ .../nightcore/util/message/NexParser.java | 136 ++++ .../util/placeholder/Placeholder.java | 15 + .../util/placeholder/PlaceholderMap.java | 77 ++ .../nightcore/util/random/MTRandom.java | 111 +++ .../nightcore/util/random/Rnd.java | 101 +++ .../util/regex/MatcherTimeoutException.java | 23 + .../nightcore/util/regex/TimedMatcher.java | 95 +++ .../util/regex/TimeoutCharSequence.java | 39 + .../nightcore/util/text/NightMessage.java | 350 +++++++++ .../nightcore/util/text/WrappedMessage.java | 127 ++++ .../nightcore/util/text/WrappedText.java | 197 +++++ .../text/decoration/ClickEventDecorator.java | 26 + .../util/text/decoration/Decorator.java | 9 + .../util/text/decoration/DecoratorParser.java | 9 + .../util/text/decoration/FontDecorator.java | 18 + .../text/decoration/GradientDecorator.java | 79 ++ .../util/text/decoration/ParsedDecorator.java | 29 + .../text/decoration/ShowItemDecorator.java | 38 + .../text/decoration/ShowTextDecorator.java | 37 + .../nightcore/util/text/tag/StandardTags.java | 27 + .../nightcore/util/text/tag/TagPool.java | 77 ++ .../nightcore/util/text/tag/Tags.java | 42 ++ .../util/text/tag/api/ContentTag.java | 34 + .../util/text/tag/api/DynamicTag.java | 57 ++ .../nightcore/util/text/tag/api/Tag.java | 54 ++ .../util/text/tag/impl/ClickTag.java | 55 ++ .../util/text/tag/impl/ColorTag.java | 47 ++ .../util/text/tag/impl/FontStyleTag.java | 41 ++ .../nightcore/util/text/tag/impl/FontTag.java | 33 + .../util/text/tag/impl/GradientTag.java | 60 ++ .../util/text/tag/impl/HexColorTag.java | 41 ++ .../util/text/tag/impl/HoverTag.java | 79 ++ .../util/text/tag/impl/LineBreakTag.java | 15 + .../util/text/tag/impl/ResetTag.java | 32 + .../nightcore/util/wrapper/UniDouble.java | 55 ++ .../nightcore/util/wrapper/UniInt.java | 50 ++ .../nightcore/util/wrapper/UniParticle.java | 205 ++++++ .../nightcore/util/wrapper/UniPermission.java | 37 + .../nightcore/util/wrapper/UniSound.java | 112 +++ .../nightcore/util/wrapper/UniTask.java | 78 ++ src/main/resources/plugin.yml | 11 + 172 files changed, 15400 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 pom.xml create mode 100644 src/main/java/org/jetbrains/annotations/NotNull.java create mode 100644 src/main/java/org/jetbrains/annotations/Nullable.java create mode 100644 src/main/java/su/nightexpress/nightcore/NightCore.java create mode 100644 src/main/java/su/nightexpress/nightcore/NightCorePlugin.java create mode 100644 src/main/java/su/nightexpress/nightcore/NightDataPlugin.java create mode 100644 src/main/java/su/nightexpress/nightcore/NightPlugin.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/CommandFlag.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/CommandManager.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/CommandResult.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/api/NightCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/api/NightPluginCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/base/HelpSubCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/base/ReloadSubCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/impl/AbstractCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/impl/BaseCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/impl/PluginCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/command/impl/WrappedCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/config/ConfigValue.java create mode 100644 src/main/java/su/nightexpress/nightcore/config/FileConfig.java create mode 100644 src/main/java/su/nightexpress/nightcore/config/PluginDetails.java create mode 100644 src/main/java/su/nightexpress/nightcore/core/CoreConfig.java create mode 100644 src/main/java/su/nightexpress/nightcore/core/CoreLang.java create mode 100644 src/main/java/su/nightexpress/nightcore/core/CoreManager.java create mode 100644 src/main/java/su/nightexpress/nightcore/core/CorePerms.java create mode 100644 src/main/java/su/nightexpress/nightcore/core/command/CheckPermCommand.java create mode 100644 src/main/java/su/nightexpress/nightcore/core/listener/CoreListener.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/AbstractConnector.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/AbstractDataHandler.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/AbstractUser.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/AbstractUserDataHandler.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/AbstractUserManager.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/DataUser.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/DatabaseConfig.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/DatabaseType.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/connection/MySQLConnector.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/connection/SQLiteConnector.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/listener/UserListener.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/serialize/ItemStackSerializer.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/SQLColumn.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/SQLCondition.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/SQLExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/SQLQueries.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/SQLValue.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnFormer.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnType.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/executor/AlterTableExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/executor/CreateTableExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/executor/DeleteQueryExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/executor/InsertQueryExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/executor/RenameTableExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/executor/SelectQueryExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/database/sql/executor/UpdateQueryExecutor.java create mode 100644 src/main/java/su/nightexpress/nightcore/dialog/Dialog.java create mode 100644 src/main/java/su/nightexpress/nightcore/dialog/DialogHandler.java create mode 100644 src/main/java/su/nightexpress/nightcore/dialog/DialogListener.java create mode 100644 src/main/java/su/nightexpress/nightcore/dialog/WrappedInput.java create mode 100644 src/main/java/su/nightexpress/nightcore/integration/VaultHook.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/LangAssets.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/LangManager.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/entry/LangEntry.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/entry/LangItem.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/entry/LangString.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/entry/LangText.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangMessage.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangString.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangText.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOption.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOptions.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/message/LangMessage.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/message/MessageOptions.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/message/OutputType.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/tag/MessageDecorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/tag/MessageTags.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/tag/impl/NoPrefixTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/tag/impl/OutputTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/tag/impl/PlaceholderTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/language/tag/impl/SoundTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/manager/AbstractFileData.java create mode 100644 src/main/java/su/nightexpress/nightcore/manager/AbstractListener.java create mode 100644 src/main/java/su/nightexpress/nightcore/manager/AbstractManager.java create mode 100644 src/main/java/su/nightexpress/nightcore/manager/SimpeListener.java create mode 100644 src/main/java/su/nightexpress/nightcore/manager/SimpleManager.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/MenuListener.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/MenuOptions.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/MenuViewer.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/api/AutoFilled.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/api/Menu.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/click/ClickAction.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/click/ClickResult.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/click/ClickType.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/impl/AbstractMenu.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/impl/ConfigMenu.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/impl/EditorMenu.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/item/ItemHandler.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/item/ItemOptions.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/item/MenuItem.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/link/Linked.java create mode 100644 src/main/java/su/nightexpress/nightcore/menu/link/ViewLink.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/BenchmarkLoop.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Colorizer.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Colors.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/CommandUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/EntityUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/FileUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/ItemReplacer.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/ItemUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Lists.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/LocationUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/NumberUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/PDCUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Pair.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Placeholders.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Players.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Plugins.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/RankMap.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Reflex.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/StringUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/TimeUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/TriFunction.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/Version.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/blocktracker/PlayerBlockTracker.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackListener.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackUtil.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedChunk.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedWorld.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/message/NexComponent.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/message/NexMessage.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/message/NexParser.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/placeholder/Placeholder.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/placeholder/PlaceholderMap.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/random/MTRandom.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/random/Rnd.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/regex/MatcherTimeoutException.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/regex/TimedMatcher.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/regex/TimeoutCharSequence.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/NightMessage.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/WrappedMessage.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/WrappedText.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/ClickEventDecorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/Decorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/DecoratorParser.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/FontDecorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/GradientDecorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/ParsedDecorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowItemDecorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowTextDecorator.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/StandardTags.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/TagPool.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/api/ContentTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/api/DynamicTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/api/Tag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ClickTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ColorTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/GradientTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HoverTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/LineBreakTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ResetTag.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/wrapper/UniDouble.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/wrapper/UniInt.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/wrapper/UniParticle.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/wrapper/UniPermission.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/wrapper/UniSound.java create mode 100644 src/main/java/su/nightexpress/nightcore/util/wrapper/UniTask.java create mode 100644 src/main/resources/plugin.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..76d5773 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/.idea/ +/pom.xml.versionsBackup +/assets/ +/target/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..aae848e --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +Utility Spigot plugin that provides the most common & useful features for plugin development to reduce duplicated code. + +# About +The main purpose of **NexEngine** is to provide abilities for more easier plugin creation and better maintaining. And most importantly, to stay lightweight and well performed. + +**List of Features:** +* Internal command & permission registration (without using plugin.yml). +* **Command API** to create commands with multiple levels of sub-commands and custom flags \[-f\]. +* **Config API** with auto-generated fields and options & custom **FileConfiguration** class with some useful methods. +* **Database API** to store plugin & user data with **SQLite** and **MySQL** support. Including utility classes for building SQL queries, columns and tables. +* **Editor API** to handle player's chat / command input when prompted (used in GUI Editors mostly). +* **Language API** to handle multiple language configs and great message customization (JSON, action bar, titles, sounds, prefix). +* **Manager API** to create "manager" classes and event listeners. +* **Menu API** to create customizable flexible GUIs programatically or from config files. +* **Placeholder API** to create and handle internal placeholders and replace them in plugin texts/messages very fast instead of regular Java `.replace`. +* **Vault Integration** to obtain server's economy & permissions datas. +* **JSON Parser** custom utility to create & parse messages with multiple JSON components, such as: Hover, Run Command, Show Item, etc. +* **Wrappers** a few wrapper classes over Spigot ones for easier creation and usage. +* **Utilities** a lot of classes with different utilities, such as Location, Item, String, File, Number, Player, Time, Array and others. +* **Regex API** custom `CharSequence` implementation to prevent plugin / server stutter of unoptimized regex expressions after specified timeout. +* **Random API** custom random algorhythm with useful methods to roll chances, weights, or just numbers. +* **TriFunction** function class. + +# Performance +**NexEngine**, itself, uses almost no server resources, because there is no events, tasks, GUIs, commands, etc. If you see it in your spark timings near the top, then some plugin that utilizes NexEngine is either bad designed or misuses the API. + +# Paper Version + +Akiranya fork, that allows to use all Paper's features. + +https://github.com/Akiranya/NexEngine-paper diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d10d7d0 --- /dev/null +++ b/pom.xml @@ -0,0 +1,117 @@ + + + 4.0.0 + + su.nightexpress.nightcore + nightcore + 2.5.0 + + + 17 + 17 + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + papermc + https://repo.papermc.io/repository/maven-public/ + + + placeholderapi + https://repo.extendedclip.com/content/repositories/placeholderapi/ + + false + + + + opencollab-snapshot + https://repo.opencollab.dev/maven-snapshots/ + + + minecraft-repo + https://libraries.minecraft.net/ + + + jitpack.io + https://jitpack.io + + + + + + org.spigotmc + spigot-api + 1.20.4-R0.1-SNAPSHOT + + + + com.zaxxer + HikariCP + 5.0.1 + + + com.mojang + authlib + 5.0.47 + + + org.xerial + sqlite-jdbc + 3.41.2.2 + + + it.unimi.dsi + fastutil + 8.5.11 + + + com.github.MilkBowl + VaultAPI + 1.7 + provided + + + me.clip + placeholderapi + 2.10.10 + provided + + + org.geysermc.floodgate + api + 2.2.0-SNAPSHOT + provided + + + + + + + src/main/resources + true + + + + + \ No newline at end of file diff --git a/src/main/java/org/jetbrains/annotations/NotNull.java b/src/main/java/org/jetbrains/annotations/NotNull.java new file mode 100644 index 0000000..6e980e2 --- /dev/null +++ b/src/main/java/org/jetbrains/annotations/NotNull.java @@ -0,0 +1,50 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package org.jetbrains.annotations; + +import java.lang.annotation.*; + +/** + * An element annotated with NotNull claims {@code null} value is + * forbidden to return (for methods), pass to (parameters) and hold + * (local variables and fields). Apart from documentation purposes this + * annotation is intended to be used by static analysis tools to validate + * against probable runtime errors and element contract violations. + * + * @author max + */ +@Documented +@Retention(RetentionPolicy.CLASS) +@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE}) +public @interface NotNull { + + /** + * @return Custom exception message + */ + String value() default ""; + + /** + * @return Custom exception type that should be thrown when not-nullity contract + * is violated. The exception class should have a constructor with one + * String argument (message). + *

+ * By default, {@link IllegalArgumentException} is thrown on null method + * arguments and {@link IllegalStateException} — on null return + * value. + */ + Class exception() default Exception.class; +} diff --git a/src/main/java/org/jetbrains/annotations/Nullable.java b/src/main/java/org/jetbrains/annotations/Nullable.java new file mode 100644 index 0000000..a275e33 --- /dev/null +++ b/src/main/java/org/jetbrains/annotations/Nullable.java @@ -0,0 +1,47 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package org.jetbrains.annotations; + +import java.lang.annotation.*; + +/** + * An element annotated with {@link Nullable} claims {@code null} value is + * perfectly valid to return (for methods), pass to (parameters) or + * hold in (local variables and fields). Apart from documentation purposes this + * annotation is intended to be used by static analysis tools to validate + * against probable runtime errors or element contract violations.
+ * By convention, this annotation applied only when the value should + * always be checked against {@code null} because the developer could + * do nothing to prevent null from happening. Otherwise, too eager + * {@link Nullable} usage could lead to too many false positives from static + * analysis tools.
+ * For example, {@link java.util.Map#get(Object key)} should not be + * annotated {@link Nullable} because someone may have put not-null value in the + * map by this key and is expecting to find this value there ever since.
+ * On the other hand, the {@link java.lang.ref.Reference#get()} should be + * annotated {@link Nullable} because it returns {@code null} if object got + * collected which can happen at any time completely unexpectedly. + * + * @author max + */ +@Documented +@Retention(RetentionPolicy.CLASS) +@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE}) +public @interface Nullable { + + String value() default ""; +} diff --git a/src/main/java/su/nightexpress/nightcore/NightCore.java b/src/main/java/su/nightexpress/nightcore/NightCore.java new file mode 100644 index 0000000..5d4c0a0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/NightCore.java @@ -0,0 +1,73 @@ +package su.nightexpress.nightcore; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.command.base.ReloadSubCommand; +import su.nightexpress.nightcore.config.PluginDetails; +import su.nightexpress.nightcore.core.CoreConfig; +import su.nightexpress.nightcore.core.CoreLang; +import su.nightexpress.nightcore.core.CoreManager; +import su.nightexpress.nightcore.core.CorePerms; +import su.nightexpress.nightcore.core.command.CheckPermCommand; +import su.nightexpress.nightcore.dialog.Dialog; +import su.nightexpress.nightcore.integration.VaultHook; +import su.nightexpress.nightcore.language.LangAssets; +import su.nightexpress.nightcore.menu.impl.EditorMenu; +import su.nightexpress.nightcore.util.Plugins; +import su.nightexpress.nightcore.util.blocktracker.PlayerBlockTracker; + +import java.util.HashSet; +import java.util.Set; + +public class NightCore extends NightPlugin { + + private final Set childrens; + private final CoreManager coreManager; + + public NightCore() { + this.childrens = new HashSet<>(); + this.coreManager = new CoreManager(this); + } + + @Override + public void enable() { + LangAssets.load(); + + if (Plugins.hasVault()) { + VaultHook.setup(); + this.getBaseCommand().addChildren(new CheckPermCommand(this)); + } + this.getBaseCommand().addChildren(new ReloadSubCommand(this, CorePerms.COMMAND_RELOAD)); + + this.coreManager.setup(); + } + + @Override + public void disable() { + this.coreManager.shutdown(); + + Dialog.shutdown(); + if (Plugins.hasVault()) { + VaultHook.shutdown(); + } + PlayerBlockTracker.shutdown(); + } + + @Override + @NotNull + protected PluginDetails getDefaultDetails() { + return PluginDetails.create("nightcore", new String[]{"nightcore", "ncore"}) + .setConfigClass(CoreConfig.class) + .setLangClass(CoreLang.class) + .setPermissionsClass(CorePerms.class); + } + + void addChildren(@NotNull NightCorePlugin child) { + this.childrens.add(child); + child.info("Powered by " + this.getName()); + } + + @NotNull + public Set getChildrens() { + return new HashSet<>(this.childrens); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/NightCorePlugin.java b/src/main/java/su/nightexpress/nightcore/NightCorePlugin.java new file mode 100644 index 0000000..f1fefd3 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/NightCorePlugin.java @@ -0,0 +1,119 @@ +package su.nightexpress.nightcore; + +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginManager; +import org.bukkit.scheduler.BukkitScheduler; +import org.bukkit.scheduler.BukkitTask; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.command.api.NightPluginCommand; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.command.CommandManager; +import su.nightexpress.nightcore.config.PluginDetails; +import su.nightexpress.nightcore.language.LangManager; +import su.nightexpress.nightcore.util.wrapper.UniTask; + +import java.util.function.Consumer; + +public interface NightCorePlugin extends Plugin { + + boolean isEngine(); + + void enable(); + + void disable(); + + void reload(); + + @NotNull NightPluginCommand getBaseCommand(); + + @Override + @NotNull FileConfig getConfig(); + + @NotNull FileConfig getLang(); + + @NotNull PluginDetails getDetails(); + + @NotNull + default String getNameLocalized() { + return this.getDetails().getName(); + } + + @NotNull + default String getPrefix() { + return this.getDetails().getPrefix(); + } + + @NotNull + default String[] getCommandAliases() { + return this.getDetails().getCommandAliases(); + } + + @NotNull + default String getLanguage() { + return this.getDetails().getLanguage(); + } + + default void info(@NotNull String msg) { + this.getLogger().info(msg); + } + + default void warn(@NotNull String msg) { + this.getLogger().warning(msg); + } + + default void error(@NotNull String msg) { + this.getLogger().severe(msg); + } + + default void debug(@NotNull String msg) { + this.info("[DEBUG] " + msg); + } + + @NotNull LangManager getLangManager(); + + @NotNull CommandManager getCommandManager(); + + @NotNull + default BukkitScheduler getScheduler() { + return this.getServer().getScheduler(); + } + + @NotNull + default PluginManager getPluginManager() { + return this.getServer().getPluginManager(); + } + + default void runTask(@NotNull Consumer consumer) { + this.getScheduler().runTask(this, consumer); + } + + default void runTaskAsync(@NotNull Consumer consumer) { + this.getScheduler().runTaskAsynchronously(this, consumer); + } + + default void runTaskLater(@NotNull Consumer consumer, long delay) { + this.getScheduler().runTaskLater(this, consumer, delay); + } + + default void runTaskLaterAsync(@NotNull Consumer consumer, long delay) { + this.getScheduler().runTaskLaterAsynchronously(this, consumer, delay); + } + + default void runTaskTimer(@NotNull Consumer consumer, long delay, long interval) { + this.getScheduler().runTaskTimer(this, consumer, delay, interval); + } + + default void runTaskTimerAsync(@NotNull Consumer consumer, long delay, long interval) { + this.getScheduler().runTaskTimerAsynchronously(this, consumer, delay, interval); + } + + @NotNull + default UniTask createTask(@NotNull Runnable runnable) { + return new UniTask(this, runnable); + } + + @NotNull + default UniTask createAsyncTask(@NotNull Runnable runnable) { + return this.createTask(runnable).setAsync(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/NightDataPlugin.java b/src/main/java/su/nightexpress/nightcore/NightDataPlugin.java new file mode 100644 index 0000000..442ff27 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/NightDataPlugin.java @@ -0,0 +1,31 @@ +package su.nightexpress.nightcore; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.AbstractUserDataHandler; +import su.nightexpress.nightcore.database.AbstractUserManager; +import su.nightexpress.nightcore.database.DataUser; + +public abstract class NightDataPlugin extends NightPlugin /*implements UserDataHolder*/ { + + //protected AbstractUserDataHandler, U> dataHandler; + //protected AbstractUserManager, U> userManager; + + @Override + protected void loadManagers() { + super.loadManagers(); + this.getUserManager().loadOnlineUsers(); + } + + @Override + protected void unloadManagers() { + super.unloadManagers(); + this.getUserManager().shutdown(); + this.getData().shutdown(); + } + + @NotNull + public abstract AbstractUserDataHandler, U> getData(); + + @NotNull + public abstract AbstractUserManager, U> getUserManager(); +} diff --git a/src/main/java/su/nightexpress/nightcore/NightPlugin.java b/src/main/java/su/nightexpress/nightcore/NightPlugin.java new file mode 100644 index 0000000..024f66c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/NightPlugin.java @@ -0,0 +1,180 @@ +package su.nightexpress.nightcore; + +import org.bukkit.event.HandlerList; +import org.bukkit.plugin.java.JavaPlugin; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.command.CommandManager; +import su.nightexpress.nightcore.command.api.NightPluginCommand; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.config.PluginDetails; +import su.nightexpress.nightcore.language.LangManager; +import su.nightexpress.nightcore.menu.api.Menu; +import su.nightexpress.nightcore.menu.impl.AbstractMenu; +import su.nightexpress.nightcore.util.Lists; +import su.nightexpress.nightcore.util.Plugins; +import su.nightexpress.nightcore.util.Reflex; +import su.nightexpress.nightcore.util.Version; +import su.nightexpress.nightcore.util.wrapper.UniPermission; + +import java.util.function.Predicate; + +public abstract class NightPlugin extends JavaPlugin implements NightCorePlugin { + + protected LangManager langManager; + protected CommandManager commandManager; + + protected FileConfig config; + protected PluginDetails details; + private boolean isEngine; + + public final boolean isEngine() { + return this.isEngine; + } + + @Override + public void onEnable() { + long loadTook = System.currentTimeMillis(); + this.isEngine = this instanceof NightCore; + + if (!this.isEngine()) { + Plugins.CORE.addChildren(this); + } + + Version version = Version.getCurrent(); + if (version == Version.UNKNOWN) { + this.warn("=".repeat(35)); + this.warn("WARNING: You're running an unsupported server version!"); + this.warn("Expect bugs and broken features."); + this.warn("=".repeat(35)); + } + else if (version.isDeprecated()) { + this.warn("=".repeat(35)); + this.warn("WARNING: You're running an outdated/deprecated server version (" + Version.getCurrent().getLocalized() + ")!"); + this.warn("Support for this version will be dropped soon."); + this.warn("Please, upgrade your server to at least " + Lists.next(Version.getCurrent(), Predicate.not(Version::isDeprecated)).getLocalized() + "."); + this.warn("=".repeat(35)); + } + + this.loadManagers(); + this.info("Plugin loaded in " + (System.currentTimeMillis() - loadTook) + " ms!"); + } + + @Override + public void onDisable() { + this.unloadManagers(); + } + + public final void reload() { + if (this.isEngine()) { + this.setupConfig(); + this.setupLanguage(); + return; + } + this.unloadManagers(); + this.loadManagers(); + } + + /*@Override + public final void reloadConfig() { + this.getConfig().reload(); + this.loadConfig(); + } + + public final void reloadLang() { + this.getLang().reload(); + this.loadLang(); + }*/ + + @Override + @NotNull + public final FileConfig getConfig() { + return this.config; + } + + @NotNull + public final FileConfig getLang() { + return this.getLangManager().getConfig(); + } + + @NotNull + @Override + public PluginDetails getDetails() { + return this.details == null ? this.getDefaultDetails() : this.details; + } + + @NotNull + protected abstract PluginDetails getDefaultDetails(); + + protected void setupConfig() { + this.config = FileConfig.loadOrExtract(this, "config.yml"); + this.details = PluginDetails.read(this); + + if (this.getDetails().getConfigClass() != null) { + this.getConfig().initializeOptions(this.getDetails().getConfigClass()); + } + } + + protected void setupLanguage() { + this.langManager = new LangManager(this); + this.langManager.setup(); + + if (this.getDetails().getLangClass() != null) { + this.getLangManager().loadEntries(this.getDetails().getLangClass()); + } + } + + protected void setupPermissions() { + Class clazz = this.getDetails().getPermissionsClass(); + if (clazz == null) return; + + Reflex.getFields(clazz, UniPermission.class).forEach(permission -> { + if (this.getPluginManager().getPermission(permission.getName()) == null) { + this.getPluginManager().addPermission(permission); + } + }); + } + + protected void setupCommands() { + this.commandManager = new CommandManager(this); + this.commandManager.setup(); + } + + protected void loadManagers() { + this.setupConfig(); // Load configuration. + this.setupLanguage(); // Load language. + this.setupPermissions(); // Register plugin permissions. + this.setupCommands(); // Register plugin commands. + + this.enable(); // Load the plugin. + + this.getConfig().saveChanges(); + this.getLang().saveChanges(); + } + + protected void unloadManagers() { + this.getScheduler().cancelTasks(this); // Stop all plugin tasks. + + this.disable(); + + HandlerList.unregisterAll(this); // Unregister all plugin listeners. + AbstractMenu.PLAYER_MENUS.values().forEach(Menu::close); // Close all GUIs. + + this.getCommandManager().shutdown(); + this.getLangManager().shutdown(); + } + + @NotNull + public final NightPluginCommand getBaseCommand() { + return this.getCommandManager().getMainCommand(); + } + + @NotNull + public final LangManager getLangManager() { + return this.langManager; + } + + @NotNull + public final CommandManager getCommandManager() { + return this.commandManager; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/CommandFlag.java b/src/main/java/su/nightexpress/nightcore/command/CommandFlag.java new file mode 100644 index 0000000..438c696 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/CommandFlag.java @@ -0,0 +1,74 @@ +package su.nightexpress.nightcore.command; + +import org.bukkit.Bukkit; +import org.bukkit.World; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.NumberUtil; + +import java.util.function.Function; + +public class CommandFlag { + + public static final char PREFIX = '-'; + + private final String name; + private final Function parser; + + public CommandFlag(@NotNull String name, @NotNull Function parser) { + this.name = name; + this.parser = parser; + } + + @NotNull + public static CommandFlag worldFlag(@NotNull String name) { + return new CommandFlag<>(name, Bukkit::getWorld); + } + + @NotNull + public static CommandFlag stringFlag(@NotNull String name) { + return new CommandFlag<>(name, Function.identity()); + } + + @NotNull + public static CommandFlag textFlag(@NotNull String name) { + return new CommandFlag<>(name, Colorizer::apply); + } + + @NotNull + public static CommandFlag intFlag(@NotNull String name) { + return new CommandFlag<>(name, str -> NumberUtil.getAnyInteger(str, 0)); + } + + @NotNull + public static CommandFlag doubleFlag(@NotNull String name) { + return new CommandFlag<>(name, str -> NumberUtil.getAnyDouble(str, 0D)); + } + + @NotNull + public static CommandFlag booleanFlag(@NotNull String name) { + return new CommandFlag<>(name, str -> true); + } + + @NotNull + public String getName() { + return name; + } + + @NotNull + public String getNamePrefixed() { + return PREFIX + this.getName(); + } + + @NotNull + public Function getParser() { + return parser; + } + + @Override + public String toString() { + return "CommandFlag{" + + "name='" + name + '\'' + + '}'; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/CommandManager.java b/src/main/java/su/nightexpress/nightcore/command/CommandManager.java new file mode 100644 index 0000000..981c81f --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/CommandManager.java @@ -0,0 +1,89 @@ +package su.nightexpress.nightcore.command; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.command.api.NightPluginCommand; +import su.nightexpress.nightcore.manager.SimpleManager; +import su.nightexpress.nightcore.command.base.HelpSubCommand; +import su.nightexpress.nightcore.command.impl.BaseCommand; +import su.nightexpress.nightcore.util.CommandUtil; +import su.nightexpress.nightcore.util.Lists; + +import java.util.HashSet; +import java.util.Set; + +public class CommandManager extends SimpleManager { + + private final Set commands; + + private BaseCommand mainCommand; + + public CommandManager(@NotNull NightCorePlugin plugin) { + super(plugin); + this.commands = new HashSet<>(); + } + + @Override + public void onLoad() { + String[] aliases = this.plugin.getCommandAliases(); + if (aliases == null || aliases.length == 0) { + this.plugin.error("Could not register plugin commands!"); + return; + } + + // Create main plugin command and attach help sub-command as a default executor. + this.mainCommand = new BaseCommand(this.plugin); + this.mainCommand.addDefaultCommand(new HelpSubCommand(this.plugin)); + + // Register main command as a bukkit command. + this.registerCommand(this.mainCommand); + } + + @Override + public void onShutdown() { + for (NightPluginCommand command : new HashSet<>(this.getCommands())) { + this.unregisterCommand(command); + command.getChildrens().clear(); + } + this.getCommands().clear(); + } + + @NotNull + public Set getCommands() { + return this.commands; + } + + @NotNull + public BaseCommand getMainCommand() { + return this.mainCommand; + } + + @Nullable + public NightPluginCommand getCommand(@NotNull String alias) { + return this.getCommands().stream() + .filter(command -> Lists.contains(command.getAliases(), alias)) + .findFirst().orElse(null); + } + + public void registerCommand(@NotNull NightPluginCommand command) { + if (this.commands.add(command)) { + CommandUtil.register(this.plugin, command); + } + } + + public boolean unregisterCommand(@NotNull String alias) { + NightPluginCommand command = this.getCommand(alias); + if (command != null) { + return this.unregisterCommand(command); + } + return false; + } + + public boolean unregisterCommand(@NotNull NightPluginCommand command) { + if (this.commands.remove(command)) { + return CommandUtil.unregister(command.getAliases()[0]); + } + return false; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/CommandResult.java b/src/main/java/su/nightexpress/nightcore/command/CommandResult.java new file mode 100644 index 0000000..1ca9a29 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/CommandResult.java @@ -0,0 +1,79 @@ +package su.nightexpress.nightcore.command; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.NumberUtil; + +import java.util.HashMap; +import java.util.Map; + +public class CommandResult { + + private final String label; + private final String[] args; + private final Map, String> flags; + + public CommandResult(@NotNull String label, String[] args, @NotNull Map, StringBuilder> flags) { + this.label = label; + this.flags = new HashMap<>(); + this.args = args; + + flags.forEach((flag, content) -> this.flags.put(flag, content.toString())); + } + + public int length() { + return this.args.length; + } + + @NotNull + public String getArg(int index) { + return this.getArgs()[index]; + } + + @NotNull + public String getArg(int index, @NotNull String def) { + if (index >= this.length()) return def; + + return this.getArgs()[index]; + } + + public int getInt(int index, int def) { + return NumberUtil.getAnyInteger(this.getArg(index, ""), def); + } + + public double getDouble(int index, double def) { + return NumberUtil.getAnyDouble(this.getArg(index, ""), def); + } + + public boolean hasFlag(@NotNull CommandFlag flag) { + return this.getFlags().containsKey(flag); + } + + @Nullable + public T getFlag(@NotNull CommandFlag flag) { + String value = this.getFlags().get(flag); + if (value == null) return null; + + return flag.getParser().apply(value); + } + + @NotNull + public T getFlag(@NotNull CommandFlag flag, @NotNull T def) { + T value = this.getFlag(flag); + return value == null ? def : value; + } + + @NotNull + public String getLabel() { + return label; + } + + public String[] getArgs() { + return args; + } + + @NotNull + public Map, String> getFlags() { + return flags; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/api/NightCommand.java b/src/main/java/su/nightexpress/nightcore/command/api/NightCommand.java new file mode 100644 index 0000000..0fd567d --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/api/NightCommand.java @@ -0,0 +1,99 @@ +package su.nightexpress.nightcore.command.api; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.permissions.Permission; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.command.CommandFlag; +import su.nightexpress.nightcore.language.entry.LangString; +import su.nightexpress.nightcore.language.legacy.LegacyLangString; +import su.nightexpress.nightcore.util.placeholder.Placeholder; + +import java.util.Collection; +import java.util.List; + +public interface NightCommand extends Placeholder { + + @NotNull List getTab(@NotNull Player player, int arg, @NotNull String[] args); + + void execute(@NotNull CommandSender sender, @NotNull String label, @NotNull String[] args); + + void addChildren(@NotNull NightCommand children); + + void removeChildren(@NotNull String alias); + + default boolean hasPermission(@NotNull CommandSender sender) { + return this.getPermission() == null || sender.hasPermission(this.getPermission()); + } + + @NotNull + default String getLabelWithParents() { + StringBuilder builder = new StringBuilder(); + NightCommand parent = this.getParent(); + while (parent != null) { + builder.insert(0, parent.getAliases()[0] + " "); + parent = parent.getParent(); + } + builder.append(this.getAliases()[0]); + return builder.toString(); + } + + @Nullable NightCommand getParent(); + + void setParent(@Nullable NightCommand parent); + + @Nullable NightCommand getChildren(@NotNull String alias); + + @NotNull Collection getChildrens(); + + @NotNull String[] getAliases(); + + @Nullable String getPermission(); + + default void setPermission(@Nullable Permission permission) { + this.setPermission(permission == null ? null : permission.getName()); + } + + void setPermission(@Nullable String permission); + + @Nullable CommandFlag getFlag(@NotNull String name); + + @NotNull Collection> getFlags(); + + default void addFlag(@NotNull CommandFlag... flags) { + for (CommandFlag flag : flags) this.addFlag(flag); + } + + void addFlag(@NotNull CommandFlag flag); + + @NotNull String getUsage(); + + @Deprecated + default void setUsage(@NotNull LegacyLangString string) { + this.setUsage(string.getString()); + } + + default void setUsage(@NotNull LangString string) { + this.setUsage(string.getString()); + } + + void setUsage(@NotNull String usage); + + @NotNull String getDescription(); + + @Deprecated + default void setDescription(@NotNull LegacyLangString string) { + this.setDescription(string.getString()); + } + + default void setDescription(@NotNull LangString string) { + this.setDescription(string.getString()); + } + + void setDescription(@NotNull String description); + + boolean isPlayerOnly(); + + void setPlayerOnly(boolean playerOnly); +} diff --git a/src/main/java/su/nightexpress/nightcore/command/api/NightPluginCommand.java b/src/main/java/su/nightexpress/nightcore/command/api/NightPluginCommand.java new file mode 100644 index 0000000..5be56f6 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/api/NightPluginCommand.java @@ -0,0 +1,19 @@ +package su.nightexpress.nightcore.command.api; + +import org.bukkit.command.Command; +import org.bukkit.command.TabExecutor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface NightPluginCommand extends NightCommand, TabExecutor { + + @Nullable NightCommand getDefaultCommand(); + + void addDefaultCommand(@NotNull NightCommand command); + + Command getBackend(); + + void setBackend(@NotNull Command backend); + + //@NotNull NightCommand findChildren(@NotNull String[] args); +} diff --git a/src/main/java/su/nightexpress/nightcore/command/base/HelpSubCommand.java b/src/main/java/su/nightexpress/nightcore/command/base/HelpSubCommand.java new file mode 100644 index 0000000..3295394 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/base/HelpSubCommand.java @@ -0,0 +1,39 @@ +package su.nightexpress.nightcore.command.base; + +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.command.impl.AbstractCommand; +import su.nightexpress.nightcore.command.CommandResult; +import su.nightexpress.nightcore.command.api.NightCommand; +import su.nightexpress.nightcore.core.CoreLang; +import su.nightexpress.nightcore.util.Placeholders; + +public class HelpSubCommand extends AbstractCommand { + + public HelpSubCommand(@NotNull NightCorePlugin plugin) { + super(plugin, new String[]{"help"}); + this.setDescription(CoreLang.COMMAND_HELP_DESC); + } + + @Override + protected void onExecute(@NotNull CommandSender sender, @NotNull CommandResult result) { + NightCommand parent = this.getParent(); + if (parent == null) return; + + if (!parent.hasPermission(sender)) { + this.errorPermission(sender); + return; + } + + CoreLang.COMMAND_HELP_LIST.getMessage() + .replace(Placeholders.GENERIC_NAME, this.plugin.getNameLocalized()) + .replace(Placeholders.GENERIC_ENTRY, list -> { + parent.getChildrens().forEach(children -> { + if (!children.hasPermission(sender)) return; + + list.add(children.replacePlaceholders().apply(CoreLang.COMMAND_HELP_ENTRY.getString())); + }); + }).send(sender); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/base/ReloadSubCommand.java b/src/main/java/su/nightexpress/nightcore/command/base/ReloadSubCommand.java new file mode 100644 index 0000000..28efb97 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/base/ReloadSubCommand.java @@ -0,0 +1,27 @@ +package su.nightexpress.nightcore.command.base; + +import org.bukkit.command.CommandSender; +import org.bukkit.permissions.Permission; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.command.CommandResult; +import su.nightexpress.nightcore.command.impl.AbstractCommand; +import su.nightexpress.nightcore.core.CoreLang; + +public class ReloadSubCommand extends AbstractCommand { + + public ReloadSubCommand(@NotNull NightCorePlugin plugin, @NotNull Permission permission) { + this(plugin, permission.getName()); + } + + public ReloadSubCommand(@NotNull NightCorePlugin plugin, @NotNull String permission) { + super(plugin, new String[]{"reload"}, permission); + this.setDescription(CoreLang.COMMAND_RELOAD_DESC); + } + + @Override + protected void onExecute(@NotNull CommandSender sender, @NotNull CommandResult result) { + this.plugin.reload(); + CoreLang.COMMAND_RELOAD_DONE.getMessage().send(sender); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/impl/AbstractCommand.java b/src/main/java/su/nightexpress/nightcore/command/impl/AbstractCommand.java new file mode 100644 index 0000000..76e54b0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/impl/AbstractCommand.java @@ -0,0 +1,234 @@ +package su.nightexpress.nightcore.command.impl; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.permissions.Permission; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.command.CommandFlag; +import su.nightexpress.nightcore.command.CommandResult; +import su.nightexpress.nightcore.command.api.NightCommand; +import su.nightexpress.nightcore.core.CoreLang; +import su.nightexpress.nightcore.core.CorePerms; +import su.nightexpress.nightcore.util.Placeholders; +import su.nightexpress.nightcore.util.placeholder.PlaceholderMap; + +import java.util.*; +import java.util.stream.Stream; + +public abstract class AbstractCommand

implements NightCommand { + + protected final P plugin; + private final String[] aliases; + private final Map childrens; + private final Map> commandFlags; + private final PlaceholderMap placeholderMap; + + private NightCommand parent; + private String permission; + private String usage; + private String description; + private boolean playerOnly; + + public AbstractCommand(@NotNull P plugin, @NotNull String[] aliases) { + this(plugin, aliases, (String) null); + } + + public AbstractCommand(@NotNull P plugin, @NotNull String[] aliases, @Nullable Permission permission) { + this(plugin, aliases, permission == null ? null : permission.getName()); + } + + public AbstractCommand(@NotNull P plugin, @NotNull String[] aliases, @Nullable String permission) { + this.plugin = plugin; + this.aliases = Stream.of(aliases).map(String::toLowerCase).toArray(String[]::new); + this.permission = permission; + this.childrens = new TreeMap<>(); + this.commandFlags = new HashMap<>(); + this.placeholderMap = new PlaceholderMap() + .add(Placeholders.COMMAND_DESCRIPTION, this::getDescription) + .add(Placeholders.COMMAND_USAGE, this::getUsage) + .add(Placeholders.COMMAND_LABEL, this::getLabelWithParents); + + } + + @Override + @NotNull + public PlaceholderMap getPlaceholders() { + return this.placeholderMap; + } + + protected abstract void onExecute(@NotNull CommandSender sender, @NotNull CommandResult result); + + @NotNull + public List getTab(@NotNull Player player, int arg, @NotNull String[] args) { + if (player.hasPermission(CorePerms.COMMAND_FLAGS)) { + return this.getFlags().stream().map(CommandFlag::getNamePrefixed).toList(); + } + return Collections.emptyList(); + } + + @Override + public final void execute(@NotNull CommandSender sender, @NotNull String label, @NotNull String[] args) { + if (this.isPlayerOnly() && !(sender instanceof Player)) { + this.errorSender(sender); + return; + } + if (!this.hasPermission(sender)) { + this.errorPermission(sender); + return; + } + + List cleanArgs = new ArrayList<>(); + Map, StringBuilder> flagContent = new HashMap<>(); + CommandFlag lastFlag = null; + + for (String arg : args) { + CommandFlag found = arg.charAt(0) == CommandFlag.PREFIX ? this.getFlag(arg.substring(1)) : null; + + if (found != null) { + flagContent.put(found, new StringBuilder()); + lastFlag = found; + } + else if (lastFlag != null) { + StringBuilder builder = flagContent.get(lastFlag); + if (!builder.isEmpty()) builder.append(" "); + + builder.append(arg); + } + else { + cleanArgs.add(arg); + } + } + if (!sender.hasPermission(CorePerms.COMMAND_FLAGS)) { + flagContent.clear(); + } + + CommandResult result = new CommandResult(label, cleanArgs.toArray(new String[0]), flagContent); + + this.onExecute(sender, result); + } + + public final void addChildren(@NotNull NightCommand children) { + if (children.getParent() != null) return; + + Stream.of(children.getAliases()).forEach(alias -> { + this.childrens.put(alias, children); + }); + children.setParent(this); + } + + @Override + public final void removeChildren(@NotNull String alias) { + this.childrens.keySet().removeIf(key -> key.equalsIgnoreCase(alias)); + } + + @Override + @Nullable + public NightCommand getParent() { + return parent; + } + + @Override + public void setParent(@Nullable NightCommand parent) { + this.parent = parent; + } + + @Override + @Nullable + public final NightCommand getChildren(@NotNull String alias) { + return this.childrens.get(alias); + } + + @Override + @NotNull + public Collection getChildrens() { + return new HashSet<>(this.childrens.values()); + } + + @Override + @NotNull + public final String[] getAliases() { + return this.aliases; + } + + @Override + @Nullable + public final String getPermission() { + return this.permission; + } + + @Override + public void setPermission(@Nullable String permission) { + this.permission = permission; + } + + @Override + @Nullable + public CommandFlag getFlag(@NotNull String name) { + return this.commandFlags.get(name.toLowerCase()); + } + + @Override + public void addFlag(@NotNull CommandFlag flag) { + this.commandFlags.put(flag.getName(), flag); + } + + @Override + @NotNull + public Collection> getFlags() { + return this.commandFlags.values(); + } + + @Override + @NotNull + public String getUsage() { + return this.usage == null ? "" : this.usage; + } + + @Override + public void setUsage(@NotNull String usage) { + this.usage = usage; + } + + @Override + @NotNull + public String getDescription() { + return this.description == null ? "" : this.description; + } + + @Override + public void setDescription(@NotNull String description) { + this.description = description; + } + + @Override + public boolean isPlayerOnly() { + return this.playerOnly; + } + + @Override + public void setPlayerOnly(boolean playerOnly) { + this.playerOnly = playerOnly; + } + + protected final void errorUsage(@NotNull CommandSender sender) { + CoreLang.ERROR_COMMAND_USAGE.getMessage().replace(this.replacePlaceholders()).send(sender); + } + + protected final void errorPermission(@NotNull CommandSender sender) { + CoreLang.ERROR_NO_PERMISSION.getMessage().send(sender); + } + + protected final void errorPlayer(@NotNull CommandSender sender) { + CoreLang.ERROR_INVALID_PLAYER.getMessage().send(sender); + } + + protected final void errorSender(@NotNull CommandSender sender) { + CoreLang.ERROR_COMMAND_PLAYER_ONLY.getMessage().send(sender); + } + + protected final void errorNumber(@NotNull CommandSender sender, @NotNull String from) { + CoreLang.ERROR_INVALID_NUMBER.getMessage().replace(Placeholders.GENERIC_VALUE, from).send(sender); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/impl/BaseCommand.java b/src/main/java/su/nightexpress/nightcore/command/impl/BaseCommand.java new file mode 100644 index 0000000..131ecb7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/impl/BaseCommand.java @@ -0,0 +1,18 @@ +package su.nightexpress.nightcore.command.impl; + +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.command.CommandResult; + +public class BaseCommand extends PluginCommand { + + public BaseCommand(@NotNull NightCorePlugin plugin) { + super(plugin, plugin.getCommandAliases()); + } + + @Override + protected void onExecute(@NotNull CommandSender sender, @NotNull CommandResult result) { + + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/impl/PluginCommand.java b/src/main/java/su/nightexpress/nightcore/command/impl/PluginCommand.java new file mode 100644 index 0000000..f398403 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/impl/PluginCommand.java @@ -0,0 +1,116 @@ +package su.nightexpress.nightcore.command.impl; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.permissions.Permission; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.command.api.NightCommand; +import su.nightexpress.nightcore.command.api.NightPluginCommand; +import su.nightexpress.nightcore.util.Lists; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public abstract class PluginCommand

extends AbstractCommand

implements NightPluginCommand { + + private Command backend; + private NightCommand defaultCommand; + + public PluginCommand(@NotNull P plugin, @NotNull String[] aliases) { + this(plugin, aliases, (String) null); + } + + public PluginCommand(@NotNull P plugin, @NotNull String[] aliases, @Nullable Permission permission) { + super(plugin, aliases, permission); + } + + public PluginCommand(@NotNull P plugin, @NotNull String[] aliases, @Nullable String permission) { + super(plugin, aliases, permission); + } + + @Override + public void addDefaultCommand(@NotNull NightCommand command) { + this.addChildren(command); + this.defaultCommand = command; + } + + @Override + @Nullable + public NightCommand getDefaultCommand() { + return defaultCommand; + } + + @Override + public Command getBackend() { + return backend; + } + + @Override + public void setBackend(@NotNull Command backend) { + this.backend = backend; + } + + //@Override + @NotNull + private NightCommand findChildren(@NotNull String[] args) { + NightCommand command = this;//.defaultCommand; + int childCount = 0; + while (args.length > childCount) { + NightCommand child = command.getChildren(args[childCount++]); + if (child == null) break; + + command = child; + } + return command; + } + + /*private int countChildren(@NotNull String[] args) { + AbstractCommand

command = this; + int childCount = 0; + while (args.length > childCount) { + AbstractCommand

child = command.getChildren(args[childCount]); + if (child == null) break; + + command = child; + childCount++; + } + return childCount; + }*/ + + @Override + public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, String[] args) { + NightCommand command = this.findChildren(args); + if (command instanceof NightPluginCommand pluginCommand) { + if (pluginCommand.getDefaultCommand() != null) { + command = pluginCommand.getDefaultCommand(); + } + } + command.execute(sender, label, args); + return true; + } + + @Override + public List onTabComplete(@NotNull CommandSender sender, @NotNull Command cmd, + @NotNull String label, String[] args) { + + if (!(sender instanceof Player player) || args.length == 0) return Collections.emptyList(); + + NightCommand command = this.findChildren(args); + if (!command.hasPermission(sender)) return Collections.emptyList(); + + List list = new ArrayList<>(); + if (!command.getChildrens().isEmpty()) { + command.getChildrens().stream().filter(child -> child.hasPermission(sender)) + .forEach(child -> list.addAll(Arrays.asList(child.getAliases()))); + } + else { + list.addAll(command.getTab(player, command.equals(this) ? (args.length) : (args.length - 1), args)); + } + return Lists.getSequentialMatches(list, args[args.length - 1]); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/command/impl/WrappedCommand.java b/src/main/java/su/nightexpress/nightcore/command/impl/WrappedCommand.java new file mode 100644 index 0000000..fdebde0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/command/impl/WrappedCommand.java @@ -0,0 +1,52 @@ +package su.nightexpress.nightcore.command.impl; + +import org.bukkit.command.*; +import org.bukkit.plugin.Plugin; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.command.api.NightPluginCommand; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class WrappedCommand extends Command implements PluginIdentifiableCommand { + + protected final Plugin plugin; + protected final CommandExecutor executor; + protected final TabCompleter tabCompleter; + + public WrappedCommand(@NotNull Plugin plugin, @NotNull NightPluginCommand command) { + this(plugin, command, command, command.getAliases(), command.getDescription(), command.getUsage()); + this.setPermission(command.getPermission()); + } + + public WrappedCommand(@NotNull Plugin plugin, + @NotNull CommandExecutor executor, + @NotNull TabCompleter tabCompleter, + @NotNull String[] aliases, + @NotNull String description, + @NotNull String usage) { + super(aliases[0], description, usage, Arrays.asList(aliases)); + this.plugin = plugin; + this.executor = executor; + this.tabCompleter = tabCompleter; + } + + @Override + @NotNull + public Plugin getPlugin() { + return this.plugin; + } + + @Override + public boolean execute(@NotNull CommandSender sender, @NotNull String label, @NotNull String[] args) { + return this.executor.onCommand(sender, this, label, args); + } + + @Override + @NotNull + public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) { + List list = this.tabCompleter.onTabComplete(sender, this, alias, args); + return list == null ? Collections.emptyList() : list; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/config/ConfigValue.java b/src/main/java/su/nightexpress/nightcore/config/ConfigValue.java new file mode 100644 index 0000000..7b509bd --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/config/ConfigValue.java @@ -0,0 +1,301 @@ +package su.nightexpress.nightcore.config; + +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.TriFunction; +import su.nightexpress.nightcore.util.wrapper.UniParticle; +import su.nightexpress.nightcore.util.wrapper.UniSound; + +import java.util.*; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public class ConfigValue { + + private final String path; + private final T defaultValue; + private final String[] description; + private final Reader reader; + private final Writer writer; + + private T value; + + public ConfigValue(@NotNull String path, + @NotNull Reader reader, + @NotNull Writer writer, + @NotNull T defaultValue, + @Nullable String... description) { + this.path = path; + this.description = description == null ? new String[0] : description; + this.reader = reader; + this.writer = writer; + this.defaultValue = defaultValue; + } + + @NotNull + public static ConfigValue create(@NotNull String path, + @NotNull Reader reader, + @NotNull Writer writer, + @NotNull T defaultValue, + @Nullable String... description) { + return new ConfigValue<>(path, reader, writer, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, + @NotNull Reader reader, + @NotNull Writer writer, + + @NotNull Supplier defaultValue, + @Nullable String... description) { + return create(path, reader, writer, defaultValue.get(), description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, @NotNull Reader reader, @NotNull T defaultValue, @Nullable String... description) { + return create(path, reader, FileConfig::set, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, @NotNull Reader reader, @NotNull Supplier defaultValue, @Nullable String... description) { + return create(path, reader, FileConfig::set, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, boolean defaultValue, @Nullable String... description) { + return create(path, FileConfig::getBoolean, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, int defaultValue, @Nullable String... description) { + return create(path, FileConfig::getInt, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, int[] defaultValue, @Nullable String... description) { + return create(path, FileConfig::getIntArray, FileConfig::setIntArray, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, double defaultValue, @Nullable String... description) { + return create(path, FileConfig::getDouble, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, long defaultValue, @Nullable String... description) { + return create(path, FileConfig::getLong, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, @NotNull String defaultValue, @Nullable String... description) { + return create(path, FileConfig::getString, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, @NotNull String[] defaultValue, @Nullable String... description) { + return create(path, FileConfig::getStringArray, FileConfig::setStringArray, defaultValue, description); + } + + @NotNull + public static ConfigValue> create(@NotNull String path, @NotNull List defaultValue, @Nullable String... description) { + return create(path, (cfg, path1, def) -> cfg.getStringList(path1), defaultValue, description); + } + + @NotNull + public static ConfigValue> create(@NotNull String path, @NotNull Set defaultValue, @Nullable String... description) { + return create(path, (cfg, path1, def) -> cfg.getStringSet(path1), defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, @NotNull ItemStack defaultValue, @Nullable String... description) { + return create(path, FileConfig::getItem, FileConfig::setItem, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, @NotNull UniSound defaultValue, @Nullable String... description) { + Reader reader = (cfg, path1, def) -> UniSound.read(cfg, path1); + Writer writer = (cfg, path1, obj) -> obj.write(cfg, path1); + + return create(path, reader, writer, defaultValue, description); + } + + @NotNull + public static ConfigValue create(@NotNull String path, @NotNull UniParticle defaultValue, @Nullable String... description) { + Reader reader = (cfg, path1, def) -> UniParticle.read(cfg, path1); + Writer writer = (cfg, path1, obj) -> obj.write(cfg, path1); + + return create(path, reader, writer, defaultValue, description); + } + + @NotNull + public static > ConfigValue create(@NotNull String path, @NotNull Class clazz, @NotNull E defaultValue, @Nullable String... description) { + Reader reader = (cfg, path1, def) -> cfg.getEnum(path1, clazz, def); + Writer writer = (cfg, path1, obj) -> cfg.set(path1, obj.name()); + + return create(path, reader, writer, defaultValue, description); + } + + @NotNull + public static ConfigValue> forSet(@NotNull String path, + @NotNull Function reader, + @NotNull Writer> writer, + @NotNull Supplier> defaultValue, + @Nullable String... description) { + return forSet(path, reader, writer, defaultValue.get(), description); + } + + @NotNull + public static ConfigValue> forSet(@NotNull String path, + @NotNull Function valFun, + @NotNull Writer> writer, + @NotNull Set defaultValue, + @Nullable String... description) { + + Reader> reader = (cfg, path1, def) -> cfg.getStringSet(path1).stream().map(valFun).filter(Objects::nonNull).collect(Collectors.toCollection(HashSet::new)); + + return create(path, reader, writer, defaultValue, description); + } + + @NotNull + public static ConfigValue> forMap(@NotNull String path, + @NotNull Function keyFun, + @NotNull TriFunction valFun, + @NotNull Writer> writer, + @NotNull Supplier> defaultValue, + @Nullable String... description) { + return forMap(path, keyFun, valFun, writer, defaultValue.get(), description); + } + + @NotNull + public static ConfigValue> forMap(@NotNull String path, + @NotNull Function keyFun, + @NotNull TriFunction valFun, + @NotNull Writer> writer, + @NotNull Map defaultValue, + @Nullable String... description) { + return forMap(path, keyFun, valFun, HashMap::new, writer, defaultValue, description); + } + + @NotNull + public static ConfigValue> forTreeMap(@NotNull String path, + @NotNull Function keyFun, + @NotNull TriFunction valFun, + @NotNull Writer> writer, + @NotNull Supplier> defaultValue, @Nullable String... description) { + return forTreeMap(path, keyFun, valFun, writer, defaultValue.get(), description); + } + + @NotNull + public static ConfigValue> forTreeMap(@NotNull String path, + @NotNull Function keyFun, + @NotNull TriFunction valFun, + @NotNull Writer> writer, + @NotNull TreeMap defaultValue, @Nullable String... description) { + return forMap(path, keyFun, valFun, TreeMap::new, writer, defaultValue, description); + } + + @NotNull + public static > ConfigValue forMap(@NotNull String path, + @NotNull Function keyFun, + @NotNull TriFunction valFun, + @NotNull Supplier mapSupplier, + @NotNull Writer writer, + @NotNull M defaultValue, @Nullable String... description) { + Reader reader = (cfg, path1, def) -> { + M map = mapSupplier.get(); + for (String id : cfg.getSection(path1)) { + K key = keyFun.apply(id); + V val = valFun.apply(cfg, path1, id); + if (key == null || val == null) continue; + + map.put(key, val); + } + return map; + }; + + return create(path, reader, writer, defaultValue, description); + } + + @NotNull + public static ConfigValue> forMap(@NotNull String path, + @NotNull TriFunction function, + @NotNull Writer> writer, + @NotNull Supplier> defaultValue, + @Nullable String... description) { + return forMap(path, String::toLowerCase, function, writer, defaultValue.get(), description); + } + + @NotNull + public static ConfigValue> forMap(@NotNull String path, + @NotNull TriFunction function, + @NotNull Writer> writer, + @NotNull Map defaultValue, + @Nullable String... description) { + return forMap(path, String::toLowerCase, function, writer, defaultValue, description); + } + + @NotNull + public T read(@NotNull FileConfig cfg) { + if (!cfg.contains(this.getPath())) { + this.write(cfg); + } + if (this.getDescription().length > 0 && !this.getDescription()[0].isEmpty()) { + cfg.setComments(this.getPath(), this.getDescription()); + } + return (this.value = this.reader.read(cfg, this.getPath(), this.getDefaultValue())); + } + + public void write(@NotNull FileConfig cfg) { + this.getWriter().write(cfg, this.getPath(), this.get()); + } + + public boolean remove(@NotNull FileConfig cfg) { + return cfg.remove(this.getPath()); + } + + @NotNull + public T get() { + return this.value == null ? this.getDefaultValue() : this.value; + } + + public void set(@NotNull T value) { + this.value = value; + } + + @NotNull + public String getPath() { + return path; + } + + @NotNull + public String[] getDescription() { + return description; + } + + @NotNull + public T getDefaultValue() { + return defaultValue; + } + + @NotNull + public Reader getReader() { + return reader; + } + + @NotNull + public Writer getWriter() { + return writer; + } + + public interface Reader { + + @NotNull T read(@NotNull FileConfig cfg, @NotNull String path, @NotNull T def); + } + + public interface Writer { + + void write(@NotNull FileConfig cfg, @NotNull String path, @NotNull T obj); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/config/FileConfig.java b/src/main/java/su/nightexpress/nightcore/config/FileConfig.java new file mode 100644 index 0000000..a026eaa --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/config/FileConfig.java @@ -0,0 +1,441 @@ +package su.nightexpress.nightcore.config; + +import org.bukkit.*; +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemFlag; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.Damageable; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.LeatherArmorMeta; +import org.bukkit.inventory.meta.PotionMeta; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Version; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.util.*; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; +import java.util.stream.IntStream; + +public class FileConfig extends YamlConfiguration { + + private final File file; + private boolean isChanged = false; + + public FileConfig(@NotNull String path, @NotNull String file) { + this(new File(path, file)); + } + + public FileConfig(@NotNull File file) { + this.options().width(512); + + FileUtil.create(file); + this.file = file; + this.reload(); + } + + @NotNull + public static FileConfig loadOrExtract(@NotNull NightCorePlugin plugin, @NotNull String path, @NotNull String file) { + if (!path.endsWith("/")) { + path += "/"; + } + return loadOrExtract(plugin, path + file); + } + + @NotNull + public static FileConfig loadOrExtract(@NotNull NightCorePlugin plugin, @NotNull String filePath) { + if (!filePath.startsWith("/")) { + filePath = "/" + filePath; + } + + File file = new File(plugin.getDataFolder() + filePath); + if (FileUtil.create(file)) { + try { + InputStream input = plugin.getClass().getResourceAsStream(filePath); + if (input != null) FileUtil.copy(input, file); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + return new FileConfig(file); + } + + @NotNull + public static List loadAll(@NotNull String path) { + return loadAll(path, false); + } + + @NotNull + public static List loadAll(@NotNull String path, boolean deep) { + return FileUtil.getFiles(path, deep).stream().filter(file -> file.getName().endsWith(".yml")).map(FileConfig::new).toList(); + } + + public void initializeOptions(@NotNull Class clazz) { + initializeOptions(clazz, this); + } + + public static void initializeOptions(@NotNull Class clazz, @NotNull FileConfig cfg) { + for (ConfigValue value : Reflex.getFields(clazz, ConfigValue.class)) { + value.read(cfg); + } + cfg.saveChanges(); + } + + @NotNull + public File getFile() { + return this.file; + } + + public void save() { + try { + this.save(this.file); + } + catch (IOException exception) { + exception.printStackTrace(); + } + } + + public boolean saveChanges() { + if (!this.isChanged) return false; + + this.save(); + this.isChanged = false; + return true; + } + + public boolean reload() { + try { + this.load(this.file); + this.isChanged = false; + return true; + } + catch (IOException | InvalidConfigurationException exception) { + exception.printStackTrace(); + } + return false; + } + + public boolean addMissing(@NotNull String path, @Nullable Object val) { + if (this.contains(path)) return false; + this.set(path, val); + return true; + } + + @Override + public void set(@NotNull String path, @Nullable Object value) { + if (value instanceof String str) { + value = Colorizer.plain(str); + } + else if (value instanceof Collection collection) { + List list = new ArrayList<>(collection); + list.replaceAll(obj -> obj instanceof String str ? Colorizer.plain(str) : obj); + value = list; + } + else if (value instanceof Location location) { + value = LocationUtil.serialize(location); + } + else if (value instanceof Enum en) { + value = en.name(); + } + super.set(path, value); + this.isChanged = true; + } + + public void setComments(@NotNull String path, @Nullable String... comments) { + this.setComments(path, Arrays.asList(comments)); + } + + public void setInlineComments(@NotNull String path, @Nullable String... comments) { + this.setInlineComments(path, Arrays.asList(comments)); + } + + @Override + public void setComments(@NotNull String path, @Nullable List comments) { + if (this.getComments(path).equals(comments)) return; + + super.setComments(path, comments); + this.isChanged = true; + } + + @Override + public void setInlineComments(@NotNull String path, @Nullable List comments) { + super.setInlineComments(path, comments); + } + + public boolean remove(@NotNull String path) { + if (!this.contains(path)) return false; + this.set(path, null); + return true; + } + + @NotNull + public Set getSection(@NotNull String path) { + ConfigurationSection section = this.getConfigurationSection(path); + return section == null ? Collections.emptySet() : section.getKeys(false); + } + + @Override + @Nullable + public String getString(@NotNull String path) { + String str = super.getString(path); + return str == null || str.isEmpty() ? null : str; + } + + @Override + @NotNull + public String getString(@NotNull String path, @Nullable String def) { + String str = super.getString(path, def); + return str == null ? "" : str; + } + + @NotNull + public Set getStringSet(@NotNull String path) { + return new HashSet<>(this.getStringList(path)); + } + + @Override + @Nullable + public Location getLocation(@NotNull String path) { + String raw = this.getString(path); + return raw == null ? null : LocationUtil.deserialize(raw); + } + + public int[] getIntArray(@NotNull String path) { + return getIntArray(path, new int[0]); + } + + public int[] getIntArray(@NotNull String path, int[] def) { + String str = this.getString(path); + return str == null ? def : NumberUtil.getIntArray(str); + } + + public void setIntArray(@NotNull String path, int[] arr) { + if (arr == null) { + this.set(path, null); + return; + } + this.set(path, String.join(",", IntStream.of(arr).boxed().map(String::valueOf).toList())); + } + + @NotNull + public String @NotNull [] getStringArray(@NotNull String path, @NotNull String[] def) { + String str = this.getString(path); + return str == null ? def : str.split(","); + } + + public void setStringArray(@NotNull String path, String[] arr) { + if (arr == null) { + this.set(path, null); + return; + } + this.set(path, String.join(",", arr)); + } + + @Nullable + public > T getEnum(@NotNull String path, @NotNull Class clazz) { + return StringUtil.getEnum(this.getString(path), clazz).orElse(null); + } + + @NotNull + public > T getEnum(@NotNull String path, @NotNull Class clazz, @NotNull T def) { + return StringUtil.getEnum(this.getString(path), clazz).orElse(def); + } + + @NotNull + public > List getEnumList(@NotNull String path, @NotNull Class clazz) { + return this.getStringSet(path).stream().map(str -> StringUtil.getEnum(str, clazz).orElse(null)) + .filter(Objects::nonNull).toList(); + } + + /*@NotNull + public Set getFireworkEffects(@NotNull String path) { + Set effects = new HashSet<>(); + for (String sId : this.getSection(path)) { + String path2 = path + "." + sId + "."; + FireworkEffect.Type type = this.getEnum(path2 + "Type", FireworkEffect.Type.class); + if (type == null) continue; + + boolean flicker = this.getBoolean(path2 + "Flicker"); + boolean trail = this.getBoolean(path2 + "Trail"); + + Set colors = new HashSet<>(); + for (String colorRaw : this.getStringList(path2 + "Colors")) { + colors.add(StringUtil.parseColor(colorRaw)); + } + + Set fadeColors = new HashSet<>(); + for (String colorRaw : this.getStringList(path2 + "Fade_Colors")) { + fadeColors.add(StringUtil.parseColor(colorRaw)); + } + + FireworkEffect.Builder builder = FireworkEffect.builder() + .with(type).flicker(flicker).trail(trail).withColor(colors).withFade(fadeColors); + effects.add(builder.build()); + } + + return effects; + }*/ + + @NotNull + public ItemStack getItem(@NotNull String path, @Nullable ItemStack def) { + ItemStack item = this.getItem(path); + return item.getType().isAir() && def != null ? def : item; + } + + @NotNull + public ItemStack getItem(@NotNull String path) { + if (!path.isEmpty() && !path.endsWith(".")) path = path + "."; + + Material material = Material.getMaterial(this.getString(path + "Material", "").toUpperCase()); + if (material == null || material == Material.AIR) return new ItemStack(Material.AIR); + + ItemStack item = new ItemStack(material); + item.setAmount(this.getInt(path + "Amount", 1)); + + String headSkin = this.getString(path + "SkinURL", ""); + if (!headSkin.isEmpty()) { + ItemUtil.setHeadSkin(item, headSkin); + } + else { + String headTexture = this.getString(path + "Head_Texture", ""); + if (!headTexture.isEmpty()) { + ItemUtil.setSkullTexture(item, headTexture); + } + } + + ItemMeta meta = item.getItemMeta(); + if (meta == null) return item; + + int durability = this.getInt(path + "Durability"); + if (durability > 0 && meta instanceof Damageable damageable) { + damageable.setDamage(durability); + } + + String name = this.getString(path + "Name"); + meta.setDisplayName(name != null ? Colorizer.apply(name) : null); + meta.setLore(Colorizer.apply(this.getStringList(path + "Lore"))); + + for (String sKey : this.getSection(path + "Enchants")) { + Enchantment enchantment; + NamespacedKey key = NamespacedKey.minecraft(sKey.toLowerCase()); + + if (Version.isAtLeast(Version.V1_19_R3)) { + enchantment = Registry.ENCHANTMENT.get(key); + } + else { + enchantment = Enchantment.getByKey(key); + } + if (enchantment == null) continue; + + int eLvl = this.getInt(path + "Enchants." + sKey); + if (eLvl <= 0) continue; + + meta.addEnchant(enchantment, eLvl, true); + } + + int model = this.getInt(path + "Custom_Model_Data"); + meta.setCustomModelData(model != 0 ? model : null); + + List flags = this.getStringList(path + "Item_Flags"); + if (flags.contains(Placeholders.WILDCARD)) { + meta.addItemFlags(ItemFlag.values()); + } + else { + flags.stream().map(str -> StringUtil.getEnum(str, ItemFlag.class).orElse(null)).filter(Objects::nonNull).forEach(meta::addItemFlags); + } + + String colorRaw = this.getString(path + "Color"); + if (colorRaw != null && !colorRaw.isEmpty()) { + Color color = StringUtil.getColor(colorRaw); + if (meta instanceof LeatherArmorMeta armorMeta) { + armorMeta.setColor(color); + } + else if (meta instanceof PotionMeta potionMeta) { + potionMeta.setColor(color); + } + } + + meta.setUnbreakable(this.getBoolean(path + "Unbreakable")); + item.setItemMeta(meta); + + return item; + } + + public void setItem(@NotNull String path, @Nullable ItemStack item) { + if (item == null) { + this.set(path, null); + return; + } + + if (!path.endsWith(".")) path = path + "."; + this.set(path.substring(0, path.length() - 1), null); + + Material material = item.getType(); + this.set(path + "Material", material.name()); + this.set(path + "Amount", item.getAmount() <= 1 ? null : item.getAmount()); + this.set(path + "SkinURL", ItemUtil.getHeadSkin(item)); + if (!this.contains(path + "SkinURL")) { + this.set(path + "Head_Texture", ItemUtil.getSkullTexture(item)); + } + + ItemMeta meta = item.getItemMeta(); + if (meta == null) return; + + if (meta instanceof Damageable damageable) { + this.set(path + "Durability", damageable.getDamage() <= 0 ? null : damageable.getDamage()); + } + + this.set(path + "Name", meta.getDisplayName().isEmpty() ? null : meta.getDisplayName()); + this.set(path + "Lore", meta.getLore()); + + for (Map.Entry entry : meta.getEnchants().entrySet()) { + this.set(path + "Enchants." + entry.getKey().getKey().getKey(), entry.getValue()); + } + this.set(path + "Custom_Model_Data", meta.hasCustomModelData() ? meta.getCustomModelData() : null); + + Color color = null; + String colorRaw = null; + if (meta instanceof PotionMeta potionMeta) { + color = potionMeta.getColor(); + } + else if (meta instanceof LeatherArmorMeta armorMeta) { + color = armorMeta.getColor(); + } + if (color != null) { + colorRaw = color.getRed() + "," + color.getGreen() + "," + color.getBlue(); + } + this.set(path + "Color", colorRaw); + + List itemFlags = new ArrayList<>(meta.getItemFlags().stream().map(ItemFlag::name).toList()); + this.set(path + "Item_Flags", itemFlags.isEmpty() ? null : itemFlags); + this.set(path + "Unbreakable", meta.isUnbreakable() ? true : null); + } + + @Nullable + public ItemStack getItemEncoded(@NotNull String path) { + String compressed = this.getString(path); + if (compressed == null) return null; + + return ItemUtil.decompress(compressed); + } + + public void setItemEncoded(@NotNull String path, @Nullable ItemStack item) { + this.set(path, item == null ? null : ItemUtil.compress(item)); + } + + @NotNull + public ItemStack[] getItemsEncoded(@NotNull String path) { + return ItemUtil.decompress(this.getStringList(path)); + } + + public void setItemsEncoded(@NotNull String path, @NotNull List item) { + this.set(path, ItemUtil.compress(item)); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/config/PluginDetails.java b/src/main/java/su/nightexpress/nightcore/config/PluginDetails.java new file mode 100644 index 0000000..2a429a0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/config/PluginDetails.java @@ -0,0 +1,122 @@ +package su.nightexpress.nightcore.config; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.language.LangManager; +import su.nightexpress.nightcore.util.text.tag.Tags; + +import java.util.Locale; + +public class PluginDetails { + + private final String name; + private final String prefix; + private final String[] commandAliases; + private final String language; + + private Class configClass; + private Class langClass; + private Class permissionsClass; + + public PluginDetails( + @NotNull String name, + @NotNull String prefix, + @NotNull String[] commandAliases, + @NotNull String language + ) { + this.name = name; + this.prefix = prefix; + this.commandAliases = commandAliases; + this.language = language.toLowerCase(); + } + + @NotNull + public static PluginDetails create(@NotNull String name, @NotNull String[] commandAliases) { + String prefix = Tags.YELLOW.enclose(name) + Tags.DARK_GRAY.enclose(" » ") + Tags.GRAY.getFullName(); + String language = Locale.getDefault().getLanguage(); + + return new PluginDetails(name, prefix, commandAliases, language); + } + + @NotNull + public static PluginDetails read(@NotNull NightCorePlugin plugin) { + FileConfig config = plugin.getConfig(); + PluginDetails defaults = plugin.getDetails(); + + String pluginName = ConfigValue.create("Plugin.Name", defaults.getName(), + "Localized plugin name. It's used in messages and with internal placeholders.") + .read(config); + + String pluginPrefix = ConfigValue.create("Plugin.Prefix", defaults.getPrefix(), + "Plugin prefix. Used in messages." + ).read(config); + + String[] commandAliases = ConfigValue.create("Plugin.Command_Aliases", defaults.getCommandAliases(), + "Command names that will be registered as main plugin commands.", + "Do not leave this empty. Split multiple names with a comma.") + .read(config); + + String languageCode = ConfigValue.create("Plugin.Language", defaults.getLanguage(), + "Sets the plugin language.", + "Basically it tells the plugin to use certain messages config from the '" + LangManager.DIR_LANG + "' sub-folder.", + "If specified language is not available, default one (English) will be used instead.", + "[Default is System Locale]") + .read(config); + + return new PluginDetails(pluginName, pluginPrefix, commandAliases, languageCode) + .setConfigClass(defaults.getConfigClass()) + .setLangClass(defaults.getLangClass()) + .setPermissionsClass(defaults.getPermissionsClass()); + } + + @NotNull + public String getName() { + return name; + } + + @NotNull + public String getPrefix() { + return prefix; + } + + @NotNull + public String[] getCommandAliases() { + return commandAliases; + } + + @NotNull + public String getLanguage() { + return language; + } + + @Nullable + public Class getConfigClass() { + return configClass; + } + + public PluginDetails setConfigClass(@Nullable Class configClass) { + this.configClass = configClass; + return this; + } + + @Nullable + public Class getLangClass() { + return langClass; + } + + public PluginDetails setLangClass(@Nullable Class langClass) { + this.langClass = langClass; + return this; + } + + @Nullable + public Class getPermissionsClass() { + return permissionsClass; + } + + public PluginDetails setPermissionsClass(@Nullable Class permissionsClass) { + this.permissionsClass = permissionsClass; + return this; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/core/CoreConfig.java b/src/main/java/su/nightexpress/nightcore/core/CoreConfig.java new file mode 100644 index 0000000..aee3b8a --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/core/CoreConfig.java @@ -0,0 +1,71 @@ +package su.nightexpress.nightcore.core; + +import su.nightexpress.nightcore.config.ConfigValue; +import su.nightexpress.nightcore.util.text.NightMessage; +import su.nightexpress.nightcore.util.text.tag.impl.ColorTag; + +import java.awt.*; +import java.util.HashMap; +import java.util.Map; + +public class CoreConfig { + + public static final ConfigValue MODERN_TEXT_PRECOMPILE_LANG = ConfigValue.create("ModernTextFormation.Precompile_Language", + true, + "When enabled, parses (deserializes) language messages to Spigot TextComponent(s) on plugin load.", + "When disabled, parses (deserializes) language texts to Spigot TextComponent(s) in runtime when sending it to player.", + "Enabling this setting is good for performance, however messages with placeholders will be recompiled in runtime anyway.", + "(Side Note) Unlike NexEngine, it does not uses regex anymore, which makes deserialization significantly faster and accurate.", + "[Default is true]"); + + public static final ConfigValue> MODERN_TEXT_DEFAULT_COLORS = ConfigValue.forMap("ModernTextFormation.Default_Colors", + (cfg, path, id) -> { + try { + Color color = Color.decode(cfg.getString(path + "." + id, "#ffffff")); + NightMessage.registerTag(new ColorTag(id, color)); + return color; + } + catch (Exception exception) { + exception.printStackTrace(); + return Color.WHITE; + } + }, + (cfg, path, map) -> map.forEach((id, value) -> cfg.set(path + "." + id, "#" + Integer.toHexString(value.getRGB()).substring(2))), + () -> { + Map map = new HashMap<>(); + map.put("aqua", Color.CYAN); + return map; + }, + "Here you can define custom colors to use it in all nightcore plugins like Text.", + "You can also override default ones." + ); + + public static final ConfigValue MENU_CLICK_COOLDOWN = ConfigValue.create("Menu.Click_Cooldown", + 150L, + "Sets cooldown (in milliseconds) for player clicks in GUIs.", + "[Default is 150ms]"); + + public static final ConfigValue USER_DEBUG_ENABLED = ConfigValue.create("UserData.Debug", + false, + "Enables debug messages for user data management.", + "[Default is false]"); + + public static final ConfigValue USER_CACHE_LIFETIME = ConfigValue.create("UserData.Cache.LifeTime", + 300, + "Sets how long (in seconds) user data will be cached for offline users", + "until removed and needs to be loaded from the database again.", + "[Default is 300 (5 minutes)]"); + + public static final ConfigValue USER_CACHE_NAME_AND_UUID = ConfigValue.create("UserData.Cache.Names_And_UUIDs", + true, + "Sets whether or not plugin will cache player names and UUIDs.", + "This will improve database performance when checking if user exists, but will increase memory usage.", + "[Default is true]"); + + public static final ConfigValue RESPECT_PLAYER_DISPLAYNAME = ConfigValue.create("Engine.Respect_Player_DisplayName", + false, + "Sets whether or not 'Player#getDisplayName' can be used to find & get players in addition to regular 'Player#getName'.", + "This is useful if you want to use custom player nicknames in commands.", + "(Works only for nightcore based plugins.)", + "[Default is false]"); +} diff --git a/src/main/java/su/nightexpress/nightcore/core/CoreLang.java b/src/main/java/su/nightexpress/nightcore/core/CoreLang.java new file mode 100644 index 0000000..0326581 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/core/CoreLang.java @@ -0,0 +1,99 @@ +package su.nightexpress.nightcore.core; + +import net.md_5.bungee.api.chat.ClickEvent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.dialog.Dialog; +import su.nightexpress.nightcore.language.entry.LangItem; +import su.nightexpress.nightcore.language.entry.LangString; +import su.nightexpress.nightcore.language.entry.LangText; +import su.nightexpress.nightcore.util.Placeholders; + +import static su.nightexpress.nightcore.util.Placeholders.*; +import static su.nightexpress.nightcore.language.tag.MessageTags.*; +import static su.nightexpress.nightcore.util.text.tag.Tags.*; + +public class CoreLang { + + public static final LangText COMMAND_HELP_LIST = LangText.of("Command.Help.List", + TAG_NO_PREFIX, + " " + YELLOW.enclose(BOLD.enclose(GENERIC_NAME)) + GRAY.enclose(" - ") + YELLOW.enclose(BOLD.enclose("Commands:")), + "", + GRAY.enclose(" " + RED.enclose(BOLD.enclose("<>")) + " - Required, " + GREEN.enclose(BOLD.enclose("[]")) + " - Optional."), + "", + GENERIC_ENTRY, + " " + ); + + public static final LangString COMMAND_HELP_ENTRY = LangString.of("Command.Help.Entry", + " " + YELLOW.enclose( "/" + COMMAND_LABEL) + " " + ORANGE.enclose(Placeholders.COMMAND_USAGE) + GRAY.enclose(" - " + COMMAND_DESCRIPTION) + ); + + public static final LangString COMMAND_HELP_DESC = LangString.of("Command.Help.Desc", "Show help page."); + + public static final LangString COMMAND_CHECKPERM_DESC = LangString.of("Command.CheckPerm.Desc", "Print player permission info."); + public static final LangString COMMAND_CHECKPERM_USAGE = LangString.of("Command.CheckPerm.Usage", ""); + + public static final LangString COMMAND_RELOAD_DESC = LangString.of("Command.Reload.Desc", "Reload the plugin."); + public static final LangText COMMAND_RELOAD_DONE = LangText.of("Command.Reload.Done", "Plugin " + GREEN.enclose("reloaded") + "!"); + + public static final LangString TIME_DAY = LangString.of("Time.Day", GENERIC_AMOUNT + "d."); + public static final LangString TIME_HOUR = LangString.of("Time.Hour", GENERIC_AMOUNT + "h."); + public static final LangString TIME_MINUTE = LangString.of("Time.Min", GENERIC_AMOUNT + "min."); + public static final LangString TIME_SECOND = LangString.of("Time.Sec", GENERIC_AMOUNT + "sec."); + public static final LangString TIME_DELIMITER = LangString.of("Time.Delimiter", " "); + + public static final LangString OTHER_YES = LangString.of("Other.Yes", GREEN.enclose("Yes")); + public static final LangString OTHER_NO = LangString.of("Other.No", RED.enclose("No")); + public static final LangString OTHER_ENABLED = LangString.of("Other.Enabled", GREEN.enclose("Enabled")); + public static final LangString OTHER_DISABLED = LangString.of("Other.Disabled", RED.enclose("Disabled")); + public static final LangString OTHER_ANY = LangString.of("Other.Any", "Any"); + public static final LangString OTHER_NONE = LangString.of("Other.None", "None"); + public static final LangString OTHER_NEVER = LangString.of("Other.Never", "Never"); + public static final LangString OTHER_ONE_TIMED = LangString.of("Other.OneTimed", "One-Timed"); + public static final LangString OTHER_UNLIMITED = LangString.of("Other.Unlimited", "Unlimited"); + public static final LangString OTHER_INFINITY = LangString.of("Other.Infinity", "∞"); + + public static final LangText ERROR_INVALID_PLAYER = LangText.of("Error.Invalid_Player", RED.enclose("Player not found.")); + public static final LangText ERROR_INVALID_WORLD = LangText.of("Error.Invalid_World", RED.enclose("Invalid world.")); + public static final LangText ERROR_INVALID_NUMBER = LangText.of("Error.Invalid_Number", RED.enclose(GENERIC_VALUE + " is not a valid number.")); + public static final LangText ERROR_NO_PERMISSION = LangText.of("Error.NoPermission", RED.enclose("You don't have permissions to do that!")); + public static final LangText ERROR_COMMAND_NOT_YOURSELF = LangText.of("Error.Command.NotYourself", RED.enclose("This command can not be used on yourself.")); + public static final LangText ERROR_COMMAND_PLAYER_ONLY = LangText.of("Error.Command.PlayerOnly", RED.enclose("This command is for players only.")); + public static final LangText ERROR_COMMAND_USAGE = LangText.of("Error.Command.Usage", + TAG_NO_PREFIX, + RED.enclose("Error: ") + GRAY.enclose("Wrong arguments!"), + RED.enclose("Usage: ") + YELLOW.enclose("/" + Placeholders.COMMAND_LABEL) + " " + ORANGE.enclose(Placeholders.COMMAND_USAGE), + " " + ); + + public static final LangText EDITOR_ACTION_EXIT = LangText.of("Editor.Action.Exit", + TAG_NO_PREFIX, + GRAY.enclose("Click " + + CLICK.enclose( + ClickEvent.Action.RUN_COMMAND, + HOVER.enclose(GREEN.enclose("[Here]"), GRAY.enclose("Click to cancel")), + "/" + Dialog.EXIT + ) + + " to leave input mode."), + " "); + + public static final LangString EDITOR_INPUT_HEADER_MAIN = LangString.of("Editor.Input.Header.Main", GREEN.enclose(BOLD.enclose("Input Mode"))); + public static final LangString EDITOR_INPUT_HEADER_ERROR = LangString.of("Editor.Input.Header.Error", RED.enclose(BOLD.enclose("ERROR"))); + public static final LangString EDITOR_INPUT_ERROR_NOT_INTEGER = LangString.of("Editor.Input.Error.NotInteger", GRAY.enclose("Expecting " + RED.enclose("whole") + " number!")); + public static final LangString EDITOR_INPUT_ERROR_GENERIC = LangString.of("Editor.Input.Error.Generic", GRAY.enclose("Invalid value!")); + + public static final LangItem EDITOR_ITEM_CLOSE = LangItem.of("Editor.Generic.Close", RED.enclose("(✕) Exit")); + public static final LangItem EDITOR_ITEM_RETURN = LangItem.of("Editor.Generic.Return", GRAY.enclose("(↓) ") + WHITE.enclose("Return")); + public static final LangItem EDITOR_ITEM_NEXT_PAGE = LangItem.of("Editor.Generic.NextPage", WHITE.enclose("Next Page") + GRAY.enclose(" (→)")); + public static final LangItem EDITOR_ITEM_PREVIOUS_PAGE = LangItem.of("Editor.Generic.PreviousPage", GRAY.enclose("(←) ") + WHITE.enclose("Previous Page")); + + @NotNull + public static String getYesOrNo(boolean value) { + return (value ? OTHER_YES : OTHER_NO).getString(); + } + + @NotNull + public static String getEnabledOrDisabled(boolean value) { + return (value ? OTHER_ENABLED : OTHER_DISABLED).getString(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/core/CoreManager.java b/src/main/java/su/nightexpress/nightcore/core/CoreManager.java new file mode 100644 index 0000000..fd770d7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/core/CoreManager.java @@ -0,0 +1,37 @@ +package su.nightexpress.nightcore.core; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCore; +import su.nightexpress.nightcore.core.listener.CoreListener; +import su.nightexpress.nightcore.dialog.DialogListener; +import su.nightexpress.nightcore.manager.AbstractManager; +import su.nightexpress.nightcore.menu.MenuListener; +import su.nightexpress.nightcore.menu.impl.AbstractMenu; + +public class CoreManager extends AbstractManager { + + public CoreManager(@NotNull NightCore plugin) { + super(plugin); + } + + @Override + protected void onLoad() { + this.addListener(new CoreListener(this.plugin)); + this.addListener(new DialogListener(this.plugin)); + this.addListener(new MenuListener(this.plugin)); + + this.addTask(this.plugin.createTask(() -> { + AbstractMenu.PLAYER_MENUS.values().forEach(menu -> { + if (menu.getOptions().isReadyToRefresh()) { + menu.flush(); + menu.getOptions().setLastAutoRefresh(System.currentTimeMillis()); + } + }); + }).setSecondsInterval(1)); + } + + @Override + protected void onShutdown() { + + } +} diff --git a/src/main/java/su/nightexpress/nightcore/core/CorePerms.java b/src/main/java/su/nightexpress/nightcore/core/CorePerms.java new file mode 100644 index 0000000..52770f0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/core/CorePerms.java @@ -0,0 +1,11 @@ +package su.nightexpress.nightcore.core; + +import su.nightexpress.nightcore.util.wrapper.UniPermission; + +public class CorePerms { + + public static final UniPermission COMMAND_RELOAD = new UniPermission("nightcore.command.reload"); + public static final UniPermission COMMAND_CHECK_PERM = new UniPermission("nightcore.command.checkperm"); + public static final UniPermission COMMAND_FLAGS = new UniPermission("nightcore.command.flags"); + +} diff --git a/src/main/java/su/nightexpress/nightcore/core/command/CheckPermCommand.java b/src/main/java/su/nightexpress/nightcore/core/command/CheckPermCommand.java new file mode 100644 index 0000000..c8f7700 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/core/command/CheckPermCommand.java @@ -0,0 +1,58 @@ +package su.nightexpress.nightcore.core.command; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCore; +import su.nightexpress.nightcore.command.CommandResult; +import su.nightexpress.nightcore.command.impl.AbstractCommand; +import su.nightexpress.nightcore.core.CoreLang; +import su.nightexpress.nightcore.core.CorePerms; +import su.nightexpress.nightcore.integration.VaultHook; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.Players; +import su.nightexpress.nightcore.util.text.NightMessage; + +import java.util.List; + +import static su.nightexpress.nightcore.util.text.tag.Tags.*; + +public class CheckPermCommand extends AbstractCommand { + + public CheckPermCommand(@NotNull NightCore plugin) { + super(plugin, new String[]{"checkperm"}, CorePerms.COMMAND_CHECK_PERM); + this.setDescription(CoreLang.COMMAND_CHECKPERM_DESC); + this.setUsage(CoreLang.COMMAND_CHECKPERM_USAGE); + } + + @Override + @NotNull + public List getTab(@NotNull Player player, int arg, @NotNull String[] args) { + if (arg == 1) { + return Players.playerNames(player); + } + return super.getTab(player, arg, args); + } + + @Override + protected void onExecute(@NotNull CommandSender sender, @NotNull CommandResult result) { + if (result.length() < 2) { + this.errorUsage(sender); + return; + } + + Player player = Players.getPlayer(result.getArg(1)); + if (player == null) { + this.errorPlayer(sender); + return; + } + + String builder = + BOLD.enclose(LIGHT_YELLOW.enclose("Permissions report for ") + LIGHT_ORANGE.enclose(player.getName() + ":")) + + LIGHT_ORANGE.enclose("▪ " + LIGHT_YELLOW.enclose("Primary Group: ") + Colorizer.plain(VaultHook.getPermissionGroup(player))) + + LIGHT_ORANGE.enclose("▪ " + LIGHT_YELLOW.enclose("All Groups: ") + Colorizer.plain(String.join(", ", VaultHook.getPermissionGroups(player)))) + + LIGHT_ORANGE.enclose("▪ " + LIGHT_YELLOW.enclose("Prefix: ") + VaultHook.getPrefix(player)) + + LIGHT_ORANGE.enclose("▪ " + LIGHT_YELLOW.enclose("Suffix: ") + VaultHook.getSuffix(player)); + NightMessage.create(builder).send(sender); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/core/listener/CoreListener.java b/src/main/java/su/nightexpress/nightcore/core/listener/CoreListener.java new file mode 100644 index 0000000..f2eed84 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/core/listener/CoreListener.java @@ -0,0 +1,24 @@ +package su.nightexpress.nightcore.core.listener; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.server.ServiceRegisterEvent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCore; +import su.nightexpress.nightcore.integration.VaultHook; +import su.nightexpress.nightcore.manager.AbstractListener; +import su.nightexpress.nightcore.util.Plugins; + +public class CoreListener extends AbstractListener { + + public CoreListener(@NotNull NightCore plugin) { + super(plugin); + } + + @EventHandler(priority = EventPriority.NORMAL) + public void onServiceRegisterEvent(ServiceRegisterEvent event) { + if (!Plugins.hasVault()) return; + + VaultHook.onServiceRegisterEvent(event); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/AbstractConnector.java b/src/main/java/su/nightexpress/nightcore/database/AbstractConnector.java new file mode 100644 index 0000000..bcefc2e --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/AbstractConnector.java @@ -0,0 +1,43 @@ +package su.nightexpress.nightcore.database; + +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; + +import java.sql.Connection; +import java.sql.SQLException; + +public abstract class AbstractConnector { + + protected final NightCorePlugin plugin; + //protected final String url; + protected final HikariConfig config; + protected final HikariDataSource dataSource; + + public AbstractConnector(@NotNull NightCorePlugin plugin, @NotNull DatabaseConfig config) { + this.plugin = plugin; + //this.url = getURL(config); + + this.config = new HikariConfig(); + this.config.setJdbcUrl(this.getURL(config)); + this.setupConfig(config); + this.config.addDataSourceProperty("cachePrepStmts", "true"); + this.config.addDataSourceProperty("prepStmtCacheSize", "250"); + this.config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + this.dataSource = new HikariDataSource(this.config); + } + + protected abstract String getURL(@NotNull DatabaseConfig config); + + protected abstract void setupConfig(@NotNull DatabaseConfig config); + + public void close() { + this.dataSource.close(); + } + + @NotNull + public final Connection getConnection() throws SQLException { + return this.dataSource.getConnection(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/AbstractDataHandler.java b/src/main/java/su/nightexpress/nightcore/database/AbstractDataHandler.java new file mode 100644 index 0000000..7ae2f4a --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/AbstractDataHandler.java @@ -0,0 +1,197 @@ +package su.nightexpress.nightcore.database; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.database.connection.MySQLConnector; +import su.nightexpress.nightcore.database.connection.SQLiteConnector; +import su.nightexpress.nightcore.database.serialize.ItemStackSerializer; +import su.nightexpress.nightcore.database.sql.SQLColumn; +import su.nightexpress.nightcore.database.sql.SQLCondition; +import su.nightexpress.nightcore.database.sql.SQLQueries; +import su.nightexpress.nightcore.database.sql.SQLValue; +import su.nightexpress.nightcore.database.sql.executor.*; +import su.nightexpress.nightcore.manager.SimpleManager; +import su.nightexpress.nightcore.util.wrapper.UniTask; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; + +public abstract class AbstractDataHandler

extends SimpleManager

{ + + protected final DatabaseConfig config; + protected final AbstractConnector connector; + protected final Gson gson; + + private UniTask syncTask; + private UniTask saveTask; + + public AbstractDataHandler(@NotNull P plugin) { + this(plugin, DatabaseConfig.read(plugin)); + } + + public AbstractDataHandler(@NotNull P plugin, @NotNull DatabaseConfig config) { + super(plugin); + + this.config = config; + if (this.getDatabaseType() == DatabaseType.MYSQL) { + this.connector = new MySQLConnector(plugin, config); + } + else { + this.connector = new SQLiteConnector(plugin, config); + } + this.gson = this.registerAdapters(new GsonBuilder().setPrettyPrinting()).create(); + } + + @Override + protected void onLoad() { + if (this.getConfig().getSaveInterval() > 0) { + this.saveTask = this.plugin.createAsyncTask(this::onSave) + .setSecondsInterval(this.getConfig().getSaveInterval() * 60) + .start(); + } + + if (this.getConfig().getSyncInterval() > 0 && this.getDatabaseType() != DatabaseType.SQLITE) { + this.syncTask = this.plugin.createAsyncTask(this::onSynchronize) + .setSecondsInterval(this.getConfig().getSyncInterval()) + .start(); + this.plugin.info("Enabled data synchronization with " + config.getSyncInterval() + " seconds interval."); + } + + if (this.getConfig().isPurgeEnabled() && this.getConfig().getPurgePeriod() > 0) { + this.onPurge(); + } + } + + @Override + protected void onShutdown() { + if (this.syncTask != null) this.syncTask.stop(); + if (this.saveTask != null) this.saveTask.stop(); + //this.onSynchronize(); + this.onSave(); + this.getConnector().close(); + } + + public abstract void onSynchronize(); + + public abstract void onSave(); + + public abstract void onPurge(); + + @NotNull + public DatabaseConfig getConfig() { + return this.config; + } + + @NotNull + public DatabaseType getDatabaseType() { + return this.getConfig().getStorageType(); + } + + @NotNull + public String getTablePrefix() { + return this.getConfig().getTablePrefix(); + } + + @NotNull + public AbstractConnector getConnector() { + return this.connector; + } + + @NotNull + protected GsonBuilder registerAdapters(@NotNull GsonBuilder builder) { + return builder.registerTypeAdapter(ItemStack.class, new ItemStackSerializer()); + } + + @NotNull + protected final Connection getConnection() throws SQLException { + return this.getConnector().getConnection(); + } + + public void createTable(@NotNull String table, @NotNull List columns) { + CreateTableExecutor.builder(table, this.getDatabaseType()).columns(columns).execute(this.getConnector()); + } + + public void renameTable(@NotNull String from, @NotNull String to) { + RenameTableExecutor.builder(from, this.getDatabaseType()).renameTo(to).execute(this.getConnector()); + } + + public void addColumn(@NotNull String table, @NotNull SQLValue... columns) { + AlterTableExecutor.builder(table, this.getDatabaseType()).addColumn(columns).execute(this.getConnector()); + } + + public void renameColumn(@NotNull String table, @NotNull SQLValue... columns) { + AlterTableExecutor.builder(table, this.getDatabaseType()).renameColumn(columns).execute(this.getConnector()); + } + + public void dropColumn(@NotNull String table, @NotNull SQLColumn... columns) { + AlterTableExecutor.builder(table, this.getDatabaseType()).dropColumn(columns).execute(this.getConnector()); + } + + public boolean hasColumn(@NotNull String table, @NotNull SQLColumn column) { + return SQLQueries.hasColumn(this.getConnector(), table, column); + } + + public void insert(@NotNull String table, @NotNull List values) { + InsertQueryExecutor.builder(table).values(values).execute(this.getConnector()); + } + + public void update(@NotNull String table, @NotNull List values, @NotNull SQLCondition... conditions) { + UpdateQueryExecutor.builder(table).values(values).where(conditions).execute(this.getConnector()); + } + + public void delete(@NotNull String table, @NotNull SQLCondition... conditions) { + DeleteQueryExecutor.builder(table).where(conditions).execute(this.getConnector()); + } + + public boolean contains(@NotNull String table, @NotNull SQLCondition... conditions) { + return this.load(table, (resultSet -> true), Collections.emptyList(), Arrays.asList(conditions)).isPresent(); + } + + public boolean contains(@NotNull String table, @NotNull List columns, @NotNull SQLCondition... conditions) { + return this.load(table, (resultSet -> true), columns, Arrays.asList(conditions)).isPresent(); + } + + @NotNull + public Optional load(@NotNull String table, @NotNull Function function, + @NotNull List columns, + @NotNull List conditions) { + List list = this.load(table, function, columns, conditions, 1); + return list.isEmpty() ? Optional.empty() : Optional.of(list.get(0)); + } + + @NotNull + public List load(@NotNull String table, @NotNull Function dataFunction) { + return this.load(table, dataFunction, -1); + } + + @NotNull + public List load(@NotNull String table, @NotNull Function dataFunction, int amount) { + return this.load(table, dataFunction, Collections.emptyList(), amount); + } + + @NotNull + public List load(@NotNull String table, + @NotNull Function dataFunction, + @NotNull List columns, + int amount) { + return this.load(table, dataFunction, columns, Collections.emptyList(), amount); + } + + @NotNull + public List load(@NotNull String table, + @NotNull Function dataFunction, + @NotNull List columns, + @NotNull List conditions, + int amount) { + return SelectQueryExecutor.builder(table, dataFunction).columns(columns).where(conditions).execute(this.getConnector()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/AbstractUser.java b/src/main/java/su/nightexpress/nightcore/database/AbstractUser.java new file mode 100644 index 0000000..e4566c2 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/AbstractUser.java @@ -0,0 +1,98 @@ +package su.nightexpress.nightcore.database; + +import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightCorePlugin; + +import java.util.UUID; + +public abstract class AbstractUser

implements DataUser { + + protected final P plugin; + protected final UUID uuid; + + protected String name; + protected long dateCreated; + protected long lastOnline; + protected long cachedUntil; + + public AbstractUser(@NotNull P plugin, @NotNull UUID uuid, @NotNull String name, long dateCreated, long lastOnline) { + this.plugin = plugin; + this.uuid = uuid; + this.name = name; + this.setDateCreated(dateCreated); + this.setLastOnline(lastOnline); + this.setCachedUntil(-1); + } + + public void onLoad() { + + } + + public void onUnload() { + + } + + public boolean isCacheExpired() { + return this.getCachedUntil() > 0 && System.currentTimeMillis() > this.getCachedUntil(); + } + + public long getCachedUntil() { + return cachedUntil; + } + + public void setCachedUntil(long cachedUntil) { + this.cachedUntil = cachedUntil; + } + + @NotNull + public final UUID getId() { + return this.uuid; + } + + @NotNull + public final String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public final long getDateCreated() { + return dateCreated; + } + + public final void setDateCreated(long dateCreated) { + this.dateCreated = dateCreated; + } + + public final long getLastOnline() { + return this.lastOnline; + } + + public final void setLastOnline(long lastOnline) { + this.lastOnline = lastOnline; + } + + public final boolean isOnline() { + return this.getPlayer() != null; + } + + @NotNull + public final OfflinePlayer getOfflinePlayer() { + return this.plugin.getServer().getOfflinePlayer(this.getId()); + } + + @Nullable + public final Player getPlayer() { + return this.plugin.getServer().getPlayer(this.getId()); + } + + @Override + public String toString() { + return "AbstractUser [uuid=" + this.uuid + ", name=" + this.name + ", lastOnline=" + this.lastOnline + "]"; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/AbstractUserDataHandler.java b/src/main/java/su/nightexpress/nightcore/database/AbstractUserDataHandler.java new file mode 100644 index 0000000..e6549b4 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/AbstractUserDataHandler.java @@ -0,0 +1,191 @@ +package su.nightexpress.nightcore.database; + +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightDataPlugin; +import su.nightexpress.nightcore.database.sql.SQLColumn; +import su.nightexpress.nightcore.database.sql.SQLCondition; +import su.nightexpress.nightcore.database.sql.SQLQueries; +import su.nightexpress.nightcore.database.sql.SQLValue; +import su.nightexpress.nightcore.database.sql.column.ColumnType; +import su.nightexpress.nightcore.core.CoreConfig; +import su.nightexpress.nightcore.util.TimeUtil; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.time.LocalDateTime; +import java.util.*; +import java.util.function.Function; + +public abstract class AbstractUserDataHandler

, U extends DataUser> extends AbstractDataHandler

{ + + protected static final SQLColumn COLUMN_USER_ID = SQLColumn.of("uuid", ColumnType.STRING); + protected static final SQLColumn COLUMN_USER_NAME = SQLColumn.of("name", ColumnType.STRING); + protected static final SQLColumn COLUMN_USER_DATE_CREATED = SQLColumn.of("dateCreated", ColumnType.LONG); + protected static final SQLColumn COLUMN_USER_LAST_ONLINE = SQLColumn.of("last_online", ColumnType.LONG); + + protected final String tableUsers; + + protected final Set existIDs; + protected final Set existNames; + + protected AbstractUserDataHandler(@NotNull P plugin) { + this(plugin, DatabaseConfig.read(plugin)); + } + + protected AbstractUserDataHandler(@NotNull P plugin, @NotNull DatabaseConfig config) { + super(plugin, config); + this.tableUsers = this.getTablePrefix() + "_users"; + this.existIDs = new HashSet<>(); + this.existNames = new HashSet<>(); + } + + @Override + protected void onLoad() { + super.onLoad(); + this.createUserTable(); + this.cacheNamesAndIds(); + } + + @Override + protected void onShutdown() { + super.onShutdown(); + } + + @Override + public void onSave() { + for (U user : this.plugin.getUserManager().getLoaded()) { + this.saveUser(user); + } + } + + @Override + public void onPurge() { + if (!SQLQueries.hasTable(this.getConnector(), this.tableUsers)) return; + + LocalDateTime deadline = LocalDateTime.now().minusDays(this.getConfig().getPurgePeriod()); + long deadlineMs = TimeUtil.toEpochMillis(deadline); + + this.delete(this.tableUsers, SQLCondition.smaller(COLUMN_USER_LAST_ONLINE.toValue(deadlineMs))); + } + + protected void createUserTable() { + List columns = new ArrayList<>(); + columns.add(COLUMN_USER_ID); + columns.add(COLUMN_USER_NAME); + columns.add(COLUMN_USER_DATE_CREATED); + columns.add(COLUMN_USER_LAST_ONLINE); + columns.addAll(this.getExtraColumns()); + + this.createTable(this.tableUsers, columns); + } + + public void cacheNamesAndIds() { + if (!CoreConfig.USER_CACHE_NAME_AND_UUID.get()) return; + + Function function = resultSet -> { + try { + this.existIDs.add(UUID.fromString(resultSet.getString(COLUMN_USER_ID.getName()))); + this.existNames.add(resultSet.getString(COLUMN_USER_NAME.getName()).toLowerCase()); + } + catch (SQLException exception) { + exception.printStackTrace(); + } + return null; + }; + + this.load(this.tableUsers, function, Arrays.asList(COLUMN_USER_ID, COLUMN_USER_NAME), Collections.emptyList(), -1); + } + + @NotNull + protected abstract List getExtraColumns(); + + @NotNull + protected List getReadColumns() { + return Collections.emptyList(); + } + + @NotNull + protected abstract List getSaveColumns(@NotNull U user); + + @NotNull + protected abstract Function getUserFunction(); + + @NotNull + public List getUsers() { + return this.load(this.tableUsers, this.getUserFunction(), Collections.emptyList(), Collections.emptyList(), -1); + } + + @Nullable + public U getUser(@NotNull Player player) { + return this.getUser(player.getUniqueId()); + } + + @Nullable + public final U getUser(@NotNull String name) { + return this.load(this.tableUsers, this.getUserFunction(), this.getReadColumns(), + Collections.singletonList(SQLCondition.equal(COLUMN_USER_NAME.asLowerCase().toValue(name.toLowerCase()))) + ).orElse(null); + } + + @Nullable + public final U getUser(@NotNull UUID uuid) { + return this.load(this.tableUsers, this.getUserFunction(), this.getReadColumns(), + Collections.singletonList(SQLCondition.equal(COLUMN_USER_ID.toValue(uuid))) + ).orElse(null); + } + + public boolean isUserExists(@NotNull String name) { + if (CoreConfig.USER_CACHE_NAME_AND_UUID.get()) { + return this.existNames.contains(name.toLowerCase()); + } + return this.contains(this.tableUsers, Collections.singletonList(COLUMN_USER_NAME), SQLCondition.equal(COLUMN_USER_NAME.asLowerCase().toValue(name.toLowerCase()))); + } + + public boolean isUserExists(@NotNull UUID uuid) { + if (CoreConfig.USER_CACHE_NAME_AND_UUID.get()) { + return this.existIDs.contains(uuid); + } + return this.contains(this.tableUsers, Collections.singletonList(COLUMN_USER_ID), SQLCondition.equal(COLUMN_USER_ID.toValue(uuid))); + } + + public void saveUser(@NotNull U user) { + List values = new ArrayList<>(); + values.add(COLUMN_USER_NAME.toValue(user.getName())); + values.add(COLUMN_USER_DATE_CREATED.toValue(user.getDateCreated())); + values.add(COLUMN_USER_LAST_ONLINE.toValue(user.getLastOnline())); + values.addAll(this.getSaveColumns(user)); + + this.update(this.tableUsers, values, SQLCondition.equal(COLUMN_USER_ID.toValue(user.getId()))); + } + + public void addUser(@NotNull U user) { + List values = new ArrayList<>(); + values.add(COLUMN_USER_ID.toValue(user.getId())); + values.add(COLUMN_USER_NAME.toValue(user.getName())); + values.add(COLUMN_USER_DATE_CREATED.toValue(user.getDateCreated())); + values.add(COLUMN_USER_LAST_ONLINE.toValue(user.getLastOnline())); + values.addAll(this.getSaveColumns(user)); + + this.insert(this.tableUsers, values); + + this.existIDs.add(user.getId()); + this.existNames.add(user.getName()); + } + + public void deleteUser(@NotNull UUID uuid) { + this.delete(this.tableUsers, SQLCondition.equal(COLUMN_USER_ID.toValue(uuid))); + + this.existIDs.clear(); + this.existNames.clear(); + this.cacheNamesAndIds(); + } + + public void deleteUser(@NotNull DataUser user) { + this.delete(this.tableUsers, SQLCondition.equal(COLUMN_USER_ID.toValue(user.getId()))); + + this.existIDs.remove(user.getId()); + this.existNames.remove(user.getName()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/AbstractUserManager.java b/src/main/java/su/nightexpress/nightcore/database/AbstractUserManager.java new file mode 100644 index 0000000..a3992d4 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/AbstractUserManager.java @@ -0,0 +1,259 @@ +package su.nightexpress.nightcore.database; + +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightDataPlugin; +import su.nightexpress.nightcore.manager.AbstractManager; +import su.nightexpress.nightcore.core.CoreConfig; +import su.nightexpress.nightcore.database.listener.UserListener; +import su.nightexpress.nightcore.util.Players; + +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Consumer; + +public abstract class AbstractUserManager

, U extends DataUser> extends AbstractManager

{ + + private final Map loadedById; + private final Map loadedByName; + + public AbstractUserManager(@NotNull P plugin) { + super(plugin); + this.loadedById = new ConcurrentHashMap<>(); + this.loadedByName = new ConcurrentHashMap<>(); + } + + @Override + protected void onLoad() { + this.addListener(new UserListener<>(this.plugin)); + } + + @Override + protected void onShutdown() { + this.getLoaded().forEach(this::save); + this.getLoadedByIdMap().clear(); + this.getLoadedByNameMap().clear(); + } + + @NotNull + public abstract U createUserData(@NotNull UUID uuid, @NotNull String name); + + public void loadOnlineUsers() { + this.plugin.getServer().getOnlinePlayers().stream().map(Player::getUniqueId).forEach(id -> { + U user = this.getUserData(id); + if (user != null) this.cachePermanent(user); + }); + } + + @NotNull + public final U getUserData(@NotNull Player player) { + UUID uuid = player.getUniqueId(); + + U user = this.getLoaded(uuid); + if (user != null) return user; + + if (Players.isReal(player)) { + user = this.getUserData(uuid); + if (user != null) { + if (CoreConfig.USER_DEBUG_ENABLED.get()) { + new Throwable().printStackTrace(); + this.plugin.warn("Main thread user data load for '" + uuid + "' aka '" + player.getName() + "'."); + } + return user; + } + } + + return this.createUserData(uuid, player.getName()); + } + + @Nullable + public final U getUserData(@NotNull String name) { + Player player = Players.getPlayer(name); + if (player != null) return this.getUserData(player); + + U user = this.getLoaded(name); + if (user != null) return user; + + user = this.plugin.getData().getUser(name); + if (user != null) { + user.onLoad(); + //this.plugin.debug("Loaded by name from DB: " + user.getName()); + this.cacheTemporary(user); + } + + return user; + } + + @Nullable + public final U getUserData(@NotNull UUID uuid) { + U user = this.getLoaded(uuid); + if (user != null) return user; + + user = this.plugin.getData().getUser(uuid); + if (user != null) { + user.onLoad(); + //this.plugin.debug("Loaded by UUID from DB: " + user.getName()); + this.cacheTemporary(user); + } + + return user; + } + + public final CompletableFuture getUserDataAsync(@NotNull String name) { + return CompletableFuture.supplyAsync(() -> this.getUserData(name)); + } + + public final CompletableFuture getUserDataAsync(@NotNull UUID uuid) { + return CompletableFuture.supplyAsync(() -> this.getUserData(uuid)); + } + + public void getUserDataAndPerform(@NotNull String name, Consumer consumer) { + U user = this.getLoaded(name); + if (user != null) { + consumer.accept(user); + } + else this.getUserDataAsync(name).thenAccept(user2 -> this.plugin.runTask(task -> consumer.accept(user2))); + } + + public void getUserDataAndPerform(@NotNull UUID uuid, Consumer consumer) { + U user = this.getLoaded(uuid); + if (user != null) { + consumer.accept(user); + } + else this.getUserDataAsync(uuid).thenAccept(user2 -> this.plugin.runTask(task -> consumer.accept(user2))); + } + + public void getUserDataAndPerformAsync(@NotNull String name, Consumer consumer) { + U user = this.getLoaded(name); + if (user != null) { + consumer.accept(user); + } + else this.getUserDataAsync(name).thenAccept(consumer); + } + + public void getUserDataAndPerformAsync(@NotNull UUID uuid, Consumer consumer) { + U user = this.getLoaded(uuid); + if (user != null) { + consumer.accept(user); + } + else this.getUserDataAsync(uuid).thenAccept(consumer); + } + + public final void unload(@NotNull Player player) { + this.unload(player.getUniqueId()); + } + + public final void unload(@NotNull UUID uuid) { + U user = this.getLoadedByIdMap().get(uuid); + if (user == null) return; + + this.unload(user); + } + + public void unload(@NotNull U user) { + Player player = user.getPlayer(); + if (player != null) { + user.setName(player.getName()); + user.setLastOnline(System.currentTimeMillis()); + } + this.saveAsync(user); + this.cacheTemporary(user); + } + + public void save(@NotNull U user) { + this.plugin.getData().saveUser(user); + } + + public void saveAsync(@NotNull U user) { + this.plugin.runTaskAsync(task -> this.save(user)); + } + + @NotNull + public Set getAllUsers() { + Map users = new HashMap<>(); + this.getLoaded().forEach(user -> users.put(user.getId(), user)); + this.plugin.getData().getUsers().forEach(user -> { + users.putIfAbsent(user.getId(), user); + }); + return new HashSet<>(users.values()); + } + + @NotNull + public Map getLoadedByIdMap() { + this.removeExpired(this.loadedById.values()); + + return this.loadedById; + } + + @NotNull + public Map getLoadedByNameMap() { + this.removeExpired(this.loadedByName.values()); + + return loadedByName; + } + + private void removeExpired(@NotNull Collection collection) { + collection.removeIf(user -> { + if (user.isCacheExpired()) { + user.onUnload(); + //this.plugin.debug("Cache expired: " + user.getName()); + return true; + } + return false; + }); + } + + @NotNull + public Set getLoaded() { + return new HashSet<>(this.getLoadedByIdMap().values()); + } + + @Nullable + public U getLoaded(@NotNull UUID uuid) { + return this.getLoadedByIdMap().get(uuid); + } + + @Nullable + public U getLoaded(@NotNull String name) { + return this.getLoadedByNameMap().get(name.toLowerCase()); + } + + public boolean isLoaded(@NotNull Player player) { + return this.isLoaded(player.getUniqueId()); + } + + public boolean isLoaded(@NotNull UUID id) { + return this.getLoadedByIdMap().containsKey(id); + } + + public boolean isLoaded(@NotNull String name) { + return this.getLoadedByNameMap().containsKey(name.toLowerCase()); + } + + public boolean isCreated(@NotNull String name) { + return this.plugin.getData().isUserExists(name); + } + + public boolean isCreated(@NotNull UUID uuid) { + return this.plugin.getData().isUserExists(uuid); + } + + public void cacheTemporary(@NotNull U user) { + user.setCachedUntil(System.currentTimeMillis() + CoreConfig.USER_CACHE_LIFETIME.get() * 1000L); + this.cache(user); + //this.plugin.debug("Temp user cache: " + user.getName()); + } + + public void cachePermanent(@NotNull U user) { + user.setCachedUntil(-1); + this.cache(user); + //this.plugin.debug("Permanent user cache: " + user.getName()); + } + + private void cache(@NotNull U user) { + this.getLoadedByIdMap().putIfAbsent(user.getId(), user); + this.getLoadedByNameMap().putIfAbsent(user.getName().toLowerCase(), user); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/DataUser.java b/src/main/java/su/nightexpress/nightcore/database/DataUser.java new file mode 100644 index 0000000..69c7933 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/DataUser.java @@ -0,0 +1,41 @@ +package su.nightexpress.nightcore.database; + +import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.UUID; + +public interface DataUser { + + void onLoad(); + + void onUnload(); + + boolean isCacheExpired(); + + long getCachedUntil(); + + void setCachedUntil(long cachedUntil); + + @NotNull UUID getId(); + + @NotNull String getName(); + + void setName(String name); + + long getDateCreated(); + + void setDateCreated(long dateCreated); + + long getLastOnline(); + + void setLastOnline(long lastOnline); + + boolean isOnline(); + + @NotNull OfflinePlayer getOfflinePlayer(); + + @Nullable Player getPlayer(); +} diff --git a/src/main/java/su/nightexpress/nightcore/database/DatabaseConfig.java b/src/main/java/su/nightexpress/nightcore/database/DatabaseConfig.java new file mode 100644 index 0000000..f513781 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/DatabaseConfig.java @@ -0,0 +1,190 @@ +package su.nightexpress.nightcore.database; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.ConfigValue; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.StringUtil; + +import java.util.stream.Stream; + +public class DatabaseConfig { + + private final int saveInterval; + private final int syncInterval; + private final DatabaseType databaseType; + private final String tablePrefix; + private final boolean purgeEnabled; + private final int purgePeriod; + + private final String username; + private final String password; + private final String host; + private final String database; + private final String urlOptions; + + private final String filename; + + public DatabaseConfig( + int saveInterval, + int syncInterval, + @NotNull DatabaseType databaseType, + @NotNull String tablePrefix, + boolean purgeEnabled, + int purgePeriod, + + @NotNull String username, + @NotNull String password, + @NotNull String host, + @NotNull String database, + @NotNull String urlOptions, + + @NotNull String filename + ) { + this.saveInterval = saveInterval; + this.syncInterval = syncInterval; + this.databaseType = databaseType; + this.tablePrefix = tablePrefix; + this.purgeEnabled = purgeEnabled; + this.purgePeriod = purgePeriod; + + this.username = username; + this.password = password; + this.host = host; + this.database = database; + this.urlOptions = urlOptions; + + this.filename = filename; + } + + @NotNull + public static DatabaseConfig read(@NotNull NightCorePlugin plugin) { + FileConfig cfg = plugin.getConfig(); + String path = "Database."; + + DatabaseType databaseType = ConfigValue.create(path + "Type", DatabaseType.class, DatabaseType.SQLITE, + "Sets database type.", + "Available values: " + String.join(",", Stream.of(DatabaseType.values()).map(Enum::name).toList())) + .read(cfg); + + int saveInterval = ConfigValue.create(path + "Auto_Save_Interval", 20, + "Sets how often (in minutes) plugin data of online players will be saved to the database.", + "Set to '-1' to disable.") + .read(cfg); + + int syncInterval = ConfigValue.create(path + "Sync_Interval", -1, + "Sets how often (in seconds) plugin data will be fetched and loaded from the remote database.", + "Useless for " + DatabaseType.SQLITE.name() + ".", + "Set to '-1' to disable.") + .read(cfg); + + String tablePrefix = ConfigValue.create(path + "Table_Prefix", StringUtil.lowerCaseUnderscore(plugin.getName()), + "Custom prefix for plugin tables in database.") + .read(cfg); + + String mysqlUser = ConfigValue.create(path + "MySQL.Username", "root", + "Database user name.") + .read(cfg); + + String mysqlPassword = ConfigValue.create(path + "MySQL.Password", "root", + "Database password.") + .read(cfg); + + String mysqlHost = ConfigValue.create(path + "MySQL.Host", "localhost:3306", + "Database address. Like http://127.0.0.1:3306/") + .read(cfg); + + String mysqlBase = ConfigValue.create(path + "MySQL.Database", "minecraft", + "Name of the MySQL database where plugin will create tables.") + .read(cfg); + + String urlOptions = ConfigValue.create(path + "MySQL.Options", + "?allowPublicKeyRetrieval=true&useSSL=false", + "Connection options. Do not touch unless you know what you're doing." + ).read(cfg); + + String sqliteFilename = ConfigValue.create(path + "SQLite.FileName", "data.db", + "File name for the SQLite database file.", + "Actually it's a path to the file, so you can use directories here.") + .read(cfg); + + + path = "Database.Purge."; + boolean purgeEnabled = ConfigValue.create(path + "Enabled", false, + "Enables the purge feature.", + "Purge will remove all records from the plugin tables that are 'old' enough.") + .read(cfg); + + int purgePeriod = ConfigValue.create(path + "For_Period", 60, + "Sets maximal 'age' for the database records before they will be purged.", + "This option may have different behavior depends on the plugin.", + "By default it's days of inactivity for the plugin users.") + .read(cfg); + + return new DatabaseConfig( + saveInterval, syncInterval, + databaseType, tablePrefix, + purgeEnabled, purgePeriod, + + mysqlUser, mysqlPassword, mysqlHost, mysqlBase, urlOptions, + + sqliteFilename + ); + } + + @NotNull + public DatabaseType getStorageType() { + return databaseType; + } + + @NotNull + public String getTablePrefix() { + return tablePrefix; + } + + public int getSaveInterval() { + return saveInterval; + } + + public int getSyncInterval() { + return syncInterval; + } + + public boolean isPurgeEnabled() { + return purgeEnabled; + } + + public int getPurgePeriod() { + return purgePeriod; + } + + @NotNull + public String getUsername() { + return username; + } + + @NotNull + public String getPassword() { + return password; + } + + @NotNull + public String getHost() { + return host; + } + + @NotNull + public String getDatabase() { + return database; + } + + @NotNull + public String getUrlOptions() { + return urlOptions; + } + + @NotNull + public String getFilename() { + return filename; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/DatabaseType.java b/src/main/java/su/nightexpress/nightcore/database/DatabaseType.java new file mode 100644 index 0000000..c850fcd --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/DatabaseType.java @@ -0,0 +1,7 @@ +package su.nightexpress.nightcore.database; + +public enum DatabaseType { + + MYSQL, + SQLITE, +} diff --git a/src/main/java/su/nightexpress/nightcore/database/connection/MySQLConnector.java b/src/main/java/su/nightexpress/nightcore/database/connection/MySQLConnector.java new file mode 100644 index 0000000..59782c1 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/connection/MySQLConnector.java @@ -0,0 +1,28 @@ +package su.nightexpress.nightcore.database.connection; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.DatabaseConfig; + +public class MySQLConnector extends AbstractConnector { + + public MySQLConnector(@NotNull NightCorePlugin plugin, @NotNull DatabaseConfig config) { + super(plugin, config); + } + + @Override + protected String getURL(@NotNull DatabaseConfig config) { + String host = config.getHost(); + String database = config.getDatabase(); + String options = config.getUrlOptions(); + + return "jdbc:mysql://" + host + "/" + database + options; + } + + @Override + protected void setupConfig(@NotNull DatabaseConfig config) { + this.config.setUsername(config.getUsername()); + this.config.setPassword(config.getPassword()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/connection/SQLiteConnector.java b/src/main/java/su/nightexpress/nightcore/database/connection/SQLiteConnector.java new file mode 100644 index 0000000..6749698 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/connection/SQLiteConnector.java @@ -0,0 +1,24 @@ +package su.nightexpress.nightcore.database.connection; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.DatabaseConfig; + +public class SQLiteConnector extends AbstractConnector { + + public SQLiteConnector(@NotNull NightCorePlugin plugin, @NotNull DatabaseConfig config) { + super(plugin, config); + } + + @Override + protected String getURL(@NotNull DatabaseConfig config) { + String filePath = plugin.getDataFolder().getAbsolutePath() + "/" + config.getFilename(); + return "jdbc:sqlite:" + filePath; + } + + @Override + protected void setupConfig(@NotNull DatabaseConfig config) { + this.config.setMaximumPoolSize(1); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/listener/UserListener.java b/src/main/java/su/nightexpress/nightcore/database/listener/UserListener.java new file mode 100644 index 0000000..505d855 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/listener/UserListener.java @@ -0,0 +1,49 @@ +package su.nightexpress.nightcore.database.listener; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.player.AsyncPlayerPreLoginEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightDataPlugin; +import su.nightexpress.nightcore.core.CoreConfig; +import su.nightexpress.nightcore.database.DataUser; +import su.nightexpress.nightcore.manager.AbstractListener; +import su.nightexpress.nightcore.database.AbstractUserManager; + +import java.util.UUID; + +public class UserListener

, U extends DataUser> extends AbstractListener

{ + + private final AbstractUserManager, U> userManager; + + public UserListener(@NotNull P plugin) { + super(plugin); + this.userManager = plugin.getUserManager(); + } + + @EventHandler(priority = EventPriority.MONITOR) + public void onUserLogin(AsyncPlayerPreLoginEvent event) { + if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) return; + + UUID uuid = event.getUniqueId(); + U user; + if (!this.userManager.isCreated(uuid)) { + user = this.userManager.createUserData(uuid, event.getName()); + plugin.getData().addUser(user); + if (CoreConfig.USER_DEBUG_ENABLED.get()) { + plugin.info("Created new data for: '" + uuid + "'"); + } + } + else user = this.userManager.getUserData(uuid); + + if (user != null) { + this.userManager.cachePermanent(user); + } + } + + @EventHandler(priority = EventPriority.MONITOR) + public void onUserQuit(PlayerQuitEvent event) { + this.plugin.getUserManager().unload(event.getPlayer()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/serialize/ItemStackSerializer.java b/src/main/java/su/nightexpress/nightcore/database/serialize/ItemStackSerializer.java new file mode 100644 index 0000000..8d91f9a --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/serialize/ItemStackSerializer.java @@ -0,0 +1,24 @@ +package su.nightexpress.nightcore.database.serialize; + +import com.google.gson.*; +import org.bukkit.inventory.ItemStack; +import su.nightexpress.nightcore.util.ItemUtil; + +import java.lang.reflect.Type; + +public class ItemStackSerializer implements JsonSerializer, JsonDeserializer { + + @Override + public JsonElement serialize(ItemStack item, Type type, JsonSerializationContext context) { + JsonObject object = new JsonObject(); + object.addProperty("data64", ItemUtil.compress(item)); + return object; + } + + @Override + public ItemStack deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { + JsonObject object = json.getAsJsonObject(); + return ItemUtil.decompress(object.get("data64").getAsString()); + } + +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/SQLColumn.java b/src/main/java/su/nightexpress/nightcore/database/sql/SQLColumn.java new file mode 100644 index 0000000..8e955c2 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/SQLColumn.java @@ -0,0 +1,68 @@ +package su.nightexpress.nightcore.database.sql; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.DatabaseType; +import su.nightexpress.nightcore.database.sql.column.ColumnType; + +public class SQLColumn { + + private final String name; + private final String nameEscaped; + private final ColumnType type; + private final int length; + + public SQLColumn(@NotNull String name, @NotNull ColumnType type, int length) { + this(name, "`" + name + "`", type, length); + } + + public SQLColumn(@NotNull String name, @NotNull String nameEscaped, @NotNull ColumnType type, int length) { + this.name = name; + this.nameEscaped = nameEscaped; + this.type = type; + this.length = length; + } + + @NotNull + public static SQLColumn of(@NotNull String name, @NotNull ColumnType type) { + return SQLColumn.of(name, type, -1); + } + + @NotNull + public static SQLColumn of(@NotNull String name, @NotNull ColumnType type, int length) { + return new SQLColumn(name, type, length); + } + + @NotNull + public SQLColumn asLowerCase() { + return new SQLColumn("LOWER(" + this.getName() + ")", this.getName(), this.getType(), this.getLength()); + } + + @NotNull + public String getName() { + return name; + } + + @NotNull + public String getNameEscaped() { + return this.nameEscaped; + } + + @NotNull + public ColumnType getType() { + return type; + } + + public int getLength() { + return length; + } + + @NotNull + public String formatType(@NotNull DatabaseType databaseType) { + return this.getType().getFormer().build(databaseType, this.getLength()); + } + + @NotNull + public SQLValue toValue(@NotNull Object value) { + return SQLValue.of(this, String.valueOf(value)); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/SQLCondition.java b/src/main/java/su/nightexpress/nightcore/database/sql/SQLCondition.java new file mode 100644 index 0000000..af832ad --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/SQLCondition.java @@ -0,0 +1,72 @@ +package su.nightexpress.nightcore.database.sql; + +import org.jetbrains.annotations.NotNull; + +public class SQLCondition { + + private final SQLValue value; + private final Type type; + + public SQLCondition(@NotNull SQLValue value, @NotNull Type type) { + this.value = value; + this.type = type; + } + + @NotNull + public static SQLCondition of(@NotNull SQLValue value, @NotNull Type type) { + return new SQLCondition(value, type); + } + + @NotNull + public static SQLCondition equal(@NotNull SQLValue value) { + return of(value, Type.EQUAL); + } + + @NotNull + public static SQLCondition not(@NotNull SQLValue value) { + return of(value, Type.NOT_EQUAL); + } + + @NotNull + public static SQLCondition smaller(@NotNull SQLValue value) { + return of(value, Type.SMALLER); + } + + @NotNull + public static SQLCondition greater(@NotNull SQLValue value) { + return of(value, Type.GREATER); + } + + @NotNull + public Type getType() { + return type; + } + + @NotNull + public SQLValue getValue() { + return value; + } + + @NotNull + public SQLColumn getColumn() { + return this.getValue().getColumn(); + } + + public enum Type { + GREATER(">"), + SMALLER("<"), + EQUAL("="), + NOT_EQUAL("!="); + + private final String operator; + + Type(@NotNull String operator) { + this.operator = operator; + } + + @NotNull + public String getOperator() { + return operator; + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/SQLExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/SQLExecutor.java new file mode 100644 index 0000000..586b25f --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/SQLExecutor.java @@ -0,0 +1,21 @@ +package su.nightexpress.nightcore.database.sql; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.AbstractConnector; + +public abstract class SQLExecutor { + + protected final String table; + + protected SQLExecutor(@NotNull String table) { + this.table = table; + } + + @NotNull + public String getTable() { + return "`" + this.table + "`"; + } + + @NotNull + public abstract T execute(@NotNull AbstractConnector connector); +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/SQLQueries.java b/src/main/java/su/nightexpress/nightcore/database/sql/SQLQueries.java new file mode 100644 index 0000000..81dad55 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/SQLQueries.java @@ -0,0 +1,115 @@ +package su.nightexpress.nightcore.database.sql; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.AbstractConnector; + +import java.sql.*; +import java.util.*; +import java.util.function.Function; + +public class SQLQueries { + + public static boolean hasTable(@NotNull AbstractConnector connector, @NotNull String table) { + try (Connection connection = connector.getConnection()) { + + boolean has; + DatabaseMetaData metaData = connection.getMetaData(); + ResultSet tables = metaData.getTables(null, null, table, null); + has = tables.next(); + tables.close(); + return has; + } + catch (SQLException exception) { + exception.printStackTrace(); + return false; + } + } + + public static boolean hasColumn(@NotNull AbstractConnector connector, + @NotNull String table, + @NotNull SQLColumn column) { + String sql = "SELECT * FROM " + table; + String columnName = column.getName(); + try (Connection connection = connector.getConnection(); + Statement statement = connection.createStatement()) { + + ResultSet resultSet = statement.executeQuery(sql); + ResultSetMetaData metaData = resultSet.getMetaData(); + int columns = metaData.getColumnCount(); + for (int index = 1; index <= columns; index++) { + if (columnName.equals(metaData.getColumnName(index))) { + return true; + } + } + return false; + } + catch (SQLException exception) { + exception.printStackTrace(); + return false; + } + } + + public static void executeStatement(@NotNull AbstractConnector connector, + @NotNull String sql) { + executeStatement(connector, sql, Collections.emptySet()); + } + + public static void executeStatement(@NotNull AbstractConnector connector, + @NotNull String sql, + @NotNull Collection values1) { + executeStatement(connector, sql, values1, Collections.emptySet()); + } + + public static void executeStatement(@NotNull AbstractConnector connector, + @NotNull String sql, + @NotNull Collection values1, + @NotNull Collection values2) { + + try (Connection connection = connector.getConnection(); + PreparedStatement statement = connection.prepareStatement(sql)) { + + int count = 1; + for (String columnName : values1) { + statement.setString(count++, columnName); + } + for (String columnValue : values2) { + statement.setString(count++, columnValue); + } + + statement.executeUpdate(); + } + catch (SQLException exception) { + exception.printStackTrace(); + } + } + + @NotNull + public static List<@NotNull T> executeQuery(@NotNull AbstractConnector connector, + @NotNull String sql, + @NotNull Collection values, + @NotNull Function dataFunction, + int amount) { + + List list = new ArrayList<>(); + try (Connection connection = connector.getConnection(); + PreparedStatement statement = connection.prepareStatement(sql)) { + + int count = 1; + for (String wValue : values) { + statement.setString(count++, wValue); + } + + ResultSet resultSet = statement.executeQuery(); + while (resultSet.next() && (amount < 0 || list.size() < amount)) { + list.add(dataFunction.apply(resultSet)); + } + resultSet.close(); + } + catch (SQLException exception) { + exception.printStackTrace(); + } + list.removeIf(Objects::isNull); + + return list; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/SQLValue.java b/src/main/java/su/nightexpress/nightcore/database/sql/SQLValue.java new file mode 100644 index 0000000..3b8c9e5 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/SQLValue.java @@ -0,0 +1,29 @@ +package su.nightexpress.nightcore.database.sql; + +import org.jetbrains.annotations.NotNull; + +public class SQLValue { + + private final SQLColumn column; + private final String value; + + public SQLValue(@NotNull SQLColumn column, @NotNull String value) { + this.column = column; + this.value = value; + } + + @NotNull + public static SQLValue of(@NotNull SQLColumn column, @NotNull String value) { + return new SQLValue(column, value); + } + + @NotNull + public SQLColumn getColumn() { + return column; + } + + @NotNull + public String getValue() { + return value; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnFormer.java b/src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnFormer.java new file mode 100644 index 0000000..976d99f --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnFormer.java @@ -0,0 +1,35 @@ +package su.nightexpress.nightcore.database.sql.column; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.DatabaseType; + +public interface ColumnFormer { + + ColumnFormer STRING = (storageType, length) -> { + if (length < 1 || storageType == DatabaseType.SQLITE) { + return storageType == DatabaseType.SQLITE ? "TEXT NOT NULL" : "MEDIUMTEXT NOT NULL"; + } + return "varchar(" + length + ") CHARACTER SET utf8 NOT NULL"; + }; + + ColumnFormer INTEGER = (storageType, length) -> { + if (length < 1 || storageType == DatabaseType.SQLITE) { + return "INTEGER NOT NULL"; + } + return "int(" + length + ") NOT NULL"; + }; + + ColumnFormer DOUBLE = (storageType, length) -> { + return storageType == DatabaseType.SQLITE ? "REAL NOT NULL" : "double NOT NULL"; + }; + + ColumnFormer LONG = (storageType, length) -> { + return length < 1 || storageType == DatabaseType.SQLITE ? "BIGINT NOT NULL" : "bigint(" + length + ") NOT NULL"; + }; + + ColumnFormer BOOLEAN = (storageType, length) -> { + return storageType == DatabaseType.SQLITE ? "INTEGER NOT NULL" : "tinyint(1) NOT NULL"; + }; + + @NotNull String build(@NotNull DatabaseType databaseType, int length); +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnType.java b/src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnType.java new file mode 100644 index 0000000..0b8c0b7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/column/ColumnType.java @@ -0,0 +1,23 @@ +package su.nightexpress.nightcore.database.sql.column; + +import org.jetbrains.annotations.NotNull; + +public class ColumnType { + + public static final ColumnType INTEGER = new ColumnType(ColumnFormer.INTEGER); + public static final ColumnType DOUBLE = new ColumnType(ColumnFormer.DOUBLE); + public static final ColumnType LONG = new ColumnType(ColumnFormer.LONG); + public static final ColumnType BOOLEAN = new ColumnType(ColumnFormer.BOOLEAN); + public static final ColumnType STRING = new ColumnType(ColumnFormer.STRING); + + private final ColumnFormer former; + + public ColumnType(@NotNull ColumnFormer former) { + this.former = former; + } + + @NotNull + public ColumnFormer getFormer() { + return former; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/executor/AlterTableExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/executor/AlterTableExecutor.java new file mode 100644 index 0000000..9348ccc --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/executor/AlterTableExecutor.java @@ -0,0 +1,112 @@ +package su.nightexpress.nightcore.database.sql.executor; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.DatabaseType; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.connection.SQLiteConnector; +import su.nightexpress.nightcore.database.sql.SQLColumn; +import su.nightexpress.nightcore.database.sql.SQLExecutor; +import su.nightexpress.nightcore.database.sql.SQLQueries; +import su.nightexpress.nightcore.database.sql.SQLValue; +import su.nightexpress.nightcore.database.sql.column.ColumnType; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public final class AlterTableExecutor extends SQLExecutor { + + private final DatabaseType databaseType; + private final List columns; + private Type type; + + private AlterTableExecutor(@NotNull String table, @NotNull DatabaseType databaseType) { + super(table); + this.databaseType = databaseType; + this.columns = new ArrayList<>(); + } + + private enum Type { + ADD_COLUMN, RENAME_COLUMN, DROP_COLUMN + } + + @NotNull + public static AlterTableExecutor builder(@NotNull String table, @NotNull DatabaseType databaseType) { + return new AlterTableExecutor(table, databaseType); + } + + @NotNull + public AlterTableExecutor addColumn(@NotNull SQLValue... columns) { + return this.addColumn(Arrays.asList(columns)); + } + + @NotNull + public AlterTableExecutor addColumn(@NotNull List columns) { + return this.columns(columns, Type.ADD_COLUMN); + } + + @NotNull + public AlterTableExecutor renameColumn(@NotNull SQLValue... columns) { + return this.addColumn(Arrays.asList(columns)); + } + + @NotNull + public AlterTableExecutor renameColumn(@NotNull List columns) { + return this.columns(columns, Type.RENAME_COLUMN); + } + + @NotNull + public AlterTableExecutor dropColumn(@NotNull SQLColumn... columns) { + return this.dropColumn(Arrays.asList(columns)); + } + + @NotNull + public AlterTableExecutor dropColumn(@NotNull List columns) { + return this.columns(columns.stream().map(column -> column.toValue("dummy")).toList(), Type.DROP_COLUMN); + } + + private AlterTableExecutor columns(@NotNull List values, @NotNull Type type) { + this.columns.clear(); + this.columns.addAll(values); + this.type = type; + return this; + } + + @Override + @NotNull + public Void execute(@NotNull AbstractConnector connector) { + if (this.columns.isEmpty()) return null; + + if (this.type == Type.ADD_COLUMN) { + this.columns.forEach(value -> { + if (SQLQueries.hasColumn(connector, this.getTable(), value.getColumn())) return; + + String sql = "ALTER TABLE " + this.getTable() + " ADD " + + value.getColumn().getName() + " " + value.getColumn().formatType(this.databaseType); + + if (connector instanceof SQLiteConnector || value.getColumn().getType() != ColumnType.STRING) { + sql = sql + " DEFAULT '" + value.getValue() + "'"; + } + + SQLQueries.executeStatement(connector, sql); + }); + } + else if (this.type == Type.RENAME_COLUMN) { + this.columns.forEach(value -> { + if (!SQLQueries.hasColumn(connector, this.getTable(), value.getColumn())) return; + + String sql = "ALTER TABLE " + this.getTable() + " RENAME COLUMN " + value.getColumn().getName() + " TO " + value.getValue(); + SQLQueries.executeStatement(connector, sql); + }); + } + else if (this.type == Type.DROP_COLUMN) { + this.columns.forEach(value -> { + if (!SQLQueries.hasColumn(connector, this.getTable(), value.getColumn())) return; + + String sql = "ALTER TABLE " + this.getTable() + " DROP COLUMN " + value.getColumn().getName(); + SQLQueries.executeStatement(connector, sql); + }); + } + return null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/executor/CreateTableExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/executor/CreateTableExecutor.java new file mode 100644 index 0000000..34066ec --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/executor/CreateTableExecutor.java @@ -0,0 +1,66 @@ +package su.nightexpress.nightcore.database.sql.executor; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.DatabaseType; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.sql.SQLColumn; +import su.nightexpress.nightcore.database.sql.SQLExecutor; +import su.nightexpress.nightcore.database.sql.SQLQueries; +import su.nightexpress.nightcore.database.sql.column.ColumnFormer; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public final class CreateTableExecutor extends SQLExecutor { + + private final DatabaseType databaseType; + private final List columns; + + private CreateTableExecutor(@NotNull String table, @NotNull DatabaseType databaseType) { + super(table); + this.databaseType = databaseType; + this.columns = new ArrayList<>(); + } + + @NotNull + public static CreateTableExecutor builder(@NotNull String table, @NotNull DatabaseType databaseType) { + return new CreateTableExecutor(table, databaseType); + } + + @NotNull + public CreateTableExecutor columns(@NotNull SQLColumn... columns) { + return this.columns(Arrays.asList(columns)); + } + + @NotNull + public CreateTableExecutor columns(@NotNull List columns) { + this.columns.clear(); + this.columns.addAll(columns); + return this; + } + + @Override + @NotNull + public Void execute(@NotNull AbstractConnector connector) { + if (this.columns.isEmpty()) return null; + + String id = "`id` " + ColumnFormer.INTEGER.build(this.databaseType, 11); + if (this.databaseType == DatabaseType.SQLITE) { + id += " PRIMARY KEY AUTOINCREMENT"; + } + else { + id += " PRIMARY KEY AUTO_INCREMENT"; + } + + String columns = id + "," + this.columns.stream() + .map(column -> column.getNameEscaped() + " " + column.formatType(this.databaseType)) + .collect(Collectors.joining(", ")); + + String sql = "CREATE TABLE IF NOT EXISTS " + this.getTable() + "(" + columns + ");"; + + SQLQueries.executeStatement(connector, sql); + return null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/executor/DeleteQueryExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/executor/DeleteQueryExecutor.java new file mode 100644 index 0000000..6d30178 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/executor/DeleteQueryExecutor.java @@ -0,0 +1,56 @@ +package su.nightexpress.nightcore.database.sql.executor; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.sql.SQLCondition; +import su.nightexpress.nightcore.database.sql.SQLExecutor; +import su.nightexpress.nightcore.database.sql.SQLQueries; +import su.nightexpress.nightcore.database.sql.SQLValue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public final class DeleteQueryExecutor extends SQLExecutor { + + private final List wheres; + + private DeleteQueryExecutor(@NotNull String table) { + super(table); + this.wheres = new ArrayList<>(); + } + + @NotNull + public static DeleteQueryExecutor builder(@NotNull String table) { + return new DeleteQueryExecutor(table); + } + + @NotNull + public DeleteQueryExecutor where(@NotNull SQLCondition... wheres) { + return this.where(Arrays.asList(wheres)); + } + + @NotNull + public DeleteQueryExecutor where(@NotNull List wheres) { + this.wheres.clear(); + this.wheres.addAll(wheres); + return this; + } + + @Override + @NotNull + public Void execute(@NotNull AbstractConnector connector) { + if (this.wheres.isEmpty()) return null; + + String whereCols = this.wheres.stream() + .map(where -> where.getValue().getColumn().getNameEscaped() + " " + where.getType().getOperator() + " ?") + .collect(Collectors.joining(" AND ")); + String sql = "DELETE FROM " + this.getTable() + (whereCols.isEmpty() ? "" : " WHERE " + whereCols); + + List whereVals = this.wheres.stream().map(SQLCondition::getValue).map(SQLValue::getValue).toList(); + + SQLQueries.executeStatement(connector, sql, whereVals); + return null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/executor/InsertQueryExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/executor/InsertQueryExecutor.java new file mode 100644 index 0000000..8b47b7d --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/executor/InsertQueryExecutor.java @@ -0,0 +1,54 @@ +package su.nightexpress.nightcore.database.sql.executor; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.sql.SQLColumn; +import su.nightexpress.nightcore.database.sql.SQLExecutor; +import su.nightexpress.nightcore.database.sql.SQLQueries; +import su.nightexpress.nightcore.database.sql.SQLValue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public final class InsertQueryExecutor extends SQLExecutor { + + private final List values; + + private InsertQueryExecutor(@NotNull String table) { + super(table); + this.values = new ArrayList<>(); + } + + @NotNull + public static InsertQueryExecutor builder(@NotNull String table) { + return new InsertQueryExecutor(table); + } + + @NotNull + public InsertQueryExecutor values(@NotNull SQLValue... values) { + return this.values(Arrays.asList(values)); + } + + @NotNull + public InsertQueryExecutor values(@NotNull List values) { + this.values.clear(); + this.values.addAll(values); + return this; + } + + @Override + @NotNull + public Void execute(@NotNull AbstractConnector connector) { + if (this.values.isEmpty()) return null; + + String columns = this.values.stream().map(SQLValue::getColumn).map(SQLColumn::getNameEscaped).collect(Collectors.joining(",")); + String values = this.values.stream().map(value -> "?").collect(Collectors.joining(",")); + String sql = "INSERT INTO " + this.getTable() + "(" + columns + ") VALUES(" + values + ")"; + List values2 = this.values.stream().map(SQLValue::getValue).toList(); + + SQLQueries.executeStatement(connector, sql, values2); + return null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/executor/RenameTableExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/executor/RenameTableExecutor.java new file mode 100644 index 0000000..6c4eb8e --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/executor/RenameTableExecutor.java @@ -0,0 +1,46 @@ +package su.nightexpress.nightcore.database.sql.executor; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.DatabaseType; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.sql.SQLExecutor; +import su.nightexpress.nightcore.database.sql.SQLQueries; + +public final class RenameTableExecutor extends SQLExecutor { + + private final DatabaseType databaseType; + private String renameTo; + + private RenameTableExecutor(@NotNull String table, @NotNull DatabaseType databaseType) { + super(table); + this.databaseType = databaseType; + } + + @NotNull + public static RenameTableExecutor builder(@NotNull String table, @NotNull DatabaseType databaseType) { + return new RenameTableExecutor(table, databaseType); + } + + @NotNull + public RenameTableExecutor renameTo(@NotNull String renameTo) { + this.renameTo = renameTo; + return this; + } + + @Override + @NotNull + public Void execute(@NotNull AbstractConnector connector) { + if (this.renameTo == null || this.renameTo.isEmpty()) return null; + if (!SQLQueries.hasTable(connector, this.getTable())) return null; + + StringBuilder sql = new StringBuilder(); + if (this.databaseType == DatabaseType.MYSQL) { + sql.append("RENAME TABLE ").append(this.getTable()).append(" TO ").append(this.renameTo).append(";"); + } + else { + sql.append("ALTER TABLE ").append(this.getTable()).append(" RENAME TO ").append(this.renameTo); + } + SQLQueries.executeStatement(connector, sql.toString()); + return null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/executor/SelectQueryExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/executor/SelectQueryExecutor.java new file mode 100644 index 0000000..a0cf8ad --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/executor/SelectQueryExecutor.java @@ -0,0 +1,85 @@ +package su.nightexpress.nightcore.database.sql.executor; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.sql.*; + +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; + +public final class SelectQueryExecutor extends SQLExecutor> { + + private final List columns; + private final List wheres; + private final Function dataFunction; + private int amount; + + private SelectQueryExecutor(@NotNull String table, @NotNull Function dataFunction) { + super(table); + this.columns = new ArrayList<>(); + this.wheres = new ArrayList<>(); + this.dataFunction = dataFunction; + this.amount = -1; + } + + @NotNull + public static SelectQueryExecutor builder(@NotNull String table, @NotNull Function dataFunction) { + return new SelectQueryExecutor<>(table, dataFunction); + } + + /*@NotNull + public SelectQueryExecutor all() { + return this.columns(new SQLColumn("*", ColumnType.STRING, -1)); + }*/ + + @NotNull + public SelectQueryExecutor columns(@NotNull SQLColumn... columns) { + return this.columns(Arrays.asList(columns)); + } + + @NotNull + public SelectQueryExecutor columns(@NotNull List columns) { + //if (columns.isEmpty()) return this.all(); + this.columns.clear(); + this.columns.addAll(columns); + return this; + } + + @NotNull + public SelectQueryExecutor where(@NotNull SQLCondition... wheres) { + return this.where(Arrays.asList(wheres)); + } + + @NotNull + public SelectQueryExecutor where(@NotNull List wheres) { + this.wheres.clear(); + this.wheres.addAll(wheres); + return this; + } + + @NotNull + public SelectQueryExecutor amount(int amount) { + this.amount = amount; + return this; + } + + @Override + @NotNull + public List execute(@NotNull AbstractConnector connector) { + String columns = this.columns.stream().map(SQLColumn::getNameEscaped).collect(Collectors.joining(",")); + if (columns.isEmpty()) columns = "*"; + + String wheres = this.wheres.stream().map(where -> where.getColumn().getNameEscaped() + " " + where.getType().getOperator() + " ?") + .collect(Collectors.joining(" AND ")); + + String sql = "SELECT " + columns + " FROM " + this.getTable() + (wheres.isEmpty() ? "" : " WHERE " + wheres); + + List values = this.wheres.stream().map(SQLCondition::getValue).map(SQLValue::getValue).toList(); + + return SQLQueries.executeQuery(connector, sql, values, this.dataFunction, this.amount); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/database/sql/executor/UpdateQueryExecutor.java b/src/main/java/su/nightexpress/nightcore/database/sql/executor/UpdateQueryExecutor.java new file mode 100644 index 0000000..0984a4e --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/database/sql/executor/UpdateQueryExecutor.java @@ -0,0 +1,75 @@ +package su.nightexpress.nightcore.database.sql.executor; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.database.AbstractConnector; +import su.nightexpress.nightcore.database.sql.SQLCondition; +import su.nightexpress.nightcore.database.sql.SQLExecutor; +import su.nightexpress.nightcore.database.sql.SQLQueries; +import su.nightexpress.nightcore.database.sql.SQLValue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public final class UpdateQueryExecutor extends SQLExecutor { + + private final List values; + private final List wheres; + + private UpdateQueryExecutor(@NotNull String table) { + super(table); + this.values = new ArrayList<>(); + this.wheres = new ArrayList<>(); + } + + @NotNull + public static UpdateQueryExecutor builder(@NotNull String table) { + return new UpdateQueryExecutor(table); + } + + @NotNull + public UpdateQueryExecutor values(@NotNull SQLValue... values) { + return this.values(Arrays.asList(values)); + } + + @NotNull + public UpdateQueryExecutor values(@NotNull List values) { + this.values.clear(); + this.values.addAll(values); + return this; + } + + @NotNull + public UpdateQueryExecutor where(@NotNull SQLCondition... wheres) { + return this.where(Arrays.asList(wheres)); + } + + @NotNull + public UpdateQueryExecutor where(@NotNull List wheres) { + this.wheres.clear(); + this.wheres.addAll(wheres); + return this; + } + + @Override + @NotNull + public Void execute(@NotNull AbstractConnector connector) { + if (this.values.isEmpty()) return null; + + String values = this.values.stream().map(value -> value.getColumn().getNameEscaped() + " = ?") + .collect(Collectors.joining(",")); + + String wheres = this.wheres.stream().map(where -> where.getColumn().getNameEscaped() + " " + where.getType().getOperator() + " ?") + .collect(Collectors.joining(" AND ")); + + String sql = "UPDATE " + this.getTable() + " SET " + values + (wheres.isEmpty() ? "" : " WHERE " + wheres); + + List values2 = this.values.stream().map(SQLValue::getValue).toList(); + List whers2 = this.wheres.stream().map(SQLCondition::getValue).map(SQLValue::getValue).toList(); + + SQLQueries.executeStatement(connector, sql, values2, whers2); + return null; + } + +} diff --git a/src/main/java/su/nightexpress/nightcore/dialog/Dialog.java b/src/main/java/su/nightexpress/nightcore/dialog/Dialog.java new file mode 100644 index 0000000..9c50df7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/dialog/Dialog.java @@ -0,0 +1,193 @@ +package su.nightexpress.nightcore.dialog; + +import net.md_5.bungee.api.chat.ClickEvent; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.core.CoreLang; +import su.nightexpress.nightcore.menu.api.Menu; +import su.nightexpress.nightcore.menu.impl.AbstractMenu; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.text.NightMessage; +import su.nightexpress.nightcore.util.text.WrappedMessage; +import su.nightexpress.nightcore.util.text.tag.Tags; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +public class Dialog { + + private static final Map DIALOG_MAP = new ConcurrentHashMap<>(); + + public static final String EXIT = "#exit"; + public static final String VALUES = "#values"; + + private final Player player; + private final DialogHandler handler; + + private Menu lastMenu; + private List suggestions; + + public Dialog(@NotNull Player player, @NotNull DialogHandler handler) { + this.player = player; + this.handler = handler; + this.suggestions = new ArrayList<>(); + } + + @NotNull + public Player getPlayer() { + return player; + } + + @NotNull + public DialogHandler getHandler() { + return handler; + } + + @Nullable + public Menu getLastMenu() { + return lastMenu; + } + + @NotNull + public Dialog setLastMenu(@Nullable Menu lastMenu) { + this.lastMenu = lastMenu; + return this; + } + + @NotNull + public List getSuggestions() { + return suggestions; + } + + @NotNull + public Dialog setSuggestions(@NotNull Collection suggestions, boolean autoRun) { + this.suggestions = suggestions.stream().sorted(String::compareTo).collect(Collectors.toCollection(ArrayList::new)); + this.displaySuggestions(autoRun, 1); + return this; + } + + public void displaySuggestions(boolean autoRun, int page) { + List values = this.getSuggestions(); + if (values.isEmpty()) return; + + int perPage = 10; + int pages = (int) Math.ceil((double) values.size() / (double) perPage); + if (page < 1) page = 1; + else if (page > pages) page = pages; + int skip = (page - 1) * perPage; + + boolean isLastPage = page == pages; + boolean isFirstPage = page == 1; + List items = values.stream().skip(skip).limit(perPage).toList(); + ClickEvent.Action action = autoRun ? ClickEvent.Action.RUN_COMMAND : ClickEvent.Action.SUGGEST_COMMAND; + + NightMessage.Builder builder = NightMessage.builder(); + builder.append("=".repeat(8) + "[ ", Tags.ORANGE); + builder.append("Value Helper", Tags.YELLOW); + builder.append("] " + "=".repeat(8), Tags.ORANGE); + builder.appendLineBreak(); + + items.forEach(element -> { + String value = element.charAt(0) == '/' ? element : '/' + element; + builder.append("> ", Tags.DARK_GRAY); + builder.append(element, Tags.GREEN) + .showText(Tags.GRAY.enclose( "Click me to select " + Tags.CYAN.enclose(element) + ".")) + .clickEvent(action, value); + builder.appendLineBreak(); + }); + + builder.append("=".repeat(9) + " ", Tags.ORANGE); + + if (isFirstPage) { + builder.append("[<]", Tags.GRAY); + } + else { + builder.append("[<]", Tags.LIGHT_RED) + .showText(Tags.GRAY.enclose("Previous Page")) + .runCommand("/" + VALUES + " " + (page - 1) + " " + autoRun); + } + + builder.append(" " + page, Tags.YELLOW); + builder.append("/", Tags.ORANGE); + builder.append(pages + " ", Tags.YELLOW); + + if (isLastPage) { + builder.append("[>]", Tags.GRAY); + } + else { + builder.append("[>]", Tags.LIGHT_RED) + .showText(Tags.GRAY.enclose("Next Page")) + .runCommand("/" + VALUES + " " + (page + 1) + " " + autoRun); + } + + builder.append(" " + "=".repeat(9), Tags.ORANGE); + builder.send(this.getPlayer()); + } + + @Deprecated + public void prompt(@NotNull String text) { + this.sendInfo(CoreLang.EDITOR_INPUT_HEADER_MAIN.getMessage().toLegacy(), Colorizer.apply(text)); + } + + public void prompt(@NotNull WrappedMessage text) { + this.info(CoreLang.EDITOR_INPUT_HEADER_MAIN.getMessage(), text); + } + + @Deprecated + public void error(@NotNull String text) { + this.sendInfo(CoreLang.EDITOR_INPUT_HEADER_ERROR.getMessage().toLegacy(), Colorizer.apply(text)); + } + + public void error(@NotNull WrappedMessage text) { + this.info(CoreLang.EDITOR_INPUT_HEADER_ERROR.getMessage(), text); + } + + public void info(@NotNull WrappedMessage title, @NotNull WrappedMessage text) { + this.sendInfo(title.toLegacy(), text.toLegacy()); + } + + @Deprecated + public void info(@NotNull String title, @NotNull String text) { + this.sendInfo(Colorizer.apply(title), Colorizer.apply(text)); + } + + private void sendInfo(@NotNull String title, @NotNull String text) { + this.getPlayer().sendTitle(title, text, 20, Short.MAX_VALUE, 20); + } + + @NotNull + public static Dialog create(@NotNull Player player, @NotNull DialogHandler handler) { + Dialog dialog = new Dialog(player, handler) + .setLastMenu(AbstractMenu.getMenu(player)); + + DIALOG_MAP.put(player.getUniqueId(), dialog); + CoreLang.EDITOR_ACTION_EXIT.getMessage().send(player); + return dialog; + } + + @Nullable + public static Dialog get(@NotNull Player player) { + return DIALOG_MAP.get(player.getUniqueId()); + } + + public static void stop(@NotNull Player player) { + Dialog dialog = DIALOG_MAP.remove(player.getUniqueId()); + if (dialog == null) return; + + Menu menu = dialog.getLastMenu(); + if (menu != null) { + menu.open(player); + } + player.sendTitle("", "", 1, 1, 1); + } + + public static void shutdown() { + DIALOG_MAP.clear(); + } + + public static boolean contains(@NotNull Player player) { + return get(player) != null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/dialog/DialogHandler.java b/src/main/java/su/nightexpress/nightcore/dialog/DialogHandler.java new file mode 100644 index 0000000..dba117c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/dialog/DialogHandler.java @@ -0,0 +1,8 @@ +package su.nightexpress.nightcore.dialog; + +import org.jetbrains.annotations.NotNull; + +public interface DialogHandler { + + boolean onInput(@NotNull WrappedInput input); +} diff --git a/src/main/java/su/nightexpress/nightcore/dialog/DialogListener.java b/src/main/java/su/nightexpress/nightcore/dialog/DialogListener.java new file mode 100644 index 0000000..20e9193 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/dialog/DialogListener.java @@ -0,0 +1,73 @@ +package su.nightexpress.nightcore.dialog; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCore; +import su.nightexpress.nightcore.manager.AbstractListener; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.NumberUtil; + +import java.util.HashSet; + +public class DialogListener extends AbstractListener { + + public DialogListener(@NotNull NightCore plugin) { + super(plugin); + } + + @EventHandler(priority = EventPriority.MONITOR) + public void onQuit(PlayerQuitEvent event) { + Dialog.stop(event.getPlayer()); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void onChatText(AsyncPlayerChatEvent event) { + Player player = event.getPlayer(); + Dialog dialog = Dialog.get(player); + if (dialog == null) return; + + event.getRecipients().clear(); + event.setCancelled(true); + + WrappedInput input = new WrappedInput(event); + + this.plugin.runTask(task -> { + if (input.getTextRaw().equalsIgnoreCase(Dialog.EXIT) || dialog.getHandler().onInput(input)) { + Dialog.stop(player); + } + }); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void onChatCommand(PlayerCommandPreprocessEvent event) { + Player player = event.getPlayer(); + Dialog dialog = Dialog.get(player); + if (dialog == null) return; + + event.setCancelled(true); + + String raw = event.getMessage(); + String text = Colorizer.apply(raw.substring(1)); + if (text.startsWith(Dialog.VALUES)) { + String[] split = text.split(" "); + int page = split.length >= 2 ? NumberUtil.getInteger(split[1], 0) : 0; + boolean auto = split.length >= 3 && Boolean.parseBoolean(split[2]); + dialog.displaySuggestions(auto, page); + return; + } + + AsyncPlayerChatEvent chatEvent = new AsyncPlayerChatEvent(true, player, text, new HashSet<>()); + WrappedInput input = new WrappedInput(chatEvent); + + this.plugin.runTask(task -> { + if (input.getTextRaw().equalsIgnoreCase(Dialog.EXIT) || dialog.getHandler().onInput(input)) { + Dialog.stop(player); + } + }); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/dialog/WrappedInput.java b/src/main/java/su/nightexpress/nightcore/dialog/WrappedInput.java new file mode 100644 index 0000000..23acd6c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/dialog/WrappedInput.java @@ -0,0 +1,92 @@ +package su.nightexpress.nightcore.dialog; + +import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.NumberUtil; +import su.nightexpress.nightcore.util.StringUtil; +import su.nightexpress.nightcore.util.wrapper.UniDouble; +import su.nightexpress.nightcore.util.wrapper.UniInt; + +public class WrappedInput { + + private final String text; + private final String textRaw; + private final String textColored; + + public WrappedInput(@NotNull AsyncPlayerChatEvent event) { + this(event.getMessage()); + } + + public WrappedInput(@NotNull String text) { + this.text = text; + this.textRaw = Colorizer.restrip(text); // TODO Modern formation, but keep colorizer to support legacy codes for other chat format plugins + this.textColored = Colorizer.apply(text); + } + + public int asInt() { + return this.asInt(0); + } + + public int asInt(int def) { + return NumberUtil.getInteger(this.getTextRaw(), def); + } + + public int asAnyInt(int def) { + return NumberUtil.getAnyInteger(this.getTextRaw(), def); + } + + public double asDouble() { + return this.asDouble(0D); + } + + public double asDouble(double def) { + return NumberUtil.getDouble(this.getTextRaw(), def); + } + + @NotNull + public UniDouble asUniDouble() { + return this.asUniDouble(0, 0); + } + + @NotNull + public UniDouble asUniDouble(double min, double max) { + String[] split = this.getTextRaw().split(" "); + return UniDouble.of(NumberUtil.getDouble(split[0], min), NumberUtil.getDouble(split.length >= 2 ? split[1] : split[0], max)); + } + + @NotNull + public UniInt asUniInt() { + return this.asUniDouble().asInt(); + } + + public double asAnyDouble(double def) { + return NumberUtil.getAnyDouble(this.getTextRaw(), def); + } + + @Nullable + public > E asEnum(@NotNull Class clazz) { + return StringUtil.getEnum(this.getTextRaw(), clazz).orElse(null); + } + + @NotNull + public > E asEnum(@NotNull Class clazz, @NotNull E def) { + return StringUtil.getEnum(this.getTextRaw(), clazz).orElse(def); + } + + @NotNull + public String getText() { + return text; + } + + @NotNull + public String getTextRaw() { + return textRaw; + } + + @NotNull + public String getTextColored() { + return textColored; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/integration/VaultHook.java b/src/main/java/su/nightexpress/nightcore/integration/VaultHook.java new file mode 100644 index 0000000..bf3fb7c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/integration/VaultHook.java @@ -0,0 +1,162 @@ +package su.nightexpress.nightcore.integration; + +import net.milkbowl.vault.chat.Chat; +import net.milkbowl.vault.economy.Economy; +import net.milkbowl.vault.permission.Permission; +import org.bukkit.Bukkit; +import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; +import org.bukkit.event.server.ServiceRegisterEvent; +import org.bukkit.plugin.RegisteredServiceProvider; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Plugins; + +import java.util.Collections; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class VaultHook { + + private static Economy economy; + private static Permission permission; + private static Chat chat; + + public static void setup() { + setPermission(); + setEconomy(); + setChat(); + } + + public static void shutdown() { + economy = null; + permission = null; + chat = null; + } + + @Nullable + private static T getProvider(@NotNull Class clazz) { + RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(clazz); + return rsp == null ? null : rsp.getProvider(); + } + + private static void setPermission() { + permission = getProvider(Permission.class); + if (permission != null) { + Plugins.CORE.info("Found permissions provider: " + permission.getName()); + } + } + + private static void setEconomy() { + economy = getProvider(Economy.class); + if (economy != null) { + Plugins.CORE.info("Found economy provider: " + economy.getName()); + } + } + + private static void setChat() { + chat = getProvider(Chat.class); + if (chat != null) { + Plugins.CORE.info("Found chat provider: " + chat.getName()); + } + } + + public static void onServiceRegisterEvent(@NotNull ServiceRegisterEvent event) { + Object provider = event.getProvider().getProvider(); + + if (economy == null && provider instanceof Economy) { + setEconomy(); + } + else if (permission == null && provider instanceof Permission) { + setPermission(); + } + else if (chat == null && provider instanceof Chat) { + setChat(); + } + } + + public static boolean hasPermissions() { + return getPermissions() != null; + } + + @Nullable + public static Permission getPermissions() { + return permission; + } + + public static boolean hasChat() { + return getChat() != null; + } + + @Nullable + public static Chat getChat() { + return chat; + } + + public static boolean hasEconomy() { + return getEconomy() != null; + } + + @Nullable + public static Economy getEconomy() { + return economy; + } + + @NotNull + public static String getEconomyName() { + return hasEconomy() ? economy.getName() : "null"; + } + + @NotNull + public static String getPermissionGroup(@NotNull Player player) { + if (!hasPermissions() || !permission.hasGroupSupport()) return ""; + + String group = permission.getPrimaryGroup(player); + return group == null ? "" : group.toLowerCase(); + } + + @NotNull + public static Set getPermissionGroups(@NotNull Player player) { + if (!hasPermissions() || !permission.hasGroupSupport()) return Collections.emptySet(); + + String[] groups = permission.getPlayerGroups(player); + if (groups == null) groups = new String[] {getPermissionGroup(player)}; + + return Stream.of(groups).map(String::toLowerCase).collect(Collectors.toSet()); + } + + @NotNull + public static String getPrefix(@NotNull Player player) { + return hasChat() ? chat.getPlayerPrefix(player) : ""; + } + + @NotNull + public static String getSuffix(@NotNull Player player) { + return hasChat() ? chat.getPlayerSuffix(player) : ""; + } + + public static double getBalance(@NotNull Player player) { + return economy.getBalance(player); + } + + public static double getBalance(@NotNull OfflinePlayer player) { + return economy.getBalance(player); + } + + public static boolean addMoney(@NotNull Player player, double amount) { + return addMoney((OfflinePlayer) player, amount); + } + + public static boolean addMoney(@NotNull OfflinePlayer player, double amount) { + return economy.depositPlayer(player, amount).transactionSuccess(); + } + + public static boolean takeMoney(@NotNull Player player, double amount) { + return takeMoney((OfflinePlayer) player, amount); + } + + public static boolean takeMoney(@NotNull OfflinePlayer player, double amount) { + return economy.withdrawPlayer(player, Math.abs(amount)).transactionSuccess(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/LangAssets.java b/src/main/java/su/nightexpress/nightcore/language/LangAssets.java new file mode 100644 index 0000000..f9ba9ce --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/LangAssets.java @@ -0,0 +1,120 @@ +package su.nightexpress.nightcore.language; + +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.EntityType; +import org.bukkit.potion.PotionEffectType; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCore; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.*; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.util.Optional; + +public class LangAssets { + + private static FileConfig config; + + public static void load() { + NightCore core = Plugins.CORE; + String langCode = core.getLanguage(); + + String assetsCode = downloadAssets(core, langCode); + config = FileConfig.loadOrExtract(core, LangManager.DIR_LANG, getFileName(assetsCode)); + } + + @NotNull + private static String downloadAssets(@NotNull NightCore plugin, @NotNull String langCode) { + File file = new File(plugin.getDataFolder().getAbsolutePath() + LangManager.DIR_LANG, getFileName(langCode)); + if (file.exists()) return langCode; + + FileUtil.create(file); + + String url = "https://github.com/nulli0n/NexEngine-spigot/raw/master/assets/" + langCode + ".yml"; + try (BufferedInputStream in = new BufferedInputStream(new URL(url).openStream()); + FileOutputStream fileOutputStream = new FileOutputStream(file)) { + plugin.info("Downloading '" + langCode + "' assets from github..."); + byte[] dataBuffer = new byte[1024]; + int bytesRead; + while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) { + fileOutputStream.write(dataBuffer, 0, bytesRead); + } + return langCode; + } + catch (IOException exception) { + //exception.printStackTrace(); + plugin.error("Could not download language assets for '" + langCode + "' (no such assets?)."); + return LangManager.isDefault(langCode) ? langCode : downloadAssets(plugin, LangManager.DEFAULT_LANGUAGE); + } + } + + @NotNull + private static String getFileName(@NotNull String langCode) { + return "assets_" + langCode + ".yml"; + } + + @NotNull + public static FileConfig getConfig() { + return config; + } + + @NotNull + public static String get(@NotNull PotionEffectType type) { + return getAsset("PotionEffectType", type); + } + + @NotNull + public static String get(@NotNull EntityType type) { + return getAsset("EntityType", type); + } + + @NotNull + public static String get(@NotNull Material type) { + return getAsset("Material", type); + } + + @NotNull + public static String get(@NotNull World world) { + return getOrCreate("World", world); + } + + @NotNull + public static String get(@NotNull Enchantment enchantment) { + return getOrCreate("Enchantment", enchantment); + } + + @NotNull + public static String getAsset(@NotNull String path, @NotNull Keyed keyed) { + return getAsset(path, keyed.getKey().getKey()); + } + + @NotNull + public static String getAsset(@NotNull String path, @NotNull String nameRaw) { + return getAsset(path + "." + nameRaw).orElse(nameRaw); + } + + @NotNull + public static Optional getAsset(@NotNull String path) { + return Optional.ofNullable(config.getString(path)).map(Colorizer::apply); + } + + @NotNull + public static String getOrCreate(@NotNull String path, @NotNull Keyed keyed) { + return getOrCreate(path, keyed.getKey().getKey()); + } + + @NotNull + public static String getOrCreate(@NotNull String path, @NotNull String nameRaw) { + config.addMissing(path + "." + nameRaw, StringUtil.capitalizeUnderscored(nameRaw)); + config.saveChanges(); + + return getAsset(path, nameRaw); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/LangManager.java b/src/main/java/su/nightexpress/nightcore/language/LangManager.java new file mode 100644 index 0000000..c94bf2f --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/LangManager.java @@ -0,0 +1,94 @@ +package su.nightexpress.nightcore.language; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.manager.SimpleManager; +import su.nightexpress.nightcore.language.entry.LangEntry; +import su.nightexpress.nightcore.util.FileUtil; +import su.nightexpress.nightcore.util.Reflex; +import su.nightexpress.nightcore.util.StringUtil; + +import java.io.File; +import java.io.InputStream; + +public class LangManager extends SimpleManager { + + public static final String DEFAULT_LANGUAGE = "en"; + public static final String DIR_LANG = "/lang/"; + + private FileConfig config; + + public LangManager(@NotNull NightCorePlugin plugin) { + super(plugin); + } + + @Override + protected void onLoad() { + String langCode = this.plugin.getLanguage(); + String realCode = this.extractConfig(langCode); + this.config = new FileConfig(this.plugin.getDataFolder() + DIR_LANG, this.getFileName(realCode)); + } + + @Override + protected void onShutdown() { + + } + + @NotNull + private String extractConfig(@NotNull String langCode) { + String fileName = this.getFileName(langCode); + + File file = new File(plugin.getDataFolder() + DIR_LANG, fileName); + if (file.exists()) return langCode; + + try { + InputStream input = plugin.getClass().getResourceAsStream(DIR_LANG + fileName); + if (input != null) { + FileUtil.create(file); + FileUtil.copy(input, file); + return langCode; + } + return isDefault(langCode) ? langCode : this.extractConfig(DEFAULT_LANGUAGE); + } + catch (Exception exception) { + exception.printStackTrace(); + return isDefault(langCode) ? langCode : this.extractConfig(DEFAULT_LANGUAGE); + } + } + + public void loadEntries(@NotNull Class clazz) { + Reflex.getFields(clazz, LangEntry.class).forEach(entry -> { + entry.load(this.plugin); + }); + } + + /*public void loadEditor(@NotNull Class clazz) { + Reflex.getFields(clazz, LangItem.class).forEach(entry -> { + entry.load(this.plugin); + }); + }*/ + + public void loadEnum(@NotNull Class> clazz) { + for (Object eName : clazz.getEnumConstants()) { + String name = eName.toString(); + String path = clazz.getSimpleName() + "." + name; + String val = StringUtil.capitalizeUnderscored(name); + this.getConfig().addMissing(path, val); + } + } + + public static boolean isDefault(@NotNull String langCode) { + return langCode.equalsIgnoreCase(DEFAULT_LANGUAGE); + } + + @NotNull + public String getFileName(@NotNull String langCode) { + return "messages_" + langCode + ".yml"; + } + + @NotNull + public FileConfig getConfig() { + return config; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/entry/LangEntry.java b/src/main/java/su/nightexpress/nightcore/language/entry/LangEntry.java new file mode 100644 index 0000000..fba687c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/entry/LangEntry.java @@ -0,0 +1,31 @@ +package su.nightexpress.nightcore.language.entry; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; + +public abstract class LangEntry { + + protected final String path; + protected final String defaultText; + + public LangEntry(@NotNull String path, @NotNull String defaultText) { + this.path = path; + this.defaultText = defaultText; + } + + public abstract boolean write(@NotNull FileConfig config); + + @NotNull + public abstract T load(@NotNull NightCorePlugin plugin); + + @NotNull + public String getPath() { + return path; + } + + @NotNull + public String getDefaultText() { + return defaultText; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/entry/LangItem.java b/src/main/java/su/nightexpress/nightcore/language/entry/LangItem.java new file mode 100644 index 0000000..a881c85 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/entry/LangItem.java @@ -0,0 +1,227 @@ +package su.nightexpress.nightcore.language.entry; + +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.ItemUtil; +import su.nightexpress.nightcore.util.Pair; +import su.nightexpress.nightcore.util.text.NightMessage; +import su.nightexpress.nightcore.util.text.WrappedMessage; +import su.nightexpress.nightcore.util.text.tag.Tags; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class LangItem extends LangEntry>> { + + private final List defaultLore; + + private String localizedName; + private List localizedLore; + + private WrappedMessage wrappedName; + private List wrappedLore; + + public LangItem(@NotNull String key, @NotNull String defaultName, @NotNull List defaultLore) { + super(key, defaultName); + this.defaultLore = defaultLore; + } + + @NotNull + public static LangItem of(@NotNull String key, @NotNull String name, @NotNull String... lore) { + return new LangItem(key, name, Arrays.asList(lore)); + } + + @Override + public boolean write(@NotNull FileConfig config) { + if (!config.contains(this.getPath())) { + config.set(this.getPath() + ".Name", this.getDefaultName()); + config.set(this.getPath() + ".Lore", this.getDefaultLore()); + return true; + } + return false; + } + + @Override + @NotNull + public Pair> load(@NotNull NightCorePlugin plugin) { + FileConfig config = plugin.getLang(); + + this.write(config); + + this.setLocalizedName(config.getString(this.getPath() + ".Name", this.getDefaultName())); + this.setLocalizedLore(config.getStringList(this.getPath() + ".Lore")); + + return Pair.of(this.getLocalizedName(), this.getLocalizedLore()); + } + + public void apply(@NotNull ItemStack item) { + ItemUtil.editMeta(item, meta -> { + meta.setDisplayName(this.getWrappedName().toLegacy()); + meta.setLore(this.getWrappedLore().stream().map(WrappedMessage::toLegacy).toList()); + }); + } + + @NotNull + public String getDefaultName() { + return this.getDefaultText(); + } + + @NotNull + public List getDefaultLore() { + return defaultLore; + } + + @NotNull + public String getLocalizedName() { + return localizedName; + } + + public void setLocalizedName(@NotNull String localizedName) { + this.localizedName = localizedName; + this.wrappedName = NightMessage.create(localizedName); + } + + @NotNull + public List getLocalizedLore() { + return localizedLore; + } + + public void setLocalizedLore(@NotNull List localizedLore) { + this.localizedLore = localizedLore; + this.wrappedLore = new ArrayList<>(); + localizedLore.forEach(line -> wrappedLore.add(NightMessage.create(line))); + } + + @NotNull + public WrappedMessage getWrappedName() { + return wrappedName; + } + + @NotNull + public List getWrappedLore() { + return wrappedLore; + } + + protected static final String LMB = "Left-Click"; + protected static final String RMB = "Right-Click"; + protected static final String DROP_KEY = "[Q] Drop Key"; + protected static final String SWAP_KEY = "[F] Swap Key"; + protected static final String SHIFT_LMB = "Shift-Left"; + protected static final String SHIFT_RMB = "Shift-Right"; + protected static final String DRAG_DROP = "Drag & Drop"; + + @NotNull + public static Builder builder(@NotNull String key) { + return new Builder(key); + } + + public static final class Builder { + + private final String key; + private String name; + private final List lore; + + public Builder(@NotNull String key) { + this.key = key; + this.name = ""; + this.lore = new ArrayList<>(); + } + + @NotNull + public LangItem build() { + return new LangItem(this.key, this.name, this.lore); + } + + @NotNull + public Builder name(@NotNull String name) { + this.name = Tags.YELLOW.enclose(Tags.BOLD.enclose(name)); + return this; + } + + @NotNull + public Builder text(@NotNull String... text) { + for (String str : text) { + this.addLore(Tags.GRAY.enclose(str)); + } + return this; + } + + @NotNull + public Builder textRaw(@NotNull String... text) { + return this.addLore(text); + } + + @NotNull + public Builder currentHeader() { + return this.addLore(Tags.YELLOW.enclose(Tags.BOLD.enclose("Current:"))); + } + + @NotNull + public Builder current(@NotNull String type, @NotNull String value) { + return this.addLore(Tags.YELLOW.enclose("▪ " + Tags.GRAY.enclose(type) + ": " + value)); + } + + @NotNull + public Builder leftClick(@NotNull String action) { + return this.click(LMB, action); + } + + @NotNull + public Builder rightClick(@NotNull String action) { + return this.click(RMB, action); + } + + @NotNull + public Builder shiftLeft(@NotNull String action) { + return this.click(SHIFT_LMB, action); + } + + @NotNull + public Builder shiftRight(@NotNull String action) { + return this.click(SHIFT_RMB, action); + } + + @NotNull + public Builder dropKey(@NotNull String action) { + return this.click(DROP_KEY, action); + } + + @NotNull + public Builder swapKey(@NotNull String action) { + return this.click(SWAP_KEY, action); + } + + @NotNull + public Builder dragAndDrop(@NotNull String action) { + return this.click(DRAG_DROP, action); + } + + @NotNull + public Builder click(@NotNull String click, @NotNull String action) { + return this.addLore(Tags.GRAY.enclose("(" + Tags.WHITE.enclose(click) + " to " + action + ")")); + } + + @NotNull + public Builder emptyLine() { + return this.addLore(""); + } + + /*@NotNull + private Builder addLore(@NotNull String prefix, @NotNull String... text) { + for (String str : text) { + this.lore.add(prefix + str); + } + return this; + }*/ + + @NotNull + private Builder addLore(@NotNull String... text) { + Collections.addAll(this.lore, text); + return this; + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/entry/LangString.java b/src/main/java/su/nightexpress/nightcore/language/entry/LangString.java new file mode 100644 index 0000000..16adc86 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/entry/LangString.java @@ -0,0 +1,64 @@ +package su.nightexpress.nightcore.language.entry; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.text.NightMessage; +import su.nightexpress.nightcore.util.text.WrappedMessage; + +public class LangString extends LangEntry { + + private String string; + private WrappedMessage message; + + public LangString(@NotNull String path, @NotNull String defaultText) { + super(path, defaultText); + } + + @NotNull + public static LangString of(@NotNull String path, @NotNull String defaultText) { + return new LangString(path, defaultText); + } + + @Override + public boolean write(@NotNull FileConfig config) { + if (!config.contains(this.getPath())) { + String textDefault = this.getDefaultText(); + config.set(this.getPath(), textDefault); + return true; + } + return false; + } + + @Override + @NotNull + public String load(@NotNull NightCorePlugin plugin) { + FileConfig config = plugin.getLang(); + + this.write(config); + String text = config.getString(this.getPath(), this.getPath()); + this.setString(text); + + return this.getString(); + } + + @NotNull + public String getString() { + return string; + } + + public void setString(@NotNull String string) { + this.string = string; + this.message = NightMessage.from(string); + } + + @NotNull + public WrappedMessage getMessage() { + return this.message; + } + + @NotNull + public String getLegacy() { + return this.getMessage().toLegacy(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/entry/LangText.java b/src/main/java/su/nightexpress/nightcore/language/entry/LangText.java new file mode 100644 index 0000000..879321e --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/entry/LangText.java @@ -0,0 +1,67 @@ +package su.nightexpress.nightcore.language.entry; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.language.message.LangMessage; +import su.nightexpress.nightcore.util.Placeholders; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class LangText extends LangEntry { + + private LangMessage message; + + public LangText(@NotNull String path, @NotNull String... defaultText) { + super(path, String.join("\n", defaultText)); + } + + @NotNull + public static LangText of(@NotNull String path, @NotNull String defaultText) { + return new LangText(path, defaultText); + } + + @NotNull + public static LangText of(@NotNull String path, @NotNull String... defaultText) { + return new LangText(path, defaultText); + } + + @Override + public boolean write(@NotNull FileConfig config) { + if (!config.contains(this.getPath())) { + String textDefault = this.getDefaultText(); + String[] textSplit = textDefault.split("\n"); + config.set(this.getPath(), textSplit.length > 1 ? Arrays.asList(textSplit) : textDefault); + return true; + } + return false; + } + + @Override + @NotNull + public LangMessage load(@NotNull NightCorePlugin plugin) { + FileConfig config = plugin.getLang(); + + this.write(config); + + List text = new ArrayList<>(config.getStringList(this.getPath())); + if (text.isEmpty()) { + text.add(config.getString(this.getPath(), this.getPath())); + } + + this.setMessage(LangMessage.parse(plugin, String.join(Placeholders.TAG_LINE_BREAK, text))); + + return this.getMessage(); + } + + @NotNull + public LangMessage getMessage() { + return message; + } + + public void setMessage(@NotNull LangMessage message) { + this.message = message; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangMessage.java b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangMessage.java new file mode 100644 index 0000000..db59b50 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangMessage.java @@ -0,0 +1,179 @@ +package su.nightexpress.nightcore.language.legacy; + +import me.clip.placeholderapi.PlaceholderAPI; +import org.bukkit.Bukkit; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.language.message.OutputType; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.Players; +import su.nightexpress.nightcore.util.message.NexParser; +import su.nightexpress.nightcore.util.regex.TimedMatcher; +import su.nightexpress.nightcore.util.wrapper.UniSound; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiConsumer; +import java.util.function.Predicate; +import java.util.function.UnaryOperator; +import java.util.regex.Pattern; + +@Deprecated +public class LegacyLangMessage { + + private static final Pattern OPTIONS_PATTERN = Pattern.compile("<\\!(.*?)\\!>"); + + private final NightCorePlugin plugin; + private final LegacyMessageOptions options; + private final List defaultText; + + private List text; + + public LegacyLangMessage(@NotNull NightCorePlugin plugin, @NotNull List defaultText) { + this.plugin = plugin; + this.options = new LegacyMessageOptions(); + this.defaultText = defaultText; + this.setText(defaultText); + this.setOptions(); + } + + private LegacyLangMessage(@NotNull LegacyLangMessage from) { + this.plugin = from.plugin; + this.options = from.options.copy(); + this.defaultText = new ArrayList<>(from.defaultText); + this.text = new ArrayList<>(from.text); + } + + private void setOptions() { + List text = this.getText(); + if (text.isEmpty()) return; + + String msg = text.get(0); + TimedMatcher matcher = TimedMatcher.create(OPTIONS_PATTERN, msg); + if (!matcher.find()) return; + + String optionTag = matcher.getMatcher().group(0); + String optionArgs = matcher.getMatcher().group(1).trim(); + this.text.set(0, msg.replace(optionTag, "")); + this.text.removeIf(String::isEmpty); + this.options.read(optionArgs); + } + + @NotNull + public List getDefaultText() { + return this.defaultText; + } + + @NotNull + public List getText() { + return this.text; + } + + @NotNull + public List getText(@NotNull CommandSender sender) { + if (!this.options.hasPlaceholderAPI() || !(sender instanceof Player player)) return this.getText(); + + List text = new ArrayList<>(this.getText()); + text.replaceAll(line -> PlaceholderAPI.setPlaceholders(player, line)); + return text; + } + + private void setText(@NotNull List text) { + this.text = Colorizer.apply(text); + this.text.removeIf(String::isEmpty); + } + + @NotNull + public LegacyLangMessage replace(@NotNull String var, @NotNull Object replacer) { + return this.replace(str -> str.replace(var, String.valueOf(replacer))); + } + + @NotNull + public LegacyLangMessage replace(@NotNull UnaryOperator replacer) { + if (this.isEmpty()) return this; + + LegacyLangMessage msgCopy = new LegacyLangMessage(this); + msgCopy.getText().replaceAll(replacer); + return msgCopy; + } + + @NotNull + public LegacyLangMessage replace(@NotNull Predicate predicate, @NotNull BiConsumer> replacer) { + if (this.isEmpty()) return this; + + LegacyLangMessage msgCopy = new LegacyLangMessage(this); + List replaced = new ArrayList<>(); + msgCopy.getText().forEach(line -> { + if (predicate.test(line)) { + replacer.accept(line, replaced); + return; + } + replaced.add(line); + }); + msgCopy.setText(replaced); + return msgCopy; + } + + public boolean isEmpty() { + return (this.options.getType() == OutputType.NONE || this.getText().isEmpty()); + } + + public void broadcast() { + if (this.isEmpty()) return; + + Bukkit.getServer().getOnlinePlayers().forEach(this::send); + this.send(Bukkit.getServer().getConsoleSender()); + } + + public void send(@NotNull CommandSender sender) { + if (this.isEmpty()) return; + + if (this.options.getSound() != null && sender instanceof Player player) { + UniSound.of(this.options.getSound()).play(player); + } + + if (this.options.getType() == OutputType.CHAT) { + String prefix = this.options.hasPrefix() ? plugin.getPrefix() : ""; + this.getText(sender).forEach(line -> { + Players.sendRichMessage(sender, prefix + line); + }); + return; + } + + if (sender instanceof Player player) { + if (this.options.getType() == OutputType.ACTION_BAR) { + Players.sendActionBar(player, String.join(" ", this.getText(player))); + } + else if (this.options.getType() == OutputType.TITLES) { + List list = this.getText(player); + String title = list.size() > 0 ? NexParser.toPlainText(list.get(0)) : ""; + String subtitle = list.size() > 1 ? NexParser.toPlainText(list.get(1)) : ""; + player.sendTitle(title, subtitle, this.options.getTitleTimes()[0], this.options.getTitleTimes()[1], this.options.getTitleTimes()[2]); + } + } + } + + /*@NotNull + public List asList() { + return this.asList(this.getText()); + } + + @NotNull + public List asList(@NotNull CommandSender sender) { + return this.asList(this.getText(sender)); + } + + @NotNull + private List asList(@NotNull String localized) { + return this.isEmpty() ? Collections.emptyList() : Stream.of(localized.split("\\\\n")) + .filter(Predicate.not(String::isEmpty)).toList(); + } + + @NotNull + @Deprecated + public String normalizeLines() { + return String.join("\n", this.asList()); + }*/ +} diff --git a/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangString.java b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangString.java new file mode 100644 index 0000000..e70294c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangString.java @@ -0,0 +1,53 @@ +package su.nightexpress.nightcore.language.legacy; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.language.entry.LangEntry; +import su.nightexpress.nightcore.util.Colorizer; + +@Deprecated +public class LegacyLangString extends LangEntry { + + private String string; + + public LegacyLangString(@NotNull String path, @NotNull String defaultText) { + super(path, defaultText); + } + + @NotNull + public static LegacyLangString of(@NotNull String path, @NotNull String defaultText) { + return new LegacyLangString(path, defaultText); + } + + @Override + public boolean write(@NotNull FileConfig config) { + if (!config.contains(this.getPath())) { + String textDefault = this.getDefaultText(); + config.set(this.getPath(), textDefault); + return true; + } + return false; + } + + @Override + @NotNull + public String load(@NotNull NightCorePlugin plugin) { + FileConfig config = plugin.getLang(); + + this.write(config); + String text = config.getString(this.getPath(), "<" + this.getPath() + ">"); + this.setString(text); + + return this.getString(); + } + + @NotNull + public String getString() { + return string; + } + + public void setString(@NotNull String string) { + this.string = Colorizer.apply(string); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangText.java b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangText.java new file mode 100644 index 0000000..3e4d6f3 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyLangText.java @@ -0,0 +1,68 @@ +package su.nightexpress.nightcore.language.legacy; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.language.entry.LangEntry; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Deprecated +public class LegacyLangText extends LangEntry { + + private LegacyLangMessage message; + + public LegacyLangText(@NotNull String path, @NotNull String... defaultText) { + super(path, String.join("\n", defaultText)); + } + + @NotNull + public static LegacyLangText of(@NotNull String path, @NotNull String defaultText) { + return new LegacyLangText(path, defaultText); + } + + @NotNull + public static LegacyLangText of(@NotNull String path, @NotNull String... defaultText) { + return new LegacyLangText(path, defaultText); + } + + @Override + public boolean write(@NotNull FileConfig config) { + if (!config.contains(this.getPath())) { + String textDefault = this.getDefaultText(); + String[] textSplit = textDefault.split("\n"); + config.set(this.getPath(), textSplit.length > 1 ? Arrays.asList(textSplit) : textDefault); + return true; + } + return false; + } + + @Override + @NotNull + public LegacyLangMessage load(@NotNull NightCorePlugin plugin) { + FileConfig config = plugin.getLang(); + + this.write(config); + + List text = new ArrayList<>(config.getStringList(this.getPath())); + if (text.isEmpty()) { + text.add(config.getString(this.getPath(), "<" + this.getPath() + ">")); + } + + //String text = !list.isEmpty() ? String.join("\\n", list) : config.getString(this.getPath(), "<" + this.getPath() + ">"); + this.setMessage(new LegacyLangMessage(plugin, text)); + + return this.getMessage(); + } + + @NotNull + public LegacyLangMessage getMessage() { + return message; + } + + public void setMessage(@NotNull LegacyLangMessage message) { + this.message = message; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOption.java b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOption.java new file mode 100644 index 0000000..6a7617c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOption.java @@ -0,0 +1,26 @@ +package su.nightexpress.nightcore.language.legacy; + +import org.jetbrains.annotations.NotNull; + +import java.util.regex.Pattern; + +@Deprecated +public enum LegacyMessageOption { + + PREFIX("prefix"), + SOUND("sound"), + TYPE("type"), + PAPI("papi"), + ; + + private final Pattern pattern; + + LegacyMessageOption(@NotNull String name) { + this.pattern = Pattern.compile(name + ":(?:'|\")(.*?)(?:'|\")(?=>|\\s|$)"); + } + + @NotNull + public Pattern getPattern() { + return pattern; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOptions.java b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOptions.java new file mode 100644 index 0000000..f62a985 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/legacy/LegacyMessageOptions.java @@ -0,0 +1,86 @@ +package su.nightexpress.nightcore.language.legacy; + +import org.bukkit.Sound; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.language.message.OutputType; +import su.nightexpress.nightcore.util.NumberUtil; +import su.nightexpress.nightcore.util.Plugins; +import su.nightexpress.nightcore.util.StringUtil; +import su.nightexpress.nightcore.util.regex.TimedMatcher; + +@Deprecated +public class LegacyMessageOptions { + + private OutputType type; + private boolean hasPrefix; + private boolean papi; + private Sound sound; + private int[] titleTimes; + + public LegacyMessageOptions() { + this.type = OutputType.CHAT; + this.hasPrefix = true; + } + + @NotNull + public LegacyMessageOptions copy() { + LegacyMessageOptions copy = new LegacyMessageOptions(); + copy.type = this.type; + copy.hasPrefix = this.hasPrefix; + copy.papi = this.papi; + copy.sound = this.sound; + copy.titleTimes = this.titleTimes; + return copy; + } + + public void read(@NotNull String matchOptions) { + for (LegacyMessageOption option : LegacyMessageOption.values()) { + TimedMatcher matcherParam = TimedMatcher.create(option.getPattern(), matchOptions); + if (!matcherParam.find()) continue; + + String optionValue = matcherParam.getMatcher().group(1).stripLeading(); + switch (option) { + case TYPE -> { + String[] split = optionValue.split(":"); + this.type = StringUtil.getEnum(split[0], OutputType.class).orElse(OutputType.CHAT); + if (this.type == OutputType.TITLES) { + this.titleTimes = new int[3]; + if (split.length >= 4) { + this.titleTimes[0] = NumberUtil.getInteger(split[1]); + this.titleTimes[1] = NumberUtil.getAnyInteger(split[2], -1); + this.titleTimes[2] = NumberUtil.getInteger(split[3]); + } + + if (this.titleTimes[1] < 0) this.titleTimes[1] = Short.MAX_VALUE; + } + } + case PREFIX -> this.hasPrefix = Boolean.parseBoolean(optionValue); + case PAPI -> this.papi = Boolean.parseBoolean(optionValue) && Plugins.hasPlaceholderAPI(); + case SOUND -> this.sound = StringUtil.getEnum(optionValue, Sound.class).orElse(null); + } + } + } + + @NotNull + public OutputType getType() { + return type; + } + + public boolean hasPrefix() { + return this.hasPrefix; + } + + public boolean hasPlaceholderAPI() { + return this.papi; + } + + @Nullable + public Sound getSound() { + return sound; + } + + public int[] getTitleTimes() { + return titleTimes; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/message/LangMessage.java b/src/main/java/su/nightexpress/nightcore/language/message/LangMessage.java new file mode 100644 index 0000000..0c2d2c0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/message/LangMessage.java @@ -0,0 +1,231 @@ +package su.nightexpress.nightcore.language.message; + +import me.clip.placeholderapi.PlaceholderAPI; +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.ComponentBuilder; +import net.md_5.bungee.api.chat.TextComponent; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.core.CoreConfig; +import su.nightexpress.nightcore.language.tag.MessageDecorator; +import su.nightexpress.nightcore.language.tag.MessageTags; +import su.nightexpress.nightcore.util.Placeholders; +import su.nightexpress.nightcore.util.Players; +import su.nightexpress.nightcore.util.text.NightMessage; +import su.nightexpress.nightcore.util.text.WrappedMessage; +import su.nightexpress.nightcore.util.text.tag.api.DynamicTag; +import su.nightexpress.nightcore.util.text.tag.api.Tag; +import su.nightexpress.nightcore.util.wrapper.UniSound; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.UnaryOperator; + +public class LangMessage { + + private final NightCorePlugin plugin; + private final String defaultText; + private final MessageOptions options; + private final WrappedMessage message; + + public LangMessage(@NotNull NightCorePlugin plugin, @NotNull String defaultText, @NotNull MessageOptions options) { + this.plugin = plugin; + this.defaultText = defaultText; + this.options = options; + this.message = NightMessage.from(defaultText); + if (CoreConfig.MODERN_TEXT_PRECOMPILE_LANG.get()) { + this.message.compile(); + } + } + + private LangMessage(@NotNull LangMessage from) { + this.plugin = from.plugin; + this.defaultText = from.defaultText; + this.options = from.options.copy(); + this.message = from.message.copy(); + } + + @NotNull + public static LangMessage parse(@NotNull NightCorePlugin plugin, @NotNull String string) { + MessageOptions options = new MessageOptions(); + StringBuilder builder = new StringBuilder(); + + int length = string.length(); + for (int index = 0; index < length; index++) { + char letter = string.charAt(index); + + Tag: + if (letter == Tag.OPEN_BRACKET && index != (length - 1)) { + int indexEnd = string.indexOf(Tag.CLOSE_BRACKET, index); + if (indexEnd == -1) break Tag; + + char next = string.charAt(index + 1); + if (next == Tag.CLOSE_BRACKET) break Tag; + + String leading = string.substring(index + 1); + String brackets = string.substring(index + 1, indexEnd); + + Tag tag = MessageTags.getTag(brackets); + + if (tag == null) { + for (Tag registered : MessageTags.getTags()) { + String tagName = registered.getName(); + if (leading.startsWith(tagName)) { + char latest = leading.charAt(tagName.length()); + + if (latest == Tag.CLOSE_BRACKET || registered instanceof DynamicTag) { + tag = registered; + break; + } + } + } + } + if (!(tag instanceof MessageDecorator decorator)) break Tag; + + if (tag instanceof DynamicTag) { + int prefixSize = tag.getName().length() + 1; // 1 for semicolon + + String content = DynamicTag.parseQuotedContent(leading.substring(prefixSize)); + if (content == null) break Tag; + + decorator.apply(options, content); + + indexEnd = index + prefixSize + content.length() + 3; // 1 for close bracket, 2 for quotes + } + else { + decorator.apply(options, leading); + } + + index = indexEnd; + continue; + } + builder.append(letter); + } + + if (options.getOutputType() == OutputType.CHAT && options.hasPrefix()) { + builder.insert(0, plugin.getPrefix()); + } + + String text = builder.toString(); + + return new LangMessage(plugin, text, options); + } + + @NotNull + public String getDefaultText() { + return this.defaultText; + } + + @NotNull + public WrappedMessage getMessage() { + return this.message; + } + + @NotNull + public WrappedMessage getMessage(@NotNull CommandSender sender) { + if (!this.options.usePlaceholderAPI() || !(sender instanceof Player player)) return this.getMessage(); + + return this.message.copy().replace(line -> PlaceholderAPI.setPlaceholders(player, line)); + } + + @NotNull + public LangMessage replace(@NotNull String var, @NotNull Object replacer) { + return this.replace(str -> str.replace(var, String.valueOf(replacer))); + } + + @NotNull + public LangMessage replace(@NotNull String var, @NotNull Consumer> replacer) { + List list = new ArrayList<>(); + replacer.accept(list); + + return this.replace(var, list); + } + + @NotNull + public LangMessage replace(@NotNull String var, @NotNull List replacer) { + //String delimiter = CoreConfig.MODERN_TEXT_PRECOMPILE_LANG.get() ? "\n" : StandardTags.LINE_BREAK; + + return this.replace(str -> str.replace(var, String.join(Placeholders.TAG_LINE_BREAK, replacer))); + } + + @NotNull + public LangMessage replace(@NotNull UnaryOperator replacer) { + if (this.isDisabled()) return this; + + LangMessage copy = new LangMessage(this); + copy.getMessage().replace(replacer); + + return copy; + } + + /*@NotNull + public LangMessage replace(@NotNull Predicate predicate, @NotNull BiConsumer> replacer) { + if (this.isEmpty()) return this; + + LangMessage msgCopy = new LangMessage(this); + List replaced = new ArrayList<>(); + List text + + msgCopy.getText().forEach(line -> { + if (predicate.test(line)) { + replacer.accept(line, replaced); + return; + } + replaced.add(line); + }); + msgCopy.setText(replaced); + + return msgCopy; + }*/ + + public boolean isDisabled() { + return this.options.getOutputType() == OutputType.NONE; + } + + public void broadcast() { + if (this.isDisabled()) return; + + this.plugin.getServer().getOnlinePlayers().forEach(this::send); + this.send(this.plugin.getServer().getConsoleSender()); + } + + public void send(@NotNull CommandSender sender) { + if (this.isDisabled()) return; + + if (this.options.getSound() != null && sender instanceof Player player) { + UniSound.of(this.options.getSound()).play(player); + } + + if (this.options.getOutputType() == OutputType.CHAT) { + this.getMessage(sender).send(sender); + return; + } + + if (sender instanceof Player player) { + if (this.options.getOutputType() == OutputType.ACTION_BAR) { + Players.sendActionBar(player, this.getMessage(player)); + //player.spigot().sendMessage(ChatMessageType.ACTION_BAR, this.getMessage(player).parseIfAbsent()); + } + else if (this.options.getOutputType() == OutputType.TITLES) { + ComponentBuilder titleBuilder = new ComponentBuilder(); + ComponentBuilder subBuilder = new ComponentBuilder(); + ComponentBuilder current = titleBuilder; + + for (BaseComponent component : this.getMessage(player).parseIfAbsent()) { + if (component instanceof TextComponent textComponent && textComponent.getText().equals("\n")) { + current = subBuilder; + continue; + } + current.append(component); + } + + String title = TextComponent.toLegacyText(titleBuilder.create()); + String subtitle = TextComponent.toLegacyText(subBuilder.create()); + player.sendTitle(title, subtitle, this.options.getTitleTimes()[0], this.options.getTitleTimes()[1], this.options.getTitleTimes()[2]); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/su/nightexpress/nightcore/language/message/MessageOptions.java b/src/main/java/su/nightexpress/nightcore/language/message/MessageOptions.java new file mode 100644 index 0000000..2f7b109 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/message/MessageOptions.java @@ -0,0 +1,72 @@ +package su.nightexpress.nightcore.language.message; + +import org.bukkit.Sound; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class MessageOptions { + + private OutputType outputType; + private boolean hasPrefix; + private boolean usePlaceholderAPI; + private Sound sound; + private int[] titleTimes; + + public MessageOptions() { + this.setOutputType(OutputType.CHAT); + this.setHasPrefix(true); + } + + @NotNull + public MessageOptions copy() { + MessageOptions copy = new MessageOptions(); + copy.outputType = this.outputType; + copy.hasPrefix = this.hasPrefix; + copy.usePlaceholderAPI = this.usePlaceholderAPI; + copy.sound = this.sound; + copy.titleTimes = this.titleTimes; + return copy; + } + + @NotNull + public OutputType getOutputType() { + return outputType; + } + + public void setOutputType(OutputType outputType) { + this.outputType = outputType; + } + + public boolean hasPrefix() { + return hasPrefix; + } + + public void setHasPrefix(boolean hasPrefix) { + this.hasPrefix = hasPrefix; + } + + public boolean usePlaceholderAPI() { + return this.usePlaceholderAPI; + } + + public void setUsePlaceholderAPI(boolean usePlaceholderAPI) { + this.usePlaceholderAPI = usePlaceholderAPI; + } + + @Nullable + public Sound getSound() { + return sound; + } + + public void setSound(Sound sound) { + this.sound = sound; + } + + public int[] getTitleTimes() { + return titleTimes; + } + + public void setTitleTimes(int[] titleTimes) { + this.titleTimes = titleTimes; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/message/OutputType.java b/src/main/java/su/nightexpress/nightcore/language/message/OutputType.java new file mode 100644 index 0000000..59a1a44 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/message/OutputType.java @@ -0,0 +1,5 @@ +package su.nightexpress.nightcore.language.message; + +public enum OutputType { + CHAT, ACTION_BAR, TITLES, NONE, +} diff --git a/src/main/java/su/nightexpress/nightcore/language/tag/MessageDecorator.java b/src/main/java/su/nightexpress/nightcore/language/tag/MessageDecorator.java new file mode 100644 index 0000000..edc6627 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/tag/MessageDecorator.java @@ -0,0 +1,9 @@ +package su.nightexpress.nightcore.language.tag; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.language.message.MessageOptions; + +public interface MessageDecorator { + + void apply(@NotNull MessageOptions options, @NotNull String value); +} diff --git a/src/main/java/su/nightexpress/nightcore/language/tag/MessageTags.java b/src/main/java/su/nightexpress/nightcore/language/tag/MessageTags.java new file mode 100644 index 0000000..e558142 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/tag/MessageTags.java @@ -0,0 +1,48 @@ +package su.nightexpress.nightcore.language.tag; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.language.tag.impl.NoPrefixTag; +import su.nightexpress.nightcore.language.tag.impl.PlaceholderTag; +import su.nightexpress.nightcore.language.tag.impl.SoundTag; +import su.nightexpress.nightcore.language.tag.impl.OutputTag; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +public class MessageTags { + + private static final Map TAG_MAP = new HashMap<>(); + + public static final NoPrefixTag NO_PREFIX = new NoPrefixTag(); + public static final OutputTag OUTPUT = new OutputTag(); + public static final SoundTag SOUND = new SoundTag(); + public static final PlaceholderTag PLACEHOLDER = new PlaceholderTag(); + + static { + registerTags(NO_PREFIX, OUTPUT, SOUND, PLACEHOLDER); + } + + public static void registerTags(@NotNull Tag... tags) { + for (Tag tag : tags) { + registerTag(tag); + } + } + + public static void registerTag(@NotNull Tag tag, @NotNull String... aliases) { + TAG_MAP.put(tag.getName(), tag); + for (String alias : aliases) { + TAG_MAP.put(alias, tag); + } + } + + @NotNull + public static Collection getTags() { + return TAG_MAP.values(); + } + + public static Tag getTag(@NotNull String name) { + return TAG_MAP.get(name.toLowerCase()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/tag/impl/NoPrefixTag.java b/src/main/java/su/nightexpress/nightcore/language/tag/impl/NoPrefixTag.java new file mode 100644 index 0000000..594b1ee --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/tag/impl/NoPrefixTag.java @@ -0,0 +1,23 @@ +package su.nightexpress.nightcore.language.tag.impl; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.language.message.MessageOptions; +import su.nightexpress.nightcore.language.tag.MessageDecorator; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +public class NoPrefixTag extends Tag implements MessageDecorator { + + public NoPrefixTag() { + super("noprefix"); + } + + @Override + public int getWeight() { + return 0; + } + + @Override + public void apply(@NotNull MessageOptions options, @NotNull String value) { + options.setHasPrefix(false); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/tag/impl/OutputTag.java b/src/main/java/su/nightexpress/nightcore/language/tag/impl/OutputTag.java new file mode 100644 index 0000000..44ebb8e --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/tag/impl/OutputTag.java @@ -0,0 +1,53 @@ +package su.nightexpress.nightcore.language.tag.impl; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.language.message.MessageOptions; +import su.nightexpress.nightcore.language.message.OutputType; +import su.nightexpress.nightcore.language.tag.MessageDecorator; +import su.nightexpress.nightcore.util.NumberUtil; +import su.nightexpress.nightcore.util.StringUtil; +import su.nightexpress.nightcore.util.text.tag.api.DynamicTag; + +public class OutputTag extends DynamicTag implements MessageDecorator { + + public OutputTag() { + super("output"); + } + + @Override + public int getWeight() { + return 0; + } + + @NotNull + public String enclose(@NotNull OutputType type) { + String prefix = type.name().toLowerCase(); + return this.leading(null, prefix); + } + + @NotNull + public String enclose(int fade, int stay) { + String prefix = OutputType.TITLES.name().toLowerCase(); + return this.leading(null, prefix + ":" + fade + ":" + stay + ":" + fade); + } + + @Override + public void apply(@NotNull MessageOptions options, @NotNull String content) { + String[] split = content.split(":"); + OutputType outputType = StringUtil.getEnum(split[0], OutputType.class).orElse(OutputType.CHAT); + + options.setOutputType(outputType); + if (outputType == OutputType.TITLES) { + int[] titleTimes = new int[3]; + if (split.length >= 4) { + titleTimes[0] = NumberUtil.getInteger(split[1]); + titleTimes[1] = NumberUtil.getAnyInteger(split[2], -1); + titleTimes[2] = NumberUtil.getInteger(split[3]); + } + + if (titleTimes[1] < 0) titleTimes[1] = Short.MAX_VALUE; + + options.setTitleTimes(titleTimes); + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/tag/impl/PlaceholderTag.java b/src/main/java/su/nightexpress/nightcore/language/tag/impl/PlaceholderTag.java new file mode 100644 index 0000000..4894652 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/tag/impl/PlaceholderTag.java @@ -0,0 +1,23 @@ +package su.nightexpress.nightcore.language.tag.impl; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.language.message.MessageOptions; +import su.nightexpress.nightcore.language.tag.MessageDecorator; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +public class PlaceholderTag extends Tag implements MessageDecorator { + + public PlaceholderTag() { + super("papi"); + } + + @Override + public int getWeight() { + return 0; + } + + @Override + public void apply(@NotNull MessageOptions options, @NotNull String value) { + options.setUsePlaceholderAPI(true); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/language/tag/impl/SoundTag.java b/src/main/java/su/nightexpress/nightcore/language/tag/impl/SoundTag.java new file mode 100644 index 0000000..3f62b37 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/language/tag/impl/SoundTag.java @@ -0,0 +1,31 @@ +package su.nightexpress.nightcore.language.tag.impl; + +import org.bukkit.Sound; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.language.message.MessageOptions; +import su.nightexpress.nightcore.language.tag.MessageDecorator; +import su.nightexpress.nightcore.util.StringUtil; +import su.nightexpress.nightcore.util.text.tag.api.DynamicTag; + +public class SoundTag extends DynamicTag implements MessageDecorator { + + public SoundTag() { + super("sound"); + } + + @Override + public int getWeight() { + return 0; + } + + @NotNull + public String enclose(@NotNull Sound sound) { + return this.leading(null, sound.name().toLowerCase()); + } + + @Override + public void apply(@NotNull MessageOptions options, @NotNull String value) { + Sound sound = StringUtil.getEnum(value, Sound.class).orElse(null); + options.setSound(sound); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/manager/AbstractFileData.java b/src/main/java/su/nightexpress/nightcore/manager/AbstractFileData.java new file mode 100644 index 0000000..397aef8 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/manager/AbstractFileData.java @@ -0,0 +1,71 @@ +package su.nightexpress.nightcore.manager; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.StringUtil; + +import java.io.File; + +public abstract class AbstractFileData

{ + + protected final P plugin; + protected final File file; + private final String id; + + public AbstractFileData(@NotNull P plugin, @NotNull String filePath) { + this(plugin, new File(filePath)); + } + + public AbstractFileData(@NotNull P plugin, @NotNull File file) { + this(plugin, file, file.getName().replace(".yml", "")); + } + + public AbstractFileData(@NotNull P plugin, @NotNull String filePath, @NotNull String id) { + this(plugin, new File(filePath), id); + } + + public AbstractFileData(@NotNull P plugin, @NotNull File file, @NotNull String id) { + this.plugin = plugin; + this.file = file; + this.id = StringUtil.lowerCaseUnderscore(id); + } + + public final boolean load() { + FileConfig config = this.getConfig(); + if (!this.onLoad(config)) return false; + + config.saveChanges(); + return true; + } + + public final void save() { + FileConfig config = this.getConfig(); + this.onSave(config); + config.saveChanges(); + } + + protected abstract boolean onLoad(@NotNull FileConfig cfg); + + protected abstract void onSave(@NotNull FileConfig cfg); + + @NotNull + public final File getFile() { + return this.file; + } + + /*@NotNull + public P plugin() { + return this.plugin; + }*/ + + @NotNull + public final String getId() { + return this.id; + } + + @NotNull + public final FileConfig getConfig() { + return new FileConfig(this.getFile()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/manager/AbstractListener.java b/src/main/java/su/nightexpress/nightcore/manager/AbstractListener.java new file mode 100644 index 0000000..a27a292 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/manager/AbstractListener.java @@ -0,0 +1,19 @@ +package su.nightexpress.nightcore.manager; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; + +public abstract class AbstractListener

implements SimpeListener { + + @NotNull + public final P plugin; + + public AbstractListener(@NotNull P plugin) { + this.plugin = plugin; + } + + @Override + public void registerListeners() { + this.plugin.getPluginManager().registerEvents(this, this.plugin); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/manager/AbstractManager.java b/src/main/java/su/nightexpress/nightcore/manager/AbstractManager.java new file mode 100644 index 0000000..2c086ee --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/manager/AbstractManager.java @@ -0,0 +1,42 @@ +package su.nightexpress.nightcore.manager; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.util.wrapper.UniTask; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public abstract class AbstractManager

extends SimpleManager

{ + + protected final Set listeners; + protected final List tasks; + + public AbstractManager(@NotNull P plugin) { + super(plugin); + this.listeners = new HashSet<>(); + this.tasks = new ArrayList<>(); + } + + @Override + public void shutdown() { + this.tasks.forEach(UniTask::stop); + this.tasks.clear(); + this.listeners.forEach(SimpeListener::unregisterListeners); + this.listeners.clear(); + super.shutdown(); + } + + protected void addListener(@NotNull SimpeListener listener) { + if (this.listeners.add(listener)) { + listener.registerListeners(); + } + } + + protected void addTask(@NotNull UniTask task) { + this.tasks.add(task); + task.start(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/manager/SimpeListener.java b/src/main/java/su/nightexpress/nightcore/manager/SimpeListener.java new file mode 100644 index 0000000..2ea13c4 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/manager/SimpeListener.java @@ -0,0 +1,13 @@ +package su.nightexpress.nightcore.manager; + +import org.bukkit.event.HandlerList; +import org.bukkit.event.Listener; + +public interface SimpeListener extends Listener { + + void registerListeners(); + + default void unregisterListeners() { + HandlerList.unregisterAll(this); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/manager/SimpleManager.java b/src/main/java/su/nightexpress/nightcore/manager/SimpleManager.java new file mode 100644 index 0000000..2a4f484 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/manager/SimpleManager.java @@ -0,0 +1,35 @@ +package su.nightexpress.nightcore.manager; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; + +public abstract class SimpleManager

{ + + protected final P plugin; + + public SimpleManager(@NotNull P plugin) { + this.plugin = plugin; + } + + @NotNull + public P plugin() { + return this.plugin; + } + + public void setup() { + this.onLoad(); + } + + public void shutdown() { + this.onShutdown(); + } + + public void reload() { + this.shutdown(); + this.setup(); + } + + protected abstract void onLoad(); + + protected abstract void onShutdown(); +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/MenuListener.java b/src/main/java/su/nightexpress/nightcore/menu/MenuListener.java new file mode 100644 index 0000000..e918e68 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/MenuListener.java @@ -0,0 +1,83 @@ +package su.nightexpress.nightcore.menu; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryDragEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCore; +import su.nightexpress.nightcore.core.CoreConfig; +import su.nightexpress.nightcore.menu.api.Menu; +import su.nightexpress.nightcore.manager.AbstractListener; +import su.nightexpress.nightcore.menu.click.ClickResult; +import su.nightexpress.nightcore.menu.impl.AbstractMenu; + +public class MenuListener extends AbstractListener { + + public MenuListener(@NotNull NightCore core) { + super(core); + } + + @EventHandler(priority = EventPriority.MONITOR) + public void onQuit(PlayerQuitEvent event) { + AbstractMenu.PLAYER_MENUS.remove(event.getPlayer().getUniqueId()); + } + + @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) + public void onMenuItemClick(InventoryClickEvent event) { + Player player = (Player) event.getWhoClicked(); + + Menu menu = AbstractMenu.getMenu(player); + if (menu == null) return; + + MenuViewer viewer = menu.getViewer(player); + if (viewer == null) return; + + if (!viewer.canClickAgain(CoreConfig.MENU_CLICK_COOLDOWN.get())) { + event.setCancelled(true); + return; + } + + Inventory inventory = event.getInventory(); + ItemStack item = event.getCurrentItem(); + + int slot = event.getRawSlot(); + boolean isMenu = slot < inventory.getSize(); + boolean isEmptyItem = item == null || item.getType().isAir(); + ClickResult result = new ClickResult(slot, item, isMenu); + + menu.onClick(viewer, result, event); + viewer.setLastClickTime(System.currentTimeMillis()); + } + + @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) + public void onMenuItemDrag(InventoryDragEvent event) { + Player player = (Player) event.getWhoClicked(); + + Menu menu = AbstractMenu.getMenu(player); + if (menu == null) return; + + MenuViewer viewer = menu.getViewer(player); + if (viewer == null) return; + + menu.onDrag(viewer, event); + } + + @EventHandler(priority = EventPriority.NORMAL) + public void onMenuClose(InventoryCloseEvent event) { + Player player = (Player) event.getPlayer(); + + Menu menu = AbstractMenu.getMenu(player); + if (menu == null) return; + + MenuViewer viewer = menu.getViewer(player); + if (viewer == null) return; + + menu.onClose(viewer, event); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/MenuOptions.java b/src/main/java/su/nightexpress/nightcore/menu/MenuOptions.java new file mode 100644 index 0000000..1d5363c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/MenuOptions.java @@ -0,0 +1,97 @@ +package su.nightexpress.nightcore.menu; + +import org.bukkit.Bukkit; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Colorizer; + +import java.util.function.UnaryOperator; + +public class MenuOptions { + + private String title; + private int size; + private InventoryType type; + private int autoRefresh; + + private long lastAutoRefresh; + + public MenuOptions(@NotNull String title, int size, @NotNull InventoryType type) { + this(title, size, type, 0); + } + + public MenuOptions(@NotNull String title, int size, @NotNull InventoryType type, int autoRefresh) { + this.setTitle(title); + this.setSize(size); + this.setType(type); + this.setAutoRefresh(autoRefresh); + } + + public MenuOptions(@NotNull MenuOptions options) { + this(options.getTitle(), options.getSize(), options.getType(), options.getAutoRefresh()); + this.lastAutoRefresh = 0L; + } + + @NotNull + public Inventory createInventory() { + String title = this.getTitle(); + if (this.getType() == InventoryType.CHEST) { + return Bukkit.getServer().createInventory(null, this.getSize(), title); + } + else { + return Bukkit.getServer().createInventory(null, this.getType(), title); + } + } + + @NotNull + public String getTitle() { + return title; + } + + public void setTitle(@NotNull String title) { + this.title = Colorizer.apply(title); + } + + public void editTitle(@NotNull UnaryOperator function) { + this.setTitle(function.apply(this.getTitle())); + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + if (size <= 0 || size % 9 != 0 || size > 54) size = 27; + this.size = size; + } + + @NotNull + public InventoryType getType() { + return type; + } + + public void setType(@NotNull InventoryType type) { + this.type = type; + } + + public int getAutoRefresh() { + return autoRefresh; + } + + public void setAutoRefresh(int autoRefresh) { + this.autoRefresh = Math.max(0, autoRefresh); + } + + public long getLastAutoRefresh() { + return lastAutoRefresh; + } + + public void setLastAutoRefresh(long lastAutoRefresh) { + this.lastAutoRefresh = lastAutoRefresh; + } + + public boolean isReadyToRefresh() { + return this.getAutoRefresh() > 0 && System.currentTimeMillis() - this.getLastAutoRefresh() >= this.getAutoRefresh(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/MenuViewer.java b/src/main/java/su/nightexpress/nightcore/menu/MenuViewer.java new file mode 100644 index 0000000..33ee568 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/MenuViewer.java @@ -0,0 +1,85 @@ +package su.nightexpress.nightcore.menu; + +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Version; + +public class MenuViewer { + + private final Player player; + + private Inventory inventory; + private InventoryView view; + private int page; + private int pages; + private long lastClickTime; + + public MenuViewer(@NotNull Player player) { + this.player = player; + this.setPage(1); + this.setPages(1); + } + + public void openInventory(@NotNull Inventory inventory) { + this.inventory = inventory; + this.view = this.getPlayer().openInventory(inventory); + } + + public void flushInventory(@NotNull MenuOptions options) { + this.inventory.clear(); + + if (Version.isAtLeast(Version.V1_19_R3)) { + this.view.setTitle(options.getTitle()); + } + } + + public boolean hasInventory() { + return this.getInventory() != null && this.getView() != null; + } + + public boolean canClickAgain(long cooldown) { + return this.getLastClickTime() == 0 || (System.currentTimeMillis() - this.getLastClickTime()) > cooldown; + } + + @NotNull + public Player getPlayer() { + return player; + } + + @Nullable + public Inventory getInventory() { + return inventory; + } + + @Nullable + public InventoryView getView() { + return view; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = Math.max(1, page); + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = Math.max(1, pages); + } + + public long getLastClickTime() { + return lastClickTime; + } + + public void setLastClickTime(long lastClickTime) { + this.lastClickTime = lastClickTime; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/api/AutoFilled.java b/src/main/java/su/nightexpress/nightcore/menu/api/AutoFilled.java new file mode 100644 index 0000000..709aaf2 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/api/AutoFilled.java @@ -0,0 +1,57 @@ +package su.nightexpress.nightcore.menu.api; + +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.menu.MenuViewer; +import su.nightexpress.nightcore.menu.click.ClickAction; +import su.nightexpress.nightcore.menu.item.ItemOptions; +import su.nightexpress.nightcore.menu.item.MenuItem; + +import java.util.ArrayList; +import java.util.List; + +public interface AutoFilled extends Menu { + + int[] getAutoFillSlots(); + + @NotNull List getAutoFills(@NotNull Player player); + + @NotNull ItemStack getAutoFillStack(@NotNull Player player, @NotNull I object); + + @NotNull ClickAction getAutoFillClick(@NotNull I object); + + default void autoFill(@NotNull MenuViewer viewer) { + this.getAutoFillItems(viewer).forEach(this::addItem); + } + + @NotNull + default List getAutoFillItems(@NotNull MenuViewer viewer) { + Player player = viewer.getPlayer(); + List items = new ArrayList<>(); + List origin = this.getAutoFills(player); + + int[] slots = this.getAutoFillSlots(); + int limit = slots.length; + int pages = (int) Math.ceil((double) origin.size() / (double) limit); + viewer.setPages(pages); + viewer.setPage(Math.min(viewer.getPage(), viewer.getPages())); + + int skip = (viewer.getPage() - 1) * limit; + + List list = origin.stream().skip(skip).limit(limit).toList(); + + int count = 0; + for (I object : list) { + ItemStack item = this.getAutoFillStack(player, object); + ItemOptions options = ItemOptions.personalWeak(player); + MenuItem menuItem = new MenuItem(item).setPriority(100).setOptions(options).setSlots(slots[count++]) + .addClick(this.getAutoFillClick(object)); + //MenuItem menuItem = new MenuItem(item, 100, options, slots[count++]); + //menuItem.addClick(this.getAutoFillClick(object)); + items.add(menuItem); + } + + return items; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/api/Menu.java b/src/main/java/su/nightexpress/nightcore/menu/api/Menu.java new file mode 100644 index 0000000..d912f10 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/api/Menu.java @@ -0,0 +1,66 @@ +package su.nightexpress.nightcore.menu.api; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryDragEvent; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.menu.MenuOptions; +import su.nightexpress.nightcore.menu.MenuViewer; +import su.nightexpress.nightcore.menu.click.ClickResult; +import su.nightexpress.nightcore.menu.item.MenuItem; + +import java.util.*; + +public interface Menu { + + void clear(); + + void flush(); + + void close(); + + void runNextTick(@NotNull Runnable runnable); + + void onClick(@NotNull MenuViewer viewer, @NotNull ClickResult result, @NotNull InventoryClickEvent event); + + void onDrag(@NotNull MenuViewer viewer, @NotNull InventoryDragEvent event); + + void onClose(@NotNull MenuViewer viewer, @NotNull InventoryCloseEvent event); + + boolean open(@NotNull MenuViewer viewer); + + boolean open(@NotNull Player player); + + boolean canOpen(@NotNull Player player); + + boolean isPersistent(); + + @NotNull Collection getViewers(); + + @Nullable MenuViewer getViewer(@NotNull Player player); + + + + @NotNull List getItems(@NotNull MenuViewer viewer); + + @Nullable MenuItem getItem(int slot); + + @Nullable MenuItem getItem(@NotNull MenuViewer viewer, int slot); + + @NotNull MenuItem addItem(@NotNull ItemStack item, int... slots); + + @NotNull MenuItem addWeakItem(@NotNull Player player, @NotNull ItemStack item, int... slots); + + @NotNull MenuItem addItem(@NotNull MenuItem menuItem); + + @NotNull UUID getId(); + + //@NotNull Map getViewersMap(); + + @NotNull Set getItems(); + + @NotNull MenuOptions getOptions(); +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/click/ClickAction.java b/src/main/java/su/nightexpress/nightcore/menu/click/ClickAction.java new file mode 100644 index 0000000..e826ff7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/click/ClickAction.java @@ -0,0 +1,10 @@ +package su.nightexpress.nightcore.menu.click; + +import org.bukkit.event.inventory.InventoryClickEvent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.menu.MenuViewer; + +public interface ClickAction { + + void onClick(@NotNull MenuViewer viewer, @NotNull InventoryClickEvent event); +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/click/ClickResult.java b/src/main/java/su/nightexpress/nightcore/menu/click/ClickResult.java new file mode 100644 index 0000000..fa4741f --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/click/ClickResult.java @@ -0,0 +1,38 @@ +package su.nightexpress.nightcore.menu.click; + +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.Nullable; + +public class ClickResult { + + private final int slot; + private final ItemStack itemStack; + private final boolean isMenu; + + public ClickResult(int slot, @Nullable ItemStack itemStack, boolean isMenu) { + this.slot = slot; + this.itemStack = itemStack; + this.isMenu = isMenu; + } + + public int getSlot() { + return slot; + } + + @Nullable + public ItemStack getItemStack() { + return itemStack; + } + + public boolean isEmptySlot() { + return this.itemStack == null || this.itemStack.getType().isAir(); + } + + public boolean isMenu() { + return isMenu; + } + + public boolean isInventory() { + return !this.isMenu(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/click/ClickType.java b/src/main/java/su/nightexpress/nightcore/menu/click/ClickType.java new file mode 100644 index 0000000..11d2e0c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/click/ClickType.java @@ -0,0 +1,45 @@ +package su.nightexpress.nightcore.menu.click; + +import org.bukkit.event.inventory.InventoryClickEvent; +import org.jetbrains.annotations.NotNull; + +public enum ClickType { + + LEFT, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, + DROP_KEY, SWAP_KEY, + NUMBER_1, + NUMBER_2, + NUMBER_3, + NUMBER_4, + NUMBER_5, + NUMBER_6, + NUMBER_7, + NUMBER_8, + NUMBER_9, + ; + + @NotNull + public static ClickType from(@NotNull InventoryClickEvent event) { + if (event.getClick() == org.bukkit.event.inventory.ClickType.DROP) return DROP_KEY; + if (event.getClick() == org.bukkit.event.inventory.ClickType.SWAP_OFFHAND) return SWAP_KEY; + if (event.getHotbarButton() >= 0) { + return switch (event.getHotbarButton()) { + case 0 -> NUMBER_1; + case 1 -> NUMBER_2; + case 2 -> NUMBER_3; + case 3 -> NUMBER_4; + case 4 -> NUMBER_5; + case 5 -> NUMBER_6; + case 6 -> NUMBER_7; + case 7 -> NUMBER_8; + case 8 -> NUMBER_9; + default -> throw new IllegalStateException("Unexpected value: " + event.getHotbarButton()); + }; + } + + if (event.isShiftClick()) { + return event.isLeftClick() ? SHIFT_LEFT : SHIFT_RIGHT; + } + return event.isLeftClick() ? LEFT : RIGHT; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/impl/AbstractMenu.java b/src/main/java/su/nightexpress/nightcore/menu/impl/AbstractMenu.java new file mode 100644 index 0000000..49cf89d --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/impl/AbstractMenu.java @@ -0,0 +1,266 @@ +package su.nightexpress.nightcore.menu.impl; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryDragEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.dialog.Dialog; +import su.nightexpress.nightcore.menu.api.Menu; +import su.nightexpress.nightcore.menu.link.Linked; +import su.nightexpress.nightcore.menu.MenuOptions; +import su.nightexpress.nightcore.menu.MenuViewer; +import su.nightexpress.nightcore.menu.click.ClickResult; +import su.nightexpress.nightcore.menu.item.ItemOptions; +import su.nightexpress.nightcore.menu.item.MenuItem; +import su.nightexpress.nightcore.util.Lists; + +import java.util.*; + +public abstract class AbstractMenu

implements Menu { + + public static final Map PLAYER_MENUS = new HashMap<>(); + + protected final P plugin; + protected final UUID id; + protected final MenuOptions options; + protected final Map viewers; + protected final Set items; + + public AbstractMenu(@NotNull P plugin) { + this(plugin, "NC Inventory", InventoryType.CHEST); + } + + public AbstractMenu(@NotNull P plugin, @NotNull String title, @NotNull InventoryType type) { + this(plugin, new MenuOptions(title, 27, type)); + } + + public AbstractMenu(@NotNull P plugin, @NotNull String title, int size) { + this(plugin, new MenuOptions(title, size, InventoryType.CHEST)); + } + + public AbstractMenu(@NotNull P plugin, @NotNull MenuOptions options) { + this.plugin = plugin; + this.id = UUID.randomUUID(); + this.options = new MenuOptions(options); + this.viewers = new HashMap<>(); + this.items = new HashSet<>(); + } + + @Nullable + public static Menu getMenu(@NotNull Player player) { + return PLAYER_MENUS.get(player.getUniqueId()); + } + + @Override + public void clear() { + this.close(); + this.getItems().clear(); + this.getViewers().clear(); + } + + @Override + public void close() { + new HashSet<>(this.getViewers()).forEach(viewer -> viewer.getPlayer().closeInventory()); + } + + /*@NotNull + public P plugin() { + return this.plugin; + }*/ + + @Override + public void runNextTick(@NotNull Runnable runnable) { + this.plugin.runTask(task -> runnable.run()); + } + + @Override + public void flush() { + this.getViewers().forEach(viewer -> this.open(viewer.getPlayer())); + } + + @Override + public boolean canOpen(@NotNull Player player) { + return !player.isSleeping(); + } + + @Override + public boolean open(@NotNull MenuViewer viewer) { + return this.open(viewer.getPlayer()); + } + + @Override + public boolean open(@NotNull Player player) { + if (!this.canOpen(player)) return false; + + MenuOptions options = new MenuOptions(this.getOptions()); + MenuViewer viewer = this.getViewerOrCreate(player); + + this.getItems().removeIf(menuItem -> menuItem.getOptions().canBeDestroyed(viewer)); + this.onPrepare(viewer, options); + + if (!viewer.hasInventory()) { + viewer.openInventory(options.createInventory()); + } + else { + viewer.flushInventory(options); + } + + Inventory inventory = viewer.getInventory(); + if (inventory == null) { + this.plugin.debug("Could not create " + this.getClass().getSimpleName() + " inventory for '" + player.getName() + "'."); + return false; + } + + this.getItems(viewer).forEach(menuItem -> { + ItemStack item = menuItem.getItemStack(); + menuItem.getOptions().modifyDisplay(viewer, item); + + for (int slot : menuItem.getSlots()) { + if (slot < 0 || slot >= inventory.getSize()) continue; + inventory.setItem(slot, item); + } + }); + + this.onReady(viewer, inventory); + + PLAYER_MENUS.put(player.getUniqueId(), this); + return true; + } + + protected abstract void onPrepare(@NotNull MenuViewer viewer, @NotNull MenuOptions options); + + protected abstract void onReady(@NotNull MenuViewer viewer, @NotNull Inventory inventory); + + @Override + public void onClick(@NotNull MenuViewer viewer, @NotNull ClickResult result, @NotNull InventoryClickEvent event) { + event.setCancelled(true); + + if (result.isInventory()) return; + + MenuItem menuItem = this.getItem(viewer, result.getSlot()); + if (menuItem == null) return; + + menuItem.getHandler().getClickActions().forEach(action -> action.onClick(viewer, event)); + } + + @Override + public void onDrag(@NotNull MenuViewer viewer, @NotNull InventoryDragEvent event) { + event.setCancelled(true); + } + + @Override + public void onClose(@NotNull MenuViewer viewer, @NotNull InventoryCloseEvent event) { + Player player = viewer.getPlayer(); + + this.getViewersMap().remove(player.getUniqueId()); + this.getItems().removeIf(menuItem -> menuItem.getOptions().canBeDestroyed(viewer)); + PLAYER_MENUS.remove(player.getUniqueId()); + + // Do not clear link if entered Editor, so it can reopen menu without data loss when done. + if (this instanceof Linked linked && !Dialog.contains(player)) { + linked.getLink().clear(viewer); + } + + if (this.getViewers().isEmpty() && !this.isPersistent()) { + this.clear(); + } + } + + @Override + public boolean isPersistent() { + return true; + } + + @Override + @NotNull + public Collection getViewers() { + return this.getViewersMap().values(); + } + + @Override + @Nullable + public MenuViewer getViewer(@NotNull Player player) { + return this.getViewersMap().get(player.getUniqueId()); + } + + @NotNull + private MenuViewer getViewerOrCreate(@NotNull Player player) { + return this.getViewersMap().computeIfAbsent(player.getUniqueId(), k -> new MenuViewer(player)); + } + + + + @Override + @NotNull + public List getItems(@NotNull MenuViewer viewer) { + return this.getItems().stream() + .filter(menuItem -> menuItem.canSee(viewer)) + .sorted(Comparator.comparingInt(MenuItem::getPriority)).toList(); + } + + @Override + @Nullable + public MenuItem getItem(int slot) { + return this.getItems().stream() + .filter(item -> Lists.contains(item.getSlots(), slot)) + .max(Comparator.comparingInt(MenuItem::getPriority)).orElse(null); + } + + @Override + @Nullable + public MenuItem getItem(@NotNull MenuViewer viewer, int slot) { + return this.getItems(viewer).stream() + .filter(menuItem -> Lists.contains(menuItem.getSlots(), slot)) + .max(Comparator.comparingInt(MenuItem::getPriority)).orElse(null); + } + + @Override + @NotNull + public MenuItem addItem(@NotNull ItemStack item, int... slots) { + return this.addItem(new MenuItem(item, slots)); + } + + @Override + @NotNull + public MenuItem addWeakItem(@NotNull Player player, @NotNull ItemStack item, int... slots) { + MenuItem menuItem = new MenuItem(item, slots); + menuItem.setOptions(ItemOptions.personalWeak(player)); + return this.addItem(menuItem); + } + + @Override + @NotNull + public MenuItem addItem(@NotNull MenuItem menuItem) { + this.getItems().add(menuItem); + return menuItem; + } + + @Override + @NotNull + public UUID getId() { + return id; + } + + @NotNull + private Map getViewersMap() { + return viewers; + } + + @Override + @NotNull + public Set getItems() { + return items; + } + + @Override + @NotNull + public MenuOptions getOptions() { + return options; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/impl/ConfigMenu.java b/src/main/java/su/nightexpress/nightcore/menu/impl/ConfigMenu.java new file mode 100644 index 0000000..f711913 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/impl/ConfigMenu.java @@ -0,0 +1,178 @@ +package su.nightexpress.nightcore.menu.impl; + +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.config.ConfigValue; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.menu.api.AutoFilled; +import su.nightexpress.nightcore.menu.MenuOptions; +import su.nightexpress.nightcore.menu.click.ClickAction; +import su.nightexpress.nightcore.menu.click.ClickType; +import su.nightexpress.nightcore.menu.item.ItemHandler; +import su.nightexpress.nightcore.menu.item.MenuItem; +import su.nightexpress.nightcore.util.*; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +public abstract class ConfigMenu

extends AbstractMenu

{ + + protected final FileConfig cfg; + protected final Map handlerMap; + protected String itemSection = "Content"; + + public ConfigMenu(@NotNull P plugin, @NotNull FileConfig cfg) { + super(plugin); + this.cfg = cfg; + this.handlerMap = new HashMap<>(); + + this.addHandler(ItemHandler.forClose(this)); + if (this instanceof AutoFilled) { + this.addHandler(ItemHandler.forNextPage(this)); + this.addHandler(ItemHandler.forPreviousPage(this)); + } + } + + @NotNull + protected abstract MenuOptions createDefaultOptions(); + + @NotNull + protected abstract List createDefaultItems(); + + public void load() { + this.loadConfig(); + } + + protected abstract void loadAdditional(); + + public void loadConfig() { + MenuOptions defaultOptions = this.createDefaultOptions(); + + String title = ConfigValue.create("Settings.Title", defaultOptions.getTitle(), + "Sets GUI title." + ).read(cfg); + + int size = ConfigValue.create("Settings.Size", defaultOptions.getSize(), + "Sets GUI size. Must be multiply of 9.", + "Useful for '" + InventoryType.CHEST.name() + "' Inventory Type only." + ).read(cfg); + + InventoryType type = ConfigValue.create("Settings.Inventory_Type", InventoryType.class, defaultOptions.getType(), + "Sets GUI type.", + "https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryType.html" + ).read(cfg); + + int autoRefresh = ConfigValue.create("Settings.Auto_Refresh", defaultOptions.getAutoRefresh(), + "Sets GUI auto-refresh interval (in seconds). Set this to 0 to disable." + ).read(cfg); + + this.getOptions().setTitle(title); + this.getOptions().setSize(size); + this.getOptions().setType(type); + this.getOptions().setAutoRefresh(autoRefresh); + + this.loadAdditional(); + + if (!this.cfg.contains(this.itemSection)) { + AtomicInteger count = new AtomicInteger(); + this.createDefaultItems().forEach(menuItem -> { + String name = StringUtil.lowerCaseUnderscore(ItemUtil.getItemName(menuItem.getItemStack())); + + this.writeItem(menuItem, this.itemSection + "." + name + "_" + count.incrementAndGet()); + }); + } + + this.cfg.getSection(this.itemSection).forEach(sId -> { + MenuItem menuItem = this.readItem(this.itemSection + "." + sId); + this.addItem(menuItem); + }); + + List comments = new ArrayList<>(); + comments.add("=".repeat(20) + " GUI CONTENT " + "=".repeat(20)); + comments.add("You can freely edit items in this section as you wish (add, remove, modify items)."); + comments.add("The following values are available as button Types:"); + comments.addAll(handlerMap.keySet().stream().map(String::toUpperCase).sorted(String::compareTo).toList()); + comments.add("=".repeat(20) + " ITEM OPTIONS " + "=".repeat(20)); + comments.add("> Item: Item to display. Please check: " + Placeholders.WIKI_ITEMS_URL); + comments.add("> Priority: Button priority. Better values will override other item(s) in the same slot(s)."); + comments.add("> Slots: Button slots. From [0] to [Size - 1]. Split them with a comma."); + comments.add("> Click_Commands: Execute custom commands on click. " + Plugins.PLACEHOLDER_API + " available here."); + comments.add(" Available click types: " + String.join(", ", Lists.getEnums(ClickType.class))); + comments.add(" Click_Commands:"); + comments.add(" LEFT:"); + comments.add(" - say Hello"); + comments.add(" - give " + Placeholders.PLAYER_NAME + " diamond 1"); + comments.add("=".repeat(50)); + this.cfg.setComments(this.itemSection, comments); + this.cfg.saveChanges(); + } + + @Override + public void clear() { + super.clear(); + this.handlerMap.clear(); + } + + public void addHandler(@NotNull ItemHandler handler) { + this.handlerMap.put(handler.getName(), handler); + } + + public void addHandler(@NotNull String name, @NotNull ClickAction action) { + this.addHandler(new ItemHandler(name, action)); + } + + @Nullable + public ItemHandler getHandler(@NotNull String name) { + return this.handlerMap.get(name.toLowerCase()); + } + + public boolean removeHandler(@NotNull String name) { + return this.handlerMap.remove(name.toLowerCase()) != null; + } + + @NotNull + protected MenuItem readItem(@NotNull String path) { + String handlerName = cfg.getString(path + ".Type", Placeholders.DEFAULT); + ItemStack item = cfg.getItem(path + ".Item"); + int[] slots = cfg.getIntArray(path + ".Slots"); + int priority = cfg.getInt(path + ".Priority"); + + MenuItem menuItem = new MenuItem(item).setPriority(priority).setSlots(slots); + + ItemHandler handler = this.getHandler(handlerName); + if (handler != null) { + menuItem.setHandler(handler); + } + + if (cfg.contains(path + ".Click_Actions")) { + Map> commandMap = new HashMap<>(); + for (String sType : cfg.getSection(path + ".Click_Actions")) { + ClickType clickType = StringUtil.getEnum(sType, ClickType.class).orElse(null); + if (clickType == null) continue; + + List commands = cfg.getStringList(path + ".Click_Actions." + sType); + commandMap.put(clickType, commands); + } + commandMap.values().removeIf(List::isEmpty); + + ClickAction clickCommands = (viewer, event) -> { + List commands = commandMap.getOrDefault(ClickType.from(event), Collections.emptyList()); + commands.forEach(command -> Players.dispatchCommand(viewer.getPlayer(), command)); + }; + + menuItem.addClick(clickCommands); + } + + return menuItem; + } + + protected void writeItem(@NotNull MenuItem menuItem, @NotNull String path) { + this.cfg.set(path + ".Priority", menuItem.getPriority()); + this.cfg.setItem(path + ".Item", menuItem.getItemStack()); + this.cfg.setIntArray(path + ".Slots", menuItem.getSlots()); + this.cfg.set(path + ".Type", menuItem.getHandler().getName()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/impl/EditorMenu.java b/src/main/java/su/nightexpress/nightcore/menu/impl/EditorMenu.java new file mode 100644 index 0000000..3c38159 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/impl/EditorMenu.java @@ -0,0 +1,131 @@ +package su.nightexpress.nightcore.menu.impl; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemFlag; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.core.CoreLang; +import su.nightexpress.nightcore.dialog.Dialog; +import su.nightexpress.nightcore.dialog.DialogHandler; +import su.nightexpress.nightcore.language.entry.LangItem; +import su.nightexpress.nightcore.language.entry.LangString; +import su.nightexpress.nightcore.language.legacy.LegacyLangString; +import su.nightexpress.nightcore.menu.MenuViewer; +import su.nightexpress.nightcore.menu.item.ItemHandler; +import su.nightexpress.nightcore.menu.item.MenuItem; +import su.nightexpress.nightcore.menu.link.Linked; +import su.nightexpress.nightcore.menu.link.ViewLink; +import su.nightexpress.nightcore.util.ItemUtil; +import su.nightexpress.nightcore.util.text.WrappedMessage; + +public abstract class EditorMenu

extends AbstractMenu

implements Linked { + + protected final ViewLink link; + + public EditorMenu(@NotNull P plugin, @NotNull String title, int size) { + super(plugin, title, size); + this.link = new ViewLink<>(); + } + + @NotNull + @Override + public ViewLink getLink() { + return link; + } + + @NotNull + protected MenuItem addNextPage(int... slots) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + ItemUtil.setSkullTexture(item, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjgyYWQxYjljYjRkZDIxMjU5YzBkNzVhYTMxNWZmMzg5YzNjZWY3NTJiZTM5NDkzMzgxNjRiYWM4NGE5NmUifX19"); + return this.addItem(item, CoreLang.EDITOR_ITEM_NEXT_PAGE, slots).setHandler(ItemHandler.forNextPage(this)); + } + + @NotNull + protected MenuItem addPreviousPage(int... slots) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + ItemUtil.setSkullTexture(item, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzdhZWU5YTc1YmYwZGY3ODk3MTgzMDE1Y2NhMGIyYTdkNzU1YzYzMzg4ZmYwMTc1MmQ1ZjQ0MTlmYzY0NSJ9fX0="); + return this.addItem(item, CoreLang.EDITOR_ITEM_PREVIOUS_PAGE, slots).setHandler(ItemHandler.forPreviousPage(this)); + } + + @NotNull + protected MenuItem addReturn(int... slots) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + ItemUtil.setSkullTexture(item, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTM4NTJiZjYxNmYzMWVkNjdjMzdkZTRiMGJhYTJjNWY4ZDhmY2E4MmU3MmRiY2FmY2JhNjY5NTZhODFjNCJ9fX0="); + return this.addItem(item, CoreLang.EDITOR_ITEM_RETURN, slots); + } + + @NotNull + protected MenuItem addCreation(@NotNull LangItem locale, int... slots) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + ItemUtil.setSkullTexture(item, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWZmMzE0MzFkNjQ1ODdmZjZlZjk4YzA2NzU4MTA2ODFmOGMxM2JmOTZmNTFkOWNiMDdlZDc4NTJiMmZmZDEifX19"); + return this.addItem(item, locale, slots); + } + + @NotNull + protected MenuItem addExit(int... slots) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + ItemUtil.setSkullTexture(item, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmViNTg4YjIxYTZmOThhZDFmZjRlMDg1YzU1MmRjYjA1MGVmYzljYWI0MjdmNDYwNDhmMThmYzgwMzQ3NWY3In19fQ=="); + return this.addItem(item, CoreLang.EDITOR_ITEM_CLOSE, slots).setHandler(ItemHandler.forClose(this)); + } + + @NotNull + public MenuItem addItem(@NotNull Material material, @NotNull LangItem locale, int... slots) { + return this.addItem(new ItemStack(material), locale, slots); + } + + @NotNull + public MenuItem addItem(@NotNull ItemStack item, @NotNull LangItem locale, int... slots) { + ItemUtil.editMeta(item, meta -> { + meta.setDisplayName(locale.getLocalizedName()); + meta.setLore(locale.getLocalizedLore()); + meta.addItemFlags(ItemFlag.values()); + }); + + MenuItem menuItem = new MenuItem(item).setPriority(100).setSlots(slots); + this.addItem(menuItem); + return menuItem; + } + + @Deprecated + public void handleInput(@NotNull MenuViewer viewer, @NotNull LegacyLangString prompt, @NotNull DialogHandler handler) { + this.handleInput(viewer.getPlayer(), prompt, handler); + } + + @Deprecated + public void handleInput(@NotNull Player player, @NotNull LegacyLangString prompt, @NotNull DialogHandler handler) { + this.handleInput(player, prompt.getString(), handler); + } + + public void handleInput(@NotNull MenuViewer viewer, @NotNull LangString prompt, @NotNull DialogHandler handler) { + this.handleInput(viewer.getPlayer(), prompt, handler); + } + + public void handleInput(@NotNull Player player, @NotNull LangString prompt, @NotNull DialogHandler handler) { + this.handleInput(player, prompt.getString(), handler); + } + + @NotNull + public Dialog handleInput(@NotNull Player player, @NotNull WrappedMessage prompt, @NotNull DialogHandler handler) { + this.runNextTick(player::closeInventory); + + Dialog dialog = Dialog.create(player, handler); + dialog.prompt(prompt); + return dialog; + } + + @NotNull + public Dialog handleInput(@NotNull Player player, @NotNull String prompt, @NotNull DialogHandler handler) { + this.runNextTick(player::closeInventory); + + Dialog dialog = Dialog.create(player, handler); + dialog.prompt(prompt); + return dialog; + } + + @NotNull + public T getObject(@NotNull MenuViewer viewer) { + return this.getLink().get(viewer); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/item/ItemHandler.java b/src/main/java/su/nightexpress/nightcore/menu/item/ItemHandler.java new file mode 100644 index 0000000..44c17a7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/item/ItemHandler.java @@ -0,0 +1,95 @@ +package su.nightexpress.nightcore.menu.item; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.menu.api.Menu; +import su.nightexpress.nightcore.menu.MenuViewer; +import su.nightexpress.nightcore.menu.click.ClickAction; +import su.nightexpress.nightcore.util.Placeholders; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + +public class ItemHandler { + + public static final String RETURN = "return"; + public static final String CLOSE = "close"; + public static final String NEXT_PAGE = "page_next"; + public static final String PREVIOUS_PAGE = "page_previous"; + + private final String name; + private final List clickActions; + private final Predicate visibilityPolicy; + + public ItemHandler() { + this(Placeholders.DEFAULT, null, null); + } + + public ItemHandler(@NotNull String name) { + this(name, null, null); + } + + public ItemHandler(@NotNull String name, @Nullable ClickAction clickAction) { + this(name, clickAction, null); + } + + public ItemHandler(@NotNull String name, @Nullable ClickAction clickAction, @Nullable Predicate visibilityPolicy) { + this.name = name.toLowerCase(); + this.clickActions = new ArrayList<>(); + this.visibilityPolicy = visibilityPolicy; + + if (clickAction != null) { + this.getClickActions().add(clickAction); + } + } + + @NotNull + public static ItemHandler forNextPage(@NotNull Menu menu) { + return new ItemHandler(NEXT_PAGE, + (viewer, event) -> { + if (viewer.getPage() < viewer.getPages()) { + viewer.setPage(viewer.getPage() + 1); + menu.open(viewer.getPlayer()); + } + }, + viewer -> viewer.getPage() < viewer.getPages()); + } + + @NotNull + public static ItemHandler forPreviousPage(@NotNull Menu menu) { + return new ItemHandler(PREVIOUS_PAGE, + (viewer, event) -> { + if (viewer.getPage() > 1) { + viewer.setPage(viewer.getPage() - 1); + menu.open(viewer.getPlayer()); + } + }, + viewer -> viewer.getPage() > 1); + } + + @NotNull + public static ItemHandler forClose(@NotNull Menu menu) { + return new ItemHandler(CLOSE, (viewer, event) -> menu.runNextTick(() -> viewer.getPlayer().closeInventory())); + } + + @NotNull + public static ItemHandler forReturn(@NotNull Menu menu, @NotNull ClickAction action) { + return new ItemHandler(RETURN, action); + } + + @NotNull + public String getName() { + return name; + } + + @NotNull + public List getClickActions() { + return clickActions; + } + + @Nullable + public Predicate getVisibilityPolicy() { + return visibilityPolicy; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/item/ItemOptions.java b/src/main/java/su/nightexpress/nightcore/menu/item/ItemOptions.java new file mode 100644 index 0000000..448dee6 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/item/ItemOptions.java @@ -0,0 +1,115 @@ +package su.nightexpress.nightcore.menu.item; + +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.menu.MenuViewer; + +import java.util.function.BiConsumer; +import java.util.function.Predicate; + +public class ItemOptions { + + private Predicate visibilityPolicy; + private Predicate weakPolicy; + private BiConsumer displayModifier; + + public ItemOptions() { + this(null, null, null); + } + + public ItemOptions(@Nullable Predicate visibilityPolicy, + @Nullable Predicate weakPolicy, + @Nullable BiConsumer displayModifier) { + this.setVisibilityPolicy(visibilityPolicy); + this.setWeakPolicy(weakPolicy); + this.setDisplayModifier(displayModifier); + } + + @NotNull + public static ItemOptions personalWeak(@NotNull Player player) { + Predicate visibility = (viewer -> viewer.getPlayer().getUniqueId().equals(player.getUniqueId())); + Predicate weak = (viewer -> viewer.getPlayer().getUniqueId().equals(player.getUniqueId())); + return new ItemOptions(visibility, weak, null); + } + + @NotNull + public static ItemOptions personalPermanent(@NotNull Player player) { + Predicate visibility = (viewer -> viewer.getPlayer().getUniqueId().equals(player.getUniqueId())); + return new ItemOptions(visibility, null, null); + } + + public boolean canSee(@NotNull MenuViewer viewer) { + Predicate policy = this.getVisibilityPolicy(); + return policy == null || policy.test(viewer); + } + + public boolean canBeDestroyed(@NotNull MenuViewer viewer) { + Predicate policy = this.getWeakPolicy(); + return policy != null && policy.test(viewer); + } + + public void modifyDisplay(@NotNull MenuViewer viewer, @NotNull ItemStack item) { + BiConsumer displayModifier = this.getDisplayModifier(); + if (displayModifier != null) { + displayModifier.accept(viewer, item); + } + } + + @Nullable + public Predicate getVisibilityPolicy() { + return visibilityPolicy; + } + + @NotNull + public ItemOptions setVisibilityPolicy(@Nullable Predicate visibilityPolicy) { + this.visibilityPolicy = visibilityPolicy; + return this; + } + + @NotNull + public ItemOptions addVisibilityPolicy(@NotNull Predicate visibilityPolicy) { + if (this.visibilityPolicy == null) { + this.setVisibilityPolicy(visibilityPolicy); + } + else { + this.visibilityPolicy = this.visibilityPolicy.and(visibilityPolicy); + } + + return this; + } + + @Nullable + public Predicate getWeakPolicy() { + return weakPolicy; + } + + @NotNull + public ItemOptions setWeakPolicy(@Nullable Predicate weakPolicy) { + this.weakPolicy = weakPolicy; + return this; + } + + @Nullable + public BiConsumer getDisplayModifier() { + return displayModifier; + } + + @NotNull + public ItemOptions setDisplayModifier(@Nullable BiConsumer displayModifier) { + this.displayModifier = displayModifier; + return this; + } + + @NotNull + public ItemOptions addDisplayModifier(@NotNull BiConsumer displayModifier) { + if (this.displayModifier == null) { + this.setDisplayModifier(displayModifier); + } + else { + this.displayModifier = this.displayModifier.andThen(displayModifier); + } + return this; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/item/MenuItem.java b/src/main/java/su/nightexpress/nightcore/menu/item/MenuItem.java new file mode 100644 index 0000000..9193352 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/item/MenuItem.java @@ -0,0 +1,113 @@ +package su.nightexpress.nightcore.menu.item; + +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.menu.MenuViewer; +import su.nightexpress.nightcore.menu.click.ClickAction; + +public class MenuItem { + + protected ItemStack itemStack; + protected int priority; + protected int[] slots; + + protected ItemOptions options; + protected ItemHandler handler; + + public MenuItem(@NotNull ItemStack itemStack) { + this(itemStack, new int[0]); + } + + public MenuItem(@NotNull ItemStack itemStack, int... slots) { + this(itemStack, 0, slots); + } + + public MenuItem(@NotNull ItemStack itemStack, int priority, int[] slots) { + this(itemStack, priority, slots, new ItemOptions(), new ItemHandler()); + } + + public MenuItem(@NotNull ItemStack itemStack, int priority, int[] slots, @NotNull ItemOptions options, @NotNull ItemHandler handler) { + this.setItemStack(itemStack); + this.setPriority(priority); + this.setSlots(slots); + this.setOptions(options); + this.setHandler(handler); + } + + @NotNull + public MenuItem copy() { + return new MenuItem(this.getItemStack(), this.getPriority(), this.getSlots(), this.getOptions(), this.getHandler()); + } + + @NotNull + public MenuItem resetOptions() { + this.setOptions(new ItemOptions()); + return this; + } + + public boolean canSee(@NotNull MenuViewer viewer) { + if (!this.getOptions().canSee(viewer)) return false; + + var policy = this.getHandler().getVisibilityPolicy(); + return policy == null || policy.test(viewer); + } + + @NotNull + public ItemStack getItemStack() { + return new ItemStack(this.itemStack); + } + + @NotNull + public MenuItem setItemStack(@NotNull ItemStack itemStack) { + this.itemStack = new ItemStack(itemStack); + return this; + } + + public int getPriority() { + return priority; + } + + @NotNull + public MenuItem setPriority(int priority) { + this.priority = priority; + return this; + } + + public int[] getSlots() { + return slots; + } + + @NotNull + public MenuItem setSlots(int... slots) { + this.slots = slots; + return this; + } + + @NotNull + public ItemOptions getOptions() { + return options; + } + + @NotNull + public MenuItem setOptions(@NotNull ItemOptions options) { + this.options = options; + return this; + } + + @NotNull + public ItemHandler getHandler() { + return handler; + } + + @NotNull + public MenuItem setHandler(@NotNull ItemHandler handler) { + this.handler = handler; + return this; + } + + @NotNull + public MenuItem addClick(@NotNull ClickAction click) { + this.getHandler().getClickActions().add(click); + return this; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/link/Linked.java b/src/main/java/su/nightexpress/nightcore/menu/link/Linked.java new file mode 100644 index 0000000..f8af481 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/link/Linked.java @@ -0,0 +1,21 @@ +package su.nightexpress.nightcore.menu.link; + +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.menu.api.Menu; + +public interface Linked extends Menu { + + @NotNull ViewLink getLink(); + + default boolean open(@NotNull Player player, @NotNull T obj) { + this.getLink().set(player, obj); + + if (!this.open(player)) { + this.getLink().clear(player); + return false; + } + + return true; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/menu/link/ViewLink.java b/src/main/java/su/nightexpress/nightcore/menu/link/ViewLink.java new file mode 100644 index 0000000..3965a9d --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/menu/link/ViewLink.java @@ -0,0 +1,41 @@ +package su.nightexpress.nightcore.menu.link; + +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.menu.MenuViewer; + +import java.util.Map; +import java.util.WeakHashMap; + +public class ViewLink { + + private final Map map; + + public ViewLink() { + this.map = new WeakHashMap<>(); + } + + public void set(@NotNull MenuViewer viewer, @NotNull T object) { + this.set(viewer.getPlayer(), object); + } + + public void set(@NotNull Player viewer, @NotNull T object) { + this.map.put(viewer, object); + } + + public T get(@NotNull MenuViewer viewer) { + return this.get(viewer.getPlayer()); + } + + public T get(@NotNull Player viewer) { + return this.map.get(viewer); + } + + public void clear(@NotNull MenuViewer viewer) { + this.clear(viewer.getPlayer()); + } + + public void clear(@NotNull Player viewer) { + this.map.remove(viewer); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/BenchmarkLoop.java b/src/main/java/su/nightexpress/nightcore/util/BenchmarkLoop.java new file mode 100644 index 0000000..c319160 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/BenchmarkLoop.java @@ -0,0 +1,34 @@ +package su.nightexpress.nightcore.util; + +//@BenchmarkMode({Mode.AverageTime}) +//@OutputTimeUnit(TimeUnit.MILLISECONDS) +//@Fork(value = 1, jvmArgs = {"-Xms2G", "-Xmx2G"}) +public class BenchmarkLoop { + + /*private static final int N = 10_000_000; + + public static void main(String[] args) throws RunnerException { + + Options opt = new OptionsBuilder() + .include(BenchmarkLoop.class.getSimpleName()) + .forks(1) + .build(); + + new Runner(opt).run(); + } + + @Benchmark + public static void first(Blackhole blackhole) { + for (int i = 0; i < N; i++) { + + } + } + + @Benchmark + public static void second(Blackhole blackhole) { + for (int i = 0; i < N; i++) { + + } + }*/ + +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Colorizer.java b/src/main/java/su/nightexpress/nightcore/util/Colorizer.java new file mode 100644 index 0000000..d66abf3 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Colorizer.java @@ -0,0 +1,154 @@ +package su.nightexpress.nightcore.util; + +import net.md_5.bungee.api.ChatColor; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.regex.TimedMatcher; + +import java.util.List; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +public class Colorizer { + + public static final Pattern PATTERN_HEX = Pattern.compile("#([A-Fa-f0-9]{6})"); + public static final Pattern PATTERN_GRADIENT = Pattern.compile("(.*?)"); + + @NotNull + public static String apply(@NotNull String str) { + return hex(gradient(legacy(str))); + } + + @NotNull + public static List apply(@NotNull List list) { + list.replaceAll(Colorizer::apply); + return list; + } + + @NotNull + public static Set apply(@NotNull Set set) { + return set.stream().map(Colorizer::apply).collect(Collectors.toSet()); + } + + @NotNull + public static String legacyHex(@NotNull String str) { + return hex(legacy(str)); + } + + @NotNull + public static String legacy(@NotNull String str) { + return ChatColor.translateAlternateColorCodes('&', str); + } + + @NotNull + public static String hex(@NotNull String str) { + TimedMatcher timedMatcher = TimedMatcher.create(PATTERN_HEX, str); + //Matcher matcher = PATTERN_HEX.matcher(str); + StringBuilder buffer = new StringBuilder(str.length() + 4 * 8); + while (timedMatcher.find()) { + Matcher matcher = timedMatcher.getMatcher(); + String group = matcher.group(1); + matcher.appendReplacement(buffer, + ChatColor.COLOR_CHAR + "x" + ChatColor.COLOR_CHAR + group.charAt(0) + + ChatColor.COLOR_CHAR + group.charAt(1) + ChatColor.COLOR_CHAR + group.charAt(2) + + ChatColor.COLOR_CHAR + group.charAt(3) + ChatColor.COLOR_CHAR + group.charAt(4) + + ChatColor.COLOR_CHAR + group.charAt(5)); + } + return timedMatcher.getMatcher().appendTail(buffer).toString(); + } + + private static ChatColor[] createGradient(@NotNull java.awt.Color start, @NotNull java.awt.Color end, int length) { + ChatColor[] colors = new ChatColor[length]; + for (int index = 0; index < length; index++) { + double percent = (double) index / (double) length; + + int red = (int) (start.getRed() + percent * (end.getRed() - start.getRed())); + int green = (int) (start.getGreen() + percent * (end.getGreen() - start.getGreen())); + int blue = (int) (start.getBlue() + percent * (end.getBlue() - start.getBlue())); + + java.awt.Color color = new java.awt.Color(red, green, blue); + colors[index] = ChatColor.of(color); + } + return colors; + } + + @NotNull + public static String gradient(@NotNull String string) { + TimedMatcher timedMatcher = TimedMatcher.create(PATTERN_GRADIENT, string); + //Matcher matcher = PATTERN_GRADIENT.matcher(string); + while (timedMatcher.find()) { + Matcher matcher = timedMatcher.getMatcher(); + String start = matcher.group(1); + String end = matcher.group(3); + String content = matcher.group(2); + + java.awt.Color colorStart = new java.awt.Color(Integer.parseInt(start, 16)); + java.awt.Color colorEnd = new java.awt.Color(Integer.parseInt(end, 16)); + ChatColor[] colors = createGradient(colorStart, colorEnd, strip(content).length()); + + StringBuilder gradiented = new StringBuilder(); + StringBuilder specialColors = new StringBuilder(); + char[] characters = content.toCharArray(); + int outIndex = 0; + for (int index = 0; index < characters.length; index++) { + if (characters[index] == ChatColor.COLOR_CHAR) { + if (index + 1 < characters.length) { + if (characters[index + 1] == 'r') { + specialColors.setLength(0); + } + else { + specialColors.append(characters[index]); + specialColors.append(characters[index + 1]); + } + index++; + } + else gradiented.append(colors[outIndex++]).append(specialColors).append(characters[index]); + } + else gradiented.append(colors[outIndex++]).append(specialColors).append(characters[index]); + } + + string = string.replace(matcher.group(0), gradiented.toString()); + } + return string; + } + + @NotNull + public static String plain(@NotNull String str) { + return plainLegacy(plainHex(str)); + } + + @NotNull + public static String plainLegacy(@NotNull String str) { + return str.replace(ChatColor.COLOR_CHAR, '&'); + } + + @NotNull + public static String plainHex(@NotNull String str) { + StringBuilder buffer = new StringBuilder(str); + + int index; + while ((index = buffer.toString().indexOf(ChatColor.COLOR_CHAR + "x")) >= 0) { + int count = 0; + buffer.replace(index, index + 2, "#"); + + for (int point = index + 1; count < 6; point += 1) { + buffer.deleteCharAt(point); + count++; + } + } + + return buffer.toString(); + } + + @NotNull + public static String strip(@NotNull String str) { + String stripped = ChatColor.stripColor(str); + return stripped == null ? "" : stripped; + } + + @NotNull + public static String restrip(@NotNull String str) { + return strip(apply(str)); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Colors.java b/src/main/java/su/nightexpress/nightcore/util/Colors.java new file mode 100644 index 0000000..5ac3c48 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Colors.java @@ -0,0 +1,29 @@ +package su.nightexpress.nightcore.util; + +@Deprecated +public class Colors { + + public static final String BOLD = "&l"; + public static final String WHITE = "#e8f2f2"; + public static final String GRAY = "#aaa8a8"; + public static final String GREEN = "#74ea31"; + public static final String YELLOW = "#ead931"; + public static final String ORANGE = "#ea9631"; + public static final String RED = "#ea3131"; + public static final String BLUE = "#3196ea"; + public static final String CYAN = "#31eace"; + public static final String PURPLE = "#bd31ea"; + public static final String PINK = "#ea31b2"; + + public static final String DARK_GRAY = "#6c6c62"; + public static final String LIGHT_GRAY = "#d4d9d8"; + public static final String LIGHT_GREEN = "#aefd5e"; + public static final String LIGHT_YELLOW = "#ffeea2"; + public static final String LIGHT_ORANGE = "#fdba5e"; + public static final String LIGHT_RED = "#fd5e5e"; + public static final String LIGHT_BLUE = "#5e9dfd"; + public static final String LIGHT_CYAN = "#5edefd"; + public static final String LIGHT_PURPLE = "#e39fff"; + public static final String LIGHT_PINK = "#fd8ddb"; + +} diff --git a/src/main/java/su/nightexpress/nightcore/util/CommandUtil.java b/src/main/java/su/nightexpress/nightcore/util/CommandUtil.java new file mode 100644 index 0000000..74f47b0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/CommandUtil.java @@ -0,0 +1,85 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.Bukkit; +import org.bukkit.command.Command; +import org.bukkit.command.SimpleCommandMap; +import org.bukkit.plugin.Plugin; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.command.api.NightPluginCommand; +import su.nightexpress.nightcore.command.impl.WrappedCommand; + +import java.util.*; + +public class CommandUtil { + + private static final String FIELD_COMMAND_MAP = "commandMap"; + private static final String FIELD_KNOWN_COMMANDS = "knownCommands"; + + private static final SimpleCommandMap COMMAND_MAP = getCommandMap(); + + private static SimpleCommandMap getCommandMap() { + return (SimpleCommandMap) Reflex.getFieldValue(Bukkit.getServer(), FIELD_COMMAND_MAP); + } + + public static void register(@NotNull Plugin plugin, @NotNull NightPluginCommand command) { + WrappedCommand wrappedCommand = new WrappedCommand(plugin, command); + if (COMMAND_MAP.register(plugin.getName(), wrappedCommand)) { + command.setBackend(wrappedCommand); + } + } + + /*public static void syncCommands() { + // Fix tab completer when registerd on runtime + Server server = Bukkit.getServer(); + Method method = Reflex.getMethod(server.getClass(), "syncCommands"); + if (method == null) return; + + Reflex.invokeMethod(method, server); + }*/ + + @SuppressWarnings("unchecked") + public static boolean unregister(@NotNull String name) { + Command command = getCommand(name).orElse(null); + if (command == null) return false; + + Map knownCommands = (HashMap) Reflex.getFieldValue(COMMAND_MAP, FIELD_KNOWN_COMMANDS); + if (knownCommands == null) return false; + if (!command.unregister(COMMAND_MAP)) return false; + + return knownCommands.keySet().removeIf(key -> key.equalsIgnoreCase(command.getName()) || command.getAliases().contains(key)); + } + + @NotNull + public static Set getAliases(@NotNull String name) { + return getAliases(name, false); + } + + @NotNull + public static Set getAliases(@NotNull String name, boolean inclusive) { + Command command = getCommand(name).orElse(null); + if (command == null) return Collections.emptySet(); + + Set aliases = new HashSet<>(command.getAliases()); + if (inclusive) aliases.add(command.getName()); + return aliases; + } + + @NotNull + public static Optional getCommand(@NotNull String name) { + return COMMAND_MAP.getCommands().stream() + .filter(command -> command.getLabel().equalsIgnoreCase(name) || command.getAliases().contains(name)) + .findFirst(); + } + + @NotNull + public static String getCommandName(@NotNull String str) { + String name = Colorizer.strip(str).split(" ")[0].substring(1); + + String[] pluginPrefix = name.split(":"); + if (pluginPrefix.length == 2) { + name = pluginPrefix[1]; + } + + return name; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/EntityUtil.java b/src/main/java/su/nightexpress/nightcore/util/EntityUtil.java new file mode 100644 index 0000000..a1cb8b9 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/EntityUtil.java @@ -0,0 +1,80 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.attribute.Attribute; +import org.bukkit.attribute.AttributeInstance; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.inventory.EntityEquipment; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class EntityUtil { + + /*@Deprecated + public static boolean isNPC(@NotNull Entity entity) { + return entity.hasMetadata("NPC"); + }*/ + + public static double getAttribute(@NotNull LivingEntity entity, @NotNull Attribute attribute) { + AttributeInstance instance = entity.getAttribute(attribute); + return instance == null ? 0D : instance.getValue(); + } + + public static double getAttributeBase(@NotNull LivingEntity entity, @NotNull Attribute attribute) { + AttributeInstance instance = entity.getAttribute(attribute); + return instance == null ? 0D : instance.getBaseValue(); + } + + @NotNull + public static Map getEquippedItems(@NotNull LivingEntity entity) { + return getEquippedItems(entity, EquipmentSlot.values()); + } + + @NotNull + public static Map getEquippedItems(@NotNull LivingEntity entity, @NotNull EquipmentSlot... slots) { + EntityEquipment equipment = entity.getEquipment(); + if (equipment == null) return Collections.emptyMap(); + + Map map = new HashMap<>(); + for (EquipmentSlot slot : slots) { + map.put(slot, equipment.getItem(slot)); + } + return map; + } + + @NotNull + public static Map getEquippedHands(@NotNull LivingEntity entity) { + return getEquippedItems(entity, EquipmentSlot.HAND, EquipmentSlot.OFF_HAND); + } + + @NotNull + public static Map getEquippedArmor(@NotNull LivingEntity entity) { + return getEquippedItems(entity, EquipmentSlot.FEET, EquipmentSlot.LEGS, EquipmentSlot.CHEST, EquipmentSlot.HEAD); + } + + @Nullable + public static BlockFace getDirection(@NotNull Entity entity) { + float yaw = Math.round(entity.getLocation().getYaw() / 90F); + + if ((yaw == -4.0F) || (yaw == 0.0F) || (yaw == 4.0F)) { + return BlockFace.SOUTH; + } + if ((yaw == -1.0F) || (yaw == 3.0F)) { + return BlockFace.EAST; + } + if ((yaw == -2.0F) || (yaw == 2.0F)) { + return BlockFace.NORTH; + } + if ((yaw == -3.0F) || (yaw == 1.0F)) { + return BlockFace.WEST; + } + return null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/FileUtil.java b/src/main/java/su/nightexpress/nightcore/util/FileUtil.java new file mode 100644 index 0000000..8bcccb4 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/FileUtil.java @@ -0,0 +1,91 @@ +package su.nightexpress.nightcore.util; + +import org.jetbrains.annotations.NotNull; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +public class FileUtil { + + public static void copy(@NotNull InputStream inputStream, @NotNull File file) { + try { + FileOutputStream outputStream = new FileOutputStream(file); + byte[] array = new byte[1024]; + int read; + while ((read = inputStream.read(array)) > 0) { + outputStream.write(array, 0, read); + } + outputStream.close(); + inputStream.close(); + } + catch (IOException ex) { + ex.printStackTrace(); + } + } + + public static boolean create(@NotNull File file) { + if (file.exists()) return false; + + File parent = file.getParentFile(); + if (parent == null) return false; + + parent.mkdirs(); + try { + return file.createNewFile(); + } + catch (IOException e) { + e.printStackTrace(); + return false; + } + } + + @NotNull + public static List getFiles(@NotNull String path, boolean deep) { + List files = new ArrayList<>(); + + File folder = new File(path); + File[] listOfFiles = folder.listFiles(); + if (listOfFiles == null) return files; + + for (File file : listOfFiles) { + if (file.isFile()) { + files.add(file); + } + else if (file.isDirectory() && deep) { + files.addAll(getFiles(file.getPath(), true)); + } + } + return files; + } + + @NotNull + public static List getFolders(@NotNull String path) { + File folder = new File(path); + File[] listOfFiles = folder.listFiles(); + if (listOfFiles == null) return Collections.emptyList(); + + return Stream.of(listOfFiles).filter(File::isDirectory).toList(); + } + + public static boolean deleteRecursive(@NotNull String path) { + return deleteRecursive(new File(path)); + } + + public static boolean deleteRecursive(@NotNull File dir) { + if (!dir.exists()) return false; + + File[] inside = dir.listFiles(); + if (inside != null) { + for (File file : inside) { + deleteRecursive(file); + } + } + return dir.delete(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/ItemReplacer.java b/src/main/java/su/nightexpress/nightcore/util/ItemReplacer.java new file mode 100644 index 0000000..c5b2514 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/ItemReplacer.java @@ -0,0 +1,246 @@ +package su.nightexpress.nightcore.util; + +import com.google.common.base.Splitter; +import me.clip.placeholderapi.PlaceholderAPI; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemFlag; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.language.entry.LangItem; +import su.nightexpress.nightcore.util.placeholder.PlaceholderMap; +import su.nightexpress.nightcore.util.text.NightMessage; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Supplier; +import java.util.function.UnaryOperator; + +public class ItemReplacer { + + private final ItemStack item; + private final ItemMeta meta; + private final PlaceholderMap placeholderMap; + + private String displayName; + private String lore; + + private boolean trimLore; + private boolean hideFlags; + + public ItemReplacer(@NotNull ItemStack item) { + this(item, item.getItemMeta()); + } + + public ItemReplacer(@NotNull ItemMeta meta) { + this(null, meta); + } + + public ItemReplacer(@Nullable ItemStack item, @Nullable ItemMeta meta) { + this.item = item; + this.meta = meta; + this.placeholderMap = new PlaceholderMap(); + } + + @NotNull + public ItemReplacer readMeta() { + if (this.hasMeta()) { + this.setDisplayName(this.meta.getDisplayName()); + this.setLore(this.meta.getLore()); + } + return this; + } + + @NotNull + public ItemReplacer readLocale(@NotNull LangItem locale) { + if (this.hasMeta()) { + this.setDisplayName(locale.getLocalizedName()); + this.setLore(locale.getLocalizedLore()); + } + return this; + } + + public void writeMeta() { + if (!this.hasMeta()) return; + + this.replace(this.placeholderMap.replacer()); + + this.meta.setDisplayName(this.getDisplayName() == null ? null : NightMessage.asLegacy(this.getDisplayName())); + this.meta.setLore(NightMessage.asLegacy(this.packTrimmedLore())); + + if (this.isHideFlags()) { + this.meta.addItemFlags(ItemFlag.values()); + } + + if (this.hasItem()) { + this.item.setItemMeta(this.meta); + } + } + + @NotNull + public static ItemReplacer create(@NotNull ItemStack item) { + return new ItemReplacer(item); + } + + @NotNull + public static ItemReplacer create(@NotNull ItemMeta meta) { + return new ItemReplacer(meta); + } + + public static void replace(@NotNull ItemStack item, @NotNull UnaryOperator replacer) { + create(item).trimmed().readMeta().replace(replacer).writeMeta(); + } + + public static void replace(@NotNull ItemMeta meta, @NotNull UnaryOperator replacer) { + create(meta).trimmed().readMeta().replace(replacer).writeMeta(); + } + + public boolean hasMeta() { + return this.meta != null; + } + + public boolean hasItem() { + return this.item != null; + } + + public boolean isTrimLore() { + return trimLore; + } + + public boolean isHideFlags() { + return hideFlags; + } + + @NotNull + public ItemReplacer trimmed() { + this.setTrimLore(true); + return this; + } + + @NotNull + public ItemReplacer hideFlags() { + this.setHideFlags(true); + return this; + } + + @NotNull + public ItemReplacer setHideFlags(boolean hideFlags) { + this.hideFlags = hideFlags; + return this; + } + + @NotNull + public ItemReplacer setTrimLore(boolean trimLore) { + this.trimLore = trimLore; + return this; + } + + @NotNull + public ItemReplacer replace(@NotNull String placeholder, @NotNull String value) { + return this.replace(placeholder, () -> value); + } + + @NotNull + public ItemReplacer replace(@NotNull String placeholder, @NotNull Supplier value) { + this.placeholderMap.add(placeholder, value); + return this; + } + + @NotNull + public ItemReplacer replace(@NotNull PlaceholderMap... placeholderMaps) { + for (PlaceholderMap placeholder : placeholderMaps) { + this.placeholderMap.add(placeholder); + } + return this; + } + + @NotNull + public ItemReplacer replace(@NotNull UnaryOperator replacer) { + if (this.getDisplayName() != null) { + this.setDisplayName(replacer.apply(this.getDisplayName())); + } + + if (this.getLore() != null) { + this.setLore(replacer.apply(this.getLore())); + } + return this; + } + + @NotNull + public ItemReplacer replacePlaceholderAPI(@NotNull Player player) { + if (!Plugins.hasPlaceholderAPI()) return this; + + this.replace(str -> PlaceholderAPI.setPlaceholders(player, str)); + return this; + } + + @NotNull + public ItemReplacer replaceLoreExact(@NotNull String placeholder, @NotNull List replacer) { + if (this.getLore() == null) return this; + + this.setLore(Lists.replace(this.packLore(), placeholder, replacer)); + return this; + } + + @NotNull + public ItemReplacer replaceLoreTrail(@NotNull String placeholder, @NotNull List replacer) { + if (this.getLore() == null) return this; + + List loreReplaced = new ArrayList<>(); + for (String lineHas : this.packLore()) { + if (lineHas.contains(placeholder)) { + replacer.forEach(lineRep -> { + loreReplaced.add(lineHas.replace(placeholder, lineRep)); + }); + continue; + } + loreReplaced.add(lineHas); + } + this.setLore(loreReplaced); + return this; + } + + @NotNull + public List packLore() { + if (this.getLore() == null) return new ArrayList<>(); + + return Splitter.on("\n").splitToList(this.getLore()); + } + + @NotNull + public List packTrimmedLore() { + List lore = this.packLore(); + if (this.isTrimLore()) { + lore = Lists.stripEmpty(lore); + } + return lore; + } + + @Nullable + public String getDisplayName() { + return displayName; + } + + @NotNull + public ItemReplacer setDisplayName(@Nullable String displayName) { + this.displayName = displayName; + return this; + } + + @Nullable + public String getLore() { + return lore; + } + + @NotNull + public ItemReplacer setLore(@Nullable List lore) { + return this.setLore(lore == null ? null : String.join("\n", lore)); + } + + @NotNull + public ItemReplacer setLore(@Nullable String lore) { + this.lore = lore; + return this; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/ItemUtil.java b/src/main/java/su/nightexpress/nightcore/util/ItemUtil.java new file mode 100644 index 0000000..3452d02 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/ItemUtil.java @@ -0,0 +1,331 @@ +package su.nightexpress.nightcore.util; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.Tag; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.profile.PlayerProfile; +import org.bukkit.profile.PlayerTextures; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.language.LangAssets; + +import java.io.*; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.math.BigInteger; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.*; +import java.util.function.Consumer; + +public class ItemUtil { + + private static final String VERSION = Version.getProtocol(); + private static final String TEXTURES_HOST = "http://textures.minecraft.net/texture/"; + + private static final Class NBT_TAG_COMPOUND = Reflex.getClass("net.minecraft.nbt", "NBTTagCompound"); + private static final Class NMS_ITEM = Reflex.getClass("net.minecraft.world.item", "ItemStack"); + private static final Class CRAFT_ITEM_STACK = Reflex.getClass("org.bukkit.craftbukkit." + VERSION + ".inventory", "CraftItemStack"); + private static final Class NBT_IO = Reflex.getClass("net.minecraft.nbt", "NBTCompressedStreamTools"); + + private static final Constructor NBT_TAG_COMPOUND_NEW = Reflex.getConstructor(NBT_TAG_COMPOUND); + + private static final Method AS_NMS_COPY = Reflex.getMethod(CRAFT_ITEM_STACK, "asNMSCopy", ItemStack.class); + private static final Method AS_BUKKIT_COPY = Reflex.getMethod(CRAFT_ITEM_STACK, "asBukkitCopy", NMS_ITEM); + + private static final Method NMS_ITEM_OF = Reflex.getMethod(NMS_ITEM, "a", NBT_TAG_COMPOUND); + private static final Method NMS_SAVE = Reflex.getMethod(NMS_ITEM, "b", NBT_TAG_COMPOUND); + + private static final Method NBT_IO_WRITE = Reflex.getMethod(NBT_IO, "a", NBT_TAG_COMPOUND, DataOutput.class); + private static final Method NBT_IO_READ = Reflex.getMethod(NBT_IO, "a", DataInput.class); + + @NotNull + public static String getItemName(@NotNull ItemStack item) { + ItemMeta meta = item.getItemMeta(); + return (meta == null || !meta.hasDisplayName()) ? LangAssets.get(item.getType()) : meta.getDisplayName(); + } + + public static void editMeta(@NotNull ItemStack item, @NotNull Consumer function) { + ItemMeta meta = item.getItemMeta(); + if (meta == null) return; + + function.accept(meta); + item.setItemMeta(meta); + } + + @NotNull + public static List getLore(@NotNull ItemStack item) { + ItemMeta meta = item.getItemMeta(); + return (meta == null || meta.getLore() == null) ? new ArrayList<>() : meta.getLore(); + } + + @NotNull + @Deprecated + public static ItemStack createCustomHead(@NotNull String texture) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + setSkullTexture(item, texture); + return item; + } + + @NotNull + public static ItemStack getSkinHead(@NotNull String texture) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + setHeadSkin(item, texture); + return item; + } + + public static void setHeadSkin(@NotNull ItemStack item, @NotNull String urlData) { + if (item.getType() != Material.PLAYER_HEAD) return; + if (!(item.getItemMeta() instanceof SkullMeta meta)) return; + + UUID uuid = UUID.nameUUIDFromBytes(urlData.getBytes()); + PlayerProfile profile = Bukkit.createPlayerProfile(uuid); + + if (!urlData.startsWith(TEXTURES_HOST)) { + urlData = TEXTURES_HOST + urlData; + } + + try { + URL url = new URL(urlData); + PlayerTextures textures = profile.getTextures(); + textures.setSkin(url); + profile.setTextures(textures); + meta.setOwnerProfile(profile); + } + catch (MalformedURLException exception) { + exception.printStackTrace(); + } + } + + @Nullable + public static String getHeadSkin(@NotNull ItemStack item) { + if (item.getType() != Material.PLAYER_HEAD) return null; + if (!(item.getItemMeta() instanceof SkullMeta meta)) return null; + + PlayerProfile profile = meta.getOwnerProfile(); + if (profile == null) return null; + + URL skin = profile.getTextures().getSkin(); + if (skin == null) return null; + + String raw = skin.toString(); + return raw.substring(TEXTURES_HOST.length()); + } + + @Deprecated + public static void setSkullTexture(@NotNull ItemStack item, @NotNull String value) { + if (item.getType() != Material.PLAYER_HEAD) return; + if (!(item.getItemMeta() instanceof SkullMeta meta)) return; + + UUID uuid = UUID.nameUUIDFromBytes(value.getBytes()); + GameProfile profile = new GameProfile(uuid, "null"); + profile.getProperties().put("textures", new Property("textures", value)); + + Method method = Reflex.getMethod(meta.getClass(), "setProfile", GameProfile.class); + if (method != null) { + Reflex.invokeMethod(method, meta, profile); + } + else { + Reflex.setFieldValue(meta, "profile", profile); + } + + item.setItemMeta(meta); + } + + @Nullable + @Deprecated + public static String getSkullTexture(@NotNull ItemStack item) { + if (item.getType() != Material.PLAYER_HEAD) return null; + + SkullMeta meta = (SkullMeta) item.getItemMeta(); + if (meta == null) return null; + + GameProfile profile = (GameProfile) Reflex.getFieldValue(meta, "profile"); + if (profile == null) return null; + + Collection properties = profile.getProperties().get("textures"); + Optional opt = properties.stream().filter(prop -> { + String name; + if (Version.isAtLeast(Version.V1_20_R2)) { + name = prop.name(); + } + else { + name = (String) Reflex.getFieldValue(profile, "name"); + } + return name != null && name.equalsIgnoreCase("textures"); + }).findFirst(); + + if (opt.isEmpty()) return null; + + if (Version.isAtLeast(Version.V1_20_R2)) { + return opt.get().value(); + } + else { + return (String) Reflex.getFieldValue(opt.get(), "value"); + } + } + + public static boolean isTool(@NotNull ItemStack item) { + return isAxe(item) || isHoe(item) || isPickaxe(item) || isShovel(item); + } + + public static boolean isArmor(@NotNull ItemStack item) { + return isHelmet(item) || isChestplate(item) || isLeggings(item) || isBoots(item); + } + + public static boolean isBow(@NotNull ItemStack item) { + return item.getType() == Material.BOW || item.getType() == Material.CROSSBOW; + } + + public static boolean isSword(@NotNull ItemStack item) { + if (Version.isAtLeast(Version.V1_19_R3)) { + return Tag.ITEMS_SWORDS.isTagged(item.getType()); + } + + Material material = item.getType(); + return material == Material.DIAMOND_SWORD || material == Material.GOLDEN_SWORD + || material == Material.IRON_SWORD || material == Material.NETHERITE_SWORD + || material == Material.STONE_SWORD || material == Material.WOODEN_SWORD; + } + + public static boolean isAxe(@NotNull ItemStack item) { + if (Version.isAtLeast(Version.V1_19_R3)) { + return Tag.ITEMS_AXES.isTagged(item.getType()); + } + + Material material = item.getType(); + return material == Material.DIAMOND_AXE || material == Material.GOLDEN_AXE + || material == Material.IRON_AXE || material == Material.NETHERITE_AXE + || material == Material.STONE_AXE || material == Material.WOODEN_AXE; + } + + public static boolean isTrident(@NotNull ItemStack item) { + return item.getType() == Material.TRIDENT; + } + + public static boolean isPickaxe(@NotNull ItemStack item) { + if (Version.isAtLeast(Version.V1_19_R3)) { + return Tag.ITEMS_PICKAXES.isTagged(item.getType()); + } + + Material material = item.getType(); + return material == Material.DIAMOND_PICKAXE || material == Material.GOLDEN_PICKAXE + || material == Material.IRON_PICKAXE || material == Material.NETHERITE_PICKAXE + || material == Material.STONE_PICKAXE || material == Material.WOODEN_PICKAXE; + } + + public static boolean isShovel(@NotNull ItemStack item) { + if (Version.isAtLeast(Version.V1_19_R3)) { + return Tag.ITEMS_SHOVELS.isTagged(item.getType()); + } + + Material material = item.getType(); + return material == Material.DIAMOND_SHOVEL || material == Material.GOLDEN_SHOVEL + || material == Material.IRON_SHOVEL || material == Material.NETHERITE_SHOVEL + || material == Material.STONE_SHOVEL || material == Material.WOODEN_SHOVEL; + } + + public static boolean isHoe(@NotNull ItemStack item) { + if (Version.isAtLeast(Version.V1_19_R3)) { + return Tag.ITEMS_HOES.isTagged(item.getType()); + } + + Material material = item.getType(); + return material == Material.DIAMOND_HOE || material == Material.GOLDEN_HOE + || material == Material.IRON_HOE || material == Material.NETHERITE_HOE + || material == Material.STONE_HOE || material == Material.WOODEN_HOE; + } + + public static boolean isElytra(@NotNull ItemStack item) { + return item.getType() == Material.ELYTRA; + } + + public static boolean isFishingRod(@NotNull ItemStack item) { + return item.getType() == Material.FISHING_ROD; + } + + public static boolean isHelmet(@NotNull ItemStack item) { + return getEquipmentSlot(item) == EquipmentSlot.HEAD; + } + + public static boolean isChestplate(@NotNull ItemStack item) { + return getEquipmentSlot(item) == EquipmentSlot.CHEST; + } + + public static boolean isLeggings(@NotNull ItemStack item) { + return getEquipmentSlot(item) == EquipmentSlot.LEGS; + } + + public static boolean isBoots(@NotNull ItemStack item) { + return getEquipmentSlot(item) == EquipmentSlot.FEET; + } + + @NotNull + public static EquipmentSlot getEquipmentSlot(@NotNull ItemStack item) { + Material material = item.getType(); + return material.isItem() ? material.getEquipmentSlot() : EquipmentSlot.HAND; + } + + @Nullable + public static String compress(@NotNull ItemStack item) { + if (NBT_TAG_COMPOUND_NEW == null || AS_NMS_COPY == null || NMS_SAVE == null || NBT_IO_WRITE == null) { + throw new UnsupportedOperationException("Unsupported server version!"); + } + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + DataOutputStream dataOutput = new DataOutputStream(outputStream); + + try { + Object nbtTagCompoundItem = NBT_TAG_COMPOUND_NEW.newInstance(); + Object nmsItem = AS_NMS_COPY.invoke(null, item); + NMS_SAVE.invoke(nmsItem, nbtTagCompoundItem); + NBT_IO_WRITE.invoke(null, nbtTagCompoundItem, dataOutput); + return new BigInteger(1, outputStream.toByteArray()).toString(32); + } + catch (ReflectiveOperationException e) { + e.printStackTrace(); + return null; + } + } + + @Nullable + public static ItemStack decompress(@NotNull String compressed) { + if (NBT_IO_READ == null || NMS_ITEM_OF == null || AS_BUKKIT_COPY == null) { + throw new UnsupportedOperationException("Unsupported server version!"); + } + + ByteArrayInputStream inputStream = new ByteArrayInputStream(new BigInteger(compressed, 32).toByteArray()); + + Object nbtTagCompoundRoot; + try { + nbtTagCompoundRoot = NBT_IO_READ.invoke(null, new DataInputStream(inputStream)); + Object nmsItem = NMS_ITEM_OF.invoke(null, nbtTagCompoundRoot); + return (ItemStack) AS_BUKKIT_COPY.invoke(null, nmsItem); + } + catch (ReflectiveOperationException e) { + e.printStackTrace(); + return null; + } + } + + @NotNull + public static List compress(@NotNull ItemStack[] items) { + return compress(Arrays.asList(items)); + } + + @NotNull + public static List compress(@NotNull List items) { + return new ArrayList<>(items.stream().map(ItemUtil::compress).filter(Objects::nonNull).toList()); + } + + public static ItemStack[] decompress(@NotNull List list) { + List items = list.stream().map(ItemUtil::decompress).filter(Objects::nonNull).toList(); + return items.toArray(new ItemStack[list.size()]); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Lists.java b/src/main/java/su/nightexpress/nightcore/util/Lists.java new file mode 100644 index 0000000..b8d8f44 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Lists.java @@ -0,0 +1,234 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.generator.WorldInfo; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class Lists { + + @NotNull + public static List worldNames() { + return Plugins.CORE.getServer().getWorlds().stream().map(WorldInfo::getName).toList(); + } + + public static int indexOf(Object[] array, @NotNull Object objectToFind) { + return indexOf(array, objectToFind, 0); + } + + public static int indexOf(Object[] array, @NotNull Object objectToFind, int startIndex) { + if (array == null || array.length == 0) return -1; + if (!array.getClass().getComponentType().isInstance(objectToFind)) return -1; + + if (startIndex < 0) startIndex = 0; + + int index; + for (index = startIndex; index < array.length; ++index) { + if (objectToFind.equals(array[index])) { + return index; + } + } + + return -1; + } + + public static boolean contains(Object[] array, Object objectToFind) { + return indexOf(array, objectToFind) != -1; + } + + public static int indexOf(int[] array, int valueToFind) { + return indexOf(array, valueToFind, 0); + } + + public static int indexOf(int[] array, int valueToFind, int startIndex) { + if (array == null || array.length == 0) return -1; + + if (startIndex < 0) startIndex = 0; + + for (int index = startIndex; index < array.length; ++index) { + if (valueToFind == array[index]) { + return index; + } + } + + return -1; + } + + public static boolean contains(int[] array, int valueToFind) { + return indexOf(array, valueToFind) != -1; + } + + @NotNull + public static List> split(@NotNull List list, int targetSize) { + List> lists = new ArrayList<>(); + if (targetSize <= 0) return lists; + + for (int index = 0; index < list.size(); index += targetSize) { + lists.add(list.subList(index, Math.min(index + targetSize, list.size()))); + } + return lists; + } + + @NotNull + public static List replace(@NotNull List origin, @NotNull String var, String... with) { + return replace(origin, var, Arrays.asList(with)); + } + + @NotNull + public static List replace(@NotNull List origin, @NotNull String var, @NotNull List with) { + List replaced = new ArrayList<>(); + for (String line : origin) { + if (line.equalsIgnoreCase(var)) { + replaced.addAll(with); + } + else replaced.add(line); + } + return replaced; + } + + /** + * @param original List to remove empty lines from. + * @return A list with no multiple empty lines in a row. + */ + @NotNull + public static List stripEmpty(@NotNull List original) { + List stripped = new ArrayList<>(); + for (int index = 0; index < original.size(); index++) { + String line = original.get(index); + if (line.isEmpty()) { + String last = stripped.isEmpty() ? null : stripped.get(stripped.size() - 1); + if (last == null || last.isEmpty() || index == (original.size() - 1)) continue; + } + stripped.add(line); + } + return stripped; + } + + @NotNull + public static List getSequentialMatches(@NotNull List results, @NotNull String input) { + char[] chars = input.toCharArray(); + List goods = new ArrayList<>(); + + Result: + for (String sub : results) { + int lastIndex = -1; + + for (char letter : chars) { + int index = sub.indexOf(letter, lastIndex == -1 ? 0 : lastIndex); + if (index <= lastIndex) { + continue Result; + } + lastIndex = index; + } + goods.add(sub); + } + return goods; + } + + @NotNull + public static > Map sortAscent(@NotNull Map map) { + return sort(map, Map.Entry.comparingByValue()); + } + + @NotNull + public static > Map sortDescent(@NotNull Map map) { + return sort(map, Collections.reverseOrder(Map.Entry.comparingByValue())); + } + + @SafeVarargs + @NotNull + public static List newList(T... values) { + List list = new ArrayList<>(); + Collections.addAll(list, values); + return list; + } + + @SafeVarargs + @NotNull + public static Set newSet(T... values) { + Set list = new HashSet<>(); + Collections.addAll(list, values); + return list; + } + + @NotNull + public static > Map sort(@NotNull Map map, @NotNull Comparator> comparator) { + return new LinkedList<>(map.entrySet()).stream().sorted(comparator) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (old, nev) -> nev, LinkedHashMap::new)); + } + + @NotNull + public static List getEnums(@NotNull Class> clazz) { + return new ArrayList<>(Stream.of(clazz.getEnumConstants()).map(Object::toString).toList()); + } + + @NotNull + public static String getEnums(@NotNull Class> clazz, @NotNull String delimiter) { + return String.join(delimiter, getEnums(clazz)); + } + + @NotNull + public static > T next(@NotNull Enum numeration) { + return shifted(numeration, 1); + } + + @NotNull + public static > T next(@NotNull Enum numeration, @NotNull Predicate predicate) { + return shifted(numeration, 1, predicate); + } + + @NotNull + public static > T previous(@NotNull Enum numeration) { + return shifted(numeration, -1); + } + + @NotNull + public static > T previous(@NotNull Enum numeration, @NotNull Predicate predicate) { + return shifted(numeration, -1, predicate); + } + + @NotNull + public static > T shifted(@NotNull Enum numeration, int shift) { + return shifted(numeration, shift, null); + } + + @NotNull + private static > T shifted(@NotNull Enum numeration, int shift, @Nullable Predicate predicate) { + T[] values = numeration.getDeclaringClass().getEnumConstants(); + return shifted(values, numeration/*.ordinal()*/, shift, predicate); + } + + @NotNull + private static > T shifted(T[] values, @NotNull Enum origin, int shift, @Nullable Predicate predicate) { + if (predicate != null) { + T source = origin.getDeclaringClass().cast(origin); + List filtered = new ArrayList<>(Arrays.asList(values)); + filtered.removeIf(num -> !predicate.test(num) && num != source); + + int currentIndex = filtered.indexOf(source); + //List filtered = Stream.of(values).filter(predicate).toList(); + if (currentIndex < 0 | filtered.isEmpty()) return source;//values[currentIndex]; + + return shifted(filtered, currentIndex, shift); + } + return shifted(values, origin.ordinal(), shift); + } + + @NotNull + public static T shifted(T[] values, int currentIndex, int shift) { + int index = currentIndex + shift; + return values[index >= values.length || index < 0 ? 0 : index]; + } + + @NotNull + public static T shifted(@NotNull List values, int currentIndex, int shift) { + int index = currentIndex + shift; + if (index < 0) return values.get(values.size() - 1); + + return values.get(index >= values.size() ? 0 : index); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/LocationUtil.java b/src/main/java/su/nightexpress/nightcore/util/LocationUtil.java new file mode 100644 index 0000000..c99ee07 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/LocationUtil.java @@ -0,0 +1,81 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.util.Vector; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Objects; + +public class LocationUtil { + + @Nullable + public static String serialize(@NotNull Location location) { + World world = location.getWorld(); + if (world == null) return null; + + return location.getX() + "," + location.getY() + "," + location.getZ() + "," + location.getPitch() + "," + location.getYaw() + "," + world.getName(); + } + + @NotNull + public static List serialize(@NotNull Collection list) { + return new ArrayList<>(list.stream().map(LocationUtil::serialize).filter(Objects::nonNull).toList()); + } + + @Nullable + public static Location deserialize(@NotNull String raw) { + String[] split = raw.split(","); + if (split.length != 6) return null; + + World world = Bukkit.getWorld(split[5]); + if (world == null) { + Plugins.CORE.error("Invalid/Unloaded world for: '" + raw + "' location!"); + return null; + } + + double x = NumberUtil.getAnyDouble(split[0], 0); + double y = NumberUtil.getAnyDouble(split[1], 0); + double z = NumberUtil.getAnyDouble(split[2], 0); + float pitch = (float) NumberUtil.getAnyDouble(split[3], 0); + float yaw = (float) NumberUtil.getAnyDouble(split[4], 0); + + return new Location(world, x, y, z, yaw, pitch); + } + + @NotNull + public static List deserialize(@NotNull Collection list) { + return new ArrayList<>(list.stream().map(LocationUtil::deserialize).filter(Objects::nonNull).toList()); + } + + @NotNull + public static String getWorldName(@NotNull Location location) { + World world = location.getWorld(); + return world == null ? "null" : world.getName(); + } + + @NotNull + public static Location getCenter(@NotNull Location location) { + return getCenter(location, true); + } + + @NotNull + public static Location getCenter(@NotNull Location location, boolean doVertical) { + Location centered = location.clone(); + location.setX(location.getBlockX() + 0.5); + location.setY(location.getBlockY() + (doVertical ? 0.5 : 0)); + location.setZ(location.getBlockZ() + 0.5); + return location; + } + + @NotNull + public static Vector getDirection(@NotNull Location from, @NotNull Location to) { + Location origin = from.clone(); + origin.setDirection(to.toVector().subtract(origin.toVector())); + return origin.getDirection(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/NumberUtil.java b/src/main/java/su/nightexpress/nightcore/util/NumberUtil.java new file mode 100644 index 0000000..cef2161 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/NumberUtil.java @@ -0,0 +1,118 @@ +package su.nightexpress.nightcore.util; + +import org.jetbrains.annotations.NotNull; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; +import java.util.TreeMap; + +public class NumberUtil { + + private static final DecimalFormat FORMAT_ROUND_HUMAN; + private final static TreeMap ROMAN_MAP = new TreeMap<>(); + + static { + FORMAT_ROUND_HUMAN = new DecimalFormat("#,###.##", new DecimalFormatSymbols(Locale.ENGLISH)); + + ROMAN_MAP.put(1000, "M"); + ROMAN_MAP.put(900, "CM"); + ROMAN_MAP.put(500, "D"); + ROMAN_MAP.put(400, "CD"); + ROMAN_MAP.put(100, "C"); + ROMAN_MAP.put(90, "XC"); + ROMAN_MAP.put(50, "L"); + ROMAN_MAP.put(40, "XL"); + ROMAN_MAP.put(10, "X"); + ROMAN_MAP.put(9, "IX"); + ROMAN_MAP.put(5, "V"); + ROMAN_MAP.put(4, "IV"); + ROMAN_MAP.put(1, "I"); + } + + @NotNull + public static String format(double value) { + return FORMAT_ROUND_HUMAN.format(value); + } + + public static double round(double value) { + return new BigDecimal(value).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } + + @NotNull + public static String toRoman(int number) { + if (number <= 0) return String.valueOf(number); + + int key = ROMAN_MAP.floorKey(number); + if (number == key) { + return ROMAN_MAP.get(number); + } + return ROMAN_MAP.get(key) + toRoman(number - key); + } + + public static int[] splitIntoParts(int whole, int parts) { + int[] arr = new int[parts]; + int remain = whole; + int partsLeft = parts; + for (int i = 0; partsLeft > 0; i++) { + int size = (remain + partsLeft - 1) / partsLeft; // rounded up, aka ceiling + arr[i] = size; + remain -= size; + partsLeft--; + } + return arr; + } + + public static double getDouble(@NotNull String input) { + return getDouble(input, 0D); + } + + public static double getDouble(@NotNull String input, double defaultValue) { + return Math.abs(getAnyDouble(input, defaultValue)); + } + + public static double getAnyDouble(@NotNull String input, double defaultValue) { + try { + double amount = Double.parseDouble(input); + if (!Double.isNaN(amount) && !Double.isInfinite(amount)) { + return amount; + } + } + catch (NumberFormatException ignored) {} + + return defaultValue; + } + + public static int getInteger(@NotNull String input) { + return getInteger(input, 0); + } + + public static int getInteger(@NotNull String input, int defaultValue) { + return Math.abs(getAnyInteger(input, defaultValue)); + } + + public static int getAnyInteger(@NotNull String input, int defaultValue) { + try { + return Integer.parseInt(input); + } + catch (NumberFormatException ignored) {} + + return defaultValue; + } + + public static int[] getIntArray(@NotNull String str) { + String[] split = str.split(","); + int[] array = new int[split.length]; + for (int index = 0; index < split.length; index++) { + try { + array[index] = Integer.parseInt(split[index].trim()); + } + catch (NumberFormatException e) { + array[index] = 0; + } + } + return array; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/PDCUtil.java b/src/main/java/su/nightexpress/nightcore/util/PDCUtil.java new file mode 100644 index 0000000..e26b719 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/PDCUtil.java @@ -0,0 +1,221 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.NamespacedKey; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataAdapterContext; +import org.bukkit.persistence.PersistentDataContainer; +import org.bukkit.persistence.PersistentDataHolder; +import org.bukkit.persistence.PersistentDataType; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.nio.ByteBuffer; +import java.util.Optional; +import java.util.UUID; + +public class PDCUtil { + + public static final PersistentDataType UUID = new UUIDDataType(); + + @NotNull + public static Optional get(@NotNull ItemStack holder, @NotNull PersistentDataType type, @NotNull NamespacedKey key) { + ItemMeta meta = holder.getItemMeta(); + if (meta == null) return Optional.empty(); + + return get(meta, type, key); + } + + @NotNull + public static Optional get(@NotNull PersistentDataHolder holder, @NotNull PersistentDataType type, @NotNull NamespacedKey key) { + PersistentDataContainer container = holder.getPersistentDataContainer(); + if (container.has(key, type)) { + return Optional.ofNullable(container.get(key, type)); + } + return Optional.empty(); + } + + public static void set(@NotNull ItemStack holder, @NotNull NamespacedKey key, boolean value) { + set(holder, PersistentDataType.INTEGER, key, value ? 1 : 0); + } + + public static void set(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key, boolean value) { + set(holder, PersistentDataType.INTEGER, key, value ? 1 : 0); + } + + public static void set(@NotNull ItemStack holder, @NotNull NamespacedKey key, double value) { + set(holder, PersistentDataType.DOUBLE, key, value); + } + + public static void set(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key, double value) { + set(holder, PersistentDataType.DOUBLE, key, value); + } + + public static void set(@NotNull ItemStack holder, @NotNull NamespacedKey key, int value) { + set(holder, PersistentDataType.INTEGER, key, value); + } + + public static void set(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key, int value) { + set(holder, PersistentDataType.INTEGER, key, value); + } + + public static void set(@NotNull ItemStack holder, @NotNull NamespacedKey key, long value) { + set(holder, PersistentDataType.LONG, key, value); + } + + public static void set(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key, long value) { + set(holder, PersistentDataType.LONG, key, value); + } + + public static void set(@NotNull ItemStack holder, @NotNull NamespacedKey key, @Nullable String value) { + set(holder, PersistentDataType.STRING, key, value); + } + + public static void set(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key, @Nullable String value) { + set(holder, PersistentDataType.STRING, key, value); + } + + public static void set(@NotNull ItemStack holder, @NotNull NamespacedKey key, @Nullable UUID value) { + set(holder, UUID, key, value); + } + + public static void set(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key, @Nullable UUID value) { + set(holder, UUID, key, value); + } + + public static void set(@NotNull ItemStack item, + @NotNull PersistentDataType dataType, + @NotNull NamespacedKey key, + @Nullable Z value) { + ItemUtil.editMeta(item, meta -> set(meta, dataType, key, value)); + /*ItemMeta meta = item.getItemMeta(); + if (meta == null) return; + + set(meta, dataType, key, value); + item.setItemMeta(meta);*/ + } + + public static void set(@NotNull PersistentDataHolder holder, + @NotNull PersistentDataType dataType, + @NotNull NamespacedKey key, + @Nullable Z value) { + if (value == null) { + remove(holder, key); + return; + } + + PersistentDataContainer container = holder.getPersistentDataContainer(); + container.set(key, dataType, value); + + /*if (holder instanceof BlockState state) { + state.update(); + }*/ + } + + public static void remove(@NotNull ItemStack holder, @NotNull NamespacedKey key) { + //ItemMeta meta = holder.getItemMeta(); + //if (meta == null) return; + //remove(meta, key); + ItemUtil.editMeta(holder, meta -> remove(meta, key)); + } + + public static void remove(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key) { + PersistentDataContainer container = holder.getPersistentDataContainer(); + container.remove(key); + + /*if (holder instanceof BlockState state) { + state.update(); + }*/ + } + + @NotNull + public static Optional getString(@NotNull ItemStack holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.STRING, key); + } + + @NotNull + public static Optional getString(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.STRING, key); + } + + @NotNull + public static Optional getInt(@NotNull ItemStack holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.INTEGER, key); + } + + @NotNull + public static Optional getInt(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.INTEGER, key); + } + + @NotNull + public static Optional getLong(@NotNull ItemStack holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.LONG, key); + } + + @NotNull + public static Optional getLong(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.LONG, key); + } + + @NotNull + public static Optional getDouble(@NotNull ItemStack holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.DOUBLE, key); + } + + @NotNull + public static Optional getDouble(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.DOUBLE, key); + } + + @NotNull + public static Optional getBoolean(@NotNull ItemStack holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.INTEGER, key).map(i -> i != 0); + } + + @NotNull + public static Optional getBoolean(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key) { + return get(holder, PersistentDataType.INTEGER, key).map(i -> i != 0); + } + + @NotNull + public static Optional getUUID(@NotNull ItemStack holder, @NotNull NamespacedKey key) { + return get(holder, UUID, key); + } + + @NotNull + public static Optional getUUID(@NotNull PersistentDataHolder holder, @NotNull NamespacedKey key) { + return get(holder, UUID, key); + } + + public static class UUIDDataType implements PersistentDataType { + + @NotNull + @Override + public Class getPrimitiveType() { + return byte[].class; + } + + @NotNull + @Override + public Class getComplexType() { + return UUID.class; + } + + @Override + public byte @NotNull [] toPrimitive(UUID complex, @NotNull PersistentDataAdapterContext context) { + ByteBuffer bb = ByteBuffer.wrap(new byte[16]); + bb.putLong(complex.getMostSignificantBits()); + bb.putLong(complex.getLeastSignificantBits()); + return bb.array(); + } + + @Override + public @NotNull UUID fromPrimitive(byte @NotNull [] primitive, @NotNull PersistentDataAdapterContext context) { + ByteBuffer bb = ByteBuffer.wrap(primitive); + long firstLong = bb.getLong(); + long secondLong = bb.getLong(); + return new UUID(firstLong, secondLong); + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Pair.java b/src/main/java/su/nightexpress/nightcore/util/Pair.java new file mode 100644 index 0000000..1701b06 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Pair.java @@ -0,0 +1,49 @@ +package su.nightexpress.nightcore.util; + +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public class Pair { + + private final F first; + private final S second; + + public Pair(@NotNull F first, @NotNull S second) { + this.first = first; + this.second = second; + } + + @NotNull + public F getFirst() { + return this.first; + } + + @NotNull + public S getSecond() { + return this.second; + } + + @NotNull + public Pair swap() { + return of(this.second, this.first); + } + + @Override + public String toString() { + return "Pair{" + "first=" + first + ", second=" + second + '}'; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Pair other) { + return Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second); + } + return false; + } + + @NotNull + public static Pair of(@NotNull F first, @NotNull S second) { + return new Pair<>(first, second); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Placeholders.java b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java new file mode 100644 index 0000000..2723c5e --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java @@ -0,0 +1,72 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.Location; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.language.tag.MessageTags; +import su.nightexpress.nightcore.util.placeholder.PlaceholderMap; +import su.nightexpress.nightcore.util.text.tag.Tags; + +import java.util.function.UnaryOperator; + +public class Placeholders { + + public static final String GITHUB_URL = "https://github.com/nulli0n/nightcore-spigot/"; + public static final String WIKI_MAIN_URL = GITHUB_URL + "wiki/"; + public static final String WIKI_ITEMS_URL = WIKI_MAIN_URL + "Configuration-Tips#item-sections"; + public static final String WIKI_LANG_URL = WIKI_MAIN_URL + "Language-Config"; + + public static final String DEFAULT = "default"; + public static final String NONE = "none"; + public static final String WILDCARD = "*"; + + public static final String GENERIC_NAME = "%name%"; + public static final String GENERIC_ITEM = "%item%"; + public static final String GENERIC_VALUE = "%value%"; + public static final String GENERIC_AMOUNT = "%amount%"; + public static final String GENERIC_ENTRY = "%entry%"; + + public static final String TAG_NO_PREFIX = MessageTags.NO_PREFIX.getFullName(); + public static final String TAG_LINE_BREAK = Tags.LINE_BREAK.getFullName(); + + public static final String PLAYER_NAME = "%player_name%"; + public static final String PLAYER_DISPLAY_NAME = "%player_display_name%"; + + public static final String LOCATION_X = "%location_x%"; + public static final String LOCATION_Y = "%location_y%"; + public static final String LOCATION_Z = "%location_z%"; + public static final String LOCATION_WORLD = "%location_world%"; + + public static final String COMMAND_USAGE = "%command_usage%"; + public static final String COMMAND_DESCRIPTION = "%command_description%"; + public static final String COMMAND_LABEL = "%command_label%"; + + @NotNull + public static UnaryOperator forLocation(@NotNull Location location) { + return new PlaceholderMap() + .add(LOCATION_X, () -> NumberUtil.format(location.getX())) + .add(LOCATION_Y, () -> NumberUtil.format(location.getY())) + .add(LOCATION_Z, () -> NumberUtil.format(location.getZ())) + .add(LOCATION_WORLD, () -> LocationUtil.getWorldName(location)) + .replacer(); + } + + @NotNull + public static UnaryOperator forPlayer(@NotNull Player player) { + return new PlaceholderMap() + .add(PLAYER_NAME, player::getName) + .add(PLAYER_DISPLAY_NAME, player::getDisplayName) + .replacer(); + } + + @NotNull + public static UnaryOperator forSender(@NotNull CommandSender sender) { + if (sender instanceof Player player) return forPlayer(player); + + return new PlaceholderMap() + .add(PLAYER_NAME, sender::getName) + .add(PLAYER_DISPLAY_NAME, sender::getName) + .replacer(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Players.java b/src/main/java/su/nightexpress/nightcore/util/Players.java new file mode 100644 index 0000000..bb3c286 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Players.java @@ -0,0 +1,282 @@ +package su.nightexpress.nightcore.util; + +import me.clip.placeholderapi.PlaceholderAPI; +import net.md_5.bungee.api.ChatMessageType; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.geysermc.floodgate.api.FloodgateApi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.core.CoreConfig; +import su.nightexpress.nightcore.integration.VaultHook; +import su.nightexpress.nightcore.util.message.NexParser; +import su.nightexpress.nightcore.util.text.NightMessage; +import su.nightexpress.nightcore.util.text.WrappedMessage; + +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Stream; + +public class Players { + + @NotNull + public static List playerNames() { + return playerNames(null); + } + + @NotNull + public static List playerNames(@Nullable Player viewer) { + return playerNames(viewer, true); + } + + @NotNull + public static List realPlayerNames() { + return realPlayerNames(null); + } + + @NotNull + public static List realPlayerNames(@Nullable Player viewer) { + return playerNames(viewer, false); + } + + @NotNull + public static List playerNames(@Nullable Player viewer, boolean includeCustom) { + Set names = new HashSet<>(); + for (Player player : Bukkit.getServer().getOnlinePlayers()) { + if (viewer != null && !viewer.canSee(player)) continue; + + names.add(player.getName()); + if (includeCustom && CoreConfig.RESPECT_PLAYER_DISPLAYNAME.get()) { + names.add(Colorizer.strip(player.getDisplayName())); + } + } + return names.stream().sorted(String::compareTo).toList(); + } + + @NotNull + public static Optional find(@NotNull String nameOrNick) { + return Optional.ofNullable(getPlayer(nameOrNick)); + } + + @Nullable + public static Player getPlayer(@NotNull String nameOrNick) { + if (!CoreConfig.RESPECT_PLAYER_DISPLAYNAME.get()) { + return Bukkit.getServer().getPlayer(nameOrNick); + } + + Player found = Bukkit.getServer().getPlayerExact(nameOrNick); + if (found != null) { + return found; + } + + String lowerName = nameOrNick.toLowerCase(); + int lowerLength = lowerName.length(); + int delta = Integer.MAX_VALUE; + + for (Player player : Bukkit.getServer().getOnlinePlayers()) { + String nameReal = player.getName().toLowerCase(Locale.ENGLISH); + String nameCustom = player.getDisplayName().toLowerCase(); + + int length; + if (nameReal.startsWith(lowerName)) { + length = player.getName().length(); + } + else if (nameCustom.startsWith(lowerName)) { + length = player.getDisplayName().length(); + } + else continue; + + int curDelta = Math.abs(length - lowerLength); + if (curDelta < delta) { + found = player; + delta = curDelta; + } + + if (curDelta == 0) break; + } + + return found; + } + + public static boolean isBedrock(@NotNull Player player) { + return Plugins.hasFloodgate() && FloodgateApi.getInstance().isFloodgatePlayer(player.getUniqueId()); + } + + public static boolean isReal(@NotNull Player player) { + return Bukkit.getServer().getPlayer(player.getUniqueId()) != null; + } + + @NotNull + public static String getPermissionGroup(@NotNull Player player) { + return Plugins.hasVault() ? VaultHook.getPermissionGroup(player).toLowerCase() : Placeholders.DEFAULT; + } + + @NotNull + public static Set getPermissionGroups(@NotNull Player player) { + return Plugins.hasVault() ? VaultHook.getPermissionGroups(player) : Collections.emptySet(); + } + + @NotNull + public static String getPrefix(@NotNull Player player) { + return Plugins.hasVault() ? VaultHook.getPrefix(player) : ""; + } + + @NotNull + public static String getSuffix(@NotNull Player player) { + return Plugins.hasVault() ? VaultHook.getSuffix(player) : ""; + } + + @Deprecated + public static void sendRichMessage(@NotNull CommandSender sender, @NotNull String message) { + if (!(sender instanceof Player player)) { + sender.sendMessage(Colorizer.apply(NexParser.toPlainText(message))); + return; + } + NexParser.toMessage(message).send(sender); + } + + public static void sendModernMessage(@NotNull CommandSender sender, @NotNull String message) { + NightMessage.create(message).send(sender); + } + + @Deprecated + public static void sendActionBar(@NotNull Player player, @NotNull String msg) { + player.spigot().sendMessage(ChatMessageType.ACTION_BAR, NexParser.toMessage(msg).build()); + } + + public static void sendActionBarText(@NotNull Player player, @NotNull String message) { + sendActionBar(player, NightMessage.create(message)); + } + + public static void sendActionBar(@NotNull Player player, @NotNull WrappedMessage message) { + player.spigot().sendMessage(ChatMessageType.ACTION_BAR, message.parseIfAbsent()); + } + + public static void dispatchCommands(@NotNull Player player, @NotNull String... commands) { + dispatchCommands(player, Arrays.asList(commands)); + } + + public static void dispatchCommands(@NotNull Player player, @NotNull List commands) { + for (String command : commands) { + dispatchCommand(player, command); + } + } + + public static void dispatchCommand(@NotNull Player player, @NotNull String command) { + command = command.replace("[CONSOLE]", ""); + command = command.trim().replace("%player%", player.getName()); + command = Placeholders.forPlayer(player).apply(command); + if (Plugins.hasPlaceholderAPI()) { + command = PlaceholderAPI.setPlaceholders(player, command); + } + Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command); + } + + public static boolean hasEmptyInventory(@NotNull Player player) { + return Stream.of(player.getInventory().getContents()).allMatch(item -> item == null || item.getType().isAir()); + } + + public static boolean hasEmptyContents(@NotNull Player player) { + return Stream.of(player.getInventory().getContents()).allMatch(item -> item == null || item.getType().isAir()); + } + + public static int countItemSpace(@NotNull Player player, @NotNull ItemStack item) { + int stackSize = item.getType().getMaxStackSize(); + return Stream.of(player.getInventory().getContents()).mapToInt(itemHas -> { + if (itemHas == null || itemHas.getType().isAir()) { + return stackSize; + } + if (itemHas.isSimilar(item)) { + return (stackSize - itemHas.getAmount()); + } + return 0; + }).sum(); + } + + public static int countItem(@NotNull Player player, @NotNull Predicate predicate) { + return Stream.of(player.getInventory().getContents()) + .filter(item -> item != null && predicate.test(item)) + .mapToInt(ItemStack::getAmount).sum(); + } + + public static int countItem(@NotNull Player player, @NotNull ItemStack item) { + return countItem(player, item::isSimilar); + } + + public static int countItem(@NotNull Player player, @NotNull Material material) { + return countItem(player, itemHas -> itemHas.getType() == material); + } + + public static void takeItem(@NotNull Player player, @NotNull ItemStack item) { + takeItem(player, item, -1); + } + + public static void takeItem(@NotNull Player player, @NotNull ItemStack item, int amount) { + takeItem(player, itemHas -> itemHas.isSimilar(item), amount); + } + + public static void takeItem(@NotNull Player player, @NotNull Material material) { + takeItem(player, material, -1); + } + + public static void takeItem(@NotNull Player player, @NotNull Material material, int amount) { + takeItem(player, itemHas -> itemHas.getType() == material, amount); + } + + public static void takeItem(@NotNull Player player, @NotNull Predicate predicate) { + takeItem(player, predicate, -1); + } + + public static void takeItem(@NotNull Player player, @NotNull Predicate predicate, int amount) { + int takenAmount = 0; + + Inventory inventory = player.getInventory(); + for (ItemStack itemHas : inventory.getContents()) { + if (itemHas == null || !predicate.test(itemHas)) continue; + + if (amount < 0) { + itemHas.setAmount(0); + continue; + } + + int hasAmount = itemHas.getAmount(); + if (takenAmount + hasAmount > amount) { + int diff = (takenAmount + hasAmount) - amount; + itemHas.setAmount(diff); + break; + } + + itemHas.setAmount(0); + if ((takenAmount += hasAmount) == amount) { + break; + } + } + } + + public static void addItem(@NotNull Player player, @NotNull ItemStack... items) { + for (ItemStack item : items) { + addItem(player, item, item.getAmount()); + } + } + + public static void addItem(@NotNull Player player, @NotNull ItemStack item2, int amount) { + if (amount <= 0 || item2.getType().isAir()) return; + + World world = player.getWorld(); + ItemStack item = new ItemStack(item2); + + int realAmount = Math.min(item.getMaxStackSize(), amount); + item.setAmount(realAmount); + player.getInventory().addItem(item).values().forEach(left -> { + world.dropItem(player.getLocation(), left); + }); + + amount -= realAmount; + if (amount > 0) addItem(player, item2, amount); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Plugins.java b/src/main/java/su/nightexpress/nightcore/util/Plugins.java new file mode 100644 index 0000000..2e6829e --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Plugins.java @@ -0,0 +1,44 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.plugin.Plugin; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCore; + +public class Plugins { + + public static final NightCore CORE = NightCore.getPlugin(NightCore.class); + + public static final String VAULT = "Vault"; + public static final String PLACEHOLDER_API = "PlaceholderAPI"; + public static final String FLOODGATE = "floodgate"; + + private static final boolean HAS_PLACEHOLDER_API = isInstalled(PLACEHOLDER_API); + private static final boolean HAS_VAULT = isInstalled(VAULT); + private static final boolean HAS_FLOODGATE = isInstalled(FLOODGATE); + + public static boolean isInstalled(@NotNull String pluginName) { + Plugin plugin = CORE.getPluginManager().getPlugin(pluginName); + return plugin != null; + } + + public static boolean isLoaded(@NotNull String pluginName) { + Plugin plugin = CORE.getPluginManager().getPlugin(pluginName); + return plugin != null && plugin.isEnabled(); + } + + public static boolean isSpigot() { + return CORE.getServer().getVersion().contains("Spigot"); + } + + public static boolean hasPlaceholderAPI() { + return HAS_PLACEHOLDER_API;//hasPlugin(PLACEHOLDER_API); + } + + public static boolean hasVault() { + return HAS_VAULT;//hasPlugin(VAULT); + } + + public static boolean hasFloodgate() { + return HAS_FLOODGATE;//hasPlugin(FLOODGATE); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/RankMap.java b/src/main/java/su/nightexpress/nightcore/util/RankMap.java new file mode 100644 index 0000000..f1ed483 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/RankMap.java @@ -0,0 +1,147 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.config.ConfigValue; +import su.nightexpress.nightcore.config.FileConfig; + +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +public class RankMap { + + private final Mode mode; + private final String permissionPrefix; + private final T defaultValue; + private final Map values; + + public enum Mode { + RANK, PERMISSION + } + + public RankMap(@NotNull Mode mode, @NotNull String permissionPrefix, @NotNull T defaultValue, @NotNull Map values) { + this.mode = mode; + this.permissionPrefix = permissionPrefix; + this.defaultValue = defaultValue; + this.values = new HashMap<>(values); + } + + @NotNull + public static RankMap readInt(@NotNull FileConfig cfg, @NotNull String path) { + return read(cfg, path, Integer.class); + } + + @NotNull + public static RankMap readDouble(@NotNull FileConfig cfg, @NotNull String path) { + return read(cfg, path, Double.class); + } + + @NotNull + public static RankMap readLong(@NotNull FileConfig cfg, @NotNull String path) { + return read(cfg, path, Long.class); + } + + @NotNull + public static RankMap read(@NotNull FileConfig cfg, @NotNull String path, @NotNull Class clazz) { + if (!cfg.contains(path + ".Mode")) { + for (String rank : cfg.getSection(path)) { + T number; + if (clazz == Double.class) { + number = clazz.cast(cfg.getDouble(path + "." + rank)); + } + else number = clazz.cast(cfg.getInt(path + "." + rank)); + + if (rank.equalsIgnoreCase(Placeholders.DEFAULT)) { + cfg.set(path + ".Default_Value", number); + } + else { + cfg.set(path + ".Values." + rank, number); + } + } + cfg.remove(path); + } + + Mode mode = ConfigValue.create(path + ".Mode", Mode.class, Mode.RANK).read(cfg); + String permissionPrefix = ConfigValue.create(path + ".Permission_Prefix", "sample.prefix.").read(cfg); + + T defaultValue; + if (clazz == Double.class) { + defaultValue = clazz.cast(cfg.getDouble(path + ".Default_Value")); + } + else defaultValue = clazz.cast(cfg.getInt(path + ".Default_Value")); + + Map values = new HashMap<>(); + for (String rank : cfg.getSection(path + ".Values")) { + T number; + if (clazz == Double.class) { + number = clazz.cast(cfg.getDouble(path + ".Values." + rank)); + } + else number = clazz.cast(cfg.getInt(path + ".Values." + rank)); + + values.put(rank.toLowerCase(), number); + } + + return new RankMap<>(mode, permissionPrefix, defaultValue, values); + } + + public void write(@NotNull FileConfig cfg, @NotNull String path) { + cfg.set(path + ".Mode", this.getMode().name()); + cfg.set(path + ".Permission_Prefix", this.getPermissionPrefix()); + this.values.forEach((rank, number) -> { + cfg.set(path + ".Values." + rank, number); + }); + } + + @NotNull + public T getRankValue(@NotNull Player player) { + String group = Players.getPermissionGroup(player); + return this.values.getOrDefault(group, this.getDefaultValue()); + } + + @NotNull + public T getGreatestOrNegative(@NotNull Player player) { + T best = this.getGreatest(player); + T lowest = this.getSmallest(player); + + return lowest.doubleValue() < 0D ? lowest : best; + } + + @NotNull + public T getGreatest(@NotNull Player player) { + if (this.getMode() == Mode.RANK) { + return this.getRankValue(player); + } + return this.values.entrySet().stream() + .filter(entry -> player.hasPermission(this.getPermissionPrefix() + entry.getKey())) + .map(Map.Entry::getValue) + .max(Comparator.comparingDouble(Number::doubleValue)).orElse(this.getDefaultValue()); + } + + @NotNull + public T getSmallest(@NotNull Player player) { + if (this.getMode() == Mode.RANK) { + return this.getRankValue(player); + } + return this.values.entrySet().stream() + .filter(entry -> player.hasPermission(this.getPermissionPrefix() + entry.getKey())) + .map(Map.Entry::getValue) + .min(Comparator.comparingDouble(Number::doubleValue)).orElse(this.getDefaultValue()); + } + + @NotNull + public Mode getMode() { + return mode; + } + + @Nullable + public String getPermissionPrefix() { + return permissionPrefix; + } + + @NotNull + public T getDefaultValue() { + return defaultValue; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Reflex.java b/src/main/java/su/nightexpress/nightcore/util/Reflex.java new file mode 100644 index 0000000..5f243ac --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Reflex.java @@ -0,0 +1,158 @@ +package su.nightexpress.nightcore.util; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.lang.reflect.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class Reflex { + + public static Class getClass(@NotNull String path, @NotNull String name) { + return getClass(path + "." + name); + } + + public static Class getInnerClass(@NotNull String path, @NotNull String name) { + return getClass(path + "$" + name); + } + + private static Class getClass(@NotNull String path) { + try { + return Class.forName(path); + } + catch (ClassNotFoundException e) { + e.printStackTrace(); + return null; + } + } + + public static Constructor getConstructor(@NotNull Class clazz, Class... types) { + try { + Constructor constructor = clazz.getDeclaredConstructor(types); + constructor.setAccessible(true); + return constructor; + } + catch (ReflectiveOperationException e) { + e.printStackTrace(); + } + return null; + } + + public static Object invokeConstructor(@NotNull Constructor constructor, Object... obj) { + try { + return constructor.newInstance(obj); + } + catch (ReflectiveOperationException e) { + e.printStackTrace(); + } + return obj; + } + + @NotNull + public static List getFields(@NotNull Class clazz, @NotNull Class type) { + List list = new ArrayList<>(); + + for (Field field : Reflex.getFields(clazz)) { + if (!field.getDeclaringClass().equals(clazz)) continue; + //if (!field.canAccess(null)) continue; + if (!Modifier.isStatic(field.getModifiers())) continue; + if (!Modifier.isFinal(field.getModifiers())) continue; + if (!type.isAssignableFrom(field.getType())) continue; + if (!field.trySetAccessible()) continue; + + try { + list.add(type.cast(field.get(null))); + } + catch (IllegalArgumentException | IllegalAccessException exception) { + exception.printStackTrace(); + } + } + + return list; + } + + @NotNull + public static List getFields(@NotNull Class type) { + List result = new ArrayList<>(); + + Class clazz = type; + while (clazz != null && clazz != Object.class) { + if (!result.isEmpty()) { + result.addAll(0, Arrays.asList(clazz.getDeclaredFields())); + } + else { + Collections.addAll(result, clazz.getDeclaredFields()); + } + clazz = clazz.getSuperclass(); + } + + return result; + } + + public static Field getField(@NotNull Class clazz, @NotNull String fieldName) { + try { + return clazz.getDeclaredField(fieldName); + } + catch (NoSuchFieldException e) { + Class superClass = clazz.getSuperclass(); + return superClass == null ? null : getField(superClass, fieldName); + } + } + + public static Object getFieldValue(@NotNull Object from, @NotNull String fieldName) { + try { + Class clazz = from instanceof Class ? (Class) from : from.getClass(); + Field field = getField(clazz, fieldName); + if (field == null) return null; + + field.setAccessible(true); + return field.get(from); + } + catch (IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } + + public static boolean setFieldValue(@NotNull Object of, @NotNull String fieldName, @Nullable Object value) { + try { + boolean isStatic = of instanceof Class; + Class clazz = isStatic ? (Class) of : of.getClass(); + + Field field = getField(clazz, fieldName); + if (field == null) return false; + + field.setAccessible(true); + field.set(isStatic ? null : of, value); + return true; + } + catch (IllegalAccessException e) { + e.printStackTrace(); + } + return false; + } + + public static Method getMethod(@NotNull Class clazz, @NotNull String fieldName, @NotNull Class... o) { + try { + return clazz.getDeclaredMethod(fieldName, o); + } + catch (NoSuchMethodException e) { + Class superClass = clazz.getSuperclass(); + return superClass == null ? null : getMethod(superClass, fieldName); + } + } + + public static Object invokeMethod(@NotNull Method method, @Nullable Object by, @Nullable Object... param) { + method.setAccessible(true); + try { + return method.invoke(by, param); + } + catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/StringUtil.java b/src/main/java/su/nightexpress/nightcore/util/StringUtil.java new file mode 100644 index 0000000..05b7658 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/StringUtil.java @@ -0,0 +1,201 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.Color; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.random.Rnd; +import su.nightexpress.nightcore.util.regex.TimedMatcher; + +import java.util.List; +import java.util.Optional; +import java.util.function.Supplier; +import java.util.regex.Pattern; + +public class StringUtil { + + private static final Pattern ID_PATTERN = Pattern.compile("[<>\\%\\$\\!\\@\\#\\^\\&\\*\\(\\)\\,\\.\\'\\:\\;\\\"\\}\\]\\{\\[\\=\\+\\`\\~\\\\]");//Pattern.compile("[^a-zA-Zа-яА-Я_0-9]"); + private static final Pattern ID_STRICT_PATTERN = Pattern.compile("[^a-zA-Zа-яА-Я_0-9]"); + + @NotNull + @Deprecated + public static String oneSpace(@NotNull String str) { + return str.trim().replaceAll("\\s+", " "); + } + + @NotNull + @Deprecated + public static String noSpace(@NotNull String str) { + return str.trim().replaceAll("\\s+", ""); + } + + @NotNull + public static String replaceEach(@NotNull String text, @NotNull List>> replacements) { + if (text.isEmpty() || replacements.isEmpty()) { + return text; + } + + final int searchLength = replacements.size(); + // keep track of which still have matches + final boolean[] noMoreMatchesForReplIndex = new boolean[searchLength]; + + // index on index that the match was found + int textIndex = -1; + int replaceIndex = -1; + int tempIndex; + + // index of replace array that will replace the search string found + for (int i = 0; i < searchLength; i++) { + if (noMoreMatchesForReplIndex[i]) { + continue; + } + tempIndex = text.indexOf(replacements.get(i).getFirst()); + + // see if we need to keep searching for this + if (tempIndex == -1) { + noMoreMatchesForReplIndex[i] = true; + } + else if (textIndex == -1 || tempIndex < textIndex) { + textIndex = tempIndex; + replaceIndex = i; + } + } + + // no search strings found, we are done + if (textIndex == -1) { + return text; + } + + int start = 0; + final StringBuilder buf = new StringBuilder(); + while (textIndex != -1) { + for (int i = start; i < textIndex; i++) { + buf.append(text.charAt(i)); + } + buf.append(replacements.get(replaceIndex).getSecond().get()); + + start = textIndex + replacements.get(replaceIndex).getFirst().length(); + + textIndex = -1; + replaceIndex = -1; + // find the next earliest match + for (int i = 0; i < searchLength; i++) { + if (noMoreMatchesForReplIndex[i]) { + continue; + } + tempIndex = text.indexOf(replacements.get(i).getFirst(), start); + + // see if we need to keep searching for this + if (tempIndex == -1) { + noMoreMatchesForReplIndex[i] = true; + } + else if (textIndex == -1 || tempIndex < textIndex) { + textIndex = tempIndex; + replaceIndex = i; + } + } + } + + final int textLength = text.length(); + for (int i = start; i < textLength; i++) { + buf.append(text.charAt(i)); + } + return buf.toString(); + } + + @NotNull + public static > Optional getEnum(String str, @NotNull Class clazz) { + try { + return str == null ? Optional.empty() : Optional.of(Enum.valueOf(clazz, str.toUpperCase())); + } + catch (Exception exception) { + return Optional.empty(); + } + } + + @NotNull + public static Color getColor(@NotNull String str) { + String[] rgb = str.split(","); + int red = NumberUtil.getInteger(rgb[0], 0); + if (red < 0) red = Rnd.get(255); + + int green = rgb.length >= 2 ? NumberUtil.getInteger(rgb[1], 0) : 0; + if (green < 0) green = Rnd.get(255); + + int blue = rgb.length >= 3 ? NumberUtil.getInteger(rgb[2], 0) : 0; + if (blue < 0) blue = Rnd.get(255); + + return Color.fromRGB(red, green, blue); + } + + @NotNull + public static String lowerCaseUnderscore(@NotNull String str) { + return lowerCaseUnderscore(str, -1); + } + + @NotNull + public static String lowerCaseUnderscore(@NotNull String str, int length) { + return lowerCaseAndClean(str, ID_PATTERN, length); + } + + @NotNull + public static String lowerCaseUnderscoreStrict(@NotNull String str) { + return lowerCaseUnderscoreStrict(str, -1); + } + + @NotNull + public static String lowerCaseUnderscoreStrict(@NotNull String str, int length) { + return lowerCaseAndClean(str, ID_STRICT_PATTERN, length); + } + + @NotNull + private static String lowerCaseAndClean(@NotNull String str, @NotNull Pattern pattern, int length) { + String clean = Colorizer.restrip(str).toLowerCase().replace(" ", "_"); + if (length > 0 && clean.length() > length) { + clean = clean.substring(0, length); + } + + TimedMatcher matcher = TimedMatcher.create(pattern, clean, 200); + //Matcher matcher = RegexUtil.getMatcher(ID_STRICT_PATTERN, clean); + return matcher.replaceAll(""); + } + + @NotNull + public static String capitalizeUnderscored(@NotNull String str) { + return capitalizeFully(str.replace("_", " ")); + } + + @NotNull + public static String capitalizeFully(@NotNull String str) { + return capitalize(str.toLowerCase()); + } + + @NotNull + public static String capitalize(@NotNull String str) { + if (str.length() == 0) return str; + + int length = str.length(); + StringBuilder builder = new StringBuilder(length); + boolean capitalizeNext = true; + + for (int index = 0; index < length; ++index) { + char letter = str.charAt(index); + if (Character.isWhitespace(letter)) { + builder.append(letter); + capitalizeNext = true; + } + else if (capitalizeNext) { + builder.append(Character.toTitleCase(letter)); + capitalizeNext = false; + } + else { + builder.append(letter); + } + } + return builder.toString(); + } + + @NotNull + public static String capitalizeFirstLetter(@NotNull String original) { + if (original.isEmpty()) return original; + return original.substring(0, 1).toUpperCase() + original.substring(1); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/TimeUtil.java b/src/main/java/su/nightexpress/nightcore/util/TimeUtil.java new file mode 100644 index 0000000..95a5727 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/TimeUtil.java @@ -0,0 +1,80 @@ +package su.nightexpress.nightcore.util; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.core.CoreLang; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.TimeZone; +import java.util.concurrent.TimeUnit; + +public class TimeUtil { + + @NotNull + public static String formatTime(long time) { + long days = TimeUnit.MILLISECONDS.toDays(time); + long hours = TimeUnit.MILLISECONDS.toHours(time) % 24; + long minutes = TimeUnit.MILLISECONDS.toMinutes(time) % 60; + long seconds = TimeUnit.MILLISECONDS.toSeconds(time) % 60; + String delimiter = CoreLang.TIME_DELIMITER.getString(); + + StringBuilder str = new StringBuilder(); + if (days > 0) { + if (str.length() > 0) { + str.append(delimiter); + } + str.append(CoreLang.TIME_DAY.getString().replace(Placeholders.GENERIC_AMOUNT, String.valueOf(days))); + } + if (hours > 0) { + if (str.length() > 0) { + str.append(delimiter); + } + str.append(CoreLang.TIME_HOUR.getString().replace(Placeholders.GENERIC_AMOUNT, String.valueOf(hours))); + } + if (minutes > 0) { + if (str.length() > 0) { + str.append(delimiter); + } + str.append(CoreLang.TIME_MINUTE.getString().replace(Placeholders.GENERIC_AMOUNT, String.valueOf(minutes))); + } + if (str.length() == 0 || seconds > 0) { + if (str.length() > 0) { + str.append(delimiter); + } + str.append(CoreLang.TIME_SECOND.getString().replace(Placeholders.GENERIC_AMOUNT, String.valueOf(seconds))); + } + + return str.toString(); + } + + @NotNull + public static String formatDuration(long from, long to) { + long time = to - from; + return formatTime(time); + } + + @NotNull + public static String formatDuration(long until) { + return formatTime(until - System.currentTimeMillis()); + } + + @NotNull + public static LocalTime getLocalTimeOf(long ms) { + long hours = TimeUnit.MILLISECONDS.toHours(ms) % 24; + long minutes = TimeUnit.MILLISECONDS.toMinutes(ms) % 60; + long seconds = TimeUnit.MILLISECONDS.toSeconds(ms) % 60; + + return LocalTime.of((int) hours, (int) minutes, (int) seconds); + } + + @NotNull + public static LocalDateTime getLocalDateTimeOf(long ms) { + return LocalDateTime.ofInstant(Instant.ofEpochMilli(ms), TimeZone.getDefault().toZoneId()); + } + + public static long toEpochMillis(@NotNull LocalDateTime dateTime) { + Instant instant = dateTime.atZone(TimeZone.getDefault().toZoneId()).toInstant(); + return instant.toEpochMilli(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/TriFunction.java b/src/main/java/su/nightexpress/nightcore/util/TriFunction.java new file mode 100644 index 0000000..2a6a23c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/TriFunction.java @@ -0,0 +1,14 @@ +package su.nightexpress.nightcore.util; + +import java.util.Objects; +import java.util.function.Function; + +public interface TriFunction { + + R apply(T t, U u, V v); + + default TriFunction andThen(Function after) { + Objects.requireNonNull(after); + return (T t, U u, V v) -> after.apply(apply(t, u, v)); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/Version.java b/src/main/java/su/nightexpress/nightcore/util/Version.java new file mode 100644 index 0000000..243779d --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/Version.java @@ -0,0 +1,76 @@ +package su.nightexpress.nightcore.util; + +import org.bukkit.Bukkit; +import org.jetbrains.annotations.NotNull; + +public enum Version { + + V1_18_R2("1.18.2"), + V1_19_R3("1.19.4"), + V1_20_R1("1.20.1", true), + V1_20_R2("1.20.2", true), + V1_20_R3("1.20.4"), + UNKNOWN("Unknown"), + ; + + private static Version current; + + private final boolean deprecated; + private final String localized; + + Version(@NotNull String localized) { + this(localized, false); + } + + Version(@NotNull String localized, boolean deprecated) { + this.localized = localized; + this.deprecated = deprecated; + } + + @NotNull + public static String getProtocol() { + String[] split = Bukkit.getServer().getClass().getPackage().getName().split("\\."); + return split[split.length - 1]; + } + + @NotNull + public static Version getCurrent() { + if (current == null) { + current = StringUtil.getEnum(getProtocol(), Version.class).orElse(UNKNOWN); + } + return current; + } + + public boolean isDeprecated() { + return deprecated; + } + + @NotNull + public String getLocalized() { + return localized; + } + + public boolean isLower(@NotNull Version version) { + return this.ordinal() < version.ordinal(); + } + + public boolean isHigher(@NotNull Version version) { + return this.ordinal() > version.ordinal(); + } + + public static boolean isAtLeast(@NotNull Version version) { + return version.isCurrent() || getCurrent().isHigher(version); + } + + public static boolean isAbove(@NotNull Version version) { + return getCurrent().isHigher(version); + } + + public static boolean isBehind(@NotNull Version version) { + return getCurrent().isLower(version); + } + + public boolean isCurrent() { + return this == Version.getCurrent(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/blocktracker/PlayerBlockTracker.java b/src/main/java/su/nightexpress/nightcore/util/blocktracker/PlayerBlockTracker.java new file mode 100644 index 0000000..ca6b0ec --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/blocktracker/PlayerBlockTracker.java @@ -0,0 +1,139 @@ +package su.nightexpress.nightcore.util.blocktracker; + +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import org.bukkit.Bukkit; +import org.bukkit.Chunk; +import org.bukkit.NamespacedKey; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Plugins; + +import java.util.*; +import java.util.function.Predicate; + +public final class PlayerBlockTracker { + + public static final Set> BLOCK_FILTERS = new HashSet<>(); + public static final NamespacedKey TRACKED_DATA_KEY = NamespacedKey.minecraft("tracked_chunk_data"); + private static final Map TRACKED_WORLD_MAP = new Object2ObjectOpenHashMap<>(); + + private static TrackListener listener; + + public static void initialize() { + if (listener == null) { + initCurrentlyLoadedWorlds(); + (listener = new TrackListener<>(Plugins.CORE)).registerListeners(); + } + } + + public static void shutdown() { + if (listener != null) { + terminateCurrentlyLoadedWorlds(); + listener.unregisterListeners(); + listener = null; + BLOCK_FILTERS.clear(); + } + } + + public static void initWorld(@NotNull World world) { + TrackedWorld trackedWorld = new TrackedWorld(); + for (Chunk loadedChunk : world.getLoadedChunks()) { + trackedWorld.initChunk(loadedChunk); + } + TRACKED_WORLD_MAP.put(world.getUID(), trackedWorld); + } + + public static void terminateWorld(@NotNull World world) { + TrackedWorld trackedWorld = TRACKED_WORLD_MAP.remove(world.getUID()); + if (trackedWorld == null) { + return; + } + for (Chunk loadedChunk : world.getLoadedChunks()) { + trackedWorld.terminateChunk(loadedChunk); + } + } + + public static void initChunk(@NotNull Chunk chunk) { + TrackedWorld trackedWorld = getTrackedWorldOf(chunk); + if (trackedWorld == null) { + return; + } + trackedWorld.initChunk(chunk); + } + + public static void terminateChunk(@NotNull Chunk chunk) { + TrackedWorld trackedWorld = getTrackedWorldOf(chunk); + if (trackedWorld == null) { + return; + } + trackedWorld.terminateChunk(chunk); + } + + public static void initCurrentlyLoadedWorlds() { + Bukkit.getWorlds().forEach(PlayerBlockTracker::initWorld); + } + + public static void terminateCurrentlyLoadedWorlds() { + Bukkit.getWorlds().forEach(PlayerBlockTracker::terminateWorld); + } + + public static boolean isTracked(@NotNull Block block) { + TrackedWorld trackedWorld = getTrackedWorldOf(block); + if (trackedWorld == null) { + return false; + } + return trackedWorld.isTracked(block); + } + + public static void track(@NotNull Block block) { + if (BLOCK_FILTERS.stream().noneMatch(filter -> filter.test(block))) return; + trackForce(block); + } + + public static void trackForce(@NotNull Block block) { + TrackedWorld trackedWorld = getTrackedWorldOf(block); + if (trackedWorld == null) { + return; + } + trackedWorld.add(block); + } + + public static void unTrack(@NotNull Block block) { + TrackedWorld trackedWorld = getTrackedWorldOf(block); + if (trackedWorld == null) { + return; + } + trackedWorld.remove(block); + } + + public static void track(@NotNull Collection trackedBlocks) { + trackedBlocks.forEach(PlayerBlockTracker::trackForce); + } + + public static void unTrack(@NotNull Collection trackedBlocks) { + trackedBlocks.forEach(PlayerBlockTracker::unTrack); + } + + public static void shift(@NotNull BlockFace direction, @NotNull List blocks) { + unTrack(blocks); + track(blocks.stream().map(block -> block.getRelative(direction)).toList()); + } + + public static void move(@NotNull Block from, @NotNull Block to) { + unTrack(from); + track(to); + } + + @Nullable + private static TrackedWorld getTrackedWorldOf(@NotNull Block block) { + return TRACKED_WORLD_MAP.get(block.getWorld().getUID()); + } + + @Nullable + private static TrackedWorld getTrackedWorldOf(@NotNull Chunk chunk) { + return TRACKED_WORLD_MAP.get(chunk.getWorld().getUID()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackListener.java b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackListener.java new file mode 100644 index 0000000..edaf9bc --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackListener.java @@ -0,0 +1,151 @@ +package su.nightexpress.nightcore.util.blocktracker; + +import org.bukkit.GameMode; +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; +import org.bukkit.block.data.Lightable; +import org.bukkit.entity.Entity; +import org.bukkit.entity.FallingBlock; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.block.*; +import org.bukkit.event.entity.EntityChangeBlockEvent; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntitySpawnEvent; +import org.bukkit.event.world.*; +import org.bukkit.metadata.FixedMetadataValue; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; +import su.nightexpress.nightcore.manager.AbstractListener; + +public class TrackListener

extends AbstractListener

{ + + private static final String META_TRACK_FALLING_BLOCK = "tracker_falling_block"; + + public TrackListener(@NotNull P plugin) { + super(plugin); + } + + @EventHandler(priority = EventPriority.NORMAL) + public void onLoad(WorldLoadEvent event) { + PlayerBlockTracker.initWorld(event.getWorld()); + } + + @EventHandler(priority = EventPriority.NORMAL) + public void onUnload(WorldUnloadEvent event) { + PlayerBlockTracker.terminateWorld(event.getWorld()); + } + + @EventHandler(priority = EventPriority.NORMAL) + public void onLoad(ChunkLoadEvent event) { + PlayerBlockTracker.initChunk(event.getChunk()); + } + + @EventHandler(priority = EventPriority.NORMAL) + public void onUnload(ChunkUnloadEvent event) { + PlayerBlockTracker.terminateChunk(event.getChunk()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onPlace(BlockPlaceEvent event) { + if (event.getPlayer().getGameMode() == GameMode.CREATIVE) { + return; + } + PlayerBlockTracker.track(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onBreak(BlockBreakEvent event) { + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onExplode(BlockExplodeEvent event) { + PlayerBlockTracker.unTrack(event.blockList()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onExplode(EntityExplodeEvent event) { + PlayerBlockTracker.unTrack(event.blockList()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onBurn(BlockBurnEvent event) { + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onFade(BlockFadeEvent event) { + if (event.getBlock().getBlockData() instanceof Lightable) return; + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onForm(BlockFormEvent event) { + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onFlow(BlockFromToEvent event) { + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onGrow(BlockGrowEvent event) { + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onStructureGrow(StructureGrowEvent e) { + if (e.getPlayer() == null) return; + PlayerBlockTracker.track(e.getBlocks().stream().map(BlockState::getBlock).toList()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onMultiPlace(BlockMultiPlaceEvent event) { + PlayerBlockTracker.track(event.getReplacedBlockStates().stream().map(BlockState::getBlock).toList()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onPistonExtend(BlockPistonExtendEvent event) { + PlayerBlockTracker.shift(event.getDirection(), event.getBlocks()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onPistonRetract(BlockPistonRetractEvent event) { + if (!event.isSticky()) { + return; + } + PlayerBlockTracker.shift(event.getDirection(), event.getBlocks()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onSpread(BlockSpreadEvent event) { + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onEntityForm(EntityBlockFormEvent event) { + PlayerBlockTracker.unTrack(event.getBlock()); + } + + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + public void onEntityFallingSpawn(EntitySpawnEvent event) { + Entity entity = event.getEntity(); + if (!(entity instanceof FallingBlock)) return; + + Block block = entity.getLocation().getBlock(); + if (!PlayerBlockTracker.isTracked(block)) return; + + entity.setMetadata(META_TRACK_FALLING_BLOCK, new FixedMetadataValue(plugin, true)); + PlayerBlockTracker.unTrack(block); + } + + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + public void onEntityFallingLand(EntityChangeBlockEvent event) { + Entity entity = event.getEntity(); + if (!entity.hasMetadata(META_TRACK_FALLING_BLOCK)) return; + + PlayerBlockTracker.trackForce(event.getBlock()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackUtil.java b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackUtil.java new file mode 100644 index 0000000..1273978 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackUtil.java @@ -0,0 +1,28 @@ +package su.nightexpress.nightcore.util.blocktracker; + +import org.bukkit.Chunk; +import org.bukkit.block.Block; +import org.jetbrains.annotations.NotNull; + +public class TrackUtil { + + public static long getChunkKey(@NotNull Chunk chunk) { + return getChunkKey(chunk.getX(), chunk.getZ()); + } + + public static long getChunkKey(final int chunkX, final int chunkZ) { + return (long) chunkX & 0xFFFFFFFFL | ((long) chunkZ & 0xFFFFFFFFL) << 32; + } + + public static long getChunkKeyOfBlock(@NotNull Block block) { + return getChunkKey(block.getX() >> 4, block.getZ() >> 4); + } + + public static int getRelativeChunkPosition(@NotNull Block block) { + final int relX = (block.getX() % 16 + 16) % 16; + final int relZ = (block.getZ() % 16 + 16) % 16; + final int relY = block.getY(); + return (relY & 0xFFFF) | ((relX & 0xFF) << 16) | ((relZ & 0xFF) << 24); + } + +} \ No newline at end of file diff --git a/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedChunk.java b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedChunk.java new file mode 100644 index 0000000..bdb497c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedChunk.java @@ -0,0 +1,44 @@ +package su.nightexpress.nightcore.util.blocktracker; + +import it.unimi.dsi.fastutil.ints.IntOpenHashSet; +import it.unimi.dsi.fastutil.ints.IntSet; +import org.bukkit.block.Block; +import org.bukkit.persistence.PersistentDataContainer; +import org.bukkit.persistence.PersistentDataType; +import org.jetbrains.annotations.NotNull; + +public class TrackedChunk { + + private final IntSet trackedBlockPositions; + + protected TrackedChunk(@NotNull PersistentDataContainer container) { + final int[] data = container.get(PlayerBlockTracker.TRACKED_DATA_KEY, PersistentDataType.INTEGER_ARRAY); + if (data == null) { + this.trackedBlockPositions = new IntOpenHashSet(); + } + else { + this.trackedBlockPositions = new IntOpenHashSet(data); + } + } + + protected void add(@NotNull Block block) { + this.trackedBlockPositions.add(TrackUtil.getRelativeChunkPosition(block)); + } + + protected void remove(@NotNull Block block) { + this.trackedBlockPositions.remove(TrackUtil.getRelativeChunkPosition(block)); + } + + protected boolean isTracked(@NotNull Block block) { + return this.trackedBlockPositions.contains(TrackUtil.getRelativeChunkPosition(block)); + } + + protected void saveTo(@NotNull PersistentDataContainer container) { + final int[] data = this.trackedBlockPositions.toIntArray(); + container.set(PlayerBlockTracker.TRACKED_DATA_KEY, PersistentDataType.INTEGER_ARRAY, data); + } + + protected boolean isEmpty() { + return this.trackedBlockPositions.isEmpty(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedWorld.java b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedWorld.java new file mode 100644 index 0000000..3123171 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/blocktracker/TrackedWorld.java @@ -0,0 +1,62 @@ +package su.nightexpress.nightcore.util.blocktracker; + +import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +import org.bukkit.Chunk; +import org.bukkit.block.Block; +import org.bukkit.persistence.PersistentDataContainer; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class TrackedWorld { + + private final Long2ObjectMap chunkMap; + + protected TrackedWorld() { + this.chunkMap = new Long2ObjectOpenHashMap<>(); + } + + protected boolean isTracked(@NotNull Block block) { + TrackedChunk trackedChunk = this.getChunkOf(block); + return trackedChunk != null && trackedChunk.isTracked(block); + } + + protected void add(@NotNull Block block) { + TrackedChunk trackedChunk = this.getChunkOf(block); + if (trackedChunk == null) return; + + trackedChunk.add(block); + } + + protected void remove(@NotNull Block block) { + TrackedChunk trackedChunk = this.getChunkOf(block); + if (trackedChunk == null) return; + + trackedChunk.remove(block); + } + + protected void initChunk(@NotNull Chunk chunk) { + PersistentDataContainer container = chunk.getPersistentDataContainer(); + TrackedChunk trackedChunk = new TrackedChunk(container); + this.chunkMap.put(TrackUtil.getChunkKey(chunk), trackedChunk); + } + + protected void terminateChunk(@NotNull Chunk chunk) { + TrackedChunk trackedChunk = this.chunkMap.remove(TrackUtil.getChunkKey(chunk)); + if (trackedChunk == null) { + return; + } + PersistentDataContainer container = chunk.getPersistentDataContainer(); + if (trackedChunk.isEmpty()) { + container.remove(PlayerBlockTracker.TRACKED_DATA_KEY); + } + else { + trackedChunk.saveTo(container); + } + } + + @Nullable + private TrackedChunk getChunkOf(@NotNull Block block) { + return this.chunkMap.get(TrackUtil.getChunkKeyOfBlock(block)); + } +} \ No newline at end of file diff --git a/src/main/java/su/nightexpress/nightcore/util/message/NexComponent.java b/src/main/java/su/nightexpress/nightcore/util/message/NexComponent.java new file mode 100644 index 0000000..b9cf433 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/message/NexComponent.java @@ -0,0 +1,158 @@ +package su.nightexpress.nightcore.util.message; + +import net.md_5.bungee.api.chat.*; +import net.md_5.bungee.api.chat.hover.content.Item; +import net.md_5.bungee.api.chat.hover.content.Text; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.ItemUtil; + +import java.util.List; + +@Deprecated +public class NexComponent { + + private final String text; + + public HoverEvent hoverEvent; + public ClickEvent clickEvent; + + private String font; + private String insertion; + + public NexComponent(@NotNull String text) { + this.text = Colorizer.apply(text); + } + + @NotNull + public String getText() { + return this.text; + } + + @Nullable + public String getFont() { + return font; + } + + public void setFont(@Nullable String font) { + this.font = font; + } + + @Nullable + public String getInsertion() { + return insertion; + } + + public void setInsertion(@Nullable String insertion) { + this.insertion = insertion; + } + + @Nullable + public HoverEvent getHoverEvent() { + return this.hoverEvent; + } + + @Nullable + public ClickEvent getClickEvent() { + return this.clickEvent; + } + + @NotNull + public NexComponent addClickEvent(@NotNull ClickEvent.Action action, @NotNull String value) { + return switch (action) { + case OPEN_URL -> this.openURL(value); + case OPEN_FILE, CHANGE_PAGE -> this; + case RUN_COMMAND -> this.runCommand(value); + case SUGGEST_COMMAND -> this.suggestCommand(value); + case COPY_TO_CLIPBOARD -> this.copyToClipboard(value); + }; + } + + @NotNull + public NexComponent addHoverEvent(@NotNull HoverEvent.Action action, @NotNull String value) { + return switch (action) { + case SHOW_ITEM -> { + ItemStack item = ItemUtil.decompress(value); + yield this.showItem(item == null ? new ItemStack(Material.AIR) : item); + } + case SHOW_TEXT -> this.showText(value); + default -> this; + }; + } + + @NotNull + public NexComponent showText(@NotNull String text) { + return this.showText(text.split(NexParser.TAG_NEWLINE)); + } + + @NotNull + public NexComponent showText(@NotNull List text) { + return this.showText(text.toArray(new String[0])); + } + + @NotNull + public NexComponent showText(@NotNull String... text) { + BaseComponent[] base = NexMessage.fromLegacyText(Colorizer.apply(String.join("\n", text))); + this.hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(base)); + return this; + } + + @NotNull + public NexComponent showItem(@NotNull ItemStack is) { + ItemMeta meta = is.getItemMeta(); + Item item = new Item(is.getType().getKey().getKey(), is.getAmount(), ItemTag.ofNbt(meta == null ? null : meta.getAsString())); + this.hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ITEM, item); + return this; + } + + @NotNull + public NexComponent runCommand(@NotNull String command) { + this.clickEvent = new ClickEvent(ClickEvent.Action.RUN_COMMAND, command); + return this; + } + + @NotNull + public NexComponent suggestCommand(@NotNull String command) { + this.clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); + return this; + } + + @NotNull + public NexComponent openURL(@NotNull String url) { + this.clickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, url); + return this; + } + + @NotNull + public NexComponent copyToClipboard(@NotNull String text) { + this.clickEvent = new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, text); + return this; + } + + @NotNull + public TextComponent build() { + TextComponent component = new TextComponent(NexMessage.fromLegacyText(this.getText())); + if (this.hoverEvent != null) { + component.setHoverEvent(this.getHoverEvent()); + } + if (this.clickEvent != null) { + component.setClickEvent(this.getClickEvent()); + } + component.setFont(this.getFont()); + component.setInsertion(this.getInsertion()); + return component; + } + + @Override + public String toString() { + return "NexComponent{" + + "text='" + text + '\'' + + ", hoverEvent=" + hoverEvent + + ", clickEvent=" + clickEvent + + '}'; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/message/NexMessage.java b/src/main/java/su/nightexpress/nightcore/util/message/NexMessage.java new file mode 100644 index 0000000..d3b74d1 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/message/NexMessage.java @@ -0,0 +1,230 @@ +package su.nightexpress.nightcore.util.message; + +import com.google.common.base.Preconditions; +import net.md_5.bungee.api.ChatColor; +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.ComponentBuilder; +import net.md_5.bungee.api.chat.TextComponent; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.Reflex; + +import java.lang.reflect.Method; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +@Deprecated +public class NexMessage { + + //private static final Pattern URL = Pattern.compile("(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$"); + + private String message; + private final Map components; + + public NexMessage(@NotNull String message) { + this.message = Colorizer.apply(message); + this.components = new HashMap<>(); + + // Originally was in 'fromLegacyText' method of the TextComponent class. + /*Matcher matcher = RegexUtil.getMatcher(URL, Colorizer.strip(this.message)); + while (RegexUtil.matcherFind(matcher)) { + String url = matcher.group(0); + String link = url.startsWith("http") ? url : "http://" + url; + + this.addComponent(url, url).openURL(link); + }*/ + } + + @NotNull + public NexComponent addComponent(@NotNull String placeholder, @NotNull String text) { + NexComponent component = new NexComponent(text); + String tag = "{@" + this.components.size() + "}"; + + this.components.put(tag, component); + this.message = this.message.replaceFirst(Pattern.quote(placeholder) + "(?!\\w)", tag); + return component; + } + + @NotNull + public BaseComponent[] build() { + return this.build(this.message); + } + + @NotNull + private BaseComponent[] build(@NotNull String line) { + ComponentBuilder builder = new ComponentBuilder(); + + StringBuilder text = new StringBuilder(); + for (int index = 0; index < line.length(); index++) { + char letter = line.charAt(index); + if (letter == '{') { + int indexEnd = line.indexOf("}", index); + if (indexEnd > index && ++indexEnd <= line.length()) { + String varRaw = line.substring(index, indexEnd); + if (varRaw.charAt(1) == '@') { + if (!text.isEmpty()) { + append(builder, fromLegacyText(text.toString()), ComponentBuilder.FormatRetention.ALL); + text = new StringBuilder(); + } + + index += varRaw.length() - 1; + + NexComponent component = this.components.get(varRaw); + if (component == null) continue; + + append(builder, component.build(), ComponentBuilder.FormatRetention.ALL); + continue; + } + } + } + text.append(letter); + } + if (!text.isEmpty()) { + append(builder, fromLegacyText(text.toString()), ComponentBuilder.FormatRetention.ALL); + } + TO_RETAIN.clear(); + return builder.create(); + } + + public void send(@NotNull CommandSender sender) { + if (sender instanceof Player player) { + for (String line : this.message.split("\n")) { + player.spigot().sendMessage(this.build(line)); + } + } + } + + public void send(@NotNull CommandSender... senders) { + Stream.of(senders).forEach(this::send); + } + + public void send(@NotNull Collection senders) { + senders.forEach(this::send); + } + + // Фикс форматирования компонентов на основе https://github.com/SpigotMC/BungeeCord/pull/3344/ + // Так как этот фикс не встроен в API спигота, и все равно работает не так, как нужно, будем использовать свой. + + private static final Set TO_RETAIN = ConcurrentHashMap.newKeySet(); + private static final Method GET_DUMMY = Reflex.getMethod(ComponentBuilder.class, "getDummy"); + + @NotNull + public static ComponentBuilder append(@NotNull ComponentBuilder orig, + @NotNull BaseComponent[] components, + @NotNull ComponentBuilder.FormatRetention retention) { + Preconditions.checkArgument(components.length != 0, "No components to append"); + for (BaseComponent component : components) { + append(orig, component, retention); + } + return orig; + } + + @NotNull + public static ComponentBuilder append(@NotNull ComponentBuilder orig, + @NotNull BaseComponent component, + @NotNull ComponentBuilder.FormatRetention retention) { + List parts = orig.getParts(); + BaseComponent previous = parts.isEmpty() ? null : parts.get(parts.size() - 1); + if (previous == null) { + previous = GET_DUMMY == null ? null : (BaseComponent) Reflex.invokeMethod(GET_DUMMY, orig); + Reflex.setFieldValue(orig, "dummy", null); + } + + BaseComponent inheritance = TO_RETAIN.stream().filter(has -> has.equals(component)).findFirst().orElse(null); + if (previous != null && inheritance != null) { + component.copyFormatting(previous, retention, false); + TO_RETAIN.remove(inheritance); + } + + parts.add(component); + orig.resetCursor(); + return orig; + } + + public static BaseComponent[] fromLegacyText(@NotNull String message) { + return fromLegacyText(message, ChatColor.WHITE); + } + + public static BaseComponent[] fromLegacyText(@NotNull String message, @NotNull ChatColor defaultColor) { + ArrayList components = new ArrayList<>(); + StringBuilder builder = new StringBuilder(); + TextComponent component = new TextComponent(); + + for (int index = 0; index < message.length(); index++) { + char letter = message.charAt(index); + if (letter == ChatColor.COLOR_CHAR) { + if (++index >= message.length()) break; + + letter = message.charAt(index); + if (letter >= 'A' && letter <= 'Z') { + letter += 32; + } + + ChatColor format; + if (letter == 'x' && index + 12 < message.length()) { + StringBuilder hex = new StringBuilder("#"); + for (int indexHex = 0; indexHex < 6; indexHex++) { + hex.append(message.charAt(index + 2 + (indexHex * 2))); + } + try { + format = ChatColor.of(hex.toString()); + } + catch (IllegalArgumentException ex) { + format = null; + } + + index += 12; + } + else { + format = ChatColor.getByChar( letter ); + } + if (format == null) continue; + + if (builder.length() > 0) { + TextComponent old = component; + component = new TextComponent(old); + old.setText(builder.toString()); + builder = new StringBuilder(); + components.add(old); + } + + if (format == ChatColor.BOLD) { + component.setBold( true ); + } + else if (format == ChatColor.ITALIC) { + component.setItalic(true); + } + else if (format == ChatColor.UNDERLINE) { + component.setUnderlined(true); + } + else if (format == ChatColor.STRIKETHROUGH) { + component.setStrikethrough(true); + } + else if (format == ChatColor.MAGIC) { + component.setObfuscated(true); + } + else { + if (format == ChatColor.RESET) { + format = defaultColor; + } + component = new TextComponent(); + component.setColor(format); + } + continue; + } + builder.append(letter); + } + + if (!component.hasFormatting()) { + TO_RETAIN.add(component); + } + + component.setText(builder.toString()); + components.add(component); + return components.toArray(new BaseComponent[0]); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/message/NexParser.java b/src/main/java/su/nightexpress/nightcore/util/message/NexParser.java new file mode 100644 index 0000000..49ba9a2 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/message/NexParser.java @@ -0,0 +1,136 @@ +package su.nightexpress.nightcore.util.message; + +import net.md_5.bungee.api.chat.ClickEvent; +import net.md_5.bungee.api.chat.HoverEvent; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Colorizer; +import su.nightexpress.nightcore.util.regex.TimedMatcher; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +@Deprecated +public class NexParser { + + private static final String OPTION_PATTERN = ":(?:'|\")(.*?)(?:'|\")(?=>|\\s|$)"; + + private static final Pattern PATTERN_OPTIONS = Pattern.compile("<\\?(.*?)\\?>(.*?)(?:<\\/>)+"); + private static final Map PATTERN_CLICKS = new HashMap<>(); + private static final Map PATTERN_HOVERS = new HashMap<>(); + private static final Pattern PATTERN_FONT = Pattern.compile("font" + OPTION_PATTERN); + private static final Pattern PATTERN_INSERTION = Pattern.compile("insertion" + OPTION_PATTERN); + + public static final String TAG_NEWLINE = ""; + + static { + for (ClickEvent.Action action : ClickEvent.Action.values()) { + PATTERN_CLICKS.put(action, Pattern.compile(action.name().toLowerCase() + OPTION_PATTERN)); + } + for (HoverEvent.Action action : HoverEvent.Action.values()) { + PATTERN_HOVERS.put(action, Pattern.compile(action.name().toLowerCase() + OPTION_PATTERN)); + } + } + + public static boolean contains(@NotNull String message) { + TimedMatcher matcher = TimedMatcher.create(PATTERN_OPTIONS, message); + return matcher.find(); + } + + @NotNull + public static String removeFrom(@NotNull String message) { + return strip(message, false); + } + + @NotNull + public static String toPlainText(@NotNull String message) { + return strip(message, true); + } + + @NotNull + private static String strip(@NotNull String message, boolean toPlain) { + TimedMatcher timedMatcher = TimedMatcher.create(PATTERN_OPTIONS, message); + while (timedMatcher.find()) { + Matcher matcher = timedMatcher.getMatcher(); + String matchFull = matcher.group(0); + if (toPlain) { + String matchOptions = matcher.group(1).trim(); + String matchText = matcher.group(2); + message = message.replace(matchFull, matchText); + } + else message = message.replace(matchFull, ""); + } + return message; + } + + public static String[] getPlainParts(@NotNull String message) { + //message = StringUtil.color(message.replace("\n", " ")); + return PATTERN_OPTIONS.split(message); + } + + public static String[] getComponentParts(@NotNull String message) { + List components = new ArrayList<>(); + + TimedMatcher timedMatcher = TimedMatcher.create(PATTERN_OPTIONS, message); + while (timedMatcher.find()) { + components.add(timedMatcher.getMatcher().group(0)); + } + + return components.toArray(new String[0]); + } + + @NotNull + public static NexMessage toMessage(@NotNull String message) { + message = Colorizer.apply(message); + + TimedMatcher timedMatcher = TimedMatcher.create(PATTERN_OPTIONS, message); + Map parameters = new HashMap<>(); + while (timedMatcher.find()) { + Matcher matcher = timedMatcher.getMatcher(); + String matchFull = matcher.group(0); + String matchOptions = matcher.group(1).trim(); + String matchText = matcher.group(2); + + message = message.replace(matchFull, matchText); + parameters.put(matchText, matchOptions); + } + + NexMessage nexMessage = new NexMessage(message); + for (Map.Entry entry : parameters.entrySet()) { + String text = entry.getKey(); + String options = entry.getValue(); + + NexComponent component = nexMessage.addComponent(text, text); + for (Map.Entry entryParams : PATTERN_CLICKS.entrySet()) { + String paramValue = getOption(entryParams.getValue(), options); + if (paramValue == null) continue; + + component.addClickEvent(entryParams.getKey(), paramValue); + break; + } + for (Map.Entry entryParams : PATTERN_HOVERS.entrySet()) { + String paramValue = getOption(entryParams.getValue(), options); + if (paramValue == null) continue; + + component.addHoverEvent(entryParams.getKey(), paramValue); + break; + } + component.setFont(getOption(PATTERN_FONT, options)); + component.setInsertion(getOption(PATTERN_INSERTION, options)); + } + + return nexMessage; + } + + @Nullable + private static String getOption(@NotNull Pattern pattern, @NotNull String from) { + TimedMatcher timedMatcher = TimedMatcher.create(pattern, from); + if (!timedMatcher.find()) return null; + + return timedMatcher.getMatcher().group(1).stripLeading(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/placeholder/Placeholder.java b/src/main/java/su/nightexpress/nightcore/util/placeholder/Placeholder.java new file mode 100644 index 0000000..416074b --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/placeholder/Placeholder.java @@ -0,0 +1,15 @@ +package su.nightexpress.nightcore.util.placeholder; + +import org.jetbrains.annotations.NotNull; + +import java.util.function.UnaryOperator; + +public interface Placeholder { + + @NotNull PlaceholderMap getPlaceholders(); + + @NotNull + default UnaryOperator replacePlaceholders() { + return this.getPlaceholders().replacer(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/placeholder/PlaceholderMap.java b/src/main/java/su/nightexpress/nightcore/util/placeholder/PlaceholderMap.java new file mode 100644 index 0000000..2b38b97 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/placeholder/PlaceholderMap.java @@ -0,0 +1,77 @@ +package su.nightexpress.nightcore.util.placeholder; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Pair; +import su.nightexpress.nightcore.util.StringUtil; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Supplier; +import java.util.function.UnaryOperator; + +public class PlaceholderMap { + + private final List>> keys; + + public PlaceholderMap() { + this(new ArrayList<>()); + } + + public PlaceholderMap(@NotNull PlaceholderMap other) { + this(other.getKeys()); + } + + public PlaceholderMap(@NotNull List>> keys) { + this.keys = new ArrayList<>(keys); + } + + @NotNull + public static PlaceholderMap fusion(@NotNull PlaceholderMap... others) { + PlaceholderMap map = new PlaceholderMap(); + for (PlaceholderMap other : others) { + map.add(other); + } + return map; + } + + @NotNull + public static PlaceholderMap fusion(@NotNull Placeholder... others) { + PlaceholderMap map = new PlaceholderMap(); + for (Placeholder other : others) { + map.add(other.getPlaceholders()); + } + return map; + } + + @NotNull + public List>> getKeys() { + return keys; + } + + @NotNull + public PlaceholderMap add(@NotNull PlaceholderMap other) { + this.getKeys().addAll(other.getKeys()); + return this; + } + + @NotNull + public PlaceholderMap add(@NotNull String key, @NotNull String replacer) { + this.add(key, () -> replacer); + return this; + } + + @NotNull + public PlaceholderMap add(@NotNull String key, @NotNull Supplier replacer) { + this.getKeys().add(Pair.of(key, replacer)); + return this; + } + + public void clear() { + this.getKeys().clear(); + } + + @NotNull + public UnaryOperator replacer() { + return str -> StringUtil.replaceEach(str, this.getKeys()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/random/MTRandom.java b/src/main/java/su/nightexpress/nightcore/util/random/MTRandom.java new file mode 100644 index 0000000..fc28dc6 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/random/MTRandom.java @@ -0,0 +1,111 @@ +package su.nightexpress.nightcore.util.random; + +import java.util.Random; + +public class MTRandom extends Random { + + private final static int UPPER_MASK = 0x80000000; + private final static int LOWER_MASK = 0x7fffffff; + + private final static int N = 624; + private final static int M = 397; + private final static int[] MAGIC = {0x0, 0x9908b0df}; + private final static int MAGIC_FACTOR1 = 1812433253; + private final static int MAGIC_FACTOR2 = 1664525; + private final static int MAGIC_FACTOR3 = 1566083941; + private final static int MAGIC_MASK1 = 0x9d2c5680; + private final static int MAGIC_MASK2 = 0xefc60000; + private final static int MAGIC_SEED = 19650218; + private final static long DEFAULT_SEED = 5489L; + + // Internal state + private transient int[] mt; + private transient int mti; + + // Temporary buffer used during setSeed(long) + private transient int[] ibuf; + + public MTRandom() { + + } + + private void setSeed() { + if (mt == null) mt = new int[N]; + + // ---- Begin Mersenne Twister Algorithm ---- + mt[0] = MTRandom.MAGIC_SEED; + for (mti = 1; mti < N; mti++) { + mt[mti] = (MAGIC_FACTOR1 * (mt[mti - 1] ^ (mt[mti - 1] >>> 30)) + mti); + } + // ---- End Mersenne Twister Algorithm ---- + } + + public final synchronized void setSeed(long seed) { + if (ibuf == null) ibuf = new int[2]; + + ibuf[0] = (int) seed; + ibuf[1] = (int) (seed >>> 32); + setSeed(ibuf); + } + + protected final synchronized int next(int bits) { + // ---- Begin Mersenne Twister Algorithm ---- + int y, kk; + if (mti >= N) { + + for (kk = 0; kk < N - M; kk++) { + y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK); + mt[kk] = mt[kk + M] ^ (y >>> 1) ^ MAGIC[y & 0x1]; + } + for (; kk < N - 1; kk++) { + y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK); + mt[kk] = mt[kk + (M - N)] ^ (y >>> 1) ^ MAGIC[y & 0x1]; + } + y = (mt[N - 1] & UPPER_MASK) | (mt[0] & LOWER_MASK); + mt[N - 1] = mt[M - 1] ^ (y >>> 1) ^ MAGIC[y & 0x1]; + + mti = 0; + } + + y = mt[mti++]; + + // Tempering + y ^= (y >>> 11); + y ^= (y << 7) & MAGIC_MASK1; + y ^= (y << 15) & MAGIC_MASK2; + y ^= (y >>> 18); + // ---- End Mersenne Twister Algorithm ---- + return (y >>> (32 - bits)); + } + + // This is a fairly obscure little code section to pack a + // byte[] into an int[] in little endian ordering. + + public final synchronized void setSeed(int[] buf) { + int length = buf.length; + if (length == 0) throw new IllegalArgumentException("Seed buffer may not be empty"); + // ---- Begin Mersenne Twister Algorithm ---- + int i = 1, j = 0, k = (Math.max(N, length)); + setSeed(); + for (; k > 0; k--) { + mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >>> 30)) * MAGIC_FACTOR2)) + buf[j] + j; + i++; + j++; + if (i >= N) { + mt[0] = mt[N - 1]; + i = 1; + } + if (j >= length) j = 0; + } + for (k = N - 1; k > 0; k--) { + mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >>> 30)) * MAGIC_FACTOR3)) - i; + i++; + if (i >= N) { + mt[0] = mt[N - 1]; + i = 1; + } + } + mt[0] = UPPER_MASK; // MSB is 1; assuring non-zero initial array + // ---- End Mersenne Twister Algorithm ---- + } +} \ No newline at end of file diff --git a/src/main/java/su/nightexpress/nightcore/util/random/Rnd.java b/src/main/java/su/nightexpress/nightcore/util/random/Rnd.java new file mode 100644 index 0000000..9b3c241 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/random/Rnd.java @@ -0,0 +1,101 @@ +package su.nightexpress.nightcore.util.random; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Pair; + +import java.util.*; + +public class Rnd { + + public static final MTRandom RANDOM = new MTRandom(); + + public static float getChance() { + return nextFloat() * 100f; + } + + public static int get(int n) { + return nextInt(n); + } + + public static int get(int min, int max) { + return min + (int) Math.floor(RANDOM.nextDouble() * (max - min + 1)); + } + + public static double getDouble(double max) { + return getDouble(0, max); + } + + public static double getDouble(double min, double max) { + return min + (max - min) * RANDOM.nextDouble(); + } + + @NotNull + public static E get(@NotNull E[] list) { + return list[get(list.length)]; + } + + public static int get(int[] list) { + return list[get(list.length)]; + } + + @NotNull + public static E get(@NotNull List list) { + if (list.isEmpty()) throw new NoSuchElementException("Empty list provided!"); + + return list.get(get(list.size())); + } + + @NotNull + public static E get(@NotNull Set list) { + return get(new ArrayList<>(list)); + } + + @NotNull + public static T getByWeight(@NotNull Map itemsMap) { + List> items = itemsMap.entrySet().stream() + .filter(entry -> entry.getValue() > 0D) + .map(entry -> Pair.of(entry.getKey(), entry.getValue())) + .sorted(Comparator.comparing(Pair::getSecond)) + .toList(); + double totalWeight = items.stream().mapToDouble(Pair::getSecond).sum(); + + int index = 0; + for (double roll = nextDouble() * totalWeight; index < items.size() - 1; ++index) { + roll -= items.get(index).getSecond(); + if (roll <= 0D) break; + } + return items.get(index).getFirst(); + } + + public static boolean chance(int chance) { + return chance >= 1 && (chance > 99 || nextInt(99) + 1 <= chance); + } + + public static boolean chance(double chance) { + return nextDouble() <= chance / 100.0; + } + + public static int nextInt(int n) { + return (int) Math.floor(RANDOM.nextDouble() * n); + } + + public static int nextInt() { + return RANDOM.nextInt(); + } + + public static double nextDouble() { + return RANDOM.nextDouble(); + } + + public static float nextFloat() { + return RANDOM.nextFloat(); + } + + public static double nextGaussian() { + return RANDOM.nextGaussian(); + } + + public static boolean nextBoolean() { + return RANDOM.nextBoolean(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/regex/MatcherTimeoutException.java b/src/main/java/su/nightexpress/nightcore/util/regex/MatcherTimeoutException.java new file mode 100644 index 0000000..193fc4f --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/regex/MatcherTimeoutException.java @@ -0,0 +1,23 @@ +package su.nightexpress.nightcore.util.regex; + +import org.jetbrains.annotations.NotNull; + +public class MatcherTimeoutException extends RuntimeException { + + private final String chars; + private final long timeout; + + MatcherTimeoutException(@NotNull CharSequence chars, long timeout) { + this.chars = chars.toString(); + this.timeout = timeout; + } + + @NotNull + public String getString() { + return this.chars; + } + + public long getTimeout() { + return this.timeout; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/regex/TimedMatcher.java b/src/main/java/su/nightexpress/nightcore/util/regex/TimedMatcher.java new file mode 100644 index 0000000..79d92ff --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/regex/TimedMatcher.java @@ -0,0 +1,95 @@ +package su.nightexpress.nightcore.util.regex; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Plugins; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TimedMatcher { + + private final Matcher matcher; + private boolean debug; + + public TimedMatcher(@NotNull Matcher matcher) { + this.matcher = matcher; + } + + @NotNull + public static TimedMatcher create(@NotNull String pattern, @NotNull String str) { + return create(pattern, str, 200); + } + + @NotNull + public static TimedMatcher create(@NotNull Pattern pattern, @NotNull String str) { + return new TimedMatcher(getMatcher(pattern, str, 200)); + } + + @NotNull + public static TimedMatcher create(@NotNull String rawPattern, @NotNull String str, long timeout) { + return create(Pattern.compile(rawPattern), str, timeout); + } + + @NotNull + public static TimedMatcher create(@NotNull Pattern pattern, @NotNull String str, long timeout) { + return new TimedMatcher(getMatcher(pattern, str, timeout)); + } + + @NotNull + private static Matcher getMatcher(@NotNull Pattern pattern, @NotNull String text, long timeout) { + if (timeout <= 0) { + return pattern.matcher(text); + } + return pattern.matcher(new TimeoutCharSequence(text, timeout)); + } + + @NotNull + public Matcher getMatcher() { + return matcher; + } + + public boolean isDebug() { + return debug; + } + + public void setDebug(boolean debug) { + this.debug = debug; + } + + @NotNull + public String replaceAll(@NotNull String with) { + try { + return this.matcher.replaceAll(with); + } + catch (MatcherTimeoutException exception) { + if (this.isDebug()) { + Plugins.CORE.warn("Matcher " + exception.getTimeout() + "ms timeout error for replaceAll: '" + matcher.pattern().pattern() + "'."); + } + return ""; + } + } + + public boolean matches() { + try { + return this.matcher.matches(); + } + catch (MatcherTimeoutException exception) { + if (this.isDebug()) { + Plugins.CORE.warn("Matcher " + exception.getTimeout() + "ms timeout error for: '" + matcher.pattern().pattern() + "'."); + } + return false; + } + } + + public boolean find() { + try { + return this.matcher.find(); + } + catch (MatcherTimeoutException exception) { + if (this.isDebug()) { + Plugins.CORE.warn("Matcher " + exception.getTimeout() + "ms timeout error for: '" + matcher.pattern().pattern() + "'."); + } + return false; + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/regex/TimeoutCharSequence.java b/src/main/java/su/nightexpress/nightcore/util/regex/TimeoutCharSequence.java new file mode 100644 index 0000000..290e876 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/regex/TimeoutCharSequence.java @@ -0,0 +1,39 @@ +package su.nightexpress.nightcore.util.regex; + +import org.jetbrains.annotations.NotNull; + +public class TimeoutCharSequence implements CharSequence { + + private final CharSequence chars; + private final long timeout; + private final long maxTime; + + public TimeoutCharSequence(@NotNull CharSequence chars, long timeout) { + this.chars = chars; + this.timeout = timeout; + this.maxTime = (System.currentTimeMillis() + timeout); + } + + @Override + public char charAt(int index) { + if (System.currentTimeMillis() > this.maxTime) { + throw new MatcherTimeoutException(this.chars, this.timeout); + } + return this.chars.charAt(index); + } + + @Override + public int length() { + return this.chars.length(); + } + + @Override + public CharSequence subSequence(int start, int end) { + return new TimeoutCharSequence(this.chars.subSequence(start, end), this.timeout); + } + + @Override + public String toString() { + return this.chars.toString(); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/NightMessage.java b/src/main/java/su/nightexpress/nightcore/util/text/NightMessage.java new file mode 100644 index 0000000..92937d7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/NightMessage.java @@ -0,0 +1,350 @@ +package su.nightexpress.nightcore.util.text; + +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.ComponentBuilder; +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.Pair; +import su.nightexpress.nightcore.util.Placeholders; +import su.nightexpress.nightcore.util.text.decoration.*; +import su.nightexpress.nightcore.util.text.tag.*; +import su.nightexpress.nightcore.util.text.tag.api.DynamicTag; +import su.nightexpress.nightcore.util.text.tag.api.Tag; +import su.nightexpress.nightcore.util.text.tag.impl.*; + +import java.awt.*; +import java.util.List; +import java.util.*; + +public class NightMessage { + + private static final Map TAG_MAP = new HashMap<>(); + + static { + registerTags( + Tags.WHITE, Tags.GRAY, Tags.GREEN, + Tags.YELLOW, Tags.ORANGE, Tags.RED, + Tags.BLUE, Tags.CYAN, Tags.PURPLE, Tags.PINK, + + Tags.DARK_GRAY, Tags.LIGHT_GRAY, Tags.LIGHT_GREEN, + Tags.LIGHT_YELLOW, Tags.LIGHT_ORANGE, Tags.LIGHT_RED, + Tags.LIGHT_BLUE, Tags.LIGHT_CYAN, Tags.LIGHT_PURPLE, Tags.LIGHT_PINK + ); + + registerTags(Tags.BOLD, Tags.ITALIC, Tags.OBFUSCATED, Tags.STRIKETHROUGH, Tags.UNDERLINED); + + registerTags( + Tags.FONT, Tags.HEX_COLOR, Tags.GRADIENT, + Tags.HOVER, Tags.CLICK, + Tags.LINE_BREAK, Tags.RESET + ); + } + + @NotNull + public static Collection getTags() { + return TAG_MAP.values(); + } + + public static void registerTags(@NotNull Tag... tags) { + for (Tag tag : tags) { + registerTag(tag); + } + } + + public static void registerTag(@NotNull Tag tag, @NotNull String... aliases) { + TAG_MAP.put(tag.getName(), tag); + for (String alias : aliases) { + TAG_MAP.put(alias, tag); + } + } + + @Nullable + public static Tag getTag(@NotNull String name) { + return TAG_MAP.get(name.toLowerCase()); + } + + @NotNull + public static String asLegacy(@NotNull String string) { + return create(string).toLegacy(); + } + + @NotNull + public static List asLegacy(@NotNull List string) { + List list = new ArrayList<>(); + for (String str : string) { + for (String br : str.split(Placeholders.TAG_LINE_BREAK)) { + list.add(asLegacy(br)); + } + } + return list; + } + + /** + * + * @param string Text to deserialize. + * @return Precompiled WrappedMessage object. + */ + @NotNull + public static WrappedMessage create(@NotNull String string) { + return create(string, TagPool.ALL); + } + + @NotNull + public static WrappedMessage from(@NotNull String string) { + return from(string, TagPool.ALL); + } + + @NotNull + public static WrappedMessage create(@NotNull String string, @NotNull TagPool tagPool) { + return from(string, tagPool).compile(); + } + + @NotNull + public static WrappedMessage from(@NotNull String string, @NotNull TagPool tagPool) { + return new WrappedMessage(string, tagPool); + } + + + + public static BaseComponent[] parse(@NotNull String string) { + return parse(string, TagPool.ALL); + } + + public static BaseComponent[] parse(@NotNull String string, @NotNull TagPool tagPool) { + List parts = new ArrayList<>(); + + WrappedText currentText = new WrappedText(); + parts.add(currentText); + + Tag lastTag = null; + + int length = string.length(); + for (int index = 0; index < length; index++) { + char letter = string.charAt(index); + + Tag: + if (letter == Tag.OPEN_BRACKET && index != (length - 1)) { + int indexEnd = string.indexOf(Tag.CLOSE_BRACKET, index); + if (indexEnd == -1) break Tag; + + char next = string.charAt(index + 1); + if (next == Tag.CLOSE_BRACKET) break Tag; + + boolean closeTag = false; + if (next == Tag.CLOSE_MARK) { + closeTag = true; + index++; + } + + String leading = string.substring(index + 1); + String brackets = string.substring(index + 1, indexEnd); + + Tag tag = getTag(brackets); + Decorator decorator = null; + //System.out.println("brackets = " + brackets); + + if (tag == null) { + for (Tag registered : getTags()) { + String tagName = registered.getName(); + if (leading.startsWith(tagName)) { + char latest = leading.charAt(tagName.length()); + + if (latest == Tag.CLOSE_BRACKET || registered instanceof DecoratorParser) { + tag = registered; + break; + } + } + } + } + //System.out.println("found tag = " + tag); + + //if (tag == null) break Tag; + /*if (tag != null && !tagPool.isGoodTag(tag)) { + break Tag; + }*/ + + if (!closeTag) { + // If tag is variable like hex codes or hover/click events. + if (tag instanceof DecoratorParser parser) { + // If tag has no dynamic content, strip it to the next close bracket. + if (!(tag instanceof DynamicTag)) { + leading = brackets; + } + //System.out.println("tag = " + tag.getName()); + //System.out.println("content = " + leading); + ParsedDecorator parsedDecorator = parser.parse(leading); + if (parsedDecorator != null) { + decorator = parsedDecorator.getDecorator(); + indexEnd = index + parsedDecorator.getLength() + 1; // 1 for close bracket + } + } + else if (tag instanceof Decorator textDecorator) { + decorator = textDecorator; + } + } + + if (tag != null) { + if (tagPool.isGoodTag(tag)) { + if (tag == Tags.LINE_BREAK) { + if (currentText.getTextBuilder().isEmpty()) { + currentText.getTextBuilder().append("\n"); + } + else { + currentText = currentText.nested(); + currentText.setText("\n"); + parts.add(currentText); + } + currentText = currentText.nested(); + parts.add(currentText); + } + + // Если был текст ДО текущего тега и не было ДРУГИХ тегов прямо перед ним, + // то вставляем новую часть текста + if (lastTag == null && !currentText.getTextBuilder().isEmpty()) { + currentText = currentText.nested(); + parts.add(currentText); + } + + if (closeTag) { + currentText.removeLatestTag(tag); + } + else if (tag != Tags.LINE_BREAK) { + currentText.addTag(tag, decorator); + } + + lastTag = tag; + } + index = indexEnd; + continue; + } + + // Move cursor back to '/' of invalid closing tag. + if (closeTag) { + index--; + } + } + currentText.getTextBuilder().append(letter); + lastTag = null; + } + + //System.out.println("parsedTexts = " + parts); + + fixGradients(parts); + + ComponentBuilder builder = new ComponentBuilder(); + for (WrappedText wrappedText : parts) { + builder.append(wrappedText.toComponent(), ComponentBuilder.FormatRetention.NONE); + } + + return builder.create(); + } + + // Fix gradient smoothness when multiple WrappedTexts have the same gradient colors, but different tag lists. + private static void fixGradients(@NotNull List parts) { + if (parts.size() < 2) return; + + List>> pairs = new ArrayList<>(); + + Pair> currentList = null; + GradientDecorator lastGradient = null; + int lastIndex = -1; + + // Create a list of sequental parts with the same gradient. + for (int index = 0; index < parts.size(); index++) { + WrappedText text = parts.get(index); + GradientDecorator gradient = (GradientDecorator) text.getDecorator(GradientTag.NAME); + + // Check for next list + if (gradient != null) { + boolean bigStep = (index - lastIndex) > 1; + boolean sameGradient = lastGradient != null && gradient.isSimilar(lastGradient); + boolean lastElement = (index == parts.size() - 1); + if (bigStep || !sameGradient || lastElement) { + if (currentList != null && currentList.getSecond().size() > 1) { + pairs.add(currentList); + } + currentList = Pair.of(gradient, new ArrayList<>()); + } + currentList.getSecond().add(text); + } + else if (currentList != null) { + pairs.add(currentList); + currentList = null; + } + + lastGradient = gradient; + lastIndex = index; + } + //System.out.println("pairs = " + pairs); + + // Recreate Gradient Decorator with shifted colors depends on text length. + for (var pair : pairs) { + GradientDecorator gradient = pair.getFirst(); + List texts = pair.getSecond(); + + int length = texts.stream().mapToInt(text -> text.getText().length()).sum(); + + Color[] colors = gradient.createGradient(length); + int shift = 0; + + for (WrappedText text : texts) { + if (shift >= colors.length) break; + + int textLength = text.getText().length(); + + Color start = colors[shift]; + Color end = colors[textLength + shift - 1]; + + GradientDecorator decorator = new GradientDecorator(start, end); + text.getDecoratorMap().put(GradientTag.NAME, decorator); + + shift += textLength; + } + } + } + + @NotNull + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private final List texts; + + public Builder() { + this.texts = new ArrayList<>(); + } + + public BaseComponent[] create() { + ComponentBuilder builder = new ComponentBuilder(); + for (WrappedText wrappedText : this.texts) { + builder.append(wrappedText.toComponent(), ComponentBuilder.FormatRetention.NONE); + } + return builder.create(); + } + + public void send(@NotNull CommandSender sender) { + sender.spigot().sendMessage(this.create()); + } + + public Builder append(@NotNull WrappedText.Builder textBuilder) { + this.texts.add(textBuilder.getText()); + return this; + } + + public WrappedText.Builder append(@NotNull String text, @NotNull Tag... tags) { + WrappedText.Builder builder = WrappedText.builder(text); + this.texts.add(builder.getText()); + for (Tag tag : tags) { + builder.tag(tag); + } + return builder; + } + + public Builder appendLineBreak() { + return this.append(WrappedText.builder("\n")); + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/WrappedMessage.java b/src/main/java/su/nightexpress/nightcore/util/text/WrappedMessage.java new file mode 100644 index 0000000..7559ad6 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/WrappedMessage.java @@ -0,0 +1,127 @@ +package su.nightexpress.nightcore.util.text; + +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.TextComponent; +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.text.tag.TagPool; + +import java.util.function.UnaryOperator; + +public class WrappedMessage { + + private final TagPool tagPool; + + private String string; + private BaseComponent[] components; + + public WrappedMessage(@NotNull String string, @NotNull TagPool tagPool) { + this.tagPool = tagPool; + this.string = string; + } + + @NotNull + public WrappedMessage copy() { + WrappedMessage copy = new WrappedMessage(this.string, this.tagPool); + if (this.components != null) { + BaseComponent[] components = new BaseComponent[this.components.length]; + for (int index = 0; index < components.length; index++) { + components[index] = this.components[index].duplicate(); + } + copy.components = components; + } + return copy; + } + + @NotNull + public WrappedMessage compile() { + this.parseIfAbsent(); + return this; + } + + @NotNull + public WrappedMessage recompile() { + this.parse(); + return this; + } + + @NotNull + public String toLegacy() { + return TextComponent.toLegacyText(this.parseIfAbsent()); + } + + @NotNull + public WrappedMessage replace(@NotNull String what, @NotNull Object object) { + return this.replace(str -> str.replace(what, String.valueOf(object))); + //return this.replace(what, String.valueOf(object)); + } + + @NotNull + public WrappedMessage replace(@NotNull UnaryOperator operator) { + this.string = operator.apply(this.string); + this.components = null; + return this; + + + /*if (this.components == null) { + this.string = operator.apply(this.string); + return this; + } + + for (BaseComponent component : this.components) { + if (component instanceof TextComponent textComponent) { + textComponent.setText(operator.apply(textComponent.getText())); + } + } + return this;*/ + } + + /*@NotNull + public WrappedMessage replace(@NotNull String var, @NotNull String value) { + if (this.components == null) { + this.string = this.string.replace(var, value); + return this; + } + + WrappedMessage message = NightMessage.create(value); + + ComponentBuilder builder = new ComponentBuilder(); + for (BaseComponent component : this.components) { + if (component instanceof TextComponent textComponent) { + String text = textComponent.getText(); + String[] split = text.split(var); + + ComponentBuilder replacer = new ComponentBuilder(); + for (String part : split) { + if (!replacer.getParts().isEmpty()) { + replacer.append(message.parseIfAbsent()); + } + + TextComponent origin = new TextComponent(part); + origin.copyFormatting(textComponent); + replacer.append(origin); + } + builder.append(replacer.create()); + } + else builder.append(component); + } + + return this; + }*/ + + public void send(@NotNull CommandSender... senders) { + this.parseIfAbsent(); + for (CommandSender sender : senders) { + sender.spigot().sendMessage(this.components); + } + } + + public BaseComponent[] parseIfAbsent() { + return this.components == null ? this.parse() : this.components; + } + + public BaseComponent[] parse() { + this.components = NightMessage.parse(this.string, this.tagPool); + return this.components; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/WrappedText.java b/src/main/java/su/nightexpress/nightcore/util/text/WrappedText.java new file mode 100644 index 0000000..cb3aafe --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/WrappedText.java @@ -0,0 +1,197 @@ +package su.nightexpress.nightcore.util.text; + +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.ClickEvent; +import net.md_5.bungee.api.chat.TextComponent; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.text.decoration.*; +import su.nightexpress.nightcore.util.text.tag.api.Tag; +import su.nightexpress.nightcore.util.text.tag.Tags; +import su.nightexpress.nightcore.util.text.tag.impl.ColorTag; +import su.nightexpress.nightcore.util.text.tag.impl.FontStyleTag; + +import java.awt.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WrappedText { + + private final StringBuilder textBuilder; + private final List tags; + private final Map decoratorMap; + + public WrappedText() { + this.textBuilder = new StringBuilder(); + this.tags = new ArrayList<>(); + this.decoratorMap = new HashMap<>(); + } + + public WrappedText(@NotNull String text) { + this(); + this.setText(text); + } + + @NotNull + public WrappedText nested() { + WrappedText nested = new WrappedText(); + nested.getTags().addAll(this.getTags()); + nested.getDecoratorMap().putAll(this.getDecoratorMap()); + return nested; + } + + @Nullable + public Decorator getDecorator(@NotNull Tag tag) { + return this.getDecorator(tag.getName()); + } + + @Nullable + public Decorator getDecorator(@NotNull String tagName) { + return this.getDecoratorMap().get(tagName.toLowerCase()); + } + + @NotNull + public BaseComponent toComponent() { + TextComponent component = new TextComponent(this.getText()); + + for (Tag tag : this.getTags()) { + Decorator decorator = this.getDecorator(tag); + if (decorator == null) continue; + + decorator.decorate(component); + } + + return component; + } + + public void addTag(@NotNull Tag tag, @Nullable Decorator decorator) { + //this.getTags().removeIf(tag::conflictsWith); + this.getTags().removeIf(other -> other.getName().equals(tag.getName())); + this.getTags().add(tag); + if (decorator != null) { + this.decoratorMap.put(tag.getName(), decorator); + } + } + + public void removeLatestTag(@NotNull Tag tag) { + for (int indexTag = this.getTags().size() - 1; indexTag > -1; indexTag--) { + Tag has = this.getTags().get(indexTag); + if (has.getName().equalsIgnoreCase(tag.getName())) { + this.getTags().remove(indexTag); + this.getDecoratorMap().remove(tag.getName()); + break ; + } + } + } + + public void removeTag(@NotNull Tag tag) { + this.getTags().remove(tag); + this.getDecoratorMap().remove(tag.getName()); + } + + @NotNull + public List getTags() { + return tags; + } + + @NotNull + public Map getDecoratorMap() { + return decoratorMap; + } + + @NotNull + public StringBuilder getTextBuilder() { + return textBuilder; + } + + @NotNull + public String getText() { + return this.getTextBuilder().toString(); + } + + public void setText(@NotNull String text) { + this.textBuilder.setLength(0); + this.textBuilder.append(text); + } + + @Override + public String toString() { + return "ParsedText{" + + "tags=" + tags + + ", text=" + textBuilder + + '}'; + } + + @NotNull + public static Builder builder(@NotNull String text) { + return new Builder(new WrappedText(text)); + } + + public static class Builder { + + private final WrappedText text; + + public Builder(@NotNull WrappedText text) { + this.text = text; + } + + @NotNull + public WrappedText getText() { + return text; + } + + @NotNull + public Builder tag(@NotNull Tag tag) { + return this.tag(tag, tag instanceof Decorator decorator ? decorator : null); + } + + @NotNull + public Builder tag(@NotNull Tag tag, @Nullable Decorator decorator) { + this.getText().addTag(tag, decorator); + return this; + } + + public Builder color(@NotNull Color color) { + return this.color(new ColorTag(color)); + } + + public Builder color(@NotNull ColorTag tag) { + return this.tag(tag); + } + + public Builder bold() { + return style(Tags.BOLD); + } + + public Builder style(@NotNull FontStyleTag tag) { + return this.tag(tag); + } + + public Builder gradient(@NotNull Color from, @NotNull Color to) { + return this.tag(Tags.GRADIENT, new GradientDecorator(from, to)); + } + + public Builder showText(@NotNull String... text) { + return this.tag(Tags.HOVER, new ShowTextDecorator(text)); + } + + public Builder showItem(@NotNull ItemStack itemStack) { + return this.tag(Tags.HOVER, new ShowItemDecorator(itemStack)); + } + + public Builder runCommand(@NotNull String value) { + return this.clickEvent(ClickEvent.Action.RUN_COMMAND, value); + } + + public Builder suggestCommand(@NotNull String value) { + return this.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, value); + } + + public Builder clickEvent(@NotNull ClickEvent.Action action, @NotNull String value) { + return this.tag(Tags.CLICK, new ClickEventDecorator(action, value)); + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/ClickEventDecorator.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ClickEventDecorator.java new file mode 100644 index 0000000..f21d1ef --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ClickEventDecorator.java @@ -0,0 +1,26 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.ClickEvent; +import org.jetbrains.annotations.NotNull; + +public class ClickEventDecorator implements Decorator { + + private final ClickEvent.Action action; + private final String value; + + public ClickEventDecorator(@NotNull ClickEvent.Action action, @NotNull String value) { + this.action = action; + this.value = value; + } + + @NotNull + public ClickEvent createEvent() { + return new ClickEvent(this.action, this.value); + } + + @Override + public void decorate(@NotNull BaseComponent component) { + component.setClickEvent(this.createEvent()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/Decorator.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/Decorator.java new file mode 100644 index 0000000..d6912bf --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/Decorator.java @@ -0,0 +1,9 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import net.md_5.bungee.api.chat.BaseComponent; +import org.jetbrains.annotations.NotNull; + +public interface Decorator { + + void decorate(@NotNull BaseComponent component); +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/DecoratorParser.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/DecoratorParser.java new file mode 100644 index 0000000..7713fe2 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/DecoratorParser.java @@ -0,0 +1,9 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface DecoratorParser { + + @Nullable ParsedDecorator parse(@NotNull String str); +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/FontDecorator.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/FontDecorator.java new file mode 100644 index 0000000..2f8569a --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/FontDecorator.java @@ -0,0 +1,18 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import net.md_5.bungee.api.chat.BaseComponent; +import org.jetbrains.annotations.NotNull; + +public class FontDecorator implements Decorator { + + private final String font; + + public FontDecorator(@NotNull String font) { + this.font = font; + } + + @Override + public void decorate(@NotNull BaseComponent component) { + component.setFont(this.font); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/GradientDecorator.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/GradientDecorator.java new file mode 100644 index 0000000..3b49427 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/GradientDecorator.java @@ -0,0 +1,79 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import net.md_5.bungee.api.ChatColor; +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.TextComponent; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +public class GradientDecorator implements Decorator { + + private final Color color; + private final Color colorEnd; + + public GradientDecorator(@NotNull Color color, @NotNull Color colorEnd) { + this.color = color; + this.colorEnd = colorEnd; + } + + public boolean isSimilar(@NotNull GradientDecorator other) { + return this.getColor().equals(other.getColor()) && this.getColorEnd().equals(other.getColorEnd()); + } + + public Color getColor() { + return color; + } + + @NotNull + public Color getColorEnd() { + return colorEnd; + } + + public Color[] createGradient(int length) { + Color[] colors = new Color[length]; + for (int index = 0; index < length; index++) { + double percent = (double) index / (double) length; + + int red = (int) (color.getRed() + percent * (colorEnd.getRed() - color.getRed())); + int green = (int) (color.getGreen() + percent * (colorEnd.getGreen() - color.getGreen())); + int blue = (int) (color.getBlue() + percent * (colorEnd.getBlue() - color.getBlue())); + + java.awt.Color color = new java.awt.Color(red, green, blue); + colors[index] = color; + } + return colors; + } + + /*@NotNull + public List> gradient(@NotNull String string) { + List> list = new ArrayList<>(); + + Color[] colors = createGradient(string.length()); + char[] characters = string.toCharArray(); + + for (int index = 0; index < characters.length; index++) { + list.add(Pair.of(String.valueOf(characters[index]), colors[index])); + } + + return list; + }*/ + + @Override + public void decorate(@NotNull BaseComponent component) { + if (!(component instanceof TextComponent textComponent)) return; + + String text = textComponent.getText(); + + Color[] colors = createGradient(text.length()); + char[] characters = text.toCharArray(); + + for (int index = 0; index < characters.length; index++) { + TextComponent extra = new TextComponent(String.valueOf(characters[index])); + extra.copyFormatting(textComponent); + extra.setColor(ChatColor.of(colors[index])); + textComponent.addExtra(extra); + } + textComponent.setText(""); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/ParsedDecorator.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ParsedDecorator.java new file mode 100644 index 0000000..cf36a78 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ParsedDecorator.java @@ -0,0 +1,29 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.text.decoration.Decorator; + +public class ParsedDecorator { + + private final Decorator tag; + + private int length; + + public ParsedDecorator(@NotNull Decorator tag, int length) { + this.tag = tag; + this.length = length; + } + + @NotNull + public Decorator getDecorator() { + return tag; + } + + public void setLength(int length) { + this.length = length; + } + + public int getLength() { + return length; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowItemDecorator.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowItemDecorator.java new file mode 100644 index 0000000..ace5854 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowItemDecorator.java @@ -0,0 +1,38 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.HoverEvent; +import net.md_5.bungee.api.chat.ItemTag; +import net.md_5.bungee.api.chat.hover.content.Item; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.ItemUtil; + +public class ShowItemDecorator implements Decorator { + + private final ItemStack item; + + public ShowItemDecorator(@NotNull String string) { + this(ItemUtil.decompress(string)); + } + + public ShowItemDecorator(ItemStack item) { + this.item = item == null ? new ItemStack(Material.AIR) : new ItemStack(item); + } + + @NotNull + public HoverEvent createEvent() { + String key = item.getType().getKey().getKey(); + ItemMeta meta = item.getItemMeta(); + Item item = new Item(key, this.item.getAmount(), ItemTag.ofNbt(meta == null ? null : meta.getAsString())); + + return new HoverEvent(HoverEvent.Action.SHOW_ITEM, item); + } + + @Override + public void decorate(@NotNull BaseComponent component) { + component.setHoverEvent(this.createEvent()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowTextDecorator.java b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowTextDecorator.java new file mode 100644 index 0000000..3d186e7 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/decoration/ShowTextDecorator.java @@ -0,0 +1,37 @@ +package su.nightexpress.nightcore.util.text.decoration; + +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.HoverEvent; +import net.md_5.bungee.api.chat.hover.content.Text; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Lists; +import su.nightexpress.nightcore.util.text.NightMessage; +import su.nightexpress.nightcore.util.text.tag.Tags; + +import java.util.List; + +public class ShowTextDecorator implements Decorator { + + private final List text; + + public ShowTextDecorator(@NotNull String... strings) { + this(Lists.newList(strings)); + } + + public ShowTextDecorator(@NotNull List text) { + this.text = text; + } + + @NotNull + public HoverEvent createEvent() { + String fused = String.join(Tags.LINE_BREAK.getFullName(), this.text); + Text text = new Text(NightMessage.parse(fused)); + + return new HoverEvent(HoverEvent.Action.SHOW_TEXT, text); + } + + @Override + public void decorate(@NotNull BaseComponent component) { + component.setHoverEvent(this.createEvent()); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/StandardTags.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/StandardTags.java new file mode 100644 index 0000000..ea13422 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/StandardTags.java @@ -0,0 +1,27 @@ +package su.nightexpress.nightcore.util.text.tag; + +@Deprecated +public class StandardTags { + + /*public static final String WHITE = Tags.WHITE.getFullName(); + public static final String GRAY = Tags.GRAY.getFullName(); + public static final String GREEN = Tags.GREEN.getFullName(); + public static final String YELLOW = Tags.YELLOW.getFullName(); + public static final String ORANGE = Tags.ORANGE.getFullName(); + public static final String RED = Tags.RED.getFullName(); + public static final String BLUE = Tags.BLUE.getFullName(); + public static final String CYAN = Tags.CYAN.getFullName(); + public static final String PURPLE = Tags.PURPLE.getFullName(); + public static final String PINK = Tags.PINK.getFullName(); + + public static final String DARK_GRAY = Tags.DARK_GRAY.getFullName(); + public static final String LIGHT_GRAY = Tags.LIGHT_GRAY.getFullName(); + public static final String LIGHT_GREEN = Tags.LIGHT_GREEN.getFullName(); + public static final String LIGHT_YELLOW = Tags.LIGHT_YELLOW.getFullName(); + public static final String LIGHT_ORANGE = Tags.LIGHT_ORANGE.getFullName(); + public static final String LIGHT_RED = Tags.LIGHT_RED.getFullName(); + public static final String LIGHT_BLUE = Tags.LIGHT_BLUE.getFullName(); + public static final String LIGHT_CYAN = Tags.LIGHT_CYAN.getFullName(); + public static final String LIGHT_PURPLE = Tags.LIGHT_PURPLE.getFullName(); + public static final String LIGHT_PINK = Tags.LIGHT_PINK.getFullName();*/ +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/TagPool.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/TagPool.java new file mode 100644 index 0000000..7f7a172 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/TagPool.java @@ -0,0 +1,77 @@ +package su.nightexpress.nightcore.util.text.tag; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.Placeholders; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class TagPool { + + public static final TagPool ALL = new TagPool(Mode.BLACKLIST, Collections.emptySet()); + public static final TagPool NONE = new TagPool(Mode.WHITELIST, Collections.emptySet()); + + private final Mode mode; + private final Set tags; + + @NotNull + public static TagPool whitelisted(@NotNull Tag... tags) { + return create(Mode.WHITELIST, tags); + } + + @NotNull + public static TagPool blacklisted(@NotNull Tag... tags) { + return create(Mode.BLACKLIST, tags); + } + + @NotNull + public static TagPool create(@NotNull Mode mode, @NotNull Tag... tags) { + return new TagPool(mode, Stream.of(tags).map(Tag::getName).collect(Collectors.toSet())); + } + + public TagPool(@NotNull Mode mode, @NotNull Set tags) { + this.mode = mode; + this.tags = new HashSet<>(tags); + } + + public enum Mode { + WHITELIST, BLACKLIST + } + + public boolean isWhitelist() { + return this.getMode() == Mode.WHITELIST; + } + + public boolean isBlacklist() { + return this.getMode() == Mode.BLACKLIST; + } + + public boolean isGoodTag(@NotNull Tag tag) { + return this.isGoodTag(tag.getName()); + } + + public boolean isGoodTag(@NotNull String name) { + name = name.toLowerCase(); + + if (this.isWhitelist()) { + return this.getTags().contains(name) || this.getTags().contains(Placeholders.WILDCARD); + } + else { + return !this.getTags().contains(name); + } + } + + @NotNull + public Mode getMode() { + return mode; + } + + @NotNull + public Set getTags() { + return tags; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java new file mode 100644 index 0000000..1d014e0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java @@ -0,0 +1,42 @@ +package su.nightexpress.nightcore.util.text.tag; + +import su.nightexpress.nightcore.util.text.tag.impl.*; + +public class Tags { + + public static final ClickTag CLICK = new ClickTag(); + public static final FontTag FONT = new FontTag(); + public static final GradientTag GRADIENT = new GradientTag(); + public static final HexColorTag HEX_COLOR = new HexColorTag(); + public static final HoverTag HOVER = new HoverTag(); + public static final LineBreakTag LINE_BREAK = new LineBreakTag(); + public static final ResetTag RESET = new ResetTag(); + + public static final FontStyleTag BOLD = new FontStyleTag("b", FontStyleTag.Style.BOLD); + public static final FontStyleTag ITALIC = new FontStyleTag("i", FontStyleTag.Style.ITALIC); + public static final FontStyleTag OBFUSCATED = new FontStyleTag("o", FontStyleTag.Style.OBFUSCATED); + public static final FontStyleTag STRIKETHROUGH = new FontStyleTag("s", FontStyleTag.Style.STRIKETHROUGH); + public static final FontStyleTag UNDERLINED = new FontStyleTag("u", FontStyleTag.Style.UNDERLINED); + + public static final ColorTag WHITE = new ColorTag("white", "#e8f2f2"); + public static final ColorTag GRAY = new ColorTag("gray", "#aaa8a8"); + public static final ColorTag GREEN = new ColorTag("green", "#74ea31"); + public static final ColorTag YELLOW = new ColorTag("yellow", "#ead931"); + public static final ColorTag ORANGE = new ColorTag("orange", "#ea9631"); + public static final ColorTag RED = new ColorTag("red", "#ea3131"); + public static final ColorTag BLUE = new ColorTag("blue", "#3196ea"); + public static final ColorTag CYAN = new ColorTag("cyan", "#31eace"); + public static final ColorTag PURPLE = new ColorTag("purple", "#bd31ea"); + public static final ColorTag PINK = new ColorTag("pink", "#ea31b2"); + + public static final ColorTag DARK_GRAY = new ColorTag("dark_gray", "#6c6c62"); + public static final ColorTag LIGHT_GRAY = new ColorTag("light_gray", "#d4d9d8"); + public static final ColorTag LIGHT_GREEN = new ColorTag("light_green", "#aefd5e"); + public static final ColorTag LIGHT_YELLOW = new ColorTag("light_yellow", "#ffeea2"); + public static final ColorTag LIGHT_ORANGE = new ColorTag("light_orange", "#fdba5e"); + public static final ColorTag LIGHT_RED = new ColorTag("light_red", "#fd5e5e"); + public static final ColorTag LIGHT_BLUE = new ColorTag("light_blue", "#5e9dfd"); + public static final ColorTag LIGHT_CYAN = new ColorTag("light_cyan", "#5edefd"); + public static final ColorTag LIGHT_PURPLE = new ColorTag("light_purple", "#e39fff"); + public static final ColorTag LIGHT_PINK = new ColorTag("light_pink", "#fd8ddb"); +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/api/ContentTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/api/ContentTag.java new file mode 100644 index 0000000..a9cba84 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/api/ContentTag.java @@ -0,0 +1,34 @@ +package su.nightexpress.nightcore.util.text.tag.api; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.text.decoration.DecoratorParser; +import su.nightexpress.nightcore.util.text.decoration.ParsedDecorator; + +public abstract class ContentTag extends DynamicTag implements DecoratorParser { + + public ContentTag(@NotNull String name) { + super(name); + } + + @Override + @Nullable + public final ParsedDecorator parse(@NotNull String str) { + int tagLength = this.getName().length(); + String sub = str.substring(tagLength); + + if (sub.charAt(0) == ':') { + sub = sub.substring(1); + tagLength += 1; + } + + ParsedDecorator decorator = this.onParse(sub); + if (decorator != null) { + decorator.setLength(decorator.getLength() + tagLength + 2); // 2 for quotes + } + return decorator; + } + + @Nullable + protected abstract ParsedDecorator onParse(@NotNull String sub); +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/api/DynamicTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/api/DynamicTag.java new file mode 100644 index 0000000..074bdb2 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/api/DynamicTag.java @@ -0,0 +1,57 @@ +package su.nightexpress.nightcore.util.text.tag.api; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public abstract class DynamicTag extends Tag { + + public DynamicTag(@NotNull String name) { + super(name); + } + + @NotNull + protected final String leading(@Nullable String prefix, @NotNull String content) { + if (prefix != null) prefix += ":"; + + StringBuilder builder = new StringBuilder(); + builder.append(this.getName()).append(":"); + if (prefix != null) { + builder.append(prefix); + } + builder.append("'").append(content).append("'"); + + return brackets(builder.toString()); + } + + @NotNull + protected final String enclose(@Nullable String prefix, @NotNull String content, @NotNull String text) { + return leading(prefix, content) + text + this.getClosingName(); + } + + @Nullable + public static String parseQuotedContent(@NotNull String string) { + char quote = string.charAt(0); + if (quote != '\'' && quote != '"') return null; + + int indexEnd = -1; + for (int index = 0; index < string.length(); index++) { + if (index == (string.length() - 1) || index == 0) continue; + + char letter = string.charAt(index); + if (letter == '\\') { // TODO Replace/remove it + index++; + continue; + } + if (letter != quote) continue; + + char next = string.charAt(index + 1); + if (next == Tag.CLOSE_BRACKET) { + indexEnd = index; + break; + } + } + if (indexEnd == -1) return null; + + return string.substring(1, indexEnd); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/api/Tag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/api/Tag.java new file mode 100644 index 0000000..4edcb9b --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/api/Tag.java @@ -0,0 +1,54 @@ +package su.nightexpress.nightcore.util.text.tag.api; + +import org.jetbrains.annotations.NotNull; + +public abstract class Tag { + + public static final char OPEN_BRACKET = '<'; + public static final char CLOSE_BRACKET = '>'; + public static final char CLOSE_MARK = '/'; + + protected final String name; + + public Tag(@NotNull String name) { + this.name = name.toLowerCase(); + } + + @NotNull + public static String brackets(@NotNull String str) { + return OPEN_BRACKET + str + CLOSE_BRACKET; + } + + @NotNull + public String getName() { + return name; + } + + @NotNull + public String enclose(@NotNull String text) { + return this.getFullName() + text + this.getClosingName(); + } + + public abstract int getWeight(); + + @NotNull + public final String getFullName() { + return brackets(this.getName()); + } + + @NotNull + public final String getClosingName() { + return brackets(CLOSE_MARK + this.getName()); + } + + public boolean conflictsWith(@NotNull Tag tag) { + return tag.getName().equalsIgnoreCase(this.getName()); + } + + @Override + public String toString() { + return "Tag{" + + "name='" + name + '\'' + + '}'; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ClickTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ClickTag.java new file mode 100644 index 0000000..c558e24 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ClickTag.java @@ -0,0 +1,55 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import net.md_5.bungee.api.chat.ClickEvent; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.text.decoration.ClickEventDecorator; +import su.nightexpress.nightcore.util.text.decoration.Decorator; +import su.nightexpress.nightcore.util.text.decoration.ParsedDecorator; +import su.nightexpress.nightcore.util.text.tag.api.DynamicTag; +import su.nightexpress.nightcore.util.text.tag.api.ContentTag; + +public class ClickTag extends ContentTag { + + public static final String NAME = "click"; + + public ClickTag() { + super(NAME); + } + + @Override + public int getWeight() { + return 50; + } + + @NotNull + public String enclose(@NotNull ClickEvent.Action action, @NotNull String text, @NotNull String command) { + String actionName = action.name().toLowerCase(); + return this.enclose(actionName, command, text); + } + + @Override + @Nullable + public ParsedDecorator onParse(@NotNull String sub) { + ClickEvent.Action action = null; + for (ClickEvent.Action global : ClickEvent.Action.values()) { + if (sub.startsWith(global.name().toLowerCase())) { + action = global; + break; + } + } + if (action == null) return null; + + int prefixSize = action.name().toLowerCase().length() + 1; // 1 for ':', like "run_command:" + sub = sub.substring(prefixSize); + + String content = DynamicTag.parseQuotedContent(sub); + if (content == null) return null; + + int length = prefixSize + content.length();// + 2; // 2 for quotes + + Decorator decorator = new ClickEventDecorator(action, content); + + return new ParsedDecorator(decorator, length); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ColorTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ColorTag.java new file mode 100644 index 0000000..01d8ac6 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ColorTag.java @@ -0,0 +1,47 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import net.md_5.bungee.api.ChatColor; +import net.md_5.bungee.api.chat.BaseComponent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.text.decoration.Decorator; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +import java.awt.*; + +public class ColorTag extends Tag implements Decorator { + + protected final Color color; + + public ColorTag(@NotNull String name, @NotNull String hex) { + this(name, Color.decode(hex)); + } + + public ColorTag(@NotNull Color color) { + this(Integer.toHexString(color.getRGB()).substring(2), color); + } + + public ColorTag(@NotNull String name, @NotNull Color color) { + super(name); + this.color = color; + } + + @Override + public int getWeight() { + return 10; + } + + @NotNull + public Color getColor() { + return color; + } + + @Override + public boolean conflictsWith(@NotNull Tag tag) { + return tag instanceof ColorTag; + } + + @Override + public void decorate(@NotNull BaseComponent component) { + component.setColor(ChatColor.of(this.getColor())); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java new file mode 100644 index 0000000..707deee --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java @@ -0,0 +1,41 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import net.md_5.bungee.api.chat.BaseComponent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.text.decoration.Decorator; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +public class FontStyleTag extends Tag implements Decorator { + + public enum Style { + BOLD, ITALIC, UNDERLINED, STRIKETHROUGH, OBFUSCATED + } + + private final Style style; + + public FontStyleTag(@NotNull String name, @NotNull Style style) { + super(name); + this.style = style; + } + + @Override + public int getWeight() { + return 0; + } + + @NotNull + public Style getStyle() { + return style; + } + + @Override + public void decorate(@NotNull BaseComponent component) { + switch (this.getStyle()) { + case BOLD -> component.setBold(true); + case ITALIC -> component.setItalic(true); + case OBFUSCATED -> component.setObfuscated(true); + case UNDERLINED -> component.setUnderlined(true); + case STRIKETHROUGH -> component.setStrikethrough(true); + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontTag.java new file mode 100644 index 0000000..ce92d82 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontTag.java @@ -0,0 +1,33 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.text.decoration.FontDecorator; +import su.nightexpress.nightcore.util.text.decoration.ParsedDecorator; +import su.nightexpress.nightcore.util.text.tag.api.DynamicTag; +import su.nightexpress.nightcore.util.text.tag.api.ContentTag; + +public class FontTag extends ContentTag { + + public static final String NAME = "font"; + + public FontTag() { + super(NAME); + } + + @Override + @Nullable + public ParsedDecorator onParse(@NotNull String str) { + String content = DynamicTag.parseQuotedContent(str); + if (content == null) return null; + + int length = content.length();// + 2; // 2 for quotes + + return new ParsedDecorator(new FontDecorator(content), length); + } + + @Override + public int getWeight() { + return 0; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/GradientTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/GradientTag.java new file mode 100644 index 0000000..28afed5 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/GradientTag.java @@ -0,0 +1,60 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.text.decoration.DecoratorParser; +import su.nightexpress.nightcore.util.text.decoration.GradientDecorator; +import su.nightexpress.nightcore.util.text.decoration.ParsedDecorator; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +import java.awt.*; + +public class GradientTag extends Tag implements DecoratorParser { + + public static final String NAME = "gradient"; + + public GradientTag() { + super(NAME); + } + + @Override + public int getWeight() { + return Integer.MAX_VALUE - 1; + } + + @Override + public boolean conflictsWith(@NotNull Tag tag) { + return super.conflictsWith(tag) || tag instanceof ColorTag || tag instanceof HexColorTag; + } + + @Override + @Nullable + public ParsedDecorator parse(@NotNull String content) { + int tagLength = this.getName().length() + 1; // 1 for semicolon + content = content.substring(tagLength); + + String[] split = content.split(":"); + if (split.length < 2) return null; + + String code1 = split[0]; + String code2 = split[1]; + //if (!code1.startsWith("#")) code1 = "#" + code1; + //if (!code2.startsWith("#")) code2 = "#" + code2; + //if (code1.length() != 7 || code2.length() != 7) return null; + + Color from; + Color to; + + try { + from = Color.decode(code1); + to = Color.decode(code2); + } + catch (NumberFormatException exception) { + return null; + } + + GradientDecorator decorator = new GradientDecorator(from, to); + + return new ParsedDecorator(decorator, 15 + tagLength); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java new file mode 100644 index 0000000..6fc52d6 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java @@ -0,0 +1,41 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.text.decoration.DecoratorParser; +import su.nightexpress.nightcore.util.text.decoration.ParsedDecorator; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +import java.awt.*; + +public class HexColorTag extends Tag implements DecoratorParser { + + public HexColorTag() { + super("#"); + } + + @Override + public int getWeight() { + return 10; + } + + @Override + public boolean conflictsWith(@NotNull Tag tag) { + return super.conflictsWith(tag) || tag instanceof ColorTag || tag instanceof GradientTag; + } + + @Override + @Nullable + public ParsedDecorator parse(@NotNull String content) { + Color color; + + try { + color = Color.decode(content); + } + catch (NumberFormatException exception) { + return null; + } + + return new ParsedDecorator(new ColorTag(color), 7); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HoverTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HoverTag.java new file mode 100644 index 0000000..8e0ac35 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HoverTag.java @@ -0,0 +1,79 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import net.md_5.bungee.api.chat.HoverEvent; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.util.ItemUtil; +import su.nightexpress.nightcore.util.text.decoration.Decorator; +import su.nightexpress.nightcore.util.text.decoration.ParsedDecorator; +import su.nightexpress.nightcore.util.text.decoration.ShowItemDecorator; +import su.nightexpress.nightcore.util.text.decoration.ShowTextDecorator; +import su.nightexpress.nightcore.util.text.tag.api.DynamicTag; +import su.nightexpress.nightcore.util.text.tag.api.ContentTag; + +public class HoverTag extends ContentTag { + + public static final String NAME = "hover"; + + public HoverTag() { + super(NAME); + } + + @Override + public int getWeight() { + return 50; + } + + /*@Override + public boolean isDynamicSize() { + return true; + }*/ + + @NotNull + public String enclose(@NotNull String text, @NotNull String hint) { + String action = HoverEvent.Action.SHOW_TEXT.name().toLowerCase(); + return this.enclose(action, hint, text); + } + + @Override + @Nullable + public ParsedDecorator onParse(@NotNull String sub) { + HoverEvent.Action action = null; + for (HoverEvent.Action global : HoverEvent.Action.values()) { + if (sub.startsWith(global.name().toLowerCase())) { + action = global; + break; + } + } + if (action == null) return null; + + int prefixSize = action.name().toLowerCase().length() + 1; // 1 for ':', like "show_text:" + sub = sub.substring(prefixSize); + + String content = DynamicTag.parseQuotedContent(sub); + if (content == null) return null; + + int length = prefixSize + content.length();// + 2; // 2 for quotes + + Decorator decorator; + if (action == HoverEvent.Action.SHOW_TEXT) { + decorator = new ShowTextDecorator(content); + } + else if (action == HoverEvent.Action.SHOW_ITEM) { + ItemStack item; + + Material material = Material.getMaterial(content.toUpperCase()); + if (material != null) { + item = new ItemStack(material); + } + else item = ItemUtil.decompress(content); + + decorator = new ShowItemDecorator(item); + } + else return null; + + return new ParsedDecorator(decorator, length); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/LineBreakTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/LineBreakTag.java new file mode 100644 index 0000000..49c674c --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/LineBreakTag.java @@ -0,0 +1,15 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +public class LineBreakTag extends Tag { + + public LineBreakTag() { + super("br"); + } + + @Override + public int getWeight() { + return 0; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ResetTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ResetTag.java new file mode 100644 index 0000000..ece94e1 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/ResetTag.java @@ -0,0 +1,32 @@ +package su.nightexpress.nightcore.util.text.tag.impl; + +import net.md_5.bungee.api.chat.BaseComponent; +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.util.text.decoration.Decorator; +import su.nightexpress.nightcore.util.text.tag.api.Tag; + +public class ResetTag extends Tag implements Decorator { + + public ResetTag() { + super("r"); + } + + @Override + public int getWeight() { + return Integer.MAX_VALUE; + } + + @Override + public void decorate(@NotNull BaseComponent component) { + component.setColor(null); + component.setBold(false); + component.setItalic(false); + component.setObfuscated(false); + component.setUnderlined(false); + component.setStrikethrough(false); + component.setFont(null); + component.setInsertion(null); + component.setHoverEvent(null); + component.setClickEvent(null); + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/wrapper/UniDouble.java b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniDouble.java new file mode 100644 index 0000000..158bf03 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniDouble.java @@ -0,0 +1,55 @@ +package su.nightexpress.nightcore.util.wrapper; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.random.Rnd; + +public final class UniDouble { + + private final double minInclusive; + private final double maxInclusive; + + private UniDouble(double min, double max) { + this.minInclusive = min; + this.maxInclusive = max; + } + + @NotNull + public static UniDouble of(double min, double max) { + return new UniDouble(min, max); + } + + @NotNull + public static UniDouble read(@NotNull FileConfig cfg, @NotNull String path) { + double min = cfg.getDouble(path + ".Min"); + double max = cfg.getDouble(path + ".Max"); + return of(min, max); + } + + public void write(@NotNull FileConfig cfg, @NotNull String path) { + cfg.set(path + ".Min", this.getMinValue()); + cfg.set(path + ".Max", this.getMaxValue()); + } + + @NotNull + public UniInt asInt() { + return UniInt.of((int) this.getMinValue(), (int) this.getMaxValue()); + } + + public double roll() { + return Rnd.getDouble(this.minInclusive, this.maxInclusive); + } + + public double getMinValue() { + return this.minInclusive; + } + + public double getMaxValue() { + return this.maxInclusive; + } + + @Override + public String toString() { + return "[" + this.minInclusive + "-" + this.maxInclusive + "]"; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/wrapper/UniInt.java b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniInt.java new file mode 100644 index 0000000..edcb0b1 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniInt.java @@ -0,0 +1,50 @@ +package su.nightexpress.nightcore.util.wrapper; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.random.Rnd; + +public final class UniInt { + + private final int minInclusive; + private final int maxInclusive; + + private UniInt(int var0, int var1) { + this.minInclusive = var0; + this.maxInclusive = var1; + } + + @NotNull + public static UniInt of(int var0, int var1) { + return new UniInt(var0, var1); + } + + @NotNull + public static UniInt read(@NotNull FileConfig cfg, @NotNull String path) { + int min = cfg.getInt(path + ".Min"); + int max = cfg.getInt(path + ".Max"); + return of(min, max); + } + + public void write(@NotNull FileConfig cfg, @NotNull String path) { + cfg.set(path + ".Min", this.getMinValue()); + cfg.set(path + ".Max", this.getMaxValue()); + } + + public int roll() { + return Rnd.get(this.minInclusive, this.maxInclusive); + } + + public int getMinValue() { + return this.minInclusive; + } + + public int getMaxValue() { + return this.maxInclusive; + } + + @Override + public String toString() { + return "[" + this.minInclusive + "-" + this.maxInclusive + "]"; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/wrapper/UniParticle.java b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniParticle.java new file mode 100644 index 0000000..bbeede6 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniParticle.java @@ -0,0 +1,205 @@ +package su.nightexpress.nightcore.util.wrapper; + +import org.bukkit.*; +import org.bukkit.block.data.BlockData; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.NumberUtil; +import su.nightexpress.nightcore.util.StringUtil; + +public class UniParticle { + + private final Particle particle; + private final Object data; + + public UniParticle(@Nullable Particle particle, @Nullable Object data) { + this.particle = particle; + this.data = data; + } + + @NotNull + public static UniParticle of(@Nullable Particle particle) { + return UniParticle.of(particle, null); + } + + @NotNull + public static UniParticle of(@Nullable Particle particle, @Nullable Object data) { + return new UniParticle(particle, data); + } + + @NotNull + public static UniParticle itemCrack(@NotNull ItemStack item) { + return new UniParticle(Particle.ITEM_CRACK, new ItemStack(item)); + } + + @NotNull + public static UniParticle itemCrack(@NotNull Material material) { + return new UniParticle(Particle.ITEM_CRACK, new ItemStack(material)); + } + + @NotNull + public static UniParticle blockCrack(@NotNull Material material) { + return new UniParticle(Particle.BLOCK_CRACK, material.createBlockData()); + } + + @NotNull + public static UniParticle blockDust(@NotNull Material material) { + return new UniParticle(Particle.BLOCK_DUST, material.createBlockData()); + } + + @NotNull + public static UniParticle blockMarker(@NotNull Material material) { + return new UniParticle(Particle.BLOCK_MARKER, material.createBlockData()); + } + + @NotNull + public static UniParticle fallingDust(@NotNull Material material) { + return new UniParticle(Particle.FALLING_DUST, material.createBlockData()); + } + + @NotNull + public static UniParticle redstone(@NotNull Color color, float size) { + return new UniParticle(Particle.REDSTONE, new Particle.DustOptions(color, size)); + } + + @NotNull + public static UniParticle read(@NotNull FileConfig cfg, @NotNull String path) { + String name = cfg.getString(path + ".Name", ""); + Particle particle = StringUtil.getEnum(name, Particle.class).orElse(null); + if (particle == null) return UniParticle.of(null); + + Class dataType = particle.getDataType(); + Object data = null; + if (dataType == BlockData.class) { + Material material = Material.getMaterial(cfg.getString(path + ".Material", "")); + data = material != null ? material.createBlockData() : Material.STONE.createBlockData(); + } + else if (dataType == Particle.DustOptions.class) { + Color color = StringUtil.getColor(cfg.getString(path + ".Color", "")); + double size = cfg.getDouble(path + ".Size", 1D); + data = new Particle.DustOptions(color, (float) size); + } + else if (dataType == Particle.DustTransition.class) { + Color colorStart = StringUtil.getColor(cfg.getString(path + ".Color_From", "")); + Color colorEnd = StringUtil.getColor(cfg.getString(path + ".Color_To", "")); + double size = cfg.getDouble(path + ".Size", 1D); + data = new Particle.DustTransition(colorStart, colorEnd, 1.0f); + } + else if (dataType == ItemStack.class) { + ItemStack item = cfg.getItem(path + ".Item"); + data = item.getType().isAir() ? new ItemStack(Material.STONE) : item; + } + else if (dataType != Void.class) return UniParticle.of(Particle.REDSTONE); + + return UniParticle.of(particle, data); + } + + public void write(@NotNull FileConfig cfg, @NotNull String path) { + cfg.set(path + ".Name", this.isEmpty() ? "null" : this.getParticle().name()); + + Object data = this.getData(); + if (data instanceof BlockData blockData) { + cfg.set(path + ".Material", blockData.getMaterial().name()); + } + else if (data instanceof Particle.DustTransition dustTransition) { + Color colorStart = dustTransition.getColor(); + Color colorEnd = dustTransition.getToColor(); + cfg.set(path + ".Color_From", colorStart.getRed() + "," + colorStart.getGreen() + "," + colorStart.getBlue()); + cfg.set(path + ".Color_To", colorEnd.getRed() + "," + colorEnd.getGreen() + "," + colorEnd.getBlue()); + cfg.set(path + ".Size", dustTransition.getSize()); + } + else if (data instanceof Particle.DustOptions dustOptions) { + Color color = dustOptions.getColor(); + cfg.set(path + ".Color", color.getRed() + "," + color.getGreen() + "," + color.getBlue()); + cfg.set(path + ".Size", dustOptions.getSize()); + } + else if (data instanceof ItemStack item) { + cfg.setItem(path + ".Item", item); + } + } + + public boolean isEmpty() { + return this.particle == null; + } + + public Particle getParticle() { + return particle; + } + + @Nullable + public Object getData() { + return data; + } + + @NotNull + @Deprecated + public UniParticle parseData(@NotNull String from) { + if (this.isEmpty()) return this; + + String[] split = from.split(" "); + Class dataType = this.getParticle().getDataType(); + Object data = null; + if (dataType == BlockData.class) { + Material material = Material.getMaterial(from.toUpperCase()); + data = material != null ? material.createBlockData() : Material.STONE.createBlockData(); + } + else if (dataType == Particle.DustOptions.class) { + Color color = StringUtil.getColor(split[0]); + double size = split.length >= 2 ? NumberUtil.getDouble(split[1], 1D) : 1D; + data = new Particle.DustOptions(color, (float) size); + } + else if (dataType == Particle.DustTransition.class) { + Color colorStart = StringUtil.getColor(split[0]); + Color colorEnd = split.length >= 2 ? StringUtil.getColor(split[1]) : colorStart; + double size = split.length >= 3 ? NumberUtil.getDouble(split[2], 1D) : 1D; + data = new Particle.DustTransition(colorStart, colorEnd, 1.0f); + } + else if (dataType == ItemStack.class) { + Material material = Material.getMaterial(from.toUpperCase()); + if (material != null && !material.isAir()) data = new ItemStack(material); + else data = new ItemStack(Material.STONE); + } + else if (dataType != Void.class) return UniParticle.of(Particle.REDSTONE); + + return UniParticle.of(this.getParticle(), data); + } + + public void play(@NotNull Location location, double speed, int amount) { + this.play(location, 0D, speed, amount); + } + + public void play(@NotNull Location location, double offsetAll, double speed, int amount) { + this.play(location, offsetAll, offsetAll, offsetAll, speed, amount); + } + + public void play(@NotNull Location location, double xOffset, double yOffset, double zOffset, double speed, int amount) { + this.play(null, location, xOffset, yOffset, zOffset, speed, amount); + } + + public void play(@NotNull Player player, @NotNull Location location, double speed, int amount) { + this.play(player, location, 0D, speed, amount); + } + + public void play(@NotNull Player player, @NotNull Location location, double offsetAll, double speed, int amount) { + this.play(player, location, offsetAll, offsetAll, offsetAll, speed, amount); + } + + public void play(@Nullable Player player, @NotNull Location location, double xOffset, double yOffset, double zOffset, double speed, int amount) { + if (this.isEmpty()) return; + + if (player == null) { + World world = location.getWorld(); + if (world == null) return; + + world.spawnParticle(this.getParticle(), location, amount, xOffset, yOffset, zOffset, speed, this.getData()); + //EffectUtil.playParticle(location, this.getParticle(), this.getData(), xOffset, yOffset, zOffset, speed, amount); + } + else { + player.spawnParticle(this.getParticle(), location, amount, xOffset, yOffset, zOffset, speed, this.getData()); + //EffectUtil.playParticle(player, location, this.getParticle(), this.getData(), xOffset, yOffset, zOffset, speed, amount); + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/wrapper/UniPermission.java b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniPermission.java new file mode 100644 index 0000000..eddd032 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniPermission.java @@ -0,0 +1,37 @@ +package su.nightexpress.nightcore.util.wrapper; + +import org.bukkit.permissions.Permission; +import org.bukkit.permissions.PermissionDefault; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class UniPermission extends Permission { + + public UniPermission(@NotNull String name) { + this(name, null, null); + } + + public UniPermission(@NotNull String name, @Nullable PermissionDefault defaultValue) { + this(name, null, defaultValue); + } + + public UniPermission(@NotNull String name, @Nullable String description) { + this(name, description, PermissionDefault.OP); + } + + public UniPermission(@NotNull String name, @Nullable String description, @Nullable PermissionDefault defaultValue) { + super(name, description, defaultValue); + } + + @NotNull + public UniPermission description(String... desc) { + this.setDescription(String.join(" ", desc)); + return this; + } + + public void addChildren(@NotNull Permission... childrens) { + for (Permission children : childrens) { + children.addParent(this, true); + } + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/wrapper/UniSound.java b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniSound.java new file mode 100644 index 0000000..b8856f0 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniSound.java @@ -0,0 +1,112 @@ +package su.nightexpress.nightcore.util.wrapper; + +import org.bukkit.Location; +import org.bukkit.Sound; +import org.bukkit.World; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import su.nightexpress.nightcore.config.ConfigValue; +import su.nightexpress.nightcore.config.FileConfig; +import su.nightexpress.nightcore.util.StringUtil; + +public class UniSound { + + private final String soundName; + private final Sound soundType; + private final float volume; + private final float pitch; + + public UniSound(@NotNull String soundName, @Nullable Sound soundType, float volume, float pitch) { + this.soundName = soundName; + this.soundType = soundType; + this.volume = volume; + this.pitch = pitch; + } + + @NotNull + public static UniSound of(@NotNull Sound sound) { + return of(sound, 0.8F); + } + + @NotNull + public static UniSound of(@NotNull Sound sound, float volume) { + return of(sound, volume, 1F); + } + + @NotNull + public static UniSound of(@NotNull Sound sound, float volume, float pitch) { + return new UniSound(sound.name(), sound, volume, pitch); + } + + @NotNull + public static UniSound read(@NotNull FileConfig cfg, @NotNull String path) { + String soundName = ConfigValue.create(path + ".Name", "null", + "Sound name. You can use Spigot sound names, or ones from your resource pack.", + "Spigot Sounds: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html").read(cfg); + + float volume = ConfigValue.create(path + ".Volume", 0.8F, + "Sound volume. From 0.0 to 1.0.").read(cfg).floatValue(); + + float pitch = ConfigValue.create(path + ".Pitch", 1D, + "Sound speed. From 0.5 to 2.0").read(cfg).floatValue(); + + Sound soundType = StringUtil.getEnum(soundName, Sound.class).orElse(null); + + return new UniSound(soundName, soundType, volume, pitch); + } + + public void write(@NotNull FileConfig cfg, @NotNull String path) { + cfg.set(path + ".Name", this.getSoundName()); + cfg.set(path + ".Volume", this.getVolume()); + cfg.set(path + ".Pitch", this.getPitch()); + } + + public boolean isEmpty() { + return this.getVolume() <= 0F || this.getSoundName().isEmpty(); + } + + public void play(@NotNull Player player) { + if (this.isEmpty()) return; + + Location location = player.getLocation(); + if (this.getSoundType() == null) { + player.playSound(location, this.getSoundName(), this.getVolume(), this.getPitch()); + } + else { + player.playSound(location, this.getSoundType(), this.getVolume(), this.getPitch()); + } + } + + public void play(@NotNull Location location) { + if (this.isEmpty()) return; + + World world = location.getWorld(); + if (world == null) return; + + if (this.getSoundType() == null) { + world.playSound(location, this.getSoundName(), this.getVolume(), this.getPitch()); + } + else { + world.playSound(location, this.getSoundType(), this.getVolume(), this.getPitch()); + } + } + + @NotNull + public String getSoundName() { + return soundName; + } + + @Nullable + public Sound getSoundType() { + return soundType; + } + + public float getVolume() { + return volume; + } + + public float getPitch() { + return pitch; + } +} diff --git a/src/main/java/su/nightexpress/nightcore/util/wrapper/UniTask.java b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniTask.java new file mode 100644 index 0000000..c443172 --- /dev/null +++ b/src/main/java/su/nightexpress/nightcore/util/wrapper/UniTask.java @@ -0,0 +1,78 @@ +package su.nightexpress.nightcore.util.wrapper; + +import org.jetbrains.annotations.NotNull; +import su.nightexpress.nightcore.NightCorePlugin; + +public class UniTask { + + private final NightCorePlugin plugin; + private final Runnable runnable; + + private long interval; + private boolean async; + private int taskId; + + public UniTask(@NotNull NightCorePlugin plugin, @NotNull Runnable runnable) { + this(plugin, runnable, 0L); + } + + public UniTask(@NotNull NightCorePlugin plugin, @NotNull Runnable runnable, long interval) { + this(plugin, runnable, interval, false); + } + + public UniTask(@NotNull NightCorePlugin plugin, @NotNull Runnable runnable, long interval, boolean async) { + this.plugin = plugin; + this.runnable = runnable; + this.setTicksInterval(interval); + this.setAsync(async); + + this.taskId = -1; + } + + public UniTask setSecondsInterval(int interval) { + return this.setTicksInterval(interval * 20L); + } + + public UniTask setTicksInterval(long interval) { + this.interval = interval; + return this; + } + + public UniTask setAsync() { + return this.setAsync(true); + } + + public UniTask setAsync(boolean async) { + this.async = async; + return this; + } + + public boolean isRunning() { + return this.taskId >= 0 && this.plugin.getScheduler().isCurrentlyRunning(this.taskId); + } + + public final void restart() { + this.stop(); + this.start(); + } + + public UniTask start() { + if (this.taskId >= 0 || this.interval <= 0L) return this; + + if (this.async) { + this.taskId = plugin.getScheduler().runTaskTimerAsynchronously(plugin, runnable, 0L, interval).getTaskId(); + } + else { + this.taskId = plugin.getScheduler().runTaskTimer(plugin, runnable, 0L, interval).getTaskId(); + } + return this; + } + + public boolean stop() { + if (this.taskId < 0) return false; + + this.plugin.getServer().getScheduler().cancelTask(this.taskId); + this.taskId = -1; + return true; + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..2854e12 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,11 @@ +name: nightcore +main: su.nightexpress.nightcore.NightCore +version: '${project.version}' +description: Plugin Creation Kit. +author: NightExpress +softdepend: [ Vault] +api-version: 1.18 +load: STARTUP +libraries: + - com.zaxxer:HikariCP:5.0.1 + - it.unimi.dsi:fastutil:8.5.11 \ No newline at end of file From 19140f28091c7434ad7c3c10a4252101f79f7dbb Mon Sep 17 00:00:00 2001 From: nulli0n <73139339+nulli0n@users.noreply.github.com> Date: Mon, 1 Jan 2024 02:28:24 +0500 Subject: [PATCH 3/9] Update README.md --- README.md | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/README.md b/README.md index 61a1d1b..8b13789 100644 --- a/README.md +++ b/README.md @@ -1,35 +1 @@ -<<<<<<< HEAD -Utility Spigot plugin that provides the most common & useful features for plugin development to reduce duplicated code. -# About -The main purpose of **NexEngine** is to provide abilities for more easier plugin creation and better maintaining. And most importantly, to stay lightweight and well performed. - -**List of Features:** -* Internal command & permission registration (without using plugin.yml). -* **Command API** to create commands with multiple levels of sub-commands and custom flags \[-f\]. -* **Config API** with auto-generated fields and options & custom **FileConfiguration** class with some useful methods. -* **Database API** to store plugin & user data with **SQLite** and **MySQL** support. Including utility classes for building SQL queries, columns and tables. -* **Editor API** to handle player's chat / command input when prompted (used in GUI Editors mostly). -* **Language API** to handle multiple language configs and great message customization (JSON, action bar, titles, sounds, prefix). -* **Manager API** to create "manager" classes and event listeners. -* **Menu API** to create customizable flexible GUIs programatically or from config files. -* **Placeholder API** to create and handle internal placeholders and replace them in plugin texts/messages very fast instead of regular Java `.replace`. -* **Vault Integration** to obtain server's economy & permissions datas. -* **JSON Parser** custom utility to create & parse messages with multiple JSON components, such as: Hover, Run Command, Show Item, etc. -* **Wrappers** a few wrapper classes over Spigot ones for easier creation and usage. -* **Utilities** a lot of classes with different utilities, such as Location, Item, String, File, Number, Player, Time, Array and others. -* **Regex API** custom `CharSequence` implementation to prevent plugin / server stutter of unoptimized regex expressions after specified timeout. -* **Random API** custom random algorhythm with useful methods to roll chances, weights, or just numbers. -* **TriFunction** function class. - -# Performance -**NexEngine**, itself, uses almost no server resources, because there is no events, tasks, GUIs, commands, etc. If you see it in your spark timings near the top, then some plugin that utilizes NexEngine is either bad designed or misuses the API. - -# Paper Version - -Akiranya fork, that allows to use all Paper's features. - -https://github.com/Akiranya/NexEngine-paper -======= -# nightcore-spigot ->>>>>>> 21e19a98d15f4730258a942770cc69f4a9cde477 From d46cd866610b95143b2fd41cc3c0d462502fc34c Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 1 Jan 2024 02:32:09 +0500 Subject: [PATCH 4/9] release --- .gitignore | 3 +- assets/cn.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ assets/cz.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ assets/de.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ assets/en.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ assets/es.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ assets/fr.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ assets/pt_br.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ assets/ru.yml | 1617 ++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 12937 insertions(+), 2 deletions(-) create mode 100644 assets/cn.yml create mode 100644 assets/cz.yml create mode 100644 assets/de.yml create mode 100644 assets/en.yml create mode 100644 assets/es.yml create mode 100644 assets/fr.yml create mode 100644 assets/pt_br.yml create mode 100644 assets/ru.yml diff --git a/.gitignore b/.gitignore index 76d5773..e9b529f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /.idea/ /pom.xml.versionsBackup -/assets/ -/target/ +/target/ \ No newline at end of file diff --git a/assets/cn.yml b/assets/cn.yml new file mode 100644 index 0000000..1a1a7c6 --- /dev/null +++ b/assets/cn.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: 悦灵 + area_effect_cloud: 区域效果云 + armor_stand: 盔甲架 + arrow: 箭 + axolotl: 美西螈 + bat: 蝙蝠 + bee: 蜜蜂 + blaze: 烈焰人 + block_display: 方块展示实体 + boat: 船 + camel: 骆驼 + cat: 猫 + cave_spider: 洞穴蜘蛛 + chest_boat: 运输船 + chest_minecart: 运输矿车 + chicken: 鸡 + cod: 鳕鱼 + command_block_minecart: 命令方块矿车 + cow: 牛 + creeper: 苦力怕 + dolphin: 海豚 + donkey: 驴 + dragon_fireball: 末影龙火球 + drowned: 溺尸 + egg: 掷出的鸡蛋 + elder_guardian: 远古守卫者 + end_crystal: 末地水晶 + ender_dragon: 末影龙 + ender_pearl: 掷出的末影珍珠 + enderman: 末影人 + endermite: 末影螨 + evoker: 唤魔者 + evoker_fangs: 唤魔者尖牙 + experience_bottle: 掷出的附魔之瓶 + experience_orb: 经验球 + eye_of_ender: 末影之眼 + falling_block: 下落的方块 + falling_block_type: 下落的%s + fireball: 火球 + firework_rocket: 烟花火箭 + fishing_bobber: 浮漂 + fox: 狐狸 + frog: 青蛙 + furnace_minecart: 动力矿车 + ghast: 恶魂 + giant: 巨人 + glow_item_frame: 荧光物品展示框 + glow_squid: 发光鱿鱼 + goat: 山羊 + guardian: 守卫者 + hoglin: 疣猪兽 + hopper_minecart: 漏斗矿车 + horse: 马 + husk: 尸壳 + illusioner: 幻术师 + interaction: 交互实体 + iron_golem: 铁傀儡 + item: 物品 + item_display: 物品展示实体 + item_frame: 物品展示框 + killer_bunny: 杀手兔 + leash_knot: 拴绳结 + lightning_bolt: 闪电束 + llama: 羊驼 + llama_spit: 羊驼唾沫 + magma_cube: 岩浆怪 + marker: 标记 + minecart: 矿车 + mooshroom: 哞菇 + mule: 骡 + ocelot: 豹猫 + painting: 画 + panda: 熊猫 + parrot: 鹦鹉 + phantom: 幻翼 + pig: 猪 + piglin: 猪灵 + piglin_brute: 猪灵蛮兵 + pillager: 掠夺者 + player: 玩家 + polar_bear: 北极熊 + potion: 药水 + pufferfish: 河豚 + rabbit: 兔子 + ravager: 劫掠兽 + salmon: 鲑鱼 + sheep: 绵羊 + shulker: 潜影贝 + shulker_bullet: 潜影弹 + silverfish: 蠹虫 + skeleton: 骷髅 + skeleton_horse: 骷髅马 + slime: 史莱姆 + small_fireball: 小火球 + sniffer: 嗅探兽 + snow_golem: 雪傀儡 + snowball: 雪球 + spawner_minecart: 刷怪笼矿车 + spectral_arrow: 光灵箭 + spider: 蜘蛛 + squid: 鱿鱼 + stray: 流浪者 + strider: 炽足兽 + tadpole: 蝌蚪 + text_display: 文本展示实体 + tnt: 被激活的TNT + tnt_minecart: TNT矿车 + trader_llama: 行商羊驼 + trident: 三叉戟 + tropical_fish: 热带鱼 + turtle: 海龟 + vex: 恼鬼 + villager: 村民 + vindicator: 卫道士 + wandering_trader: 流浪商人 + warden: 监守者 + witch: 女巫 + wither: 凋灵 + wither_skeleton: 凋灵骷髅 + wither_skull: 凋灵之首 + wolf: 狼 + zoglin: 僵尸疣猪兽 + zombie: 僵尸 + zombie_horse: 僵尸马 + zombie_villager: 僵尸村民 + zombified_piglin: 僵尸猪灵 +PotionEffectType: + absorption: 伤害吸收 + bad_omen: 不祥之兆 + blindness: 失明 + conduit_power: 潮涌能量 + darkness: 黑暗 + dolphins_grace: 海豚的恩惠 + fire_resistance: 抗火 + glowing: 发光 + haste: 急迫 + health_boost: 生命提升 + hero_of_the_village: 村庄英雄 + hunger: 饥饿 + instant_damage: 瞬间伤害 + instant_health: 瞬间治疗 + invisibility: 隐身 + jump_boost: 跳跃提升 + levitation: 飘浮 + luck: 幸运 + mining_fatigue: 挖掘疲劳 + nausea: 反胃 + night_vision: 夜视 + poison: 中毒 + regeneration: 生命恢复 + resistance: 抗性提升 + saturation: 饱和 + slow_falling: 缓降 + slowness: 缓慢 + speed: 迅捷 + strength: 力量 + unluck: 霉运 + water_breathing: 水下呼吸 + weakness: 虚弱 + wither: 凋零 +Material: + acacia_button: 金合欢木按钮 + acacia_door: 金合欢木门 + acacia_fence: 金合欢木栅栏 + acacia_fence_gate: 金合欢木栅栏门 + acacia_hanging_sign: 悬挂式金合欢木告示牌 + acacia_leaves: 金合欢树叶 + acacia_log: 金合欢原木 + acacia_planks: 金合欢木板 + acacia_pressure_plate: 金合欢木压力板 + acacia_sapling: 金合欢树苗 + acacia_sign: 金合欢木告示牌 + acacia_slab: 金合欢木台阶 + acacia_stairs: 金合欢木楼梯 + acacia_trapdoor: 金合欢木活板门 + acacia_wall_hanging_sign: 墙上的悬挂式金合欢木告示牌 + acacia_wall_sign: 墙上的金合欢木告示牌 + acacia_wood: 金合欢木 + activator_rail: 激活铁轨 + air: 空气 + allium: 绒球葱 + amethyst_block: 紫水晶块 + amethyst_cluster: 紫水晶簇 + ancient_debris: 远古残骸 + andesite: 安山岩 + andesite_slab: 安山岩台阶 + andesite_stairs: 安山岩楼梯 + andesite_wall: 安山岩墙 + anvil: 铁砧 + attached_melon_stem: 结果的西瓜茎 + attached_pumpkin_stem: 结果的南瓜茎 + azalea: 杜鹃花丛 + azalea_leaves: 杜鹃树叶 + azure_bluet: 蓝花美耳草 + bamboo: 竹子 + bamboo_block: 竹块 + bamboo_button: 竹按钮 + bamboo_door: 竹门 + bamboo_fence: 竹栅栏 + bamboo_fence_gate: 竹栅栏门 + bamboo_hanging_sign: 悬挂式竹告示牌 + bamboo_mosaic: 竹马赛克 + bamboo_mosaic_slab: 竹马赛克台阶 + bamboo_mosaic_stairs: 竹马赛克楼梯 + bamboo_planks: 竹板 + bamboo_pressure_plate: 竹压力板 + bamboo_sapling: 竹笋 + bamboo_sign: 竹告示牌 + bamboo_slab: 竹台阶 + bamboo_stairs: 竹楼梯 + bamboo_trapdoor: 竹活板门 + bamboo_wall_hanging_sign: 墙上的悬挂式竹告示牌 + bamboo_wall_sign: 墙上的竹告示牌 + barrel: 木桶 + barrier: 屏障 + basalt: 玄武岩 + beacon: 信标 + bedrock: 基岩 + bee_nest: 蜂巢 + beehive: 蜂箱 + beetroots: 甜菜根 + bell: 钟 + big_dripleaf: 大型垂滴叶 + big_dripleaf_stem: 大型垂滴叶茎 + birch_button: 白桦木按钮 + birch_door: 白桦木门 + birch_fence: 白桦木栅栏 + birch_fence_gate: 白桦木栅栏门 + birch_hanging_sign: 悬挂式白桦木告示牌 + birch_leaves: 白桦树叶 + birch_log: 白桦原木 + birch_planks: 白桦木板 + birch_pressure_plate: 白桦木压力板 + birch_sapling: 白桦树苗 + birch_sign: 白桦木告示牌 + birch_slab: 白桦木台阶 + birch_stairs: 白桦木楼梯 + birch_trapdoor: 白桦木活板门 + birch_wall_hanging_sign: 墙上的悬挂式白桦木告示牌 + birch_wall_sign: 墙上的白桦木告示牌 + birch_wood: 白桦木 + black_banner: 黑色旗帜 + black_bed: 黑色床 + black_candle: 黑色蜡烛 + black_candle_cake: 插上黑色蜡烛的蛋糕 + black_carpet: 黑色地毯 + black_concrete: 黑色混凝土 + black_concrete_powder: 黑色混凝土粉末 + black_glazed_terracotta: 黑色带釉陶瓦 + black_shulker_box: 黑色潜影盒 + black_stained_glass: 黑色染色玻璃 + black_stained_glass_pane: 黑色染色玻璃板 + black_terracotta: 黑色陶瓦 + black_wool: 黑色羊毛 + blackstone: 黑石 + blackstone_slab: 黑石台阶 + blackstone_stairs: 黑石楼梯 + blackstone_wall: 黑石墙 + blast_furnace: 高炉 + blue_banner: 蓝色旗帜 + blue_bed: 蓝色床 + blue_candle: 蓝色蜡烛 + blue_candle_cake: 插上蓝色蜡烛的蛋糕 + blue_carpet: 蓝色地毯 + blue_concrete: 蓝色混凝土 + blue_concrete_powder: 蓝色混凝土粉末 + blue_glazed_terracotta: 蓝色带釉陶瓦 + blue_ice: 蓝冰 + blue_orchid: 兰花 + blue_shulker_box: 蓝色潜影盒 + blue_stained_glass: 蓝色染色玻璃 + blue_stained_glass_pane: 蓝色染色玻璃板 + blue_terracotta: 蓝色陶瓦 + blue_wool: 蓝色羊毛 + bone_block: 骨块 + bookshelf: 书架 + brain_coral: 脑纹珊瑚 + brain_coral_block: 脑纹珊瑚块 + brain_coral_fan: 脑纹珊瑚扇 + brain_coral_wall_fan: 墙上的脑纹珊瑚扇 + brewing_stand: 酿造台 + brick_slab: 红砖台阶 + brick_stairs: 红砖楼梯 + brick_wall: 红砖墙 + bricks: 红砖块 + brown_banner: 棕色旗帜 + brown_bed: 棕色床 + brown_candle: 棕色蜡烛 + brown_candle_cake: 插上棕色蜡烛的蛋糕 + brown_carpet: 棕色地毯 + brown_concrete: 棕色混凝土 + brown_concrete_powder: 棕色混凝土粉末 + brown_glazed_terracotta: 棕色带釉陶瓦 + brown_mushroom: 棕色蘑菇 + brown_mushroom_block: 棕色蘑菇方块 + brown_shulker_box: 棕色潜影盒 + brown_stained_glass: 棕色染色玻璃 + brown_stained_glass_pane: 棕色染色玻璃板 + brown_terracotta: 棕色陶瓦 + brown_wool: 棕色羊毛 + bubble_column: 气泡柱 + bubble_coral: 气泡珊瑚 + bubble_coral_block: 气泡珊瑚块 + bubble_coral_fan: 气泡珊瑚扇 + bubble_coral_wall_fan: 墙上的气泡珊瑚扇 + budding_amethyst: 紫水晶母岩 + cactus: 仙人掌 + cake: 蛋糕 + calcite: 方解石 + calibrated_sculk_sensor: 校频幽匿感测体 + campfire: 营火 + candle: 蜡烛 + candle_cake: 插上蜡烛的蛋糕 + carrots: 胡萝卜 + cartography_table: 制图台 + carved_pumpkin: 雕刻南瓜 + cauldron: 炼药锅 + cave_air: 洞穴空气 + cave_vines: 洞穴藤蔓 + cave_vines_plant: 洞穴藤蔓植株 + chain: 锁链 + chain_command_block: 连锁型命令方块 + cherry_button: 樱花木按钮 + cherry_door: 樱花木门 + cherry_fence: 樱花木栅栏 + cherry_fence_gate: 樱花木栅栏门 + cherry_hanging_sign: 悬挂式樱花木告示牌 + cherry_leaves: 樱花树叶 + cherry_log: 樱花原木 + cherry_planks: 樱花木板 + cherry_pressure_plate: 樱花木压力板 + cherry_sapling: 樱花树苗 + cherry_sign: 樱花木告示牌 + cherry_slab: 樱花木台阶 + cherry_stairs: 樱花木楼梯 + cherry_trapdoor: 樱花木活板门 + cherry_wall_hanging_sign: 墙上的悬挂式樱花木告示牌 + cherry_wall_sign: 墙上的樱花木告示牌 + cherry_wood: 樱花木 + chest: 箱子 + chipped_anvil: 开裂的铁砧 + chiseled_bookshelf: 雕纹书架 + chiseled_deepslate: 雕纹深板岩 + chiseled_nether_bricks: 雕纹下界砖块 + chiseled_polished_blackstone: 雕纹磨制黑石 + chiseled_quartz_block: 雕纹石英块 + chiseled_red_sandstone: 雕纹红砂岩 + chiseled_sandstone: 雕纹砂岩 + chiseled_stone_bricks: 雕纹石砖 + chorus_flower: 紫颂花 + chorus_plant: 紫颂植株 + clay: 黏土块 + coal_block: 煤炭块 + coal_ore: 煤矿石 + coarse_dirt: 砂土 + cobbled_deepslate: 深板岩圆石 + cobbled_deepslate_slab: 深板岩圆石台阶 + cobbled_deepslate_stairs: 深板岩圆石楼梯 + cobbled_deepslate_wall: 深板岩圆石墙 + cobblestone: 圆石 + cobblestone_slab: 圆石台阶 + cobblestone_stairs: 圆石楼梯 + cobblestone_wall: 圆石墙 + cobweb: 蜘蛛网 + cocoa: 可可果 + command_block: 命令方块 + comparator: 红石比较器 + composter: 堆肥桶 + conduit: 潮涌核心 + copper_block: 铜块 + copper_ore: 铜矿石 + cornflower: 矢车菊 + cracked_deepslate_bricks: 裂纹深板岩砖 + cracked_deepslate_tiles: 裂纹深板岩瓦 + cracked_nether_bricks: 裂纹下界砖块 + cracked_polished_blackstone_bricks: 裂纹磨制黑石砖 + cracked_stone_bricks: 裂纹石砖 + crafting_table: 工作台 + creeper_head: 苦力怕的头 + creeper_wall_head: 墙上的苦力怕的头 + crimson_button: 绯红木按钮 + crimson_door: 绯红木门 + crimson_fence: 绯红木栅栏 + crimson_fence_gate: 绯红木栅栏门 + crimson_fungus: 绯红菌 + crimson_hanging_sign: 悬挂式绯红木告示牌 + crimson_hyphae: 绯红菌核 + crimson_nylium: 绯红菌岩 + crimson_planks: 绯红木板 + crimson_pressure_plate: 绯红木压力板 + crimson_roots: 绯红菌索 + crimson_sign: 绯红木告示牌 + crimson_slab: 绯红木台阶 + crimson_stairs: 绯红木楼梯 + crimson_stem: 绯红菌柄 + crimson_trapdoor: 绯红木活板门 + crimson_wall_hanging_sign: 墙上的悬挂式绯红木告示牌 + crimson_wall_sign: 墙上的绯红木告示牌 + crying_obsidian: 哭泣的黑曜石 + cut_copper: 切制铜块 + cut_copper_slab: 切制铜台阶 + cut_copper_stairs: 切制铜楼梯 + cut_red_sandstone: 切制红砂岩 + cut_red_sandstone_slab: 切制红砂岩台阶 + cut_sandstone: 切制砂岩 + cut_sandstone_slab: 切制砂岩台阶 + cyan_banner: 青色旗帜 + cyan_bed: 青色床 + cyan_candle: 青色蜡烛 + cyan_candle_cake: 插上青色蜡烛的蛋糕 + cyan_carpet: 青色地毯 + cyan_concrete: 青色混凝土 + cyan_concrete_powder: 青色混凝土粉末 + cyan_glazed_terracotta: 青色带釉陶瓦 + cyan_shulker_box: 青色潜影盒 + cyan_stained_glass: 青色染色玻璃 + cyan_stained_glass_pane: 青色染色玻璃板 + cyan_terracotta: 青色陶瓦 + cyan_wool: 青色羊毛 + damaged_anvil: 损坏的铁砧 + dandelion: 蒲公英 + dark_oak_button: 深色橡木按钮 + dark_oak_door: 深色橡木门 + dark_oak_fence: 深色橡木栅栏 + dark_oak_fence_gate: 深色橡木栅栏门 + dark_oak_hanging_sign: 悬挂式深色橡木告示牌 + dark_oak_leaves: 深色橡树树叶 + dark_oak_log: 深色橡木原木 + dark_oak_planks: 深色橡木木板 + dark_oak_pressure_plate: 深色橡木压力板 + dark_oak_sapling: 深色橡树树苗 + dark_oak_sign: 深色橡木告示牌 + dark_oak_slab: 深色橡木台阶 + dark_oak_stairs: 深色橡木楼梯 + dark_oak_trapdoor: 深色橡木活板门 + dark_oak_wall_hanging_sign: 墙上的悬挂式深色橡木告示牌 + dark_oak_wall_sign: 墙上的深色橡木告示牌 + dark_oak_wood: 深色橡木 + dark_prismarine: 暗海晶石 + dark_prismarine_slab: 暗海晶石台阶 + dark_prismarine_stairs: 暗海晶石楼梯 + daylight_detector: 阳光探测器 + dead_brain_coral: 失活的脑纹珊瑚 + dead_brain_coral_block: 失活的脑纹珊瑚块 + dead_brain_coral_fan: 失活的脑纹珊瑚扇 + dead_brain_coral_wall_fan: 墙上的失活脑纹珊瑚扇 + dead_bubble_coral: 失活的气泡珊瑚 + dead_bubble_coral_block: 失活的气泡珊瑚块 + dead_bubble_coral_fan: 失活的气泡珊瑚扇 + dead_bubble_coral_wall_fan: 墙上的失活气泡珊瑚扇 + dead_bush: 枯萎的灌木 + dead_fire_coral: 失活的火珊瑚 + dead_fire_coral_block: 失活的火珊瑚块 + dead_fire_coral_fan: 失活的火珊瑚扇 + dead_fire_coral_wall_fan: 墙上的失活火珊瑚扇 + dead_horn_coral: 失活的鹿角珊瑚 + dead_horn_coral_block: 失活的鹿角珊瑚块 + dead_horn_coral_fan: 失活的鹿角珊瑚扇 + dead_horn_coral_wall_fan: 墙上的失活鹿角珊瑚扇 + dead_tube_coral: 失活的管珊瑚 + dead_tube_coral_block: 失活的管珊瑚块 + dead_tube_coral_fan: 失活的管珊瑚扇 + dead_tube_coral_wall_fan: 墙上的失活管珊瑚扇 + decorated_pot: 饰纹陶罐 + deepslate: 深板岩 + deepslate_brick_slab: 深板岩砖台阶 + deepslate_brick_stairs: 深板岩砖楼梯 + deepslate_brick_wall: 深板岩砖墙 + deepslate_bricks: 深板岩砖 + deepslate_coal_ore: 深层煤矿石 + deepslate_copper_ore: 深层铜矿石 + deepslate_diamond_ore: 深层钻石矿石 + deepslate_emerald_ore: 深层绿宝石矿石 + deepslate_gold_ore: 深层金矿石 + deepslate_iron_ore: 深层铁矿石 + deepslate_lapis_ore: 深层青金石矿石 + deepslate_redstone_ore: 深层红石矿石 + deepslate_tile_slab: 深板岩瓦台阶 + deepslate_tile_stairs: 深板岩瓦楼梯 + deepslate_tile_wall: 深板岩瓦墙 + deepslate_tiles: 深板岩瓦 + detector_rail: 探测铁轨 + diamond_block: 钻石块 + diamond_ore: 钻石矿石 + diorite: 闪长岩 + diorite_slab: 闪长岩台阶 + diorite_stairs: 闪长岩楼梯 + diorite_wall: 闪长岩墙 + dirt: 泥土 + dirt_path: 土径 + dispenser: 发射器 + dragon_egg: 龙蛋 + dragon_head: 龙首 + dragon_wall_head: 墙上的龙首 + dried_kelp_block: 干海带块 + dripstone_block: 滴水石块 + dropper: 投掷器 + emerald_block: 绿宝石块 + emerald_ore: 绿宝石矿石 + enchanting_table: 附魔台 + end_gateway: 末地折跃门 + end_portal: 末地传送门 + end_portal_frame: 末地传送门框架 + end_rod: 末地烛 + end_stone: 末地石 + end_stone_brick_slab: 末地石砖台阶 + end_stone_brick_stairs: 末地石砖楼梯 + end_stone_brick_wall: 末地石砖墙 + end_stone_bricks: 末地石砖 + ender_chest: 末影箱 + exposed_copper: 斑驳的铜块 + exposed_cut_copper: 斑驳的切制铜块 + exposed_cut_copper_slab: 斑驳的切制铜台阶 + exposed_cut_copper_stairs: 斑驳的切制铜楼梯 + farmland: 耕地 + fern: 蕨 + fire: 火 + fire_coral: 火珊瑚 + fire_coral_block: 火珊瑚块 + fire_coral_fan: 火珊瑚扇 + fire_coral_wall_fan: 墙上的火珊瑚扇 + fletching_table: 制箭台 + flower_pot: 花盆 + flowering_azalea: 盛开的杜鹃花丛 + flowering_azalea_leaves: 盛开的杜鹃树叶 + frogspawn: 青蛙卵 + frosted_ice: 霜冰 + furnace: 熔炉 + gilded_blackstone: 镶金黑石 + glass: 玻璃 + glass_pane: 玻璃板 + glow_lichen: 发光地衣 + glowstone: 荧石 + gold_block: 金块 + gold_ore: 金矿石 + granite: 花岗岩 + granite_slab: 花岗岩台阶 + granite_stairs: 花岗岩楼梯 + granite_wall: 花岗岩墙 + grass: 草 + grass_block: 草方块 + gravel: 沙砾 + gray_banner: 灰色旗帜 + gray_bed: 灰色床 + gray_candle: 灰色蜡烛 + gray_candle_cake: 插上灰色蜡烛的蛋糕 + gray_carpet: 灰色地毯 + gray_concrete: 灰色混凝土 + gray_concrete_powder: 灰色混凝土粉末 + gray_glazed_terracotta: 灰色带釉陶瓦 + gray_shulker_box: 灰色潜影盒 + gray_stained_glass: 灰色染色玻璃 + gray_stained_glass_pane: 灰色染色玻璃板 + gray_terracotta: 灰色陶瓦 + gray_wool: 灰色羊毛 + green_banner: 绿色旗帜 + green_bed: 绿色床 + green_candle: 绿色蜡烛 + green_candle_cake: 插上绿色蜡烛的蛋糕 + green_carpet: 绿色地毯 + green_concrete: 绿色混凝土 + green_concrete_powder: 绿色混凝土粉末 + green_glazed_terracotta: 绿色带釉陶瓦 + green_shulker_box: 绿色潜影盒 + green_stained_glass: 绿色染色玻璃 + green_stained_glass_pane: 绿色染色玻璃板 + green_terracotta: 绿色陶瓦 + green_wool: 绿色羊毛 + grindstone: 砂轮 + hanging_roots: 垂根 + hay_block: 干草捆 + heavy_weighted_pressure_plate: 重质测重压力板 + honey_block: 蜂蜜块 + honeycomb_block: 蜜脾块 + hopper: 漏斗 + horn_coral: 鹿角珊瑚 + horn_coral_block: 鹿角珊瑚块 + horn_coral_fan: 鹿角珊瑚扇 + horn_coral_wall_fan: 墙上的鹿角珊瑚扇 + ice: 冰 + infested_chiseled_stone_bricks: 虫蚀雕纹石砖 + infested_cobblestone: 虫蚀圆石 + infested_cracked_stone_bricks: 虫蚀裂纹石砖 + infested_deepslate: 虫蚀深板岩 + infested_mossy_stone_bricks: 虫蚀苔石砖 + infested_stone: 虫蚀石头 + infested_stone_bricks: 虫蚀石砖 + iron_bars: 铁栏杆 + iron_block: 铁块 + iron_door: 铁门 + iron_ore: 铁矿石 + iron_trapdoor: 铁活板门 + jack_o_lantern: 南瓜灯 + jigsaw: 拼图方块 + jukebox: 唱片机 + jungle_button: 丛林木按钮 + jungle_door: 丛林木门 + jungle_fence: 丛林木栅栏 + jungle_fence_gate: 丛林木栅栏门 + jungle_hanging_sign: 悬挂式丛林木告示牌 + jungle_leaves: 丛林树叶 + jungle_log: 丛林原木 + jungle_planks: 丛林木板 + jungle_pressure_plate: 丛林木压力板 + jungle_sapling: 丛林树苗 + jungle_sign: 丛林木告示牌 + jungle_slab: 丛林木台阶 + jungle_stairs: 丛林木楼梯 + jungle_trapdoor: 丛林木活板门 + jungle_wall_hanging_sign: 墙上的悬挂式丛林木告示牌 + jungle_wall_sign: 墙上的丛林木告示牌 + jungle_wood: 丛林木 + kelp: 海带 + kelp_plant: 海带植株 + ladder: 梯子 + lantern: 灯笼 + lapis_block: 青金石块 + lapis_ore: 青金石矿石 + large_amethyst_bud: 大型紫晶芽 + large_fern: 大型蕨 + lava: 熔岩 + lava_cauldron: 装有熔岩的炼药锅 + lectern: 讲台 + lever: 拉杆 + light: 光源方块 + light_blue_banner: 淡蓝色旗帜 + light_blue_bed: 淡蓝色床 + light_blue_candle: 淡蓝色蜡烛 + light_blue_candle_cake: 插上淡蓝色蜡烛的蛋糕 + light_blue_carpet: 淡蓝色地毯 + light_blue_concrete: 淡蓝色混凝土 + light_blue_concrete_powder: 淡蓝色混凝土粉末 + light_blue_glazed_terracotta: 淡蓝色带釉陶瓦 + light_blue_shulker_box: 淡蓝色潜影盒 + light_blue_stained_glass: 淡蓝色染色玻璃 + light_blue_stained_glass_pane: 淡蓝色染色玻璃板 + light_blue_terracotta: 淡蓝色陶瓦 + light_blue_wool: 淡蓝色羊毛 + light_gray_banner: 淡灰色旗帜 + light_gray_bed: 淡灰色床 + light_gray_candle: 淡灰色蜡烛 + light_gray_candle_cake: 插上淡灰色蜡烛的蛋糕 + light_gray_carpet: 淡灰色地毯 + light_gray_concrete: 淡灰色混凝土 + light_gray_concrete_powder: 淡灰色混凝土粉末 + light_gray_glazed_terracotta: 淡灰色带釉陶瓦 + light_gray_shulker_box: 淡灰色潜影盒 + light_gray_stained_glass: 淡灰色染色玻璃 + light_gray_stained_glass_pane: 淡灰色染色玻璃板 + light_gray_terracotta: 淡灰色陶瓦 + light_gray_wool: 淡灰色羊毛 + light_weighted_pressure_plate: 轻质测重压力板 + lightning_rod: 避雷针 + lilac: 丁香 + lily_of_the_valley: 铃兰 + lily_pad: 睡莲 + lime_banner: 黄绿色旗帜 + lime_bed: 黄绿色床 + lime_candle: 黄绿色蜡烛 + lime_candle_cake: 插上黄绿色蜡烛的蛋糕 + lime_carpet: 黄绿色地毯 + lime_concrete: 黄绿色混凝土 + lime_concrete_powder: 黄绿色混凝土粉末 + lime_glazed_terracotta: 黄绿色带釉陶瓦 + lime_shulker_box: 黄绿色潜影盒 + lime_stained_glass: 黄绿色染色玻璃 + lime_stained_glass_pane: 黄绿色染色玻璃板 + lime_terracotta: 黄绿色陶瓦 + lime_wool: 黄绿色羊毛 + lodestone: 磁石 + loom: 织布机 + magenta_banner: 品红色旗帜 + magenta_bed: 品红色床 + magenta_candle: 品红色蜡烛 + magenta_candle_cake: 插上品红色蜡烛的蛋糕 + magenta_carpet: 品红色地毯 + magenta_concrete: 品红色混凝土 + magenta_concrete_powder: 品红色混凝土粉末 + magenta_glazed_terracotta: 品红色带釉陶瓦 + magenta_shulker_box: 品红色潜影盒 + magenta_stained_glass: 品红色染色玻璃 + magenta_stained_glass_pane: 品红色染色玻璃板 + magenta_terracotta: 品红色陶瓦 + magenta_wool: 品红色羊毛 + magma_block: 岩浆块 + mangrove_button: 红树木按钮 + mangrove_door: 红树木门 + mangrove_fence: 红树木栅栏 + mangrove_fence_gate: 红树木栅栏门 + mangrove_hanging_sign: 悬挂式红树木告示牌 + mangrove_leaves: 红树树叶 + mangrove_log: 红树原木 + mangrove_planks: 红树木板 + mangrove_pressure_plate: 红树木压力板 + mangrove_propagule: 红树胎生苗 + mangrove_roots: 红树根 + mangrove_sign: 红树木告示牌 + mangrove_slab: 红树木台阶 + mangrove_stairs: 红树木楼梯 + mangrove_trapdoor: 红树木活板门 + mangrove_wall_hanging_sign: 墙上的悬挂式红树木告示牌 + mangrove_wall_sign: 墙上的红树木告示牌 + mangrove_wood: 红树木 + medium_amethyst_bud: 中型紫晶芽 + melon: 西瓜 + melon_stem: 西瓜茎 + moss_block: 苔藓块 + moss_carpet: 覆地苔藓 + mossy_cobblestone: 苔石 + mossy_cobblestone_slab: 苔石台阶 + mossy_cobblestone_stairs: 苔石楼梯 + mossy_cobblestone_wall: 苔石墙 + mossy_stone_brick_slab: 苔石砖台阶 + mossy_stone_brick_stairs: 苔石砖楼梯 + mossy_stone_brick_wall: 苔石砖墙 + mossy_stone_bricks: 苔石砖 + moving_piston: 移动的活塞 + mud: 泥巴 + mud_brick_slab: 泥砖台阶 + mud_brick_stairs: 泥砖楼梯 + mud_brick_wall: 泥砖墙 + mud_bricks: 泥砖 + muddy_mangrove_roots: 沾泥的红树根 + mushroom_stem: 蘑菇柄 + mycelium: 菌丝体 + nether_brick_fence: 下界砖栅栏 + nether_brick_slab: 下界砖台阶 + nether_brick_stairs: 下界砖楼梯 + nether_brick_wall: 下界砖墙 + nether_bricks: 下界砖块 + nether_gold_ore: 下界金矿石 + nether_portal: 下界传送门 + nether_quartz_ore: 下界石英矿石 + nether_sprouts: 下界苗 + nether_wart: 下界疣 + nether_wart_block: 下界疣块 + netherite_block: 下界合金块 + netherrack: 下界岩 + note_block: 音符盒 + oak_button: 橡木按钮 + oak_door: 橡木门 + oak_fence: 橡木栅栏 + oak_fence_gate: 橡木栅栏门 + oak_hanging_sign: 悬挂式橡木告示牌 + oak_leaves: 橡树树叶 + oak_log: 橡木原木 + oak_planks: 橡木木板 + oak_pressure_plate: 橡木压力板 + oak_sapling: 橡树树苗 + oak_sign: 橡木告示牌 + oak_slab: 橡木台阶 + oak_stairs: 橡木楼梯 + oak_trapdoor: 橡木活板门 + oak_wall_hanging_sign: 墙上的悬挂式橡木告示牌 + oak_wall_sign: 墙上的橡木告示牌 + oak_wood: 橡木 + observer: 侦测器 + obsidian: 黑曜石 + ochre_froglight: 赭黄蛙明灯 + ominous_banner: 灾厄旗帜 + orange_banner: 橙色旗帜 + orange_bed: 橙色床 + orange_candle: 橙色蜡烛 + orange_candle_cake: 插上橙色蜡烛的蛋糕 + orange_carpet: 橙色地毯 + orange_concrete: 橙色混凝土 + orange_concrete_powder: 橙色混凝土粉末 + orange_glazed_terracotta: 橙色带釉陶瓦 + orange_shulker_box: 橙色潜影盒 + orange_stained_glass: 橙色染色玻璃 + orange_stained_glass_pane: 橙色染色玻璃板 + orange_terracotta: 橙色陶瓦 + orange_tulip: 橙色郁金香 + orange_wool: 橙色羊毛 + oxeye_daisy: 滨菊 + oxidized_copper: 氧化的铜块 + oxidized_cut_copper: 氧化的切制铜块 + oxidized_cut_copper_slab: 氧化的切制铜台阶 + oxidized_cut_copper_stairs: 氧化的切制铜楼梯 + packed_ice: 浮冰 + packed_mud: 泥坯 + pearlescent_froglight: 珠光蛙明灯 + peony: 牡丹 + petrified_oak_slab: 石化橡木台阶 + piglin_head: 猪灵的头 + piglin_wall_head: 墙上的猪灵的头 + pink_banner: 粉红色旗帜 + pink_bed: 粉红色床 + pink_candle: 粉红色蜡烛 + pink_candle_cake: 插上粉红色蜡烛的蛋糕 + pink_carpet: 粉红色地毯 + pink_concrete: 粉红色混凝土 + pink_concrete_powder: 粉红色混凝土粉末 + pink_glazed_terracotta: 粉红色带釉陶瓦 + pink_petals: 粉红色花簇 + pink_shulker_box: 粉红色潜影盒 + pink_stained_glass: 粉红色染色玻璃 + pink_stained_glass_pane: 粉红色染色玻璃板 + pink_terracotta: 粉红色陶瓦 + pink_tulip: 粉红色郁金香 + pink_wool: 粉红色羊毛 + piston: 活塞 + piston_head: 活塞头 + pitcher_crop: 瓶子草植株 + pitcher_plant: 瓶子草 + player_head: 玩家的头 + player_wall_head: 墙上的玩家的头 + podzol: 灰化土 + pointed_dripstone: 滴水石锥 + polished_andesite: 磨制安山岩 + polished_andesite_slab: 磨制安山岩台阶 + polished_andesite_stairs: 磨制安山岩楼梯 + polished_basalt: 磨制玄武岩 + polished_blackstone: 磨制黑石 + polished_blackstone_brick_slab: 磨制黑石砖台阶 + polished_blackstone_brick_stairs: 磨制黑石砖楼梯 + polished_blackstone_brick_wall: 磨制黑石砖墙 + polished_blackstone_bricks: 磨制黑石砖 + polished_blackstone_button: 磨制黑石按钮 + polished_blackstone_pressure_plate: 磨制黑石压力板 + polished_blackstone_slab: 磨制黑石台阶 + polished_blackstone_stairs: 磨制黑石楼梯 + polished_blackstone_wall: 磨制黑石墙 + polished_deepslate: 磨制深板岩 + polished_deepslate_slab: 磨制深板岩台阶 + polished_deepslate_stairs: 磨制深板岩楼梯 + polished_deepslate_wall: 磨制深板岩墙 + polished_diorite: 磨制闪长岩 + polished_diorite_slab: 磨制闪长岩台阶 + polished_diorite_stairs: 磨制闪长岩楼梯 + polished_granite: 磨制花岗岩 + polished_granite_slab: 磨制花岗岩台阶 + polished_granite_stairs: 磨制花岗岩楼梯 + poppy: 虞美人 + potatoes: 马铃薯 + potted_acacia_sapling: 金合欢树苗盆栽 + potted_allium: 绒球葱盆栽 + potted_azalea_bush: 杜鹃花丛盆栽 + potted_azure_bluet: 蓝花美耳草盆栽 + potted_bamboo: 竹子盆栽 + potted_birch_sapling: 白桦树苗盆栽 + potted_blue_orchid: 兰花盆栽 + potted_brown_mushroom: 棕色蘑菇盆栽 + potted_cactus: 仙人掌盆栽 + potted_cherry_sapling: 樱花树苗盆栽 + potted_cornflower: 矢车菊盆栽 + potted_crimson_fungus: 绯红菌盆栽 + potted_crimson_roots: 绯红菌索盆栽 + potted_dandelion: 蒲公英盆栽 + potted_dark_oak_sapling: 深色橡树树苗盆栽 + potted_dead_bush: 枯萎的灌木盆栽 + potted_fern: 蕨盆栽 + potted_flowering_azalea_bush: 盛开的杜鹃花丛盆栽 + potted_jungle_sapling: 丛林树苗盆栽 + potted_lily_of_the_valley: 铃兰盆栽 + potted_mangrove_propagule: 红树胎生苗盆栽 + potted_oak_sapling: 橡树树苗盆栽 + potted_orange_tulip: 橙色郁金香盆栽 + potted_oxeye_daisy: 滨菊盆栽 + potted_pink_tulip: 粉红色郁金香盆栽 + potted_poppy: 虞美人盆栽 + potted_red_mushroom: 红色蘑菇盆栽 + potted_red_tulip: 红色郁金香盆栽 + potted_spruce_sapling: 云杉树苗盆栽 + potted_torchflower: 火把花盆栽 + potted_warped_fungus: 诡异菌盆栽 + potted_warped_roots: 诡异菌索盆栽 + potted_white_tulip: 白色郁金香盆栽 + potted_wither_rose: 凋灵玫瑰盆栽 + powder_snow: 细雪 + powder_snow_cauldron: 装有细雪的炼药锅 + powered_rail: 动力铁轨 + prismarine: 海晶石 + prismarine_brick_slab: 海晶石砖台阶 + prismarine_brick_stairs: 海晶石砖楼梯 + prismarine_bricks: 海晶石砖 + prismarine_slab: 海晶石台阶 + prismarine_stairs: 海晶石楼梯 + prismarine_wall: 海晶石墙 + pumpkin: 南瓜 + pumpkin_stem: 南瓜茎 + purple_banner: 紫色旗帜 + purple_bed: 紫色床 + purple_candle: 紫色蜡烛 + purple_candle_cake: 插上紫色蜡烛的蛋糕 + purple_carpet: 紫色地毯 + purple_concrete: 紫色混凝土 + purple_concrete_powder: 紫色混凝土粉末 + purple_glazed_terracotta: 紫色带釉陶瓦 + purple_shulker_box: 紫色潜影盒 + purple_stained_glass: 紫色染色玻璃 + purple_stained_glass_pane: 紫色染色玻璃板 + purple_terracotta: 紫色陶瓦 + purple_wool: 紫色羊毛 + purpur_block: 紫珀块 + purpur_pillar: 紫珀柱 + purpur_slab: 紫珀台阶 + purpur_stairs: 紫珀楼梯 + quartz_block: 石英块 + quartz_bricks: 石英砖 + quartz_pillar: 石英柱 + quartz_slab: 石英台阶 + quartz_stairs: 石英楼梯 + rail: 铁轨 + raw_copper_block: 粗铜块 + raw_gold_block: 粗金块 + raw_iron_block: 粗铁块 + red_banner: 红色旗帜 + red_bed: 红色床 + red_candle: 红色蜡烛 + red_candle_cake: 插上红色蜡烛的蛋糕 + red_carpet: 红色地毯 + red_concrete: 红色混凝土 + red_concrete_powder: 红色混凝土粉末 + red_glazed_terracotta: 红色带釉陶瓦 + red_mushroom: 红色蘑菇 + red_mushroom_block: 红色蘑菇方块 + red_nether_brick_slab: 红色下界砖台阶 + red_nether_brick_stairs: 红色下界砖楼梯 + red_nether_brick_wall: 红色下界砖墙 + red_nether_bricks: 红色下界砖块 + red_sand: 红沙 + red_sandstone: 红砂岩 + red_sandstone_slab: 红砂岩台阶 + red_sandstone_stairs: 红砂岩楼梯 + red_sandstone_wall: 红砂岩墙 + red_shulker_box: 红色潜影盒 + red_stained_glass: 红色染色玻璃 + red_stained_glass_pane: 红色染色玻璃板 + red_terracotta: 红色陶瓦 + red_tulip: 红色郁金香 + red_wool: 红色羊毛 + redstone_block: 红石块 + redstone_lamp: 红石灯 + redstone_ore: 红石矿石 + redstone_torch: 红石火把 + redstone_wall_torch: 墙上的红石火把 + redstone_wire: 红石线 + reinforced_deepslate: 强化深板岩 + repeater: 红石中继器 + repeating_command_block: 循环型命令方块 + respawn_anchor: 重生锚 + rooted_dirt: 缠根泥土 + rose_bush: 玫瑰丛 + sand: 沙子 + sandstone: 砂岩 + sandstone_slab: 砂岩台阶 + sandstone_stairs: 砂岩楼梯 + sandstone_wall: 砂岩墙 + scaffolding: 脚手架 + sculk: 幽匿块 + sculk_catalyst: 幽匿催发体 + sculk_sensor: 幽匿感测体 + sculk_shrieker: 幽匿尖啸体 + sculk_vein: 幽匿脉络 + sea_lantern: 海晶灯 + sea_pickle: 海泡菜 + seagrass: 海草 + set_spawn: 已设置重生点 + shroomlight: 菌光体 + shulker_box: 潜影盒 + skeleton_skull: 骷髅头颅 + skeleton_wall_skull: 墙上的骷髅头颅 + slime_block: 黏液块 + small_amethyst_bud: 小型紫晶芽 + small_dripleaf: 小型垂滴叶 + smithing_table: 锻造台 + smoker: 烟熏炉 + smooth_basalt: 平滑玄武岩 + smooth_quartz: 平滑石英块 + smooth_quartz_slab: 平滑石英台阶 + smooth_quartz_stairs: 平滑石英楼梯 + smooth_red_sandstone: 平滑红砂岩 + smooth_red_sandstone_slab: 平滑红砂岩台阶 + smooth_red_sandstone_stairs: 平滑红砂岩楼梯 + smooth_sandstone: 平滑砂岩 + smooth_sandstone_slab: 平滑砂岩台阶 + smooth_sandstone_stairs: 平滑砂岩楼梯 + smooth_stone: 平滑石头 + smooth_stone_slab: 平滑石头台阶 + sniffer_egg: 嗅探兽蛋 + snow: 雪 + snow_block: 雪块 + soul_campfire: 灵魂营火 + soul_fire: 灵魂火 + soul_lantern: 灵魂灯笼 + soul_sand: 灵魂沙 + soul_soil: 灵魂土 + soul_torch: 灵魂火把 + soul_wall_torch: 墙上的灵魂火把 + spawner: 刷怪笼 + sponge: 海绵 + spore_blossom: 孢子花 + spruce_button: 云杉木按钮 + spruce_door: 云杉木门 + spruce_fence: 云杉木栅栏 + spruce_fence_gate: 云杉木栅栏门 + spruce_hanging_sign: 悬挂式云杉木告示牌 + spruce_leaves: 云杉树叶 + spruce_log: 云杉原木 + spruce_planks: 云杉木板 + spruce_pressure_plate: 云杉木压力板 + spruce_sapling: 云杉树苗 + spruce_sign: 云杉木告示牌 + spruce_slab: 云杉木台阶 + spruce_stairs: 云杉木楼梯 + spruce_trapdoor: 云杉木活板门 + spruce_wall_hanging_sign: 墙上的悬挂式云杉木告示牌 + spruce_wall_sign: 墙上的云杉木告示牌 + spruce_wood: 云杉木 + sticky_piston: 黏性活塞 + stone: 石头 + stone_brick_slab: 石砖台阶 + stone_brick_stairs: 石砖楼梯 + stone_brick_wall: 石砖墙 + stone_bricks: 石砖 + stone_button: 石头按钮 + stone_pressure_plate: 石头压力板 + stone_slab: 石头台阶 + stone_stairs: 石头楼梯 + stonecutter: 切石机 + stripped_acacia_log: 去皮金合欢原木 + stripped_acacia_wood: 去皮金合欢木 + stripped_bamboo_block: 去皮竹块 + stripped_birch_log: 去皮白桦原木 + stripped_birch_wood: 去皮白桦木 + stripped_cherry_log: 去皮樱花原木 + stripped_cherry_wood: 去皮樱花木 + stripped_crimson_hyphae: 去皮绯红菌核 + stripped_crimson_stem: 去皮绯红菌柄 + stripped_dark_oak_log: 去皮深色橡木原木 + stripped_dark_oak_wood: 去皮深色橡木 + stripped_jungle_log: 去皮丛林原木 + stripped_jungle_wood: 去皮丛林木 + stripped_mangrove_log: 去皮红树原木 + stripped_mangrove_wood: 去皮红树木 + stripped_oak_log: 去皮橡木原木 + stripped_oak_wood: 去皮橡木 + stripped_spruce_log: 去皮云杉原木 + stripped_spruce_wood: 去皮云杉木 + stripped_warped_hyphae: 去皮诡异菌核 + stripped_warped_stem: 去皮诡异菌柄 + structure_block: 结构方块 + structure_void: 结构空位 + sugar_cane: 甘蔗 + sunflower: 向日葵 + suspicious_gravel: 可疑的沙砾 + suspicious_sand: 可疑的沙子 + sweet_berry_bush: 甜浆果丛 + tall_grass: 高草丛 + tall_seagrass: 高海草 + target: 标靶 + terracotta: 陶瓦 + tinted_glass: 遮光玻璃 + tnt: TNT + torch: 火把 + torchflower: 火把花 + torchflower_crop: 火把花植株 + trapped_chest: 陷阱箱 + tripwire: 绊线 + tripwire_hook: 绊线钩 + tube_coral: 管珊瑚 + tube_coral_block: 管珊瑚块 + tube_coral_fan: 管珊瑚扇 + tube_coral_wall_fan: 墙上的管珊瑚扇 + tuff: 凝灰岩 + turtle_egg: 海龟蛋 + twisting_vines: 缠怨藤 + twisting_vines_plant: 缠怨藤植株 + verdant_froglight: 青翠蛙明灯 + vine: 藤蔓 + void_air: 虚空空气 + wall_torch: 墙上的火把 + warped_button: 诡异木按钮 + warped_door: 诡异木门 + warped_fence: 诡异木栅栏 + warped_fence_gate: 诡异木栅栏门 + warped_fungus: 诡异菌 + warped_hanging_sign: 悬挂式诡异木告示牌 + warped_hyphae: 诡异菌核 + warped_nylium: 诡异菌岩 + warped_planks: 诡异木板 + warped_pressure_plate: 诡异木压力板 + warped_roots: 诡异菌索 + warped_sign: 诡异木告示牌 + warped_slab: 诡异木台阶 + warped_stairs: 诡异木楼梯 + warped_stem: 诡异菌柄 + warped_trapdoor: 诡异木活板门 + warped_wall_hanging_sign: 墙上的悬挂式诡异木告示牌 + warped_wall_sign: 墙上的诡异木告示牌 + warped_wart_block: 诡异疣块 + water: 水 + water_cauldron: 装有水的炼药锅 + waxed_copper_block: 涂蜡的铜块 + waxed_cut_copper: 涂蜡的切制铜块 + waxed_cut_copper_slab: 涂蜡的切制铜台阶 + waxed_cut_copper_stairs: 涂蜡的切制铜楼梯 + waxed_exposed_copper: 涂蜡的斑驳铜块 + waxed_exposed_cut_copper: 涂蜡的斑驳切制铜块 + waxed_exposed_cut_copper_slab: 涂蜡的斑驳切制铜台阶 + waxed_exposed_cut_copper_stairs: 涂蜡的斑驳切制铜楼梯 + waxed_oxidized_copper: 涂蜡的氧化铜块 + waxed_oxidized_cut_copper: 涂蜡的氧化切制铜块 + waxed_oxidized_cut_copper_slab: 涂蜡的氧化切制铜台阶 + waxed_oxidized_cut_copper_stairs: 涂蜡的氧化切制铜楼梯 + waxed_weathered_copper: 涂蜡的锈蚀铜块 + waxed_weathered_cut_copper: 涂蜡的锈蚀切制铜块 + waxed_weathered_cut_copper_slab: 涂蜡的锈蚀切制铜台阶 + waxed_weathered_cut_copper_stairs: 涂蜡的锈蚀切制铜楼梯 + weathered_copper: 锈蚀的铜块 + weathered_cut_copper: 锈蚀的切制铜块 + weathered_cut_copper_slab: 锈蚀的切制铜台阶 + weathered_cut_copper_stairs: 锈蚀的切制铜楼梯 + weeping_vines: 垂泪藤 + weeping_vines_plant: 垂泪藤植株 + wet_sponge: 湿海绵 + wheat: 小麦 + white_banner: 白色旗帜 + white_bed: 白色床 + white_candle: 白色蜡烛 + white_candle_cake: 插上白色蜡烛的蛋糕 + white_carpet: 白色地毯 + white_concrete: 白色混凝土 + white_concrete_powder: 白色混凝土粉末 + white_glazed_terracotta: 白色带釉陶瓦 + white_shulker_box: 白色潜影盒 + white_stained_glass: 白色染色玻璃 + white_stained_glass_pane: 白色染色玻璃板 + white_terracotta: 白色陶瓦 + white_tulip: 白色郁金香 + white_wool: 白色羊毛 + wither_rose: 凋灵玫瑰 + wither_skeleton_skull: 凋灵骷髅头颅 + wither_skeleton_wall_skull: 墙上的凋灵骷髅头颅 + yellow_banner: 黄色旗帜 + yellow_bed: 黄色床 + yellow_candle: 黄色蜡烛 + yellow_candle_cake: 插上黄色蜡烛的蛋糕 + yellow_carpet: 黄色地毯 + yellow_concrete: 黄色混凝土 + yellow_concrete_powder: 黄色混凝土粉末 + yellow_glazed_terracotta: 黄色带釉陶瓦 + yellow_shulker_box: 黄色潜影盒 + yellow_stained_glass: 黄色染色玻璃 + yellow_stained_glass_pane: 黄色染色玻璃板 + yellow_terracotta: 黄色陶瓦 + yellow_wool: 黄色羊毛 + zombie_head: 僵尸的头 + zombie_wall_head: 墙上的僵尸的头 + acacia_boat: 金合欢木船 + acacia_chest_boat: 金合欢木运输船 + allay_spawn_egg: 悦灵刷怪蛋 + amethyst_shard: 紫水晶碎片 + angler_pottery_shard: 垂钓纹样陶片 + angler_pottery_sherd: 垂钓纹样陶片 + apple: 苹果 + archer_pottery_shard: 弓箭纹样陶片 + archer_pottery_sherd: 弓箭纹样陶片 + armor_stand: 盔甲架 + arms_up_pottery_shard: 举臂纹样陶片 + arms_up_pottery_sherd: 举臂纹样陶片 + arrow: 箭 + axolotl_bucket: 美西螈桶 + axolotl_spawn_egg: 美西螈刷怪蛋 + baked_potato: 烤马铃薯 + bamboo_chest_raft: 运输竹筏 + bamboo_raft: 竹筏 + bat_spawn_egg: 蝙蝠刷怪蛋 + bee_spawn_egg: 蜜蜂刷怪蛋 + beef: 生牛肉 + beetroot: 甜菜根 + beetroot_seeds: 甜菜种子 + beetroot_soup: 甜菜汤 + birch_boat: 白桦木船 + birch_chest_boat: 白桦木运输船 + black_dye: 黑色染料 + blade_pottery_shard: 利刃纹样陶片 + blade_pottery_sherd: 利刃纹样陶片 + blaze_powder: 烈焰粉 + blaze_rod: 烈焰棒 + blaze_spawn_egg: 烈焰人刷怪蛋 + blue_dye: 蓝色染料 + bone: 骨头 + bone_meal: 骨粉 + book: 书 + bow: 弓 + bowl: 碗 + bread: 面包 + brewer_pottery_shard: 佳酿纹样陶片 + brewer_pottery_sherd: 佳酿纹样陶片 + brick: 红砖 + brown_dye: 棕色染料 + brush: 刷子 + bucket: 铁桶 + bundle: 收纳袋 + burn_pottery_shard: 烈焰纹样陶片 + burn_pottery_sherd: 烈焰纹样陶片 + camel_spawn_egg: 骆驼刷怪蛋 + carrot: 胡萝卜 + carrot_on_a_stick: 胡萝卜钓竿 + cat_spawn_egg: 猫刷怪蛋 + cave_spider_spawn_egg: 洞穴蜘蛛刷怪蛋 + chainmail_boots: 锁链靴子 + chainmail_chestplate: 锁链胸甲 + chainmail_helmet: 锁链头盔 + chainmail_leggings: 锁链护腿 + charcoal: 木炭 + cherry_boat: 樱花木船 + cherry_chest_boat: 樱花木运输船 + chest_minecart: 运输矿车 + chicken: 生鸡肉 + chicken_spawn_egg: 鸡刷怪蛋 + chorus_fruit: 紫颂果 + clay_ball: 黏土球 + clock: 时钟 + coal: 煤炭 + coast_armor_trim_smithing_template: 锻造模板 + cocoa_beans: 可可豆 + cod: 生鳕鱼 + cod_bucket: 鳕鱼桶 + cod_spawn_egg: 鳕鱼刷怪蛋 + command_block_minecart: 命令方块矿车 + compass: 指南针 + cooked_beef: 牛排 + cooked_chicken: 熟鸡肉 + cooked_cod: 熟鳕鱼 + cooked_mutton: 熟羊肉 + cooked_porkchop: 熟猪排 + cooked_rabbit: 熟兔肉 + cooked_salmon: 熟鲑鱼 + cookie: 曲奇 + copper_ingot: 铜锭 + cow_spawn_egg: 牛刷怪蛋 + creeper_banner_pattern: 旗帜图案 + creeper_spawn_egg: 苦力怕刷怪蛋 + crossbow: 弩 + cyan_dye: 青色染料 + danger_pottery_shard: 危机纹样陶片 + danger_pottery_sherd: 危机纹样陶片 + dark_oak_boat: 深色橡木船 + dark_oak_chest_boat: 深色橡木运输船 + debug_stick: 调试棒 + diamond: 钻石 + diamond_axe: 钻石斧 + diamond_boots: 钻石靴子 + diamond_chestplate: 钻石胸甲 + diamond_helmet: 钻石头盔 + diamond_hoe: 钻石锄 + diamond_horse_armor: 钻石马铠 + diamond_leggings: 钻石护腿 + diamond_pickaxe: 钻石镐 + diamond_shovel: 钻石锹 + diamond_sword: 钻石剑 + disc_fragment_5: 唱片残片 + dolphin_spawn_egg: 海豚刷怪蛋 + donkey_spawn_egg: 驴刷怪蛋 + dragon_breath: 龙息 + dried_kelp: 干海带 + drowned_spawn_egg: 溺尸刷怪蛋 + dune_armor_trim_smithing_template: 锻造模板 + echo_shard: 回响碎片 + egg: 鸡蛋 + elder_guardian_spawn_egg: 远古守卫者刷怪蛋 + elytra: 鞘翅 + emerald: 绿宝石 + enchanted_book: 附魔书 + enchanted_golden_apple: 附魔金苹果 + end_crystal: 末地水晶 + ender_dragon_spawn_egg: 末影龙刷怪蛋 + ender_eye: 末影之眼 + ender_pearl: 末影珍珠 + enderman_spawn_egg: 末影人刷怪蛋 + endermite_spawn_egg: 末影螨刷怪蛋 + evoker_spawn_egg: 唤魔者刷怪蛋 + experience_bottle: 附魔之瓶 + explorer_pottery_shard: 探险纹样陶片 + explorer_pottery_sherd: 探险纹样陶片 + eye_armor_trim_smithing_template: 锻造模板 + feather: 羽毛 + fermented_spider_eye: 发酵蛛眼 + filled_map: 地图 + fire_charge: 火焰弹 + firework_rocket: 烟花火箭 + firework_star: 烟火之星 + fishing_rod: 钓鱼竿 + flint: 燧石 + flint_and_steel: 打火石 + flower_banner_pattern: 旗帜图案 + fox_spawn_egg: 狐狸刷怪蛋 + friend_pottery_shard: 挚友纹样陶片 + friend_pottery_sherd: 挚友纹样陶片 + frog_spawn_egg: 青蛙刷怪蛋 + furnace_minecart: 动力矿车 + ghast_spawn_egg: 恶魂刷怪蛋 + ghast_tear: 恶魂之泪 + glass_bottle: 玻璃瓶 + glistering_melon_slice: 闪烁的西瓜片 + globe_banner_pattern: 旗帜图案 + glow_berries: 发光浆果 + glow_ink_sac: 荧光墨囊 + glow_item_frame: 荧光物品展示框 + glow_squid_spawn_egg: 发光鱿鱼刷怪蛋 + glowstone_dust: 荧石粉 + goat_horn: 山羊角 + goat_spawn_egg: 山羊刷怪蛋 + gold_ingot: 金锭 + gold_nugget: 金粒 + golden_apple: 金苹果 + golden_axe: 金斧 + golden_boots: 金靴子 + golden_carrot: 金胡萝卜 + golden_chestplate: 金胸甲 + golden_helmet: 金头盔 + golden_hoe: 金锄 + golden_horse_armor: 金马铠 + golden_leggings: 金护腿 + golden_pickaxe: 金镐 + golden_shovel: 金锹 + golden_sword: 金剑 + gray_dye: 灰色染料 + green_dye: 绿色染料 + guardian_spawn_egg: 守卫者刷怪蛋 + gunpowder: 火药 + heart_of_the_sea: 海洋之心 + heart_pottery_shard: 爱心纹样陶片 + heart_pottery_sherd: 爱心纹样陶片 + heartbreak_pottery_shard: 心碎纹样陶片 + heartbreak_pottery_sherd: 心碎纹样陶片 + hoglin_spawn_egg: 疣猪兽刷怪蛋 + honey_bottle: 蜂蜜瓶 + honeycomb: 蜜脾 + hopper_minecart: 漏斗矿车 + horse_spawn_egg: 马刷怪蛋 + host_armor_trim_smithing_template: 锻造模板 + howl_pottery_shard: 狼嚎纹样陶片 + howl_pottery_sherd: 狼嚎纹样陶片 + husk_spawn_egg: 尸壳刷怪蛋 + ink_sac: 墨囊 + iron_axe: 铁斧 + iron_boots: 铁靴子 + iron_chestplate: 铁胸甲 + iron_golem_spawn_egg: 铁傀儡刷怪蛋 + iron_helmet: 铁头盔 + iron_hoe: 铁锄 + iron_horse_armor: 铁马铠 + iron_ingot: 铁锭 + iron_leggings: 铁护腿 + iron_nugget: 铁粒 + iron_pickaxe: 铁镐 + iron_shovel: 铁锹 + iron_sword: 铁剑 + item_frame: 物品展示框 + jungle_boat: 丛林木船 + jungle_chest_boat: 丛林木运输船 + knowledge_book: 知识之书 + lapis_lazuli: 青金石 + lava_bucket: 熔岩桶 + lead: 拴绳 + leather: 皮革 + leather_boots: 皮革靴子 + leather_chestplate: 皮革外套 + leather_helmet: 皮革帽子 + leather_horse_armor: 皮革马铠 + leather_leggings: 皮革裤子 + light_blue_dye: 淡蓝色染料 + light_gray_dye: 淡灰色染料 + lime_dye: 黄绿色染料 + lingering_potion: 滞留药水 + llama_spawn_egg: 羊驼刷怪蛋 + lodestone_compass: 磁石指针 + magenta_dye: 品红色染料 + magma_cream: 岩浆膏 + magma_cube_spawn_egg: 岩浆怪刷怪蛋 + mangrove_boat: 红树木船 + mangrove_chest_boat: 红树木运输船 + map: 空地图 + melon_seeds: 西瓜种子 + melon_slice: 西瓜片 + milk_bucket: 奶桶 + minecart: 矿车 + miner_pottery_shard: 采矿纹样陶片 + miner_pottery_sherd: 采矿纹样陶片 + mojang_banner_pattern: 旗帜图案 + mooshroom_spawn_egg: 哞菇刷怪蛋 + mourner_pottery_shard: 悲恸纹样陶片 + mourner_pottery_sherd: 悲恸纹样陶片 + mule_spawn_egg: 骡刷怪蛋 + mushroom_stew: 蘑菇煲 + music_disc_11: 音乐唱片 + music_disc_13: 音乐唱片 + music_disc_5: 音乐唱片 + music_disc_blocks: 音乐唱片 + music_disc_cat: 音乐唱片 + music_disc_chirp: 音乐唱片 + music_disc_far: 音乐唱片 + music_disc_mall: 音乐唱片 + music_disc_mellohi: 音乐唱片 + music_disc_otherside: 音乐唱片 + music_disc_pigstep: 音乐唱片 + music_disc_relic: 音乐唱片 + music_disc_stal: 音乐唱片 + music_disc_strad: 音乐唱片 + music_disc_wait: 音乐唱片 + music_disc_ward: 音乐唱片 + mutton: 生羊肉 + name_tag: 命名牌 + nautilus_shell: 鹦鹉螺壳 + nether_brick: 下界砖 + nether_star: 下界之星 + netherite_axe: 下界合金斧 + netherite_boots: 下界合金靴子 + netherite_chestplate: 下界合金胸甲 + netherite_helmet: 下界合金头盔 + netherite_hoe: 下界合金锄 + netherite_ingot: 下界合金锭 + netherite_leggings: 下界合金护腿 + netherite_pickaxe: 下界合金镐 + netherite_scrap: 下界合金碎片 + netherite_shovel: 下界合金锹 + netherite_sword: 下界合金剑 + netherite_upgrade_smithing_template: 锻造模板 + oak_boat: 橡木船 + oak_chest_boat: 橡木运输船 + ocelot_spawn_egg: 豹猫刷怪蛋 + orange_dye: 橙色染料 + painting: 画 + panda_spawn_egg: 熊猫刷怪蛋 + paper: 纸 + parrot_spawn_egg: 鹦鹉刷怪蛋 + phantom_membrane: 幻翼膜 + phantom_spawn_egg: 幻翼刷怪蛋 + pig_spawn_egg: 猪刷怪蛋 + piglin_banner_pattern: 旗帜图案 + piglin_brute_spawn_egg: 猪灵蛮兵刷怪蛋 + piglin_spawn_egg: 猪灵刷怪蛋 + pillager_spawn_egg: 掠夺者刷怪蛋 + pink_dye: 粉红色染料 + pitcher_pod: 瓶子草荚果 + plenty_pottery_shard: 富饶纹样陶片 + plenty_pottery_sherd: 富饶纹样陶片 + poisonous_potato: 毒马铃薯 + polar_bear_spawn_egg: 北极熊刷怪蛋 + popped_chorus_fruit: 爆裂紫颂果 + porkchop: 生猪排 + potato: 马铃薯 + potion: 药水 + pottery_shard_archer: 弓箭纹样陶片 + pottery_shard_arms_up: 举臂纹样陶片 + pottery_shard_prize: 珍宝纹样陶片 + pottery_shard_skull: 头颅纹样陶片 + powder_snow_bucket: 细雪桶 + prismarine_crystals: 海晶砂粒 + prismarine_shard: 海晶碎片 + prize_pottery_shard: 珍宝纹样陶片 + prize_pottery_sherd: 珍宝纹样陶片 + pufferfish: 河豚 + pufferfish_bucket: 河豚桶 + pufferfish_spawn_egg: 河豚刷怪蛋 + pumpkin_pie: 南瓜派 + pumpkin_seeds: 南瓜种子 + purple_dye: 紫色染料 + quartz: 下界石英 + rabbit: 生兔肉 + rabbit_foot: 兔子脚 + rabbit_hide: 兔子皮 + rabbit_spawn_egg: 兔子刷怪蛋 + rabbit_stew: 兔肉煲 + raiser_armor_trim_smithing_template: 锻造模板 + ravager_spawn_egg: 劫掠兽刷怪蛋 + raw_copper: 粗铜 + raw_gold: 粗金 + raw_iron: 粗铁 + recovery_compass: 追溯指针 + red_dye: 红色染料 + redstone: 红石粉 + rib_armor_trim_smithing_template: 锻造模板 + rotten_flesh: 腐肉 + saddle: 鞍 + salmon: 生鲑鱼 + salmon_bucket: 鲑鱼桶 + salmon_spawn_egg: 鲑鱼刷怪蛋 + scute: 鳞甲 + sentry_armor_trim_smithing_template: 锻造模板 + shaper_armor_trim_smithing_template: 锻造模板 + sheaf_pottery_shard: 麦捆纹样陶片 + sheaf_pottery_sherd: 麦捆纹样陶片 + shears: 剪刀 + sheep_spawn_egg: 绵羊刷怪蛋 + shelter_pottery_shard: 树荫纹样陶片 + shelter_pottery_sherd: 树荫纹样陶片 + shield: 盾牌 + shulker_shell: 潜影壳 + shulker_spawn_egg: 潜影贝刷怪蛋 + sign: 告示牌 + silence_armor_trim_smithing_template: 锻造模板 + silverfish_spawn_egg: 蠹虫刷怪蛋 + skeleton_horse_spawn_egg: 骷髅马刷怪蛋 + skeleton_spawn_egg: 骷髅刷怪蛋 + skull_banner_pattern: 旗帜图案 + skull_pottery_shard: 头颅纹样陶片 + skull_pottery_sherd: 头颅纹样陶片 + slime_ball: 黏液球 + slime_spawn_egg: 史莱姆刷怪蛋 + smithing_template: 锻造模板 + sniffer_spawn_egg: 嗅探兽刷怪蛋 + snort_pottery_shard: 嗅探纹样陶片 + snort_pottery_sherd: 嗅探纹样陶片 + snout_armor_trim_smithing_template: 锻造模板 + snow_golem_spawn_egg: 雪傀儡刷怪蛋 + snowball: 雪球 + spectral_arrow: 光灵箭 + spider_eye: 蜘蛛眼 + spider_spawn_egg: 蜘蛛刷怪蛋 + spire_armor_trim_smithing_template: 锻造模板 + splash_potion: 喷溅药水 + spruce_boat: 云杉木船 + spruce_chest_boat: 云杉木运输船 + spyglass: 望远镜 + squid_spawn_egg: 鱿鱼刷怪蛋 + stick: 木棍 + stone_axe: 石斧 + stone_hoe: 石锄 + stone_pickaxe: 石镐 + stone_shovel: 石锹 + stone_sword: 石剑 + stray_spawn_egg: 流浪者刷怪蛋 + strider_spawn_egg: 炽足兽刷怪蛋 + string: 线 + sugar: 糖 + suspicious_stew: 谜之炖菜 + sweet_berries: 甜浆果 + tadpole_bucket: 蝌蚪桶 + tadpole_spawn_egg: 蝌蚪刷怪蛋 + tide_armor_trim_smithing_template: 锻造模板 + tipped_arrow: 药箭 + tnt_minecart: TNT矿车 + torchflower_seeds: 火把花种子 + totem_of_undying: 不死图腾 + trader_llama_spawn_egg: 行商羊驼刷怪蛋 + trident: 三叉戟 + tropical_fish: 热带鱼 + tropical_fish_bucket: 热带鱼桶 + tropical_fish_spawn_egg: 热带鱼刷怪蛋 + turtle_helmet: 海龟壳 + turtle_spawn_egg: 海龟刷怪蛋 + vex_armor_trim_smithing_template: 锻造模板 + vex_spawn_egg: 恼鬼刷怪蛋 + villager_spawn_egg: 村民刷怪蛋 + vindicator_spawn_egg: 卫道士刷怪蛋 + wandering_trader_spawn_egg: 流浪商人刷怪蛋 + ward_armor_trim_smithing_template: 锻造模板 + warden_spawn_egg: 监守者刷怪蛋 + warped_fungus_on_a_stick: 诡异菌钓竿 + water_bucket: 水桶 + wayfinder_armor_trim_smithing_template: 锻造模板 + wheat_seeds: 小麦种子 + white_dye: 白色染料 + wild_armor_trim_smithing_template: 锻造模板 + witch_spawn_egg: 女巫刷怪蛋 + wither_skeleton_spawn_egg: 凋灵骷髅刷怪蛋 + wither_spawn_egg: 凋灵刷怪蛋 + wolf_spawn_egg: 狼刷怪蛋 + wooden_axe: 木斧 + wooden_hoe: 木锄 + wooden_pickaxe: 木镐 + wooden_shovel: 木锹 + wooden_sword: 木剑 + writable_book: 书与笔 + written_book: 成书 + yellow_dye: 黄色染料 + zoglin_spawn_egg: 僵尸疣猪兽刷怪蛋 + zombie_horse_spawn_egg: 僵尸马刷怪蛋 + zombie_spawn_egg: 僵尸刷怪蛋 + zombie_villager_spawn_egg: 僵尸村民刷怪蛋 + zombified_piglin_spawn_egg: 僵尸猪灵刷怪蛋 +Enchantment: + aqua_affinity: 水下速掘 + bane_of_arthropods: 节肢杀手 + binding_curse: 绑定诅咒 + blast_protection: 爆炸保护 + channeling: 引雷 + depth_strider: 深海探索者 + efficiency: 效率 + feather_falling: 摔落缓冲 + fire_aspect: 火焰附加 + fire_protection: 火焰保护 + flame: 火矢 + fortune: 时运 + frost_walker: 冰霜行者 + impaling: 穿刺 + infinity: 无限 + knockback: 击退 + looting: 抢夺 + loyalty: 忠诚 + luck_of_the_sea: 海之眷顾 + lure: 饵钓 + mending: 经验修补 + multishot: 多重射击 + piercing: 穿透 + power: 力量 + projectile_protection: 弹射物保护 + protection: 保护 + punch: 冲击 + quick_charge: 快速装填 + respiration: 水下呼吸 + riptide: 激流 + sharpness: 锋利 + silk_touch: 精准采集 + smite: 亡灵杀手 + soul_speed: 灵魂疾行 + sweeping: 横扫之刃 + swift_sneak: 迅捷潜行 + thorns: 荆棘 + unbreaking: 耐久 + vanishing_curse: 消失诅咒 diff --git a/assets/cz.yml b/assets/cz.yml new file mode 100644 index 0000000..aa92a65 --- /dev/null +++ b/assets/cz.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: alík + area_effect_cloud: oblak s oblastí účinku + armor_stand: Stojan na zbroj + arrow: šíp + axolotl: Axolotl + bat: netopýr + bee: Včela + blaze: ohnivák + block_display: zobrazovač bloku + boat: člun + camel: velbloud + cat: kočka + cave_spider: jeskynní pavouk + chest_boat: Člun s truhlou + chest_minecart: Nákladní vozík + chicken: slepice + cod: treska + command_block_minecart: Vozík s příkazovým blokem + cow: kráva + creeper: creeper + dolphin: delfín + donkey: osel + dragon_fireball: dračí ohnivá koule + drowned: utopenec + egg: hozené vajíčko + elder_guardian: prastrážce + end_crystal: Endový krystal + ender_dragon: drak z Endu + ender_pearl: hozená endová perla + enderman: enderman + endermite: endermit + evoker: mág + evoker_fangs: mágovy tesáky + experience_bottle: hozená lahvička očarování + experience_orb: bod zkušeností + eye_of_ender: Endové oko + falling_block: nestabilní blok + falling_block_type: Padající %s + fireball: ohnivá koule + firework_rocket: Rachejtle + fishing_bobber: splávek + fox: Liška + frog: žába + furnace_minecart: Parní vozík + ghast: ghast + giant: obr + glow_item_frame: světelný rámeček + glow_squid: světélkující chobotnice + goat: koza + guardian: strážce + hoglin: hoglin + hopper_minecart: Vozík s násypkou + horse: kůň + husk: pouštní zombie + illusioner: iluzionista + interaction: Snímač interakcí + iron_golem: železný golem + item: předmět + item_display: zobrazovač předmětu + item_frame: Rámeček + killer_bunny: zabijácký králík + leash_knot: úvaz + lightning_bolt: blesk + llama: lama + llama_spit: plivnutí lamy + magma_cube: magmaslizoun + marker: Značka + minecart: Vozík + mooshroom: krávomůrka + mule: mula + ocelot: ocelot + painting: Obraz + panda: panda + parrot: papoušek + phantom: přízrak + pig: prase + piglin: piglin + piglin_brute: piglin hromotluk + pillager: nájezdník + player: hráč + polar_bear: lední medvěd + potion: Lektvar + pufferfish: Čtverzubec + rabbit: králík + ravager: Ničitel + salmon: losos + sheep: ovce + shulker: shulker + shulker_bullet: shulkerova střela + silverfish: rybenka + skeleton: kostlivec + skeleton_horse: kůň kostlivec + slime: slizoun + small_fireball: malá ohnivá koule + sniffer: čmuchal + snow_golem: sněhulák + snowball: Sněhová koule + spawner_minecart: vozík s líhní + spectral_arrow: Přízračný šíp + spider: pavouk + squid: chobotnice + stray: tulák + strider: lávouch + tadpole: pulec + text_display: zobrazovač textu + tnt: aktivované TNT + tnt_minecart: Vozík s TNT + trader_llama: Obchodníkova lama + trident: trojzubec + tropical_fish: tropická ryba + turtle: želva + vex: protiva + villager: vesničan + vindicator: mstitel + wandering_trader: Potulný obchodník + warden: vartýř + witch: čarodějnice + wither: wither + wither_skeleton: wither kostlivec + wither_skull: lebka wither kostlivce + wolf: vlk + zoglin: zoglin + zombie: zombie + zombie_horse: zombie kůň + zombie_villager: zombie vesničan + zombified_piglin: zombie piglin +PotionEffectType: + absorption: Pohlcení + bad_omen: Zlověstné znamení + blindness: Slepota + conduit_power: Vodní živel + darkness: Temnota + dolphins_grace: Delfíní přízeň + fire_resistance: Ohnivzdornost + glowing: Záření + haste: Spěch + health_boost: Zesílení zdraví + hero_of_the_village: Hrdina vesnice + hunger: Hlad + instant_damage: Okamžité zranění + instant_health: Okamžité zdraví + invisibility: Neviditelnost + jump_boost: Vyšší skoky + levitation: Levitace + luck: Štěstí + mining_fatigue: Únava z těžby + nausea: Nevolnost + night_vision: Vidění ve tmě + poison: Otrava + regeneration: Regenerace + resistance: Odolnost + saturation: Sytost + slow_falling: Snášení se + slowness: Zpomalení + speed: Svižnost + strength: Síla + unluck: Smůla + water_breathing: Podvodní dýchání + weakness: Oslabení + wither: Usychání +Material: + acacia_button: Akáciové tlačítko + acacia_door: Akáciové dveře + acacia_fence: Akáciový plot + acacia_fence_gate: Akáciová branka + acacia_hanging_sign: Akáciová závěsná cedule + acacia_leaves: Akáciové listí + acacia_log: Akáciový kmen + acacia_planks: Akáciová prkna + acacia_pressure_plate: Akáciová nášlapná deska + acacia_sapling: Sazenice akácie + acacia_sign: Akáciová cedule + acacia_slab: Akáciový půlblok + acacia_stairs: Akáciové schody + acacia_trapdoor: Akáciový poklop + acacia_wall_hanging_sign: Akáciová závěsná cedule na zdi + acacia_wall_sign: Akáciová cedule na zdi + acacia_wood: Akáciové dřevo + activator_rail: Aktivační kolej + air: Vzduch + allium: Česnek + amethyst_block: Ametystový blok + amethyst_cluster: Ametystová drúza + ancient_debris: Prastará suť + andesite: Andezit + andesite_slab: Andezitový půlblok + andesite_stairs: Andezitové schody + andesite_wall: Andezitová zídka + anvil: Kovadlina + attached_melon_stem: Připojený melounový stonek + attached_pumpkin_stem: Připojený dýňový stonek + azalea: Azalka + azalea_leaves: Listí azalky + azure_bluet: Houstonie modrá + bamboo: Bambus + bamboo_block: Bambusový blok + bamboo_button: Bambusové tlačítko + bamboo_door: Bambusové dveře + bamboo_fence: Bambusový plot + bamboo_fence_gate: Bambusová branka + bamboo_hanging_sign: Bambusová závěsná cedule + bamboo_mosaic: Bambusová mozaika + bamboo_mosaic_slab: Půlblok z bambusové mozaiky + bamboo_mosaic_stairs: Schody z bambusové mozaiky + bamboo_planks: Bambusová prkna + bamboo_pressure_plate: Bambusová nášlapná deska + bamboo_sapling: Bambusový výhonek + bamboo_sign: Bambusová cedule + bamboo_slab: Bambusový půlblok + bamboo_stairs: Bambusové schody + bamboo_trapdoor: Bambusový poklop + bamboo_wall_hanging_sign: Bambusová závěsná cedule na zdi + bamboo_wall_sign: Bambusová cedule na zdi + barrel: Sud + barrier: Bariéra + basalt: Čedič + beacon: Maják + bedrock: Podloží + bee_nest: Včelí hnízdo + beehive: Včelí úl + beetroots: Červená řepa + bell: Zvon + big_dripleaf: Velká krápenka + big_dripleaf_stem: Stonek velké krápenky + birch_button: Březové tlačítko + birch_door: Březové dveře + birch_fence: Březový plot + birch_fence_gate: Březová branka + birch_hanging_sign: Březová závěsná cedule + birch_leaves: Březové listí + birch_log: Březový kmen + birch_planks: Březová prkna + birch_pressure_plate: Březová nášlapná deska + birch_sapling: Sazenice břízy + birch_sign: Březová cedule + birch_slab: Březový půlblok + birch_stairs: Březové schody + birch_trapdoor: Březový poklop + birch_wall_hanging_sign: Březová závěsná cedule na zdi + birch_wall_sign: Březová cedule na zdi + birch_wood: Březové dřevo + black_banner: Černý prapor + black_bed: Černá postel + black_candle: Černá svíčka + black_candle_cake: Dort s černou svíčkou + black_carpet: Černý koberec + black_concrete: Černý beton + black_concrete_powder: Černý cement + black_glazed_terracotta: Černá glazovaná terakota + black_shulker_box: Černá shulkerova schránka + black_stained_glass: Černé sklo + black_stained_glass_pane: Tabulka černého skla + black_terracotta: Černá terakota + black_wool: Černá vlna + blackstone: Černokámen + blackstone_slab: Černokamenný půlblok + blackstone_stairs: Černokamenné schody + blackstone_wall: Černokamenná zídka + blast_furnace: Tavicí pec + blue_banner: Modrý prapor + blue_bed: Modrá postel + blue_candle: Modrá svíčka + blue_candle_cake: Dort s modrou svíčkou + blue_carpet: Modrý koberec + blue_concrete: Modrý beton + blue_concrete_powder: Modrý cement + blue_glazed_terracotta: Modrá glazovaná terakota + blue_ice: Modrý led + blue_orchid: Modrá orchidej + blue_shulker_box: Modrá shulkerova schránka + blue_stained_glass: Modré sklo + blue_stained_glass_pane: Tabulka modrého skla + blue_terracotta: Modrá terakota + blue_wool: Modrá vlna + bone_block: Kostní blok + bookshelf: Knihovna + brain_coral: Mozkový korál + brain_coral_block: Blok mozkového korálu + brain_coral_fan: Vějíř mozkového korálu + brain_coral_wall_fan: Vějíř mozkového korálu na zdi + brewing_stand: Varný stojan + brick_slab: Cihlový půlblok + brick_stairs: Cihlové schody + brick_wall: Cihlová zídka + bricks: Cihly + brown_banner: Hnědý prapor + brown_bed: Hnědá postel + brown_candle: Hnědá svíčka + brown_candle_cake: Dort s hnědou svíčkou + brown_carpet: Hnědý koberec + brown_concrete: Hnědý beton + brown_concrete_powder: Hnědý cement + brown_glazed_terracotta: Hnědá glazovaná terakota + brown_mushroom: Hřib + brown_mushroom_block: Hřibový blok + brown_shulker_box: Hnědá shulkerova schránka + brown_stained_glass: Hnědé sklo + brown_stained_glass_pane: Tabulka hnědého skla + brown_terracotta: Hnědá terakota + brown_wool: Hnědá vlna + bubble_column: Bubliny + bubble_coral: Bublinový korál + bubble_coral_block: Blok bublinového korálu + bubble_coral_fan: Vějíř bublinového korálu + bubble_coral_wall_fan: Vějíř bublinového korálu na zdi + budding_amethyst: Krystalizující ametyst + cactus: Kaktus + cake: Dort + calcite: Kalcit + calibrated_sculk_sensor: Kalibrované sculkové čidlo + campfire: Táborák + candle: Svíčka + candle_cake: Dort se svíčkou + carrots: Mrkve + cartography_table: Kartografický stůl + carved_pumpkin: Vydlabaná dýně + cauldron: Kotel + cave_air: Vzduch + cave_vines: Jeskynní liána + cave_vines_plant: Stonek jeskyní liány + chain: Řetěz + chain_command_block: Řetězový příkazový blok + cherry_button: Třešňové tlačítko + cherry_door: Třešňové dveře + cherry_fence: Třešňový plot + cherry_fence_gate: Třešňová branka + cherry_hanging_sign: Třešňová závěsná cedule + cherry_leaves: Třešňové listí + cherry_log: Třešňový kmen + cherry_planks: Třešňová prkna + cherry_pressure_plate: Třešňová nášlapná deska + cherry_sapling: Sazenice třešně + cherry_sign: Třešňová cedule + cherry_slab: Třešňový půlblok + cherry_stairs: Třešňové schody + cherry_trapdoor: Třešňový poklop + cherry_wall_hanging_sign: Třešňová závěsná cedule + cherry_wall_sign: Třešňová cedule na zdi + cherry_wood: Třešňové dřevo + chest: Truhla + chipped_anvil: Opotřebená kovadlina + chiseled_bookshelf: Vyřezávaná knihovna + chiseled_deepslate: Opracovaná břidlice + chiseled_nether_bricks: Opracované netherové cihly + chiseled_polished_blackstone: Opracovaný leštěný černokámen + chiseled_quartz_block: Opracovaný blok křemene + chiseled_red_sandstone: Opracovaný rudý pískovec + chiseled_sandstone: Opracovaný pískovec + chiseled_stone_bricks: Opracované kamenné cihly + chorus_flower: Květ chorusu + chorus_plant: Chorus + clay: Blok jílu + coal_block: Uhelný blok + coal_ore: Ložisko uhlí + coarse_dirt: Hrubá hlína + cobbled_deepslate: Břidlicové kamenivo + cobbled_deepslate_slab: Půlblok z břidlicového kameniva + cobbled_deepslate_stairs: Schody z břidlicového kameniva + cobbled_deepslate_wall: Zídka z břidlicového kameniva + cobblestone: Kamení + cobblestone_slab: Půlblok z kamení + cobblestone_stairs: Schody z kamení + cobblestone_wall: Zídka z kamení + cobweb: Pavučina + cocoa: Kakao + command_block: Příkazový blok + comparator: Redstonový porovnávač + composter: Kompostér + conduit: Zářič + copper_block: Blok mědi + copper_ore: Měděná ruda + cornflower: Chrpa + cracked_deepslate_bricks: Popraskané břidlicové cihly + cracked_deepslate_tiles: Popraskaná břidlicová dlažba + cracked_nether_bricks: Popraskané netherové cihly + cracked_polished_blackstone_bricks: Popraskané cihly z leštěného černokamene + cracked_stone_bricks: Popraskané kamenné cihly + crafting_table: Pracovní stůl + creeper_head: Hlava creepera + creeper_wall_head: Hlava creepera na zdi + crimson_button: Karmínové tlačítko + crimson_door: Karmínové dveře + crimson_fence: Karmínový plot + crimson_fence_gate: Karmínová branka + crimson_fungus: Karmínová houba + crimson_hanging_sign: Karmínová závěsná cedule + crimson_hyphae: Karmínová stélka + crimson_nylium: Karmínové podhoubí + crimson_planks: Karmínová prkna + crimson_pressure_plate: Karmínová nášlapná deska + crimson_roots: Karmínové kořínky + crimson_sign: Karmínová cedule + crimson_slab: Karmínový půlblok + crimson_stairs: Karmínové schody + crimson_stem: Karmínová třeň + crimson_trapdoor: Karmínový poklop + crimson_wall_hanging_sign: Karmínová závěsná cedule na zdi + crimson_wall_sign: Karmínová cedule na zdi + crying_obsidian: Plačící obsidián + cut_copper: Tepaná měď + cut_copper_slab: Půlblok z tepané mědi + cut_copper_stairs: Schody z tepané mědi + cut_red_sandstone: Řezaný rudý pískovec + cut_red_sandstone_slab: Půlblok řezaného rudého pískovce + cut_sandstone: Řezaný pískovec + cut_sandstone_slab: Půlblok řezaného pískovce + cyan_banner: Azurový prapor + cyan_bed: Azurová postel + cyan_candle: Azurová svíčka + cyan_candle_cake: Dort s azurovou svíčkou + cyan_carpet: Azurový koberec + cyan_concrete: Azurový beton + cyan_concrete_powder: Azurový cement + cyan_glazed_terracotta: Azurová glazovaná terakota + cyan_shulker_box: Azurová shulkerova schránka + cyan_stained_glass: Azurové sklo + cyan_stained_glass_pane: Tabulka azurového skla + cyan_terracotta: Azurová terakota + cyan_wool: Azurová vlna + damaged_anvil: Poškozená kovadlina + dandelion: Pampeliška + dark_oak_button: Tlačítko z tmavého dubu + dark_oak_door: Dveře z tmavého dubu + dark_oak_fence: Plot z tmavého dubu + dark_oak_fence_gate: Branka z tmavého dubu + dark_oak_hanging_sign: Závěsná cedule z tmavého dubu + dark_oak_leaves: Listí tmavého dubu + dark_oak_log: Kmen z tmavého dubu + dark_oak_planks: Prkna z tmavého dubu + dark_oak_pressure_plate: Nášlapná deska z tmavého dubu + dark_oak_sapling: Sazenice tmavého dubu + dark_oak_sign: Cedule z tmavého dubu + dark_oak_slab: Půlblok z tmavého dubu + dark_oak_stairs: Schody z tmavého dubu + dark_oak_trapdoor: Poklop z tmavého dubu + dark_oak_wall_hanging_sign: Závěsná cedule z tmavého dubu na zdi + dark_oak_wall_sign: Cedule z tmavého dubu na zdi + dark_oak_wood: Dřevo z tmavého dubu + dark_prismarine: Tmavý prismarín + dark_prismarine_slab: Půlblok z tmavého prismarínu + dark_prismarine_stairs: Schody z tmavého prismarínu + daylight_detector: Senzor denního světla + dead_brain_coral: Mrtvý mozkový korál + dead_brain_coral_block: Blok mrtvého mozkového korálu + dead_brain_coral_fan: Blok mrtvého mozkového korálu + dead_brain_coral_wall_fan: Mrtvý vějíř mozkového korálu na zdi + dead_bubble_coral: Mrtvý bublinový korál + dead_bubble_coral_block: Blok mrtvého bublinového korálu + dead_bubble_coral_fan: Blok mrtvého bublinového korálu + dead_bubble_coral_wall_fan: Mrtvý vějíř bublinového korálu na zdi + dead_bush: Suché křoví + dead_fire_coral: Mrtvý žahavkový korál + dead_fire_coral_block: Blok mrtvého žahavkového korálu + dead_fire_coral_fan: Blok mrtvého žahavkového korálu + dead_fire_coral_wall_fan: Mrtvý vějíř žahavkového korálu na zdi + dead_horn_coral: Mrtvý drsnatý korál + dead_horn_coral_block: Blok mrtvého drsnatého korálu + dead_horn_coral_fan: Blok mrtvého drsnatého korálu + dead_horn_coral_wall_fan: Mrtvý vějíř drsnatého korálu na zdi + dead_tube_coral: Mrtvý varhanitkový korál + dead_tube_coral_block: Blok mrtvého varhanitkového korálu + dead_tube_coral_fan: Blok mrtvého varhanitkového korálu + dead_tube_coral_wall_fan: Mrtvý vějíř varhanitkového korálu na zdi + decorated_pot: Zdobený hrnec + deepslate: Břidlice + deepslate_brick_slab: Půlblok z břidlicových cihel + deepslate_brick_stairs: Schody z břidlicových cihel + deepslate_brick_wall: Zídka z břidlicových cihel + deepslate_bricks: Břidlicové cihly + deepslate_coal_ore: Hlubinné ložisko uhlí + deepslate_copper_ore: Hlubinná měděná ruda + deepslate_diamond_ore: Hlubinné diamantové ložisko + deepslate_emerald_ore: Hlubinné smaragdové ložisko + deepslate_gold_ore: Hlubinná zlatá ruda + deepslate_iron_ore: Hlubinná železná ruda + deepslate_lapis_ore: Hlubinné ložisko lazuritu + deepslate_redstone_ore: Hlubinné redstonové ložisko + deepslate_tile_slab: Půlblok z břidlicové dlažby + deepslate_tile_stairs: Schody z břidlicové dlažby + deepslate_tile_wall: Zídka z břidlicové dlažby + deepslate_tiles: Břidlicová dlažba + detector_rail: Senzorová kolej + diamond_block: Diamantový blok + diamond_ore: Diamantové ložisko + diorite: Diorit + diorite_slab: Dioritový půlblok + diorite_stairs: Dioritové schody + diorite_wall: Dioritová zídka + dirt: Hlína + dirt_path: Pěšina + dispenser: Dávkovač + dragon_egg: Dračí vejce + dragon_head: Hlava draka + dragon_wall_head: Hlava draka na zdi + dried_kelp_block: Balík sušených chaluh + dripstone_block: Blok krápníku + dropper: Podavač + emerald_block: Smaragdový blok + emerald_ore: Smaragdové ložisko + enchanting_table: Oltář očarování + end_gateway: Brána Endu + end_portal: Portál do Endu + end_portal_frame: Rám portálu do Endu + end_rod: Enderitová tyč + end_stone: Enderit + end_stone_brick_slab: Půlblok z enderitových cihel + end_stone_brick_stairs: Schody z enderitových cihel + end_stone_brick_wall: Zídka z enderitových cihel + end_stone_bricks: Enderitové cihly + ender_chest: Enderitová truhla + exposed_copper: Měď s lehkou měděnkou + exposed_cut_copper: Tepaná měď s lehkou měděnkou + exposed_cut_copper_slab: Tepaný půlblok s lehkou měděnkou + exposed_cut_copper_stairs: Tepané schody s lehkou měděnkou + farmland: Ornice + fern: Kapradina + fire: Oheň + fire_coral: Žahavkový korál + fire_coral_block: Blok žahavkového korálu + fire_coral_fan: Vějíř žahavkového korálu + fire_coral_wall_fan: Vějíř žahavkového korálu na zdi + fletching_table: Stůl na výrobu šípů + flower_pot: Květináč + flowering_azalea: Kvetoucí azalka + flowering_azalea_leaves: Azalkové listí s květy + frogspawn: Žabí vajíčka + frosted_ice: Křehký led + furnace: Pec + gilded_blackstone: Zlatonosný černokámen + glass: Sklo + glass_pane: Tabulka skla + glow_lichen: Světélkující lišejník + glowstone: Světlit + gold_block: Blok zlata + gold_ore: Zlatá ruda + granite: Žula + granite_slab: Žulový půlblok + granite_stairs: Žulové schody + granite_wall: Žulová zídka + grass: Tráva + grass_block: Trávník + gravel: Štěrk + gray_banner: Šedý prapor + gray_bed: Šedá postel + gray_candle: Šedá svíčka + gray_candle_cake: Dort se šedou svíčkou + gray_carpet: Šedý koberec + gray_concrete: Šedý beton + gray_concrete_powder: Šedý cement + gray_glazed_terracotta: Šedá glazovaná terakota + gray_shulker_box: Šedá shulkerova schránka + gray_stained_glass: Šedé sklo + gray_stained_glass_pane: Tabulka šedého skla + gray_terracotta: Šedá terakota + gray_wool: Šedá vlna + green_banner: Zelený prapor + green_bed: Zelená postel + green_candle: Zelená svíčka + green_candle_cake: Dort se zelenou svíčkou + green_carpet: Zelený koberec + green_concrete: Zelený beton + green_concrete_powder: Zelený cement + green_glazed_terracotta: Zelená glazovaná terakota + green_shulker_box: Zelená shulkerova schránka + green_stained_glass: Zelené sklo + green_stained_glass_pane: Tabulka zeleného skla + green_terracotta: Zelená terakota + green_wool: Zelená vlna + grindstone: Brusný kámen + hanging_roots: Visící kořeny + hay_block: Balík slámy + heavy_weighted_pressure_plate: Zátěžová vážní nášlapná deska + honey_block: Blok medu + honeycomb_block: Blok medových pláství + hopper: Násypka + horn_coral: Drsnatý korál + horn_coral_block: Blok drsnatého korálu + horn_coral_fan: Vějíř drsnatého korálu + horn_coral_wall_fan: Vějíř drsnatého korálu na zdi + ice: Led + infested_chiseled_stone_bricks: Zamořené opracované kamenné cihly + infested_cobblestone: Zamořené kamení + infested_cracked_stone_bricks: Zamořené popraskané kamenné cihly + infested_deepslate: Zamořená břidlice + infested_mossy_stone_bricks: Zamořené omšelé kamenné cihly + infested_stone: Zamořený kámen + infested_stone_bricks: Zamořené kamenné cihly + iron_bars: Železné mříže + iron_block: Blok železa + iron_door: Železné dveře + iron_ore: Železná ruda + iron_trapdoor: Železný poklop + jack_o_lantern: Svítící dýně + jigsaw: Blok skládačky + jukebox: Hrací skříň + jungle_button: Tlačítko z tropického dřeva + jungle_door: Dveře z tropického dřeva + jungle_fence: Plot z tropického dřeva + jungle_fence_gate: Branka z tropického dřeva + jungle_hanging_sign: Závěsná cedule z tropického dřeva + jungle_leaves: Tropické listí + jungle_log: Kmen z tropického stromu + jungle_planks: Prkna z tropického dřeva + jungle_pressure_plate: Nášlapná deska z tropického dřeva + jungle_sapling: Sazenice tropického stromu + jungle_sign: Cedule z tropického dřeva + jungle_slab: Půlblok z tropického dřeva + jungle_stairs: Schody z tropického dřeva + jungle_trapdoor: Poklop z tropického dřeva + jungle_wall_hanging_sign: Závěsná cedule z tropického dřeva na zdi + jungle_wall_sign: Cedule z tropického dřeva na zdi + jungle_wood: Tropické dřevo + kelp: Chaluha + kelp_plant: Rostoucí chaluha + ladder: Žebřík + lantern: Lucerna + lapis_block: Blok lazuritu + lapis_ore: Ložisko lazuritu + large_amethyst_bud: Velký trs ametystů + large_fern: Velká kapradina + lava: Láva + lava_cauldron: Kotel s lávou + lectern: Čtecí pult + lever: Páka + light: Světlo + light_blue_banner: Světle modrý prapor + light_blue_bed: Světle modrá postel + light_blue_candle: Světle modrá svíčka + light_blue_candle_cake: Dort se světle modrou svíčkou + light_blue_carpet: Světle modrý koberec + light_blue_concrete: Světle modrý beton + light_blue_concrete_powder: Světle modrý cement + light_blue_glazed_terracotta: Světle modrá glazovaná terakota + light_blue_shulker_box: Světle modrá shulkerova schránka + light_blue_stained_glass: Světle modré sklo + light_blue_stained_glass_pane: Tabulka světle modrého skla + light_blue_terracotta: Světle modrá terakota + light_blue_wool: Světle modrá vlna + light_gray_banner: Světle šedý prapor + light_gray_bed: Světle šedá postel + light_gray_candle: Světle šedá svíčka + light_gray_candle_cake: Dort se světle šedou svíčkou + light_gray_carpet: Světle šedý koberec + light_gray_concrete: Světle šedý beton + light_gray_concrete_powder: Světle šedý cement + light_gray_glazed_terracotta: Světle šedá glazovaná terakota + light_gray_shulker_box: Světle šedá shulkerova schránka + light_gray_stained_glass: Světle šedé sklo + light_gray_stained_glass_pane: Tabulka světle šedého skla + light_gray_terracotta: Světle šedá terakota + light_gray_wool: Světle šedá vlna + light_weighted_pressure_plate: Citlivá vážní nášlapná deska + lightning_rod: Hromosvod + lilac: Šeřík + lily_of_the_valley: Konvalinka + lily_pad: Leknín + lime_banner: Světle zelený prapor + lime_bed: Světle zelená postel + lime_candle: Světle zelená svíčka + lime_candle_cake: Dort se světle zelenou svíčkou + lime_carpet: Světle zelený koberec + lime_concrete: Světle zelený beton + lime_concrete_powder: Světle zelený cement + lime_glazed_terracotta: Světle zelená glazovaná terakota + lime_shulker_box: Světle zelená shulkerova schránka + lime_stained_glass: Světle zelené sklo + lime_stained_glass_pane: Tabulka světle zeleného skla + lime_terracotta: Světle zelená terakota + lime_wool: Světle zelená vlna + lodestone: Navigační kámen + loom: Tkalcovský stav + magenta_banner: Purpurový prapor + magenta_bed: Purpurová postel + magenta_candle: Purpurová svíčka + magenta_candle_cake: Dort s purpurovou svíčkou + magenta_carpet: Purpurový koberec + magenta_concrete: Purpurový beton + magenta_concrete_powder: Purpurový cement + magenta_glazed_terracotta: Purpurová glazovaná terakota + magenta_shulker_box: Purpurová shulkerova schránka + magenta_stained_glass: Purpurové sklo + magenta_stained_glass_pane: Tabulka purpurového skla + magenta_terracotta: Purpurová terakota + magenta_wool: Purpurová vlna + magma_block: Blok magmatu + mangrove_button: Kořenovníkové tlačítko + mangrove_door: Kořenovníkové dveře + mangrove_fence: Kořenovníkový plot + mangrove_fence_gate: Kořenovníková branka + mangrove_hanging_sign: Kořenovníková závěsná cedule + mangrove_leaves: Kořenovníkové listí + mangrove_log: Kořenovníkový kmen + mangrove_planks: Kořenovníková prkna + mangrove_pressure_plate: Nášlapná deska z kořenovníkového dřeva + mangrove_propagule: Kořenovníkový výhonek + mangrove_roots: Kořeny kořenovníku + mangrove_sign: Kořenovníková cedule + mangrove_slab: Kořenovníkový půlblok + mangrove_stairs: Kořenovníkové schody + mangrove_trapdoor: Kořenovníkový poklop + mangrove_wall_hanging_sign: Kořenovníková závěsná cedule na zdi + mangrove_wall_sign: Kořenovníková cedule na zdi + mangrove_wood: Kořenovníkové dřevo + medium_amethyst_bud: Střední ametystový trs + melon: Meloun + melon_stem: Stonek melounu + moss_block: Blok mechu + moss_carpet: Mechový koberec + mossy_cobblestone: Kamení porostlé mechem + mossy_cobblestone_slab: Omšelý půlblok z kamení + mossy_cobblestone_stairs: Omšelé schody z kamení + mossy_cobblestone_wall: Omšelá zídka z kamení + mossy_stone_brick_slab: Omšelý půlblok z kamenných cihel + mossy_stone_brick_stairs: Omšelé schody z kamenných cihel + mossy_stone_brick_wall: Omšelá zídka z kamenných cihel + mossy_stone_bricks: Omšelé kamenné cihly + moving_piston: Pohybující se blok + mud: Bahno + mud_brick_slab: Vepřovicový půlblok + mud_brick_stairs: Vepřovicové schody + mud_brick_wall: Vepřovicová zídka + mud_bricks: Vepřovice + muddy_mangrove_roots: Zabahněné kořeny kořenovníku + mushroom_stem: Třeň + mycelium: Podhoubí + nether_brick_fence: Plot z netherových cihel + nether_brick_slab: Půlblok z netherových cihel + nether_brick_stairs: Schody z netherových cihel + nether_brick_wall: Zídka z netherových cihel + nether_bricks: Netherové cihly + nether_gold_ore: Netherová zlatá ruda + nether_portal: Portál do Netheru + nether_quartz_ore: Ložisko netherového křemene + nether_sprouts: Netherové výhonky + nether_wart: Bradavičník + nether_wart_block: Blok bradavičníku + netherite_block: Blok netheritu + netherrack: Netherová suť + note_block: Hudební blok + oak_button: Dubové tlačítko + oak_door: Dubové dveře + oak_fence: Dubový plot + oak_fence_gate: Dubová branka + oak_hanging_sign: Dubová závěsná cedule + oak_leaves: Dubové listí + oak_log: Dubový kmen + oak_planks: Dubová prkna + oak_pressure_plate: Dubová nášlapná deska + oak_sapling: Sazenice dubu + oak_sign: Dubová cedule + oak_slab: Dubový půlblok + oak_stairs: Dubové schody + oak_trapdoor: Dubový poklop + oak_wall_hanging_sign: Dubová závěsná cedule na zdi + oak_wall_sign: Dubová cedule na zdi + oak_wood: Dubové dřevo + observer: Detektor změn + obsidian: Obsidián + ochre_froglight: Okrový žabosvit + ominous_banner: Zlověstný prapor + orange_banner: Oranžový prapor + orange_bed: Oranžová postel + orange_candle: Oranžová svíčka + orange_candle_cake: Dort s oranžovou svíčkou + orange_carpet: Oranžový koberec + orange_concrete: Oranžový beton + orange_concrete_powder: Oranžový cement + orange_glazed_terracotta: Oranžová glazovaná terakota + orange_shulker_box: Oranžová shulkerova schránka + orange_stained_glass: Oranžové sklo + orange_stained_glass_pane: Tabulka oranžového skla + orange_terracotta: Oranžová terakota + orange_tulip: Oranžový tulipán + orange_wool: Oranžová vlna + oxeye_daisy: Kopretina + oxidized_copper: Měď pokrytá měděnkou + oxidized_cut_copper: Tepaná měď pokrytá měděnkou + oxidized_cut_copper_slab: Tepaný půlblok pokrytý měděnkou + oxidized_cut_copper_stairs: Tepané schody pokryté měděnkou + packed_ice: Hutný led + packed_mud: Hutné bahno + pearlescent_froglight: Perleťový žabosvit + peony: Pivoňka + petrified_oak_slab: Zkamenělý dubový půlblok + piglin_head: Hlava piglina + piglin_wall_head: Hlava piglina na zdi + pink_banner: Růžový prapor + pink_bed: Růžová postel + pink_candle: Růžová svíčka + pink_candle_cake: Dort s růžovou svíčkou + pink_carpet: Růžový koberec + pink_concrete: Růžový beton + pink_concrete_powder: Růžový cement + pink_glazed_terracotta: Růžová glazovaná terakota + pink_petals: Růžové kvítí + pink_shulker_box: Růžová shulkerova schránka + pink_stained_glass: Růžové sklo + pink_stained_glass_pane: Tabulka růžového skla + pink_terracotta: Růžová terakota + pink_tulip: Růžový tulipán + pink_wool: Růžová vlna + piston: Píst + piston_head: Hlava pístu + pitcher_crop: Rostoucí džbánovka + pitcher_plant: Džbánovka + player_head: Hlava hráče + player_wall_head: Hlava hráče na zdi + podzol: Podzol + pointed_dripstone: Špička krápníku + polished_andesite: Leštěný andezit + polished_andesite_slab: Půlblok z leštěného andezitu + polished_andesite_stairs: Schody z leštěného andezitu + polished_basalt: Leštěný čedič + polished_blackstone: Leštěný černokámen + polished_blackstone_brick_slab: Půlblok z cihel z leštěného černokamene + polished_blackstone_brick_stairs: Schody z cihel z leštěného černokamene + polished_blackstone_brick_wall: Zídka z cihel z leštěného černokamene + polished_blackstone_bricks: Cihly z leštěného černokamene + polished_blackstone_button: Tlačítko z leštěného černokamene + polished_blackstone_pressure_plate: Nášlapná deska z leštěného černokamene + polished_blackstone_slab: Půlblok z leštěného černokamene + polished_blackstone_stairs: Schody z leštěného černokamene + polished_blackstone_wall: Zídka z leštěného černokamene + polished_deepslate: Leštěná břidlice + polished_deepslate_slab: Půlblok z leštěné břidlice + polished_deepslate_stairs: Schody z leštěné břidlice + polished_deepslate_wall: Zídka z leštěné břidlice + polished_diorite: Leštěný diorit + polished_diorite_slab: Půlblok z leštěného dioritu + polished_diorite_stairs: Schody z leštěného dioritu + polished_granite: Leštěná žula + polished_granite_slab: Půlblok z leštěné žuly + polished_granite_stairs: Schody z leštěné žuly + poppy: Vlčí mák + potatoes: Brambory + potted_acacia_sapling: Sazenice akácie v květináči + potted_allium: Česnek v květináči + potted_azalea_bush: Azalka v květináči + potted_azure_bluet: Houstonie modrá v květináči + potted_bamboo: Bambus v květináči + potted_birch_sapling: Sazenice břízy v květináči + potted_blue_orchid: Modrá orchidej v květináči + potted_brown_mushroom: Hřib v květináči + potted_cactus: Kaktus v květináči + potted_cherry_sapling: Sazenice třešně v květináči + potted_cornflower: Chrpa v květináči + potted_crimson_fungus: Karmínová houba v květináči + potted_crimson_roots: Karmínové kořínky v květináči + potted_dandelion: Pampeliška v květináči + potted_dark_oak_sapling: Sazenice tmavého dubu v květináči + potted_dead_bush: Suché křoví v květináči + potted_fern: Kapradina v květináči + potted_flowering_azalea_bush: Kvetoucí azalka v květináči + potted_jungle_sapling: Sazenice tropického stromu v květináči + potted_lily_of_the_valley: Konvalinka v květináči + potted_mangrove_propagule: Kořenovníkový výhonek v květináči + potted_oak_sapling: Sazenice dubu v květináči + potted_orange_tulip: Oranžový tulipán v květináči + potted_oxeye_daisy: Kopretina v květináči + potted_pink_tulip: Růžový tulipán v květináči + potted_poppy: Vlčí mák v květináči + potted_red_mushroom: Muchomůrka v květináči + potted_red_tulip: Červený tulipán v květináči + potted_spruce_sapling: Sazenice smrku v květináči + potted_torchflower: Plamněnka v květináči + potted_warped_fungus: Přízračná houba v květináči + potted_warped_roots: Přízračné kořínky v květináči + potted_white_tulip: Bílý tulipán v květináči + potted_wither_rose: Witherova růže v květináči + powder_snow: Prašan + powder_snow_cauldron: Kotel s prašanem + powered_rail: Napájená kolej + prismarine: Prismarín + prismarine_brick_slab: Půlblok z prismarínových cihel + prismarine_brick_stairs: Schody z prismarínových cihel + prismarine_bricks: Prismarínové cihly + prismarine_slab: Prismarínový půlblok + prismarine_stairs: Prismarínové schody + prismarine_wall: Prismarínová zídka + pumpkin: Dýně + pumpkin_stem: Dýňový stonek + purple_banner: Fialový prapor + purple_bed: Fialová postel + purple_candle: Fialová svíčka + purple_candle_cake: Dort s fialovou svíčkou + purple_carpet: Fialový koberec + purple_concrete: Fialový beton + purple_concrete_powder: Fialový cement + purple_glazed_terracotta: Fialová glazovaná terakota + purple_shulker_box: Fialová shulkerova schránka + purple_stained_glass: Fialové sklo + purple_stained_glass_pane: Tabulka fialového skla + purple_terracotta: Fialová terakota + purple_wool: Fialová vlna + purpur_block: Blok purpuru + purpur_pillar: Purpurový pilíř + purpur_slab: Purpurový půlblok + purpur_stairs: Purpurové schody + quartz_block: Blok křemene + quartz_bricks: Křemenné cihly + quartz_pillar: Křemenný pilíř + quartz_slab: Křemenný půlblok + quartz_stairs: Křemenné schody + rail: Kolej + raw_copper_block: Blok vytěžené mědi + raw_gold_block: Blok vytěženého zlata + raw_iron_block: Blok vytěženého železa + red_banner: Červený prapor + red_bed: Červená postel + red_candle: Červená svíčka + red_candle_cake: Dort s červenou svíčkou + red_carpet: Červený koberec + red_concrete: Červený beton + red_concrete_powder: Červený cement + red_glazed_terracotta: Červená glazovaná terakota + red_mushroom: Muchomůrka + red_mushroom_block: Muchomůrkový blok + red_nether_brick_slab: Půlblok z rudých netherových cihel + red_nether_brick_stairs: Schody z rudých netherových cihel + red_nether_brick_wall: Zídka z rudých netherových cihel + red_nether_bricks: Rudé netherové cihly + red_sand: Rudý písek + red_sandstone: Rudý pískovec + red_sandstone_slab: Půlblok z rudého pískovce + red_sandstone_stairs: Schody z rudého pískovce + red_sandstone_wall: Zídka z rudého pískovce + red_shulker_box: Červená shulkerova schránka + red_stained_glass: Červené sklo + red_stained_glass_pane: Tabulka červeného skla + red_terracotta: Červená terakota + red_tulip: Červený tulipán + red_wool: Červená vlna + redstone_block: Redstonový blok + redstone_lamp: Redstonová lampa + redstone_ore: Redstonové ložisko + redstone_torch: Redstonová louč + redstone_wall_torch: Redstonová louč na zdi + redstone_wire: Redstonový vodič + reinforced_deepslate: Vyztužená břidlice + repeater: Redstonový zesilovač + repeating_command_block: Opakovací příkazový blok + respawn_anchor: Kotva oživení + rooted_dirt: Prorostlá hlína + rose_bush: Keř růží + sand: Písek + sandstone: Pískovec + sandstone_slab: Pískovcový půlblok + sandstone_stairs: Pískovcové schody + sandstone_wall: Pískovcová zídka + scaffolding: Lešení + sculk: Sculk + sculk_catalyst: Sculkový katalyzátor + sculk_sensor: Sculkové čidlo + sculk_shrieker: Sculkový kvílák + sculk_vein: Sculková žíla + sea_lantern: Mořská lucerna + sea_pickle: Ohnivka + seagrass: Mořská tráva + set_spawn: Místo oživení nastaveno + shroomlight: Světlohubka + shulker_box: Shulkerova schránka + skeleton_skull: Lebka kostlivce + skeleton_wall_skull: Lebka kostlivce na zdi + slime_block: Blok slizu + small_amethyst_bud: Malý trs ametystů + small_dripleaf: Malá krápenka + smithing_table: Kovářský stůl + smoker: Trouba + smooth_basalt: Hladký čedič + smooth_quartz: Blok hladkého křemene + smooth_quartz_slab: Půlblok z hladkého křemene + smooth_quartz_stairs: Schody z hladkého křemene + smooth_red_sandstone: Vyhlazený rudý pískovec + smooth_red_sandstone_slab: Půlblok z vyhlazeného rudého pískovce + smooth_red_sandstone_stairs: Schody z vyhlazeného rudého pískovce + smooth_sandstone: Vyhlazený pískovec + smooth_sandstone_slab: Půlblok z vyhlazeného pískovce + smooth_sandstone_stairs: Schody z vyhlazeného pískovce + smooth_stone: Hladký kámen + smooth_stone_slab: Půlblok z hladkého kamene + sniffer_egg: Čmuchalí vejce + snow: Sníh + snow_block: Blok sněhu + soul_campfire: Táborák s ohněm duší + soul_fire: Oheň duší + soul_lantern: Lucerna duší + soul_sand: Písek duší + soul_soil: Půda duší + soul_torch: Louč duší + soul_wall_torch: Louč duší na zdi + spawner: Líheň + sponge: Mořská houba + spore_blossom: Prášenka + spruce_button: Smrkové tlačítko + spruce_door: Smrkové dveře + spruce_fence: Smrkový plot + spruce_fence_gate: Smrková branka + spruce_hanging_sign: Smrková závěsná cedule + spruce_leaves: Smrkové jehličí + spruce_log: Smrkový kmen + spruce_planks: Smrková prkna + spruce_pressure_plate: Smrková nášlapná deska + spruce_sapling: Sazenice smrku + spruce_sign: Smrková cedule + spruce_slab: Smrkový půlblok + spruce_stairs: Smrkové schody + spruce_trapdoor: Smrkový poklop + spruce_wall_hanging_sign: Smrková závěsná cedule na zdi + spruce_wall_sign: Smrková cedule na zdi + spruce_wood: Smrkové dřevo + sticky_piston: Lepivý píst + stone: Kámen + stone_brick_slab: Půlblok z kamenných cihel + stone_brick_stairs: Schody z kamenných cihel + stone_brick_wall: Zídka z kamenných cihel + stone_bricks: Kamenné cihly + stone_button: Kamenné tlačítko + stone_pressure_plate: Kamenná nášlapná deska + stone_slab: Kamenný půlblok + stone_stairs: Kamenné schody + stonecutter: Řezačka kamene + stripped_acacia_log: Oloupaný akáciový kmen + stripped_acacia_wood: Oloupané akáciové dřevo + stripped_bamboo_block: Blok oloupaného bambusu + stripped_birch_log: Oloupaný březový kmen + stripped_birch_wood: Oloupané březové dřevo + stripped_cherry_log: Oloupaný třešňový kmen + stripped_cherry_wood: Oloupané třešňové dřevo + stripped_crimson_hyphae: Oloupaná karmínová stélka + stripped_crimson_stem: Oloupaná karmínová třeň + stripped_dark_oak_log: Oloupaný kmen z tmavého dubu + stripped_dark_oak_wood: Oloupané dřevo z tmavého dubu + stripped_jungle_log: Oloupaný kmen z tropického stromu + stripped_jungle_wood: Oloupané tropické dřevo + stripped_mangrove_log: Oloupaný kořenovníkový kmen + stripped_mangrove_wood: Oloupané kořenovníkové dřevo + stripped_oak_log: Oloupaný dubový kmen + stripped_oak_wood: Oloupané dubové dřevo + stripped_spruce_log: Oloupaný smrkový kmen + stripped_spruce_wood: Oloupané smrkové dřevo + stripped_warped_hyphae: Oloupaná přízračná stélka + stripped_warped_stem: Oloupaná přízračná třeň + structure_block: Konstrukční blok + structure_void: Konstrukční void + sugar_cane: Cukrová třtina + sunflower: Slunečnice + suspicious_gravel: Zvláštní štěrk + suspicious_sand: Zvláštní písek + sweet_berry_bush: Keř sladkých bobulí + tall_grass: Vysoká tráva + tall_seagrass: Vysoká mořská tráva + target: Terč + terracotta: Terakota + tinted_glass: Kouřové sklo + tnt: TNT + torch: Louč + torchflower: Plamněnka + torchflower_crop: Rostoucí plamněnka + trapped_chest: Nástražná truhla + tripwire: Nástražný drát + tripwire_hook: Uchycení nástražného drátu + tube_coral: Varhanitkový korál + tube_coral_block: Blok varhanitkového korálu + tube_coral_fan: Vějíř varhanitkového korálu + tube_coral_wall_fan: Vějíř varhanitkového korálu na zdi + tuff: Tuf + turtle_egg: Želví vajíčko + twisting_vines: Přízračná liána + twisting_vines_plant: Stonek přízračné liány + verdant_froglight: Nazelenalý žabosvit + vine: Liána + void_air: Vzduch + wall_torch: Louč na zdi + warped_button: Přízračné tlačítko + warped_door: Přízračné dveře + warped_fence: Přízračný plot + warped_fence_gate: Přízračná branka + warped_fungus: Přízračná houba + warped_hanging_sign: Přízračná závěsná cedule + warped_hyphae: Přízračná stélka + warped_nylium: Přízračné podhoubí + warped_planks: Přízračná prkna + warped_pressure_plate: Přízračná nášlapná deska + warped_roots: Přízračné kořínky + warped_sign: Přízračná cedule + warped_slab: Přízračný půlblok + warped_stairs: Přízračné schody + warped_stem: Přízračná třeň + warped_trapdoor: Přízračný poklop + warped_wall_hanging_sign: Přízračná závěsná cedule na zdi + warped_wall_sign: Přízračná cedule na zdi + warped_wart_block: Blok přízračného bradavičníku + water: Voda + water_cauldron: Kotel s vodou + waxed_copper_block: Navoskovaný blok mědi + waxed_cut_copper: Navoskovaná tepaná měď + waxed_cut_copper_slab: Navoskovaný půlblok z tepané mědi + waxed_cut_copper_stairs: Navoskované schody z tepané mědi + waxed_exposed_copper: Navoskovaná měď s lehkou měděnkou + waxed_exposed_cut_copper: Navoskovaná tepaná měď s lehkou měděnkou + waxed_exposed_cut_copper_slab: Navoskovaný tepaný půlblok s lehkou měděnkou + waxed_exposed_cut_copper_stairs: Navoskované tepané schody s lehkou měděnkou + waxed_oxidized_copper: Navoskovaná měď pokrytá měděnkou + waxed_oxidized_cut_copper: Navoskovaná tepaná měď pokrytá měděnkou + waxed_oxidized_cut_copper_slab: Navoskovaný půlblok pokrytý měděnkou + waxed_oxidized_cut_copper_stairs: Navoskované schody pokryté měděnkou + waxed_weathered_copper: Navoskovaná měď pokrytá střední měděnkou + waxed_weathered_cut_copper: Navoskovaná tepaná měď pokrytá střední měděnkou + waxed_weathered_cut_copper_slab: Navoskovaný tepaný půlblok pokrytý střední měděnkou + waxed_weathered_cut_copper_stairs: Navoskované tepané schody pokryté střední měděnkou + weathered_copper: Měď se střední měděnkou + weathered_cut_copper: Tepaná měď pokrytá střední měděnkou + weathered_cut_copper_slab: Tepaný půlblok pokrytý střední měděnkou + weathered_cut_copper_stairs: Tepané schody pokryté střední měděnkou + weeping_vines: Karmínová liána + weeping_vines_plant: Stonek karmínové liány + wet_sponge: Mokrá mořská houba + wheat: Pšenice + white_banner: Bílý prapor + white_bed: Bílá postel + white_candle: Bílá svíčka + white_candle_cake: Dort s bílou svíčkou + white_carpet: Bílý koberec + white_concrete: Bílý beton + white_concrete_powder: Bílý cement + white_glazed_terracotta: Bílá glazovaná terakota + white_shulker_box: Bílá shulkerova schránka + white_stained_glass: Bílé sklo + white_stained_glass_pane: Tabulka bílého skla + white_terracotta: Bílá terakota + white_tulip: Bílý tulipán + white_wool: Bílá vlna + wither_rose: Witherova růže + wither_skeleton_skull: Lebka wither kostlivce + wither_skeleton_wall_skull: Lebka wither kostlivce na zdi + yellow_banner: Žlutý prapor + yellow_bed: Žlutá postel + yellow_candle: Žlutá svíčka + yellow_candle_cake: Dort se žlutou svíčkou + yellow_carpet: Žlutý koberec + yellow_concrete: Žlutý beton + yellow_concrete_powder: Žlutý cement + yellow_glazed_terracotta: Žlutá glazovaná terakota + yellow_shulker_box: Žlutá shulkerova schránka + yellow_stained_glass: Žluté sklo + yellow_stained_glass_pane: Tabulka žlutého skla + yellow_terracotta: Žlutá terakota + yellow_wool: Žlutá vlna + zombie_head: Hlava zombie + zombie_wall_head: Hlava zombie na zdi + acacia_boat: Akáciový člun + acacia_chest_boat: Akáciový člun s truhlou + allay_spawn_egg: Vajíčko s alíkem + amethyst_shard: Ametystový střep + angler_pottery_shard: Střep s udicí + angler_pottery_sherd: Střep s udicí + apple: Jablko + archer_pottery_shard: Střep s lukem + archer_pottery_sherd: Střep s lukem + armor_stand: Stojan na zbroj + arms_up_pottery_shard: Střep s rukama nad hlavou + arms_up_pottery_sherd: Střep s rukama nad hlavou + arrow: Šíp + axolotl_bucket: Kbelík s axolotlem + axolotl_spawn_egg: Vajíčko s axolotlem + baked_potato: Pečená brambora + bamboo_chest_raft: Bambusový vor s truhlou + bamboo_raft: Bambusový vor + bat_spawn_egg: Vajíčko s netopýrem + bee_spawn_egg: Vajíčko se včelou + beef: Syrový steak + beetroot: Červená řepa + beetroot_seeds: Semínka červené řepy + beetroot_soup: Polévka z červené řepy + birch_boat: Březový člun + birch_chest_boat: Březový člun s truhlou + black_dye: Černé barvivo + blade_pottery_shard: Střep s čepelí + blade_pottery_sherd: Střep s čepelí + blaze_powder: Ohnivý prach + blaze_rod: Ohnivá hůl + blaze_spawn_egg: Vajíčko s ohnivákem + blue_dye: Modré barvivo + bone: Kost + bone_meal: Kostní moučka + book: Kniha + bow: Luk + bowl: Miska + bread: Chléb + brewer_pottery_shard: Střep s baňkou + brewer_pottery_sherd: Střep s baňkou + brick: Cihla + brown_dye: Hnědé barvivo + brush: Štěteček + bucket: Kbelík + bundle: Ranec + burn_pottery_shard: Střep s ohněm + burn_pottery_sherd: Střep s ohněm + camel_spawn_egg: Vajíčko s velbloudem + carrot: Mrkev + carrot_on_a_stick: Mrkev na prutu + cat_spawn_egg: Vajíčko s kočkou + cave_spider_spawn_egg: Vajíčko s jeskynním pavoukem + chainmail_boots: Kroužkové boty + chainmail_chestplate: Kroužková košile + chainmail_helmet: Kroužková kapuce + chainmail_leggings: Kroužkové kalhoty + charcoal: Dřevěné uhlí + cherry_boat: Třešňový člun + cherry_chest_boat: Třešňový člun s truhlou + chest_minecart: Nákladní vozík + chicken: Syrové kuře + chicken_spawn_egg: Vajíčko se slepicí + chorus_fruit: Plod chorusu + clay_ball: Hrouda jílu + clock: Hodiny + coal: Uhlí + coast_armor_trim_smithing_template: Kovářská předloha + cocoa_beans: Kakaové boby + cod: Syrová treska + cod_bucket: Kbelík s treskou + cod_spawn_egg: Vajíčko s treskou + command_block_minecart: Vozík s příkazovým blokem + compass: Kompas + cooked_beef: Propečený steak + cooked_chicken: Pečené kuře + cooked_cod: Pečená treska + cooked_mutton: Pečené skopové + cooked_porkchop: Pečená kotleta + cooked_rabbit: Pečený králík + cooked_salmon: Pečený losos + cookie: Sušenka + copper_ingot: Měděný ingot + cow_spawn_egg: Vajíčko s krávou + creeper_banner_pattern: Vzor praporu + creeper_spawn_egg: Vajíčko s creeperem + crossbow: Kuše + cyan_dye: Azurové barvivo + danger_pottery_shard: Střep s creeperem + danger_pottery_sherd: Střep s creeperem + dark_oak_boat: Člun z tmavého dubu + dark_oak_chest_boat: Člun z tmavého dubu s truhlou + debug_stick: Ladicí hůlka + diamond: Diamant + diamond_axe: Diamantová sekera + diamond_boots: Diamantové boty + diamond_chestplate: Diamantové brnění + diamond_helmet: Diamantová helma + diamond_hoe: Diamantová motyka + diamond_horse_armor: Diamantová zbroj pro koně + diamond_leggings: Diamantové kalhoty + diamond_pickaxe: Diamantový krumpáč + diamond_shovel: Diamantová lopata + diamond_sword: Diamantový meč + disc_fragment_5: Úlomek desky + dolphin_spawn_egg: Vajíčko s delfínem + donkey_spawn_egg: Vajíčko s oslem + dragon_breath: Dračí dech + dried_kelp: Sušená chaluha + drowned_spawn_egg: Vajíčko s utopencem + dune_armor_trim_smithing_template: Kovářská předloha + echo_shard: Úlomek ozvěny + egg: Vajíčko + elder_guardian_spawn_egg: Vajíčko s prastrážcem + elytra: Krovky + emerald: Smaragd + enchanted_book: Očarovaná kniha + enchanted_golden_apple: Očarované zlaté jablko + end_crystal: Endový krystal + ender_dragon_spawn_egg: Vajíčko s drakem z Endu + ender_eye: Endové oko + ender_pearl: Endová perla + enderman_spawn_egg: Vajíčko s endermanem + endermite_spawn_egg: Vajíčko s endermitem + evoker_spawn_egg: Vajíčko s mágem + experience_bottle: Lektvar očarování + explorer_pottery_shard: Střep s mapou + explorer_pottery_sherd: Střep s mapou + eye_armor_trim_smithing_template: Kovářská předloha + feather: Pírko + fermented_spider_eye: Zkvašené pavoučí oko + filled_map: Mapa + fire_charge: Ohnivá koule + firework_rocket: Rachejtle + firework_star: Ohňostrojová hvězda + fishing_rod: Rybářský prut + flint: Pazourek + flint_and_steel: Křesadlo + flower_banner_pattern: Vzor praporu + fox_spawn_egg: Vajíčko s liškou + friend_pottery_shard: Střep s vesničanem + friend_pottery_sherd: Střep s vesničanem + frog_spawn_egg: Vajíčko s žábou + furnace_minecart: Parní vozík + ghast_spawn_egg: Vajíčko s ghastem + ghast_tear: Ghastova slza + glass_bottle: Lahvička + glistering_melon_slice: Zlatavý kousek melounu + globe_banner_pattern: Vzor praporu + glow_berries: Zářinky + glow_ink_sac: Váček světélkujícího inkoustu + glow_item_frame: Světelný rámeček + glow_squid_spawn_egg: Vajíčko se světélkující chobotnicí + glowstone_dust: Světlitový prášek + goat_horn: Kozí roh + goat_spawn_egg: Vajíčko s kozou + gold_ingot: Zlatý ingot + gold_nugget: Zlatý nuget + golden_apple: Zlaté jablko + golden_axe: Zlatá sekera + golden_boots: Zlaté boty + golden_carrot: Zlatá mrkev + golden_chestplate: Zlaté brnění + golden_helmet: Zlatá helma + golden_hoe: Zlatá motyka + golden_horse_armor: Zlatá zbroj pro koně + golden_leggings: Zlaté kalhoty + golden_pickaxe: Zlatý krumpáč + golden_shovel: Zlatá lopata + golden_sword: Zlatý meč + gray_dye: Šedé barvivo + green_dye: Zelené barvivo + guardian_spawn_egg: Vajíčko se strážcem + gunpowder: Střelný prach + heart_of_the_sea: Srdce moře + heart_pottery_shard: Střep se srdcem + heart_pottery_sherd: Střep se srdcem + heartbreak_pottery_shard: Střep se zlomeným srdcem + heartbreak_pottery_sherd: Střep se zlomeným srdcem + hoglin_spawn_egg: Vajíčko s hoglinem + honey_bottle: Lahvička medu + honeycomb: Plástev medu + hopper_minecart: Vozík s násypkou + horse_spawn_egg: Vajíčko s koněm + host_armor_trim_smithing_template: Kovářská předloha + howl_pottery_shard: Střep s vlkem + howl_pottery_sherd: Střep s vlkem + husk_spawn_egg: Vajíčko s pouštní zombie + ink_sac: Váček inkoustu + iron_axe: Železná sekera + iron_boots: Železné boty + iron_chestplate: Železné brnění + iron_golem_spawn_egg: Vajíčko se železným golemem + iron_helmet: Železná helma + iron_hoe: Železná motyka + iron_horse_armor: Železná zbroj pro koně + iron_ingot: Železný ingot + iron_leggings: Železné kalhoty + iron_nugget: Železný nuget + iron_pickaxe: Železný krumpáč + iron_shovel: Železná lopata + iron_sword: Železný meč + item_frame: Rámeček + jungle_boat: Člun z tropického dřeva + jungle_chest_boat: Člun z tropického dřeva s truhlou + knowledge_book: Kniha vědění + lapis_lazuli: Lazurit + lava_bucket: Kbelík lávy + lead: Vodítko + leather: Kůže + leather_boots: Kožené boty + leather_chestplate: Kožená tunika + leather_helmet: Kožená čapka + leather_horse_armor: Kožená zbroj pro koně + leather_leggings: Kožené kalhoty + light_blue_dye: Světle modré barvivo + light_gray_dye: Světle šedé barvivo + lime_dye: Světle zelené barvivo + lingering_potion: Doznívající lektvar + llama_spawn_egg: Vajíčko s lamou + lodestone_compass: Spárovaný kompas + magenta_dye: Purpurové barvivo + magma_cream: Lávová pěna + magma_cube_spawn_egg: Vajíčko s magmaslizounem + mangrove_boat: Kořenovníkový člun + mangrove_chest_boat: Kořenovníkový člun s truhlou + map: Prázdná mapa + melon_seeds: Semínka melounu + melon_slice: Kousek melounu + milk_bucket: Mléko + minecart: Vozík + miner_pottery_shard: Střep s krumpáčem + miner_pottery_sherd: Střep s krumpáčem + mojang_banner_pattern: Vzor praporu + mooshroom_spawn_egg: Vajíčko s krávomůrkou + mourner_pottery_shard: Střep s vartýřem + mourner_pottery_sherd: Střep s vartýřem + mule_spawn_egg: Vajíčko s mulou + mushroom_stew: Houbová polévka + music_disc_11: Gramofonová deska + music_disc_13: Gramofonová deska + music_disc_5: Gramofonová deska + music_disc_blocks: Gramofonová deska + music_disc_cat: Gramofonová deska + music_disc_chirp: Gramofonová deska + music_disc_far: Gramofonová deska + music_disc_mall: Gramofonová deska + music_disc_mellohi: Gramofonová deska + music_disc_otherside: Gramofonová deska + music_disc_pigstep: Gramofonová deska + music_disc_relic: Gramofonová deska + music_disc_stal: Gramofonová deska + music_disc_strad: Gramofonová deska + music_disc_wait: Gramofonová deska + music_disc_ward: Gramofonová deska + mutton: Syrové skopové + name_tag: Jmenovka + nautilus_shell: Ulita loděnky + nether_brick: Netherová cihla + nether_star: Netherová hvězda + netherite_axe: Netheritová sekera + netherite_boots: Netheritové boty + netherite_chestplate: Netheritové brnění + netherite_helmet: Netheritová helma + netherite_hoe: Netheritová motyka + netherite_ingot: Netheritový ingot + netherite_leggings: Netheritové kalhoty + netherite_pickaxe: Netheritový krumpáč + netherite_scrap: Netheritový plátek + netherite_shovel: Netheritová lopata + netherite_sword: Netheritový meč + netherite_upgrade_smithing_template: Kovářská předloha + oak_boat: Dubový člun + oak_chest_boat: Dubový člun s truhlou + ocelot_spawn_egg: Vajíčko s ocelotem + orange_dye: Oranžové barvivo + painting: Obraz + panda_spawn_egg: Vajíčko s pandou + paper: Papír + parrot_spawn_egg: Vajíčko s papouškem + phantom_membrane: Blána přízraku + phantom_spawn_egg: Vajíčko s přízrakem + pig_spawn_egg: Vajíčko s prasetem + piglin_banner_pattern: Vzor praporu + piglin_brute_spawn_egg: Vajíčko s piglinem hromotlukem + piglin_spawn_egg: Vajíčko s piglinem + pillager_spawn_egg: Vajíčko s nájezdníkem + pink_dye: Růžové barvivo + pitcher_pod: Tobolka džbánovky + plenty_pottery_shard: Střep s truhlou + plenty_pottery_sherd: Střep s truhlou + poisonous_potato: Jedovatá brambora + polar_bear_spawn_egg: Vajíčko s ledním medvědem + popped_chorus_fruit: Vypukaný květ chorusu + porkchop: Syrová kotleta + potato: Brambora + potion: Lektvar + pottery_shard_archer: Střep s lukem + pottery_shard_arms_up: Střep s rukama nad hlavou + pottery_shard_prize: Střep s drahokamem + pottery_shard_skull: Střep s lebkou + powder_snow_bucket: Kbelík s prašanem + prismarine_crystals: Prismarínový krystal + prismarine_shard: Prismarínový střep + prize_pottery_shard: Střep s drahokamem + prize_pottery_sherd: Střep s drahokamem + pufferfish: Čtverzubec + pufferfish_bucket: Kbelík se čtverzubcem + pufferfish_spawn_egg: Vajíčko se čtverzubcem + pumpkin_pie: Dýňový koláč + pumpkin_seeds: Dýňová semínka + purple_dye: Fialové barvivo + quartz: Netherový křemen + rabbit: Syrový králík + rabbit_foot: Králičí pacička + rabbit_hide: Králičí kůže + rabbit_spawn_egg: Vajíčko s králíkem + rabbit_stew: Králičí guláš + raiser_armor_trim_smithing_template: Kovářská předloha + ravager_spawn_egg: Vajíčko s ničitelem + raw_copper: Vytěžená měď + raw_gold: Vytěžené zlato + raw_iron: Vytěžené železo + recovery_compass: Kompas návratu + red_dye: Červené barvivo + redstone: Redstonový prášek + rib_armor_trim_smithing_template: Kovářská předloha + rotten_flesh: Shnilé maso + saddle: Sedlo + salmon: Syrový losos + salmon_bucket: Kbelík s lososem + salmon_spawn_egg: Vajíčko s lososem + scute: Želví destička + sentry_armor_trim_smithing_template: Kovářská předloha + shaper_armor_trim_smithing_template: Kovářská předloha + sheaf_pottery_shard: Střep se snopem + sheaf_pottery_sherd: Střep se snopem + shears: Nůžky + sheep_spawn_egg: Vajíčko s ovcí + shelter_pottery_shard: Střep se stromem + shelter_pottery_sherd: Střep se stromem + shield: Štít + shulker_shell: Shulkerův krunýř + shulker_spawn_egg: Vajíčko se shulkerem + sign: Cedule + silence_armor_trim_smithing_template: Kovářská předloha + silverfish_spawn_egg: Vajíčko s rybenkou + skeleton_horse_spawn_egg: Vajíčko s koňským kostlivcem + skeleton_spawn_egg: Vajíčko s kostlivcem + skull_banner_pattern: Vzor praporu + skull_pottery_shard: Střep s lebkou + skull_pottery_sherd: Střep s lebkou + slime_ball: Sliz + slime_spawn_egg: Vajíčko se slizounem + smithing_template: Kovářská předloha + sniffer_spawn_egg: Vejce se čmuchalem + snort_pottery_shard: Střep s čmuchalem + snort_pottery_sherd: Střep s čmuchalem + snout_armor_trim_smithing_template: Kovářská předloha + snow_golem_spawn_egg: Vajíčko se sněhulákem + snowball: Sněhová koule + spectral_arrow: Přízračný šíp + spider_eye: Pavoučí oko + spider_spawn_egg: Vajíčko s pavoukem + spire_armor_trim_smithing_template: Kovářská předloha + splash_potion: Vrhací lektvar + spruce_boat: Smrkový člun + spruce_chest_boat: Smrkový člun s truhlou + spyglass: Dalekohled + squid_spawn_egg: Vajíčko s chobotnicí + stick: Tyčka + stone_axe: Kamenná sekera + stone_hoe: Kamenná motyka + stone_pickaxe: Kamenný krumpáč + stone_shovel: Kamenná lopata + stone_sword: Kamenný meč + stray_spawn_egg: Vajíčko s tulákem + strider_spawn_egg: Vajíčko s lávouchem + string: Vlákno + sugar: Cukr + suspicious_stew: Nevábná šlichta + sweet_berries: Sladké bobule + tadpole_bucket: Kbelík s pulcem + tadpole_spawn_egg: Vajíčko s pulcem + tide_armor_trim_smithing_template: Kovářská předloha + tipped_arrow: Namočený šíp + tnt_minecart: Vozík s TNT + torchflower_seeds: Semínka plamněnky + totem_of_undying: Totem nesmrtelnosti + trader_llama_spawn_egg: Vajíčko s obchodníkovou lamou + trident: Trojzubec + tropical_fish: Tropická ryba + tropical_fish_bucket: Kbelík s tropickou rybou + tropical_fish_spawn_egg: Vajíčko s tropickou rybou + turtle_helmet: Helma z želvoviny + turtle_spawn_egg: Vajíčko se želvou + vex_armor_trim_smithing_template: Kovářská předloha + vex_spawn_egg: Vajíčko s protivou + villager_spawn_egg: Vajíčko s vesničanem + vindicator_spawn_egg: Vajíčko se mstitelem + wandering_trader_spawn_egg: Vajíčko s potulným obchodníkem + ward_armor_trim_smithing_template: Kovářská předloha + warden_spawn_egg: Vajíčko s vartýřem + warped_fungus_on_a_stick: Přízračná houba na udici + water_bucket: Kbelík vody + wayfinder_armor_trim_smithing_template: Kovářská předloha + wheat_seeds: Semínka pšenice + white_dye: Bílé barvivo + wild_armor_trim_smithing_template: Kovářská předloha + witch_spawn_egg: Vajíčko s čarodějnicí + wither_skeleton_spawn_egg: Vajíčko s wither kostlivcem + wither_spawn_egg: Vajíčko s witherem + wolf_spawn_egg: Vajíčko s vlkem + wooden_axe: Dřevěná sekera + wooden_hoe: Dřevěná motyka + wooden_pickaxe: Dřevěný krumpáč + wooden_shovel: Dřevěná lopata + wooden_sword: Dřevěný meč + writable_book: Rozepsaná kniha s brkem + written_book: Napsaná kniha + yellow_dye: Žluté barvivo + zoglin_spawn_egg: Vajíčko se zoglinem + zombie_horse_spawn_egg: Vajíčko se zombie koněm + zombie_spawn_egg: Vajíčko se zombie + zombie_villager_spawn_egg: Vajíčko se zombie vesničanem + zombified_piglin_spawn_egg: Vajíčko se zombie piglinem +Enchantment: + aqua_affinity: Jako ryba ve vodě + bane_of_arthropods: Hmyzákova záhuba + binding_curse: Kletba spoutání + blast_protection: Ochrana proti výbuchu + channeling: Výboj + depth_strider: Rychloplavec + efficiency: Účinnost + feather_falling: Lehkost pírka + fire_aspect: Síla ohně + fire_protection: Ochrana proti ohni + flame: Plamen + fortune: Štěstí + frost_walker: Mrazík + impaling: Probodnutí + infinity: Bezedný toulec + knockback: Odražení + looting: Kořist + loyalty: Věrnost + luck_of_the_sea: Rybářské štěstí + lure: Návnada + mending: Oprava + multishot: Štěpení šípů + piercing: Průraznost + power: Síla + projectile_protection: Ochrana proti střelám + protection: Ochrana + punch: Pružné lučiště + quick_charge: Rychlonabíjení + respiration: Dýchání + riptide: Mocný záběr + sharpness: Ostrost + silk_touch: Něžný dotek + smite: Rána nemrtvým + soul_speed: Rychlost duší + sweeping: Svištivé ostří + swift_sneak: Tichošlápek + thorns: Trny + unbreaking: Nerozbitnost + vanishing_curse: Kletba zmizení diff --git a/assets/de.yml b/assets/de.yml new file mode 100644 index 0000000..943d729 --- /dev/null +++ b/assets/de.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: Hilfsgeist + area_effect_cloud: Partikelwolke + armor_stand: Rüstungsständer + arrow: Pfeil + axolotl: Axolotl + bat: Fledermaus + bee: Biene + blaze: Lohe + block_display: Blockdarsteller + boat: Boot + camel: Dromedar + cat: Katze + cave_spider: Höhlenspinne + chest_boat: Truhenboot + chest_minecart: Güterlore + chicken: Huhn + cod: Kabeljau + command_block_minecart: Befehlsblocklore + cow: Kuh + creeper: Creeper + dolphin: Delfin + donkey: Esel + dragon_fireball: Drachen-Feuerkugel + drowned: Ertrunkener + egg: Geworfenes Ei + elder_guardian: Großer Wächter + end_crystal: Enderkristall + ender_dragon: Enderdrache + ender_pearl: Geworfene Enderperle + enderman: Enderman + endermite: Endermite + evoker: Magier + evoker_fangs: Fangzähne + experience_bottle: Geworfenes Erfahrungsfläschchen + experience_orb: Erfahrungskugel + eye_of_ender: Enderauge + falling_block: Fallender Block + falling_block_type: Fallender %s + fireball: Feuerkugel + firework_rocket: Feuerwerksrakete + fishing_bobber: Schwimmer + fox: Fuchs + frog: Frosch + furnace_minecart: Ofenlore + ghast: Ghast + giant: Riese + glow_item_frame: Leuchtrahmen + glow_squid: Leuchttintenfisch + goat: Ziege + guardian: Wächter + hoglin: Hoglin + hopper_minecart: Trichterlore + horse: Pferd + husk: Wüstenzombie + illusioner: Illusionist + interaction: Interaktionsobjekt + iron_golem: Eisengolem + item: Gegenstand + item_display: Gegenstandsdarsteller + item_frame: Rahmen + killer_bunny: Das Killer-Kaninchen + leash_knot: Leinenknoten + lightning_bolt: Blitz + llama: Lama + llama_spit: Lamaspucke + magma_cube: Magmawürfel + marker: Marker + minecart: Lore + mooshroom: Mooshroom + mule: Maultier + ocelot: Ozelot + painting: Gemälde + panda: Panda + parrot: Papagei + phantom: Phantom + pig: Schwein + piglin: Piglin + piglin_brute: Piglin-Barbar + pillager: Plünderer + player: Spieler + polar_bear: Eisbär + potion: Trank + pufferfish: Kugelfisch + rabbit: Kaninchen + ravager: Verwüster + salmon: Lachs + sheep: Schaf + shulker: Shulker + shulker_bullet: Shulker-Geschoss + silverfish: Silberfischchen + skeleton: Skelett + skeleton_horse: Skelettpferd + slime: Schleim + small_fireball: Kleine Feuerkugel + sniffer: Schnüffler + snow_golem: Schneegolem + snowball: Schneeball + spawner_minecart: Spawner-Lore + spectral_arrow: Spektralpfeil + spider: Spinne + squid: Tintenfisch + stray: Eiswanderer + strider: Schreiter + tadpole: Kaulquappe + text_display: Textdarsteller + tnt: Gezündetes TNT + tnt_minecart: TNT-Lore + trader_llama: Händlerlama + trident: Dreizack + tropical_fish: Tropenfisch + turtle: Schildkröte + vex: Plagegeist + villager: Dorfbewohner + vindicator: Diener + wandering_trader: Fahrender Händler + warden: Wärter + witch: Hexe + wither: Wither + wither_skeleton: Witherskelett + wither_skull: Witherschädel + wolf: Wolf + zoglin: Zoglin + zombie: Zombie + zombie_horse: Zombiepferd + zombie_villager: Zombiedorfbewohner + zombified_piglin: Zombifizierter Piglin +PotionEffectType: + absorption: Absorption + bad_omen: Drohendes Unheil + blindness: Blindheit + conduit_power: Meereskraft + darkness: Dunkelheit + dolphins_grace: Gunst des Delfins + fire_resistance: Feuerschutz + glowing: Leuchten + haste: Eile + health_boost: Extraenergie + hero_of_the_village: Held des Dorfes + hunger: Hunger + instant_damage: Direktschaden + instant_health: Direktheilung + invisibility: Unsichtbarkeit + jump_boost: Sprungkraft + levitation: Schwebekraft + luck: Glück + mining_fatigue: Abbaulähmung + nausea: Übelkeit + night_vision: Nachtsicht + poison: Vergiftung + regeneration: Regeneration + resistance: Resistenz + saturation: Sättigung + slow_falling: Sanfter Fall + slowness: Langsamkeit + speed: Schnelligkeit + strength: Stärke + unluck: Pech + water_breathing: Unterwasseratmung + weakness: Schwäche + wither: Verdorrung +Material: + acacia_button: Akazienholzknopf + acacia_door: Akazienholztür + acacia_fence: Akazienholzzaun + acacia_fence_gate: Akazienholzzauntor + acacia_hanging_sign: Akazienholzhängeschild + acacia_leaves: Akazienlaub + acacia_log: Akazienstamm + acacia_planks: Akazienholzbretter + acacia_pressure_plate: Akazienholzdruckplatte + acacia_sapling: Akaziensetzling + acacia_sign: Akazienholzschild + acacia_slab: Akazienholzstufe + acacia_stairs: Akazienholztreppe + acacia_trapdoor: Akazienholzfalltür + acacia_wall_hanging_sign: Akazienholzwandhängeschild + acacia_wall_sign: Akazienholzwandschild + acacia_wood: Akazienholz + activator_rail: Aktivierungsschiene + air: Luft + allium: Zierlauch + amethyst_block: Amethystblock + amethyst_cluster: Amethysthaufen + ancient_debris: Antiker Schrott + andesite: Andesit + andesite_slab: Andesitstufe + andesite_stairs: Andesittreppe + andesite_wall: Andesitmauer + anvil: Amboss + attached_melon_stem: Melonenranke + attached_pumpkin_stem: Kürbisranke + azalea: Azalee + azalea_leaves: Azaleenlaub + azure_bluet: Porzellansternchen + bamboo: Bambus + bamboo_block: Bambusblock + bamboo_button: Bambusknopf + bamboo_door: Bambustür + bamboo_fence: Bambuszaun + bamboo_fence_gate: Bambuszauntor + bamboo_hanging_sign: Bambushängeschild + bamboo_mosaic: Bambusmosaik + bamboo_mosaic_slab: Bambusmosaikstufe + bamboo_mosaic_stairs: Bambusmosaiktreppe + bamboo_planks: Bambusbretter + bamboo_pressure_plate: Bambusdruckplatte + bamboo_sapling: Bambussprössling + bamboo_sign: Bambusschild + bamboo_slab: Bambusstufe + bamboo_stairs: Bambustreppe + bamboo_trapdoor: Bambusfalltür + bamboo_wall_hanging_sign: Bambuswandhängeschild + bamboo_wall_sign: Bambuswandschild + barrel: Fass + barrier: Barriere + basalt: Basalt + beacon: Leuchtfeuer + bedrock: Grundgestein + bee_nest: Bienennest + beehive: Bienenstock + beetroots: Rote Bete + bell: Glocke + big_dripleaf: Großes Tropfblatt + big_dripleaf_stem: Großer Tropfblattstiel + birch_button: Birkenholzknopf + birch_door: Birkenholztür + birch_fence: Birkenholzzaun + birch_fence_gate: Birkenholzzauntor + birch_hanging_sign: Birkenholzhängeschild + birch_leaves: Birkenlaub + birch_log: Birkenstamm + birch_planks: Birkenholzbretter + birch_pressure_plate: Birkenholzdruckplatte + birch_sapling: Birkensetzling + birch_sign: Birkenholzschild + birch_slab: Birkenholzstufe + birch_stairs: Birkenholztreppe + birch_trapdoor: Birkenholzfalltür + birch_wall_hanging_sign: Birkenholzwandhängeschild + birch_wall_sign: Birkenholzwandschild + birch_wood: Birkenholz + black_banner: Schwarzes Banner + black_bed: Schwarzes Bett + black_candle: Schwarze Kerze + black_candle_cake: Kuchen mit schwarzer Kerze + black_carpet: Schwarzer Teppich + black_concrete: Schwarzer Beton + black_concrete_powder: Schwarzer Trockenbeton + black_glazed_terracotta: Schwarze glasierte Keramik + black_shulker_box: Schwarze Shulker-Kiste + black_stained_glass: Schwarzes Glas + black_stained_glass_pane: Schwarze Glasscheibe + black_terracotta: Schwarze Keramik + black_wool: Schwarze Wolle + blackstone: Schwarzstein + blackstone_slab: Schwarzsteinstufe + blackstone_stairs: Schwarzsteintreppe + blackstone_wall: Schwarzsteinmauer + blast_furnace: Schmelzofen + blue_banner: Blaues Banner + blue_bed: Blaues Bett + blue_candle: Blaue Kerze + blue_candle_cake: Kuchen mit blauer Kerze + blue_carpet: Blauer Teppich + blue_concrete: Blauer Beton + blue_concrete_powder: Blauer Trockenbeton + blue_glazed_terracotta: Blaue glasierte Keramik + blue_ice: Blaueis + blue_orchid: Blaue Orchidee + blue_shulker_box: Blaue Shulker-Kiste + blue_stained_glass: Blaues Glas + blue_stained_glass_pane: Blaue Glasscheibe + blue_terracotta: Blaue Keramik + blue_wool: Blaue Wolle + bone_block: Knochenblock + bookshelf: Bücherregal + brain_coral: Hirnkoralle + brain_coral_block: Hirnkorallenblock + brain_coral_fan: Hirnkorallenfächer + brain_coral_wall_fan: Hirnkorallenwandfächer + brewing_stand: Braustand + brick_slab: Ziegelstufe + brick_stairs: Ziegeltreppe + brick_wall: Ziegelsteinmauer + bricks: Ziegelsteine + brown_banner: Braunes Banner + brown_bed: Braunes Bett + brown_candle: Braune Kerze + brown_candle_cake: Kuchen mit brauner Kerze + brown_carpet: Brauner Teppich + brown_concrete: Brauner Beton + brown_concrete_powder: Brauner Trockenbeton + brown_glazed_terracotta: Braune glasierte Keramik + brown_mushroom: Brauner Pilz + brown_mushroom_block: Brauner Pilzblock + brown_shulker_box: Braune Shulker-Kiste + brown_stained_glass: Braunes Glas + brown_stained_glass_pane: Braune Glasscheibe + brown_terracotta: Braune Keramik + brown_wool: Braune Wolle + bubble_column: Blasensäule + bubble_coral: Blasenkoralle + bubble_coral_block: Blasenkorallenblock + bubble_coral_fan: Blasenkorallenfächer + bubble_coral_wall_fan: Blasenkorallenwandfächer + budding_amethyst: Amethystknospenblock + cactus: Kaktus + cake: Kuchen + calcite: Kalzit + calibrated_sculk_sensor: Kalibrierter Sculk-Sensor + campfire: Lagerfeuer + candle: Kerze + candle_cake: Kuchen mit Kerze + carrots: Karotten + cartography_table: Kartentisch + carved_pumpkin: Geschnitzter Kürbis + cauldron: Kessel + cave_air: Höhlenluft + cave_vines: Höhlenranken + cave_vines_plant: Höhlenrankenpflanze + chain: Kette + chain_command_block: Ketten-Befehlsblock + cherry_button: Kirschholzknopf + cherry_door: Kirschholztür + cherry_fence: Kirschholzzaun + cherry_fence_gate: Kirschholzzauntor + cherry_hanging_sign: Kirschholzhängeschild + cherry_leaves: Kirschlaub + cherry_log: Kirschstamm + cherry_planks: Kirschholzbretter + cherry_pressure_plate: Kirschholzdruckplatte + cherry_sapling: Kirschsetzling + cherry_sign: Kirschholzschild + cherry_slab: Kirschholzstufe + cherry_stairs: Kirschholztreppe + cherry_trapdoor: Kirschholzfalltür + cherry_wall_hanging_sign: Kirschholzwandhängeschild + cherry_wall_sign: Kirschholzwandschild + cherry_wood: Kirschholz + chest: Truhe + chipped_anvil: Angeschlagener Amboss + chiseled_bookshelf: Gearbeitetes Bücherregal + chiseled_deepslate: Gemeißelter Tiefenschiefer + chiseled_nether_bricks: Gemeißelte Netherziegel + chiseled_polished_blackstone: Gemeißelter polierter Schwarzstein + chiseled_quartz_block: Gemeißelter Quarzblock + chiseled_red_sandstone: Gemeißelter roter Sandstein + chiseled_sandstone: Gemeißelter Sandstein + chiseled_stone_bricks: Gemeißelte Steinziegel + chorus_flower: Chorusblüte + chorus_plant: Choruspflanze + clay: Ton + coal_block: Kohleblock + coal_ore: Steinkohle + coarse_dirt: Grobe Erde + cobbled_deepslate: Bruchtiefenschiefer + cobbled_deepslate_slab: Bruchtiefenschieferstufe + cobbled_deepslate_stairs: Bruchtiefenschiefertreppe + cobbled_deepslate_wall: Bruchtiefenschiefermauer + cobblestone: Bruchstein + cobblestone_slab: Bruchsteinstufe + cobblestone_stairs: Bruchsteintreppe + cobblestone_wall: Bruchsteinmauer + cobweb: Spinnennetz + cocoa: Kakao + command_block: Befehlsblock + comparator: Redstone-Komparator + composter: Komposter + conduit: Aquisator + copper_block: Kupferblock + copper_ore: Kupfererz + cornflower: Kornblume + cracked_deepslate_bricks: Rissige Tiefenschieferziegel + cracked_deepslate_tiles: Rissige Tiefenschieferfliesen + cracked_nether_bricks: Rissige Netherziegel + cracked_polished_blackstone_bricks: Rissige polierte Schwarzsteinziegel + cracked_stone_bricks: Rissige Steinziegel + crafting_table: Werkbank + creeper_head: Creeperkopf + creeper_wall_head: Creeper-Wandkopf + crimson_button: Karmesinknopf + crimson_door: Karmesintür + crimson_fence: Karmesinzaun + crimson_fence_gate: Karmesinzauntor + crimson_fungus: Karmesinpilz + crimson_hanging_sign: Karmesinhängeschild + crimson_hyphae: Karmesinhyphen + crimson_nylium: Karmesin-Nezel + crimson_planks: Karmesinbretter + crimson_pressure_plate: Karmesindruckplatte + crimson_roots: Karmesinwurzeln + crimson_sign: Karmesinschild + crimson_slab: Karmesinstufe + crimson_stairs: Karmesintreppe + crimson_stem: Karmesinstiel + crimson_trapdoor: Karmesinfalltür + crimson_wall_hanging_sign: Karmesinwandhängeschild + crimson_wall_sign: Karmesinwandschild + crying_obsidian: Weinender Obsidian + cut_copper: Geschnittener Kupferblock + cut_copper_slab: Geschnittene Kupferstufe + cut_copper_stairs: Geschnittene Kupfertreppe + cut_red_sandstone: Geschnittener roter Sandstein + cut_red_sandstone_slab: Geschnittene rote Sandsteinstufe + cut_sandstone: Geschnittener Sandstein + cut_sandstone_slab: Geschnittene Sandsteinstufe + cyan_banner: Türkises Banner + cyan_bed: Türkises Bett + cyan_candle: Türkise Kerze + cyan_candle_cake: Kuchen mit türkiser Kerze + cyan_carpet: Türkiser Teppich + cyan_concrete: Türkiser Beton + cyan_concrete_powder: Türkiser Trockenbeton + cyan_glazed_terracotta: Türkise glasierte Keramik + cyan_shulker_box: Türkise Shulker-Kiste + cyan_stained_glass: Türkises Glas + cyan_stained_glass_pane: Türkise Glasscheibe + cyan_terracotta: Türkise Keramik + cyan_wool: Türkise Wolle + damaged_anvil: Beschädigter Amboss + dandelion: Löwenzahn + dark_oak_button: Schwarzeichenholzknopf + dark_oak_door: Schwarzeichenholztür + dark_oak_fence: Schwarzeichenholzzaun + dark_oak_fence_gate: Schwarzeichenholzzauntor + dark_oak_hanging_sign: Schwarzeichenholzhängeschild + dark_oak_leaves: Schwarzeichenlaub + dark_oak_log: Schwarzeichenstamm + dark_oak_planks: Schwarzeichenholzbretter + dark_oak_pressure_plate: Schwarzeichenholzdruckplatte + dark_oak_sapling: Schwarzeichensetzling + dark_oak_sign: Schwarzeichenholzschild + dark_oak_slab: Schwarzeichenholzstufe + dark_oak_stairs: Schwarzeichenholztreppe + dark_oak_trapdoor: Schwarzeichenholzfalltür + dark_oak_wall_hanging_sign: Schwarzeichenholzwandhängeschild + dark_oak_wall_sign: Schwarzeichenholzwandschild + dark_oak_wood: Schwarzeichenholz + dark_prismarine: Dunkler Prismarin + dark_prismarine_slab: Dunkle Prismarinstufe + dark_prismarine_stairs: Dunkle Prismarintreppe + daylight_detector: Tageslichtsensor + dead_brain_coral: Abgestorbene Hirnkoralle + dead_brain_coral_block: Abgestorbener Hirnkorallenblock + dead_brain_coral_fan: Abgestorbener Hirnkorallenfächer + dead_brain_coral_wall_fan: Abgestorbener Hirnkorallenwandfächer + dead_bubble_coral: Abgestorbene Blasenkoralle + dead_bubble_coral_block: Abgestorbener Blasenkorallenblock + dead_bubble_coral_fan: Abgestorbener Blasenkorallenfächer + dead_bubble_coral_wall_fan: Abgestorbener Blasenkorallenwandfächer + dead_bush: Toter Busch + dead_fire_coral: Abgestorbene Feuerkoralle + dead_fire_coral_block: Abgestorbener Feuerkorallenblock + dead_fire_coral_fan: Abgestorbener Feuerkorallenfächer + dead_fire_coral_wall_fan: Abgestorbener Feuerkorallenwandfächer + dead_horn_coral: Abgestorbene Geweihkoralle + dead_horn_coral_block: Abgestorbener Geweihkorallenblock + dead_horn_coral_fan: Abgestorbener Geweihkorallenfächer + dead_horn_coral_wall_fan: Abgestorbener Geweihkorallenwandfächer + dead_tube_coral: Abgestorbene Orgelkoralle + dead_tube_coral_block: Abgestorbener Orgelkorallenblock + dead_tube_coral_fan: Abgestorbener Orgelkorallenfächer + dead_tube_coral_wall_fan: Abgestorbener Orgelkorallenwandfächer + decorated_pot: Verzierter Krug + deepslate: Tiefenschiefer + deepslate_brick_slab: Tiefenschieferziegelstufe + deepslate_brick_stairs: Tiefenschieferziegeltreppe + deepslate_brick_wall: Tiefenschieferziegelmauer + deepslate_bricks: Tiefenschieferziegel + deepslate_coal_ore: Tiefenschiefer-Steinkohle + deepslate_copper_ore: Tiefenschiefer-Kupfererz + deepslate_diamond_ore: Tiefenschiefer-Diamanterz + deepslate_emerald_ore: Tiefenschiefer-Smaragderz + deepslate_gold_ore: Tiefenschiefer-Golderz + deepslate_iron_ore: Tiefenschiefer-Eisenerz + deepslate_lapis_ore: Tiefenschiefer-Lapislazulierz + deepslate_redstone_ore: Tiefenschiefer-Redstone-Erz + deepslate_tile_slab: Tiefenschieferfliesenstufe + deepslate_tile_stairs: Tiefenschieferfliesentreppe + deepslate_tile_wall: Tiefenschieferfliesenmauer + deepslate_tiles: Tiefenschieferfliesen + detector_rail: Sensorschiene + diamond_block: Diamantblock + diamond_ore: Diamanterz + diorite: Diorit + diorite_slab: Dioritstufe + diorite_stairs: Diorittreppe + diorite_wall: Dioritmauer + dirt: Erde + dirt_path: Trampelpfad + dispenser: Werfer + dragon_egg: Drachenei + dragon_head: Drachenkopf + dragon_wall_head: Drachen-Wandkopf + dried_kelp_block: Getrockneter Seetangblock + dripstone_block: Tropfsteinblock + dropper: Spender + emerald_block: Smaragdblock + emerald_ore: Smaragderz + enchanting_table: Zaubertisch + end_gateway: Endtransitportal + end_portal: Endportal + end_portal_frame: Endportalrahmen + end_rod: Endstab + end_stone: Endstein + end_stone_brick_slab: Endsteinziegelstufe + end_stone_brick_stairs: Endsteinziegeltreppe + end_stone_brick_wall: Endsteinziegelmauer + end_stone_bricks: Endsteinziegel + ender_chest: Endertruhe + exposed_copper: Angelaufener Kupferblock + exposed_cut_copper: Angelaufener geschnittener Kupferblock + exposed_cut_copper_slab: Angelaufene geschnittene Kupferstufe + exposed_cut_copper_stairs: Angelaufene geschnittene Kupfertreppe + farmland: Ackerboden + fern: Farn + fire: Feuer + fire_coral: Feuerkoralle + fire_coral_block: Feuerkorallenblock + fire_coral_fan: Feuerkorallenfächer + fire_coral_wall_fan: Feuerkorallenwandfächer + fletching_table: Bognertisch + flower_pot: Blumentopf + flowering_azalea: Blühende Azalee + flowering_azalea_leaves: Blühendes Azaleenlaub + frogspawn: Froschlaich + frosted_ice: Brüchiges Eis + furnace: Ofen + gilded_blackstone: Golddurchzogener Schwarzstein + glass: Glas + glass_pane: Glasscheibe + glow_lichen: Leuchtflechte + glowstone: Leuchtstein + gold_block: Goldblock + gold_ore: Golderz + granite: Granit + granite_slab: Granitstufe + granite_stairs: Granittreppe + granite_wall: Granitmauer + grass: Gras + grass_block: Grasblock + gravel: Kies + gray_banner: Graues Banner + gray_bed: Graues Bett + gray_candle: Graue Kerze + gray_candle_cake: Kuchen mit grauer Kerze + gray_carpet: Grauer Teppich + gray_concrete: Grauer Beton + gray_concrete_powder: Grauer Trockenbeton + gray_glazed_terracotta: Graue glasierte Keramik + gray_shulker_box: Graue Shulker-Kiste + gray_stained_glass: Graues Glas + gray_stained_glass_pane: Graue Glasscheibe + gray_terracotta: Graue Keramik + gray_wool: Graue Wolle + green_banner: Grünes Banner + green_bed: Grünes Bett + green_candle: Grüne Kerze + green_candle_cake: Kuchen mit grüner Kerze + green_carpet: Grüner Teppich + green_concrete: Grüner Beton + green_concrete_powder: Grüner Trockenbeton + green_glazed_terracotta: Grüne glasierte Keramik + green_shulker_box: Grüne Shulker-Kiste + green_stained_glass: Grünes Glas + green_stained_glass_pane: Grüne Glasscheibe + green_terracotta: Grüne Keramik + green_wool: Grüne Wolle + grindstone: Schleifstein + hanging_roots: Hängende Wurzeln + hay_block: Strohballen + heavy_weighted_pressure_plate: Grobwägeplatte + honey_block: Honigblock + honeycomb_block: Honigwabenblock + hopper: Trichter + horn_coral: Geweihkoralle + horn_coral_block: Geweihkorallenblock + horn_coral_fan: Geweihkorallenfächer + horn_coral_wall_fan: Geweihkorallenwandfächer + ice: Eis + infested_chiseled_stone_bricks: Befallene gemeißelte Steinziegel + infested_cobblestone: Befallener Bruchstein + infested_cracked_stone_bricks: Befallene rissige Steinziegel + infested_deepslate: Befallener Tiefenschiefer + infested_mossy_stone_bricks: Befallene bemooste Steinziegel + infested_stone: Befallener Stein + infested_stone_bricks: Befallene Steinziegel + iron_bars: Eisengitter + iron_block: Eisenblock + iron_door: Eisentür + iron_ore: Eisenerz + iron_trapdoor: Eisenfalltür + jack_o_lantern: Kürbislaterne + jigsaw: Verbundblock + jukebox: Plattenspieler + jungle_button: Tropenholzknopf + jungle_door: Tropenholztür + jungle_fence: Tropenholzzaun + jungle_fence_gate: Tropenholzzauntor + jungle_hanging_sign: Tropenholzhängeschild + jungle_leaves: Tropenbaumlaub + jungle_log: Tropenbaumstamm + jungle_planks: Tropenholzbretter + jungle_pressure_plate: Tropenholzdruckplatte + jungle_sapling: Tropenbaumsetzling + jungle_sign: Tropenholzschild + jungle_slab: Tropenholzstufe + jungle_stairs: Tropenholztreppe + jungle_trapdoor: Tropenholzfalltür + jungle_wall_hanging_sign: Tropenholzwandhängeschild + jungle_wall_sign: Tropenholzwandschild + jungle_wood: Tropenholz + kelp: Seetang + kelp_plant: Seetangstängel + ladder: Leiter + lantern: Laterne + lapis_block: Lapislazuliblock + lapis_ore: Lapislazulierz + large_amethyst_bud: Große Amethystknospe + large_fern: Großer Farn + lava: Lava + lava_cauldron: Lavakessel + lectern: Lesepult + lever: Hebel + light: Lichtblock + light_blue_banner: Hellblaues Banner + light_blue_bed: Hellblaues Bett + light_blue_candle: Hellblaue Kerze + light_blue_candle_cake: Kuchen mit hellblauer Kerze + light_blue_carpet: Hellblauer Teppich + light_blue_concrete: Hellblauer Beton + light_blue_concrete_powder: Hellblauer Trockenbeton + light_blue_glazed_terracotta: Hellblaue glasierte Keramik + light_blue_shulker_box: Hellblaue Shulker-Kiste + light_blue_stained_glass: Hellblaues Glas + light_blue_stained_glass_pane: Hellblaue Glasscheibe + light_blue_terracotta: Hellblaue Keramik + light_blue_wool: Hellblaue Wolle + light_gray_banner: Hellgraues Banner + light_gray_bed: Hellgraues Bett + light_gray_candle: Hellgraue Kerze + light_gray_candle_cake: Kuchen mit hellgrauer Kerze + light_gray_carpet: Hellgrauer Teppich + light_gray_concrete: Hellgrauer Beton + light_gray_concrete_powder: Hellgrauer Trockenbeton + light_gray_glazed_terracotta: Hellgraue glasierte Keramik + light_gray_shulker_box: Hellgraue Shulker-Kiste + light_gray_stained_glass: Hellgraues Glas + light_gray_stained_glass_pane: Hellgraue Glasscheibe + light_gray_terracotta: Hellgraue Keramik + light_gray_wool: Hellgraue Wolle + light_weighted_pressure_plate: Feinwägeplatte + lightning_rod: Blitzableiter + lilac: Flieder + lily_of_the_valley: Maiglöckchen + lily_pad: Seerosenblatt + lime_banner: Hellgrünes Banner + lime_bed: Hellgrünes Bett + lime_candle: Hellgrüne Kerze + lime_candle_cake: Kuchen mit hellgrüner Kerze + lime_carpet: Hellgrüner Teppich + lime_concrete: Hellgrüner Beton + lime_concrete_powder: Hellgrüner Trockenbeton + lime_glazed_terracotta: Hellgrüne glasierte Keramik + lime_shulker_box: Hellgrüne Shulker-Kiste + lime_stained_glass: Hellgrünes Glas + lime_stained_glass_pane: Hellgrüne Glasscheibe + lime_terracotta: Hellgrüne Keramik + lime_wool: Hellgrüne Wolle + lodestone: Leitstein + loom: Webstuhl + magenta_banner: Magenta Banner + magenta_bed: Magenta Bett + magenta_candle: Magenta Kerze + magenta_candle_cake: Kuchen mit magenta Kerze + magenta_carpet: Magenta Teppich + magenta_concrete: Magenta Beton + magenta_concrete_powder: Magenta Trockenbeton + magenta_glazed_terracotta: Magenta glasierte Keramik + magenta_shulker_box: Magenta Shulker-Kiste + magenta_stained_glass: Magenta Glas + magenta_stained_glass_pane: Magenta Glasscheibe + magenta_terracotta: Magenta Keramik + magenta_wool: Magenta Wolle + magma_block: Magmablock + mangrove_button: Mangrovenholzknopf + mangrove_door: Mangrovenholztür + mangrove_fence: Mangrovenholzzaun + mangrove_fence_gate: Mangrovenholzzauntor + mangrove_hanging_sign: Mangrovenholzhängeschild + mangrove_leaves: Mangrovenlaub + mangrove_log: Mangrovenstamm + mangrove_planks: Mangrovenholzbretter + mangrove_pressure_plate: Mangrovenholzdruckplatte + mangrove_propagule: Mangroven-Keimling + mangrove_roots: Mangrovenwurzeln + mangrove_sign: Mangrovenholzschild + mangrove_slab: Mangrovenholzstufe + mangrove_stairs: Mangrovenholztreppe + mangrove_trapdoor: Mangrovenholzfalltür + mangrove_wall_hanging_sign: Mangrovenholzwandhängeschild + mangrove_wall_sign: Mangrovenholzwandschild + mangrove_wood: Mangrovenholz + medium_amethyst_bud: Mittlere Amethystknospe + melon: Melone + melon_stem: Melonenpflanze + moss_block: Moosblock + moss_carpet: Moosteppich + mossy_cobblestone: Bemooster Bruchstein + mossy_cobblestone_slab: Bemooste Bruchsteinstufe + mossy_cobblestone_stairs: Bemooste Bruchsteintreppe + mossy_cobblestone_wall: Bemooste Bruchsteinmauer + mossy_stone_brick_slab: Bemooste Steinziegelstufe + mossy_stone_brick_stairs: Bemooste Steinziegeltreppe + mossy_stone_brick_wall: Bemooste Steinziegelmauer + mossy_stone_bricks: Bemooste Steinziegel + moving_piston: Bewegter Block + mud: Schlamm + mud_brick_slab: Schlammziegelstufe + mud_brick_stairs: Schlammziegeltreppe + mud_brick_wall: Schlammziegelmauer + mud_bricks: Schlammziegel + muddy_mangrove_roots: Schlammige Mangrovenwurzeln + mushroom_stem: Pilzstiel + mycelium: Myzel + nether_brick_fence: Netherziegelzaun + nether_brick_slab: Netherziegelstufe + nether_brick_stairs: Netherziegeltreppe + nether_brick_wall: Netherziegelmauer + nether_bricks: Netherziegel + nether_gold_ore: Nethergolderz + nether_portal: Netherportal + nether_quartz_ore: Netherquarzerz + nether_sprouts: Nethersprossen + nether_wart: Netherwarze + nether_wart_block: Netherwarzenblock + netherite_block: Netheritblock + netherrack: Netherrack + note_block: Notenblock + oak_button: Eichenholzknopf + oak_door: Eichenholztür + oak_fence: Eichenholzzaun + oak_fence_gate: Eichenholzzauntor + oak_hanging_sign: Eichenholzhängeschild + oak_leaves: Eichenlaub + oak_log: Eichenstamm + oak_planks: Eichenholzbretter + oak_pressure_plate: Eichenholzdruckplatte + oak_sapling: Eichensetzling + oak_sign: Eichenholzschild + oak_slab: Eichenholzstufe + oak_stairs: Eichenholztreppe + oak_trapdoor: Eichenholzfalltür + oak_wall_hanging_sign: Eichenholzwandhängeschild + oak_wall_sign: Eichenholzwandschild + oak_wood: Eichenholz + observer: Beobachter + obsidian: Obsidian + ochre_froglight: Ockernes Froschlicht + ominous_banner: Unheilvolles Banner + orange_banner: Oranges Banner + orange_bed: Oranges Bett + orange_candle: Orange Kerze + orange_candle_cake: Kuchen mit oranger Kerze + orange_carpet: Oranger Teppich + orange_concrete: Oranger Beton + orange_concrete_powder: Oranger Trockenbeton + orange_glazed_terracotta: Orange glasierte Keramik + orange_shulker_box: Orange Shulker-Kiste + orange_stained_glass: Oranges Glas + orange_stained_glass_pane: Orange Glasscheibe + orange_terracotta: Orange Keramik + orange_tulip: Orange Tulpe + orange_wool: Orange Wolle + oxeye_daisy: Margerite + oxidized_copper: Oxidierter Kupferblock + oxidized_cut_copper: Oxidierter geschnittener Kupferblock + oxidized_cut_copper_slab: Oxidierte geschnittene Kupferstufe + oxidized_cut_copper_stairs: Oxidierte geschnittene Kupfertreppe + packed_ice: Packeis + packed_mud: Fester Schlamm + pearlescent_froglight: Perlmutternes Froschlicht + peony: Pfingstrose + petrified_oak_slab: Versteinerte Eichenholzstufe + piglin_head: Piglinkopf + piglin_wall_head: Piglin-Wandkopf + pink_banner: Rosa Banner + pink_bed: Rosa Bett + pink_candle: Rosa Kerze + pink_candle_cake: Kuchen mit rosa Kerze + pink_carpet: Rosa Teppich + pink_concrete: Rosa Beton + pink_concrete_powder: Rosa Trockenbeton + pink_glazed_terracotta: Rosa glasierte Keramik + pink_petals: Rosa Blütenblätter + pink_shulker_box: Rosa Shulker-Kiste + pink_stained_glass: Rosa Glas + pink_stained_glass_pane: Rosa Glasscheibe + pink_terracotta: Rosa Keramik + pink_tulip: Rosa Tulpe + pink_wool: Rosa Wolle + piston: Kolben + piston_head: Kolbenkopf + pitcher_crop: Kannenpflanzentrieb + pitcher_plant: Kannenpflanze + player_head: Spielerkopf + player_wall_head: Spieler-Wandkopf + podzol: Podsol + pointed_dripstone: Spitzer Tropfstein + polished_andesite: Polierter Andesit + polished_andesite_slab: Polierte Andesitstufe + polished_andesite_stairs: Polierte Andesittreppe + polished_basalt: Polierter Basalt + polished_blackstone: Polierter Schwarzstein + polished_blackstone_brick_slab: Polierte Schwarzsteinziegelstufe + polished_blackstone_brick_stairs: Polierte Schwarzsteinziegeltreppe + polished_blackstone_brick_wall: Polierte Schwarzsteinziegelmauer + polished_blackstone_bricks: Polierte Schwarzsteinziegel + polished_blackstone_button: Polierter Schwarzsteinknopf + polished_blackstone_pressure_plate: Polierte Schwarzsteindruckplatte + polished_blackstone_slab: Polierte Schwarzsteinstufe + polished_blackstone_stairs: Polierte Schwarzsteintreppe + polished_blackstone_wall: Polierte Schwarzsteinmauer + polished_deepslate: Polierter Tiefenschiefer + polished_deepslate_slab: Polierte Tiefenschieferstufe + polished_deepslate_stairs: Polierte Tiefenschiefertreppe + polished_deepslate_wall: Polierte Tiefenschiefermauer + polished_diorite: Polierter Diorit + polished_diorite_slab: Polierte Dioritstufe + polished_diorite_stairs: Polierte Diorittreppe + polished_granite: Polierter Granit + polished_granite_slab: Polierte Granitstufe + polished_granite_stairs: Polierte Granittreppe + poppy: Mohn + potatoes: Kartoffeln + potted_acacia_sapling: Eingetopfter Akaziensetzling + potted_allium: Eingetopfter Zierlauch + potted_azalea_bush: Eingetopfte Azalee + potted_azure_bluet: Eingetopftes Porzellansternchen + potted_bamboo: Eingetopfter Bambus + potted_birch_sapling: Eingetopfter Birkensetzling + potted_blue_orchid: Eingetopfte blaue Orchidee + potted_brown_mushroom: Eingetopfter brauner Pilz + potted_cactus: Eingetopfter Kaktus + potted_cherry_sapling: Eingetopfter Kirschsetzling + potted_cornflower: Eingetopfte Kornblume + potted_crimson_fungus: Eingetopfter Karmesinpilz + potted_crimson_roots: Eingetopfte Karmesinwurzeln + potted_dandelion: Eingetopfter Löwenzahn + potted_dark_oak_sapling: Eingetopfter Schwarzeichensetzling + potted_dead_bush: Eingetopfter toter Busch + potted_fern: Eingetopfter Farn + potted_flowering_azalea_bush: Eingetopfte blühende Azalee + potted_jungle_sapling: Eingetopfter Tropenbaumsetzling + potted_lily_of_the_valley: Eingetopftes Maiglöckchen + potted_mangrove_propagule: Eingetopfter Mangroven-Keimling + potted_oak_sapling: Eingetopfter Eichensetzling + potted_orange_tulip: Eingetopfte orange Tulpe + potted_oxeye_daisy: Eingetopfte Margerite + potted_pink_tulip: Eingetopfte rosa Tulpe + potted_poppy: Eingetopfter Mohn + potted_red_mushroom: Eingetopfter roter Pilz + potted_red_tulip: Eingetopfte rote Tulpe + potted_spruce_sapling: Eingetopfter Fichtensetzling + potted_torchflower: Eingetopfte Fackellilie + potted_warped_fungus: Eingetopfter Wirrpilz + potted_warped_roots: Eingetopfte Wirrwurzeln + potted_white_tulip: Eingetopfte weiße Tulpe + potted_wither_rose: Eingetopfte Wither-Rose + powder_snow: Pulverschnee + powder_snow_cauldron: Pulverschneekessel + powered_rail: Antriebsschiene + prismarine: Prismarin + prismarine_brick_slab: Prismarinziegelstufe + prismarine_brick_stairs: Prismarinziegeltreppe + prismarine_bricks: Prismarinziegel + prismarine_slab: Prismarinstufe + prismarine_stairs: Prismarintreppe + prismarine_wall: Prismarinmauer + pumpkin: Kürbis + pumpkin_stem: Kürbispflanze + purple_banner: Violettes Banner + purple_bed: Violettes Bett + purple_candle: Violette Kerze + purple_candle_cake: Kuchen mit violetter Kerze + purple_carpet: Violetter Teppich + purple_concrete: Violetter Beton + purple_concrete_powder: Violetter Trockenbeton + purple_glazed_terracotta: Violette glasierte Keramik + purple_shulker_box: Violette Shulker-Kiste + purple_stained_glass: Violettes Glas + purple_stained_glass_pane: Violette Glasscheibe + purple_terracotta: Violette Keramik + purple_wool: Violette Wolle + purpur_block: Purpurblock + purpur_pillar: Purpursäule + purpur_slab: Purpurstufe + purpur_stairs: Purpurtreppe + quartz_block: Quarzblock + quartz_bricks: Quarzziegel + quartz_pillar: Quarzsäule + quartz_slab: Quarzstufe + quartz_stairs: Quarztreppe + rail: Schiene + raw_copper_block: Rohkupferblock + raw_gold_block: Rohgoldblock + raw_iron_block: Roheisenblock + red_banner: Rotes Banner + red_bed: Rotes Bett + red_candle: Rote Kerze + red_candle_cake: Kuchen mit roter Kerze + red_carpet: Roter Teppich + red_concrete: Roter Beton + red_concrete_powder: Roter Trockenbeton + red_glazed_terracotta: Rote glasierte Keramik + red_mushroom: Roter Pilz + red_mushroom_block: Roter Pilzblock + red_nether_brick_slab: Rote Netherziegelstufe + red_nether_brick_stairs: Rote Netherziegeltreppe + red_nether_brick_wall: Rote Netherziegelmauer + red_nether_bricks: Rote Netherziegel + red_sand: Roter Sand + red_sandstone: Roter Sandstein + red_sandstone_slab: Rote Sandsteinstufe + red_sandstone_stairs: Rote Sandsteintreppe + red_sandstone_wall: Rote Sandsteinmauer + red_shulker_box: Rote Shulker-Kiste + red_stained_glass: Rotes Glas + red_stained_glass_pane: Rote Glasscheibe + red_terracotta: Rote Keramik + red_tulip: Rote Tulpe + red_wool: Rote Wolle + redstone_block: Redstone-Block + redstone_lamp: Redstone-Lampe + redstone_ore: Redstone-Erz + redstone_torch: Redstone-Fackel + redstone_wall_torch: Redstone-Wandfackel + redstone_wire: Redstone-Leitung + reinforced_deepslate: Verstärkter Tiefenschiefer + repeater: Redstone-Verstärker + repeating_command_block: Wiederhol-Befehlsblock + respawn_anchor: Seelenanker + rooted_dirt: Wurzelerde + rose_bush: Rosenstrauch + sand: Sand + sandstone: Sandstein + sandstone_slab: Sandsteinstufe + sandstone_stairs: Sandsteintreppe + sandstone_wall: Sandsteinmauer + scaffolding: Gerüst + sculk: Sculk + sculk_catalyst: Sculk-Katalysator + sculk_sensor: Sculk-Sensor + sculk_shrieker: Sculk-Kreischer + sculk_vein: Sculk-Ader + sea_lantern: Seelaterne + sea_pickle: Meeresgurke + seagrass: Seegras + set_spawn: Wiedereinstiegspunkt gesetzt + shroomlight: Pilzlicht + shulker_box: Shulker-Kiste + skeleton_skull: Skelettschädel + skeleton_wall_skull: Skelett-Wandschädel + slime_block: Schleimblock + small_amethyst_bud: Kleine Amethystknospe + small_dripleaf: Kleines Tropfblatt + smithing_table: Schmiedetisch + smoker: Räucherofen + smooth_basalt: Glatter Basalt + smooth_quartz: Glatter Quarzblock + smooth_quartz_slab: Glatte Quarzstufe + smooth_quartz_stairs: Glatte Quarztreppe + smooth_red_sandstone: Glatter roter Sandstein + smooth_red_sandstone_slab: Glatte rote Sandsteinstufe + smooth_red_sandstone_stairs: Glatte rote Sandsteintreppe + smooth_sandstone: Glatter Sandstein + smooth_sandstone_slab: Glatte Sandsteinstufe + smooth_sandstone_stairs: Glatte Sandsteintreppe + smooth_stone: Glatter Stein + smooth_stone_slab: Glatte Steinstufe + sniffer_egg: Schnüffler-Ei + snow: Schnee + snow_block: Schneeblock + soul_campfire: Seelenlagerfeuer + soul_fire: Seelenfeuer + soul_lantern: Seelenlaterne + soul_sand: Seelensand + soul_soil: Seelenerde + soul_torch: Seelenfackel + soul_wall_torch: Seelenwandfackel + spawner: Spawner + sponge: Schwamm + spore_blossom: Sporenblüte + spruce_button: Fichtenholzknopf + spruce_door: Fichtenholztür + spruce_fence: Fichtenholzzaun + spruce_fence_gate: Fichtenholzzauntor + spruce_hanging_sign: Fichtenholzhängeschild + spruce_leaves: Fichtennadeln + spruce_log: Fichtenstamm + spruce_planks: Fichtenholzbretter + spruce_pressure_plate: Fichtenholzdruckplatte + spruce_sapling: Fichtensetzling + spruce_sign: Fichtenholzschild + spruce_slab: Fichtenholzstufe + spruce_stairs: Fichtenholztreppe + spruce_trapdoor: Fichtenholzfalltür + spruce_wall_hanging_sign: Fichtenholzwandhängeschild + spruce_wall_sign: Fichtenholzwandschild + spruce_wood: Fichtenholz + sticky_piston: Klebriger Kolben + stone: Stein + stone_brick_slab: Steinziegelstufe + stone_brick_stairs: Steinziegeltreppe + stone_brick_wall: Steinziegelmauer + stone_bricks: Steinziegel + stone_button: Steinknopf + stone_pressure_plate: Steindruckplatte + stone_slab: Steinstufe + stone_stairs: Steintreppe + stonecutter: Steinsäge + stripped_acacia_log: Entrindeter Akazienstamm + stripped_acacia_wood: Entrindetes Akazienholz + stripped_bamboo_block: Geschälter Bambusblock + stripped_birch_log: Entrindeter Birkenstamm + stripped_birch_wood: Entrindetes Birkenholz + stripped_cherry_log: Entrindeter Kirschstamm + stripped_cherry_wood: Entrindetes Kirschholz + stripped_crimson_hyphae: Geschälte Karmesinhyphen + stripped_crimson_stem: Geschälter Karmesinstiel + stripped_dark_oak_log: Entrindeter Schwarzeichenstamm + stripped_dark_oak_wood: Entrindetes Schwarzeichenholz + stripped_jungle_log: Entrindeter Tropenbaumstamm + stripped_jungle_wood: Entrindetes Tropenholz + stripped_mangrove_log: Entrindeter Mangrovenstamm + stripped_mangrove_wood: Entrindetes Mangrovenholz + stripped_oak_log: Entrindeter Eichenstamm + stripped_oak_wood: Entrindetes Eichenholz + stripped_spruce_log: Entrindeter Fichtenstamm + stripped_spruce_wood: Entrindetes Fichtenholz + stripped_warped_hyphae: Geschälte Wirrhyphen + stripped_warped_stem: Geschälter Wirrstiel + structure_block: Konstruktionsblock + structure_void: Konstruktionsleere + sugar_cane: Zuckerrohr + sunflower: Sonnenblume + suspicious_gravel: Seltsamer Kies + suspicious_sand: Seltsamer Sand + sweet_berry_bush: Süßbeerstrauch + tall_grass: Hohes Gras + tall_seagrass: Hohes Seegras + target: Zielblock + terracotta: Keramik + tinted_glass: Getöntes Glas + tnt: TNT + torch: Fackel + torchflower: Fackellilie + torchflower_crop: Fackellilienpflanze + trapped_chest: Redstone-Truhe + tripwire: Stolperdraht + tripwire_hook: Haken + tube_coral: Orgelkoralle + tube_coral_block: Orgelkorallenblock + tube_coral_fan: Orgelkorallenfächer + tube_coral_wall_fan: Orgelkorallenwandfächer + tuff: Tuffstein + turtle_egg: Schildkrötenei + twisting_vines: Zwirbelranken + twisting_vines_plant: Zwirbelrankenpflanze + verdant_froglight: Junggrünes Froschlicht + vine: Ranken + void_air: Leerenluft + wall_torch: Wandfackel + warped_button: Wirrknopf + warped_door: Wirrtür + warped_fence: Wirrzaun + warped_fence_gate: Wirrzauntor + warped_fungus: Wirrpilz + warped_hanging_sign: Wirrhängeschild + warped_hyphae: Wirrhyphen + warped_nylium: Wirr-Nezel + warped_planks: Wirrbretter + warped_pressure_plate: Wirrdruckplatte + warped_roots: Wirrwurzeln + warped_sign: Wirrschild + warped_slab: Wirrstufe + warped_stairs: Wirrtreppe + warped_stem: Wirrstiel + warped_trapdoor: Wirrfalltür + warped_wall_hanging_sign: Wirrwandhängeschild + warped_wall_sign: Wirrwandschild + warped_wart_block: Wirrwarzenblock + water: Wasser + water_cauldron: Wasserkessel + waxed_copper_block: Gewachster Kupferblock + waxed_cut_copper: Gewachster geschnittener Kupferblock + waxed_cut_copper_slab: Gewachste geschnittene Kupferstufe + waxed_cut_copper_stairs: Gewachste geschnittene Kupfertreppe + waxed_exposed_copper: Gewachster angelaufener Kupferblock + waxed_exposed_cut_copper: Gewachster angelaufener geschnittener Kupferblock + waxed_exposed_cut_copper_slab: Gewachste angelaufene geschnittene Kupferstufe + waxed_exposed_cut_copper_stairs: Gewachste angelaufene geschnittene Kupfertreppe + waxed_oxidized_copper: Gewachster oxidierter Kupferblock + waxed_oxidized_cut_copper: Gewachster oxidierter geschnittener Kupferblock + waxed_oxidized_cut_copper_slab: Gewachste oxidierte geschnittene Kupferstufe + waxed_oxidized_cut_copper_stairs: Gewachste oxidierte geschnittene Kupfertreppe + waxed_weathered_copper: Gewachster verwitterter Kupferblock + waxed_weathered_cut_copper: Gewachster verwitterter geschnittener Kupferblock + waxed_weathered_cut_copper_slab: Gewachste verwitterte geschnittene Kupferstufe + waxed_weathered_cut_copper_stairs: Gewachste verwitterte geschnittene Kupfertreppe + weathered_copper: Verwitterter Kupferblock + weathered_cut_copper: Verwitterter geschnittener Kupferblock + weathered_cut_copper_slab: Verwitterte geschnittene Kupferstufe + weathered_cut_copper_stairs: Verwitterte geschnittene Kupfertreppe + weeping_vines: Trauerranken + weeping_vines_plant: Trauerrankenpflanze + wet_sponge: Nasser Schwamm + wheat: Weizen + white_banner: Weißes Banner + white_bed: Weißes Bett + white_candle: Weiße Kerze + white_candle_cake: Kuchen mit weißer Kerze + white_carpet: Weißer Teppich + white_concrete: Weißer Beton + white_concrete_powder: Weißer Trockenbeton + white_glazed_terracotta: Weiße glasierte Keramik + white_shulker_box: Weiße Shulker-Kiste + white_stained_glass: Weißes Glas + white_stained_glass_pane: Weiße Glasscheibe + white_terracotta: Weiße Keramik + white_tulip: Weiße Tulpe + white_wool: Weiße Wolle + wither_rose: Wither-Rose + wither_skeleton_skull: Witherskelettschädel + wither_skeleton_wall_skull: Witherskelett-Wandschädel + yellow_banner: Gelbes Banner + yellow_bed: Gelbes Bett + yellow_candle: Gelbe Kerze + yellow_candle_cake: Kuchen mit gelber Kerze + yellow_carpet: Gelber Teppich + yellow_concrete: Gelber Beton + yellow_concrete_powder: Gelber Trockenbeton + yellow_glazed_terracotta: Gelbe glasierte Keramik + yellow_shulker_box: Gelbe Shulker-Kiste + yellow_stained_glass: Gelbes Glas + yellow_stained_glass_pane: Gelbe Glasscheibe + yellow_terracotta: Gelbe Keramik + yellow_wool: Gelbe Wolle + zombie_head: Zombiekopf + zombie_wall_head: Zombie-Wandkopf + acacia_boat: Akazienholzboot + acacia_chest_boat: Akazienholztruhenboot + allay_spawn_egg: Hilfsgeister-Spawn-Ei + amethyst_shard: Amethystscherbe + angler_pottery_shard: Angler-Töpferscherbe + angler_pottery_sherd: Angler-Töpferscherbe + apple: Apfel + archer_pottery_shard: Schützen-Töpferscherbe + archer_pottery_sherd: Schützen-Töpferscherbe + armor_stand: Rüstungsständer + arms_up_pottery_shard: Gebärden-Töpferscherbe + arms_up_pottery_sherd: Gebärden-Töpferscherbe + arrow: Pfeil + axolotl_bucket: Axolotleimer + axolotl_spawn_egg: Axolotl-Spawn-Ei + baked_potato: Ofenkartoffel + bamboo_chest_raft: Bambus-Truhenfloß + bamboo_raft: Bambusfloß + bat_spawn_egg: Fledermaus-Spawn-Ei + bee_spawn_egg: Bienen-Spawn-Ei + beef: Rohes Rindfleisch + beetroot: Rote Bete + beetroot_seeds: Rote-Bete-Samen + beetroot_soup: Borschtsch + birch_boat: Birkenholzboot + birch_chest_boat: Birkenholztruhenboot + black_dye: Schwarzer Farbstoff + blade_pottery_shard: Klingen-Töpferscherbe + blade_pottery_sherd: Klingen-Töpferscherbe + blaze_powder: Lohenstaub + blaze_rod: Lohenrute + blaze_spawn_egg: Lohen-Spawn-Ei + blue_dye: Blauer Farbstoff + bone: Knochen + bone_meal: Knochenmehl + book: Buch + bow: Bogen + bowl: Schüssel + bread: Brot + brewer_pottery_shard: Brauer-Töpferscherbe + brewer_pottery_sherd: Brauer-Töpferscherbe + brick: Ziegel + brown_dye: Brauner Farbstoff + brush: Pinsel + bucket: Eimer + bundle: Bündel + burn_pottery_shard: Flammen-Töpferscherbe + burn_pottery_sherd: Flammen-Töpferscherbe + camel_spawn_egg: Dromedar-Spawn-Ei + carrot: Karotte + carrot_on_a_stick: Karottenrute + cat_spawn_egg: Katzen-Spawn-Ei + cave_spider_spawn_egg: Höhlenspinnen-Spawn-Ei + chainmail_boots: Kettenstiefel + chainmail_chestplate: Kettenhemd + chainmail_helmet: Kettenhaube + chainmail_leggings: Kettenhose + charcoal: Holzkohle + cherry_boat: Kirschholzboot + cherry_chest_boat: Kirschholztruhenboot + chest_minecart: Güterlore + chicken: Rohes Hühnchen + chicken_spawn_egg: Huhn-Spawn-Ei + chorus_fruit: Chorusfrucht + clay_ball: Tonklumpen + clock: Uhr + coal: Kohle + coast_armor_trim_smithing_template: Schmiedevorlage + cocoa_beans: Kakaobohnen + cod: Roher Kabeljau + cod_bucket: Kabeljaueimer + cod_spawn_egg: Kabeljau-Spawn-Ei + command_block_minecart: Befehlsblocklore + compass: Kompass + cooked_beef: Steak + cooked_chicken: Gebratenes Hühnchen + cooked_cod: Gebratener Kabeljau + cooked_mutton: Gebratenes Hammelfleisch + cooked_porkchop: Gebratenes Schweinefleisch + cooked_rabbit: Gebratenes Kaninchen + cooked_salmon: Gebratener Lachs + cookie: Keks + copper_ingot: Kupferbarren + cow_spawn_egg: Kuh-Spawn-Ei + creeper_banner_pattern: Bannervorlage + creeper_spawn_egg: Creeper-Spawn-Ei + crossbow: Armbrust + cyan_dye: Türkiser Farbstoff + danger_pottery_shard: Gefahren-Töpferscherbe + danger_pottery_sherd: Gefahren-Töpferscherbe + dark_oak_boat: Schwarzeichenholzboot + dark_oak_chest_boat: Schwarzeichenholztruhenboot + debug_stick: Debug-Stab + diamond: Diamant + diamond_axe: Diamantaxt + diamond_boots: Diamantstiefel + diamond_chestplate: Diamantharnisch + diamond_helmet: Diamanthelm + diamond_hoe: Diamanthacke + diamond_horse_armor: Diamantener Rossharnisch + diamond_leggings: Diamantbeinschutz + diamond_pickaxe: Diamantspitzhacke + diamond_shovel: Diamantschaufel + diamond_sword: Diamantschwert + disc_fragment_5: Plattenbruchstück + dolphin_spawn_egg: Delfin-Spawn-Ei + donkey_spawn_egg: Esel-Spawn-Ei + dragon_breath: Drachenatem + dried_kelp: Getrockneter Seetang + drowned_spawn_egg: Ertrunkenen-Spawn-Ei + dune_armor_trim_smithing_template: Schmiedevorlage + echo_shard: Echoscherbe + egg: Ei + elder_guardian_spawn_egg: Großer-Wächter-Spawn-Ei + elytra: Elytren + emerald: Smaragd + enchanted_book: Verzaubertes Buch + enchanted_golden_apple: Verzauberter goldener Apfel + end_crystal: Enderkristall + ender_dragon_spawn_egg: Enderdrachen-Spawn-Ei + ender_eye: Enderauge + ender_pearl: Enderperle + enderman_spawn_egg: Enderman-Spawn-Ei + endermite_spawn_egg: Endermiten-Spawn-Ei + evoker_spawn_egg: Magier-Spawn-Ei + experience_bottle: Erfahrungsfläschchen + explorer_pottery_shard: Entdecker-Töpferscherbe + explorer_pottery_sherd: Entdecker-Töpferscherbe + eye_armor_trim_smithing_template: Schmiedevorlage + feather: Feder + fermented_spider_eye: Fermentiertes Spinnenauge + filled_map: Karte + fire_charge: Feuerkugel + firework_rocket: Feuerwerksrakete + firework_star: Feuerwerksstern + fishing_rod: Angel + flint: Feuerstein + flint_and_steel: Feuerzeug + flower_banner_pattern: Bannervorlage + fox_spawn_egg: Fuchs-Spawn-Ei + friend_pottery_shard: Freundes-Töpferscherbe + friend_pottery_sherd: Freundes-Töpferscherbe + frog_spawn_egg: Frosch-Spawn-Ei + furnace_minecart: Ofenlore + ghast_spawn_egg: Ghast-Spawn-Ei + ghast_tear: Ghast-Träne + glass_bottle: Glasflasche + glistering_melon_slice: Glitzernde Melonenscheibe + globe_banner_pattern: Bannervorlage + glow_berries: Leuchtbeeren + glow_ink_sac: Leuchttintenbeutel + glow_item_frame: Leuchtrahmen + glow_squid_spawn_egg: Leuchttintenfisch-Spawn-Ei + glowstone_dust: Leuchtsteinstaub + goat_horn: Bockshorn + goat_spawn_egg: Ziegen-Spawn-Ei + gold_ingot: Goldbarren + gold_nugget: Goldklumpen + golden_apple: Goldener Apfel + golden_axe: Goldaxt + golden_boots: Goldstiefel + golden_carrot: Goldene Karotte + golden_chestplate: Goldharnisch + golden_helmet: Goldhelm + golden_hoe: Goldhacke + golden_horse_armor: Goldener Rossharnisch + golden_leggings: Goldbeinschutz + golden_pickaxe: Goldspitzhacke + golden_shovel: Goldschaufel + golden_sword: Goldschwert + gray_dye: Grauer Farbstoff + green_dye: Grüner Farbstoff + guardian_spawn_egg: Wächter-Spawn-Ei + gunpowder: Schwarzpulver + heart_of_the_sea: Herz des Meeres + heart_pottery_shard: Herz-Töpferscherbe + heart_pottery_sherd: Herz-Töpferscherbe + heartbreak_pottery_shard: Herzschmerz-Töpferscherbe + heartbreak_pottery_sherd: Herzschmerz-Töpferscherbe + hoglin_spawn_egg: Hoglin-Spawn-Ei + honey_bottle: Honigflasche + honeycomb: Honigwabe + hopper_minecart: Trichterlore + horse_spawn_egg: Pferde-Spawn-Ei + host_armor_trim_smithing_template: Schmiedevorlage + howl_pottery_shard: Geheul-Töpferscherbe + howl_pottery_sherd: Geheul-Töpferscherbe + husk_spawn_egg: Wüstenzombie-Spawn-Ei + ink_sac: Tintenbeutel + iron_axe: Eisenaxt + iron_boots: Eisenstiefel + iron_chestplate: Eisenharnisch + iron_golem_spawn_egg: Eisengolem-Spawn-Ei + iron_helmet: Eisenhelm + iron_hoe: Eisenhacke + iron_horse_armor: Eiserner Rossharnisch + iron_ingot: Eisenbarren + iron_leggings: Eisenbeinschutz + iron_nugget: Eisenklumpen + iron_pickaxe: Eisenspitzhacke + iron_shovel: Eisenschaufel + iron_sword: Eisenschwert + item_frame: Rahmen + jungle_boat: Tropenholzboot + jungle_chest_boat: Tropenholztruhenboot + knowledge_book: Buch des Wissens + lapis_lazuli: Lapislazuli + lava_bucket: Lavaeimer + lead: Leine + leather: Leder + leather_boots: Lederstiefel + leather_chestplate: Lederjacke + leather_helmet: Lederkappe + leather_horse_armor: Lederner Rossharnisch + leather_leggings: Lederhose + light_blue_dye: Hellblauer Farbstoff + light_gray_dye: Hellgrauer Farbstoff + lime_dye: Hellgrüner Farbstoff + lingering_potion: Verweiltrank + llama_spawn_egg: Lama-Spawn-Ei + lodestone_compass: Leitstein-Kompass + magenta_dye: Magenta Farbstoff + magma_cream: Magmacreme + magma_cube_spawn_egg: Magmawürfel-Spawn-Ei + mangrove_boat: Mangrovenholzboot + mangrove_chest_boat: Mangrovenholztruhenboot + map: Leere Karte + melon_seeds: Melonenkerne + melon_slice: Melonenscheibe + milk_bucket: Milcheimer + minecart: Lore + miner_pottery_shard: Bergarbeiter-Töpferscherbe + miner_pottery_sherd: Bergarbeiter-Töpferscherbe + mojang_banner_pattern: Bannervorlage + mooshroom_spawn_egg: Mooshroom-Spawn-Ei + mourner_pottery_shard: Wimmerer-Töpferscherbe + mourner_pottery_sherd: Wimmerer-Töpferscherbe + mule_spawn_egg: Maultier-Spawn-Ei + mushroom_stew: Pilzsuppe + music_disc_11: Schallplatte + music_disc_13: Schallplatte + music_disc_5: Schallplatte + music_disc_blocks: Schallplatte + music_disc_cat: Schallplatte + music_disc_chirp: Schallplatte + music_disc_far: Schallplatte + music_disc_mall: Schallplatte + music_disc_mellohi: Schallplatte + music_disc_otherside: Schallplatte + music_disc_pigstep: Schallplatte + music_disc_relic: Schallplatte + music_disc_stal: Schallplatte + music_disc_strad: Schallplatte + music_disc_wait: Schallplatte + music_disc_ward: Schallplatte + mutton: Rohes Hammelfleisch + name_tag: Namensschild + nautilus_shell: Nautilusschale + nether_brick: Netherziegel + nether_star: Netherstern + netherite_axe: Netheritaxt + netherite_boots: Netheritstiefel + netherite_chestplate: Netheritharnisch + netherite_helmet: Netherithelm + netherite_hoe: Netherithacke + netherite_ingot: Netheritbarren + netherite_leggings: Netheritbeinschutz + netherite_pickaxe: Netheritspitzhacke + netherite_scrap: Netheritplatten + netherite_shovel: Netheritschaufel + netherite_sword: Netheritschwert + netherite_upgrade_smithing_template: Schmiedevorlage + oak_boat: Eichenholzboot + oak_chest_boat: Eichenholztruhenboot + ocelot_spawn_egg: Ozelot-Spawn-Ei + orange_dye: Oranger Farbstoff + painting: Gemälde + panda_spawn_egg: Panda-Spawn-Ei + paper: Papier + parrot_spawn_egg: Papageien-Spawn-Ei + phantom_membrane: Phantomhaut + phantom_spawn_egg: Phantom-Spawn-Ei + pig_spawn_egg: Schweine-Spawn-Ei + piglin_banner_pattern: Bannervorlage + piglin_brute_spawn_egg: Piglin-Barbaren-Spawn-Ei + piglin_spawn_egg: Piglin-Spawn-Ei + pillager_spawn_egg: Plünderer-Spawn-Ei + pink_dye: Rosa Farbstoff + pitcher_pod: Kannenpflanzenkapsel + plenty_pottery_shard: Reichtums-Töpferscherbe + plenty_pottery_sherd: Reichtums-Töpferscherbe + poisonous_potato: Giftige Kartoffel + polar_bear_spawn_egg: Eisbären-Spawn-Ei + popped_chorus_fruit: Geplatzte Chorusfrucht + porkchop: Rohes Schweinefleisch + potato: Kartoffel + potion: Trank + pottery_shard_archer: Schützen-Töpferscherbe + pottery_shard_arms_up: Gebärden-Töpferscherbe + pottery_shard_prize: Juwelen-Töpferscherbe + pottery_shard_skull: Totenkopf-Töpferscherbe + powder_snow_bucket: Pulverschneeeimer + prismarine_crystals: Prismarinkristalle + prismarine_shard: Prismarinscherbe + prize_pottery_shard: Juwelen-Töpferscherbe + prize_pottery_sherd: Juwelen-Töpferscherbe + pufferfish: Kugelfisch + pufferfish_bucket: Kugelfischeimer + pufferfish_spawn_egg: Kugelfisch-Spawn-Ei + pumpkin_pie: Kürbiskuchen + pumpkin_seeds: Kürbiskerne + purple_dye: Violetter Farbstoff + quartz: Netherquarz + rabbit: Rohes Kaninchen + rabbit_foot: Hasenpfote + rabbit_hide: Kaninchenfell + rabbit_spawn_egg: Kaninchen-Spawn-Ei + rabbit_stew: Kaninchenragout + raiser_armor_trim_smithing_template: Schmiedevorlage + ravager_spawn_egg: Verwüster-Spawn-Ei + raw_copper: Rohkupfer + raw_gold: Rohgold + raw_iron: Roheisen + recovery_compass: Bergungskompass + red_dye: Roter Farbstoff + redstone: Redstone-Staub + rib_armor_trim_smithing_template: Schmiedevorlage + rotten_flesh: Verrottetes Fleisch + saddle: Sattel + salmon: Roher Lachs + salmon_bucket: Lachseimer + salmon_spawn_egg: Lachs-Spawn-Ei + scute: Hornschild + sentry_armor_trim_smithing_template: Schmiedevorlage + shaper_armor_trim_smithing_template: Schmiedevorlage + sheaf_pottery_shard: Garben-Töpferscherbe + sheaf_pottery_sherd: Garben-Töpferscherbe + shears: Schere + sheep_spawn_egg: Schafs-Spawn-Ei + shelter_pottery_shard: Zufluchts-Töpferscherbe + shelter_pottery_sherd: Zufluchts-Töpferscherbe + shield: Schild + shulker_shell: Shulker-Schale + shulker_spawn_egg: Shulker-Spawn-Ei + sign: Schild + silence_armor_trim_smithing_template: Schmiedevorlage + silverfish_spawn_egg: Silberfischchen-Spawn-Ei + skeleton_horse_spawn_egg: Skelettpferde-Spawn-Ei + skeleton_spawn_egg: Skelett-Spawn-Ei + skull_banner_pattern: Bannervorlage + skull_pottery_shard: Totenkopf-Töpferscherbe + skull_pottery_sherd: Totenkopf-Töpferscherbe + slime_ball: Schleimball + slime_spawn_egg: Schleim-Spawn-Ei + smithing_template: Schmiedevorlage + sniffer_spawn_egg: Schnüffler-Spawn-Ei + snort_pottery_shard: Schnaub-Töpferscherbe + snort_pottery_sherd: Schnaub-Töpferscherbe + snout_armor_trim_smithing_template: Schmiedevorlage + snow_golem_spawn_egg: Schneegolem-Spawn-Ei + snowball: Schneeball + spectral_arrow: Spektralpfeil + spider_eye: Spinnenauge + spider_spawn_egg: Spinnen-Spawn-Ei + spire_armor_trim_smithing_template: Schmiedevorlage + splash_potion: Wurftrank + spruce_boat: Fichtenholzboot + spruce_chest_boat: Fichtenholztruhenboot + spyglass: Fernrohr + squid_spawn_egg: Tintenfisch-Spawn-Ei + stick: Stock + stone_axe: Steinaxt + stone_hoe: Steinhacke + stone_pickaxe: Steinspitzhacke + stone_shovel: Steinschaufel + stone_sword: Steinschwert + stray_spawn_egg: Eiswanderer-Spawn-Ei + strider_spawn_egg: Schreiter-Spawn-Ei + string: Faden + sugar: Zucker + suspicious_stew: Seltsame Suppe + sweet_berries: Süßbeeren + tadpole_bucket: Kaulquappeneimer + tadpole_spawn_egg: Kaulquappen-Spawn-Ei + tide_armor_trim_smithing_template: Schmiedevorlage + tipped_arrow: Getränkter Pfeil + tnt_minecart: TNT-Lore + torchflower_seeds: Fackelliliensamen + totem_of_undying: Totem der Unsterblichkeit + trader_llama_spawn_egg: Händlerlama-Spawn-Ei + trident: Dreizack + tropical_fish: Tropenfisch + tropical_fish_bucket: Tropenfischeimer + tropical_fish_spawn_egg: Tropenfisch-Spawn-Ei + turtle_helmet: Schildkrötenpanzer + turtle_spawn_egg: Schildkröten-Spawn-Ei + vex_armor_trim_smithing_template: Schmiedevorlage + vex_spawn_egg: Plagegeister-Spawn-Ei + villager_spawn_egg: Dorfbewohner-Spawn-Ei + vindicator_spawn_egg: Diener-Spawn-Ei + wandering_trader_spawn_egg: Fahrender-Händler-Spawn-Ei + ward_armor_trim_smithing_template: Schmiedevorlage + warden_spawn_egg: Wärter-Spawn-Ei + warped_fungus_on_a_stick: Wirrpilzrute + water_bucket: Wassereimer + wayfinder_armor_trim_smithing_template: Schmiedevorlage + wheat_seeds: Weizenkörner + white_dye: Weißer Farbstoff + wild_armor_trim_smithing_template: Schmiedevorlage + witch_spawn_egg: Hexen-Spawn-Ei + wither_skeleton_spawn_egg: Witherskelett-Spawn-Ei + wither_spawn_egg: Wither-Spawn-Ei + wolf_spawn_egg: Wolfs-Spawn-Ei + wooden_axe: Holzaxt + wooden_hoe: Holzhacke + wooden_pickaxe: Holzspitzhacke + wooden_shovel: Holzschaufel + wooden_sword: Holzschwert + writable_book: Buch und Feder + written_book: Beschriebenes Buch + yellow_dye: Gelber Farbstoff + zoglin_spawn_egg: Zoglin-Spawn-Ei + zombie_horse_spawn_egg: Zombiepferde-Spawn-Ei + zombie_spawn_egg: Zombie-Spawn-Ei + zombie_villager_spawn_egg: Zombiedorfbewohner-Spawn-Ei + zombified_piglin_spawn_egg: Zombifizierter-Piglin-Spawn-Ei +Enchantment: + aqua_affinity: Wasseraffinität + bane_of_arthropods: Nemesis der Gliederfüßer + binding_curse: Fluch der Bindung + blast_protection: Explosionsschutz + channeling: Entladung + depth_strider: Wasserläufer + efficiency: Effizienz + feather_falling: Federfall + fire_aspect: Verbrennung + fire_protection: Feuerschutz + flame: Flamme + fortune: Glück + frost_walker: Eisläufer + impaling: Harpune + infinity: Unendlichkeit + knockback: Rückstoß + looting: Plünderung + loyalty: Treue + luck_of_the_sea: Glück des Meeres + lure: Köder + mending: Reparatur + multishot: Mehrfachschuss + piercing: Durchschuss + power: Stärke + projectile_protection: Schusssicher + protection: Schutz + punch: Schlag + quick_charge: Schnellladen + respiration: Atmung + riptide: Sog + sharpness: Schärfe + silk_touch: Behutsamkeit + smite: Bann + soul_speed: Seelenläufer + sweeping: Schwungkraft + swift_sneak: Huschen + thorns: Dornen + unbreaking: Haltbarkeit + vanishing_curse: Fluch des Verschwindens diff --git a/assets/en.yml b/assets/en.yml new file mode 100644 index 0000000..c8c27b7 --- /dev/null +++ b/assets/en.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: Allay + area_effect_cloud: Area Effect Cloud + armor_stand: Armour Stand + arrow: Arrow + axolotl: Axolotl + bat: Bat + bee: Bee + blaze: Blaze + block_display: Block Display + boat: Boat + camel: Camel + cat: Cat + cave_spider: Cave Spider + chest_boat: Boat with Chest + chest_minecart: Minecart with Chest + chicken: Chicken + cod: Cod + command_block_minecart: Minecart with Command Block + cow: Cow + creeper: Creeper + dolphin: Dolphin + donkey: Donkey + dragon_fireball: Dragon Fireball + drowned: Drowned + egg: Thrown Egg + elder_guardian: Elder Guardian + end_crystal: End Crystal + ender_dragon: Ender Dragon + ender_pearl: Thrown Ender Pearl + enderman: Enderman + endermite: Endermite + evoker: Evoker + evoker_fangs: Evoker Fangs + experience_bottle: Thrown Bottle o' Enchanting + experience_orb: Experience Orb + eye_of_ender: Eye of Ender + falling_block: Falling Block + falling_block_type: Falling %s + fireball: Fireball + firework_rocket: Firework Rocket + fishing_bobber: Fishing Bobber + fox: Fox + frog: Frog + furnace_minecart: Minecart with Furnace + ghast: Ghast + giant: Giant + glow_item_frame: Glow Item Frame + glow_squid: Glow Squid + goat: Goat + guardian: Guardian + hoglin: Hoglin + hopper_minecart: Minecart with Hopper + horse: Horse + husk: Husk + illusioner: Illusioner + interaction: Interaction + iron_golem: Iron Golem + item: Item + item_display: Item Display + item_frame: Item Frame + killer_bunny: The Killer Bunny + leash_knot: Leash Knot + lightning_bolt: Lightning Bolt + llama: Llama + llama_spit: Llama Spit + magma_cube: Magma Cube + marker: Marker + minecart: Minecart + mooshroom: Mooshroom + mule: Mule + ocelot: Ocelot + painting: Painting + panda: Panda + parrot: Parrot + phantom: Phantom + pig: Pig + piglin: Piglin + piglin_brute: Piglin Brute + pillager: Pillager + player: Player + polar_bear: Polar Bear + potion: Potion + pufferfish: Pufferfish + rabbit: Rabbit + ravager: Ravager + salmon: Salmon + sheep: Sheep + shulker: Shulker + shulker_bullet: Shulker Bullet + silverfish: Silverfish + skeleton: Skeleton + skeleton_horse: Skeleton Horse + slime: Slime + small_fireball: Small Fireball + sniffer: Sniffer + snow_golem: Snow Golem + snowball: Snowball + spawner_minecart: Minecart with Monster Spawner + spectral_arrow: Spectral Arrow + spider: Spider + squid: Squid + stray: Stray + strider: Strider + tadpole: Tadpole + text_display: Text Display + tnt: Primed TNT + tnt_minecart: Minecart with TNT + trader_llama: Trader Llama + trident: Trident + tropical_fish: Tropical Fish + turtle: Turtle + vex: Vex + villager: Villager + vindicator: Vindicator + wandering_trader: Wandering Trader + warden: Warden + witch: Witch + wither: Wither + wither_skeleton: Wither Skeleton + wither_skull: Wither Skull + wolf: Wolf + zoglin: Zoglin + zombie: Zombie + zombie_horse: Zombie Horse + zombie_villager: Zombie Villager + zombified_piglin: Zombified Piglin +PotionEffectType: + absorption: Absorption + bad_omen: Bad Omen + blindness: Blindness + conduit_power: Conduit Power + darkness: Darkness + dolphins_grace: Dolphin's Grace + fire_resistance: Fire Resistance + glowing: Glowing + haste: Haste + health_boost: Health Boost + hero_of_the_village: Hero of the Village + hunger: Hunger + instant_damage: Instant Damage + instant_health: Instant Health + invisibility: Invisibility + jump_boost: Jump Boost + levitation: Levitation + luck: Luck + mining_fatigue: Mining Fatigue + nausea: Nausea + night_vision: Night Vision + poison: Poison + regeneration: Regeneration + resistance: Resistance + saturation: Saturation + slow_falling: Slow Falling + slowness: Slowness + speed: Speed + strength: Strength + unluck: Bad Luck + water_breathing: Water Breathing + weakness: Weakness + wither: Wither +Material: + acacia_button: Acacia Button + acacia_door: Acacia Door + acacia_fence: Acacia Fence + acacia_fence_gate: Acacia Fence Gate + acacia_hanging_sign: Acacia Hanging Sign + acacia_leaves: Acacia Leaves + acacia_log: Acacia Log + acacia_planks: Acacia Planks + acacia_pressure_plate: Acacia Pressure Plate + acacia_sapling: Acacia Sapling + acacia_sign: Acacia Sign + acacia_slab: Acacia Slab + acacia_stairs: Acacia Stairs + acacia_trapdoor: Acacia Trapdoor + acacia_wall_hanging_sign: Acacia Wall Hanging Sign + acacia_wall_sign: Acacia Wall Sign + acacia_wood: Acacia Wood + activator_rail: Activator Rail + air: Air + allium: Allium + amethyst_block: Block of Amethyst + amethyst_cluster: Amethyst Cluster + ancient_debris: Ancient Debris + andesite: Andesite + andesite_slab: Andesite Slab + andesite_stairs: Andesite Stairs + andesite_wall: Andesite Wall + anvil: Anvil + attached_melon_stem: Attached Melon Stem + attached_pumpkin_stem: Attached Pumpkin Stem + azalea: Azalea + azalea_leaves: Azalea Leaves + azure_bluet: Azure Bluet + bamboo: Bamboo + bamboo_block: Block of Bamboo + bamboo_button: Bamboo Button + bamboo_door: Bamboo Door + bamboo_fence: Bamboo Fence + bamboo_fence_gate: Bamboo Fence Gate + bamboo_hanging_sign: Bamboo Hanging Sign + bamboo_mosaic: Bamboo Mosaic + bamboo_mosaic_slab: Bamboo Mosaic Slab + bamboo_mosaic_stairs: Bamboo Mosaic Stairs + bamboo_planks: Bamboo Planks + bamboo_pressure_plate: Bamboo Pressure Plate + bamboo_sapling: Bamboo Shoot + bamboo_sign: Bamboo Sign + bamboo_slab: Bamboo Slab + bamboo_stairs: Bamboo Stairs + bamboo_trapdoor: Bamboo Trapdoor + bamboo_wall_hanging_sign: Bamboo Wall Hanging Sign + bamboo_wall_sign: Bamboo Wall Sign + barrel: Barrel + barrier: Barrier + basalt: Basalt + beacon: Beacon + bedrock: Bedrock + bee_nest: Bee Nest + beehive: Beehive + beetroots: Beetroots + bell: Bell + big_dripleaf: Big Dripleaf + big_dripleaf_stem: Big Dripleaf Stem + birch_button: Birch Button + birch_door: Birch Door + birch_fence: Birch Fence + birch_fence_gate: Birch Fence Gate + birch_hanging_sign: Birch Hanging Sign + birch_leaves: Birch Leaves + birch_log: Birch Log + birch_planks: Birch Planks + birch_pressure_plate: Birch Pressure Plate + birch_sapling: Birch Sapling + birch_sign: Birch Sign + birch_slab: Birch Slab + birch_stairs: Birch Stairs + birch_trapdoor: Birch Trapdoor + birch_wall_hanging_sign: Birch Wall Hanging Sign + birch_wall_sign: Birch Wall Sign + birch_wood: Birch Wood + black_banner: Black Banner + black_bed: Black Bed + black_candle: Black Candle + black_candle_cake: Cake with Black Candle + black_carpet: Black Carpet + black_concrete: Black Concrete + black_concrete_powder: Black Concrete Powder + black_glazed_terracotta: Black Glazed Terracotta + black_shulker_box: Black Shulker Box + black_stained_glass: Black Stained Glass + black_stained_glass_pane: Black Stained Glass Pane + black_terracotta: Black Terracotta + black_wool: Black Wool + blackstone: Blackstone + blackstone_slab: Blackstone Slab + blackstone_stairs: Blackstone Stairs + blackstone_wall: Blackstone Wall + blast_furnace: Blast Furnace + blue_banner: Blue Banner + blue_bed: Blue Bed + blue_candle: Blue Candle + blue_candle_cake: Cake with Blue Candle + blue_carpet: Blue Carpet + blue_concrete: Blue Concrete + blue_concrete_powder: Blue Concrete Powder + blue_glazed_terracotta: Blue Glazed Terracotta + blue_ice: Blue Ice + blue_orchid: Blue Orchid + blue_shulker_box: Blue Shulker Box + blue_stained_glass: Blue Stained Glass + blue_stained_glass_pane: Blue Stained Glass Pane + blue_terracotta: Blue Terracotta + blue_wool: Blue Wool + bone_block: Bone Block + bookshelf: Bookshelf + brain_coral: Brain Coral + brain_coral_block: Brain Coral Block + brain_coral_fan: Brain Coral Fan + brain_coral_wall_fan: Brain Coral Wall Fan + brewing_stand: Brewing Stand + brick_slab: Brick Slab + brick_stairs: Brick Stairs + brick_wall: Brick Wall + bricks: Bricks + brown_banner: Brown Banner + brown_bed: Brown Bed + brown_candle: Brown Candle + brown_candle_cake: Cake with Brown Candle + brown_carpet: Brown Carpet + brown_concrete: Brown Concrete + brown_concrete_powder: Brown Concrete Powder + brown_glazed_terracotta: Brown Glazed Terracotta + brown_mushroom: Brown Mushroom + brown_mushroom_block: Brown Mushroom Block + brown_shulker_box: Brown Shulker Box + brown_stained_glass: Brown Stained Glass + brown_stained_glass_pane: Brown Stained Glass Pane + brown_terracotta: Brown Terracotta + brown_wool: Brown Wool + bubble_column: Bubble Column + bubble_coral: Bubble Coral + bubble_coral_block: Bubble Coral Block + bubble_coral_fan: Bubble Coral Fan + bubble_coral_wall_fan: Bubble Coral Wall Fan + budding_amethyst: Budding Amethyst + cactus: Cactus + cake: Cake + calcite: Calcite + calibrated_sculk_sensor: Calibrated Sculk Sensor + campfire: Campfire + candle: Candle + candle_cake: Cake with Candle + carrots: Carrots + cartography_table: Cartography Table + carved_pumpkin: Carved Pumpkin + cauldron: Cauldron + cave_air: Cave Air + cave_vines: Cave Vines + cave_vines_plant: Cave Vines Plant + chain: Chain + chain_command_block: Chain Command Block + cherry_button: Cherry Button + cherry_door: Cherry Door + cherry_fence: Cherry Fence + cherry_fence_gate: Cherry Fence Gate + cherry_hanging_sign: Cherry Hanging Sign + cherry_leaves: Cherry Leaves + cherry_log: Cherry Log + cherry_planks: Cherry Planks + cherry_pressure_plate: Cherry Pressure Plate + cherry_sapling: Cherry Sapling + cherry_sign: Cherry Sign + cherry_slab: Cherry Slab + cherry_stairs: Cherry Stairs + cherry_trapdoor: Cherry Trapdoor + cherry_wall_hanging_sign: Cherry Wall Hanging Sign + cherry_wall_sign: Cherry Wall Sign + cherry_wood: Cherry Wood + chest: Chest + chipped_anvil: Chipped Anvil + chiseled_bookshelf: Chiselled Bookshelf + chiseled_deepslate: Chiselled Deepslate + chiseled_nether_bricks: Chiselled Nether Bricks + chiseled_polished_blackstone: Chiselled Polished Blackstone + chiseled_quartz_block: Chiselled Quartz Block + chiseled_red_sandstone: Chiselled Red Sandstone + chiseled_sandstone: Chiselled Sandstone + chiseled_stone_bricks: Chiselled Stone Bricks + chorus_flower: Chorus Flower + chorus_plant: Chorus Plant + clay: Clay + coal_block: Block of Coal + coal_ore: Coal Ore + coarse_dirt: Coarse Dirt + cobbled_deepslate: Cobbled Deepslate + cobbled_deepslate_slab: Cobbled Deepslate Slab + cobbled_deepslate_stairs: Cobbled Deepslate Stairs + cobbled_deepslate_wall: Cobbled Deepslate Wall + cobblestone: Cobblestone + cobblestone_slab: Cobblestone Slab + cobblestone_stairs: Cobblestone Stairs + cobblestone_wall: Cobblestone Wall + cobweb: Cobweb + cocoa: Cocoa + command_block: Command Block + comparator: Redstone Comparator + composter: Composter + conduit: Conduit + copper_block: Block of Copper + copper_ore: Copper Ore + cornflower: Cornflower + cracked_deepslate_bricks: Cracked Deepslate Bricks + cracked_deepslate_tiles: Cracked Deepslate Tiles + cracked_nether_bricks: Cracked Nether Bricks + cracked_polished_blackstone_bricks: Cracked Polished Blackstone Bricks + cracked_stone_bricks: Cracked Stone Bricks + crafting_table: Crafting Table + creeper_head: Creeper Head + creeper_wall_head: Creeper Wall Head + crimson_button: Crimson Button + crimson_door: Crimson Door + crimson_fence: Crimson Fence + crimson_fence_gate: Crimson Fence Gate + crimson_fungus: Crimson Fungus + crimson_hanging_sign: Crimson Hanging Sign + crimson_hyphae: Crimson Hyphae + crimson_nylium: Crimson Nylium + crimson_planks: Crimson Planks + crimson_pressure_plate: Crimson Pressure Plate + crimson_roots: Crimson Roots + crimson_sign: Crimson Sign + crimson_slab: Crimson Slab + crimson_stairs: Crimson Stairs + crimson_stem: Crimson Stem + crimson_trapdoor: Crimson Trapdoor + crimson_wall_hanging_sign: Crimson Wall Hanging Sign + crimson_wall_sign: Crimson Wall Sign + crying_obsidian: Crying Obsidian + cut_copper: Cut Copper + cut_copper_slab: Cut Copper Slab + cut_copper_stairs: Cut Copper Stairs + cut_red_sandstone: Cut Red Sandstone + cut_red_sandstone_slab: Cut Red Sandstone Slab + cut_sandstone: Cut Sandstone + cut_sandstone_slab: Cut Sandstone Slab + cyan_banner: Cyan Banner + cyan_bed: Cyan Bed + cyan_candle: Cyan Candle + cyan_candle_cake: Cake with Cyan Candle + cyan_carpet: Cyan Carpet + cyan_concrete: Cyan Concrete + cyan_concrete_powder: Cyan Concrete Powder + cyan_glazed_terracotta: Cyan Glazed Terracotta + cyan_shulker_box: Cyan Shulker Box + cyan_stained_glass: Cyan Stained Glass + cyan_stained_glass_pane: Cyan Stained Glass Pane + cyan_terracotta: Cyan Terracotta + cyan_wool: Cyan Wool + damaged_anvil: Damaged Anvil + dandelion: Dandelion + dark_oak_button: Dark Oak Button + dark_oak_door: Dark Oak Door + dark_oak_fence: Dark Oak Fence + dark_oak_fence_gate: Dark Oak Fence Gate + dark_oak_hanging_sign: Dark Oak Hanging Sign + dark_oak_leaves: Dark Oak Leaves + dark_oak_log: Dark Oak Log + dark_oak_planks: Dark Oak Planks + dark_oak_pressure_plate: Dark Oak Pressure Plate + dark_oak_sapling: Dark Oak Sapling + dark_oak_sign: Dark Oak Sign + dark_oak_slab: Dark Oak Slab + dark_oak_stairs: Dark Oak Stairs + dark_oak_trapdoor: Dark Oak Trapdoor + dark_oak_wall_hanging_sign: Dark Oak Wall Hanging Sign + dark_oak_wall_sign: Dark Oak Wall Sign + dark_oak_wood: Dark Oak Wood + dark_prismarine: Dark Prismarine + dark_prismarine_slab: Dark Prismarine Slab + dark_prismarine_stairs: Dark Prismarine Stairs + daylight_detector: Daylight Detector + dead_brain_coral: Dead Brain Coral + dead_brain_coral_block: Dead Brain Coral Block + dead_brain_coral_fan: Dead Brain Coral Fan + dead_brain_coral_wall_fan: Dead Brain Coral Wall Fan + dead_bubble_coral: Dead Bubble Coral + dead_bubble_coral_block: Dead Bubble Coral Block + dead_bubble_coral_fan: Dead Bubble Coral Fan + dead_bubble_coral_wall_fan: Dead Bubble Coral Wall Fan + dead_bush: Dead Bush + dead_fire_coral: Dead Fire Coral + dead_fire_coral_block: Dead Fire Coral Block + dead_fire_coral_fan: Dead Fire Coral Fan + dead_fire_coral_wall_fan: Dead Fire Coral Wall Fan + dead_horn_coral: Dead Horn Coral + dead_horn_coral_block: Dead Horn Coral Block + dead_horn_coral_fan: Dead Horn Coral Fan + dead_horn_coral_wall_fan: Dead Horn Coral Wall Fan + dead_tube_coral: Dead Tube Coral + dead_tube_coral_block: Dead Tube Coral Block + dead_tube_coral_fan: Dead Tube Coral Fan + dead_tube_coral_wall_fan: Dead Tube Coral Wall Fan + decorated_pot: Decorated Pot + deepslate: Deepslate + deepslate_brick_slab: Deepslate Brick Slab + deepslate_brick_stairs: Deepslate Brick Stairs + deepslate_brick_wall: Deepslate Brick Wall + deepslate_bricks: Deepslate Bricks + deepslate_coal_ore: Deepslate Coal Ore + deepslate_copper_ore: Deepslate Copper Ore + deepslate_diamond_ore: Deepslate Diamond Ore + deepslate_emerald_ore: Deepslate Emerald Ore + deepslate_gold_ore: Deepslate Gold Ore + deepslate_iron_ore: Deepslate Iron Ore + deepslate_lapis_ore: Deepslate Lapis Lazuli Ore + deepslate_redstone_ore: Deepslate Redstone Ore + deepslate_tile_slab: Deepslate Tile Slab + deepslate_tile_stairs: Deepslate Tile Stairs + deepslate_tile_wall: Deepslate Tile Wall + deepslate_tiles: Deepslate Tiles + detector_rail: Detector Rail + diamond_block: Block of Diamond + diamond_ore: Diamond Ore + diorite: Diorite + diorite_slab: Diorite Slab + diorite_stairs: Diorite Stairs + diorite_wall: Diorite Wall + dirt: Dirt + dirt_path: Dirt Path + dispenser: Dispenser + dragon_egg: Dragon Egg + dragon_head: Dragon Head + dragon_wall_head: Dragon Wall Head + dried_kelp_block: Dried Kelp Block + dripstone_block: Dripstone Block + dropper: Dropper + emerald_block: Block of Emerald + emerald_ore: Emerald Ore + enchanting_table: Enchanting Table + end_gateway: End Gateway + end_portal: End Portal + end_portal_frame: End Portal Frame + end_rod: End Rod + end_stone: End Stone + end_stone_brick_slab: End Stone Brick Slab + end_stone_brick_stairs: End Stone Brick Stairs + end_stone_brick_wall: End Stone Brick Wall + end_stone_bricks: End Stone Bricks + ender_chest: Ender Chest + exposed_copper: Exposed Copper + exposed_cut_copper: Exposed Cut Copper + exposed_cut_copper_slab: Exposed Cut Copper Slab + exposed_cut_copper_stairs: Exposed Cut Copper Stairs + farmland: Farmland + fern: Fern + fire: Fire + fire_coral: Fire Coral + fire_coral_block: Fire Coral Block + fire_coral_fan: Fire Coral Fan + fire_coral_wall_fan: Fire Coral Wall Fan + fletching_table: Fletching Table + flower_pot: Flower Pot + flowering_azalea: Flowering Azalea + flowering_azalea_leaves: Flowering Azalea Leaves + frogspawn: Frogspawn + frosted_ice: Frosted Ice + furnace: Furnace + gilded_blackstone: Gilded Blackstone + glass: Glass + glass_pane: Glass Pane + glow_lichen: Glow Lichen + glowstone: Glowstone + gold_block: Block of Gold + gold_ore: Gold Ore + granite: Granite + granite_slab: Granite Slab + granite_stairs: Granite Stairs + granite_wall: Granite Wall + grass: Grass + grass_block: Grass Block + gravel: Gravel + gray_banner: Grey Banner + gray_bed: Grey Bed + gray_candle: Grey Candle + gray_candle_cake: Cake with Grey Candle + gray_carpet: Grey Carpet + gray_concrete: Grey Concrete + gray_concrete_powder: Grey Concrete Powder + gray_glazed_terracotta: Grey Glazed Terracotta + gray_shulker_box: Grey Shulker Box + gray_stained_glass: Grey Stained Glass + gray_stained_glass_pane: Grey Stained Glass Pane + gray_terracotta: Grey Terracotta + gray_wool: Grey Wool + green_banner: Green Banner + green_bed: Green Bed + green_candle: Green Candle + green_candle_cake: Cake with Green Candle + green_carpet: Green Carpet + green_concrete: Green Concrete + green_concrete_powder: Green Concrete Powder + green_glazed_terracotta: Green Glazed Terracotta + green_shulker_box: Green Shulker Box + green_stained_glass: Green Stained Glass + green_stained_glass_pane: Green Stained Glass Pane + green_terracotta: Green Terracotta + green_wool: Green Wool + grindstone: Grindstone + hanging_roots: Hanging Roots + hay_block: Hay Bale + heavy_weighted_pressure_plate: Heavy Weighted Pressure Plate + honey_block: Honey Block + honeycomb_block: Honeycomb Block + hopper: Hopper + horn_coral: Horn Coral + horn_coral_block: Horn Coral Block + horn_coral_fan: Horn Coral Fan + horn_coral_wall_fan: Horn Coral Wall Fan + ice: Ice + infested_chiseled_stone_bricks: Infested Chiselled Stone Bricks + infested_cobblestone: Infested Cobblestone + infested_cracked_stone_bricks: Infested Cracked Stone Bricks + infested_deepslate: Infested Deepslate + infested_mossy_stone_bricks: Infested Mossy Stone Bricks + infested_stone: Infested Stone + infested_stone_bricks: Infested Stone Bricks + iron_bars: Iron Bars + iron_block: Block of Iron + iron_door: Iron Door + iron_ore: Iron Ore + iron_trapdoor: Iron Trapdoor + jack_o_lantern: Jack o'Lantern + jigsaw: Jigsaw Block + jukebox: Jukebox + jungle_button: Jungle Button + jungle_door: Jungle Door + jungle_fence: Jungle Fence + jungle_fence_gate: Jungle Fence Gate + jungle_hanging_sign: Jungle Hanging Sign + jungle_leaves: Jungle Leaves + jungle_log: Jungle Log + jungle_planks: Jungle Planks + jungle_pressure_plate: Jungle Pressure Plate + jungle_sapling: Jungle Sapling + jungle_sign: Jungle Sign + jungle_slab: Jungle Slab + jungle_stairs: Jungle Stairs + jungle_trapdoor: Jungle Trapdoor + jungle_wall_hanging_sign: Jungle Wall Hanging Sign + jungle_wall_sign: Jungle Wall Sign + jungle_wood: Jungle Wood + kelp: Kelp + kelp_plant: Kelp Plant + ladder: Ladder + lantern: Lantern + lapis_block: Block of Lapis Lazuli + lapis_ore: Lapis Lazuli Ore + large_amethyst_bud: Large Amethyst Bud + large_fern: Large Fern + lava: Lava + lava_cauldron: Lava Cauldron + lectern: Lectern + lever: Lever + light: Light + light_blue_banner: Light Blue Banner + light_blue_bed: Light Blue Bed + light_blue_candle: Light Blue Candle + light_blue_candle_cake: Cake with Light Blue Candle + light_blue_carpet: Light Blue Carpet + light_blue_concrete: Light Blue Concrete + light_blue_concrete_powder: Light Blue Concrete Powder + light_blue_glazed_terracotta: Light Blue Glazed Terracotta + light_blue_shulker_box: Light Blue Shulker Box + light_blue_stained_glass: Light Blue Stained Glass + light_blue_stained_glass_pane: Light Blue Stained Glass Pane + light_blue_terracotta: Light Blue Terracotta + light_blue_wool: Light Blue Wool + light_gray_banner: Light Grey Banner + light_gray_bed: Light Grey Bed + light_gray_candle: Light Grey Candle + light_gray_candle_cake: Cake with Light Grey Candle + light_gray_carpet: Light Grey Carpet + light_gray_concrete: Light Grey Concrete + light_gray_concrete_powder: Light Grey Concrete Powder + light_gray_glazed_terracotta: Light Grey Glazed Terracotta + light_gray_shulker_box: Light Grey Shulker Box + light_gray_stained_glass: Light Grey Stained Glass + light_gray_stained_glass_pane: Light Grey Stained Glass Pane + light_gray_terracotta: Light Grey Terracotta + light_gray_wool: Light Grey Wool + light_weighted_pressure_plate: Light Weighted Pressure Plate + lightning_rod: Lightning Rod + lilac: Lilac + lily_of_the_valley: Lily of the Valley + lily_pad: Lily Pad + lime_banner: Lime Banner + lime_bed: Lime Bed + lime_candle: Lime Candle + lime_candle_cake: Cake with Lime Candle + lime_carpet: Lime Carpet + lime_concrete: Lime Concrete + lime_concrete_powder: Lime Concrete Powder + lime_glazed_terracotta: Lime Glazed Terracotta + lime_shulker_box: Lime Shulker Box + lime_stained_glass: Lime Stained Glass + lime_stained_glass_pane: Lime Stained Glass Pane + lime_terracotta: Lime Terracotta + lime_wool: Lime Wool + lodestone: Lodestone + loom: Loom + magenta_banner: Magenta Banner + magenta_bed: Magenta Bed + magenta_candle: Magenta Candle + magenta_candle_cake: Cake with Magenta Candle + magenta_carpet: Magenta Carpet + magenta_concrete: Magenta Concrete + magenta_concrete_powder: Magenta Concrete Powder + magenta_glazed_terracotta: Magenta Glazed Terracotta + magenta_shulker_box: Magenta Shulker Box + magenta_stained_glass: Magenta Stained Glass + magenta_stained_glass_pane: Magenta Stained Glass Pane + magenta_terracotta: Magenta Terracotta + magenta_wool: Magenta Wool + magma_block: Magma Block + mangrove_button: Mangrove Button + mangrove_door: Mangrove Door + mangrove_fence: Mangrove Fence + mangrove_fence_gate: Mangrove Fence Gate + mangrove_hanging_sign: Mangrove Hanging Sign + mangrove_leaves: Mangrove Leaves + mangrove_log: Mangrove Log + mangrove_planks: Mangrove Planks + mangrove_pressure_plate: Mangrove Pressure Plate + mangrove_propagule: Mangrove Propagule + mangrove_roots: Mangrove Roots + mangrove_sign: Mangrove Sign + mangrove_slab: Mangrove Slab + mangrove_stairs: Mangrove Stairs + mangrove_trapdoor: Mangrove Trapdoor + mangrove_wall_hanging_sign: Mangrove Wall Hanging Sign + mangrove_wall_sign: Mangrove Wall Sign + mangrove_wood: Mangrove Wood + medium_amethyst_bud: Medium Amethyst Bud + melon: Melon + melon_stem: Melon Stem + moss_block: Moss Block + moss_carpet: Moss Carpet + mossy_cobblestone: Mossy Cobblestone + mossy_cobblestone_slab: Mossy Cobblestone Slab + mossy_cobblestone_stairs: Mossy Cobblestone Stairs + mossy_cobblestone_wall: Mossy Cobblestone Wall + mossy_stone_brick_slab: Mossy Stone Brick Slab + mossy_stone_brick_stairs: Mossy Stone Brick Stairs + mossy_stone_brick_wall: Mossy Stone Brick Wall + mossy_stone_bricks: Mossy Stone Bricks + moving_piston: Moving Piston + mud: Mud + mud_brick_slab: Mud Brick Slab + mud_brick_stairs: Mud Brick Stairs + mud_brick_wall: Mud Brick Wall + mud_bricks: Mud Bricks + muddy_mangrove_roots: Muddy Mangrove Roots + mushroom_stem: Mushroom Stem + mycelium: Mycelium + nether_brick_fence: Nether Brick Fence + nether_brick_slab: Nether Brick Slab + nether_brick_stairs: Nether Brick Stairs + nether_brick_wall: Nether Brick Wall + nether_bricks: Nether Bricks + nether_gold_ore: Nether Gold Ore + nether_portal: Nether Portal + nether_quartz_ore: Nether Quartz Ore + nether_sprouts: Nether Sprouts + nether_wart: Nether Wart + nether_wart_block: Nether Wart Block + netherite_block: Block of Netherite + netherrack: Netherrack + note_block: Note Block + oak_button: Oak Button + oak_door: Oak Door + oak_fence: Oak Fence + oak_fence_gate: Oak Fence Gate + oak_hanging_sign: Oak Hanging Sign + oak_leaves: Oak Leaves + oak_log: Oak Log + oak_planks: Oak Planks + oak_pressure_plate: Oak Pressure Plate + oak_sapling: Oak Sapling + oak_sign: Oak Sign + oak_slab: Oak Slab + oak_stairs: Oak Stairs + oak_trapdoor: Oak Trapdoor + oak_wall_hanging_sign: Oak Wall Hanging Sign + oak_wall_sign: Oak Wall Sign + oak_wood: Oak Wood + observer: Observer + obsidian: Obsidian + ochre_froglight: Ochre Froglight + ominous_banner: Ominous Banner + orange_banner: Orange Banner + orange_bed: Orange Bed + orange_candle: Orange Candle + orange_candle_cake: Cake with Orange Candle + orange_carpet: Orange Carpet + orange_concrete: Orange Concrete + orange_concrete_powder: Orange Concrete Powder + orange_glazed_terracotta: Orange Glazed Terracotta + orange_shulker_box: Orange Shulker Box + orange_stained_glass: Orange Stained Glass + orange_stained_glass_pane: Orange Stained Glass Pane + orange_terracotta: Orange Terracotta + orange_tulip: Orange Tulip + orange_wool: Orange Wool + oxeye_daisy: Oxeye Daisy + oxidized_copper: Oxidised Copper + oxidized_cut_copper: Oxidised Cut Copper + oxidized_cut_copper_slab: Oxidised Cut Copper Slab + oxidized_cut_copper_stairs: Oxidised Cut Copper Stairs + packed_ice: Compressed Ice + packed_mud: Packed Mud + pearlescent_froglight: Pearlescent Froglight + peony: Peony + petrified_oak_slab: Petrified Oak Slab + piglin_head: Piglin Head + piglin_wall_head: Piglin Wall Head + pink_banner: Pink Banner + pink_bed: Pink Bed + pink_candle: Pink Candle + pink_candle_cake: Cake with Pink Candle + pink_carpet: Pink Carpet + pink_concrete: Pink Concrete + pink_concrete_powder: Pink Concrete Powder + pink_glazed_terracotta: Pink Glazed Terracotta + pink_petals: Pink Petals + pink_shulker_box: Pink Shulker Box + pink_stained_glass: Pink Stained Glass + pink_stained_glass_pane: Pink Stained Glass Pane + pink_terracotta: Pink Terracotta + pink_tulip: Pink Tulip + pink_wool: Pink Wool + piston: Piston + piston_head: Piston Head + pitcher_crop: Pitcher Crop + pitcher_plant: Pitcher Plant + player_head: Player Head + player_wall_head: Player Wall Head + podzol: Podzol + pointed_dripstone: Pointed Dripstone + polished_andesite: Polished Andesite + polished_andesite_slab: Polished Andesite Slab + polished_andesite_stairs: Polished Andesite Stairs + polished_basalt: Polished Basalt + polished_blackstone: Polished Blackstone + polished_blackstone_brick_slab: Polished Blackstone Brick Slab + polished_blackstone_brick_stairs: Polished Blackstone Brick Stairs + polished_blackstone_brick_wall: Polished Blackstone Brick Wall + polished_blackstone_bricks: Polished Blackstone Bricks + polished_blackstone_button: Polished Blackstone Button + polished_blackstone_pressure_plate: Polished Blackstone Pressure Plate + polished_blackstone_slab: Polished Blackstone Slab + polished_blackstone_stairs: Polished Blackstone Stairs + polished_blackstone_wall: Polished Blackstone Wall + polished_deepslate: Polished Deepslate + polished_deepslate_slab: Polished Deepslate Slab + polished_deepslate_stairs: Polished Deepslate Stairs + polished_deepslate_wall: Polished Deepslate Wall + polished_diorite: Polished Diorite + polished_diorite_slab: Polished Diorite Slab + polished_diorite_stairs: Polished Diorite Stairs + polished_granite: Polished Granite + polished_granite_slab: Polished Granite Slab + polished_granite_stairs: Polished Granite Stairs + poppy: Poppy + potatoes: Potatoes + potted_acacia_sapling: Potted Acacia Sapling + potted_allium: Potted Allium + potted_azalea_bush: Potted Azalea + potted_azure_bluet: Potted Azure Bluet + potted_bamboo: Potted Bamboo + potted_birch_sapling: Potted Birch Sapling + potted_blue_orchid: Potted Blue Orchid + potted_brown_mushroom: Potted Brown Mushroom + potted_cactus: Potted Cactus + potted_cherry_sapling: Potted Cherry Sapling + potted_cornflower: Potted Cornflower + potted_crimson_fungus: Potted Crimson Fungus + potted_crimson_roots: Potted Crimson Roots + potted_dandelion: Potted Dandelion + potted_dark_oak_sapling: Potted Dark Oak Sapling + potted_dead_bush: Potted Dead Bush + potted_fern: Potted Fern + potted_flowering_azalea_bush: Potted Flowering Azalea + potted_jungle_sapling: Potted Jungle Sapling + potted_lily_of_the_valley: Potted Lily of the Valley + potted_mangrove_propagule: Potted Mangrove Propagule + potted_oak_sapling: Potted Oak Sapling + potted_orange_tulip: Potted Orange Tulip + potted_oxeye_daisy: Potted Oxeye Daisy + potted_pink_tulip: Potted Pink Tulip + potted_poppy: Potted Poppy + potted_red_mushroom: Potted Red Mushroom + potted_red_tulip: Potted Red Tulip + potted_spruce_sapling: Potted Spruce Sapling + potted_torchflower: Potted Torchflower + potted_warped_fungus: Potted Warped Fungus + potted_warped_roots: Potted Warped Roots + potted_white_tulip: Potted White Tulip + potted_wither_rose: Potted Wither Rose + powder_snow: Powder Snow + powder_snow_cauldron: Powder Snow Cauldron + powered_rail: Powered Rail + prismarine: Prismarine + prismarine_brick_slab: Prismarine Brick Slab + prismarine_brick_stairs: Prismarine Brick Stairs + prismarine_bricks: Prismarine Bricks + prismarine_slab: Prismarine Slab + prismarine_stairs: Prismarine Stairs + prismarine_wall: Prismarine Wall + pumpkin: Pumpkin + pumpkin_stem: Pumpkin Stem + purple_banner: Purple Banner + purple_bed: Purple Bed + purple_candle: Purple Candle + purple_candle_cake: Cake with Purple Candle + purple_carpet: Purple Carpet + purple_concrete: Purple Concrete + purple_concrete_powder: Purple Concrete Powder + purple_glazed_terracotta: Purple Glazed Terracotta + purple_shulker_box: Purple Shulker Box + purple_stained_glass: Purple Stained Glass + purple_stained_glass_pane: Purple Stained Glass Pane + purple_terracotta: Purple Terracotta + purple_wool: Purple Wool + purpur_block: Purpur Block + purpur_pillar: Purpur Pillar + purpur_slab: Purpur Slab + purpur_stairs: Purpur Stairs + quartz_block: Block of Quartz + quartz_bricks: Quartz Bricks + quartz_pillar: Quartz Pillar + quartz_slab: Quartz Slab + quartz_stairs: Quartz Stairs + rail: Rail + raw_copper_block: Block of Raw Copper + raw_gold_block: Block of Raw Gold + raw_iron_block: Block of Raw Iron + red_banner: Red Banner + red_bed: Red Bed + red_candle: Red Candle + red_candle_cake: Cake with Red Candle + red_carpet: Red Carpet + red_concrete: Red Concrete + red_concrete_powder: Red Concrete Powder + red_glazed_terracotta: Red Glazed Terracotta + red_mushroom: Red Mushroom + red_mushroom_block: Red Mushroom Block + red_nether_brick_slab: Red Nether Brick Slab + red_nether_brick_stairs: Red Nether Brick Stairs + red_nether_brick_wall: Red Nether Brick Wall + red_nether_bricks: Red Nether Bricks + red_sand: Red Sand + red_sandstone: Red Sandstone + red_sandstone_slab: Red Sandstone Slab + red_sandstone_stairs: Red Sandstone Stairs + red_sandstone_wall: Red Sandstone Wall + red_shulker_box: Red Shulker Box + red_stained_glass: Red Stained Glass + red_stained_glass_pane: Red Stained Glass Pane + red_terracotta: Red Terracotta + red_tulip: Red Tulip + red_wool: Red Wool + redstone_block: Block of Redstone + redstone_lamp: Redstone Lamp + redstone_ore: Redstone Ore + redstone_torch: Redstone Torch + redstone_wall_torch: Redstone Wall Torch + redstone_wire: Redstone Wire + reinforced_deepslate: Reinforced Deepslate + repeater: Redstone Repeater + repeating_command_block: Repeating Command Block + respawn_anchor: Respawn Anchor + rooted_dirt: Rooted Dirt + rose_bush: Rose Bush + sand: Sand + sandstone: Sandstone + sandstone_slab: Sandstone Slab + sandstone_stairs: Sandstone Stairs + sandstone_wall: Sandstone Wall + scaffolding: Scaffolding + sculk: Sculk + sculk_catalyst: Sculk Catalyst + sculk_sensor: Sculk Sensor + sculk_shrieker: Sculk Shrieker + sculk_vein: Sculk Vein + sea_lantern: Sea Lantern + sea_pickle: Sea Pickle + seagrass: Seagrass + set_spawn: Respawn point set + shroomlight: Shroomlight + shulker_box: Shulker Box + skeleton_skull: Skeleton Skull + skeleton_wall_skull: Skeleton Wall Skull + slime_block: Slime Block + small_amethyst_bud: Small Amethyst Bud + small_dripleaf: Small Dripleaf + smithing_table: Smithing Table + smoker: Smoker + smooth_basalt: Smooth Basalt + smooth_quartz: Smooth Quartz Block + smooth_quartz_slab: Smooth Quartz Slab + smooth_quartz_stairs: Smooth Quartz Stairs + smooth_red_sandstone: Smooth Red Sandstone + smooth_red_sandstone_slab: Smooth Red Sandstone Slab + smooth_red_sandstone_stairs: Smooth Red Sandstone Stairs + smooth_sandstone: Smooth Sandstone + smooth_sandstone_slab: Smooth Sandstone Slab + smooth_sandstone_stairs: Smooth Sandstone Stairs + smooth_stone: Smooth Stone + smooth_stone_slab: Smooth Stone Slab + sniffer_egg: Sniffer Egg + snow: Snow + snow_block: Snow Block + soul_campfire: Soul Campfire + soul_fire: Soul Fire + soul_lantern: Soul Lantern + soul_sand: Soul Sand + soul_soil: Soul Soil + soul_torch: Soul Torch + soul_wall_torch: Soul Wall Torch + spawner: Monster Spawner + sponge: Sponge + spore_blossom: Spore Blossom + spruce_button: Spruce Button + spruce_door: Spruce Door + spruce_fence: Spruce Fence + spruce_fence_gate: Spruce Fence Gate + spruce_hanging_sign: Spruce Hanging Sign + spruce_leaves: Spruce Leaves + spruce_log: Spruce Log + spruce_planks: Spruce Planks + spruce_pressure_plate: Spruce Pressure Plate + spruce_sapling: Spruce Sapling + spruce_sign: Spruce Sign + spruce_slab: Spruce Slab + spruce_stairs: Spruce Stairs + spruce_trapdoor: Spruce Trapdoor + spruce_wall_hanging_sign: Spruce Wall Hanging Sign + spruce_wall_sign: Spruce Wall Sign + spruce_wood: Spruce Wood + sticky_piston: Sticky Piston + stone: Stone + stone_brick_slab: Stone Brick Slab + stone_brick_stairs: Stone Brick Stairs + stone_brick_wall: Stone Brick Wall + stone_bricks: Stone Bricks + stone_button: Stone Button + stone_pressure_plate: Stone Pressure Plate + stone_slab: Stone Slab + stone_stairs: Stone Stairs + stonecutter: Stonecutter + stripped_acacia_log: Stripped Acacia Log + stripped_acacia_wood: Stripped Acacia Wood + stripped_bamboo_block: Block of Stripped Bamboo + stripped_birch_log: Stripped Birch Log + stripped_birch_wood: Stripped Birch Wood + stripped_cherry_log: Stripped Cherry Log + stripped_cherry_wood: Stripped Cherry Wood + stripped_crimson_hyphae: Stripped Crimson Hyphae + stripped_crimson_stem: Stripped Crimson Stem + stripped_dark_oak_log: Stripped Dark Oak Log + stripped_dark_oak_wood: Stripped Dark Oak Wood + stripped_jungle_log: Stripped Jungle Log + stripped_jungle_wood: Stripped Jungle Wood + stripped_mangrove_log: Stripped Mangrove Log + stripped_mangrove_wood: Stripped Mangrove Wood + stripped_oak_log: Stripped Oak Log + stripped_oak_wood: Stripped Oak Wood + stripped_spruce_log: Stripped Spruce Log + stripped_spruce_wood: Stripped Spruce Wood + stripped_warped_hyphae: Stripped Warped Hyphae + stripped_warped_stem: Stripped Warped Stem + structure_block: Structure Block + structure_void: Structure Void + sugar_cane: Sugar Cane + sunflower: Sunflower + suspicious_gravel: Suspicious Gravel + suspicious_sand: Suspicious Sand + sweet_berry_bush: Sweet Berry Bush + tall_grass: Tall Grass + tall_seagrass: Tall Seagrass + target: Target + terracotta: Terracotta + tinted_glass: Tinted Glass + tnt: TNT + torch: Torch + torchflower: Torchflower + torchflower_crop: Torchflower Crop + trapped_chest: Trapped Chest + tripwire: Tripwire + tripwire_hook: Tripwire Hook + tube_coral: Tube Coral + tube_coral_block: Tube Coral Block + tube_coral_fan: Tube Coral Fan + tube_coral_wall_fan: Tube Coral Wall Fan + tuff: Tuff + turtle_egg: Turtle Egg + twisting_vines: Twisting Vines + twisting_vines_plant: Twisting Vines Plant + verdant_froglight: Verdant Froglight + vine: Vines + void_air: Void Air + wall_torch: Wall Torch + warped_button: Warped Button + warped_door: Warped Door + warped_fence: Warped Fence + warped_fence_gate: Warped Fence Gate + warped_fungus: Warped Fungus + warped_hanging_sign: Warped Hanging Sign + warped_hyphae: Warped Hyphae + warped_nylium: Warped Nylium + warped_planks: Warped Planks + warped_pressure_plate: Warped Pressure Plate + warped_roots: Warped Roots + warped_sign: Warped Sign + warped_slab: Warped Slab + warped_stairs: Warped Stairs + warped_stem: Warped Stem + warped_trapdoor: Warped Trapdoor + warped_wall_hanging_sign: Warped Wall Hanging Sign + warped_wall_sign: Warped Wall Sign + warped_wart_block: Warped Wart Block + water: Water + water_cauldron: Water Cauldron + waxed_copper_block: Waxed Block of Copper + waxed_cut_copper: Waxed Cut Copper + waxed_cut_copper_slab: Waxed Cut Copper Slab + waxed_cut_copper_stairs: Waxed Cut Copper Stairs + waxed_exposed_copper: Waxed Exposed Copper + waxed_exposed_cut_copper: Waxed Exposed Cut Copper + waxed_exposed_cut_copper_slab: Waxed Exposed Cut Copper Slab + waxed_exposed_cut_copper_stairs: Waxed Exposed Cut Copper Stairs + waxed_oxidized_copper: Waxed Oxidised Copper + waxed_oxidized_cut_copper: Waxed Oxidised Cut Copper + waxed_oxidized_cut_copper_slab: Waxed Oxidised Cut Copper Slab + waxed_oxidized_cut_copper_stairs: Waxed Oxidised Cut Copper Stairs + waxed_weathered_copper: Waxed Weathered Copper + waxed_weathered_cut_copper: Waxed Weathered Cut Copper + waxed_weathered_cut_copper_slab: Waxed Weathered Cut Copper Slab + waxed_weathered_cut_copper_stairs: Waxed Weathered Cut Copper Stairs + weathered_copper: Weathered Copper + weathered_cut_copper: Weathered Cut Copper + weathered_cut_copper_slab: Weathered Cut Copper Slab + weathered_cut_copper_stairs: Weathered Cut Copper Stairs + weeping_vines: Weeping Vines + weeping_vines_plant: Weeping Vines Plant + wet_sponge: Wet Sponge + wheat: Wheat + white_banner: White Banner + white_bed: White Bed + white_candle: White Candle + white_candle_cake: Cake with White Candle + white_carpet: White Carpet + white_concrete: White Concrete + white_concrete_powder: White Concrete Powder + white_glazed_terracotta: White Glazed Terracotta + white_shulker_box: White Shulker Box + white_stained_glass: White Stained Glass + white_stained_glass_pane: White Stained Glass Pane + white_terracotta: White Terracotta + white_tulip: White Tulip + white_wool: White Wool + wither_rose: Wither Rose + wither_skeleton_skull: Wither Skeleton Skull + wither_skeleton_wall_skull: Wither Skeleton Wall Skull + yellow_banner: Yellow Banner + yellow_bed: Yellow Bed + yellow_candle: Yellow Candle + yellow_candle_cake: Cake with Yellow Candle + yellow_carpet: Yellow Carpet + yellow_concrete: Yellow Concrete + yellow_concrete_powder: Yellow Concrete Powder + yellow_glazed_terracotta: Yellow Glazed Terracotta + yellow_shulker_box: Yellow Shulker Box + yellow_stained_glass: Yellow Stained Glass + yellow_stained_glass_pane: Yellow Stained Glass Pane + yellow_terracotta: Yellow Terracotta + yellow_wool: Yellow Wool + zombie_head: Zombie Head + zombie_wall_head: Zombie Wall Head + acacia_boat: Acacia Boat + acacia_chest_boat: Acacia Boat with Chest + allay_spawn_egg: Allay Spawn Egg + amethyst_shard: Amethyst Shard + angler_pottery_shard: Angler Pottery Shard + angler_pottery_sherd: Angler Pottery Sherd + apple: Apple + archer_pottery_shard: Archer Pottery Shard + archer_pottery_sherd: Archer Pottery Sherd + armor_stand: Armour Stand + arms_up_pottery_shard: Arms Up Pottery Shard + arms_up_pottery_sherd: Arms Up Pottery Sherd + arrow: Arrow + axolotl_bucket: Bucket of Axolotl + axolotl_spawn_egg: Axolotl Spawn Egg + baked_potato: Jacket Potato + bamboo_chest_raft: Bamboo Raft with Chest + bamboo_raft: Bamboo Raft + bat_spawn_egg: Bat Spawn Egg + bee_spawn_egg: Bee Spawn Egg + beef: Raw Beef + beetroot: Beetroot + beetroot_seeds: Beetroot Seeds + beetroot_soup: Beetroot Soup + birch_boat: Birch Boat + birch_chest_boat: Birch Boat with Chest + black_dye: Black Dye + blade_pottery_shard: Blade Pottery Shard + blade_pottery_sherd: Blade Pottery Sherd + blaze_powder: Blaze Powder + blaze_rod: Blaze Rod + blaze_spawn_egg: Blaze Spawn Egg + blue_dye: Blue Dye + bone: Bone + bone_meal: Bone Meal + book: Book + bow: Bow + bowl: Bowl + bread: Bread + brewer_pottery_shard: Brewer Pottery Shard + brewer_pottery_sherd: Brewer Pottery Sherd + brick: Brick + brown_dye: Brown Dye + brush: Brush + bucket: Bucket + bundle: Bundle + burn_pottery_shard: Burn Pottery Shard + burn_pottery_sherd: Burn Pottery Sherd + camel_spawn_egg: Camel Spawn Egg + carrot: Carrot + carrot_on_a_stick: Carrot on a Stick + cat_spawn_egg: Cat Spawn Egg + cave_spider_spawn_egg: Cave Spider Spawn Egg + chainmail_boots: Chainmail Boots + chainmail_chestplate: Chainmail Chestplate + chainmail_helmet: Chainmail Helmet + chainmail_leggings: Chainmail Leggings + charcoal: Charcoal + cherry_boat: Cherry Boat + cherry_chest_boat: Cherry Boat with Chest + chest_minecart: Minecart with Chest + chicken: Raw Chicken + chicken_spawn_egg: Chicken Spawn Egg + chorus_fruit: Chorus Fruit + clay_ball: Clay Ball + clock: Clock + coal: Coal + coast_armor_trim_smithing_template: Smithing Template + cocoa_beans: Cocoa Beans + cod: Raw Cod + cod_bucket: Bucket of Cod + cod_spawn_egg: Cod Spawn Egg + command_block_minecart: Minecart with Command Block + compass: Compass + cooked_beef: Steak + cooked_chicken: Roast Chicken + cooked_cod: Cooked Cod + cooked_mutton: Cooked Mutton + cooked_porkchop: Cooked Porkchop + cooked_rabbit: Cooked Rabbit + cooked_salmon: Cooked Salmon + cookie: Biscuit + copper_ingot: Copper Ingot + cow_spawn_egg: Cow Spawn Egg + creeper_banner_pattern: Banner Pattern + creeper_spawn_egg: Creeper Spawn Egg + crossbow: Crossbow + cyan_dye: Cyan Dye + danger_pottery_shard: Danger Pottery Shard + danger_pottery_sherd: Danger Pottery Sherd + dark_oak_boat: Dark Oak Boat + dark_oak_chest_boat: Dark Oak Boat with Chest + debug_stick: Debug Stick + diamond: Diamond + diamond_axe: Diamond Axe + diamond_boots: Diamond Boots + diamond_chestplate: Diamond Chestplate + diamond_helmet: Diamond Helmet + diamond_hoe: Diamond Hoe + diamond_horse_armor: Diamond Horse Armour + diamond_leggings: Diamond Leggings + diamond_pickaxe: Diamond Pickaxe + diamond_shovel: Diamond Shovel + diamond_sword: Diamond Sword + disc_fragment_5: Disc Fragment + dolphin_spawn_egg: Dolphin Spawn Egg + donkey_spawn_egg: Donkey Spawn Egg + dragon_breath: Dragon's Breath + dried_kelp: Dried Kelp + drowned_spawn_egg: Drowned Spawn Egg + dune_armor_trim_smithing_template: Smithing Template + echo_shard: Echo Shard + egg: Egg + elder_guardian_spawn_egg: Elder Guardian Spawn Egg + elytra: Elytra + emerald: Emerald + enchanted_book: Enchanted Book + enchanted_golden_apple: Enchanted Golden Apple + end_crystal: End Crystal + ender_dragon_spawn_egg: Ender Dragon Spawn Egg + ender_eye: Eye of Ender + ender_pearl: Ender Pearl + enderman_spawn_egg: Enderman Spawn Egg + endermite_spawn_egg: Endermite Spawn Egg + evoker_spawn_egg: Evoker Spawn Egg + experience_bottle: Bottle o' Enchanting + explorer_pottery_shard: Explorer Pottery Shard + explorer_pottery_sherd: Explorer Pottery Sherd + eye_armor_trim_smithing_template: Smithing Template + feather: Feather + fermented_spider_eye: Fermented Spider Eye + filled_map: Map + fire_charge: Fire Charge + firework_rocket: Firework Rocket + firework_star: Firework Star + fishing_rod: Fishing Rod + flint: Flint + flint_and_steel: Flint and Steel + flower_banner_pattern: Banner Pattern + fox_spawn_egg: Fox Spawn Egg + friend_pottery_shard: Friend Pottery Shard + friend_pottery_sherd: Friend Pottery Sherd + frog_spawn_egg: Frog Spawn Egg + furnace_minecart: Minecart with Furnace + ghast_spawn_egg: Ghast Spawn Egg + ghast_tear: Ghast Tear + glass_bottle: Glass Bottle + glistering_melon_slice: Glistering Melon Slice + globe_banner_pattern: Banner Pattern + glow_berries: Glow Berries + glow_ink_sac: Glow Ink Sac + glow_item_frame: Glow Item Frame + glow_squid_spawn_egg: Glow Squid Spawn Egg + glowstone_dust: Glowstone Dust + goat_horn: Goat Horn + goat_spawn_egg: Goat Spawn Egg + gold_ingot: Gold Ingot + gold_nugget: Golden Nugget + golden_apple: Golden Apple + golden_axe: Golden Axe + golden_boots: Golden Boots + golden_carrot: Golden Carrot + golden_chestplate: Golden Chestplate + golden_helmet: Golden Helmet + golden_hoe: Golden Hoe + golden_horse_armor: Golden Horse Armour + golden_leggings: Golden Leggings + golden_pickaxe: Golden Pickaxe + golden_shovel: Golden Shovel + golden_sword: Golden Sword + gray_dye: Grey Dye + green_dye: Green Dye + guardian_spawn_egg: Guardian Spawn Egg + gunpowder: Gunpowder + heart_of_the_sea: Heart of the Sea + heart_pottery_shard: Heart Pottery Shard + heart_pottery_sherd: Heart Pottery Sherd + heartbreak_pottery_shard: Heartbreak Pottery Shard + heartbreak_pottery_sherd: Heartbreak Pottery Sherd + hoglin_spawn_egg: Hoglin Spawn Egg + honey_bottle: Honey Bottle + honeycomb: Honeycomb + hopper_minecart: Minecart with Hopper + horse_spawn_egg: Horse Spawn Egg + host_armor_trim_smithing_template: Smithing Template + howl_pottery_shard: Howl Pottery Shard + howl_pottery_sherd: Howl Pottery Sherd + husk_spawn_egg: Husk Spawn Egg + ink_sac: Ink Sac + iron_axe: Iron Axe + iron_boots: Iron Boots + iron_chestplate: Iron Chestplate + iron_golem_spawn_egg: Iron Golem Spawn Egg + iron_helmet: Iron Helmet + iron_hoe: Iron Hoe + iron_horse_armor: Iron Horse Armour + iron_ingot: Iron Ingot + iron_leggings: Iron Leggings + iron_nugget: Iron Nugget + iron_pickaxe: Iron Pickaxe + iron_shovel: Iron Shovel + iron_sword: Iron Sword + item_frame: Item Frame + jungle_boat: Jungle Boat + jungle_chest_boat: Jungle Boat with Chest + knowledge_book: Knowledge Book + lapis_lazuli: Lapis Lazuli + lava_bucket: Lava Bucket + lead: Lead + leather: Leather + leather_boots: Leather Boots + leather_chestplate: Leather Tunic + leather_helmet: Leather Hat + leather_horse_armor: Leather Horse Armour + leather_leggings: Leather Trousers + light_blue_dye: Light Blue Dye + light_gray_dye: Light Grey Dye + lime_dye: Lime Dye + lingering_potion: Lingering Potion + llama_spawn_egg: Llama Spawn Egg + lodestone_compass: Lodestone Compass + magenta_dye: Magenta Dye + magma_cream: Magma Cream + magma_cube_spawn_egg: Magma Cube Spawn Egg + mangrove_boat: Mangrove Boat + mangrove_chest_boat: Mangrove Boat with Chest + map: Empty Map + melon_seeds: Melon Seeds + melon_slice: Melon Slice + milk_bucket: Milk Bucket + minecart: Minecart + miner_pottery_shard: Miner Pottery Shard + miner_pottery_sherd: Miner Pottery Sherd + mojang_banner_pattern: Banner Pattern + mooshroom_spawn_egg: Mooshroom Spawn Egg + mourner_pottery_shard: Mourner Pottery Shard + mourner_pottery_sherd: Mourner Pottery Sherd + mule_spawn_egg: Mule Spawn Egg + mushroom_stew: Mushroom Soup + music_disc_11: Music Disc + music_disc_13: Music Disc + music_disc_5: Music Disc + music_disc_blocks: Music Disc + music_disc_cat: Music Disc + music_disc_chirp: Music Disc + music_disc_far: Music Disc + music_disc_mall: Music Disc + music_disc_mellohi: Music Disc + music_disc_otherside: Music Disc + music_disc_pigstep: Music Disc + music_disc_relic: Music Disc + music_disc_stal: Music Disc + music_disc_strad: Music Disc + music_disc_wait: Music Disc + music_disc_ward: Music Disc + mutton: Raw Mutton + name_tag: Name Tag + nautilus_shell: Nautilus Shell + nether_brick: Nether Brick + nether_star: Nether Star + netherite_axe: Netherite Axe + netherite_boots: Netherite Boots + netherite_chestplate: Netherite Chestplate + netherite_helmet: Netherite Helmet + netherite_hoe: Netherite Hoe + netherite_ingot: Netherite Ingot + netherite_leggings: Netherite Leggings + netherite_pickaxe: Netherite Pickaxe + netherite_scrap: Netherite Scrap + netherite_shovel: Netherite Shovel + netherite_sword: Netherite Sword + netherite_upgrade_smithing_template: Smithing Template + oak_boat: Oak Boat + oak_chest_boat: Oak Boat with Chest + ocelot_spawn_egg: Ocelot Spawn Egg + orange_dye: Orange Dye + painting: Painting + panda_spawn_egg: Panda Spawn Egg + paper: Paper + parrot_spawn_egg: Parrot Spawn Egg + phantom_membrane: Phantom Membrane + phantom_spawn_egg: Phantom Spawn Egg + pig_spawn_egg: Pig Spawn Egg + piglin_banner_pattern: Banner Pattern + piglin_brute_spawn_egg: Piglin Brute Spawn Egg + piglin_spawn_egg: Piglin Spawn Egg + pillager_spawn_egg: Pillager Spawn Egg + pink_dye: Pink Dye + pitcher_pod: Pitcher Pod + plenty_pottery_shard: Plenty Pottery Shard + plenty_pottery_sherd: Plenty Pottery Sherd + poisonous_potato: Poisonous Potato + polar_bear_spawn_egg: Polar Bear Spawn Egg + popped_chorus_fruit: Popped Chorus Fruit + porkchop: Raw Porkchop + potato: Potato + potion: Potion + pottery_shard_archer: Archer Pottery Shard + pottery_shard_arms_up: Arms Up Pottery Shard + pottery_shard_prize: Prize Pottery Shard + pottery_shard_skull: Skull Pottery Shard + powder_snow_bucket: Powder Snow Bucket + prismarine_crystals: Prismarine Crystals + prismarine_shard: Prismarine Shard + prize_pottery_shard: Prize Pottery Shard + prize_pottery_sherd: Prize Pottery Sherd + pufferfish: Pufferfish + pufferfish_bucket: Bucket of Pufferfish + pufferfish_spawn_egg: Pufferfish Spawn Egg + pumpkin_pie: Pumpkin Pie + pumpkin_seeds: Pumpkin Seeds + purple_dye: Purple Dye + quartz: Nether Quartz + rabbit: Raw Rabbit + rabbit_foot: Rabbit's Foot + rabbit_hide: Rabbit Hide + rabbit_spawn_egg: Rabbit Spawn Egg + rabbit_stew: Rabbit Stew + raiser_armor_trim_smithing_template: Smithing Template + ravager_spawn_egg: Ravager Spawn Egg + raw_copper: Raw Copper + raw_gold: Raw Gold + raw_iron: Raw Iron + recovery_compass: Recovery Compass + red_dye: Red Dye + redstone: Redstone Dust + rib_armor_trim_smithing_template: Smithing Template + rotten_flesh: Rotten Flesh + saddle: Saddle + salmon: Raw Salmon + salmon_bucket: Bucket of Salmon + salmon_spawn_egg: Salmon Spawn Egg + scute: Scute + sentry_armor_trim_smithing_template: Smithing Template + shaper_armor_trim_smithing_template: Smithing Template + sheaf_pottery_shard: Sheaf Pottery Shard + sheaf_pottery_sherd: Sheaf Pottery Sherd + shears: Shears + sheep_spawn_egg: Sheep Spawn Egg + shelter_pottery_shard: Shelter Pottery Shard + shelter_pottery_sherd: Shelter Pottery Sherd + shield: Shield + shulker_shell: Shulker Shell + shulker_spawn_egg: Shulker Spawn Egg + sign: Sign + silence_armor_trim_smithing_template: Smithing Template + silverfish_spawn_egg: Silverfish Spawn Egg + skeleton_horse_spawn_egg: Skeleton Horse Spawn Egg + skeleton_spawn_egg: Skeleton Spawn Egg + skull_banner_pattern: Banner Pattern + skull_pottery_shard: Skull Pottery Shard + skull_pottery_sherd: Skull Pottery Sherd + slime_ball: Slimeball + slime_spawn_egg: Slime Spawn Egg + smithing_template: Smithing Template + sniffer_spawn_egg: Sniffer Spawn Egg + snort_pottery_shard: Snort Pottery Shard + snort_pottery_sherd: Snort Pottery Sherd + snout_armor_trim_smithing_template: Smithing Template + snow_golem_spawn_egg: Snow Golem Spawn Egg + snowball: Snowball + spectral_arrow: Spectral Arrow + spider_eye: Spider Eye + spider_spawn_egg: Spider Spawn Egg + spire_armor_trim_smithing_template: Smithing Template + splash_potion: Splash Potion + spruce_boat: Spruce Boat + spruce_chest_boat: Spruce Boat with Chest + spyglass: Spyglass + squid_spawn_egg: Squid Spawn Egg + stick: Stick + stone_axe: Stone Axe + stone_hoe: Stone Hoe + stone_pickaxe: Stone Pickaxe + stone_shovel: Stone Shovel + stone_sword: Stone Sword + stray_spawn_egg: Stray Spawn Egg + strider_spawn_egg: Strider Spawn Egg + string: String + sugar: Sugar + suspicious_stew: Suspicious Stew + sweet_berries: Sweet Berries + tadpole_bucket: Bucket of Tadpole + tadpole_spawn_egg: Tadpole Spawn Egg + tide_armor_trim_smithing_template: Smithing Template + tipped_arrow: Tipped Arrow + tnt_minecart: Minecart with TNT + torchflower_seeds: Torchflower Seeds + totem_of_undying: Totem of Undying + trader_llama_spawn_egg: Trader Llama Spawn Egg + trident: Trident + tropical_fish: Tropical Fish + tropical_fish_bucket: Bucket of Tropical Fish + tropical_fish_spawn_egg: Tropical Fish Spawn Egg + turtle_helmet: Turtle Shell + turtle_spawn_egg: Turtle Spawn Egg + vex_armor_trim_smithing_template: Smithing Template + vex_spawn_egg: Vex Spawn Egg + villager_spawn_egg: Villager Spawn Egg + vindicator_spawn_egg: Vindicator Spawn Egg + wandering_trader_spawn_egg: Wandering Trader Spawn Egg + ward_armor_trim_smithing_template: Smithing Template + warden_spawn_egg: Warden Spawn Egg + warped_fungus_on_a_stick: Warped Fungus on a Stick + water_bucket: Water Bucket + wayfinder_armor_trim_smithing_template: Smithing Template + wheat_seeds: Wheat Seeds + white_dye: White Dye + wild_armor_trim_smithing_template: Smithing Template + witch_spawn_egg: Witch Spawn Egg + wither_skeleton_spawn_egg: Wither Skeleton Spawn Egg + wither_spawn_egg: Wither Spawn Egg + wolf_spawn_egg: Wolf Spawn Egg + wooden_axe: Wooden Axe + wooden_hoe: Wooden Hoe + wooden_pickaxe: Wooden Pickaxe + wooden_shovel: Wooden Shovel + wooden_sword: Wooden Sword + writable_book: Book and Quill + written_book: Written Book + yellow_dye: Yellow Dye + zoglin_spawn_egg: Zoglin Spawn Egg + zombie_horse_spawn_egg: Zombie Horse Spawn Egg + zombie_spawn_egg: Zombie Spawn Egg + zombie_villager_spawn_egg: Zombie Villager Spawn Egg + zombified_piglin_spawn_egg: Zombified Piglin Spawn Egg +Enchantment: + aqua_affinity: Aqua Affinity + bane_of_arthropods: Bane of Arthropods + binding_curse: Curse of Binding + blast_protection: Blast Protection + channeling: Channelling + depth_strider: Depth Strider + efficiency: Efficiency + feather_falling: Feather Falling + fire_aspect: Fire Aspect + fire_protection: Fire Protection + flame: Flame + fortune: Fortune + frost_walker: Frost Walker + impaling: Impaling + infinity: Infinity + knockback: Knockback + looting: Looting + loyalty: Loyalty + luck_of_the_sea: Luck of the Sea + lure: Lure + mending: Mending + multishot: Multishot + piercing: Piercing + power: Power + projectile_protection: Projectile Protection + protection: Protection + punch: Punch + quick_charge: Quick Charge + respiration: Respiration + riptide: Riptide + sharpness: Sharpness + silk_touch: Silk Touch + smite: Smite + soul_speed: Soul Speed + sweeping: Sweeping Edge + swift_sneak: Swift Sneak + thorns: Thorns + unbreaking: Unbreaking + vanishing_curse: Curse of Vanishing diff --git a/assets/es.yml b/assets/es.yml new file mode 100644 index 0000000..1283566 --- /dev/null +++ b/assets/es.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: Allay + area_effect_cloud: Nube de efecto persistente + armor_stand: Soporte para armadura + arrow: Flecha + axolotl: Ajolote + bat: Murciélago + bee: Abeja + blaze: Blaze + block_display: Bloque holográfico + boat: Barca + camel: Camello + cat: Gato + cave_spider: Araña de cueva + chest_boat: Barca con cofre + chest_minecart: Vagoneta con cofre + chicken: Pollo + cod: Bacalao + command_block_minecart: Vagoneta con bloque de comandos + cow: Vaca + creeper: Creeper + dolphin: Delfín + donkey: Burro + dragon_fireball: Bola de fuego de dragón + drowned: Ahogado + egg: Huevo lanzado + elder_guardian: Guardián anciano + end_crystal: Cristal del End + ender_dragon: Enderdragón + ender_pearl: Perla de ender lanzada + enderman: Enderman + endermite: Endermite + evoker: Evocador + evoker_fangs: Colmillos de evocador + experience_bottle: Frasco con experiencia lanzado + experience_orb: Orbe de experiencia + eye_of_ender: Ojo de ender + falling_block: Bloque en caída + falling_block_type: '%s en caída' + fireball: Bola de fuego + firework_rocket: Cohete de fuegos artificiales + fishing_bobber: Anzuelo + fox: Zorro + frog: Rana + furnace_minecart: Vagoneta con horno + ghast: Ghast + giant: Zombi gigante + glow_item_frame: Marco luminoso + glow_squid: Calamar luminoso + goat: Cabra + guardian: Guardián + hoglin: Hoglin + hopper_minecart: Vagoneta con tolva + horse: Caballo + husk: Disecado + illusioner: Ilusionista + interaction: Interacción + iron_golem: Gólem de hierro + item: Objeto + item_display: Objeto holográfico + item_frame: Marco + killer_bunny: El conejo asesino + leash_knot: Nudo de rienda + lightning_bolt: Rayo + llama: Llama + llama_spit: Escupitajo de llama + magma_cube: Cubo de magma + marker: Marcador + minecart: Vagoneta + mooshroom: Mooshroom + mule: Mula + ocelot: Ocelote + painting: Cuadro + panda: Panda + parrot: Loro + phantom: Fantasma + pig: Cerdo + piglin: Piglin + piglin_brute: Piglin bruto + pillager: Saqueador + player: Jugador + polar_bear: Oso polar + potion: Poción + pufferfish: Pez globo + rabbit: Conejo + ravager: Devastador + salmon: Salmón + sheep: Oveja + shulker: Shulker + shulker_bullet: Proyectil de shulker + silverfish: Lepisma + skeleton: Esqueleto + skeleton_horse: Caballo esqueleto + slime: Slime + small_fireball: Bola de fuego pequeña + sniffer: Sniffer + snow_golem: Gólem de nieve + snowball: Bola de nieve + spawner_minecart: Vagoneta con generador de criaturas + spectral_arrow: Flecha espectral + spider: Araña + squid: Calamar + stray: Errante + strider: Lavagante + tadpole: Renacuajo + text_display: Texto holográfico + tnt: Dinamita activada + tnt_minecart: Vagoneta con dinamita + trader_llama: Llama ambulante + trident: Tridente + tropical_fish: Pez tropical + turtle: Tortuga + vex: Vex + villager: Aldeano + vindicator: Vindicador + wandering_trader: Vendedor ambulante + warden: Warden + witch: Bruja + wither: Wither + wither_skeleton: Esqueleto del Wither + wither_skull: Calavera de Wither + wolf: Lobo + zoglin: Zoglin + zombie: Zombi + zombie_horse: Caballo zombi + zombie_villager: Aldeano zombi + zombified_piglin: Piglin zombificado +PotionEffectType: + absorption: Absorción + bad_omen: Mal presagio + blindness: Ceguera + conduit_power: Canalización + darkness: Oscuridad + dolphins_grace: Gracia de delfín + fire_resistance: Cuerpo ignífugo + glowing: Luminiscencia + haste: Prisa minera + health_boost: Salud mejorada + hero_of_the_village: Héroe de la aldea + hunger: Hambre + instant_damage: Daño instantáneo + instant_health: Curación instantánea + invisibility: Invisibilidad + jump_boost: Supersalto + levitation: Levitación + luck: Suerte + mining_fatigue: Fatiga minera + nausea: Náusea + night_vision: Visión nocturna + poison: Veneno + regeneration: Regeneración + resistance: Resistencia + saturation: Saturación + slow_falling: Caída lenta + slowness: Lentitud + speed: Velocidad + strength: Fuerza + unluck: Mala suerte + water_breathing: Apnea + weakness: Debilidad + wither: Descomposición +Material: + acacia_button: Botón de acacia + acacia_door: Puerta de acacia + acacia_fence: Valla de acacia + acacia_fence_gate: Puerta de valla de acacia + acacia_hanging_sign: Cartel colgante de acacia + acacia_leaves: Hojas de acacia + acacia_log: Tronco de acacia + acacia_planks: Tablones de acacia + acacia_pressure_plate: Placa de presión de acacia + acacia_sapling: Brote de acacia + acacia_sign: Cartel de acacia + acacia_slab: Losa de acacia + acacia_stairs: Escaleras de acacia + acacia_trapdoor: Trampilla de acacia + acacia_wall_hanging_sign: Cartel colgante de acacia en pared + acacia_wall_sign: Cartel de acacia en pared + acacia_wood: Leño de acacia + activator_rail: Raíl activador + air: Aire + allium: Allium + amethyst_block: Bloque de amatista + amethyst_cluster: Cúmulo de amatista + ancient_debris: Escombros ancestrales + andesite: Andesita + andesite_slab: Losa de andesita + andesite_stairs: Escaleras de andesita + andesite_wall: Muro de andesita + anvil: Yunque + attached_melon_stem: Tallo de sandía unido + attached_pumpkin_stem: Tallo de calabaza unido + azalea: Azalea + azalea_leaves: Hojas de azalea + azure_bluet: Azure bluet + bamboo: Bambú + bamboo_block: Bloque de bambú + bamboo_button: Botón de bambú + bamboo_door: Puerta de bambú + bamboo_fence: Valla de bambú + bamboo_fence_gate: Puerta de valla de bambú + bamboo_hanging_sign: Cartel colgante de bambú + bamboo_mosaic: Mosaico de bambú + bamboo_mosaic_slab: Losa de mosaico de bambú + bamboo_mosaic_stairs: Escaleras de mosaico de bambú + bamboo_planks: Tablones de bambú + bamboo_pressure_plate: Placa de presión de bambú + bamboo_sapling: Esqueje de bambú + bamboo_sign: Cartel de bambú + bamboo_slab: Losa de bambú + bamboo_stairs: Escaleras de bambú + bamboo_trapdoor: Trampilla de bambú + bamboo_wall_hanging_sign: Cartel colgante de bambú en pared + bamboo_wall_sign: Cartel de bambú en pared + barrel: Barril + barrier: Barrera + basalt: Basalto + beacon: Faro + bedrock: Piedra base + bee_nest: Colmena + beehive: Apiario + beetroots: Remolachas + bell: Campana + big_dripleaf: Plantaforma grande + big_dripleaf_stem: Tallo de plantaforma grande + birch_button: Botón de abedul + birch_door: Puerta de abedul + birch_fence: Valla de abedul + birch_fence_gate: Puerta de valla de abedul + birch_hanging_sign: Cartel colgante de abedul + birch_leaves: Hojas de abedul + birch_log: Tronco de abedul + birch_planks: Tablones de abedul + birch_pressure_plate: Placa de presión de abedul + birch_sapling: Brote de abedul + birch_sign: Cartel de abedul + birch_slab: Losa de abedul + birch_stairs: Escaleras de abedul + birch_trapdoor: Trampilla de abedul + birch_wall_hanging_sign: Cartel colgante de abedul en pared + birch_wall_sign: Cartel de abedul en pared + birch_wood: Leño de abedul + black_banner: Estandarte negro + black_bed: Cama negra + black_candle: Vela negra + black_candle_cake: Tarta con vela negra + black_carpet: Alfombra negra + black_concrete: Hormigón negro + black_concrete_powder: Cemento negro + black_glazed_terracotta: Azulejo negro + black_shulker_box: Caja de shulker negra + black_stained_glass: Cristal tintado de negro + black_stained_glass_pane: Panel de cristal tintado de negro + black_terracotta: Terracota negra + black_wool: Lana negra + blackstone: Piedra negra + blackstone_slab: Losa de piedra negra + blackstone_stairs: Escaleras de piedra negra + blackstone_wall: Muro de piedra negra + blast_furnace: Alto horno + blue_banner: Estandarte azul + blue_bed: Cama azul + blue_candle: Vela azul + blue_candle_cake: Tarta con vela azul + blue_carpet: Alfombra azul + blue_concrete: Hormigón azul + blue_concrete_powder: Cemento azul + blue_glazed_terracotta: Azulejo azul + blue_ice: Hielo azul + blue_orchid: Orquídea azul + blue_shulker_box: Caja de shulker azul + blue_stained_glass: Cristal tintado de azul + blue_stained_glass_pane: Panel de cristal tintado de azul + blue_terracotta: Terracota azul + blue_wool: Lana azul + bone_block: Bloque de huesos + bookshelf: Librería + brain_coral: Coral de cerebro + brain_coral_block: Bloque de coral de cerebro + brain_coral_fan: Gorgonia de cerebro + brain_coral_wall_fan: Gorgonia de cerebro en pared + brewing_stand: Soporte para pociones + brick_slab: Losa de ladrillos + brick_stairs: Escaleras de ladrillos + brick_wall: Muro de ladrillos + bricks: Ladrillos + brown_banner: Estandarte marrón + brown_bed: Cama marrón + brown_candle: Vela marrón + brown_candle_cake: Tarta con vela marrón + brown_carpet: Alfombra marrón + brown_concrete: Hormigón marrón + brown_concrete_powder: Cemento marrón + brown_glazed_terracotta: Azulejo marrón + brown_mushroom: Champiñón marrón + brown_mushroom_block: Bloque de champiñón marrón + brown_shulker_box: Caja de shulker marrón + brown_stained_glass: Cristal tintado de marrón + brown_stained_glass_pane: Panel de cristal tintado de marrón + brown_terracotta: Terracota marrón + brown_wool: Lana marrón + bubble_column: Columna de burbujas + bubble_coral: Coral de burbuja + bubble_coral_block: Bloque de coral de burbuja + bubble_coral_fan: Gorgonia de burbuja + bubble_coral_wall_fan: Gorgonia de burbuja en pared + budding_amethyst: Brotador de amatista + cactus: Cactus + cake: Tarta + calcite: Calcita + calibrated_sculk_sensor: Sensor de sculk calibrado + campfire: Hoguera + candle: Vela + candle_cake: Tarta con vela + carrots: Zanahorias + cartography_table: Mesa de cartografía + carved_pumpkin: Calabaza tallada + cauldron: Caldero + cave_air: Aire de cueva + cave_vines: Enredaderas de cueva + cave_vines_plant: Planta de enredaderas de cueva + chain: Cadena + chain_command_block: Bloque de comandos en cadena + cherry_button: Botón de cerezo + cherry_door: Puerta de cerezo + cherry_fence: Valla de cerezo + cherry_fence_gate: Puerta de valla de cerezo + cherry_hanging_sign: Cartel colgante de cerezo + cherry_leaves: Hojas de cerezo + cherry_log: Tronco de cerezo + cherry_planks: Tablones de cerezo + cherry_pressure_plate: Placa de presión de cerezo + cherry_sapling: Brote de cerezo + cherry_sign: Cartel de cerezo + cherry_slab: Losa de cerezo + cherry_stairs: Escaleras de cerezo + cherry_trapdoor: Trampilla de cerezo + cherry_wall_hanging_sign: Cartel colgante de cerezo en pared + cherry_wall_sign: Cartel colgante de cerezo + cherry_wood: Leño de cerezo + chest: Cofre + chipped_anvil: Yunque dañado + chiseled_bookshelf: Estantería + chiseled_deepslate: Pizarra profunda cincelada + chiseled_nether_bricks: Ladrillos del Nether cincelados + chiseled_polished_blackstone: Piedra negra pulida cincelada + chiseled_quartz_block: Cuarzo cincelado + chiseled_red_sandstone: Arenisca roja cincelada + chiseled_sandstone: Arenisca cincelada + chiseled_stone_bricks: Ladrillos de piedra cincelados + chorus_flower: Flor chorus + chorus_plant: Planta chorus + clay: Bloque de arcilla + coal_block: Bloque de carbón + coal_ore: Mena de carbón + coarse_dirt: Tierra estéril + cobbled_deepslate: Pizarra profunda rocosa + cobbled_deepslate_slab: Losa de pizarra profunda rocosa + cobbled_deepslate_stairs: Escaleras de pizarra profunda rocosa + cobbled_deepslate_wall: Muro de pizarra profunda rocosa + cobblestone: Roca + cobblestone_slab: Losa de roca + cobblestone_stairs: Escaleras de roca + cobblestone_wall: Muro de roca + cobweb: Telaraña + cocoa: Cacao + command_block: Bloque de comandos + comparator: Comparador de redstone + composter: Compostador + conduit: Canalizador + copper_block: Bloque de cobre + copper_ore: Mena de cobre + cornflower: Aciano + cracked_deepslate_bricks: Ladrillos de pizarra profunda agrietados + cracked_deepslate_tiles: Baldosas de pizarra profunda agrietadas + cracked_nether_bricks: Ladrillos del Nether agrietados + cracked_polished_blackstone_bricks: Ladrillos de piedra negra pulida agrietados + cracked_stone_bricks: Ladrillos de piedra agrietados + crafting_table: Mesa de trabajo + creeper_head: Cabeza de creeper + creeper_wall_head: Cabeza de creeper en pared + crimson_button: Botón carmesí + crimson_door: Puerta carmesí + crimson_fence: Valla carmesí + crimson_fence_gate: Puerta de valla carmesí + crimson_fungus: Hongo carmesí + crimson_hanging_sign: Cartel colgante carmesí + crimson_hyphae: Hifas carmesí + crimson_nylium: Necelio carmesí + crimson_planks: Tablones carmesí + crimson_pressure_plate: Placa de presión carmesí + crimson_roots: Raíces carmesí + crimson_sign: Cartel carmesí + crimson_slab: Losa carmesí + crimson_stairs: Escaleras carmesí + crimson_stem: Tallo carmesí + crimson_trapdoor: Trampilla carmesí + crimson_wall_hanging_sign: Cartel colgante carmesí en pared + crimson_wall_sign: Cartel carmesí en pared + crying_obsidian: Obsidiana llorosa + cut_copper: Cobre cortado + cut_copper_slab: Losa de cobre cortado + cut_copper_stairs: Escaleras de cobre cortado + cut_red_sandstone: Arenisca roja cortada + cut_red_sandstone_slab: Losa de arenisca roja cortada + cut_sandstone: Arenisca cortada + cut_sandstone_slab: Losa de arenisca cortada + cyan_banner: Estandarte cian + cyan_bed: Cama cian + cyan_candle: Vela cian + cyan_candle_cake: Tarta con vela cian + cyan_carpet: Alfombra cian + cyan_concrete: Hormigón cian + cyan_concrete_powder: Cemento cian + cyan_glazed_terracotta: Azulejo cian + cyan_shulker_box: Caja de shulker cian + cyan_stained_glass: Cristal tintado de cian + cyan_stained_glass_pane: Panel de cristal tintado de cian + cyan_terracotta: Terracota cian + cyan_wool: Lana cian + damaged_anvil: Yunque muy dañado + dandelion: Diente de león + dark_oak_button: Botón de roble oscuro + dark_oak_door: Puerta de roble oscuro + dark_oak_fence: Valla de roble oscuro + dark_oak_fence_gate: Puerta de valla de roble oscuro + dark_oak_hanging_sign: Cartel colgante de roble oscuro + dark_oak_leaves: Hojas de roble oscuro + dark_oak_log: Tronco de roble oscuro + dark_oak_planks: Tablones de roble oscuro + dark_oak_pressure_plate: Placa de presión de roble oscuro + dark_oak_sapling: Brote de roble oscuro + dark_oak_sign: Cartel de roble oscuro + dark_oak_slab: Losa de roble oscuro + dark_oak_stairs: Escaleras de roble oscuro + dark_oak_trapdoor: Trampilla de roble oscuro + dark_oak_wall_hanging_sign: Cartel colgante de roble oscuro en pared + dark_oak_wall_sign: Cartel de roble oscuro en pared + dark_oak_wood: Leño de roble oscuro + dark_prismarine: Prismarina oscura + dark_prismarine_slab: Losa de prismarina oscura + dark_prismarine_stairs: Escaleras de prismarina oscura + daylight_detector: Sensor de luz solar + dead_brain_coral: Coral de cerebro muerto + dead_brain_coral_block: Bloque de coral de cerebro muerto + dead_brain_coral_fan: Gorgonia de cerebro muerta + dead_brain_coral_wall_fan: Gorgonia de cerebro muerta en pared + dead_bubble_coral: Coral de burbuja muerto + dead_bubble_coral_block: Bloque de coral de burbuja muerto + dead_bubble_coral_fan: Gorgonia de burbuja muerta + dead_bubble_coral_wall_fan: Gorgonia de burbuja muerta en pared + dead_bush: Arbusto muerto + dead_fire_coral: Coral de fuego muerto + dead_fire_coral_block: Bloque de coral de fuego muerto + dead_fire_coral_fan: Gorgonia de fuego muerta + dead_fire_coral_wall_fan: Gorgonia de fuego muerta en pared + dead_horn_coral: Coral de cuerno muerto + dead_horn_coral_block: Bloque de coral de cuerno muerto + dead_horn_coral_fan: Gorgonia de cuerno muerta + dead_horn_coral_wall_fan: Gorgonia de cuerno muerta en pared + dead_tube_coral: Coral de tubo muerto + dead_tube_coral_block: Bloque de coral de tubo muerto + dead_tube_coral_fan: Gorgonia de tubo muerta + dead_tube_coral_wall_fan: Gorgonia de tubo muerta en pared + decorated_pot: Vasija decorada + deepslate: Pizarra profunda + deepslate_brick_slab: Losa de ladrillos de pizarra profunda + deepslate_brick_stairs: Escaleras de ladrillos de pizarra profunda + deepslate_brick_wall: Muro de ladrillos de pizarra profunda + deepslate_bricks: Ladrillos de pizarra profunda + deepslate_coal_ore: Mena de carbón de pizarra profunda + deepslate_copper_ore: Mena de cobre de pizarra profunda + deepslate_diamond_ore: Mena de diamante de pizarra profunda + deepslate_emerald_ore: Mena de esmeralda de pizarra profunda + deepslate_gold_ore: Mena de oro de pizarra profunda + deepslate_iron_ore: Mena de hierro de pizarra profunda + deepslate_lapis_ore: Mena de lapislázuli de pizarra profunda + deepslate_redstone_ore: Mena de redstone de pizarra profunda + deepslate_tile_slab: Losa de baldosas de pizarra profunda + deepslate_tile_stairs: Escaleras de baldosas de pizarra profunda + deepslate_tile_wall: Muro de baldosas de pizarra profunda + deepslate_tiles: Baldosas de pizarra profunda + detector_rail: Raíl detector + diamond_block: Bloque de diamante + diamond_ore: Mena de diamante + diorite: Diorita + diorite_slab: Losa de diorita + diorite_stairs: Escaleras de diorita + diorite_wall: Muro de diorita + dirt: Tierra + dirt_path: Camino de tierra + dispenser: Dispensador + dragon_egg: Huevo de dragón + dragon_head: Cabeza de dragón + dragon_wall_head: Cabeza de dragón en pared + dried_kelp_block: Bloque de algas secas + dripstone_block: Bloque de espeleotema + dropper: Soltador + emerald_block: Bloque de esmeralda + emerald_ore: Mena de esmeralda + enchanting_table: Mesa de encantamientos + end_gateway: Nexo del End + end_portal: Portal del End + end_portal_frame: Marco del portal del End + end_rod: Vara del End + end_stone: Piedra del End + end_stone_brick_slab: Losa de ladrillos de piedra del End + end_stone_brick_stairs: Escaleras de ladrillos de piedra del End + end_stone_brick_wall: Muro de ladrillos de piedra del End + end_stone_bricks: Ladrillos de piedra del End + ender_chest: Cofre de ender + exposed_copper: Cobre expuesto + exposed_cut_copper: Cobre cortado expuesto + exposed_cut_copper_slab: Losa de cobre cortado expuesto + exposed_cut_copper_stairs: Escaleras de cobre cortado expuesto + farmland: Tierra de cultivo + fern: Helecho + fire: Fuego + fire_coral: Coral de fuego + fire_coral_block: Bloque de coral de fuego + fire_coral_fan: Gorgonia de fuego + fire_coral_wall_fan: Gorgonia de fuego en pared + fletching_table: Mesa de flechas + flower_pot: Maceta + flowering_azalea: Azalea florecida + flowering_azalea_leaves: Hojas de azalea florecida + frogspawn: Huevas de rana + frosted_ice: Hielo escarchado + furnace: Horno + gilded_blackstone: Piedra negra áurea + glass: Cristal + glass_pane: Panel de cristal + glow_lichen: Liquen luminoso + glowstone: Piedra luminosa + gold_block: Bloque de oro + gold_ore: Mena de oro + granite: Granito + granite_slab: Losa de granito + granite_stairs: Escaleras de granito + granite_wall: Muro de granito + grass: Hierba + grass_block: Césped + gravel: Grava + gray_banner: Estandarte gris + gray_bed: Cama gris + gray_candle: Vela gris + gray_candle_cake: Tarta con vela gris + gray_carpet: Alfombra gris + gray_concrete: Hormigón gris + gray_concrete_powder: Cemento gris + gray_glazed_terracotta: Azulejo gris + gray_shulker_box: Caja de shulker gris + gray_stained_glass: Cristal tintado de gris + gray_stained_glass_pane: Panel de cristal tintado de gris + gray_terracotta: Terracota gris + gray_wool: Lana gris + green_banner: Estandarte verde + green_bed: Cama verde + green_candle: Vela verde + green_candle_cake: Tarta con vela verde + green_carpet: Alfombra verde + green_concrete: Hormigón verde + green_concrete_powder: Cemento verde + green_glazed_terracotta: Azulejo verde + green_shulker_box: Caja de shulker verde + green_stained_glass: Cristal tintado de verde + green_stained_glass_pane: Panel de cristal tintado de verde + green_terracotta: Terracota verde + green_wool: Lana verde + grindstone: Afiladora + hanging_roots: Raíces colgantes + hay_block: Bala de heno + heavy_weighted_pressure_plate: Placa de presión para peso elevado + honey_block: Bloque de miel + honeycomb_block: Bloque de panal + hopper: Tolva + horn_coral: Coral de cuerno + horn_coral_block: Bloque de coral de cuerno + horn_coral_fan: Gorgonia de cuerno + horn_coral_wall_fan: Gorgonia de cuerno en pared + ice: Hielo + infested_chiseled_stone_bricks: Ladrillos de piedra cincelados infestados + infested_cobblestone: Roca infestada + infested_cracked_stone_bricks: Ladrillos de piedra agrietados infestados + infested_deepslate: Pizarra profunda infestada + infested_mossy_stone_bricks: Ladrillos de piedra musgosos infestados + infested_stone: Piedra infestada + infested_stone_bricks: Ladrillos de piedra infestados + iron_bars: Barrotes de hierro + iron_block: Bloque de hierro + iron_door: Puerta de hierro + iron_ore: Mena de hierro + iron_trapdoor: Trampilla de hierro + jack_o_lantern: Calabaza de Halloween + jigsaw: Bloque rompecabezas + jukebox: Tocadiscos + jungle_button: Botón de jungla + jungle_door: Puerta de jungla + jungle_fence: Valla de jungla + jungle_fence_gate: Puerta de valla de jungla + jungle_hanging_sign: Cartel colgante de jungla + jungle_leaves: Hojas de jungla + jungle_log: Tronco de jungla + jungle_planks: Tablones de jungla + jungle_pressure_plate: Placa de presión de jungla + jungle_sapling: Brote de jungla + jungle_sign: Cartel de jungla + jungle_slab: Losa de jungla + jungle_stairs: Escaleras de jungla + jungle_trapdoor: Trampilla de jungla + jungle_wall_hanging_sign: Cartel colgante de jungla en pared + jungle_wall_sign: Cartel de jungla en pared + jungle_wood: Leño de jungla + kelp: Alga + kelp_plant: Tallo de alga + ladder: Escalera de mano + lantern: Farol + lapis_block: Bloque de lapislázuli + lapis_ore: Mena de lapislázuli + large_amethyst_bud: Brote de amatista grande + large_fern: Helecho grande + lava: Lava + lava_cauldron: Caldero con lava + lectern: Atril + lever: Palanca + light: Luz + light_blue_banner: Estandarte azul claro + light_blue_bed: Cama azul claro + light_blue_candle: Vela azul claro + light_blue_candle_cake: Tarta con vela azul claro + light_blue_carpet: Alfombra azul claro + light_blue_concrete: Hormigón azul claro + light_blue_concrete_powder: Cemento azul claro + light_blue_glazed_terracotta: Azulejo azul claro + light_blue_shulker_box: Caja de shulker azul claro + light_blue_stained_glass: Cristal tintado de azul claro + light_blue_stained_glass_pane: Panel de cristal tintado de azul claro + light_blue_terracotta: Terracota azul claro + light_blue_wool: Lana azul claro + light_gray_banner: Estandarte gris claro + light_gray_bed: Cama gris claro + light_gray_candle: Vela gris claro + light_gray_candle_cake: Tarta con vela gris claro + light_gray_carpet: Alfombra gris claro + light_gray_concrete: Hormigón gris claro + light_gray_concrete_powder: Cemento gris claro + light_gray_glazed_terracotta: Azulejo gris claro + light_gray_shulker_box: Caja de shulker gris claro + light_gray_stained_glass: Cristal tintado de gris claro + light_gray_stained_glass_pane: Panel de cristal tintado de gris claro + light_gray_terracotta: Terracota gris claro + light_gray_wool: Lana gris claro + light_weighted_pressure_plate: Placa de presión para peso ligero + lightning_rod: Pararrayos + lilac: Lila + lily_of_the_valley: Convalaria + lily_pad: Nenúfar + lime_banner: Estandarte verde lima + lime_bed: Cama verde lima + lime_candle: Vela verde lima + lime_candle_cake: Tarta con vela verde lima + lime_carpet: Alfombra verde lima + lime_concrete: Hormigón verde lima + lime_concrete_powder: Cemento verde lima + lime_glazed_terracotta: Azulejo verde lima + lime_shulker_box: Caja de shulker verde lima + lime_stained_glass: Cristal tintado de verde lima + lime_stained_glass_pane: Panel de cristal tintado de verde lima + lime_terracotta: Terracota verde lima + lime_wool: Lana lima + lodestone: Magnetita + loom: Telar + magenta_banner: Estandarte magenta + magenta_bed: Cama magenta + magenta_candle: Vela magenta + magenta_candle_cake: Tarta con vela magenta + magenta_carpet: Alfombra magenta + magenta_concrete: Hormigón magenta + magenta_concrete_powder: Cemento magenta + magenta_glazed_terracotta: Azulejo magenta + magenta_shulker_box: Caja de shulker magenta + magenta_stained_glass: Cristal tintado de magenta + magenta_stained_glass_pane: Panel de cristal tintado de magenta + magenta_terracotta: Terracota magenta + magenta_wool: Lana magenta + magma_block: Bloque de magma + mangrove_button: Botón de mangle + mangrove_door: Puerta de mangle + mangrove_fence: Valla de mangle + mangrove_fence_gate: Puerta de valla de mangle + mangrove_hanging_sign: Cartel colgante de mangle + mangrove_leaves: Hojas de mangle + mangrove_log: Tronco de mangle + mangrove_planks: Tablones de mangle + mangrove_pressure_plate: Placa de presión de mangle + mangrove_propagule: Propágulo de mangle + mangrove_roots: Raíces de mangle + mangrove_sign: Cartel de mangle + mangrove_slab: Losa de mangle + mangrove_stairs: Escaleras de mangle + mangrove_trapdoor: Trampilla de mangle + mangrove_wall_hanging_sign: Cartel colgante de mangle en pared + mangrove_wall_sign: Cartel de mangle en pared + mangrove_wood: Leño de mangle + medium_amethyst_bud: Brote de amatista mediano + melon: Sandía + melon_stem: Tallo de sandía + moss_block: Bloque de musgo + moss_carpet: Capa de musgo + mossy_cobblestone: Roca musgosa + mossy_cobblestone_slab: Losa de roca musgosa + mossy_cobblestone_stairs: Escaleras de roca musgosa + mossy_cobblestone_wall: Muro de roca musgosa + mossy_stone_brick_slab: Losa de ladrillos de piedra musgosos + mossy_stone_brick_stairs: Escaleras de ladrillos de piedra musgosos + mossy_stone_brick_wall: Muro de ladrillos de piedra musgosos + mossy_stone_bricks: Ladrillos de piedra musgosos + moving_piston: Pistón en movimiento + mud: Barro + mud_brick_slab: Losa de ladrillos de adobe + mud_brick_stairs: Escaleras de ladrillos de adobe + mud_brick_wall: Muro de ladrillos de adobe + mud_bricks: Ladrillos de adobe + muddy_mangrove_roots: Raíces de mangle embarradas + mushroom_stem: Tallo de champiñón + mycelium: Micelio + nether_brick_fence: Valla de ladrillos del Nether + nether_brick_slab: Losa de ladrillos del Nether + nether_brick_stairs: Escaleras de ladrillos del Nether + nether_brick_wall: Muro de ladrillos del Nether + nether_bricks: Ladrillos del Nether + nether_gold_ore: Mena de oro del Nether + nether_portal: Portal del Nether + nether_quartz_ore: Mena de cuarzo del Nether + nether_sprouts: Rastrojo del Nether + nether_wart: Verruga del Nether + nether_wart_block: Bloque de verrugas del Nether + netherite_block: Bloque de netherita + netherrack: Netherrack + note_block: Bloque musical + oak_button: Botón de roble + oak_door: Puerta de roble + oak_fence: Valla de roble + oak_fence_gate: Puerta de valla de roble + oak_hanging_sign: Cartel colgante de roble + oak_leaves: Hojas de roble + oak_log: Tronco de roble + oak_planks: Tablones de roble + oak_pressure_plate: Placa de presión de roble + oak_sapling: Brote de roble + oak_sign: Cartel de roble + oak_slab: Losa de roble + oak_stairs: Escaleras de roble + oak_trapdoor: Trampilla de roble + oak_wall_hanging_sign: Cartel colgante de roble en pared + oak_wall_sign: Cartel de roble en pared + oak_wood: Leño de roble + observer: Observador + obsidian: Obsidiana + ochre_froglight: Ranaluz ocre + ominous_banner: Estandarte ominoso + orange_banner: Estandarte naranja + orange_bed: Cama naranja + orange_candle: Vela naranja + orange_candle_cake: Tarta con vela naranja + orange_carpet: Alfombra naranja + orange_concrete: Hormigón naranja + orange_concrete_powder: Cemento naranja + orange_glazed_terracotta: Azulejo naranja + orange_shulker_box: Caja de shulker naranja + orange_stained_glass: Cristal tintado de naranja + orange_stained_glass_pane: Panel de cristal tintado de naranja + orange_terracotta: Terracota naranja + orange_tulip: Tulipán naranja + orange_wool: Lana naranja + oxeye_daisy: Margarita + oxidized_copper: Cobre oxidado + oxidized_cut_copper: Cobre cortado oxidado + oxidized_cut_copper_slab: Losa de cobre cortado oxidado + oxidized_cut_copper_stairs: Escaleras de cobre cortado oxidado + packed_ice: Hielo compacto + packed_mud: Adobe + pearlescent_froglight: Ranaluz nacarada + peony: Peonía + petrified_oak_slab: Losa de roble petrificada + piglin_head: Cabeza de piglin + piglin_wall_head: Cabeza de piglin en pared + pink_banner: Estandarte rosa + pink_bed: Cama rosa + pink_candle: Vela rosa + pink_candle_cake: Tarta con vela rosa + pink_carpet: Alfombra rosa + pink_concrete: Hormigón rosa + pink_concrete_powder: Cemento rosa + pink_glazed_terracotta: Azulejo rosa + pink_petals: Pétalos rosas + pink_shulker_box: Caja de shulker rosa + pink_stained_glass: Cristal tintado de rosa + pink_stained_glass_pane: Panel de cristal tintado de rosa + pink_terracotta: Terracota rosa + pink_tulip: Tulipán rosa + pink_wool: Lana rosa + piston: Pistón + piston_head: Cabeza de pistón + pitcher_crop: Cultivo de planta odre + pitcher_plant: Planta odre + player_head: Cabeza de jugador + player_wall_head: Cabeza de jugador en pared + podzol: Podsol + pointed_dripstone: Espeleotema puntiagudo + polished_andesite: Andesita pulida + polished_andesite_slab: Losa de andesita pulida + polished_andesite_stairs: Escaleras de andesita pulida + polished_basalt: Basalto pulido + polished_blackstone: Piedra negra pulida + polished_blackstone_brick_slab: Losa de ladrillos de piedra negra pulida + polished_blackstone_brick_stairs: Escaleras de ladrillos de piedra negra pulida + polished_blackstone_brick_wall: Muro de ladrillos de piedra negra pulida + polished_blackstone_bricks: Ladrillos de piedra negra pulida + polished_blackstone_button: Botón de piedra negra pulida + polished_blackstone_pressure_plate: Placa de presión de piedra negra pulida + polished_blackstone_slab: Losa de piedra negra pulida + polished_blackstone_stairs: Escaleras de piedra negra pulida + polished_blackstone_wall: Muro de piedra negra pulida + polished_deepslate: Pizarra profunda pulida + polished_deepslate_slab: Losa de pizarra profunda pulida + polished_deepslate_stairs: Escaleras de pizarra profunda pulida + polished_deepslate_wall: Muro de pizarra profunda pulida + polished_diorite: Diorita pulida + polished_diorite_slab: Losa de diorita pulida + polished_diorite_stairs: Escaleras de diorita pulida + polished_granite: Granito pulido + polished_granite_slab: Losa de granito pulido + polished_granite_stairs: Escaleras de granito pulido + poppy: Amapola + potatoes: Patatas + potted_acacia_sapling: Maceta con brote de acacia + potted_allium: Maceta con allium + potted_azalea_bush: Maceta con azalea + potted_azure_bluet: Maceta con azure bluet + potted_bamboo: Maceta con bambú + potted_birch_sapling: Maceta con brote de abedul + potted_blue_orchid: Maceta con orquídea azul + potted_brown_mushroom: Maceta con champiñón marrón + potted_cactus: Maceta con cactus + potted_cherry_sapling: Maceta con brote de cerezo + potted_cornflower: Maceta con aciano + potted_crimson_fungus: Maceta con hongo carmesí + potted_crimson_roots: Maceta con raíces carmesí + potted_dandelion: Maceta con diente de león + potted_dark_oak_sapling: Maceta con brote de roble oscuro + potted_dead_bush: Maceta con arbusto muerto + potted_fern: Maceta con helecho + potted_flowering_azalea_bush: Maceta con azalea florecida + potted_jungle_sapling: Maceta con brote de jungla + potted_lily_of_the_valley: Maceta con convalaria + potted_mangrove_propagule: Maceta con propágulo de mangle + potted_oak_sapling: Maceta con brote de roble + potted_orange_tulip: Maceta con tulipán naranja + potted_oxeye_daisy: Maceta con margarita + potted_pink_tulip: Maceta con tulipán rosa + potted_poppy: Maceta con amapola + potted_red_mushroom: Maceta con champiñón rojo + potted_red_tulip: Maceta con tulipán rojo + potted_spruce_sapling: Maceta con brote de abeto + potted_torchflower: Maceta con plantorcha + potted_warped_fungus: Maceta con hongo distorsionado + potted_warped_roots: Maceta con raíces distorsionadas + potted_white_tulip: Maceta con tulipán blanco + potted_wither_rose: Maceta con rosa del Wither + powder_snow: Nieve polvo + powder_snow_cauldron: Caldero con nieve polvo + powered_rail: Raíl propulsor + prismarine: Prismarina + prismarine_brick_slab: Losa de ladrillos de prismarina + prismarine_brick_stairs: Escaleras de ladrillos de prismarina + prismarine_bricks: Ladrillos de prismarina + prismarine_slab: Losa de prismarina + prismarine_stairs: Escaleras de prismarina + prismarine_wall: Muro de prismarina + pumpkin: Calabaza + pumpkin_stem: Tallo de calabaza + purple_banner: Estandarte morado + purple_bed: Cama morada + purple_candle: Vela morada + purple_candle_cake: Tarta con vela morada + purple_carpet: Alfombra morada + purple_concrete: Hormigón morado + purple_concrete_powder: Cemento morado + purple_glazed_terracotta: Azulejo morado + purple_shulker_box: Caja de shulker morada + purple_stained_glass: Cristal tintado de morado + purple_stained_glass_pane: Panel de cristal tintado de morado + purple_terracotta: Terracota morada + purple_wool: Lana morada + purpur_block: Bloque de purpur + purpur_pillar: Pilar de purpur + purpur_slab: Losa de purpur + purpur_stairs: Escaleras de purpur + quartz_block: Cuarzo + quartz_bricks: Ladrillos de cuarzo + quartz_pillar: Pilar de cuarzo + quartz_slab: Losa de cuarzo + quartz_stairs: Escaleras de cuarzo + rail: Raíl + raw_copper_block: Bloque de cobre en bruto + raw_gold_block: Bloque de oro en bruto + raw_iron_block: Bloque de hierro en bruto + red_banner: Estandarte rojo + red_bed: Cama roja + red_candle: Vela roja + red_candle_cake: Tarta con vela roja + red_carpet: Alfombra roja + red_concrete: Hormigón rojo + red_concrete_powder: Cemento rojo + red_glazed_terracotta: Azulejo rojo + red_mushroom: Champiñón rojo + red_mushroom_block: Bloque de champiñón rojo + red_nether_brick_slab: Losa de ladrillos del Nether rojos + red_nether_brick_stairs: Escaleras de ladrillos del Nether rojos + red_nether_brick_wall: Muro de ladrillos del Nether rojos + red_nether_bricks: Ladrillos del Nether rojos + red_sand: Arena roja + red_sandstone: Arenisca roja + red_sandstone_slab: Losa de arenisca roja + red_sandstone_stairs: Escaleras de arenisca roja + red_sandstone_wall: Muro de arenisca roja + red_shulker_box: Caja de shulker roja + red_stained_glass: Cristal tintado de rojo + red_stained_glass_pane: Panel de cristal tintado de rojo + red_terracotta: Terracota roja + red_tulip: Tulipán rojo + red_wool: Lana roja + redstone_block: Bloque de redstone + redstone_lamp: Lámpara de redstone + redstone_ore: Mena de redstone + redstone_torch: Antorcha de redstone + redstone_wall_torch: Antorcha de redstone en pared + redstone_wire: Cable de redstone + reinforced_deepslate: Pizarra profunda reforzada + repeater: Repetidor de redstone + repeating_command_block: Bloque de comando de repetición + respawn_anchor: Nexo de reaparición + rooted_dirt: Tierra enraizada + rose_bush: Rosal + sand: Arena + sandstone: Arenisca + sandstone_slab: Losa de arenisca + sandstone_stairs: Escaleras de arenisca + sandstone_wall: Muro de arenisca + scaffolding: Andamio + sculk: Sculk + sculk_catalyst: Catalizador de sculk + sculk_sensor: Sensor de sculk + sculk_shrieker: Chillador de sculk + sculk_vein: Vena de sculk + sea_lantern: Linterna marina + sea_pickle: Pepino de mar + seagrass: Hierba marina + set_spawn: Se ha establecido el punto de reaparición + shroomlight: Brillongo + shulker_box: Caja de shulker + skeleton_skull: Calavera de esqueleto + skeleton_wall_skull: Calavera de esqueleto en pared + slime_block: Bloque de slime + small_amethyst_bud: Brote de amatista pequeño + small_dripleaf: Plantaforma pequeña + smithing_table: Mesa de herrería + smoker: Ahumador + smooth_basalt: Basalto liso + smooth_quartz: Bloque de cuarzo liso + smooth_quartz_slab: Losa de cuarzo liso + smooth_quartz_stairs: Escaleras de cuarzo liso + smooth_red_sandstone: Arenisca roja lisa + smooth_red_sandstone_slab: Losa de arenisca roja lisa + smooth_red_sandstone_stairs: Escaleras de arenisca roja lisa + smooth_sandstone: Arenisca lisa + smooth_sandstone_slab: Losa de arenisca lisa + smooth_sandstone_stairs: Escaleras de arenisca lisa + smooth_stone: Piedra lisa + smooth_stone_slab: Losa de piedra lisa + sniffer_egg: Huevo de sniffer + snow: Capa de nieve + snow_block: Bloque de nieve + soul_campfire: Hoguera de almas + soul_fire: Fuego de almas + soul_lantern: Farol de almas + soul_sand: Arena de almas + soul_soil: Tierra de almas + soul_torch: Antorcha de almas + soul_wall_torch: Antorcha de almas en pared + spawner: Generador de criaturas + sponge: Esponja + spore_blossom: Flor de esporas + spruce_button: Botón de abeto + spruce_door: Puerta de abeto + spruce_fence: Valla de abeto + spruce_fence_gate: Puerta de valla de abeto + spruce_hanging_sign: Cartel colgante de abeto + spruce_leaves: Hojas de abeto + spruce_log: Tronco de abeto + spruce_planks: Tablones de abeto + spruce_pressure_plate: Placa de presión de abeto + spruce_sapling: Brote de abeto + spruce_sign: Cartel de abeto + spruce_slab: Losa de abeto + spruce_stairs: Escaleras de abeto + spruce_trapdoor: Trampilla de abeto + spruce_wall_hanging_sign: Cartel colgante de abeto en pared + spruce_wall_sign: Cartel de abeto en pared + spruce_wood: Leño de abeto + sticky_piston: Pistón pegajoso + stone: Piedra + stone_brick_slab: Losa de ladrillos de piedra + stone_brick_stairs: Escaleras de ladrillos de piedra + stone_brick_wall: Muro de ladrillos de piedra + stone_bricks: Ladrillos de piedra + stone_button: Botón de piedra + stone_pressure_plate: Placa de presión de piedra + stone_slab: Losa de piedra + stone_stairs: Escaleras de piedra + stonecutter: Cortapiedras + stripped_acacia_log: Tronco de acacia sin corteza + stripped_acacia_wood: Leño de acacia sin corteza + stripped_bamboo_block: Bloque de bambú pelado + stripped_birch_log: Tronco de abedul sin corteza + stripped_birch_wood: Leño de abedul sin corteza + stripped_cherry_log: Tronco de cerezo sin corteza + stripped_cherry_wood: Leño de cerezo sin corteza + stripped_crimson_hyphae: Hifas carmesí peladas + stripped_crimson_stem: Tallo carmesí pelado + stripped_dark_oak_log: Tronco de roble oscuro sin corteza + stripped_dark_oak_wood: Leño de roble oscuro sin corteza + stripped_jungle_log: Tronco de jungla sin corteza + stripped_jungle_wood: Leño de jungla sin corteza + stripped_mangrove_log: Tronco de mangle sin corteza + stripped_mangrove_wood: Leño de mangle sin corteza + stripped_oak_log: Tronco de roble sin corteza + stripped_oak_wood: Leño de roble sin corteza + stripped_spruce_log: Tronco de abeto sin corteza + stripped_spruce_wood: Leño de abeto sin corteza + stripped_warped_hyphae: Hifas distorsionadas peladas + stripped_warped_stem: Tallo distorsionado pelado + structure_block: Bloque estructural + structure_void: Vacío estructural + sugar_cane: Caña de azúcar + sunflower: Girasol + suspicious_gravel: Grava sospechosa + suspicious_sand: Arena sospechosa + sweet_berry_bush: Arbusto de bayas dulces + tall_grass: Hierba alta + tall_seagrass: Hierba marina alta + target: Diana + terracotta: Terracota + tinted_glass: Cristal opaco + tnt: Dinamita + torch: Antorcha + torchflower: Plantorcha + torchflower_crop: Cultivo de plantorcha + trapped_chest: Cofre trampa + tripwire: Hilo trampa + tripwire_hook: Gancho de cuerda + tube_coral: Coral de tubo + tube_coral_block: Bloque de coral de tubo + tube_coral_fan: Gorgonia de tubo + tube_coral_wall_fan: Gorgonia de tubo en pared + tuff: Toba + turtle_egg: Huevo de tortuga + twisting_vines: Enredaderas retorcidas + twisting_vines_plant: Planta de enredaderas retorcidas + verdant_froglight: Ranaluz verde + vine: Enredaderas + void_air: Aire de vacío + wall_torch: Antorcha en pared + warped_button: Botón distorsionado + warped_door: Puerta distorsionada + warped_fence: Valla distorsionada + warped_fence_gate: Puerta de valla distorsionada + warped_fungus: Hongo distorsionado + warped_hanging_sign: Cartel colgante distorsionado + warped_hyphae: Hifas distorsionadas + warped_nylium: Necelio distorsionado + warped_planks: Tablones distorsionados + warped_pressure_plate: Placa de presión distorsionada + warped_roots: Raíces distorsionadas + warped_sign: Cartel distorsionado + warped_slab: Losa distorsionada + warped_stairs: Escaleras distorsionadas + warped_stem: Tallo distorsionado + warped_trapdoor: Trampilla distorsionada + warped_wall_hanging_sign: Cartel colgante distorsionado en pared + warped_wall_sign: Cartel distorsionado en pared + warped_wart_block: Bloque de verrugas distorsionadas + water: Agua + water_cauldron: Caldero con agua + waxed_copper_block: Bloque de cobre encerado + waxed_cut_copper: Cobre cortado encerado + waxed_cut_copper_slab: Losa de cobre cortado encerado + waxed_cut_copper_stairs: Escaleras de cobre cortado encerado + waxed_exposed_copper: Cobre expuesto encerado + waxed_exposed_cut_copper: Cobre cortado expuesto encerado + waxed_exposed_cut_copper_slab: Losa de cobre cortado expuesto encerado + waxed_exposed_cut_copper_stairs: Escaleras de cobre cortado expuesto encerado + waxed_oxidized_copper: Cobre oxidado encerado + waxed_oxidized_cut_copper: Cobre cortado oxidado encerado + waxed_oxidized_cut_copper_slab: Losa de cobre cortado oxidado encerado + waxed_oxidized_cut_copper_stairs: Escaleras de cobre cortado oxidado encerado + waxed_weathered_copper: Cobre degradado encerado + waxed_weathered_cut_copper: Cobre cortado degradado encerado + waxed_weathered_cut_copper_slab: Losa de cobre cortado degradado encerado + waxed_weathered_cut_copper_stairs: Escaleras de cobre cortado degradado encerado + weathered_copper: Cobre degradado + weathered_cut_copper: Cobre cortado degradado + weathered_cut_copper_slab: Losa de cobre cortado degradado + weathered_cut_copper_stairs: Escaleras de cobre cortado degradado + weeping_vines: Enredaderas lacrimosas + weeping_vines_plant: Planta de enredaderas lacrimosas + wet_sponge: Esponja mojada + wheat: Trigo + white_banner: Estandarte blanco + white_bed: Cama blanca + white_candle: Vela blanca + white_candle_cake: Tarta con vela blanca + white_carpet: Alfombra blanca + white_concrete: Hormigón blanco + white_concrete_powder: Cemento blanco + white_glazed_terracotta: Azulejo blanco + white_shulker_box: Caja de shulker blanca + white_stained_glass: Cristal tintado de blanco + white_stained_glass_pane: Panel de cristal tintado de blanco + white_terracotta: Terracota blanca + white_tulip: Tulipán blanco + white_wool: Lana blanca + wither_rose: Rosa del Wither + wither_skeleton_skull: Calavera de esqueleto del Wither + wither_skeleton_wall_skull: Calavera de esqueleto del Wither en pared + yellow_banner: Estandarte amarillo + yellow_bed: Cama amarilla + yellow_candle: Vela amarilla + yellow_candle_cake: Tarta con vela amarilla + yellow_carpet: Alfombra amarilla + yellow_concrete: Hormigón amarillo + yellow_concrete_powder: Cemento amarillo + yellow_glazed_terracotta: Azulejo amarillo + yellow_shulker_box: Caja de shulker amarilla + yellow_stained_glass: Cristal tintado de amarillo + yellow_stained_glass_pane: Panel de cristal tintado de amarillo + yellow_terracotta: Terracota amarilla + yellow_wool: Lana amarilla + zombie_head: Cabeza de zombi + zombie_wall_head: Cabeza de zombi en pared + acacia_boat: Barca de acacia + acacia_chest_boat: Barca de acacia con cofre + allay_spawn_egg: Generar allay + amethyst_shard: Fragmento de amatista + angler_pottery_shard: Fragmento de cerámica de caña de pescar + angler_pottery_sherd: Fragmento de cerámica de caña de pescar + apple: Manzana + archer_pottery_shard: Fragmento de cerámica de arco + archer_pottery_sherd: Fragmento de cerámica de arco + armor_stand: Soporte para armadura + arms_up_pottery_shard: Fragmento de cerámica de monigote + arms_up_pottery_sherd: Fragmento de cerámica de monigote + arrow: Flecha + axolotl_bucket: Cubo con ajolote + axolotl_spawn_egg: Generar ajolote + baked_potato: Patata cocida + bamboo_chest_raft: Balsa de bambú con cofre + bamboo_raft: Balsa de bambú + bat_spawn_egg: Generar murciélago + bee_spawn_egg: Generar abeja + beef: Filete crudo + beetroot: Remolacha + beetroot_seeds: Semillas de remolacha + beetroot_soup: Estofado de remolacha + birch_boat: Barca de abedul + birch_chest_boat: Barca de abedul con cofre + black_dye: Tinte negro + blade_pottery_shard: Fragmento de cerámica de espada + blade_pottery_sherd: Fragmento de cerámica de espada + blaze_powder: Polvo de blaze + blaze_rod: Vara de blaze + blaze_spawn_egg: Generar blaze + blue_dye: Tinte azul + bone: Hueso + bone_meal: Polvo de hueso + book: Libro + bow: Arco + bowl: Cuenco + bread: Pan + brewer_pottery_shard: Fragmento de cerámica de poción + brewer_pottery_sherd: Fragmento de cerámica de poción + brick: Ladrillo + brown_dye: Tinte marrón + brush: Pincel + bucket: Cubo + bundle: Saco + burn_pottery_shard: Fragmento de cerámica de fuego + burn_pottery_sherd: Fragmento de cerámica de fuego + camel_spawn_egg: Generar camello + carrot: Zanahoria + carrot_on_a_stick: Caña con zanahoria + cat_spawn_egg: Generar gato + cave_spider_spawn_egg: Generar araña de cueva + chainmail_boots: Botas de cota de mallas + chainmail_chestplate: Peto de cota de mallas + chainmail_helmet: Casco de cota de mallas + chainmail_leggings: Grebas de cota de mallas + charcoal: Carbón vegetal + cherry_boat: Barca de cerezo + cherry_chest_boat: Barca de cerezo con cofre + chest_minecart: Vagoneta con cofre + chicken: Pollo crudo + chicken_spawn_egg: Generar pollo + chorus_fruit: Fruta chorus + clay_ball: Bola de arcilla + clock: Reloj + coal: Carbón + coast_armor_trim_smithing_template: Molde de herrería + cocoa_beans: Semillas de cacao + cod: Bacalao crudo + cod_bucket: Cubo con bacalao + cod_spawn_egg: Generar bacalao + command_block_minecart: Vagoneta con bloque de comandos + compass: Brújula + cooked_beef: Filete asado + cooked_chicken: Pollo asado + cooked_cod: Bacalao cocinado + cooked_mutton: Cordero asado + cooked_porkchop: Chuleta de cerdo cocinada + cooked_rabbit: Conejo asado + cooked_salmon: Salmón ahumado + cookie: Galleta + copper_ingot: Lingote de cobre + cow_spawn_egg: Generar vaca + creeper_banner_pattern: Diseño de estandarte + creeper_spawn_egg: Generar creeper + crossbow: Ballesta + cyan_dye: Tinte cian + danger_pottery_shard: Fragmento de cerámica de creeper + danger_pottery_sherd: Fragmento de cerámica de creeper + dark_oak_boat: Barca de roble oscuro + dark_oak_chest_boat: Barca de roble oscuro con cofre + debug_stick: Palo de desarrollo + diamond: Diamante + diamond_axe: Hacha de diamante + diamond_boots: Botas de diamante + diamond_chestplate: Peto de diamante + diamond_helmet: Casco de diamante + diamond_hoe: Azada de diamante + diamond_horse_armor: Armadura de diamante para caballo + diamond_leggings: Grebas de diamante + diamond_pickaxe: Pico de diamante + diamond_shovel: Pala de diamante + diamond_sword: Espada de diamante + disc_fragment_5: Fragmento de disco + dolphin_spawn_egg: Generar delfín + donkey_spawn_egg: Generar burro + dragon_breath: Aliento de dragón + dried_kelp: Algas secas + drowned_spawn_egg: Generar ahogado + dune_armor_trim_smithing_template: Molde de herrería + echo_shard: Fragmento resonante + egg: Huevo + elder_guardian_spawn_egg: Generar guardián anciano + elytra: Élitros + emerald: Esmeralda + enchanted_book: Libro encantado + enchanted_golden_apple: Manzana dorada encantada + end_crystal: Cristal del End + ender_dragon_spawn_egg: Generar Enderdragón + ender_eye: Ojo de ender + ender_pearl: Perla de ender + enderman_spawn_egg: Generar enderman + endermite_spawn_egg: Generar endermite + evoker_spawn_egg: Generar evocador + experience_bottle: Frasco con experiencia + explorer_pottery_shard: Fragmento de cerámica de mapa + explorer_pottery_sherd: Fragmento de cerámica de mapa + eye_armor_trim_smithing_template: Molde de herrería + feather: Pluma + fermented_spider_eye: Ojo de araña fermentado + filled_map: Mapa + fire_charge: Carga ígnea + firework_rocket: Cohete de fuegos artificiales + firework_star: Estrella de fuegos artificiales + fishing_rod: Caña de pescar + flint: Pedernal + flint_and_steel: Mechero + flower_banner_pattern: Diseño de estandarte + fox_spawn_egg: Generar zorro + friend_pottery_shard: Fragmento de cerámica de amistad + friend_pottery_sherd: Fragmento de cerámica de amistad + frog_spawn_egg: Generar rana + furnace_minecart: Vagoneta con horno + ghast_spawn_egg: Generar ghast + ghast_tear: Lágrima de ghast + glass_bottle: Frasco de cristal + glistering_melon_slice: Rodaja de sandía reluciente + globe_banner_pattern: Diseño de estandarte + glow_berries: Bayas luminosas + glow_ink_sac: Saco de tinta luminosa + glow_item_frame: Marco luminoso + glow_squid_spawn_egg: Generar calamar luminoso + glowstone_dust: Polvo de piedra luminosa + goat_horn: Cuerno de cabra + goat_spawn_egg: Generar cabra + gold_ingot: Lingote de oro + gold_nugget: Pepita de oro + golden_apple: Manzana dorada + golden_axe: Hacha de oro + golden_boots: Botas de oro + golden_carrot: Zanahoria dorada + golden_chestplate: Peto de oro + golden_helmet: Casco de oro + golden_hoe: Azada de oro + golden_horse_armor: Armadura de oro para caballo + golden_leggings: Grebas de oro + golden_pickaxe: Pico de oro + golden_shovel: Pala de oro + golden_sword: Espada de oro + gray_dye: Tinte gris + green_dye: Tinte verde + guardian_spawn_egg: Generar guardián + gunpowder: Pólvora + heart_of_the_sea: Corazón del mar + heart_pottery_shard: Fragmento de cerámica de corazón + heart_pottery_sherd: Fragmento de cerámica de corazón + heartbreak_pottery_shard: Fragmento de cerámica de corazón roto + heartbreak_pottery_sherd: Fragmento de cerámica de corazón roto + hoglin_spawn_egg: Generar hoglin + honey_bottle: Frasco con miel + honeycomb: Panal + hopper_minecart: Vagoneta con tolva + horse_spawn_egg: Generar caballo + host_armor_trim_smithing_template: Molde de herrería + howl_pottery_shard: Fragmento de cerámica de lobo + howl_pottery_sherd: Fragmento de cerámica de lobo + husk_spawn_egg: Generar disecado + ink_sac: Saco de tinta + iron_axe: Hacha de hierro + iron_boots: Botas de hierro + iron_chestplate: Peto de hierro + iron_golem_spawn_egg: Generar gólem de hierro + iron_helmet: Casco de hierro + iron_hoe: Azada de hierro + iron_horse_armor: Armadura de hierro para caballo + iron_ingot: Lingote de hierro + iron_leggings: Grebas de hierro + iron_nugget: Pepita de hierro + iron_pickaxe: Pico de hierro + iron_shovel: Pala de hierro + iron_sword: Espada de hierro + item_frame: Marco + jungle_boat: Barca de jungla + jungle_chest_boat: Barca de jungla con cofre + knowledge_book: Enciclopedia + lapis_lazuli: Lapislázuli + lava_bucket: Cubo con lava + lead: Rienda + leather: Cuero + leather_boots: Botas de cuero + leather_chestplate: Túnica de cuero + leather_helmet: Sombrero de cuero + leather_horse_armor: Armadura de cuero para caballo + leather_leggings: Pantalones de cuero + light_blue_dye: Tinte azul claro + light_gray_dye: Tinte gris claro + lime_dye: Tinte verde lima + lingering_potion: Poción persistente + llama_spawn_egg: Generar llama + lodestone_compass: Brújula imantada + magenta_dye: Tinte magenta + magma_cream: Crema de magma + magma_cube_spawn_egg: Generar cubo de magma + mangrove_boat: Barca de mangle + mangrove_chest_boat: Barca de mangle con cofre + map: Mapa en blanco + melon_seeds: Semillas de sandía + melon_slice: Rodaja de sandía + milk_bucket: Cubo con leche + minecart: Vagoneta + miner_pottery_shard: Fragmento de cerámica de pico + miner_pottery_sherd: Fragmento de cerámica de pico + mojang_banner_pattern: Diseño de estandarte + mooshroom_spawn_egg: Generar mooshroom + mourner_pottery_shard: Fragmento de cerámica de warden + mourner_pottery_sherd: Fragmento de cerámica de warden + mule_spawn_egg: Generar mula + mushroom_stew: Estofado de champiñones + music_disc_11: Disco de música + music_disc_13: Disco de música + music_disc_5: Disco de música + music_disc_blocks: Disco de música + music_disc_cat: Disco de música + music_disc_chirp: Disco de música + music_disc_far: Disco de música + music_disc_mall: Disco de música + music_disc_mellohi: Disco de música + music_disc_otherside: Disco de música + music_disc_pigstep: Disco de música + music_disc_relic: Disco de música + music_disc_stal: Disco de música + music_disc_strad: Disco de música + music_disc_wait: Disco de música + music_disc_ward: Disco de música + mutton: Cordero crudo + name_tag: Etiqueta + nautilus_shell: Caparazón de nautilo + nether_brick: Ladrillo del Nether + nether_star: Estrella del Nether + netherite_axe: Hacha de netherita + netherite_boots: Botas de netherita + netherite_chestplate: Peto de netherita + netherite_helmet: Casco de netherita + netherite_hoe: Azada de netherita + netherite_ingot: Lingote de netherita + netherite_leggings: Grebas de netherita + netherite_pickaxe: Pico de netherita + netherite_scrap: Fragmentos de netherita + netherite_shovel: Pala de netherita + netherite_sword: Espada de netherita + netherite_upgrade_smithing_template: Molde de herrería + oak_boat: Barca de roble + oak_chest_boat: Barca de roble con cofre + ocelot_spawn_egg: Generar ocelote + orange_dye: Tinte naranja + painting: Cuadro + panda_spawn_egg: Generar panda + paper: Papel + parrot_spawn_egg: Generar loro + phantom_membrane: Membrana de fantasma + phantom_spawn_egg: Generar fantasma + pig_spawn_egg: Generar cerdo + piglin_banner_pattern: Diseño de estandarte + piglin_brute_spawn_egg: Generar piglin bruto + piglin_spawn_egg: Generar piglin + pillager_spawn_egg: Generar saqueador + pink_dye: Tinte rosa + pitcher_pod: Vaina de planta odre + plenty_pottery_shard: Fragmento de cerámica de cofre + plenty_pottery_sherd: Fragmento de cerámica de cofre + poisonous_potato: Patata venenosa + polar_bear_spawn_egg: Generar oso polar + popped_chorus_fruit: Fruta chorus horneada + porkchop: Chuleta de cerdo cruda + potato: Patata + potion: Poción + pottery_shard_archer: Fragmento de cerámica de arco + pottery_shard_arms_up: Fragmento de cerámica de monigote + pottery_shard_prize: Fragmento de cerámica de gema + pottery_shard_skull: Fragmento de cerámica de calavera + powder_snow_bucket: Cubo con nieve polvo + prismarine_crystals: Cristales de prismarina + prismarine_shard: Fragmento de prismarina + prize_pottery_shard: Fragmento de cerámica de gema + prize_pottery_sherd: Fragmento de cerámica de gema + pufferfish: Pez globo + pufferfish_bucket: Cubo con pez globo + pufferfish_spawn_egg: Generar pez globo + pumpkin_pie: Tarta de calabaza + pumpkin_seeds: Semillas de calabaza + purple_dye: Tinte morado + quartz: Cuarzo del Nether + rabbit: Conejo crudo + rabbit_foot: Pata de conejo + rabbit_hide: Piel de conejo + rabbit_spawn_egg: Generar conejo + rabbit_stew: Estofado de conejo + raiser_armor_trim_smithing_template: Molde de herrería + ravager_spawn_egg: Generar devastador + raw_copper: Cobre en bruto + raw_gold: Oro en bruto + raw_iron: Hierro en bruto + recovery_compass: Brújula de recuperación + red_dye: Tinte rojo + redstone: Polvo de redstone + rib_armor_trim_smithing_template: Molde de herrería + rotten_flesh: Carne podrida + saddle: Montura + salmon: Salmón crudo + salmon_bucket: Cubo con salmón + salmon_spawn_egg: Generar salmón + scute: Escama de tortuga + sentry_armor_trim_smithing_template: Molde de herrería + shaper_armor_trim_smithing_template: Molde de herrería + sheaf_pottery_shard: Fragmento de cerámica de paja + sheaf_pottery_sherd: Fragmento de cerámica de paja + shears: Tijeras + sheep_spawn_egg: Generar oveja + shelter_pottery_shard: Fragmento de cerámica de refugio + shelter_pottery_sherd: Fragmento de cerámica de refugio + shield: Escudo + shulker_shell: Caparazón de shulker + shulker_spawn_egg: Generar shulker + sign: Cartel + silence_armor_trim_smithing_template: Molde de herrería + silverfish_spawn_egg: Generar lepisma + skeleton_horse_spawn_egg: Generar caballo esqueleto + skeleton_spawn_egg: Generar esqueleto + skull_banner_pattern: Diseño de estandarte + skull_pottery_shard: Fragmento de cerámica de calavera + skull_pottery_sherd: Fragmento de cerámica de calavera + slime_ball: Bola de slime + slime_spawn_egg: Generar slime + smithing_template: Molde de herrería + sniffer_spawn_egg: Generar sniffer + snort_pottery_shard: Fragmento de cerámica de sniffer + snort_pottery_sherd: Fragmento de cerámica de sniffer + snout_armor_trim_smithing_template: Molde de herrería + snow_golem_spawn_egg: Generar gólem de nieve + snowball: Bola de nieve + spectral_arrow: Flecha espectral + spider_eye: Ojo de araña + spider_spawn_egg: Generar araña + spire_armor_trim_smithing_template: Molde de herrería + splash_potion: Poción arrojadiza + spruce_boat: Barca de abeto + spruce_chest_boat: Barca de abeto con cofre + spyglass: Catalejo + squid_spawn_egg: Generar calamar + stick: Palo + stone_axe: Hacha de piedra + stone_hoe: Azada de piedra + stone_pickaxe: Pico de piedra + stone_shovel: Pala de piedra + stone_sword: Espada de piedra + stray_spawn_egg: Generar errante + strider_spawn_egg: Generar lavagante + string: Hilo + sugar: Azúcar + suspicious_stew: Estofado sospechoso + sweet_berries: Bayas dulces + tadpole_bucket: Cubo con renacuajo + tadpole_spawn_egg: Generar renacuajo + tide_armor_trim_smithing_template: Molde de herrería + tipped_arrow: Flecha con efecto + tnt_minecart: Vagoneta con dinamita + torchflower_seeds: Semillas de plantorcha + totem_of_undying: Tótem de inmortalidad + trader_llama_spawn_egg: Generar llama ambulante + trident: Tridente + tropical_fish: Pez tropical + tropical_fish_bucket: Cubo con pez tropical + tropical_fish_spawn_egg: Generar pez tropical + turtle_helmet: Caparazón de tortuga + turtle_spawn_egg: Generar tortuga + vex_armor_trim_smithing_template: Molde de herrería + vex_spawn_egg: Generar vex + villager_spawn_egg: Generar aldeano + vindicator_spawn_egg: Generar vindicador + wandering_trader_spawn_egg: Generar vendedor ambulante + ward_armor_trim_smithing_template: Molde de herrería + warden_spawn_egg: Generar warden + warped_fungus_on_a_stick: Caña con hongo distorsionado + water_bucket: Cubo con agua + wayfinder_armor_trim_smithing_template: Molde de herrería + wheat_seeds: Semillas de trigo + white_dye: Tinte blanco + wild_armor_trim_smithing_template: Molde de herrería + witch_spawn_egg: Generar bruja + wither_skeleton_spawn_egg: Generar esqueleto del Wither + wither_spawn_egg: Generar Wither + wolf_spawn_egg: Generar lobo + wooden_axe: Hacha de madera + wooden_hoe: Azada de madera + wooden_pickaxe: Pico de madera + wooden_shovel: Pala de madera + wooden_sword: Espada de madera + writable_book: Libro y pluma + written_book: Libro escrito + yellow_dye: Tinte amarillo + zoglin_spawn_egg: Generar zoglin + zombie_horse_spawn_egg: Generar caballo zombi + zombie_spawn_egg: Generar zombi + zombie_villager_spawn_egg: Generar aldeano zombi + zombified_piglin_spawn_egg: Generar piglin zombificado +Enchantment: + aqua_affinity: Afinidad acuática + bane_of_arthropods: Perdición de los artrópodos + binding_curse: Maldición de ligamiento + blast_protection: Protección contra explosiones + channeling: Conductividad + depth_strider: Agilidad acuática + efficiency: Eficiencia + feather_falling: Caída de pluma + fire_aspect: Aspecto ígneo + fire_protection: Protección contra el fuego + flame: Fuego + fortune: Fortuna + frost_walker: Paso helado + impaling: Empalamiento + infinity: Infinidad + knockback: Empuje + looting: Botín + loyalty: Lealtad + luck_of_the_sea: Suerte marina + lure: Atracción + mending: Reparación + multishot: Multidisparo + piercing: Perforación + power: Poder + projectile_protection: Protección contra proyectiles + protection: Protección + punch: Retroceso + quick_charge: Carga rápida + respiration: Respiración + riptide: Propulsión acuática + sharpness: Filo + silk_touch: Toque de seda + smite: Golpeo + soul_speed: Velocidad del alma + sweeping: Barrido + swift_sneak: Sigilo veloz + thorns: Espinas + unbreaking: Irrompibilidad + vanishing_curse: Maldición de desaparición diff --git a/assets/fr.yml b/assets/fr.yml new file mode 100644 index 0000000..a011236 --- /dev/null +++ b/assets/fr.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: Allay + area_effect_cloud: Nuage d'effet persistant + armor_stand: Porte-armure + arrow: Flèche + axolotl: Axolotl + bat: Chauve-souris + bee: Abeille + blaze: Blaze + block_display: Bloc holographique + boat: Bateau + camel: Dromadaire + cat: Chat + cave_spider: Araignée venimeuse + chest_boat: Bateau de stockage + chest_minecart: Wagonnet de stockage + chicken: Poule + cod: Morue + command_block_minecart: Wagonnet à bloc de commande + cow: Vache + creeper: Creeper + dolphin: Dauphin + donkey: Âne + dragon_fireball: Boule de feu de dragon + drowned: Noyé + egg: Oeuf lancé + elder_guardian: Grand gardien + end_crystal: Cristal de l'End + ender_dragon: Ender Dragon + ender_pearl: Perle de l'Ender lancée + enderman: Enderman + endermite: Endermite + evoker: Évocateur + evoker_fangs: Mâchoires d'évocateur + experience_bottle: Fiole d'expérience lancée + experience_orb: Orbe d'expérience + eye_of_ender: Œil de l'Ender + falling_block: Bloc soumis à la gravité + falling_block_type: '%s qui tombe' + fireball: Boule de feu + firework_rocket: Fusée de feu d'artifice + fishing_bobber: Flotteur + fox: Renard + frog: Grenouille + furnace_minecart: Wagonnet motorisé + ghast: Ghast + giant: Géant + glow_item_frame: Cadre luisant + glow_squid: Poulpe luisant + goat: Chèvre + guardian: Gardien + hoglin: Hoglin + hopper_minecart: Wagonnet à entonnoir + horse: Cheval + husk: Zombie momifié + illusioner: Illusionniste + interaction: Interaction + iron_golem: Golem de fer + item: Objet + item_display: Objet holographique + item_frame: Cadre + killer_bunny: Lapin tueur + leash_knot: Nœud de laisse + lightning_bolt: Foudre + llama: Lama + llama_spit: Crachat de lama + magma_cube: Cube de magma + marker: Repère + minecart: Wagonnet + mooshroom: Mooshroom + mule: Mule + ocelot: Ocelot + painting: Tableau + panda: Panda + parrot: Perroquet + phantom: Phantom + pig: Cochon + piglin: Piglin + piglin_brute: Piglin barbare + pillager: Pillard + player: Joueur + polar_bear: Ours blanc + potion: Potion + pufferfish: Poisson-globe + rabbit: Lapin + ravager: Ravageur + salmon: Saumon + sheep: Mouton + shulker: Shulker + shulker_bullet: Projectile de Shulker + silverfish: Poisson d'argent + skeleton: Squelette + skeleton_horse: Cheval-squelette + slime: Slime + small_fireball: Petite boule de feu + sniffer: Renifleur + snow_golem: Golem de neige + snowball: Boule de neige + spawner_minecart: Wagonnet générateur de créatures + spectral_arrow: Flèche spectrale + spider: Araignée + squid: Poulpe + stray: Vagabond + strider: Arpenteur + tadpole: Têtard + text_display: Texte holographique + tnt: TNT amorcé + tnt_minecart: Wagonnet à TNT + trader_llama: Lama de marchand + trident: Trident + tropical_fish: Poisson tropical + turtle: Tortue + vex: Vex + villager: Villageois + vindicator: Vindicateur + wandering_trader: Marchand ambulant + warden: Warden + witch: Sorcière + wither: Wither + wither_skeleton: Wither squelette + wither_skull: Crâne de Wither + wolf: Loup + zoglin: Zoglin + zombie: Zombie + zombie_horse: Cheval-zombie + zombie_villager: Zombie-villageois + zombified_piglin: Piglin zombifié +PotionEffectType: + absorption: Absorption + bad_omen: Mauvais présage + blindness: Cécité + conduit_power: Force de conduit + darkness: Obscurité + dolphins_grace: Grâce du dauphin + fire_resistance: Résistance au feu + glowing: Surbrillance + haste: Célérité + health_boost: Bonus de vie + hero_of_the_village: Héros du village + hunger: Faim + instant_damage: Dégâts instantanés + instant_health: Soin instantané + invisibility: Invisibilité + jump_boost: Sauts améliorés + levitation: Lévitation + luck: Chance + mining_fatigue: Fatigue de minage + nausea: Nausée + night_vision: Nyctalopie + poison: Poison + regeneration: Régénération + resistance: Résistance + saturation: Saturation + slow_falling: Chute lente + slowness: Lenteur + speed: Rapidité + strength: Force + unluck: Malchance + water_breathing: Apnée + weakness: Faiblesse + wither: Décomposition +Material: + acacia_button: Bouton en acacia + acacia_door: Porte en acacia + acacia_fence: Barrière en acacia + acacia_fence_gate: Portillon en acacia + acacia_hanging_sign: Pancarte suspendue en acacia + acacia_leaves: Feuilles d'acacia + acacia_log: Bûche d'acacia + acacia_planks: Planches d'acacia + acacia_pressure_plate: Plaque de pression en acacia + acacia_sapling: Pousse d'acacia + acacia_sign: Pancarte en acacia + acacia_slab: Dalle en acacia + acacia_stairs: Escalier en acacia + acacia_trapdoor: Trappe en acacia + acacia_wall_hanging_sign: Pancarte suspendue en acacia murale + acacia_wall_sign: Pancarte en acacia murale + acacia_wood: Bois d'acacia + activator_rail: Rails déclencheurs + air: Air + allium: Allium + amethyst_block: Bloc d'améthyste + amethyst_cluster: Amas d'améthyste + ancient_debris: Débris antiques + andesite: Andésite + andesite_slab: Dalle d'andésite + andesite_stairs: Escalier d'andésite + andesite_wall: Muret d'andésite + anvil: Enclume + attached_melon_stem: Tige de pastèque attachée + attached_pumpkin_stem: Tige de citrouille attachée + azalea: Azalée + azalea_leaves: Feuilles d'azalée + azure_bluet: Houstonie bleue + bamboo: Bambou + bamboo_block: Bloc de bambou + bamboo_button: Bouton en bambou + bamboo_door: Porte en bambou + bamboo_fence: Barrière en bambou + bamboo_fence_gate: Portillon en bambou + bamboo_hanging_sign: Pancarte suspendue en bambou + bamboo_mosaic: Mosaïque de bambou + bamboo_mosaic_slab: Dalle en mosaïque de bambou + bamboo_mosaic_stairs: Escalier en mosaïque de bambou + bamboo_planks: Planches de bambou + bamboo_pressure_plate: Plaque de pression en bambou + bamboo_sapling: Pousse de bambou + bamboo_sign: Pancarte en bambou + bamboo_slab: Dalle en bambou + bamboo_stairs: Escalier en bambou + bamboo_trapdoor: Trappe en bambou + bamboo_wall_hanging_sign: Pancarte suspendue en bambou murale + bamboo_wall_sign: Pancarte en bambou murale + barrel: Tonneau + barrier: Barrière invisible + basalt: Basalte + beacon: Balise + bedrock: Bedrock + bee_nest: Nid d'abeilles + beehive: Ruche + beetroots: Betteraves + bell: Cloche + big_dripleaf: Grande foliogoutte + big_dripleaf_stem: Tige de grande foliogoutte + birch_button: Bouton en bouleau + birch_door: Porte en bouleau + birch_fence: Barrière en bouleau + birch_fence_gate: Portillon en bouleau + birch_hanging_sign: Pancarte suspendue en bouleau + birch_leaves: Feuilles de bouleau + birch_log: Bûche de bouleau + birch_planks: Planches de bouleau + birch_pressure_plate: Plaque de pression en bouleau + birch_sapling: Pousse de bouleau + birch_sign: Pancarte en bouleau + birch_slab: Dalle en bouleau + birch_stairs: Escalier en bouleau + birch_trapdoor: Trappe en bouleau + birch_wall_hanging_sign: Pancarte suspendue en bouleau murale + birch_wall_sign: Pancarte en bouleau murale + birch_wood: Bois de bouleau + black_banner: Bannière noire + black_bed: Lit noir + black_candle: Bougie noire + black_candle_cake: Gâteau à bougie noire + black_carpet: Tapis noir + black_concrete: Béton noir + black_concrete_powder: Béton noir en poudre + black_glazed_terracotta: Terre cuite émaillée noire + black_shulker_box: Boîte de Shulker noire + black_stained_glass: Verre noir + black_stained_glass_pane: Vitre noire + black_terracotta: Terre cuite noire + black_wool: Laine noire + blackstone: Roche noire + blackstone_slab: Dalle de roche noire + blackstone_stairs: Escalier de roche noire + blackstone_wall: Muret de roche noire + blast_furnace: Haut fourneau + blue_banner: Bannière bleue + blue_bed: Lit bleu + blue_candle: Bougie bleue + blue_candle_cake: Gâteau à bougie bleue + blue_carpet: Tapis bleu + blue_concrete: Béton bleu + blue_concrete_powder: Béton bleu en poudre + blue_glazed_terracotta: Terre cuite émaillée bleue + blue_ice: Glace bleue + blue_orchid: Orchidée bleue + blue_shulker_box: Boîte de Shulker bleue + blue_stained_glass: Verre bleu + blue_stained_glass_pane: Vitre bleue + blue_terracotta: Terre cuite bleue + blue_wool: Laine bleue + bone_block: Bloc d'os + bookshelf: Bibliothèque + brain_coral: Corail cerveau + brain_coral_block: Bloc de corail cerveau + brain_coral_fan: Gorgone de corail cerveau + brain_coral_wall_fan: Gorgone de corail cerveau murale + brewing_stand: Alambic + brick_slab: Dalle en briques + brick_stairs: Escalier en briques + brick_wall: Muret en briques + bricks: Briques + brown_banner: Bannière marron + brown_bed: Lit marron + brown_candle: Bougie marron + brown_candle_cake: Gâteau à bougie marron + brown_carpet: Tapis marron + brown_concrete: Béton marron + brown_concrete_powder: Béton marron en poudre + brown_glazed_terracotta: Terre cuite émaillée marron + brown_mushroom: Champignon brun + brown_mushroom_block: Bloc de champignon brun + brown_shulker_box: Boîte de Shulker marron + brown_stained_glass: Verre marron + brown_stained_glass_pane: Vitre marron + brown_terracotta: Terre cuite marron + brown_wool: Laine marron + bubble_column: Colonne de bulles + bubble_coral: Corail bulles + bubble_coral_block: Bloc de corail bulles + bubble_coral_fan: Gorgone de corail bulles + bubble_coral_wall_fan: Gorgone de corail bulles murale + budding_amethyst: Druse d'améthyste + cactus: Cactus + cake: Gâteau + calcite: Calcite + calibrated_sculk_sensor: Capteur sculk calibré + campfire: Feu de camp + candle: Bougie + candle_cake: Gâteau à bougie + carrots: Carottes + cartography_table: Table de cartographie + carved_pumpkin: Citrouille sculptée + cauldron: Chaudron + cave_air: Air de caverne + cave_vines: Lianes des cavernes + cave_vines_plant: Plante de lianes des cavernes + chain: Chaîne + chain_command_block: Bloc de commande en chaîne + cherry_button: Bouton en cerisier + cherry_door: Porte en cerisier + cherry_fence: Barrière en cerisier + cherry_fence_gate: Portillon en cerisier + cherry_hanging_sign: Pancarte suspendue en cerisier + cherry_leaves: Feuilles de cerisier + cherry_log: Bûche de cerisier + cherry_planks: Planches de cerisier + cherry_pressure_plate: Plaque de pression en cerisier + cherry_sapling: Pousse de cerisier + cherry_sign: Pancarte en cerisier + cherry_slab: Dalle en cerisier + cherry_stairs: Escalier en cerisier + cherry_trapdoor: Trappe en cerisier + cherry_wall_hanging_sign: Pancarte suspendue en cerisier murale + cherry_wall_sign: Pancarte en cerisier murale + cherry_wood: Bois de cerisier + chest: Coffre + chipped_anvil: Enclume ébréchée + chiseled_bookshelf: Bibliothèque sculptée + chiseled_deepslate: Ardoise des abîmes sculptée + chiseled_nether_bricks: Briques du Nether sculptées + chiseled_polished_blackstone: Pierre noire sculptée + chiseled_quartz_block: Bloc de quartz sculpté + chiseled_red_sandstone: Grès rouge sculpté + chiseled_sandstone: Grès sculpté + chiseled_stone_bricks: Pierre sculptée + chorus_flower: Fleur de chorus + chorus_plant: Plante de chorus + clay: Argile + coal_block: Bloc de charbon + coal_ore: Minerai de charbon + coarse_dirt: Terre stérile + cobbled_deepslate: Pierres des abîmes + cobbled_deepslate_slab: Dalle de pierres des abîmes + cobbled_deepslate_stairs: Escalier en pierres des abîmes + cobbled_deepslate_wall: Muret de pierres des abîmes + cobblestone: Pierres + cobblestone_slab: Dalle de pierres + cobblestone_stairs: Escalier en pierre + cobblestone_wall: Muret de pierres + cobweb: Toile d'araignée + cocoa: Cacao + command_block: Bloc de commande + comparator: Comparateur de redstone + composter: Composteur + conduit: Conduit + copper_block: Bloc de cuivre + copper_ore: Minerai de cuivre + cornflower: Bleuet + cracked_deepslate_bricks: Ardoise des abîmes taillée craquelée + cracked_deepslate_tiles: Ardoise des abîmes carrelée craquelée + cracked_nether_bricks: Briques du Nether craquelées + cracked_polished_blackstone_bricks: Pierre noire taillée craquelée + cracked_stone_bricks: Pierre taillée craquelée + crafting_table: Établi + creeper_head: Tête de Creeper + creeper_wall_head: Tête de Creeper murale + crimson_button: Bouton carmin + crimson_door: Porte carmin + crimson_fence: Barrière carmin + crimson_fence_gate: Portillon carmin + crimson_fungus: Champignon carmin + crimson_hanging_sign: Pancarte suspendue carmin + crimson_hyphae: Hyphes carmin + crimson_nylium: Nylium carmin + crimson_planks: Planches carmin + crimson_pressure_plate: Plaque de pression carmin + crimson_roots: Racines carmin + crimson_sign: Pancarte carmin + crimson_slab: Dalle carmin + crimson_stairs: Escalier carmin + crimson_stem: Tige carmin + crimson_trapdoor: Trappe carmin + crimson_wall_hanging_sign: Pancarte suspendue carmin murale + crimson_wall_sign: Pancarte carmin murale + crying_obsidian: Obsidienne pleureuse + cut_copper: Cuivre taillé + cut_copper_slab: Dalle en cuivre taillé + cut_copper_stairs: Escalier en cuivre taillé + cut_red_sandstone: Grès rouge taillé + cut_red_sandstone_slab: Dalle en grès rouge taillé + cut_sandstone: Grès taillé + cut_sandstone_slab: Dalle en grès taillé + cyan_banner: Bannière cyan + cyan_bed: Lit cyan + cyan_candle: Bougie cyan + cyan_candle_cake: Gâteau à bougie cyan + cyan_carpet: Tapis cyan + cyan_concrete: Béton cyan + cyan_concrete_powder: Béton cyan en poudre + cyan_glazed_terracotta: Terre cuite émaillée cyan + cyan_shulker_box: Boîte de Shulker cyan + cyan_stained_glass: Verre cyan + cyan_stained_glass_pane: Vitre cyan + cyan_terracotta: Terre cuite cyan + cyan_wool: Laine cyan + damaged_anvil: Enclume endommagée + dandelion: Pissenlit + dark_oak_button: Bouton en chêne noir + dark_oak_door: Porte en chêne noir + dark_oak_fence: Barrière en chêne noir + dark_oak_fence_gate: Portillon en chêne noir + dark_oak_hanging_sign: Pancarte suspendue en chêne noir + dark_oak_leaves: Feuilles de chêne noir + dark_oak_log: Bûche de chêne noir + dark_oak_planks: Planches de chêne noir + dark_oak_pressure_plate: Plaque de pression en chêne noir + dark_oak_sapling: Pousse de chêne noir + dark_oak_sign: Pancarte en chêne noir + dark_oak_slab: Dalle en chêne noir + dark_oak_stairs: Escalier en chêne noir + dark_oak_trapdoor: Trappe en chêne noir + dark_oak_wall_hanging_sign: Pancarte suspendue en chêne noir murale + dark_oak_wall_sign: Pancarte en chêne noir murale + dark_oak_wood: Bois de chêne noir + dark_prismarine: Prismarine sombre + dark_prismarine_slab: Dalle de prismarine sombre + dark_prismarine_stairs: Escalier en prismarine sombre + daylight_detector: Capteur de lumière + dead_brain_coral: Corail cerveau mort + dead_brain_coral_block: Bloc de corail cerveau mort + dead_brain_coral_fan: Gorgone de corail cerveau morte + dead_brain_coral_wall_fan: Gorgone de corail cerveau morte murale + dead_bubble_coral: Corail bulles mort + dead_bubble_coral_block: Bloc de corail bulles mort + dead_bubble_coral_fan: Gorgone de corail bulles morte + dead_bubble_coral_wall_fan: Gorgone de corail bulles morte murale + dead_bush: Arbuste mort + dead_fire_coral: Corail de feu mort + dead_fire_coral_block: Bloc de corail de feu mort + dead_fire_coral_fan: Gorgone de corail de feu morte + dead_fire_coral_wall_fan: Gorgone de corail de feu morte murale + dead_horn_coral: Corail corné mort + dead_horn_coral_block: Bloc de corail corné mort + dead_horn_coral_fan: Gorgone de corail corné morte + dead_horn_coral_wall_fan: Gorgone de corail corné morte murale + dead_tube_coral: Corail tubulaire mort + dead_tube_coral_block: Bloc de corail tubulaire mort + dead_tube_coral_fan: Gorgone de corail tubulaire morte + dead_tube_coral_wall_fan: Gorgone de corail tubulaire morte murale + decorated_pot: Vase décoré + deepslate: Ardoise des abîmes + deepslate_brick_slab: Dalle en ardoise des abîmes taillée + deepslate_brick_stairs: Escalier en ardoise des abîmes taillée + deepslate_brick_wall: Muret en ardoise des abîmes taillée + deepslate_bricks: Ardoise des abîmes taillée + deepslate_coal_ore: Minerai de charbon des abîmes + deepslate_copper_ore: Minerai de cuivre des abîmes + deepslate_diamond_ore: Minerai de diamant des abîmes + deepslate_emerald_ore: Minerai d'émeraude des abîmes + deepslate_gold_ore: Minerai d'or des abîmes + deepslate_iron_ore: Minerai de fer des abîmes + deepslate_lapis_ore: Minerai de lapis-lazuli des abîmes + deepslate_redstone_ore: Minerai de redstone des abîmes + deepslate_tile_slab: Dalle en ardoise des abîmes carrelée + deepslate_tile_stairs: Escalier en ardoise des abîmes carrelée + deepslate_tile_wall: Muret en ardoise des abîmes carrelée + deepslate_tiles: Ardoise des abîmes carrelée + detector_rail: Rails détecteurs + diamond_block: Bloc de diamant + diamond_ore: Minerai de diamant + diorite: Diorite + diorite_slab: Dalle de diorite + diorite_stairs: Escalier de diorite + diorite_wall: Muret de diorite + dirt: Terre + dirt_path: Chemin de terre + dispenser: Distributeur + dragon_egg: Oeuf de dragon + dragon_head: Tête de dragon + dragon_wall_head: Tête de dragon murale + dried_kelp_block: Bloc d'algues séchées + dripstone_block: Bloc de spéléothème + dropper: Dropper + emerald_block: Bloc d'émeraude + emerald_ore: Minerai d'émeraude + enchanting_table: Table d'enchantement + end_gateway: Passerelle de l'End + end_portal: Portail de l'End + end_portal_frame: Cadre de portail de l'End + end_rod: Barre de l'End + end_stone: Pierre de l'End + end_stone_brick_slab: Dalle en pierre taillée de l'End + end_stone_brick_stairs: Escalier en pierre taillée de l'End + end_stone_brick_wall: Muret en pierre taillée de l'End + end_stone_bricks: Pierre taillée de l'End + ender_chest: Coffre de l'Ender + exposed_copper: Cuivre exposé + exposed_cut_copper: Cuivre taillé exposé + exposed_cut_copper_slab: Dalle en cuivre taillé exposé + exposed_cut_copper_stairs: Escalier en cuivre taillé exposé + farmland: Terre labourée + fern: Fougère + fire: Feu + fire_coral: Corail de feu + fire_coral_block: Bloc de corail de feu + fire_coral_fan: Gorgone de corail de feu + fire_coral_wall_fan: Gorgone de corail de feu murale + fletching_table: Table d'archerie + flower_pot: Pot de fleurs + flowering_azalea: Azalée fleurie + flowering_azalea_leaves: Feuilles d'azalée fleurie + frogspawn: Oeufs de grenouille + frosted_ice: Glace givrée + furnace: Fourneau + gilded_blackstone: Roche noire dorée + glass: Verre + glass_pane: Vitre + glow_lichen: Lichen lumineux + glowstone: Pierre lumineuse + gold_block: Bloc d'or + gold_ore: Minerai d'or + granite: Granite + granite_slab: Dalle de granite + granite_stairs: Escalier de granite + granite_wall: Muret de granite + grass: Herbe + grass_block: Bloc d'herbe + gravel: Gravier + gray_banner: Bannière grise + gray_bed: Lit gris + gray_candle: Bougie grise + gray_candle_cake: Gâteau à bougie grise + gray_carpet: Tapis gris + gray_concrete: Béton gris + gray_concrete_powder: Béton gris en poudre + gray_glazed_terracotta: Terre cuite émaillée grise + gray_shulker_box: Boîte de Shulker grise + gray_stained_glass: Verre gris + gray_stained_glass_pane: Vitre grise + gray_terracotta: Terre cuite grise + gray_wool: Laine grise + green_banner: Bannière verte + green_bed: Lit vert + green_candle: Bougie verte + green_candle_cake: Gâteau à bougie verte + green_carpet: Tapis vert + green_concrete: Béton vert + green_concrete_powder: Béton vert en poudre + green_glazed_terracotta: Terre cuite émaillée verte + green_shulker_box: Boîte de Shulker verte + green_stained_glass: Verre vert + green_stained_glass_pane: Vitre verte + green_terracotta: Terre cuite verte + green_wool: Laine verte + grindstone: Meule + hanging_roots: Racines suspendues + hay_block: Botte de paille + heavy_weighted_pressure_plate: Plaque de pression pondérée lourde + honey_block: Bloc de miel + honeycomb_block: Bloc de rayon de miel + hopper: Entonnoir + horn_coral: Corail corné + horn_coral_block: Bloc de corail corné + horn_coral_fan: Gorgone de corail corné + horn_coral_wall_fan: Gorgone de corail corné murale + ice: Glace + infested_chiseled_stone_bricks: Pierre sculptée infestée + infested_cobblestone: Pierres infestées + infested_cracked_stone_bricks: Pierre taillée craquelée infestée + infested_deepslate: Ardoise des abîmes infestée + infested_mossy_stone_bricks: Pierre taillée moussue infestée + infested_stone: Roche infestée + infested_stone_bricks: Pierre taillée infestée + iron_bars: Barreaux de fer + iron_block: Bloc de fer + iron_door: Porte en fer + iron_ore: Minerai de fer + iron_trapdoor: Trappe en fer + jack_o_lantern: Citrouille-lanterne + jigsaw: Bloc de puzzle + jukebox: Jukebox + jungle_button: Bouton en acajou + jungle_door: Porte en acajou + jungle_fence: Barrière en acajou + jungle_fence_gate: Portillon en acajou + jungle_hanging_sign: Pancarte suspendue en acajou + jungle_leaves: Feuilles d'acajou + jungle_log: Bûche d'acajou + jungle_planks: Planches d'acajou + jungle_pressure_plate: Plaque de pression en acajou + jungle_sapling: Pousse d'acajou + jungle_sign: Pancarte en acajou + jungle_slab: Dalle en acajou + jungle_stairs: Escalier en acajou + jungle_trapdoor: Trappe en acajou + jungle_wall_hanging_sign: Pancarte suspendue en acajou murale + jungle_wall_sign: Pancarte en acajou murale + jungle_wood: Bois d'acajou + kelp: Algue + kelp_plant: Tige d'algue + ladder: Échelle + lantern: Lanterne + lapis_block: Bloc de lapis-lazuli + lapis_ore: Minerai de lapis-lazuli + large_amethyst_bud: Grand cristal d'améthyste + large_fern: Grande fougère + lava: Lave + lava_cauldron: Chaudron de lave + lectern: Pupitre + lever: Levier + light: Lumière + light_blue_banner: Bannière bleu clair + light_blue_bed: Lit bleu clair + light_blue_candle: Bougie bleu clair + light_blue_candle_cake: Gâteau à bougie bleu clair + light_blue_carpet: Tapis bleu clair + light_blue_concrete: Béton bleu clair + light_blue_concrete_powder: Béton bleu clair en poudre + light_blue_glazed_terracotta: Terre cuite émaillée bleu clair + light_blue_shulker_box: Boîte de Shulker bleu clair + light_blue_stained_glass: Verre bleu clair + light_blue_stained_glass_pane: Vitre bleu clair + light_blue_terracotta: Terre cuite bleu clair + light_blue_wool: Laine bleu clair + light_gray_banner: Bannière gris clair + light_gray_bed: Lit gris clair + light_gray_candle: Bougie gris clair + light_gray_candle_cake: Gâteau à bougie gris clair + light_gray_carpet: Tapis gris clair + light_gray_concrete: Béton gris clair + light_gray_concrete_powder: Béton gris clair en poudre + light_gray_glazed_terracotta: Terre cuite émaillée gris clair + light_gray_shulker_box: Boîte de Shulker gris clair + light_gray_stained_glass: Verre gris clair + light_gray_stained_glass_pane: Vitre gris clair + light_gray_terracotta: Terre cuite gris clair + light_gray_wool: Laine gris clair + light_weighted_pressure_plate: Plaque de pression pondérée légère + lightning_rod: Paratonnerre + lilac: Lilas + lily_of_the_valley: Muguet + lily_pad: Nénuphar + lime_banner: Bannière vert clair + lime_bed: Lit vert clair + lime_candle: Bougie vert clair + lime_candle_cake: Gâteau à bougie vert clair + lime_carpet: Tapis vert clair + lime_concrete: Béton vert clair + lime_concrete_powder: Béton vert clair en poudre + lime_glazed_terracotta: Terre cuite émaillée vert clair + lime_shulker_box: Boîte de Shulker vert clair + lime_stained_glass: Verre vert clair + lime_stained_glass_pane: Vitre vert clair + lime_terracotta: Terre cuite vert clair + lime_wool: Laine vert clair + lodestone: Magnétite + loom: Métier à tisser + magenta_banner: Bannière magenta + magenta_bed: Lit magenta + magenta_candle: Bougie magenta + magenta_candle_cake: Gâteau à bougie magenta + magenta_carpet: Tapis magenta + magenta_concrete: Béton magenta + magenta_concrete_powder: Béton magenta en poudre + magenta_glazed_terracotta: Terre cuite émaillée magenta + magenta_shulker_box: Boîte de Shulker magenta + magenta_stained_glass: Verre magenta + magenta_stained_glass_pane: Vitre magenta + magenta_terracotta: Terre cuite magenta + magenta_wool: Laine magenta + magma_block: Bloc de magma + mangrove_button: Bouton en palétuvier + mangrove_door: Porte en palétuvier + mangrove_fence: Barrière en palétuvier + mangrove_fence_gate: Portillon en palétuvier + mangrove_hanging_sign: Pancarte suspendue en palétuvier + mangrove_leaves: Feuilles de palétuvier + mangrove_log: Bûche de palétuvier + mangrove_planks: Planches de palétuvier + mangrove_pressure_plate: Plaque de pression en palétuvier + mangrove_propagule: Propagule de palétuvier + mangrove_roots: Racines de palétuvier + mangrove_sign: Pancarte en palétuvier + mangrove_slab: Dalle en palétuvier + mangrove_stairs: Escalier en palétuvier + mangrove_trapdoor: Trappe en palétuvier + mangrove_wall_hanging_sign: Pancarte suspendue en palétuvier murale + mangrove_wall_sign: Pancarte en palétuvier murale + mangrove_wood: Bois de palétuvier + medium_amethyst_bud: Cristal moyen d'améthyste + melon: Pastèque + melon_stem: Tige de pastèque + moss_block: Bloc de mousse + moss_carpet: Tapis de mousse + mossy_cobblestone: Pierres moussues + mossy_cobblestone_slab: Dalle en pierres moussues + mossy_cobblestone_stairs: Escalier en pierres moussues + mossy_cobblestone_wall: Muret de pierres moussues + mossy_stone_brick_slab: Dalle en pierre taillée moussue + mossy_stone_brick_stairs: Escalier en pierre taillée moussue + mossy_stone_brick_wall: Muret en pierre taillée moussue + mossy_stone_bricks: Pierre taillée moussue + moving_piston: Bloc en mouvement + mud: Boue + mud_brick_slab: Dalle en briques de terre crue + mud_brick_stairs: Escalier en briques de terre crue + mud_brick_wall: Muret en briques de terre crue + mud_bricks: Briques de terre crue + muddy_mangrove_roots: Racines de palétuvier boueuses + mushroom_stem: Tige de champignon + mycelium: Mycélium + nether_brick_fence: Barrière en briques du Nether + nether_brick_slab: Dalle en briques du Nether + nether_brick_stairs: Escalier en briques du Nether + nether_brick_wall: Muret en briques du Nether + nether_bricks: Briques du Nether + nether_gold_ore: Minerai d'or du Nether + nether_portal: Portail du Nether + nether_quartz_ore: Minerai de quartz du Nether + nether_sprouts: Germes du Nether + nether_wart: Verrues du Nether + nether_wart_block: Bloc de verrues du Nether + netherite_block: Bloc de Netherite + netherrack: Netherrack + note_block: Bloc musical + oak_button: Bouton en chêne + oak_door: Porte en chêne + oak_fence: Barrière en chêne + oak_fence_gate: Portillon en chêne + oak_hanging_sign: Pancarte suspendue en chêne + oak_leaves: Feuilles de chêne + oak_log: Bûche de chêne + oak_planks: Planches de chêne + oak_pressure_plate: Plaque de pression en chêne + oak_sapling: Pousse de chêne + oak_sign: Pancarte en chêne + oak_slab: Dalle en chêne + oak_stairs: Escalier en chêne + oak_trapdoor: Trappe en chêne + oak_wall_hanging_sign: Pancarte suspendue en chêne murale + oak_wall_sign: Pancarte en chêne murale + oak_wood: Bois de chêne + observer: Observateur + obsidian: Obsidienne + ochre_froglight: Grelampe ocrée + ominous_banner: Bannière menaçante + orange_banner: Bannière orange + orange_bed: Lit orange + orange_candle: Bougie orange + orange_candle_cake: Gâteau à bougie orange + orange_carpet: Tapis orange + orange_concrete: Béton orange + orange_concrete_powder: Béton orange en poudre + orange_glazed_terracotta: Terre cuite émaillée orange + orange_shulker_box: Boîte de Shulker orange + orange_stained_glass: Verre orange + orange_stained_glass_pane: Vitre orange + orange_terracotta: Terre cuite orange + orange_tulip: Tulipe orange + orange_wool: Laine orange + oxeye_daisy: Marguerite + oxidized_copper: Cuivre oxydé + oxidized_cut_copper: Cuivre taillé oxydé + oxidized_cut_copper_slab: Dalle en cuivre taillé oxydé + oxidized_cut_copper_stairs: Escalier en cuivre taillé oxydé + packed_ice: Glace compactée + packed_mud: Terre crue + pearlescent_froglight: Grelampe nacrée + peony: Pivoine + petrified_oak_slab: Dalle en chêne pétrifiée + piglin_head: Tête de Piglin + piglin_wall_head: Tête de Piglin murale + pink_banner: Bannière rose + pink_bed: Lit rose + pink_candle: Bougie rose + pink_candle_cake: Gâteau à bougie rose + pink_carpet: Tapis rose + pink_concrete: Béton rose + pink_concrete_powder: Béton rose en poudre + pink_glazed_terracotta: Terre cuite émaillée rose + pink_petals: Pétales roses + pink_shulker_box: Boîte de Shulker rose + pink_stained_glass: Verre rose + pink_stained_glass_pane: Vitre rose + pink_terracotta: Terre cuite rose + pink_tulip: Tulipe rose + pink_wool: Laine rose + piston: Piston + piston_head: Tête de piston + pitcher_crop: Plant de planturne + pitcher_plant: Planturne + player_head: Tête de joueur + player_wall_head: Tête de joueur murale + podzol: Podzol + pointed_dripstone: Spéléothème pointu + polished_andesite: Andésite polie + polished_andesite_slab: Dalle d'andésite polie + polished_andesite_stairs: Escalier d'andésite polie + polished_basalt: Basalte poli + polished_blackstone: Pierre noire + polished_blackstone_brick_slab: Dalle en pierre noire taillée + polished_blackstone_brick_stairs: Escalier en pierre noire taillée + polished_blackstone_brick_wall: Muret en pierre noire taillée + polished_blackstone_bricks: Pierre noire taillée + polished_blackstone_button: Bouton en pierre noire + polished_blackstone_pressure_plate: Plaque de pression en pierre noire + polished_blackstone_slab: Dalle en pierre noire + polished_blackstone_stairs: Escalier en pierre noire + polished_blackstone_wall: Muret en pierre noire + polished_deepslate: Ardoise des abîmes polie + polished_deepslate_slab: Dalle en ardoise des abîmes polie + polished_deepslate_stairs: Escalier en ardoise des abîmes polie + polished_deepslate_wall: Muret en ardoise des abîmes polie + polished_diorite: Diorite polie + polished_diorite_slab: Dalle en diorite polie + polished_diorite_stairs: Escalier en diorite polie + polished_granite: Granite poli + polished_granite_slab: Dalle en granite poli + polished_granite_stairs: Escalier en granite poli + poppy: Coquelicot + potatoes: Pommes de terre + potted_acacia_sapling: Pousse d'acacia en pot + potted_allium: Allium en pot + potted_azalea_bush: Azalée en pot + potted_azure_bluet: Houstonie bleue en pot + potted_bamboo: Bambou en pot + potted_birch_sapling: Pousse de bouleau en pot + potted_blue_orchid: Orchidée bleue en pot + potted_brown_mushroom: Champignon brun en pot + potted_cactus: Cactus en pot + potted_cherry_sapling: Pousse de cerisier en pot + potted_cornflower: Bleuet en pot + potted_crimson_fungus: Champignon carmin en pot + potted_crimson_roots: Racines carmin en pot + potted_dandelion: Pissenlit en pot + potted_dark_oak_sapling: Pousse de chêne noir en pot + potted_dead_bush: Arbuste mort en pot + potted_fern: Fougère en pot + potted_flowering_azalea_bush: Azalée fleurie en pot + potted_jungle_sapling: Pousse d'acajou en pot + potted_lily_of_the_valley: Muguet en pot + potted_mangrove_propagule: Propagule de palétuvier en pot + potted_oak_sapling: Pousse de chêne en pot + potted_orange_tulip: Tulipe orange en pot + potted_oxeye_daisy: Marguerite en pot + potted_pink_tulip: Tulipe rose en pot + potted_poppy: Coquelicot en pot + potted_red_mushroom: Champignon rouge en pot + potted_red_tulip: Tulipe rouge en pot + potted_spruce_sapling: Pousse de sapin en pot + potted_torchflower: Torche-fleur en pot + potted_warped_fungus: Champignon biscornu en pot + potted_warped_roots: Racines biscornues en pot + potted_white_tulip: Tulipe blanche en pot + potted_wither_rose: Rose de Wither en pot + powder_snow: Neige poudreuse + powder_snow_cauldron: Chaudron de neige poudreuse + powered_rail: Rails de propulsion + prismarine: Prismarine + prismarine_brick_slab: Dalle de prismarine taillée + prismarine_brick_stairs: Escalier en prismarine taillée + prismarine_bricks: Prismarine taillée + prismarine_slab: Dalle de prismarine + prismarine_stairs: Escalier en prismarine + prismarine_wall: Muret de prismarine + pumpkin: Citrouille + pumpkin_stem: Tige de citrouille + purple_banner: Bannière violette + purple_bed: Lit violet + purple_candle: Bougie violette + purple_candle_cake: Gâteau à bougie violette + purple_carpet: Tapis violet + purple_concrete: Béton violet + purple_concrete_powder: Béton violet en poudre + purple_glazed_terracotta: Terre cuite émaillée violette + purple_shulker_box: Boîte de Shulker violette + purple_stained_glass: Verre violet + purple_stained_glass_pane: Vitre violette + purple_terracotta: Terre cuite violette + purple_wool: Laine violette + purpur_block: Bloc de purpur + purpur_pillar: Pilier de purpur + purpur_slab: Dalle de purpur + purpur_stairs: Escalier de purpur + quartz_block: Bloc de quartz + quartz_bricks: Briques de quartz + quartz_pillar: Pilier de quartz + quartz_slab: Dalle de quartz + quartz_stairs: Escalier en quartz + rail: Rails + raw_copper_block: Bloc de cuivre brut + raw_gold_block: Bloc d'or brut + raw_iron_block: Bloc de fer brut + red_banner: Bannière rouge + red_bed: Lit rouge + red_candle: Bougie rouge + red_candle_cake: Gâteau à bougie rouge + red_carpet: Tapis rouge + red_concrete: Béton rouge + red_concrete_powder: Béton rouge en poudre + red_glazed_terracotta: Terre cuite émaillée rouge + red_mushroom: Champignon rouge + red_mushroom_block: Bloc de champignon rouge + red_nether_brick_slab: Dalle en briques rouges du Nether + red_nether_brick_stairs: Escalier en briques rouges du Nether + red_nether_brick_wall: Muret en briques rouges du Nether + red_nether_bricks: Briques rouges du Nether + red_sand: Sable rouge + red_sandstone: Grès rouge + red_sandstone_slab: Dalle de grès rouge + red_sandstone_stairs: Escalier en grès rouge + red_sandstone_wall: Muret en grès rouge + red_shulker_box: Boîte de Shulker rouge + red_stained_glass: Verre rouge + red_stained_glass_pane: Vitre rouge + red_terracotta: Terre cuite rouge + red_tulip: Tulipe rouge + red_wool: Laine rouge + redstone_block: Bloc de redstone + redstone_lamp: Lampe à redstone + redstone_ore: Minerai de redstone + redstone_torch: Torche de redstone + redstone_wall_torch: Torche de redstone murale + redstone_wire: Câble de redstone + reinforced_deepslate: Ardoise des abîmes renforcée + repeater: Répéteur de redstone + repeating_command_block: Bloc de commande à répétition + respawn_anchor: Ancre de réapparition + rooted_dirt: Terre racineuse + rose_bush: Rosier + sand: Sable + sandstone: Grès + sandstone_slab: Dalle de grès + sandstone_stairs: Escalier en grès + sandstone_wall: Muret en grès + scaffolding: Échafaudage + sculk: Sculk + sculk_catalyst: Catalyseur de sculk + sculk_sensor: Capteur sculk + sculk_shrieker: Hurleur sculk + sculk_vein: Veine de sculk + sea_lantern: Lanterne aquatique + sea_pickle: Cornichon de mer + seagrass: Herbe aquatique + set_spawn: Point de réapparition défini + shroomlight: Champilampe + shulker_box: Boîte de Shulker + skeleton_skull: Crâne de squelette + skeleton_wall_skull: Crâne de squelette mural + slime_block: Bloc de Slime + small_amethyst_bud: Petit cristal d'améthyste + small_dripleaf: Petite foliogoutte + smithing_table: Table de forge + smoker: Fumoir + smooth_basalt: Basalte lisse + smooth_quartz: Bloc de quartz lisse + smooth_quartz_slab: Dalle en quartz lisse + smooth_quartz_stairs: Escalier en quartz lisse + smooth_red_sandstone: Grès rouge lisse + smooth_red_sandstone_slab: Dalle en grès rouge lisse + smooth_red_sandstone_stairs: Escalier en grès rouge lisse + smooth_sandstone: Grès lisse + smooth_sandstone_slab: Dalle en grès lisse + smooth_sandstone_stairs: Escalier en grès lisse + smooth_stone: Roche lisse + smooth_stone_slab: Dalle de roche lisse + sniffer_egg: Oeuf de renifleur + snow: Neige + snow_block: Bloc de neige + soul_campfire: Feu de camp des âmes + soul_fire: Feu des âmes + soul_lantern: Lanterne des âmes + soul_sand: Sable des âmes + soul_soil: Terre des âmes + soul_torch: Torche des âmes + soul_wall_torch: Torche des âmes murale + spawner: Générateur de créatures + sponge: Éponge + spore_blossom: Fleur sporifère + spruce_button: Bouton en sapin + spruce_door: Porte en sapin + spruce_fence: Barrière en sapin + spruce_fence_gate: Portillon en sapin + spruce_hanging_sign: Pancarte suspendue en sapin + spruce_leaves: Feuilles de sapin + spruce_log: Bûche de sapin + spruce_planks: Planches de sapin + spruce_pressure_plate: Plaque de pression en sapin + spruce_sapling: Pousse de sapin + spruce_sign: Pancarte en sapin + spruce_slab: Dalle en sapin + spruce_stairs: Escalier en sapin + spruce_trapdoor: Trappe en sapin + spruce_wall_hanging_sign: Pancarte suspendue en sapin murale + spruce_wall_sign: Pancarte en sapin murale + spruce_wood: Bois de sapin + sticky_piston: Piston collant + stone: Roche + stone_brick_slab: Dalle en pierre taillée + stone_brick_stairs: Escalier en pierre taillée + stone_brick_wall: Muret en pierre taillée + stone_bricks: Pierre taillée + stone_button: Bouton en pierre + stone_pressure_plate: Plaque de pression en pierre + stone_slab: Dalle de roche + stone_stairs: Escalier de roche + stonecutter: Tailleur de pierre + stripped_acacia_log: Bûche d'acacia écorcée + stripped_acacia_wood: Bois d'acacia écorcé + stripped_bamboo_block: Bloc de bambou écorcé + stripped_birch_log: Bûche de bouleau écorcée + stripped_birch_wood: Bois de bouleau écorcé + stripped_cherry_log: Bûche de cerisier écorcée + stripped_cherry_wood: Bois de cerisier écorcé + stripped_crimson_hyphae: Hyphes carmin dénudées + stripped_crimson_stem: Tige carmin dénudée + stripped_dark_oak_log: Bûche de chêne noir écorcée + stripped_dark_oak_wood: Bois de chêne noir écorcé + stripped_jungle_log: Bûche d'acajou écorcée + stripped_jungle_wood: Bois d'acajou écorcé + stripped_mangrove_log: Bûche de palétuvier écorcée + stripped_mangrove_wood: Bois de palétuvier écorcé + stripped_oak_log: Bûche de chêne écorcée + stripped_oak_wood: Bois de chêne écorcé + stripped_spruce_log: Bûche de sapin écorcée + stripped_spruce_wood: Bois de sapin écorcé + stripped_warped_hyphae: Hyphes biscornues dénudées + stripped_warped_stem: Tige biscornue dénudée + structure_block: Bloc de structure + structure_void: Vide de structure + sugar_cane: Canne à sucre + sunflower: Tournesol + suspicious_gravel: Gravier suspect + suspicious_sand: Sable suspect + sweet_berry_bush: Buisson à baies sucrées + tall_grass: Hautes herbes + tall_seagrass: Hautes herbes aquatiques + target: Cible + terracotta: Terre cuite + tinted_glass: Verre teinté + tnt: TNT + torch: Torche + torchflower: Torche-fleur + torchflower_crop: Plant de torche-fleur + trapped_chest: Coffre piégé + tripwire: Fil de déclenchement + tripwire_hook: Crochet + tube_coral: Corail tubulaire + tube_coral_block: Bloc de corail tubulaire + tube_coral_fan: Gorgone de corail tubulaire + tube_coral_wall_fan: Gorgone de corail tubulaire murale + tuff: Tuf + turtle_egg: Oeuf de tortue + twisting_vines: Lianes tortueuses + twisting_vines_plant: Plante de lianes tortueuses + verdant_froglight: Grelampe verdoyante + vine: Lianes + void_air: Air du vide + wall_torch: Torche murale + warped_button: Bouton biscornu + warped_door: Porte biscornue + warped_fence: Barrière biscornue + warped_fence_gate: Portillon biscornu + warped_fungus: Champignon biscornu + warped_hanging_sign: Pancarte suspendue biscornue + warped_hyphae: Hyphes biscornues + warped_nylium: Nylium biscornu + warped_planks: Planches biscornues + warped_pressure_plate: Plaque de pression biscornue + warped_roots: Racines biscornues + warped_sign: Pancarte biscornue + warped_slab: Dalle biscornue + warped_stairs: Escalier biscornu + warped_stem: Tige biscornue + warped_trapdoor: Trappe biscornue + warped_wall_hanging_sign: Pancarte suspendue biscornue murale + warped_wall_sign: Pancarte biscornue murale + warped_wart_block: Bloc de verrues biscornues + water: Eau + water_cauldron: Chaudron d'eau + waxed_copper_block: Bloc de cuivre ciré + waxed_cut_copper: Cuivre taillé ciré + waxed_cut_copper_slab: Dalle en cuivre taillé cirée + waxed_cut_copper_stairs: Escalier en cuivre taillé ciré + waxed_exposed_copper: Cuivre exposé ciré + waxed_exposed_cut_copper: Cuivre taillé exposé ciré + waxed_exposed_cut_copper_slab: Dalle en cuivre taillé exposé cirée + waxed_exposed_cut_copper_stairs: Escalier en cuivre taillé exposé ciré + waxed_oxidized_copper: Cuivre oxydé ciré + waxed_oxidized_cut_copper: Cuivre taillé oxydé ciré + waxed_oxidized_cut_copper_slab: Dalle en cuivre taillé oxydé cirée + waxed_oxidized_cut_copper_stairs: Escalier en cuivre taillé oxydé ciré + waxed_weathered_copper: Cuivre érodé ciré + waxed_weathered_cut_copper: Cuivre taillé érodé ciré + waxed_weathered_cut_copper_slab: Dalle en cuivre taillé érodé cirée + waxed_weathered_cut_copper_stairs: Escalier en cuivre taillé érodé ciré + weathered_copper: Cuivre érodé + weathered_cut_copper: Cuivre taillé érodé + weathered_cut_copper_slab: Dalle en cuivre taillé érodé + weathered_cut_copper_stairs: Escalier en cuivre taillé érodé + weeping_vines: Lianes pleureuses + weeping_vines_plant: Plante de lianes pleureuses + wet_sponge: Éponge mouillée + wheat: Blé + white_banner: Bannière blanche + white_bed: Lit blanc + white_candle: Bougie blanche + white_candle_cake: Gâteau à bougie blanche + white_carpet: Tapis blanc + white_concrete: Béton blanc + white_concrete_powder: Béton blanc en poudre + white_glazed_terracotta: Terre cuite émaillée blanche + white_shulker_box: Boîte de Shulker blanche + white_stained_glass: Verre blanc + white_stained_glass_pane: Vitre blanche + white_terracotta: Terre cuite blanche + white_tulip: Tulipe blanche + white_wool: Laine blanche + wither_rose: Rose de Wither + wither_skeleton_skull: Crâne de Wither squelette + wither_skeleton_wall_skull: Crâne de Wither squelette mural + yellow_banner: Bannière jaune + yellow_bed: Lit jaune + yellow_candle: Bougie jaune + yellow_candle_cake: Gâteau à bougie jaune + yellow_carpet: Tapis jaune + yellow_concrete: Béton jaune + yellow_concrete_powder: Béton jaune en poudre + yellow_glazed_terracotta: Terre cuite émaillée jaune + yellow_shulker_box: Boîte de Shulker jaune + yellow_stained_glass: Verre jaune + yellow_stained_glass_pane: Vitre jaune + yellow_terracotta: Terre cuite jaune + yellow_wool: Laine jaune + zombie_head: Tête de zombie + zombie_wall_head: Tête de zombie murale + acacia_boat: Bateau en acacia + acacia_chest_boat: Bateau de stockage en acacia + allay_spawn_egg: Oeuf d'apparition d'Allay + amethyst_shard: Éclat d'améthyste + angler_pottery_shard: Tesson de poterie de pêcheur + angler_pottery_sherd: Tesson de poterie de pêcheur + apple: Pomme + archer_pottery_shard: Tesson de poterie d'archer + archer_pottery_sherd: Tesson de poterie d'archer + armor_stand: Porte-armure + arms_up_pottery_shard: Tesson de poterie de figure + arms_up_pottery_sherd: Tesson de poterie de figure + arrow: Flèche + axolotl_bucket: Axolotl dans un seau + axolotl_spawn_egg: Oeuf d'apparition d'axolotl + baked_potato: Pomme de terre cuite + bamboo_chest_raft: Radeau de stockage en bambou + bamboo_raft: Radeau en bambou + bat_spawn_egg: Oeuf d'apparition de chauve-souris + bee_spawn_egg: Oeuf d'apparition d'abeille + beef: Boeuf cru + beetroot: Betterave + beetroot_seeds: Graines de betterave + beetroot_soup: Soupe de betteraves + birch_boat: Bateau en bouleau + birch_chest_boat: Bateau de stockage en bouleau + black_dye: Teinture noire + blade_pottery_shard: Tesson de poterie de lame + blade_pottery_sherd: Tesson de poterie de lame + blaze_powder: Poudre de Blaze + blaze_rod: Bâton de Blaze + blaze_spawn_egg: Oeuf d'apparition de Blaze + blue_dye: Teinture bleue + bone: Os + bone_meal: Poudre d'os + book: Livre + bow: Arc + bowl: Bol + bread: Pain + brewer_pottery_shard: Tesson de poterie d'alchimiste + brewer_pottery_sherd: Tesson de poterie d'alchimiste + brick: Brique + brown_dye: Teinture marron + brush: Pinceau + bucket: Seau + bundle: Sac + burn_pottery_shard: Tesson de poterie de feu + burn_pottery_sherd: Tesson de poterie de feu + camel_spawn_egg: Oeuf d'apparition de dromadaire + carrot: Carotte + carrot_on_a_stick: Carotte sur un bâton + cat_spawn_egg: Oeuf d'apparition de chat + cave_spider_spawn_egg: Oeuf d'apparition d'araignée venimeuse + chainmail_boots: Bottes de mailles + chainmail_chestplate: Cotte de mailles + chainmail_helmet: Casque de mailles + chainmail_leggings: Jambières de mailles + charcoal: Charbon de bois + cherry_boat: Bateau en cerisier + cherry_chest_boat: Bateau de stockage en cerisier + chest_minecart: Wagonnet de stockage + chicken: Poulet cru + chicken_spawn_egg: Oeuf d'apparition de poule + chorus_fruit: Chorus + clay_ball: Motte d'argile + clock: Montre + coal: Charbon + coast_armor_trim_smithing_template: Modèle de forge + cocoa_beans: Fèves de cacao + cod: Morue crue + cod_bucket: Morue dans un seau + cod_spawn_egg: Oeuf d'apparition de morue + command_block_minecart: Wagonnet à bloc de commande + compass: Boussole + cooked_beef: Steak + cooked_chicken: Poulet rôti + cooked_cod: Morue cuite + cooked_mutton: Mouton cuit + cooked_porkchop: Côtelette de porc cuite + cooked_rabbit: Lapin cuit + cooked_salmon: Saumon cuit + cookie: Cookie + copper_ingot: Lingot de cuivre + cow_spawn_egg: Oeuf d'apparition de vache + creeper_banner_pattern: Motif de bannière + creeper_spawn_egg: Oeuf d'apparition de Creeper + crossbow: Arbalète + cyan_dye: Teinture cyan + danger_pottery_shard: Tesson de poterie de danger + danger_pottery_sherd: Tesson de poterie de danger + dark_oak_boat: Bateau en chêne noir + dark_oak_chest_boat: Bateau de stockage en chêne noir + debug_stick: Bâton de débogage + diamond: Diamant + diamond_axe: Hache en diamant + diamond_boots: Bottes en diamant + diamond_chestplate: Plastron en diamant + diamond_helmet: Casque en diamant + diamond_hoe: Houe en diamant + diamond_horse_armor: Armure en diamant pour cheval + diamond_leggings: Jambières en diamant + diamond_pickaxe: Pioche en diamant + diamond_shovel: Pelle en diamant + diamond_sword: Épée en diamant + disc_fragment_5: Fragment de disque + dolphin_spawn_egg: Oeuf d'apparition de dauphin + donkey_spawn_egg: Oeuf d'apparition d'âne + dragon_breath: Souffle de dragon + dried_kelp: Algue séchée + drowned_spawn_egg: Oeuf d'apparition de noyé + dune_armor_trim_smithing_template: Modèle de forge + echo_shard: Éclat d'écho + egg: Oeuf + elder_guardian_spawn_egg: Oeuf d'apparition de grand gardien + elytra: Élytres + emerald: Émeraude + enchanted_book: Livre enchanté + enchanted_golden_apple: Pomme dorée enchantée + end_crystal: Cristal de l'End + ender_dragon_spawn_egg: Oeuf d'apparition d'Ender Dragon + ender_eye: Oeil de l'Ender + ender_pearl: Perle de l'Ender + enderman_spawn_egg: Oeuf d'apparition d'Enderman + endermite_spawn_egg: Oeuf d'apparition d'Endermite + evoker_spawn_egg: Oeuf d'apparition d'évocateur + experience_bottle: Fiole d'expérience + explorer_pottery_shard: Tesson de poterie d'explorateur + explorer_pottery_sherd: Tesson de poterie d'explorateur + eye_armor_trim_smithing_template: Modèle de forge + feather: Plume + fermented_spider_eye: Oeil d'araignée fermenté + filled_map: Carte + fire_charge: Boule de feu + firework_rocket: Fusée de feu d'artifice + firework_star: Étoile de feu d'artifice + fishing_rod: Canne à pêche + flint: Silex + flint_and_steel: Briquet + flower_banner_pattern: Motif de bannière + fox_spawn_egg: Oeuf d'apparition de renard + friend_pottery_shard: Tesson de poterie d'ami + friend_pottery_sherd: Tesson de poterie d'ami + frog_spawn_egg: Oeuf d'apparition de grenouille + furnace_minecart: Wagonnet motorisé + ghast_spawn_egg: Oeuf d'apparition de Ghast + ghast_tear: Larme de Ghast + glass_bottle: Fiole + glistering_melon_slice: Tranche de pastèque scintillante + globe_banner_pattern: Motif de bannière + glow_berries: Baies lumineuses + glow_ink_sac: Poche d'encre luisante + glow_item_frame: Cadre luisant + glow_squid_spawn_egg: Oeuf d'apparition de poulpe luisant + glowstone_dust: Poudre lumineuse + goat_horn: Corne de chèvre + goat_spawn_egg: Oeuf d'apparition de chèvre + gold_ingot: Lingot d'or + gold_nugget: Pépite d'or + golden_apple: Pomme dorée + golden_axe: Hache en or + golden_boots: Bottes en or + golden_carrot: Carotte dorée + golden_chestplate: Plastron en or + golden_helmet: Casque en or + golden_hoe: Houe en or + golden_horse_armor: Armure en or pour cheval + golden_leggings: Jambières en or + golden_pickaxe: Pioche en or + golden_shovel: Pelle en or + golden_sword: Épée en or + gray_dye: Teinture grise + green_dye: Teinture verte + guardian_spawn_egg: Oeuf d'apparition de gardien + gunpowder: Poudre à canon + heart_of_the_sea: Coeur de la mer + heart_pottery_shard: Tesson de poterie de coeur + heart_pottery_sherd: Tesson de poterie de coeur + heartbreak_pottery_shard: Tesson de poterie de coeur brisé + heartbreak_pottery_sherd: Tesson de poterie de coeur brisé + hoglin_spawn_egg: Oeuf d'apparition de Hoglin + honey_bottle: Fiole de miel + honeycomb: Rayon de miel + hopper_minecart: Wagonnet à entonnoir + horse_spawn_egg: Oeuf d'apparition de cheval + host_armor_trim_smithing_template: Modèle de forge + howl_pottery_shard: Tesson de poterie de loup + howl_pottery_sherd: Tesson de poterie de loup + husk_spawn_egg: Oeuf d'apparition de zombie momifié + ink_sac: Poche d'encre + iron_axe: Hache en fer + iron_boots: Bottes en fer + iron_chestplate: Plastron en fer + iron_golem_spawn_egg: Oeuf d'apparition de golem de fer + iron_helmet: Casque en fer + iron_hoe: Houe en fer + iron_horse_armor: Armure en fer pour cheval + iron_ingot: Lingot de fer + iron_leggings: Jambières en fer + iron_nugget: Pépite de fer + iron_pickaxe: Pioche en fer + iron_shovel: Pelle en fer + iron_sword: Épée en fer + item_frame: Cadre + jungle_boat: Bateau en acajou + jungle_chest_boat: Bateau de stockage en acajou + knowledge_book: Livre des connaissances + lapis_lazuli: Lapis-lazuli + lava_bucket: Seau de lave + lead: Laisse + leather: Cuir + leather_boots: Bottes en cuir + leather_chestplate: Tunique en cuir + leather_helmet: Chapeau en cuir + leather_horse_armor: Armure en cuir pour cheval + leather_leggings: Pantalon en cuir + light_blue_dye: Teinture bleu clair + light_gray_dye: Teinture gris clair + lime_dye: Teinture vert clair + lingering_potion: Potion persistante + llama_spawn_egg: Oeuf d'apparition de lama + lodestone_compass: Boussole magnétisée + magenta_dye: Teinture magenta + magma_cream: Crème de magma + magma_cube_spawn_egg: Oeuf d'apparition de cube de magma + mangrove_boat: Bateau en palétuvier + mangrove_chest_boat: Bateau de stockage en palétuvier + map: Carte vierge + melon_seeds: Graines de pastèque + melon_slice: Tranche de pastèque + milk_bucket: Seau de lait + minecart: Wagonnet + miner_pottery_shard: Tesson de poterie de mineur + miner_pottery_sherd: Tesson de poterie de mineur + mojang_banner_pattern: Motif de bannière + mooshroom_spawn_egg: Oeuf d'apparition de Mooshroom + mourner_pottery_shard: Tesson de poterie de pleureur + mourner_pottery_sherd: Tesson de poterie de pleureur + mule_spawn_egg: Oeuf d'apparition de mule + mushroom_stew: Soupe de champignons + music_disc_11: Disque + music_disc_13: Disque + music_disc_5: Disque + music_disc_blocks: Disque + music_disc_cat: Disque + music_disc_chirp: Disque + music_disc_far: Disque + music_disc_mall: Disque + music_disc_mellohi: Disque + music_disc_otherside: Disque + music_disc_pigstep: Disque + music_disc_relic: Disque + music_disc_stal: Disque + music_disc_strad: Disque + music_disc_wait: Disque + music_disc_ward: Disque + mutton: Mouton cru + name_tag: Étiquette + nautilus_shell: Coquille de nautile + nether_brick: Brique du Nether + nether_star: Étoile du Nether + netherite_axe: Hache en Netherite + netherite_boots: Bottes en Netherite + netherite_chestplate: Plastron en Netherite + netherite_helmet: Casque en Netherite + netherite_hoe: Houe en Netherite + netherite_ingot: Lingot de Netherite + netherite_leggings: Jambières en Netherite + netherite_pickaxe: Pioche en Netherite + netherite_scrap: Fragments de Netherite + netherite_shovel: Pelle en Netherite + netherite_sword: Épée en Netherite + netherite_upgrade_smithing_template: Modèle de forge + oak_boat: Bateau en chêne + oak_chest_boat: Bateau de stockage en chêne + ocelot_spawn_egg: Oeuf d'apparition d'ocelot + orange_dye: Teinture orange + painting: Tableau + panda_spawn_egg: Oeuf d'apparition de panda + paper: Papier + parrot_spawn_egg: Oeuf d'apparition de perroquet + phantom_membrane: Membrane de Phantom + phantom_spawn_egg: Oeuf d'apparition de Phantom + pig_spawn_egg: Oeuf d'apparition de cochon + piglin_banner_pattern: Motif de bannière + piglin_brute_spawn_egg: Oeuf d'apparition de Piglin barbare + piglin_spawn_egg: Oeuf d'apparition de Piglin + pillager_spawn_egg: Oeuf d'apparition de pillard + pink_dye: Teinture rose + pitcher_pod: Gousse de planturne + plenty_pottery_shard: Tesson de poterie de richesse + plenty_pottery_sherd: Tesson de poterie de richesse + poisonous_potato: Pomme de terre empoisonnée + polar_bear_spawn_egg: Oeuf d'apparition d'ours blanc + popped_chorus_fruit: Chorus éclaté + porkchop: Côtelette de porc crue + potato: Pomme de terre + potion: Potion + pottery_shard_archer: Tesson de poterie d'archer + pottery_shard_arms_up: Tesson de poterie de figure + pottery_shard_prize: Tesson de poterie de joyau + pottery_shard_skull: Tesson de poterie de crâne + powder_snow_bucket: Seau de neige poudreuse + prismarine_crystals: Cristaux de prismarine + prismarine_shard: Éclat de prismarine + prize_pottery_shard: Tesson de poterie de joyau + prize_pottery_sherd: Tesson de poterie de joyau + pufferfish: Poisson-globe + pufferfish_bucket: Poisson-globe dans un seau + pufferfish_spawn_egg: Oeuf d'apparition de poisson-globe + pumpkin_pie: Tarte à la citrouille + pumpkin_seeds: Graines de citrouille + purple_dye: Teinture violette + quartz: Quartz du Nether + rabbit: Lapin cru + rabbit_foot: Patte de lapin + rabbit_hide: Peau de lapin + rabbit_spawn_egg: Oeuf d'apparition de lapin + rabbit_stew: Ragoût de lapin + raiser_armor_trim_smithing_template: Modèle de forge + ravager_spawn_egg: Oeuf d'apparition de ravageur + raw_copper: Cuivre brut + raw_gold: Or brut + raw_iron: Fer brut + recovery_compass: Boussole de récupération + red_dye: Teinture rouge + redstone: Poudre de redstone + rib_armor_trim_smithing_template: Modèle de forge + rotten_flesh: Chair putréfiée + saddle: Selle + salmon: Saumon cru + salmon_bucket: Saumon dans un seau + salmon_spawn_egg: Oeuf d'apparition de saumon + scute: Écaille de tortue + sentry_armor_trim_smithing_template: Modèle de forge + shaper_armor_trim_smithing_template: Modèle de forge + sheaf_pottery_shard: Tesson de poterie d'épis + sheaf_pottery_sherd: Tesson de poterie d'épis + shears: Cisailles + sheep_spawn_egg: Oeuf d'apparition de mouton + shelter_pottery_shard: Tesson de poterie d'abri + shelter_pottery_sherd: Tesson de poterie d'abri + shield: Bouclier + shulker_shell: Carapace de Shulker + shulker_spawn_egg: Oeuf d'apparition de Shulker + sign: Pancarte + silence_armor_trim_smithing_template: Modèle de forge + silverfish_spawn_egg: Oeuf d'apparition de poisson d'argent + skeleton_horse_spawn_egg: Oeuf d'apparition de cheval-squelette + skeleton_spawn_egg: Oeuf d'apparition de squelette + skull_banner_pattern: Motif de bannière + skull_pottery_shard: Tesson de poterie de crâne + skull_pottery_sherd: Tesson de poterie de crâne + slime_ball: Boule de Slime + slime_spawn_egg: Oeuf d'apparition de Slime + smithing_template: Modèle de forge + sniffer_spawn_egg: Oeuf d'apparition de renifleur + snort_pottery_shard: Tesson de poterie de renifleur + snort_pottery_sherd: Tesson de poterie de renifleur + snout_armor_trim_smithing_template: Modèle de forge + snow_golem_spawn_egg: Oeuf d'apparition de golem de neige + snowball: Boule de neige + spectral_arrow: Flèche spectrale + spider_eye: Oeil d'araignée + spider_spawn_egg: Oeuf d'apparition d'araignée + spire_armor_trim_smithing_template: Modèle de forge + splash_potion: Potion jetable + spruce_boat: Bateau en sapin + spruce_chest_boat: Bateau de stockage en sapin + spyglass: Longue-vue + squid_spawn_egg: Oeuf d'apparition de poulpe + stick: Bâton + stone_axe: Hache en pierre + stone_hoe: Houe en pierre + stone_pickaxe: Pioche en pierre + stone_shovel: Pelle en pierre + stone_sword: Épée en pierre + stray_spawn_egg: Oeuf d'apparition de vagabond + strider_spawn_egg: Oeuf d'apparition d'arpenteur + string: Ficelle + sugar: Sucre + suspicious_stew: Soupe suspecte + sweet_berries: Baies sucrées + tadpole_bucket: Têtard dans un seau + tadpole_spawn_egg: Oeuf d'apparition de têtard + tide_armor_trim_smithing_template: Modèle de forge + tipped_arrow: Flèche à effet + tnt_minecart: Wagonnet à TNT + torchflower_seeds: Graines de torche-fleur + totem_of_undying: Totem d'immortalité + trader_llama_spawn_egg: Oeuf d'apparition de lama de marchand + trident: Trident + tropical_fish: Poisson tropical + tropical_fish_bucket: Poisson tropical dans un seau + tropical_fish_spawn_egg: Oeuf d'apparition de poisson tropical + turtle_helmet: Carapace de tortue + turtle_spawn_egg: Oeuf d'apparition de tortue + vex_armor_trim_smithing_template: Modèle de forge + vex_spawn_egg: Oeuf d'apparition de Vex + villager_spawn_egg: Oeuf d'apparition de villageois + vindicator_spawn_egg: Oeuf d'apparition de vindicateur + wandering_trader_spawn_egg: Oeuf d'apparition de marchand ambulant + ward_armor_trim_smithing_template: Modèle de forge + warden_spawn_egg: Oeuf d'apparition de Warden + warped_fungus_on_a_stick: Champignon biscornu sur un bâton + water_bucket: Seau d'eau + wayfinder_armor_trim_smithing_template: Modèle de forge + wheat_seeds: Graines de blé + white_dye: Teinture blanche + wild_armor_trim_smithing_template: Modèle de forge + witch_spawn_egg: Oeuf d'apparition de sorcière + wither_skeleton_spawn_egg: Oeuf d'apparition de Wither squelette + wither_spawn_egg: Oeuf d'apparition de Wither + wolf_spawn_egg: Oeuf d'apparition de loup + wooden_axe: Hache en bois + wooden_hoe: Houe en bois + wooden_pickaxe: Pioche en bois + wooden_shovel: Pelle en bois + wooden_sword: Épée en bois + writable_book: Livre et plume + written_book: Livre écrit + yellow_dye: Teinture jaune + zoglin_spawn_egg: Oeuf d'apparition de Zoglin + zombie_horse_spawn_egg: Oeuf d'apparition de cheval-zombie + zombie_spawn_egg: Oeuf d'apparition de zombie + zombie_villager_spawn_egg: Oeuf d'apparition de zombie-villageois + zombified_piglin_spawn_egg: Oeuf d'apparition de Piglin zombifié +Enchantment: + aqua_affinity: Affinité aquatique + bane_of_arthropods: Fléau des arthropodes + binding_curse: Malédiction du lien éternel + blast_protection: Protection contre les explosions + channeling: Canalisation + depth_strider: Agilité aquatique + efficiency: Efficacité + feather_falling: Chute amortie + fire_aspect: Aura de feu + fire_protection: Protection contre le feu + flame: Flamme + fortune: Fortune + frost_walker: Semelles givrantes + impaling: Empalement + infinity: Infinité + knockback: Recul + looting: Butin + loyalty: Loyauté + luck_of_the_sea: Chance de la mer + lure: Appât + mending: Raccommodage + multishot: Tir multiple + piercing: Perforation + power: Puissance + projectile_protection: Protection contre les projectiles + protection: Protection + punch: Frappe + quick_charge: Charge rapide + respiration: Apnée + riptide: Impulsion + sharpness: Tranchant + silk_touch: Toucher de soie + smite: Châtiment + soul_speed: Agilité des âmes + sweeping: Affilage + swift_sneak: Furtivité rapide + thorns: Épines + unbreaking: Solidité + vanishing_curse: Malédiction de disparition diff --git a/assets/pt_br.yml b/assets/pt_br.yml new file mode 100644 index 0000000..659aee6 --- /dev/null +++ b/assets/pt_br.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: Allay + area_effect_cloud: Nuvem de efeito de área + armor_stand: Suporte de armaduras + arrow: Flecha + axolotl: Axolote + bat: Morcego + bee: Abelha + blaze: Blaze + block_display: Entidade-bloco + boat: Bote + camel: Camelo + cat: Gato + cave_spider: Aranha das cavernas + chest_boat: Bote com baú + chest_minecart: Carrinho de mina com baú + chicken: Galinha + cod: Bacalhau + command_block_minecart: Carrinho de mina com bloco de comando + cow: Vaca + creeper: Creeper + dolphin: Golfinho + donkey: Burro + dragon_fireball: Bola de fogo do dragão + drowned: Afogado + egg: Ovo lançado + elder_guardian: Guardião-mestre + end_crystal: Cristal do End + ender_dragon: Dragão Ender + ender_pearl: Pérola de ender lançada + enderman: Enderman + endermite: Endermite + evoker: Invocador + evoker_fangs: Presas de invocador + experience_bottle: Frasco de experiência lançado + experience_orb: Esfera de experiência + eye_of_ender: Olho de ender + falling_block: Bloco em queda + falling_block_type: '%s em queda' + fireball: Bola de fogo + firework_rocket: Fogo de artifício + fishing_bobber: Boia de pesca + fox: Raposa + frog: Sapo + furnace_minecart: Carrinho de mina com fornalha + ghast: Ghast + giant: Zumbi gigante + glow_item_frame: Moldura brilhante + glow_squid: Lula-brilhante + goat: Cabra + guardian: Guardião + hoglin: Hoglin + hopper_minecart: Carrinho de mina com funil + horse: Cavalo + husk: Zumbi-múmia + illusioner: Ilusionista + interaction: Entidade-interação + iron_golem: Golem de ferro + item: Item + item_display: Entidade-item + item_frame: Moldura + killer_bunny: Coelho assassino + leash_knot: Nó de laço + lightning_bolt: Trovão + llama: Lhama + llama_spit: Cuspe de lhama + magma_cube: Cubo de magma + marker: Marcador + minecart: Carrinho de mina + mooshroom: Mooshroom + mule: Mula + ocelot: Jaguatirica + painting: Quadro + panda: Panda + parrot: Papagaio + phantom: Phantom + pig: Porco + piglin: Piglin + piglin_brute: Piglin bárbaro + pillager: Saqueador + player: Jogador + polar_bear: Urso polar + potion: Poção + pufferfish: Baiacu + rabbit: Coelho + ravager: Devastador + salmon: Salmão + sheep: Ovelha + shulker: Shulker + shulker_bullet: Projétil de shulker + silverfish: Traça + skeleton: Esqueleto + skeleton_horse: Cavalo-esqueleto + slime: Slime + small_fireball: Bola de fogo pequena + sniffer: Farejador + snow_golem: Golem de neve + snowball: Bola de neve + spawner_minecart: Carrinho de mina com gerador de criaturas + spectral_arrow: Flecha espectral + spider: Aranha + squid: Lula + stray: Esqueleto-errante + strider: Lavagante + tadpole: Girino + text_display: Entidade-texto + tnt: Dinamite acionada + tnt_minecart: Carrinho de mina com dinamite + trader_llama: Lhama do vendedor + trident: Tridente + tropical_fish: Peixe tropical + turtle: Tartaruga + vex: Vex + villager: Aldeão + vindicator: Vingador + wandering_trader: Vendedor ambulante + warden: Defensor + witch: Bruxa + wither: Wither + wither_skeleton: Esqueleto wither + wither_skull: Crânio de Wither + wolf: Lobo + zoglin: Zoglin + zombie: Zumbi + zombie_horse: Cavalo-zumbi + zombie_villager: Aldeão zumbi + zombified_piglin: Piglin-zumbi +PotionEffectType: + absorption: Absorção + bad_omen: Mau presságio + blindness: Cegueira + conduit_power: Proteção do mar + darkness: Escuridão + dolphins_grace: Graça marinha + fire_resistance: Resist. ao fogo + glowing: Brilho + haste: Pressa + health_boost: Vida extra + hero_of_the_village: Herói da vila + hunger: Fome + instant_damage: Dano instantâneo + instant_health: Vida instantânea + invisibility: Invisibilidade + jump_boost: Supersalto + levitation: Levitação + luck: Sorte + mining_fatigue: Exaustão + nausea: Náusea + night_vision: Visão noturna + poison: Veneno + regeneration: Regeneração + resistance: Resistência + saturation: Saturação + slow_falling: Queda lenta + slowness: Lentidão + speed: Velocidade + strength: Força + unluck: Má sorte + water_breathing: Respir. aquática + weakness: Fraqueza + wither: Decomposição +Material: + acacia_button: Botão de acácia + acacia_door: Porta de acácia + acacia_fence: Cerca de acácia + acacia_fence_gate: Portão de acácia + acacia_hanging_sign: Placa suspensa de acácia + acacia_leaves: Folhas de acácia + acacia_log: Tronco de acácia + acacia_planks: Tábuas de acácia + acacia_pressure_plate: Placa de pressão de acácia + acacia_sapling: Muda de acácia + acacia_sign: Placa de acácia + acacia_slab: Laje de acácia + acacia_stairs: Escadas de acácia + acacia_trapdoor: Alçapão de acácia + acacia_wall_hanging_sign: Placa suspensa de acácia de parede + acacia_wall_sign: Placa de acácia de parede + acacia_wood: Madeira de acácia + activator_rail: Trilho ativador + air: Ar + allium: Alho-silvestre + amethyst_block: Bloco de ametista + amethyst_cluster: Agregado de ametista + ancient_debris: Detritos ancestrais + andesite: Andesito + andesite_slab: Laje de andesito + andesite_stairs: Escadas de andesito + andesite_wall: Muro de andesito + anvil: Bigorna + attached_melon_stem: Caule de melancia unido + attached_pumpkin_stem: Caule de abóbora unido + azalea: Azaleia + azalea_leaves: Folhas de azaleia + azure_bluet: Flor-silvestre-azul + bamboo: Bambu + bamboo_block: Bloco de bambu + bamboo_button: Botão de bambu + bamboo_door: Porta de bambu + bamboo_fence: Cerca de bambu + bamboo_fence_gate: Portão de bambu + bamboo_hanging_sign: Placa suspensa de bambu + bamboo_mosaic: Mosaico de bambu + bamboo_mosaic_slab: Laje de mosaico de bambu + bamboo_mosaic_stairs: Escadas de mosaico de bambu + bamboo_planks: Tábuas de bambu + bamboo_pressure_plate: Placa de pressão de bambu + bamboo_sapling: Muda de bambu + bamboo_sign: Placa de bambu + bamboo_slab: Laje de bambu + bamboo_stairs: Escadas de bambu + bamboo_trapdoor: Alçapão de bambu + bamboo_wall_hanging_sign: Placa suspensa de bambu de parede + bamboo_wall_sign: Placa de bambu de parede + barrel: Barril + barrier: Barreira + basalt: Basalto + beacon: Sinalizador + bedrock: Rocha-mãe + bee_nest: Colmeia + beehive: Colmeia artificial + beetroots: Beterrabas + bell: Sino + big_dripleaf: Plantaforma grande + big_dripleaf_stem: Caule de plantaforma grande + birch_button: Botão de bétula + birch_door: Porta de bétula + birch_fence: Cerca de bétula + birch_fence_gate: Portão de bétula + birch_hanging_sign: Placa suspensa de bétula + birch_leaves: Folhas de bétula + birch_log: Tronco de bétula + birch_planks: Tábuas de bétula + birch_pressure_plate: Placa de pressão de bétula + birch_sapling: Muda de bétula + birch_sign: Placa de bétula + birch_slab: Laje de bétula + birch_stairs: Escadas de bétula + birch_trapdoor: Alçapão de bétula + birch_wall_hanging_sign: Placa suspensa de bétula de parede + birch_wall_sign: Placa de bétula de parede + birch_wood: Madeira de bétula + black_banner: Estandarte preto + black_bed: Cama preta + black_candle: Vela preta + black_candle_cake: Bolo com vela preta + black_carpet: Tapete preto + black_concrete: Concreto preto + black_concrete_powder: Cimento preto + black_glazed_terracotta: Azulejo preto + black_shulker_box: Caixa de shulker preta + black_stained_glass: Vidro preto + black_stained_glass_pane: Vidraça preta + black_terracotta: Terracota preta + black_wool: Lã preta + blackstone: Pedra-negra + blackstone_slab: Laje de pedra-negra + blackstone_stairs: Escadas de pedra-negra + blackstone_wall: Muro de pedra-negra + blast_furnace: Alto-forno + blue_banner: Estandarte azul + blue_bed: Cama azul + blue_candle: Vela azul + blue_candle_cake: Bolo com vela azul + blue_carpet: Tapete azul + blue_concrete: Concreto azul + blue_concrete_powder: Cimento azul + blue_glazed_terracotta: Azulejo azul + blue_ice: Gelo azul + blue_orchid: Orquídea-azul + blue_shulker_box: Caixa de shulker azul + blue_stained_glass: Vidro azul + blue_stained_glass_pane: Vidraça azul + blue_terracotta: Terracota azul + blue_wool: Lã azul + bone_block: Bloco de ossos + bookshelf: Estante de livros + brain_coral: Coral-de-cérebro + brain_coral_block: Bloco de coral-de-cérebro + brain_coral_fan: Gorgônia-de-cérebro + brain_coral_wall_fan: Gorgônia-de-cérebro de parede + brewing_stand: Suporte de poções + brick_slab: Laje de tijolos + brick_stairs: Escadas de tijolos + brick_wall: Muro de tijolos + bricks: Tijolos + brown_banner: Estandarte marrom + brown_bed: Cama marrom + brown_candle: Vela marrom + brown_candle_cake: Bolo com vela marrom + brown_carpet: Tapete marrom + brown_concrete: Concreto marrom + brown_concrete_powder: Cimento marrom + brown_glazed_terracotta: Azulejo marrom + brown_mushroom: Cogumelo marrom + brown_mushroom_block: Bloco de cogumelo marrom + brown_shulker_box: Caixa de shulker marrom + brown_stained_glass: Vidro marrom + brown_stained_glass_pane: Vidraça marrom + brown_terracotta: Terracota marrom + brown_wool: Lã marrom + bubble_column: Coluna de bolhas + bubble_coral: Coral-de-bolha + bubble_coral_block: Bloco de coral-de-bolha + bubble_coral_fan: Gorgônia-de-bolha + bubble_coral_wall_fan: Gorgônia-de-bolha de parede + budding_amethyst: Drusa de ametista + cactus: Cacto + cake: Bolo + calcite: Calcita + calibrated_sculk_sensor: Sensor de sculk calibrado + campfire: Fogueira + candle: Vela + candle_cake: Bolo com vela + carrots: Cenouras + cartography_table: Bancada de cartografia + carved_pumpkin: Abóbora esculpida + cauldron: Caldeirão + cave_air: Ar da caverna + cave_vines: Trepadeiras das cavernas + cave_vines_plant: Planta de trepadeiras das cavernas + chain: Corrente + chain_command_block: Bloco de comando em cadeia + cherry_button: Botão de cerejeira + cherry_door: Porta de cerejeira + cherry_fence: Cerca de cerejeira + cherry_fence_gate: Portão de cerejeira + cherry_hanging_sign: Placa suspensa de cerejeira + cherry_leaves: Folhas de cerejeira + cherry_log: Tronco de cerejeira + cherry_planks: Tábuas de cerejeira + cherry_pressure_plate: Placa de pressão de cerejeira + cherry_sapling: Muda de cerejeira + cherry_sign: Placa de cerejeira + cherry_slab: Laje de cerejeira + cherry_stairs: Escadas de cerejeira + cherry_trapdoor: Alçapão de cerejeira + cherry_wall_hanging_sign: Placa suspensa de cerejeira de parede + cherry_wall_sign: Placa de cerejeira de parede + cherry_wood: Madeira de cerejeira + chest: Baú + chipped_anvil: Bigorna rachada + chiseled_bookshelf: Porta-livros + chiseled_deepslate: Ardósia talhada + chiseled_nether_bricks: Tijolos do Nether talhados + chiseled_polished_blackstone: Pedra-negra polida talhada + chiseled_quartz_block: Bloco de quartzo talhado + chiseled_red_sandstone: Arenito vermelho talhado + chiseled_sandstone: Arenito talhado + chiseled_stone_bricks: Tijolos de pedra talhados + chorus_flower: Flor do coro + chorus_plant: Planta do coro + clay: Argila + coal_block: Bloco de carvão + coal_ore: Minério de carvão + coarse_dirt: Terra infértil + cobbled_deepslate: Pedregulho de ardósia + cobbled_deepslate_slab: Laje de pedregulho de ardósia + cobbled_deepslate_stairs: Escadas de pedregulho de ardósia + cobbled_deepslate_wall: Muro de pedregulho de ardósia + cobblestone: Pedregulho + cobblestone_slab: Laje de pedregulho + cobblestone_stairs: Escadas de pedregulho + cobblestone_wall: Muro de pedregulho + cobweb: Teia de aranha + cocoa: Cacau + command_block: Bloco de comando + comparator: Comparador de redstone + composter: Composteira + conduit: Aqueduto + copper_block: Bloco de cobre + copper_ore: Minério de cobre + cornflower: Centáurea + cracked_deepslate_bricks: Tijolos de ardósia rachados + cracked_deepslate_tiles: Ladrilhos de ardósia rachados + cracked_nether_bricks: Tijolos do Nether rachados + cracked_polished_blackstone_bricks: Tijolos de pedra-negra polida rachados + cracked_stone_bricks: Tijolos de pedra rachados + crafting_table: Bancada de trabalho + creeper_head: Cabeça de creeper + creeper_wall_head: Cabeça de creeper de parede + crimson_button: Botão carmesim + crimson_door: Porta carmesim + crimson_fence: Cerca carmesim + crimson_fence_gate: Portão carmesim + crimson_fungus: Fungo carmesim + crimson_hanging_sign: Placa suspensa carmesim + crimson_hyphae: Hifas carmesins + crimson_nylium: Nicélio carmesim + crimson_planks: Tábuas carmesins + crimson_pressure_plate: Placa de pressão carmesim + crimson_roots: Raízes carmesins + crimson_sign: Placa carmesim + crimson_slab: Laje carmesim + crimson_stairs: Escadas carmesins + crimson_stem: Caule carmesim + crimson_trapdoor: Alçapão carmesim + crimson_wall_hanging_sign: Placa suspensa carmesim de parede + crimson_wall_sign: Placa carmesim de parede + crying_obsidian: Obsidiana chorona + cut_copper: Cobre lapidado + cut_copper_slab: Laje de cobre lapidado + cut_copper_stairs: Escadas de cobre lapidado + cut_red_sandstone: Arenito vermelho lapidado + cut_red_sandstone_slab: Laje de arenito vermelho lapidado + cut_sandstone: Arenito lapidado + cut_sandstone_slab: Laje de arenito lapidado + cyan_banner: Estandarte ciano + cyan_bed: Cama ciano + cyan_candle: Vela ciano + cyan_candle_cake: Bolo com vela ciano + cyan_carpet: Tapete ciano + cyan_concrete: Concreto ciano + cyan_concrete_powder: Cimento ciano + cyan_glazed_terracotta: Azulejo ciano + cyan_shulker_box: Caixa de shulker ciano + cyan_stained_glass: Vidro ciano + cyan_stained_glass_pane: Vidraça ciano + cyan_terracotta: Terracota ciano + cyan_wool: Lã ciano + damaged_anvil: Bigorna danificada + dandelion: Dente-de-leão + dark_oak_button: Botão de carvalho escuro + dark_oak_door: Porta de carvalho escuro + dark_oak_fence: Cerca de carvalho escuro + dark_oak_fence_gate: Portão de carvalho escuro + dark_oak_hanging_sign: Placa suspensa de carvalho escuro + dark_oak_leaves: Folhas de carvalho escuro + dark_oak_log: Tronco de carvalho escuro + dark_oak_planks: Tábuas de carvalho escuro + dark_oak_pressure_plate: Placa de pressão de carvalho escuro + dark_oak_sapling: Muda de carvalho escuro + dark_oak_sign: Placa de carvalho escuro + dark_oak_slab: Laje de carvalho escuro + dark_oak_stairs: Escadas de carvalho escuro + dark_oak_trapdoor: Alçapão de carvalho escuro + dark_oak_wall_hanging_sign: Placa suspensa de carvalho escuro de parede + dark_oak_wall_sign: Placa de carvalho escuro de parede + dark_oak_wood: Madeira de carvalho escuro + dark_prismarine: Prismarinho escuro + dark_prismarine_slab: Laje de prismarinho escuro + dark_prismarine_stairs: Escadas de prismarinho escuro + daylight_detector: Detector de luz solar + dead_brain_coral: Coral-de-cérebro morto + dead_brain_coral_block: Bloco de coral-de-cérebro morto + dead_brain_coral_fan: Gorgônia-de-cérebro morta + dead_brain_coral_wall_fan: Gorgônia-de-cérebro morta de parede + dead_bubble_coral: Coral-de-bolha morto + dead_bubble_coral_block: Bloco de coral-de-bolha morto + dead_bubble_coral_fan: Gorgônia-de-bolha morta + dead_bubble_coral_wall_fan: Gorgônia-de-bolha morta de parede + dead_bush: Arbusto seco + dead_fire_coral: Coral-de-fogo morto + dead_fire_coral_block: Bloco de coral-de-fogo morto + dead_fire_coral_fan: Gorgônia-de-fogo morta + dead_fire_coral_wall_fan: Gorgônia-de-fogo morta de parede + dead_horn_coral: Coral-de-chifre morto + dead_horn_coral_block: Bloco de coral-de-chifre morto + dead_horn_coral_fan: Gorgônia-de-chifre morta + dead_horn_coral_wall_fan: Gorgônia-de-chifre morta de parede + dead_tube_coral: Coral-de-tubo morto + dead_tube_coral_block: Bloco de coral-de-tubo morto + dead_tube_coral_fan: Gorgônia-de-tubo morta + dead_tube_coral_wall_fan: Gorgônia-de-tubo morta de parede + decorated_pot: Vaso decorado + deepslate: Ardósia + deepslate_brick_slab: Laje de tijolos de ardósia + deepslate_brick_stairs: Escadas de tijolos de ardósia + deepslate_brick_wall: Muro de tijolos de ardósia + deepslate_bricks: Tijolos de ardósia + deepslate_coal_ore: Minério de carvão de ardósia + deepslate_copper_ore: Minério de cobre de ardósia + deepslate_diamond_ore: Minério de diamante de ardósia + deepslate_emerald_ore: Minério de esmeralda de ardósia + deepslate_gold_ore: Minério de ouro de ardósia + deepslate_iron_ore: Minério de ferro de ardósia + deepslate_lapis_ore: Minério de lápis-lazúli de ardósia + deepslate_redstone_ore: Minério de redstone de ardósia + deepslate_tile_slab: Laje de ladrilhos de ardósia + deepslate_tile_stairs: Escadas de ladrilhos de ardósia + deepslate_tile_wall: Muro de ladrilhos de ardósia + deepslate_tiles: Ladrilhos de ardósia + detector_rail: Trilho detector + diamond_block: Bloco de diamante + diamond_ore: Minério de diamante + diorite: Diorito + diorite_slab: Laje de diorito + diorite_stairs: Escadas de diorito + diorite_wall: Muro de diorito + dirt: Terra + dirt_path: Caminho de terra + dispenser: Ejetor + dragon_egg: Ovo de dragão + dragon_head: Cabeça de dragão + dragon_wall_head: Cabeça de dragão de parede + dried_kelp_block: Bloco de algas secas + dripstone_block: Bloco de espeleotema + dropper: Liberador + emerald_block: Bloco de esmeralda + emerald_ore: Minério de esmeralda + enchanting_table: Mesa de encantamentos + end_gateway: Passagem do End + end_portal: Portal do End + end_portal_frame: Moldura do portal do End + end_rod: Lâmpada do End + end_stone: Pedra do End + end_stone_brick_slab: Laje de tijolos de pedra do End + end_stone_brick_stairs: Escadas de tijolos de pedra do End + end_stone_brick_wall: Muro de tijolos de pedra do End + end_stone_bricks: Tijolos de pedra do End + ender_chest: Baú de ender + exposed_copper: Cobre exposto + exposed_cut_copper: Cobre lapidado exposto + exposed_cut_copper_slab: Laje de cobre lapidado exposto + exposed_cut_copper_stairs: Escadas de cobre lapidado exposto + farmland: Terra arada + fern: Samambaia + fire: Fogo + fire_coral: Coral-de-fogo + fire_coral_block: Bloco de coral-de-fogo + fire_coral_fan: Gorgônia-de-fogo + fire_coral_wall_fan: Gorgônia-de-fogo de parede + fletching_table: Bancada de arco e flecha + flower_pot: Vaso + flowering_azalea: Azaleia florescente + flowering_azalea_leaves: Folhas de azaleia florescentes + frogspawn: Ovos de sapo + frosted_ice: Gelo fosco + furnace: Fornalha + gilded_blackstone: Pedra-negra dourada + glass: Vidro + glass_pane: Vidraça + glow_lichen: Líquen brilhante + glowstone: Pedra luminosa + gold_block: Bloco de ouro + gold_ore: Minério de ouro + granite: Granito + granite_slab: Laje de granito + granite_stairs: Escadas de granito + granite_wall: Muro de granito + grass: Grama + grass_block: Bloco de grama + gravel: Cascalho + gray_banner: Estandarte cinza + gray_bed: Cama cinza + gray_candle: Vela cinza + gray_candle_cake: Bolo com vela cinza + gray_carpet: Tapete cinza + gray_concrete: Concreto cinza + gray_concrete_powder: Cimento cinza + gray_glazed_terracotta: Azulejo cinza + gray_shulker_box: Caixa de shulker cinza + gray_stained_glass: Vidro cinza + gray_stained_glass_pane: Vidraça cinza + gray_terracotta: Terracota cinza + gray_wool: Lã cinza + green_banner: Estandarte verde + green_bed: Cama verde + green_candle: Vela verde + green_candle_cake: Bolo com vela verde + green_carpet: Tapete verde + green_concrete: Concreto verde + green_concrete_powder: Cimento verde + green_glazed_terracotta: Azulejo verde + green_shulker_box: Caixa de shulker verde + green_stained_glass: Vidro verde + green_stained_glass_pane: Vidraça verde + green_terracotta: Terracota verde + green_wool: Lã verde + grindstone: Rebolo + hanging_roots: Raízes suspensas + hay_block: Fardo de feno + heavy_weighted_pressure_plate: Placa de pressão de pesagem pesada + honey_block: Bloco de mel + honeycomb_block: Bloco de favo de mel + hopper: Funil + horn_coral: Coral-de-chifre + horn_coral_block: Bloco de coral-de-chifre + horn_coral_fan: Gorgônia-de-chifre + horn_coral_wall_fan: Gorgônia-de-chifre de parede + ice: Gelo + infested_chiseled_stone_bricks: Tijolos de pedra talhados infestados + infested_cobblestone: Pedregulho infestado + infested_cracked_stone_bricks: Tijolos de pedra rachados infestados + infested_deepslate: Ardósia infestada + infested_mossy_stone_bricks: Tijolos de pedra musgosos infestados + infested_stone: Pedra infestada + infested_stone_bricks: Tijolos de pedra infestados + iron_bars: Grades de ferro + iron_block: Bloco de ferro + iron_door: Porta de ferro + iron_ore: Minério de ferro + iron_trapdoor: Alçapão de ferro + jack_o_lantern: Abóbora de Halloween + jigsaw: Bloco-quebra-cabeça + jukebox: Toca-discos + jungle_button: Botão de madeira da selva + jungle_door: Porta de madeira da selva + jungle_fence: Cerca de madeira da selva + jungle_fence_gate: Portão de madeira da selva + jungle_hanging_sign: Placa suspensa de madeira da selva + jungle_leaves: Folhas da selva + jungle_log: Tronco de árvore da selva + jungle_planks: Tábuas de madeira da selva + jungle_pressure_plate: Placa de pressão de madeira da selva + jungle_sapling: Muda de árvore da selva + jungle_sign: Placa de madeira da selva + jungle_slab: Laje de madeira da selva + jungle_stairs: Escadas de madeira da selva + jungle_trapdoor: Alçapão de madeira da selva + jungle_wall_hanging_sign: Placa suspensa de madeira da selva de parede + jungle_wall_sign: Placa de madeira da selva de parede + jungle_wood: Madeira da selva + kelp: Alga + kelp_plant: Talo de alga + ladder: Escada de mão + lantern: Lampião + lapis_block: Bloco de lápis-lazúli + lapis_ore: Minério de lápis-lazúli + large_amethyst_bud: Cristal de ametista grande + large_fern: Samambaia grande + lava: Lava + lava_cauldron: Caldeirão de lava + lectern: Atril + lever: Alavanca + light: Luz + light_blue_banner: Estandarte azul-claro + light_blue_bed: Cama azul-clara + light_blue_candle: Vela azul-clara + light_blue_candle_cake: Bolo com vela azul-clara + light_blue_carpet: Tapete azul-claro + light_blue_concrete: Concreto azul-claro + light_blue_concrete_powder: Cimento azul-claro + light_blue_glazed_terracotta: Azulejo azul-claro + light_blue_shulker_box: Caixa de shulker azul-clara + light_blue_stained_glass: Vidro azul-claro + light_blue_stained_glass_pane: Vidraça azul-clara + light_blue_terracotta: Terracota azul-clara + light_blue_wool: Lã azul-clara + light_gray_banner: Estandarte cinza-claro + light_gray_bed: Cama cinza-clara + light_gray_candle: Vela cinza-clara + light_gray_candle_cake: Bolo com vela cinza-clara + light_gray_carpet: Tapete cinza-claro + light_gray_concrete: Concreto cinza-claro + light_gray_concrete_powder: Cimento cinza-claro + light_gray_glazed_terracotta: Azulejo cinza-claro + light_gray_shulker_box: Caixa de shulker cinza-clara + light_gray_stained_glass: Vidro cinza-claro + light_gray_stained_glass_pane: Vidraça cinza-clara + light_gray_terracotta: Terracota cinza-clara + light_gray_wool: Lã cinza-clara + light_weighted_pressure_plate: Placa de pressão de pesagem leve + lightning_rod: Para-raios + lilac: Lilás + lily_of_the_valley: Lírio-do-vale + lily_pad: Vitória-régia + lime_banner: Estandarte verde-limão + lime_bed: Cama verde-limão + lime_candle: Vela verde-limão + lime_candle_cake: Bolo com vela verde-limão + lime_carpet: Tapete verde-limão + lime_concrete: Concreto verde-limão + lime_concrete_powder: Cimento verde-limão + lime_glazed_terracotta: Azulejo verde-limão + lime_shulker_box: Caixa de shulker verde-limão + lime_stained_glass: Vidro verde-limão + lime_stained_glass_pane: Vidraça verde-limão + lime_terracotta: Terracota verde-limão + lime_wool: Lã verde-limão + lodestone: Magnetita + loom: Tear + magenta_banner: Estandarte magenta + magenta_bed: Cama magenta + magenta_candle: Vela magenta + magenta_candle_cake: Bolo com vela magenta + magenta_carpet: Tapete magenta + magenta_concrete: Concreto magenta + magenta_concrete_powder: Cimento magenta + magenta_glazed_terracotta: Azulejo magenta + magenta_shulker_box: Caixa de shulker magenta + magenta_stained_glass: Vidro magenta + magenta_stained_glass_pane: Vidraça magenta + magenta_terracotta: Terracota magenta + magenta_wool: Lã magenta + magma_block: Bloco de magma + mangrove_button: Botão de mangue + mangrove_door: Porta de mangue + mangrove_fence: Cerca de mangue + mangrove_fence_gate: Portão de mangue + mangrove_hanging_sign: Placa suspensa de mangue + mangrove_leaves: Folhas de mangue + mangrove_log: Tronco de mangue + mangrove_planks: Tábuas de mangue + mangrove_pressure_plate: Placa de pressão de mangue + mangrove_propagule: Propágulo de mangue + mangrove_roots: Raízes de mangue + mangrove_sign: Placa de mangue + mangrove_slab: Laje de mangue + mangrove_stairs: Escadas de mangue + mangrove_trapdoor: Alçapão de mangue + mangrove_wall_hanging_sign: Placa suspensa de mangue de parede + mangrove_wall_sign: Placa de mangue de parede + mangrove_wood: Madeira de mangue + medium_amethyst_bud: Cristal de ametista médio + melon: Melancia + melon_stem: Caule de melancia + moss_block: Bloco de musgo + moss_carpet: Tapete de musgo + mossy_cobblestone: Pedregulho musgoso + mossy_cobblestone_slab: Laje de pedregulho musgoso + mossy_cobblestone_stairs: Escadas de pedregulho musgoso + mossy_cobblestone_wall: Muro de pedregulho musgoso + mossy_stone_brick_slab: Laje de tijolos de pedra musgosos + mossy_stone_brick_stairs: Escadas de tijolos de pedra musgosos + mossy_stone_brick_wall: Muro de tijolos de pedra musgosos + mossy_stone_bricks: Tijolos de pedra musgosos + moving_piston: Pistão em movimento + mud: Barro + mud_brick_slab: Laje de tijolos de barro + mud_brick_stairs: Escadas de tijolos de barro + mud_brick_wall: Muro de tijolos de barro + mud_bricks: Tijolos de barro + muddy_mangrove_roots: Raízes barrentas de mangue + mushroom_stem: Caule de cogumelo + mycelium: Micélio + nether_brick_fence: Cerca de tijolos do Nether + nether_brick_slab: Laje de tijolos do Nether + nether_brick_stairs: Escadas de tijolos do Nether + nether_brick_wall: Muro de tijolos do Nether + nether_bricks: Tijolos do Nether + nether_gold_ore: Minério de ouro do Nether + nether_portal: Portal do Nether + nether_quartz_ore: Minério de quartzo do Nether + nether_sprouts: Brotos do Nether + nether_wart: Fungo do Nether + nether_wart_block: Bloco de fungos do Nether + netherite_block: Bloco de netherita + netherrack: Netherrack + note_block: Bloco musical + oak_button: Botão de carvalho + oak_door: Porta de carvalho + oak_fence: Cerca de carvalho + oak_fence_gate: Portão de carvalho + oak_hanging_sign: Placa suspensa de carvalho + oak_leaves: Folhas de carvalho + oak_log: Tronco de carvalho + oak_planks: Tábuas de carvalho + oak_pressure_plate: Placa de pressão de carvalho + oak_sapling: Muda de carvalho + oak_sign: Placa de carvalho + oak_slab: Laje de carvalho + oak_stairs: Escadas de carvalho + oak_trapdoor: Alçapão de carvalho + oak_wall_hanging_sign: Placa suspensa de carvalho de parede + oak_wall_sign: Placa de carvalho de parede + oak_wood: Madeira de carvalho + observer: Observador + obsidian: Obsidiana + ochre_froglight: Anfibrilho ocre + ominous_banner: Estandarte ameaçador + orange_banner: Estandarte laranja + orange_bed: Cama laranja + orange_candle: Vela laranja + orange_candle_cake: Bolo com vela laranja + orange_carpet: Tapete laranja + orange_concrete: Concreto laranja + orange_concrete_powder: Cimento laranja + orange_glazed_terracotta: Azulejo laranja + orange_shulker_box: Caixa de shulker laranja + orange_stained_glass: Vidro laranja + orange_stained_glass_pane: Vidraça laranja + orange_terracotta: Terracota laranja + orange_tulip: Tulipa laranja + orange_wool: Lã laranja + oxeye_daisy: Margarida + oxidized_copper: Cobre oxidado + oxidized_cut_copper: Cobre lapidado oxidado + oxidized_cut_copper_slab: Laje de cobre lapidado oxidado + oxidized_cut_copper_stairs: Escadas de cobre lapidado oxidado + packed_ice: Gelo compactado + packed_mud: Barro seco + pearlescent_froglight: Anfibrilho perolado + peony: Peônia + petrified_oak_slab: Laje de carvalho petrificado + piglin_head: Cabeça de piglin + piglin_wall_head: Cabeça de piglin de parede + pink_banner: Estandarte rosa + pink_bed: Cama rosa + pink_candle: Vela rosa + pink_candle_cake: Bolo com vela rosa + pink_carpet: Tapete rosa + pink_concrete: Concreto rosa + pink_concrete_powder: Cimento rosa + pink_glazed_terracotta: Azulejo rosa + pink_petals: Pétalas rosas + pink_shulker_box: Caixa de shulker rosa + pink_stained_glass: Vidro rosa + pink_stained_glass_pane: Vidraça rosa + pink_terracotta: Terracota rosa + pink_tulip: Tulipa rosa + pink_wool: Lã rosa + piston: Pistão + piston_head: Cabeça de pistão + pitcher_crop: Plantio de planta ancestral + pitcher_plant: Planta ancestral + player_head: Cabeça de jogador + player_wall_head: Cabeça de jogador de parede + podzol: Podzol + pointed_dripstone: Espeleotema pontiagudo + polished_andesite: Andesito polido + polished_andesite_slab: Laje de andesito polido + polished_andesite_stairs: Escadas de andesito polido + polished_basalt: Basalto polido + polished_blackstone: Pedra-negra polida + polished_blackstone_brick_slab: Laje de tijolos de pedra-negra polida + polished_blackstone_brick_stairs: Escadas de tijolos de pedra-negra polida + polished_blackstone_brick_wall: Muro de tijolos de pedra-negra polida + polished_blackstone_bricks: Tijolos de pedra-negra polida + polished_blackstone_button: Botão de pedra-negra polida + polished_blackstone_pressure_plate: Placa de pressão de pedra-negra polida + polished_blackstone_slab: Laje de pedra-negra polida + polished_blackstone_stairs: Escadas de pedra-negra polida + polished_blackstone_wall: Muro de pedra-negra polida + polished_deepslate: Ardósia polida + polished_deepslate_slab: Laje de ardósia polida + polished_deepslate_stairs: Escadas de ardósia polida + polished_deepslate_wall: Muro de ardósia polida + polished_diorite: Diorito polido + polished_diorite_slab: Laje de diorito polido + polished_diorite_stairs: Escadas de diorito polido + polished_granite: Granito polido + polished_granite_slab: Laje de granito polido + polished_granite_stairs: Escadas de granito polido + poppy: Papoula + potatoes: Batatas + potted_acacia_sapling: Muda de acácia envasada + potted_allium: Alho-silvestre envasado + potted_azalea_bush: Azaleia envasada + potted_azure_bluet: Flor-silvestre-azul envasada + potted_bamboo: Bambu envasado + potted_birch_sapling: Muda de bétula envasada + potted_blue_orchid: Orquídea-azul envasada + potted_brown_mushroom: Cogumelo marrom envasado + potted_cactus: Cacto envasado + potted_cherry_sapling: Muda de cerejeira envasada + potted_cornflower: Centáurea envasada + potted_crimson_fungus: Fungo carmesim envasado + potted_crimson_roots: Raízes carmesins envasadas + potted_dandelion: Dente-de-leão envasado + potted_dark_oak_sapling: Muda de carvalho escuro envasada + potted_dead_bush: Arbusto seco envasado + potted_fern: Samambaia envasada + potted_flowering_azalea_bush: Azaleia florescente envasada + potted_jungle_sapling: Muda de árvore da selva envasada + potted_lily_of_the_valley: Lírio-do-vale envasado + potted_mangrove_propagule: Propágulo de mangue envasado + potted_oak_sapling: Muda de carvalho envasada + potted_orange_tulip: Tulipa laranja envasada + potted_oxeye_daisy: Margarida envasada + potted_pink_tulip: Tulipa rosa envasada + potted_poppy: Papoula envasada + potted_red_mushroom: Cogumelo vermelho envasado + potted_red_tulip: Tulipa vermelha envasada + potted_spruce_sapling: Muda de pinheiro envasada + potted_torchflower: Plantocha envasada + potted_warped_fungus: Fungo distorcido envasado + potted_warped_roots: Raízes distorcidas envasadas + potted_white_tulip: Tulipa branca envasada + potted_wither_rose: Rosa do Wither envasada + powder_snow: Neve fofa + powder_snow_cauldron: Caldeirão de neve fofa + powered_rail: Trilho elétrico + prismarine: Prismarinho + prismarine_brick_slab: Laje de tijolos de prismarinho + prismarine_brick_stairs: Escadas de tijolos de prismarinho + prismarine_bricks: Tijolos de prismarinho + prismarine_slab: Laje de prismarinho + prismarine_stairs: Escadas de prismarinho + prismarine_wall: Muro de prismarinho + pumpkin: Abóbora + pumpkin_stem: Caule de abóbora + purple_banner: Estandarte roxo + purple_bed: Cama roxa + purple_candle: Vela roxa + purple_candle_cake: Bolo com vela roxa + purple_carpet: Tapete roxo + purple_concrete: Concreto roxo + purple_concrete_powder: Cimento roxo + purple_glazed_terracotta: Azulejo roxo + purple_shulker_box: Caixa de shulker roxa + purple_stained_glass: Vidro roxo + purple_stained_glass_pane: Vidraça roxa + purple_terracotta: Terracota roxa + purple_wool: Lã roxa + purpur_block: Bloco de púrpura + purpur_pillar: Pilar de púrpura + purpur_slab: Laje de púrpura + purpur_stairs: Escadas de púrpura + quartz_block: Bloco de quartzo + quartz_bricks: Tijolos de quartzo + quartz_pillar: Pilar de quartzo + quartz_slab: Laje de quartzo + quartz_stairs: Escadas de quartzo + rail: Trilho + raw_copper_block: Bloco de cobre bruto + raw_gold_block: Bloco de ouro bruto + raw_iron_block: Bloco de ferro bruto + red_banner: Estandarte vermelho + red_bed: Cama vermelha + red_candle: Vela vermelha + red_candle_cake: Bolo com vela vermelha + red_carpet: Tapete vermelho + red_concrete: Concreto vermelho + red_concrete_powder: Cimento vermelho + red_glazed_terracotta: Azulejo vermelho + red_mushroom: Cogumelo vermelho + red_mushroom_block: Bloco de cogumelo vermelho + red_nether_brick_slab: Laje de tijolos vermelhos do Nether + red_nether_brick_stairs: Escadas de tijolos vermelhos do Nether + red_nether_brick_wall: Muro de tijolos vermelhos do Nether + red_nether_bricks: Tijolos vermelhos do Nether + red_sand: Areia vermelha + red_sandstone: Arenito vermelho + red_sandstone_slab: Laje de arenito vermelho + red_sandstone_stairs: Escadas de arenito vermelho + red_sandstone_wall: Muro de arenito vermelho + red_shulker_box: Caixa de shulker vermelha + red_stained_glass: Vidro vermelho + red_stained_glass_pane: Vidraça vermelha + red_terracotta: Terracota vermelha + red_tulip: Tulipa vermelha + red_wool: Lã vermelha + redstone_block: Bloco de redstone + redstone_lamp: Lâmpada de redstone + redstone_ore: Minério de redstone + redstone_torch: Tocha de redstone + redstone_wall_torch: Tocha de redstone de parede + redstone_wire: Cabo de redstone + reinforced_deepslate: Ardósia reforçada + repeater: Repetidor de redstone + repeating_command_block: Bloco de comando em repetição + respawn_anchor: Âncora de renascimento + rooted_dirt: Terra enraizada + rose_bush: Roseira + sand: Areia + sandstone: Arenito + sandstone_slab: Laje de arenito + sandstone_stairs: Escadas de arenito + sandstone_wall: Muro de arenito + scaffolding: Andaime + sculk: Sculk + sculk_catalyst: Catalisador de sculk + sculk_sensor: Sensor de sculk + sculk_shrieker: Emissor de sculk + sculk_vein: Veio de sculk + sea_lantern: Lanterna do mar + sea_pickle: Pepino-do-mar + seagrass: Erva marinha + set_spawn: O ponto de renascimento foi definido + shroomlight: Cogubrilho + shulker_box: Caixa de shulker + skeleton_skull: Crânio de esqueleto + skeleton_wall_skull: Crânio de esqueleto de parede + slime_block: Bloco de slime + small_amethyst_bud: Cristal de ametista pequeno + small_dripleaf: Plantaforma pequena + smithing_table: Bancada de ferraria + smoker: Defumador + smooth_basalt: Basalto liso + smooth_quartz: Bloco de quartzo liso + smooth_quartz_slab: Laje de quartzo liso + smooth_quartz_stairs: Escadas de quartzo liso + smooth_red_sandstone: Arenito vermelho liso + smooth_red_sandstone_slab: Laje de arenito vermelho liso + smooth_red_sandstone_stairs: Escadas de arenito vermelho liso + smooth_sandstone: Arenito liso + smooth_sandstone_slab: Laje de arenito liso + smooth_sandstone_stairs: Escadas de arenito liso + smooth_stone: Pedra lisa + smooth_stone_slab: Laje de pedra lisa + sniffer_egg: Ovo de farejador + snow: Neve + snow_block: Bloco de neve + soul_campfire: Fogueira das almas + soul_fire: Fogo das almas + soul_lantern: Lampião das almas + soul_sand: Areia das almas + soul_soil: Terra das almas + soul_torch: Tocha das almas + soul_wall_torch: Tocha das almas de parede + spawner: Gerador de criaturas + sponge: Esponja + spore_blossom: Flor de esporos + spruce_button: Botão de pinheiro + spruce_door: Porta de pinheiro + spruce_fence: Cerca de pinheiro + spruce_fence_gate: Portão de pinheiro + spruce_hanging_sign: Placa suspensa de pinheiro + spruce_leaves: Folhas de pinheiro + spruce_log: Tronco de pinheiro + spruce_planks: Tábuas de pinheiro + spruce_pressure_plate: Placa de pressão de pinheiro + spruce_sapling: Muda de pinheiro + spruce_sign: Placa de pinheiro + spruce_slab: Laje de pinheiro + spruce_stairs: Escadas de pinheiro + spruce_trapdoor: Alçapão de pinheiro + spruce_wall_hanging_sign: Placa suspensa de pinheiro de parede + spruce_wall_sign: Placa de pinheiro de parede + spruce_wood: Madeira de pinheiro + sticky_piston: Pistão grudento + stone: Pedra + stone_brick_slab: Laje de tijolos de pedra + stone_brick_stairs: Escadas de tijolos de pedra + stone_brick_wall: Muro de tijolos de pedra + stone_bricks: Tijolos de pedra + stone_button: Botão de pedra + stone_pressure_plate: Placa de pressão de pedra + stone_slab: Laje de pedra + stone_stairs: Escadas de pedra + stonecutter: Cortador de pedras + stripped_acacia_log: Tronco de acácia descascado + stripped_acacia_wood: Madeira de acácia descascada + stripped_bamboo_block: Bloco de bambu descascado + stripped_birch_log: Tronco de bétula descascado + stripped_birch_wood: Madeira de bétula descascada + stripped_cherry_log: Tronco de cerejeira descascado + stripped_cherry_wood: Madeira de cerejeira descascada + stripped_crimson_hyphae: Hifas carmesins descascadas + stripped_crimson_stem: Caule carmesim descascado + stripped_dark_oak_log: Tronco de carvalho escuro descascado + stripped_dark_oak_wood: Madeira de carvalho escuro descascada + stripped_jungle_log: Tronco de árvore da selva descascado + stripped_jungle_wood: Madeira de árvore da selva descascada + stripped_mangrove_log: Tronco de mangue descascado + stripped_mangrove_wood: Madeira de mangue descascada + stripped_oak_log: Tronco de carvalho descascado + stripped_oak_wood: Madeira de carvalho descascada + stripped_spruce_log: Tronco de pinheiro descascado + stripped_spruce_wood: Madeira de pinheiro descascada + stripped_warped_hyphae: Hifas distorcidas descascadas + stripped_warped_stem: Caule distorcido descascado + structure_block: Gerador de estruturas + structure_void: Vazio estrutural + sugar_cane: Cana-de-açúcar + sunflower: Girassol + suspicious_gravel: Cascalho suspeito + suspicious_sand: Areia suspeita + sweet_berry_bush: Arbusto de bagas doces + tall_grass: Grama alta + tall_seagrass: Erva marinha alta + target: Alvo + terracotta: Terracota + tinted_glass: Vidro fosco + tnt: Dinamite + torch: Tocha + torchflower: Plantocha + torchflower_crop: Plantio de plantocha + trapped_chest: Baú com armadilha + tripwire: Fio de armadilha + tripwire_hook: Gancho de armadilha + tube_coral: Coral-de-tubo + tube_coral_block: Bloco de coral-de-tubo + tube_coral_fan: Gorgônia-de-tubo + tube_coral_wall_fan: Gorgônia-de-tubo de parede + tuff: Tufo + turtle_egg: Ovo de tartaruga + twisting_vines: Trepadeiras retorcidas + twisting_vines_plant: Planta de trepadeiras retorcidas + verdant_froglight: Anfibrilho verdejante + vine: Trepadeiras + void_air: Ar do vazio + wall_torch: Tocha de parede + warped_button: Botão distorcido + warped_door: Porta distorcida + warped_fence: Cerca distorcida + warped_fence_gate: Portão distorcido + warped_fungus: Fungo distorcido + warped_hanging_sign: Placa suspensa distorcida + warped_hyphae: Hifas distorcidas + warped_nylium: Nicélio distorcido + warped_planks: Tábuas distorcidas + warped_pressure_plate: Placa de pressão distorcida + warped_roots: Raízes distorcidas + warped_sign: Placa distorcida + warped_slab: Laje distorcida + warped_stairs: Escadas distorcidas + warped_stem: Caule distorcido + warped_trapdoor: Alçapão distorcido + warped_wall_hanging_sign: Placa suspensa distorcida de parede + warped_wall_sign: Placa distorcida de parede + warped_wart_block: Bloco de fungos distorcidos + water: Água + water_cauldron: Caldeirão de água + waxed_copper_block: Bloco de cobre encerado + waxed_cut_copper: Cobre lapidado encerado + waxed_cut_copper_slab: Laje de cobre lapidado encerado + waxed_cut_copper_stairs: Escadas de cobre lapidado encerado + waxed_exposed_copper: Cobre exposto encerado + waxed_exposed_cut_copper: Cobre lapidado exposto encerado + waxed_exposed_cut_copper_slab: Laje de cobre lapidado exposto encerado + waxed_exposed_cut_copper_stairs: Escadas de cobre lapidado exposto encerado + waxed_oxidized_copper: Cobre oxidado encerado + waxed_oxidized_cut_copper: Cobre lapidado oxidado encerado + waxed_oxidized_cut_copper_slab: Laje de cobre lapidado oxidado encerado + waxed_oxidized_cut_copper_stairs: Escadas de cobre lapidado oxidado encerado + waxed_weathered_copper: Cobre desgastado encerado + waxed_weathered_cut_copper: Cobre lapidado desgastado encerado + waxed_weathered_cut_copper_slab: Laje de cobre lapidado desgastado encerado + waxed_weathered_cut_copper_stairs: Escadas de cobre lapidado desgastado encerado + weathered_copper: Cobre desgastado + weathered_cut_copper: Cobre lapidado desgastado + weathered_cut_copper_slab: Laje de cobre lapidado desgastado + weathered_cut_copper_stairs: Escadas de cobre lapidado desgastado + weeping_vines: Trepadeiras choronas + weeping_vines_plant: Planta de trepadeiras choronas + wet_sponge: Esponja úmida + wheat: Trigo + white_banner: Estandarte branco + white_bed: Cama branca + white_candle: Vela branca + white_candle_cake: Bolo com vela branca + white_carpet: Tapete branco + white_concrete: Concreto branco + white_concrete_powder: Cimento branco + white_glazed_terracotta: Azulejo branco + white_shulker_box: Caixa de shulker branca + white_stained_glass: Vidro branco + white_stained_glass_pane: Vidraça branca + white_terracotta: Terracota branca + white_tulip: Tulipa branca + white_wool: Lã branca + wither_rose: Rosa do Wither + wither_skeleton_skull: Crânio de esqueleto wither + wither_skeleton_wall_skull: Crânio de esqueleto wither de parede + yellow_banner: Estandarte amarelo + yellow_bed: Cama amarela + yellow_candle: Vela amarela + yellow_candle_cake: Bolo com vela amarela + yellow_carpet: Tapete amarelo + yellow_concrete: Concreto amarelo + yellow_concrete_powder: Cimento amarelo + yellow_glazed_terracotta: Azulejo amarelo + yellow_shulker_box: Caixa de shulker amarela + yellow_stained_glass: Vidro amarelo + yellow_stained_glass_pane: Vidraça amarela + yellow_terracotta: Terracota amarela + yellow_wool: Lã amarela + zombie_head: Cabeça de zumbi + zombie_wall_head: Cabeça de zumbi de parede + acacia_boat: Bote de acácia + acacia_chest_boat: Bote de acácia com baú + allay_spawn_egg: Ovo gerador de allay + amethyst_shard: Fragmento de ametista + angler_pottery_shard: Óstraco de pesca + angler_pottery_sherd: Óstraco de pesca + apple: Maçã + archer_pottery_shard: Óstraco de arco + archer_pottery_sherd: Óstraco de arco + armor_stand: Suporte de armaduras + arms_up_pottery_shard: Óstraco de figura + arms_up_pottery_sherd: Óstraco de figura + arrow: Flecha + axolotl_bucket: Balde com axolote + axolotl_spawn_egg: Ovo gerador de axolote + baked_potato: Batata assada + bamboo_chest_raft: Jangada de bambu com baú + bamboo_raft: Jangada de bambu + bat_spawn_egg: Ovo gerador de morcego + bee_spawn_egg: Ovo gerador de abelha + beef: Bife cru + beetroot: Beterraba + beetroot_seeds: Sementes de beterraba + beetroot_soup: Ensopado de beterraba + birch_boat: Bote de bétula + birch_chest_boat: Bote de bétula com baú + black_dye: Corante preto + blade_pottery_shard: Óstraco de espada + blade_pottery_sherd: Óstraco de espada + blaze_powder: Pó de blaze + blaze_rod: Vara de blaze + blaze_spawn_egg: Ovo gerador de blaze + blue_dye: Corante azul + bone: Osso + bone_meal: Farinha de osso + book: Livro + bow: Arco + bowl: Tigela + bread: Pão + brewer_pottery_shard: Óstraco de poção + brewer_pottery_sherd: Óstraco de poção + brick: Tijolo + brown_dye: Corante marrom + brush: Pincel + bucket: Balde + bundle: Trouxa + burn_pottery_shard: Óstraco de fogo + burn_pottery_sherd: Óstraco de fogo + camel_spawn_egg: Ovo gerador de camelo + carrot: Cenoura + carrot_on_a_stick: Vara com cenoura + cat_spawn_egg: Ovo gerador de gato + cave_spider_spawn_egg: Ovo gerador de aranha das cavernas + chainmail_boots: Botas de malha + chainmail_chestplate: Peitoral de malha + chainmail_helmet: Capacete de malha + chainmail_leggings: Calças de malha + charcoal: Carvão vegetal + cherry_boat: Bote de cerejeira + cherry_chest_boat: Bote de cerejeira com baú + chest_minecart: Carrinho de mina com baú + chicken: Frango cru + chicken_spawn_egg: Ovo gerador de galinha + chorus_fruit: Fruta do coro + clay_ball: Bola de argila + clock: Relógio + coal: Carvão + coast_armor_trim_smithing_template: Molde de ferraria + cocoa_beans: Sementes de cacau + cod: Bacalhau cru + cod_bucket: Balde com bacalhau + cod_spawn_egg: Ovo gerador de bacalhau + command_block_minecart: Carrinho de mina com bloco de comando + compass: Bússola + cooked_beef: Filé + cooked_chicken: Frango assado + cooked_cod: Bacalhau assado + cooked_mutton: Carneiro assado + cooked_porkchop: Costeleta de porco assada + cooked_rabbit: Coelho assado + cooked_salmon: Salmão assado + cookie: Biscoito + copper_ingot: Barra de cobre + cow_spawn_egg: Ovo gerador de vaca + creeper_banner_pattern: Desenho para estandarte + creeper_spawn_egg: Ovo gerador de creeper + crossbow: Besta + cyan_dye: Corante ciano + danger_pottery_shard: Óstraco de creeper + danger_pottery_sherd: Óstraco de creeper + dark_oak_boat: Bote de carvalho escuro + dark_oak_chest_boat: Bote de carvalho escuro com baú + debug_stick: Graveto de depuração + diamond: Diamante + diamond_axe: Machado de diamante + diamond_boots: Botas de diamante + diamond_chestplate: Peitoral de diamante + diamond_helmet: Capacete de diamante + diamond_hoe: Enxada de diamante + diamond_horse_armor: Armadura de diamante para cavalo + diamond_leggings: Calças de diamante + diamond_pickaxe: Picareta de diamante + diamond_shovel: Pá de diamante + diamond_sword: Espada de diamante + disc_fragment_5: Fragmento de disco + dolphin_spawn_egg: Ovo gerador de golfinho + donkey_spawn_egg: Ovo gerador de burro + dragon_breath: Bafo do dragão + dried_kelp: Algas secas + drowned_spawn_egg: Ovo gerador de afogado + dune_armor_trim_smithing_template: Molde de ferraria + echo_shard: Fragmento de eco + egg: Ovo + elder_guardian_spawn_egg: Ovo gerador de guardião-mestre + elytra: Élitros + emerald: Esmeralda + enchanted_book: Livro encantado + enchanted_golden_apple: Maçã dourada encantada + end_crystal: Cristal do End + ender_dragon_spawn_egg: Ovo gerador de Dragão Ender + ender_eye: Olho de ender + ender_pearl: Pérola de ender + enderman_spawn_egg: Ovo gerador de enderman + endermite_spawn_egg: Ovo gerador de endermite + evoker_spawn_egg: Ovo gerador de invocador + experience_bottle: Frasco de experiência + explorer_pottery_shard: Óstraco de mapa + explorer_pottery_sherd: Óstraco de mapa + eye_armor_trim_smithing_template: Molde de ferraria + feather: Pena + fermented_spider_eye: Olho de aranha fermentado + filled_map: Mapa + fire_charge: Bola de fogo + firework_rocket: Fogo de artifício + firework_star: Estrela de fogo de artifício + fishing_rod: Vara de pesca + flint: Sílex + flint_and_steel: Pederneira + flower_banner_pattern: Desenho para estandarte + fox_spawn_egg: Ovo gerador de raposa + friend_pottery_shard: Óstraco de amigo + friend_pottery_sherd: Óstraco de amigo + frog_spawn_egg: Ovo gerador de sapo + furnace_minecart: Carrinho de mina com fornalha + ghast_spawn_egg: Ovo gerador de ghast + ghast_tear: Lágrima de ghast + glass_bottle: Frasco + glistering_melon_slice: Fatia de melancia reluzente + globe_banner_pattern: Desenho para estandarte + glow_berries: Bagas brilhantes + glow_ink_sac: Bolsa de tinta brilhante + glow_item_frame: Moldura brilhante + glow_squid_spawn_egg: Ovo gerador de lula-brilhante + glowstone_dust: Pó de pedra luminosa + goat_horn: Chifre de cabra + goat_spawn_egg: Ovo gerador de cabra + gold_ingot: Barra de ouro + gold_nugget: Pepita de ouro + golden_apple: Maçã dourada + golden_axe: Machado de ouro + golden_boots: Botas de ouro + golden_carrot: Cenoura dourada + golden_chestplate: Peitoral de ouro + golden_helmet: Capacete de ouro + golden_hoe: Enxada de ouro + golden_horse_armor: Armadura de ouro para cavalo + golden_leggings: Calças de ouro + golden_pickaxe: Picareta de ouro + golden_shovel: Pá de ouro + golden_sword: Espada de ouro + gray_dye: Corante cinza + green_dye: Corante verde + guardian_spawn_egg: Ovo gerador de guardião + gunpowder: Pólvora + heart_of_the_sea: Coração do mar + heart_pottery_shard: Óstraco de coração + heart_pottery_sherd: Óstraco de coração + heartbreak_pottery_shard: Óstraco de coração partido + heartbreak_pottery_sherd: Óstraco de coração partido + hoglin_spawn_egg: Ovo gerador de hoglin + honey_bottle: Frasco de mel + honeycomb: Favo de mel + hopper_minecart: Carrinho de mina com funil + horse_spawn_egg: Ovo gerador de cavalo + host_armor_trim_smithing_template: Molde de ferraria + howl_pottery_shard: Óstraco de lobo + howl_pottery_sherd: Óstraco de lobo + husk_spawn_egg: Ovo gerador de zumbi-múmia + ink_sac: Bolsa de tinta + iron_axe: Machado de ferro + iron_boots: Botas de ferro + iron_chestplate: Peitoral de ferro + iron_golem_spawn_egg: Ovo gerador de golem de ferro + iron_helmet: Capacete de ferro + iron_hoe: Enxada de ferro + iron_horse_armor: Armadura de ferro para cavalo + iron_ingot: Barra de ferro + iron_leggings: Calças de ferro + iron_nugget: Pepita de ferro + iron_pickaxe: Picareta de ferro + iron_shovel: Pá de ferro + iron_sword: Espada de ferro + item_frame: Moldura + jungle_boat: Bote de madeira da selva + jungle_chest_boat: Bote de madeira da selva com baú + knowledge_book: Enciclopédia + lapis_lazuli: Lápis-lazúli + lava_bucket: Balde de lava + lead: Laço + leather: Couro + leather_boots: Botas de couro + leather_chestplate: Túnica de couro + leather_helmet: Capuz de couro + leather_horse_armor: Armadura de couro para cavalo + leather_leggings: Calças de couro + light_blue_dye: Corante azul-claro + light_gray_dye: Corante cinza-claro + lime_dye: Corante verde-limão + lingering_potion: Poção prolongada + llama_spawn_egg: Ovo gerador de lhama + lodestone_compass: Bússola magnetizada + magenta_dye: Corante magenta + magma_cream: Creme de magma + magma_cube_spawn_egg: Ovo gerador de cubo de magma + mangrove_boat: Bote de mangue + mangrove_chest_boat: Bote de mangue com baú + map: Mapa em branco + melon_seeds: Sementes de melancia + melon_slice: Fatia de melancia + milk_bucket: Balde de leite + minecart: Carrinho de mina + miner_pottery_shard: Óstraco de picareta + miner_pottery_sherd: Óstraco de picareta + mojang_banner_pattern: Desenho para estandarte + mooshroom_spawn_egg: Ovo gerador de mooshroom + mourner_pottery_shard: Óstraco de defensor + mourner_pottery_sherd: Óstraco de defensor + mule_spawn_egg: Ovo gerador de mula + mushroom_stew: Ensopado de cogumelos + music_disc_11: Disco musical + music_disc_13: Disco musical + music_disc_5: Disco musical + music_disc_blocks: Disco musical + music_disc_cat: Disco musical + music_disc_chirp: Disco musical + music_disc_far: Disco musical + music_disc_mall: Disco musical + music_disc_mellohi: Disco musical + music_disc_otherside: Disco musical + music_disc_pigstep: Disco musical + music_disc_relic: Disco musical + music_disc_stal: Disco musical + music_disc_strad: Disco musical + music_disc_wait: Disco musical + music_disc_ward: Disco musical + mutton: Carneiro cru + name_tag: Etiqueta + nautilus_shell: Concha de náutilo + nether_brick: Tijolo do Nether + nether_star: Estrela do Nether + netherite_axe: Machado de netherita + netherite_boots: Botas de netherita + netherite_chestplate: Peitoral de netherita + netherite_helmet: Capacete de netherita + netherite_hoe: Enxada de netherita + netherite_ingot: Barra de netherita + netherite_leggings: Calças de netherita + netherite_pickaxe: Picareta de netherita + netherite_scrap: Fragmentos de netherita + netherite_shovel: Pá de netherita + netherite_sword: Espada de netherita + netherite_upgrade_smithing_template: Molde de ferraria + oak_boat: Bote de carvalho + oak_chest_boat: Bote de carvalho com baú + ocelot_spawn_egg: Ovo gerador de jaguatirica + orange_dye: Corante laranja + painting: Quadro + panda_spawn_egg: Ovo gerador de panda + paper: Papel + parrot_spawn_egg: Ovo gerador de papagaio + phantom_membrane: Membrana de phantom + phantom_spawn_egg: Ovo gerador de phantom + pig_spawn_egg: Ovo gerador de porco + piglin_banner_pattern: Desenho para estandarte + piglin_brute_spawn_egg: Ovo gerador de piglin bárbaro + piglin_spawn_egg: Ovo gerador de piglin + pillager_spawn_egg: Ovo gerador de saqueador + pink_dye: Corante rosa + pitcher_pod: Vagem de planta ancestral + plenty_pottery_shard: Óstraco de baú + plenty_pottery_sherd: Óstraco de baú + poisonous_potato: Batata venenosa + polar_bear_spawn_egg: Ovo gerador de urso polar + popped_chorus_fruit: Fruta do coro cozida + porkchop: Costeleta de porco crua + potato: Batata + potion: Poção + pottery_shard_archer: Óstraco de arco + pottery_shard_arms_up: Óstraco de figura + pottery_shard_prize: Óstraco de joia + pottery_shard_skull: Óstraco de caveira + powder_snow_bucket: Balde de neve fofa + prismarine_crystals: Cristais de prismarinho + prismarine_shard: Pedaço de prismarinho + prize_pottery_shard: Óstraco de joia + prize_pottery_sherd: Óstraco de joia + pufferfish: Baiacu + pufferfish_bucket: Balde com baiacu + pufferfish_spawn_egg: Ovo gerador de baiacu + pumpkin_pie: Torta de abóbora + pumpkin_seeds: Sementes de abóbora + purple_dye: Corante roxo + quartz: Quartzo do Nether + rabbit: Coelho cru + rabbit_foot: Pé de coelho + rabbit_hide: Pele de coelho + rabbit_spawn_egg: Ovo gerador de coelho + rabbit_stew: Ensopado de coelho + raiser_armor_trim_smithing_template: Molde de ferraria + ravager_spawn_egg: Ovo gerador de devastador + raw_copper: Cobre bruto + raw_gold: Ouro bruto + raw_iron: Ferro bruto + recovery_compass: Bússola de retomada + red_dye: Corante vermelho + redstone: Pó de redstone + rib_armor_trim_smithing_template: Molde de ferraria + rotten_flesh: Carne podre + saddle: Sela + salmon: Salmão cru + salmon_bucket: Balde com salmão + salmon_spawn_egg: Ovo gerador de salmão + scute: Escama de tartaruga + sentry_armor_trim_smithing_template: Molde de ferraria + shaper_armor_trim_smithing_template: Molde de ferraria + sheaf_pottery_shard: Óstraco de trigo + sheaf_pottery_sherd: Óstraco de trigo + shears: Tesoura + sheep_spawn_egg: Ovo gerador de ovelha + shelter_pottery_shard: Óstraco de árvore + shelter_pottery_sherd: Óstraco de árvore + shield: Escudo + shulker_shell: Casco de shulker + shulker_spawn_egg: Ovo gerador de shulker + sign: Placa + silence_armor_trim_smithing_template: Molde de ferraria + silverfish_spawn_egg: Ovo gerador de traça + skeleton_horse_spawn_egg: Ovo gerador de cavalo-esqueleto + skeleton_spawn_egg: Ovo gerador de esqueleto + skull_banner_pattern: Desenho para estandarte + skull_pottery_shard: Óstraco de caveira + skull_pottery_sherd: Óstraco de caveira + slime_ball: Bola de slime + slime_spawn_egg: Ovo gerador de slime + smithing_template: Molde de ferraria + sniffer_spawn_egg: Ovo gerador de farejador + snort_pottery_shard: Óstraco de farejador + snort_pottery_sherd: Óstraco de farejador + snout_armor_trim_smithing_template: Molde de ferraria + snow_golem_spawn_egg: Ovo gerador de golem de neve + snowball: Bola de neve + spectral_arrow: Flecha espectral + spider_eye: Olho de aranha + spider_spawn_egg: Ovo gerador de aranha + spire_armor_trim_smithing_template: Molde de ferraria + splash_potion: Poção arremessável + spruce_boat: Bote de pinheiro + spruce_chest_boat: Bote de pinheiro com baú + spyglass: Luneta + squid_spawn_egg: Ovo gerador de lula + stick: Graveto + stone_axe: Machado de pedra + stone_hoe: Enxada de pedra + stone_pickaxe: Picareta de pedra + stone_shovel: Pá de pedra + stone_sword: Espada de pedra + stray_spawn_egg: Ovo gerador de esqueleto-errante + strider_spawn_egg: Ovo gerador de lavagante + string: Linha + sugar: Açúcar + suspicious_stew: Ensopado suspeito + sweet_berries: Bagas doces + tadpole_bucket: Balde com girino + tadpole_spawn_egg: Ovo gerador de girino + tide_armor_trim_smithing_template: Molde de ferraria + tipped_arrow: Flecha com efeito + tnt_minecart: Carrinho de mina com dinamite + torchflower_seeds: Sementes de plantocha + totem_of_undying: Totem da imortalidade + trader_llama_spawn_egg: Ovo gerador de lhama do vendedor + trident: Tridente + tropical_fish: Peixe tropical + tropical_fish_bucket: Balde com peixe tropical + tropical_fish_spawn_egg: Ovo gerador de peixe tropical + turtle_helmet: Casco de tartaruga + turtle_spawn_egg: Ovo gerador de tartaruga + vex_armor_trim_smithing_template: Molde de ferraria + vex_spawn_egg: Ovo gerador de vex + villager_spawn_egg: Ovo gerador de aldeão + vindicator_spawn_egg: Ovo gerador de vingador + wandering_trader_spawn_egg: Ovo gerador de vendedor ambulante + ward_armor_trim_smithing_template: Molde de ferraria + warden_spawn_egg: Ovo gerador de defensor + warped_fungus_on_a_stick: Vara com fungo distorcido + water_bucket: Balde de água + wayfinder_armor_trim_smithing_template: Molde de ferraria + wheat_seeds: Sementes de trigo + white_dye: Corante branco + wild_armor_trim_smithing_template: Molde de ferraria + witch_spawn_egg: Ovo gerador de bruxa + wither_skeleton_spawn_egg: Ovo gerador de esqueleto wither + wither_spawn_egg: Ovo gerador de Wither + wolf_spawn_egg: Ovo gerador de lobo + wooden_axe: Machado de madeira + wooden_hoe: Enxada de madeira + wooden_pickaxe: Picareta de madeira + wooden_shovel: Pá de madeira + wooden_sword: Espada de madeira + writable_book: Livro e pena + written_book: Livro escrito + yellow_dye: Corante amarelo + zoglin_spawn_egg: Ovo gerador de zoglin + zombie_horse_spawn_egg: Ovo gerador de cavalo-zumbi + zombie_spawn_egg: Ovo gerador de zumbi + zombie_villager_spawn_egg: Ovo gerador de aldeão zumbi + zombified_piglin_spawn_egg: Ovo gerador de piglin-zumbi +Enchantment: + aqua_affinity: Afinidade aquática + bane_of_arthropods: Ruína dos artrópodes + binding_curse: Maldição do ligamento + blast_protection: Proteção contra explosões + channeling: Condutividade + depth_strider: Passos profundos + efficiency: Eficiência + feather_falling: Peso-pena + fire_aspect: Aspecto flamejante + fire_protection: Proteção contra o fogo + flame: Chama + fortune: Fortuna + frost_walker: Passos gelados + impaling: Penetração + infinity: Infinidade + knockback: Repulsão + looting: Saque + loyalty: Lealdade + luck_of_the_sea: Sorte do mar + lure: Isca + mending: Remendo + multishot: Rajada + piercing: Perfuração + power: Força + projectile_protection: Proteção contra projéteis + protection: Proteção + punch: Impacto + quick_charge: Carga rápida + respiration: Respiração + riptide: Correnteza + sharpness: Afiação + silk_touch: Toque suave + smite: Julgamento + soul_speed: Velocidade das almas + sweeping: Alcance + swift_sneak: Passos furtivos + thorns: Espinhos + unbreaking: Durabilidade + vanishing_curse: Maldição do desaparecimento diff --git a/assets/ru.yml b/assets/ru.yml new file mode 100644 index 0000000..7ff593d --- /dev/null +++ b/assets/ru.yml @@ -0,0 +1,1617 @@ +EntityType: + allay: Тихоня + area_effect_cloud: Облако эффекта + armor_stand: Стойка для брони + arrow: Стрела + axolotl: Аксолотль + bat: Летучая мышь + bee: Пчела + blaze: Всполох + block_display: Визуализатор блока + boat: Лодка + camel: Верблюд + cat: Кошка + cave_spider: Пещерный паук + chest_boat: Грузовая лодка + chest_minecart: Грузовая вагонетка + chicken: Курица + cod: Треска + command_block_minecart: Вагонетка с командным блоком + cow: Корова + creeper: Крипер + dolphin: Дельфин + donkey: Осёл + dragon_fireball: Файербол дракона + drowned: Утопленник + egg: Брошенное яйцо + elder_guardian: Древний страж + end_crystal: Кристалл Энда + ender_dragon: Эндер-дракон + ender_pearl: Брошенный эндер-жемчуг + enderman: Эндермен + endermite: Эндермит + evoker: Заклинатель + evoker_fangs: Клыки заклинателя + experience_bottle: Брошенный пузырёк опыта + experience_orb: Сфера опыта + eye_of_ender: Око Эндера + falling_block: Падающий блок + falling_block_type: '%s в падении' + fireball: Файербол + firework_rocket: Фейерверк + fishing_bobber: Поплавок + fox: Лисица + frog: Лягушка + furnace_minecart: Самоходная вагонетка + ghast: Гаст + giant: Гигант + glow_item_frame: Светящаяся рамка + glow_squid: Светящийся спрут + goat: Коза + guardian: Страж + hoglin: Хоглин + hopper_minecart: Загрузочная вагонетка + horse: Лошадь + husk: Кадавр + illusioner: Иллюзор + interaction: Взаимодействие + iron_golem: Железный голем + item: Предмет + item_display: Визуализатор предмета + item_frame: Рамка + killer_bunny: Кролик-убийца + leash_knot: Узел поводка + lightning_bolt: Молния + llama: Лама + llama_spit: Плевок ламы + magma_cube: Магмовый куб + marker: Метка + minecart: Вагонетка + mooshroom: Муухомор + mule: Мул + ocelot: Оцелот + painting: Картина + panda: Панда + parrot: Попугай + phantom: Фантом + pig: Свинья + piglin: Пиглин + piglin_brute: Брутальный пиглин + pillager: Разбойник + player: Игрок + polar_bear: Белый медведь + potion: Зелье + pufferfish: Иглобрюх + rabbit: Кролик + ravager: Разоритель + salmon: Лосось + sheep: Овца + shulker: Шалкер + shulker_bullet: Снаряд шалкера + silverfish: Чешуйница + skeleton: Скелет + skeleton_horse: Лошадь-скелет + slime: Слизень + small_fireball: Малый файербол + sniffer: Нюхач + snow_golem: Снежный голем + snowball: Снежок + spawner_minecart: Вагонетка с рассадником монстров + spectral_arrow: Спектральная стрела + spider: Паук + squid: Спрут + stray: Зимогор + strider: Лавомерка + tadpole: Головастик + text_display: Визуализатор текста + tnt: Активированный динамит + tnt_minecart: Вагонетка с динамитом + trader_llama: Лама торговца + trident: Трезубец + tropical_fish: Тропическая рыба + turtle: Черепаха + vex: Вредина + villager: Крестьянин + vindicator: Поборник + wandering_trader: Странствующий торговец + warden: Хранитель + witch: Ведьма + wither: Визер + wither_skeleton: Визер-скелет + wither_skull: Череп визера + wolf: Волк + zoglin: Зоглин + zombie: Зомби + zombie_horse: Лошадь-зомби + zombie_villager: Крестьянин-зомби + zombified_piglin: Зомбифицированный пиглин +PotionEffectType: + absorption: Поглощение + bad_omen: Дурное знамение + blindness: Слепота + conduit_power: Сила источника + darkness: Тьма + dolphins_grace: Грация дельфина + fire_resistance: Огнестойкость + glowing: Свечение + haste: Спешка + health_boost: Прилив здоровья + hero_of_the_village: Герой деревни + hunger: Голод + instant_damage: Моментальный урон + instant_health: Исцеление + invisibility: Невидимость + jump_boost: Прыгучесть + levitation: Левитация + luck: Везение + mining_fatigue: Утомление + nausea: Тошнота + night_vision: Ночное зрение + poison: Отравление + regeneration: Регенерация + resistance: Сопротивление + saturation: Насыщенность + slow_falling: Плавное падение + slowness: Замедление + speed: Скорость + strength: Сила + unluck: Невезение + water_breathing: Водное дыхание + weakness: Слабость + wither: Иссушение +Material: + acacia_button: Акациевая кнопка + acacia_door: Акациевая дверь + acacia_fence: Акациевый забор + acacia_fence_gate: Акациевая калитка + acacia_hanging_sign: Акациевая подвесная табличка + acacia_leaves: Листья акации + acacia_log: Акациевое бревно + acacia_planks: Акациевые доски + acacia_pressure_plate: Акациевая нажимная плита + acacia_sapling: Саженец акации + acacia_sign: Акациевая табличка + acacia_slab: Акациевая плита + acacia_stairs: Акациевые ступеньки + acacia_trapdoor: Акациевый люк + acacia_wall_hanging_sign: Акациевая настенная подвесная табличка + acacia_wall_sign: Акациевая настенная табличка + acacia_wood: Акация + activator_rail: Активирующие рельсы + air: Воздух + allium: Лук-батун + amethyst_block: Аметистовый блок + amethyst_cluster: Аметистовая друза + ancient_debris: Древние обломки + andesite: Андезит + andesite_slab: Андезитовая плита + andesite_stairs: Андезитовые ступеньки + andesite_wall: Андезитовая ограда + anvil: Наковальня + attached_melon_stem: Прикреплённый стебель арбуза + attached_pumpkin_stem: Прикреплённый стебель тыквы + azalea: Азалия + azalea_leaves: Листья азалии + azure_bluet: Хаустония серая + bamboo: Бамбук + bamboo_block: Блок бамбука + bamboo_button: Бамбуковая кнопка + bamboo_door: Бамбуковая дверь + bamboo_fence: Бамбуковый забор + bamboo_fence_gate: Бамбуковая калитка + bamboo_hanging_sign: Бамбуковая подвесная табличка + bamboo_mosaic: Бамбуковая мозаика + bamboo_mosaic_slab: Плита из бамбуковой мозаики + bamboo_mosaic_stairs: Ступеньки из бамбуковой мозаики + bamboo_planks: Бамбуковые доски + bamboo_pressure_plate: Бамбуковая нажимная плита + bamboo_sapling: Побег бамбука + bamboo_sign: Бамбуковая табличка + bamboo_slab: Бамбуковая плита + bamboo_stairs: Бамбуковые ступеньки + bamboo_trapdoor: Бамбуковый люк + bamboo_wall_hanging_sign: Бамбуковая настенная подвесная табличка + bamboo_wall_sign: Бамбуковая настенная табличка + barrel: Бочка + barrier: Барьер + basalt: Базальт + beacon: Маяк + bedrock: Бедрок + bee_nest: Пчелиное гнездо + beehive: Улей + beetroots: Свёкла + bell: Колокол + big_dripleaf: Большая бросянка + big_dripleaf_stem: Стебель большой бросянки + birch_button: Берёзовая кнопка + birch_door: Берёзовая дверь + birch_fence: Берёзовый забор + birch_fence_gate: Берёзовая калитка + birch_hanging_sign: Берёзовая подвесная табличка + birch_leaves: Берёзовые листья + birch_log: Берёзовое бревно + birch_planks: Берёзовые доски + birch_pressure_plate: Берёзовая нажимная плита + birch_sapling: Саженец берёзы + birch_sign: Берёзовая табличка + birch_slab: Берёзовая плита + birch_stairs: Берёзовые ступеньки + birch_trapdoor: Берёзовый люк + birch_wall_hanging_sign: Берёзовая настенная подвесная табличка + birch_wall_sign: Берёзовая настенная табличка + birch_wood: Берёза + black_banner: Чёрный флаг + black_bed: Чёрная кровать + black_candle: Чёрная свеча + black_candle_cake: Торт с чёрной свечой + black_carpet: Чёрный ковёр + black_concrete: Чёрный бетон + black_concrete_powder: Чёрный сухой бетон + black_glazed_terracotta: Чёрная глазурованная керамика + black_shulker_box: Чёрный шалкеровый ящик + black_stained_glass: Чёрное стекло + black_stained_glass_pane: Чёрная стеклянная панель + black_terracotta: Чёрная керамика + black_wool: Чёрная шерсть + blackstone: Чернит + blackstone_slab: Чернитная плита + blackstone_stairs: Чернитные ступеньки + blackstone_wall: Чернитная ограда + blast_furnace: Плавильная печь + blue_banner: Синий флаг + blue_bed: Синяя кровать + blue_candle: Синяя свеча + blue_candle_cake: Торт с синей свечой + blue_carpet: Синий ковёр + blue_concrete: Синий бетон + blue_concrete_powder: Синий сухой бетон + blue_glazed_terracotta: Синяя глазурованная керамика + blue_ice: Синий лёд + blue_orchid: Синяя орхидея + blue_shulker_box: Синий шалкеровый ящик + blue_stained_glass: Синее стекло + blue_stained_glass_pane: Синяя стеклянная панель + blue_terracotta: Синяя керамика + blue_wool: Синяя шерсть + bone_block: Костный блок + bookshelf: Книжная полка + brain_coral: Коралл-мозговик + brain_coral_block: Блок коралла-мозговика + brain_coral_fan: Веерный коралл-мозговик + brain_coral_wall_fan: Горизонтальный веерный коралл-мозговик + brewing_stand: Зельеварка + brick_slab: Кирпичная плита + brick_stairs: Кирпичные ступеньки + brick_wall: Кирпичная ограда + bricks: Кирпичи + brown_banner: Коричневый флаг + brown_bed: Коричневая кровать + brown_candle: Коричневая свеча + brown_candle_cake: Торт с коричневой свечой + brown_carpet: Коричневый ковёр + brown_concrete: Коричневый бетон + brown_concrete_powder: Коричневый сухой бетон + brown_glazed_terracotta: Коричневая глазурованная керамика + brown_mushroom: Коричневый гриб + brown_mushroom_block: Блок коричневого гриба + brown_shulker_box: Коричневый шалкеровый ящик + brown_stained_glass: Коричневое стекло + brown_stained_glass_pane: Коричневая стеклянная панель + brown_terracotta: Коричневая керамика + brown_wool: Коричневая шерсть + bubble_column: Колонна пузырей + bubble_coral: Пузырчатый коралл + bubble_coral_block: Блок пузырчатого коралла + bubble_coral_fan: Веерный пузырчатый коралл + bubble_coral_wall_fan: Горизонтальный веерный пузырчатый коралл + budding_amethyst: Цветущий аметист + cactus: Кактус + cake: Торт + calcite: Кальцит + calibrated_sculk_sensor: Откалиброванный скалк-сенсор + campfire: Костёр + candle: Свеча + candle_cake: Торт со свечой + carrots: Морковь + cartography_table: Стол картографа + carved_pumpkin: Вырезанная тыква + cauldron: Котёл + cave_air: Пещерный воздух + cave_vines: Пещерная лоза + cave_vines_plant: Стебель пещерной лозы + chain: Цепь + chain_command_block: Последовательный командный блок + cherry_button: Вишнёвая кнопка + cherry_door: Вишнёвая дверь + cherry_fence: Вишнёвый забор + cherry_fence_gate: Вишнёвая калитка + cherry_hanging_sign: Вишнёвая подвесная табличка + cherry_leaves: Вишнёвые листья + cherry_log: Вишнёвое бревно + cherry_planks: Вишнёвые доски + cherry_pressure_plate: Вишнёвая нажимная плита + cherry_sapling: Саженец вишни + cherry_sign: Вишнёвая табличка + cherry_slab: Вишнёвая плита + cherry_stairs: Вишнёвые ступеньки + cherry_trapdoor: Вишнёвый люк + cherry_wall_hanging_sign: Вишнёвая настенная подвесная табличка + cherry_wall_sign: Вишнёвая настенная табличка + cherry_wood: Вишня + chest: Сундук + chipped_anvil: Повреждённая наковальня + chiseled_bookshelf: Резная книжная полка + chiseled_deepslate: Резной глубинный сланец + chiseled_nether_bricks: Резные незерские кирпичи + chiseled_polished_blackstone: Резной полированный чернит + chiseled_quartz_block: Резной кварцевый блок + chiseled_red_sandstone: Резной красный песчаник + chiseled_sandstone: Резной песчаник + chiseled_stone_bricks: Резные каменные кирпичи + chorus_flower: Цветок хоруса + chorus_plant: Хорус + clay: Глина + coal_block: Угольный блок + coal_ore: Угольная руда + coarse_dirt: Каменистая земля + cobbled_deepslate: Колотый глубинный сланец + cobbled_deepslate_slab: Плита из колотого глубинного сланца + cobbled_deepslate_stairs: Ступеньки из колотого глубинного сланца + cobbled_deepslate_wall: Ограда из колотого глубинного сланца + cobblestone: Булыжник + cobblestone_slab: Булыжная плита + cobblestone_stairs: Булыжные ступеньки + cobblestone_wall: Булыжная ограда + cobweb: Паутина + cocoa: Какао + command_block: Командный блок + comparator: Редстоуновый компаратор + composter: Компостница + conduit: Морской источник + copper_block: Медный блок + copper_ore: Медная руда + cornflower: Синий василёк + cracked_deepslate_bricks: Потрескавшиеся глубинносланцевые кирпичи + cracked_deepslate_tiles: Потрескавшийся глубинносланцевый плитняк + cracked_nether_bricks: Потрескавшиеся незерские кирпичи + cracked_polished_blackstone_bricks: Потрескавшиеся полированно-чернитные кирпичи + cracked_stone_bricks: Потрескавшиеся каменные кирпичи + crafting_table: Верстак + creeper_head: Голова крипера + creeper_wall_head: Настенная голова крипера + crimson_button: Багровая кнопка + crimson_door: Багровая дверь + crimson_fence: Багровый забор + crimson_fence_gate: Багровая калитка + crimson_fungus: Багровый гриб + crimson_hanging_sign: Багровая подвесная табличка + crimson_hyphae: Багровые гифы + crimson_nylium: Багровый нилий + crimson_planks: Багровые доски + crimson_pressure_plate: Багровая нажимная плита + crimson_roots: Багровые корни + crimson_sign: Багровая табличка + crimson_slab: Багровая плита + crimson_stairs: Багровые ступеньки + crimson_stem: Багровый стебель + crimson_trapdoor: Багровый люк + crimson_wall_hanging_sign: Багровая настенная подвесная табличка + crimson_wall_sign: Багровая настенная табличка + crying_obsidian: Плачущий обсидиан + cut_copper: Резной медный блок + cut_copper_slab: Резная медная плита + cut_copper_stairs: Резные медные ступеньки + cut_red_sandstone: Пиленый красный песчаник + cut_red_sandstone_slab: Плита из пиленого красного песчаника + cut_sandstone: Пиленый песчаник + cut_sandstone_slab: Плита из пиленого песчаника + cyan_banner: Бирюзовый флаг + cyan_bed: Бирюзовая кровать + cyan_candle: Бирюзовая свеча + cyan_candle_cake: Торт с бирюзовой свечой + cyan_carpet: Бирюзовый ковёр + cyan_concrete: Бирюзовый бетон + cyan_concrete_powder: Бирюзовый сухой бетон + cyan_glazed_terracotta: Бирюзовая глазурованная керамика + cyan_shulker_box: Бирюзовый шалкеровый ящик + cyan_stained_glass: Бирюзовое стекло + cyan_stained_glass_pane: Бирюзовая стеклянная панель + cyan_terracotta: Бирюзовая керамика + cyan_wool: Бирюзовая шерсть + damaged_anvil: Разбитая наковальня + dandelion: Одуванчик + dark_oak_button: Кнопка из тёмного дуба + dark_oak_door: Дверь из тёмного дуба + dark_oak_fence: Забор из тёмного дуба + dark_oak_fence_gate: Калитка из тёмного дуба + dark_oak_hanging_sign: Подвесная табличка из тёмного дуба + dark_oak_leaves: Листья тёмного дуба + dark_oak_log: Бревно тёмного дуба + dark_oak_planks: Доски из тёмного дуба + dark_oak_pressure_plate: Нажимная плита из тёмного дуба + dark_oak_sapling: Саженец тёмного дуба + dark_oak_sign: Табличка из тёмного дуба + dark_oak_slab: Плита из тёмного дуба + dark_oak_stairs: Ступеньки из тёмного дуба + dark_oak_trapdoor: Люк из тёмного дуба + dark_oak_wall_hanging_sign: Настенная подвесная табличка из тёмного дуба + dark_oak_wall_sign: Настенная табличка из тёмного дуба + dark_oak_wood: Тёмный дуб + dark_prismarine: Тёмный призмарин + dark_prismarine_slab: Плита из тёмного призмарина + dark_prismarine_stairs: Ступеньки из тёмного призмарина + daylight_detector: Датчик дневного света + dead_brain_coral: Мёртвый коралл-мозговик + dead_brain_coral_block: Блок мёртвого коралла-мозговика + dead_brain_coral_fan: Мёртвый веерный коралл-мозговик + dead_brain_coral_wall_fan: Мёртвый горизонтальный веерный коралл-мозговик + dead_bubble_coral: Мёртвый пузырчатый коралл + dead_bubble_coral_block: Блок мёртвого пузырчатого коралла + dead_bubble_coral_fan: Мёртвый веерный пузырчатый коралл + dead_bubble_coral_wall_fan: Мёртвый горизонтальный веерный пузырчатый коралл + dead_bush: Мёртвый куст + dead_fire_coral: Мёртвый огненный коралл + dead_fire_coral_block: Блок мёртвого огненного коралла + dead_fire_coral_fan: Мёртвый веерный огненный коралл + dead_fire_coral_wall_fan: Мёртвый горизонтальный веерный огненный коралл + dead_horn_coral: Мёртвый роговый коралл + dead_horn_coral_block: Блок мёртвого рогового коралла + dead_horn_coral_fan: Мёртвый веерный роговый коралл + dead_horn_coral_wall_fan: Мёртвый горизонтальный веерный роговый коралл + dead_tube_coral: Мёртвый трубчатый коралл + dead_tube_coral_block: Блок мёртвого трубчатого коралла + dead_tube_coral_fan: Мёртвый веерный трубчатый коралл + dead_tube_coral_wall_fan: Мёртвый горизонтальный веерный трубчатый коралл + decorated_pot: Узорчатая ваза + deepslate: Глубинный сланец + deepslate_brick_slab: Плита из глубинносланцевого кирпича + deepslate_brick_stairs: Ступеньки из глубинносланцевого кирпича + deepslate_brick_wall: Ограда из глубинносланцевого кирпича + deepslate_bricks: Глубинносланцевые кирпичи + deepslate_coal_ore: Угленосный глубинный сланец + deepslate_copper_ore: Меденосный глубинный сланец + deepslate_diamond_ore: Алмазоносный глубинный сланец + deepslate_emerald_ore: Изумрудоносный глубинный сланец + deepslate_gold_ore: Золотоносный глубинный сланец + deepslate_iron_ore: Железоносный глубинный сланец + deepslate_lapis_ore: Лазуритоносный глубинный сланец + deepslate_redstone_ore: Редстоуноносный глубинный сланец + deepslate_tile_slab: Плита из глубинносланцевого плитняка + deepslate_tile_stairs: Ступеньки из глубинносланцевого плитняка + deepslate_tile_wall: Ограда из глубинносланцевого плитняка + deepslate_tiles: Глубинносланцевый плитняк + detector_rail: Рельсы с датчиком + diamond_block: Алмазный блок + diamond_ore: Алмазная руда + diorite: Диорит + diorite_slab: Диоритовая плита + diorite_stairs: Диоритовые ступеньки + diorite_wall: Диоритовая ограда + dirt: Земля + dirt_path: Тропинка + dispenser: Раздатчик + dragon_egg: Яйцо дракона + dragon_head: Голова дракона + dragon_wall_head: Настенная голова дракона + dried_kelp_block: Блок сушёной ламинарии + dripstone_block: Натёчный камень + dropper: Выбрасыватель + emerald_block: Изумрудный блок + emerald_ore: Изумрудная руда + enchanting_table: Чародейский стол + end_gateway: Врата Энда + end_portal: Портал в Энд + end_portal_frame: Рамка портала в Энд + end_rod: Стержень Энда + end_stone: Эндерняк + end_stone_brick_slab: Плита из эндернякового кирпича + end_stone_brick_stairs: Ступеньки из эндернякового кирпича + end_stone_brick_wall: Ограда из эндернякового кирпича + end_stone_bricks: Эндерняковые кирпичи + ender_chest: Эндер-сундук + exposed_copper: Потемневший медный блок + exposed_cut_copper: Потемневший резной медный блок + exposed_cut_copper_slab: Потемневшая резная медная плита + exposed_cut_copper_stairs: Потемневшие резные медные ступеньки + farmland: Пашня + fern: Папоротник + fire: Огонь + fire_coral: Огненный коралл + fire_coral_block: Блок огненного коралла + fire_coral_fan: Веерный огненный коралл + fire_coral_wall_fan: Горизонтальный веерный огненный коралл + fletching_table: Стол лучника + flower_pot: Цветочный горшок + flowering_azalea: Цветущая азалия + flowering_azalea_leaves: Листья цветущей азалии + frogspawn: Лягушачья икра + frosted_ice: Талый лёд + furnace: Печь + gilded_blackstone: Золочёный чернит + glass: Стекло + glass_pane: Стеклянная панель + glow_lichen: Светящийся лишайник + glowstone: Светокамень + gold_block: Золотой блок + gold_ore: Золотая руда + granite: Гранит + granite_slab: Гранитная плита + granite_stairs: Гранитные ступеньки + granite_wall: Гранитная ограда + grass: Трава + grass_block: Дёрн + gravel: Гравий + gray_banner: Серый флаг + gray_bed: Серая кровать + gray_candle: Серая свеча + gray_candle_cake: Торт с серой свечой + gray_carpet: Серый ковёр + gray_concrete: Серый бетон + gray_concrete_powder: Серый сухой бетон + gray_glazed_terracotta: Серая глазурованная керамика + gray_shulker_box: Серый шалкеровый ящик + gray_stained_glass: Серое стекло + gray_stained_glass_pane: Серая стеклянная панель + gray_terracotta: Серая керамика + gray_wool: Серая шерсть + green_banner: Зелёный флаг + green_bed: Зелёная кровать + green_candle: Зелёная свеча + green_candle_cake: Торт с зелёной свечой + green_carpet: Зелёный ковёр + green_concrete: Зелёный бетон + green_concrete_powder: Зелёный сухой бетон + green_glazed_terracotta: Зелёная глазурованная керамика + green_shulker_box: Зелёный шалкеровый ящик + green_stained_glass: Зелёное стекло + green_stained_glass_pane: Зелёная стеклянная панель + green_terracotta: Зелёная керамика + green_wool: Зелёная шерсть + grindstone: Точило + hanging_roots: Свисающие корни + hay_block: Сноп сена + heavy_weighted_pressure_plate: Большегрузная весовая пластина + honey_block: Блок мёда + honeycomb_block: Блок пчелиных сот + hopper: Воронка + horn_coral: Роговой коралл + horn_coral_block: Блок рогового коралла + horn_coral_fan: Веерный роговый коралл + horn_coral_wall_fan: Горизонтальный веерный роговый коралл + ice: Лёд + infested_chiseled_stone_bricks: Заражённые резные каменные кирпичи + infested_cobblestone: Заражённый булыжник + infested_cracked_stone_bricks: Заражённые потрескавшиеся каменные кирпичи + infested_deepslate: Заражённый глубинный сланец + infested_mossy_stone_bricks: Заражённые замшелые каменные кирпичи + infested_stone: Заражённый камень + infested_stone_bricks: Заражённые каменные кирпичи + iron_bars: Железные прутья + iron_block: Железный блок + iron_door: Железная дверь + iron_ore: Железная руда + iron_trapdoor: Железный люк + jack_o_lantern: Светильник Джека + jigsaw: Пазл + jukebox: Проигрыватель + jungle_button: Кнопка из тропического дерева + jungle_door: Дверь из тропического дерева + jungle_fence: Забор из тропического дерева + jungle_fence_gate: Калитка из тропического дерева + jungle_hanging_sign: Подвесная табличка из тропического дерева + jungle_leaves: Листья тропического дерева + jungle_log: Бревно тропического дерева + jungle_planks: Доски из тропического дерева + jungle_pressure_plate: Нажимная плита из тропического дерева + jungle_sapling: Саженец тропического дерева + jungle_sign: Табличка из тропического дерева + jungle_slab: Плита из тропического дерева + jungle_stairs: Ступеньки из тропического дерева + jungle_trapdoor: Люк из тропического дерева + jungle_wall_hanging_sign: Настенная подвесная табличка из тропического дерева + jungle_wall_sign: Настенная табличка из тропического дерева + jungle_wood: Тропическое дерево + kelp: Ламинария + kelp_plant: Стебель ламинарии + ladder: Лестница + lantern: Фонарь + lapis_block: Лазуритовый блок + lapis_ore: Лазуритовая руда + large_amethyst_bud: Большой аметистовый бутон + large_fern: Раскидистый папоротник + lava: Лава + lava_cauldron: Котёл с лавой + lectern: Кафедра + lever: Рычаг + light: Свет + light_blue_banner: Голубой флаг + light_blue_bed: Голубая кровать + light_blue_candle: Голубая свеча + light_blue_candle_cake: Торт с голубой свечой + light_blue_carpet: Голубой ковёр + light_blue_concrete: Голубой бетон + light_blue_concrete_powder: Голубой сухой бетон + light_blue_glazed_terracotta: Голубая глазурованная керамика + light_blue_shulker_box: Голубой шалкеровый ящик + light_blue_stained_glass: Голубое стекло + light_blue_stained_glass_pane: Голубая стеклянная панель + light_blue_terracotta: Голубая керамика + light_blue_wool: Голубая шерсть + light_gray_banner: Светло-серый флаг + light_gray_bed: Светло-серая кровать + light_gray_candle: Светло-серая свеча + light_gray_candle_cake: Торт со светло-серой свечой + light_gray_carpet: Светло-серый ковёр + light_gray_concrete: Светло-серый бетон + light_gray_concrete_powder: Светло-серый сухой бетон + light_gray_glazed_terracotta: Светло-серая глазурованная керамика + light_gray_shulker_box: Светло-серый шалкеровый ящик + light_gray_stained_glass: Светло-серое стекло + light_gray_stained_glass_pane: Светло-серая стеклянная панель + light_gray_terracotta: Светло-серая керамика + light_gray_wool: Светло-серая шерсть + light_weighted_pressure_plate: Весовая пластина + lightning_rod: Громоотвод + lilac: Сирень + lily_of_the_valley: Ландыш + lily_pad: Кувшинка + lime_banner: Лаймовый флаг + lime_bed: Лаймовая кровать + lime_candle: Лаймовая свеча + lime_candle_cake: Торт с лаймовой свечой + lime_carpet: Лаймовый ковёр + lime_concrete: Лаймовый бетон + lime_concrete_powder: Лаймовый сухой бетон + lime_glazed_terracotta: Лаймовая глазурованная керамика + lime_shulker_box: Лаймовый шалкеровый ящик + lime_stained_glass: Лаймовое стекло + lime_stained_glass_pane: Лаймовая стеклянная панель + lime_terracotta: Лаймовая керамика + lime_wool: Лаймовая шерсть + lodestone: Магнетит + loom: Ткацкий станок + magenta_banner: Пурпурный флаг + magenta_bed: Пурпурная кровать + magenta_candle: Пурпурная свеча + magenta_candle_cake: Торт с пурпурной свечой + magenta_carpet: Пурпурный ковёр + magenta_concrete: Пурпурный бетон + magenta_concrete_powder: Пурпурный сухой бетон + magenta_glazed_terracotta: Пурпурная глазурованная керамика + magenta_shulker_box: Пурпурный шалкеровый ящик + magenta_stained_glass: Пурпурное стекло + magenta_stained_glass_pane: Пурпурная стеклянная панель + magenta_terracotta: Пурпурная керамика + magenta_wool: Пурпурная шерсть + magma_block: Магма + mangrove_button: Мангровая кнопка + mangrove_door: Мангровая дверь + mangrove_fence: Мангровый забор + mangrove_fence_gate: Мангровая калитка + mangrove_hanging_sign: Мангровая подвесная табличка + mangrove_leaves: Мангровые листья + mangrove_log: Мангровое бревно + mangrove_planks: Мангровые доски + mangrove_pressure_plate: Мангровая нажимная плита + mangrove_propagule: Мангровый отросток + mangrove_roots: Мангровые корни + mangrove_sign: Мангровая табличка + mangrove_slab: Мангровая плита + mangrove_stairs: Мангровые ступеньки + mangrove_trapdoor: Мангровый люк + mangrove_wall_hanging_sign: Мангровая настенная подвесная табличка + mangrove_wall_sign: Мангровая настенная табличка + mangrove_wood: Мангровое дерево + medium_amethyst_bud: Средний аметистовый бутон + melon: Арбуз + melon_stem: Стебель арбуза + moss_block: Блок мха + moss_carpet: Моховой ковёр + mossy_cobblestone: Замшелый булыжник + mossy_cobblestone_slab: Замшелая булыжная плита + mossy_cobblestone_stairs: Замшелые булыжные ступеньки + mossy_cobblestone_wall: Замшелая булыжная ограда + mossy_stone_brick_slab: Плита из замшелого каменного кирпича + mossy_stone_brick_stairs: Ступеньки из замшелого каменного кирпича + mossy_stone_brick_wall: Ограда из замшелого каменного кирпича + mossy_stone_bricks: Замшелые каменные кирпичи + moving_piston: Движущийся поршень + mud: Грязь + mud_brick_slab: Саманная плита + mud_brick_stairs: Саманные ступеньки + mud_brick_wall: Саманная ограда + mud_bricks: Саманные кирпичи + muddy_mangrove_roots: Грязные мангровые корни + mushroom_stem: Ножка гриба + mycelium: Мицелий + nether_brick_fence: Забор из незерского кирпича + nether_brick_slab: Плита из незерского кирпича + nether_brick_stairs: Ступеньки из незерского кирпича + nether_brick_wall: Ограда из незерского кирпича + nether_bricks: Незерские кирпичи + nether_gold_ore: Незерская золотая руда + nether_portal: Портал в Незер + nether_quartz_ore: Незер-кварцевая руда + nether_sprouts: Незерские ростки + nether_wart: Незерский нарост + nether_wart_block: Блок незерского нароста + netherite_block: Незеритовый блок + netherrack: Незерак + note_block: Нотный блок + oak_button: Дубовая кнопка + oak_door: Дубовая дверь + oak_fence: Дубовый забор + oak_fence_gate: Дубовая калитка + oak_hanging_sign: Дубовая подвесная табличка + oak_leaves: Дубовые листья + oak_log: Дубовое бревно + oak_planks: Дубовые доски + oak_pressure_plate: Дубовая нажимная плита + oak_sapling: Саженец дуба + oak_sign: Дубовая табличка + oak_slab: Дубовая плита + oak_stairs: Дубовые ступеньки + oak_trapdoor: Дубовый люк + oak_wall_hanging_sign: Дубовая настенная подвесная табличка + oak_wall_sign: Дубовая настенная табличка + oak_wood: Дуб + observer: Наблюдатель + obsidian: Обсидиан + ochre_froglight: Охристая квампа + ominous_banner: Зловещий флаг + orange_banner: Оранжевый флаг + orange_bed: Оранжевая кровать + orange_candle: Оранжевая свеча + orange_candle_cake: Торт с оранжевой свечой + orange_carpet: Оранжевый ковёр + orange_concrete: Оранжевый бетон + orange_concrete_powder: Оранжевый сухой бетон + orange_glazed_terracotta: Оранжевая глазурованная керамика + orange_shulker_box: Оранжевый шалкеровый ящик + orange_stained_glass: Оранжевое стекло + orange_stained_glass_pane: Оранжевая стеклянная панель + orange_terracotta: Оранжевая керамика + orange_tulip: Оранжевый тюльпан + orange_wool: Оранжевая шерсть + oxeye_daisy: Ромашка + oxidized_copper: Окисленный медный блок + oxidized_cut_copper: Окисленный резной медный блок + oxidized_cut_copper_slab: Окисленная резная медная плита + oxidized_cut_copper_stairs: Окисленные резные медные ступеньки + packed_ice: Плотный лёд + packed_mud: Плотная грязь + pearlescent_froglight: Перламутровая квампа + peony: Пион + petrified_oak_slab: Окаменевшая дубовая плита + piglin_head: Голова пиглина + piglin_wall_head: Настенная голова пиглина + pink_banner: Розовый флаг + pink_bed: Розовая кровать + pink_candle: Розовая свеча + pink_candle_cake: Торт с розовой свечой + pink_carpet: Розовый ковёр + pink_concrete: Розовый бетон + pink_concrete_powder: Розовый сухой бетон + pink_glazed_terracotta: Розовая глазурованная керамика + pink_petals: Розовые лепестки + pink_shulker_box: Розовый шалкеровый ящик + pink_stained_glass: Розовое стекло + pink_stained_glass_pane: Розовая стеклянная панель + pink_terracotta: Розовая керамика + pink_tulip: Розовый тюльпан + pink_wool: Розовая шерсть + piston: Поршень + piston_head: Головка поршня + pitcher_crop: Росток кувшинницы + pitcher_plant: Кувшинница + player_head: Голова игрока + player_wall_head: Настенная голова игрока + podzol: Подзол + pointed_dripstone: Капельник + polished_andesite: Полированный андезит + polished_andesite_slab: Плита из полированного андезита + polished_andesite_stairs: Ступеньки из полированного андезита + polished_basalt: Полированный базальт + polished_blackstone: Полированный чернит + polished_blackstone_brick_slab: Плита из полированно-чернитного кирпича + polished_blackstone_brick_stairs: Ступеньки из полированно-чернитного кирпича + polished_blackstone_brick_wall: Ограда из полированно-чернитного кирпича + polished_blackstone_bricks: Полированно-чернитные кирпичи + polished_blackstone_button: Кнопка из полированного чернита + polished_blackstone_pressure_plate: Нажимная плита из полированного чернита + polished_blackstone_slab: Плита из полированного чернита + polished_blackstone_stairs: Ступеньки из полированного чернита + polished_blackstone_wall: Ограда из полированного чернита + polished_deepslate: Полированный глубинный сланец + polished_deepslate_slab: Плита из полированного глубинного сланца + polished_deepslate_stairs: Ступеньки из полированного глубинного сланца + polished_deepslate_wall: Ограда из полированного глубинного сланца + polished_diorite: Полированный диорит + polished_diorite_slab: Плита из полированного диорита + polished_diorite_stairs: Ступеньки из полированного диорита + polished_granite: Полированный гранит + polished_granite_slab: Плита из полированного гранита + polished_granite_stairs: Ступеньки из полированного гранита + poppy: Мак + potatoes: Картофель + potted_acacia_sapling: Саженец акации в горшке + potted_allium: Лук-батун в горшке + potted_azalea_bush: Азалия в горшке + potted_azure_bluet: Хаустония серая в горшке + potted_bamboo: Бамбук в горшке + potted_birch_sapling: Саженец берёзы в горшке + potted_blue_orchid: Синяя орхидея в горшке + potted_brown_mushroom: Коричневый гриб в горшке + potted_cactus: Кактус в горшке + potted_cherry_sapling: Саженец вишни в горшке + potted_cornflower: Синий василёк в горшке + potted_crimson_fungus: Багровый гриб в горшке + potted_crimson_roots: Багровые корни в горшке + potted_dandelion: Одуванчик в горшке + potted_dark_oak_sapling: Саженец тёмного дуба в горшке + potted_dead_bush: Мёртвый куст в горшке + potted_fern: Папоротник в горшке + potted_flowering_azalea_bush: Цветущая азалия в горшке + potted_jungle_sapling: Саженец тропического дерева в горшке + potted_lily_of_the_valley: Ландыш в горшке + potted_mangrove_propagule: Мангровый отросток в горшке + potted_oak_sapling: Саженец дуба в горшке + potted_orange_tulip: Оранжевый тюльпан в горшке + potted_oxeye_daisy: Ромашка в горшке + potted_pink_tulip: Розовый тюльпан в горшке + potted_poppy: Мак в горшке + potted_red_mushroom: Красный гриб в горшке + potted_red_tulip: Красный тюльпан в горшке + potted_spruce_sapling: Саженец ели в горшке + potted_torchflower: Факельник в горшке + potted_warped_fungus: Искажённый гриб в горшке + potted_warped_roots: Искажённые корни в горшке + potted_white_tulip: Белый тюльпан в горшке + potted_wither_rose: Роза визера в горшке + powder_snow: Рыхлый снег + powder_snow_cauldron: Котёл с рыхлым снегом + powered_rail: Энергорельсы + prismarine: Призмарин + prismarine_brick_slab: Плита из призмаринового кирпича + prismarine_brick_stairs: Ступеньки из призмаринового кирпича + prismarine_bricks: Призмариновые кирпичи + prismarine_slab: Призмариновая плита + prismarine_stairs: Призмариновые ступеньки + prismarine_wall: Призмариновая ограда + pumpkin: Тыква + pumpkin_stem: Стебель тыквы + purple_banner: Фиолетовый флаг + purple_bed: Фиолетовая кровать + purple_candle: Фиолетовая свеча + purple_candle_cake: Торт с фиолетовой свечой + purple_carpet: Фиолетовый ковёр + purple_concrete: Фиолетовый бетон + purple_concrete_powder: Фиолетовый сухой бетон + purple_glazed_terracotta: Фиолетовая глазурованная керамика + purple_shulker_box: Фиолетовый шалкеровый ящик + purple_stained_glass: Фиолетовое стекло + purple_stained_glass_pane: Фиолетовая стеклянная панель + purple_terracotta: Фиолетовая керамика + purple_wool: Фиолетовая шерсть + purpur_block: Пурпур + purpur_pillar: Пурпуровый пилон + purpur_slab: Пурпуровая плита + purpur_stairs: Пурпуровые ступеньки + quartz_block: Кварцевый блок + quartz_bricks: Кварцевые кирпичи + quartz_pillar: Кварцевая колонна + quartz_slab: Кварцевая плита + quartz_stairs: Кварцевые ступеньки + rail: Рельсы + raw_copper_block: Блок рудной меди + raw_gold_block: Блок рудного золота + raw_iron_block: Блок рудного железа + red_banner: Красный флаг + red_bed: Красная кровать + red_candle: Красная свеча + red_candle_cake: Торт с красной свечой + red_carpet: Красный ковёр + red_concrete: Красный бетон + red_concrete_powder: Красный сухой бетон + red_glazed_terracotta: Красная глазурованная керамика + red_mushroom: Красный гриб + red_mushroom_block: Блок красного гриба + red_nether_brick_slab: Плита из красного незерского кирпича + red_nether_brick_stairs: Ступеньки из красного незерского кирпича + red_nether_brick_wall: Ограда из красного незерского кирпича + red_nether_bricks: Красные незерские кирпичи + red_sand: Красный песок + red_sandstone: Красный песчаник + red_sandstone_slab: Плита из красного песчаника + red_sandstone_stairs: Ступеньки из красного песчаника + red_sandstone_wall: Ограда из красного песчаника + red_shulker_box: Красный шалкеровый ящик + red_stained_glass: Красное стекло + red_stained_glass_pane: Красная стеклянная панель + red_terracotta: Красная керамика + red_tulip: Красный тюльпан + red_wool: Красная шерсть + redstone_block: Редстоуновый блок + redstone_lamp: Редстоуновый фонарь + redstone_ore: Редстоуновая руда + redstone_torch: Редстоуновый факел + redstone_wall_torch: Настенный редстоуновый факел + redstone_wire: Редстоуновый провод + reinforced_deepslate: Укреплённый глубинный сланец + repeater: Редстоуновый повторитель + repeating_command_block: Повторяющий командный блок + respawn_anchor: Якорь возрождения + rooted_dirt: Корнистая земля + rose_bush: Розовый куст + sand: Песок + sandstone: Песчаник + sandstone_slab: Песчаниковая плита + sandstone_stairs: Песчаниковые ступеньки + sandstone_wall: Песчаниковая ограда + scaffolding: Подмостки + sculk: Скалк + sculk_catalyst: Скалковый катализатор + sculk_sensor: Скалк-сенсор + sculk_shrieker: Скалковый крикун + sculk_vein: Скалковая жила + sea_lantern: Морской фонарь + sea_pickle: Морской огурец + seagrass: Морская трава + set_spawn: Точка возрождения установлена + shroomlight: Грибосвет + shulker_box: Шалкеровый ящик + skeleton_skull: Череп + skeleton_wall_skull: Настенный череп + slime_block: Блок слизи + small_amethyst_bud: Малый аметистовый бутон + small_dripleaf: Маленькая бросянка + smithing_table: Стол кузнеца + smoker: Коптильня + smooth_basalt: Гладкий базальт + smooth_quartz: Гладкий кварц + smooth_quartz_slab: Плита из гладкого кварца + smooth_quartz_stairs: Ступеньки из гладкого кварца + smooth_red_sandstone: Гладкий красный песчаник + smooth_red_sandstone_slab: Плита из гладкого красного песчаника + smooth_red_sandstone_stairs: Ступеньки из гладкого красного песчаника + smooth_sandstone: Гладкий песчаник + smooth_sandstone_slab: Плита из гладкого песчаника + smooth_sandstone_stairs: Ступеньки из гладкого песчаника + smooth_stone: Гладкий камень + smooth_stone_slab: Плита из гладкого камня + sniffer_egg: Яйцо нюхача + snow: Снег + snow_block: Блок снега + soul_campfire: Костёр душ + soul_fire: Огонь душ + soul_lantern: Фонарь душ + soul_sand: Песок душ + soul_soil: Почва душ + soul_torch: Факел душ + soul_wall_torch: Настенный факел душ + spawner: Рассадник монстров + sponge: Губка + spore_blossom: Спороцвет + spruce_button: Еловая кнопка + spruce_door: Еловая дверь + spruce_fence: Еловый забор + spruce_fence_gate: Еловая калитка + spruce_hanging_sign: Еловая подвесная табличка + spruce_leaves: Хвоя + spruce_log: Еловое бревно + spruce_planks: Еловые доски + spruce_pressure_plate: Еловая нажимная плита + spruce_sapling: Саженец ели + spruce_sign: Еловая табличка + spruce_slab: Еловая плита + spruce_stairs: Еловые ступеньки + spruce_trapdoor: Еловый люк + spruce_wall_hanging_sign: Еловая настенная подвесная табличка + spruce_wall_sign: Еловая настенная табличка + spruce_wood: Ель + sticky_piston: Липкий поршень + stone: Камень + stone_brick_slab: Плита из каменного кирпича + stone_brick_stairs: Ступеньки из каменного кирпича + stone_brick_wall: Ограда из каменного кирпича + stone_bricks: Каменные кирпичи + stone_button: Каменная кнопка + stone_pressure_plate: Каменная нажимная плита + stone_slab: Каменная плита + stone_stairs: Каменные ступеньки + stonecutter: Камнерез + stripped_acacia_log: Обтёсанное акациевое бревно + stripped_acacia_wood: Обтёсанная акациевая древесина + stripped_bamboo_block: Блок обтёсанного бамбука + stripped_birch_log: Обтёсанное берёзовое бревно + stripped_birch_wood: Обтёсанная берёзовая древесина + stripped_cherry_log: Обтёсанное вишнёвое бревно + stripped_cherry_wood: Обтёсанная вишнёвая древесина + stripped_crimson_hyphae: Очищенные багровые гифы + stripped_crimson_stem: Очищенный багровый стебель + stripped_dark_oak_log: Обтёсанное бревно тёмного дуба + stripped_dark_oak_wood: Обтёсанная древесина тёмного дуба + stripped_jungle_log: Обтёсанное бревно тропического дерева + stripped_jungle_wood: Обтёсанная тропическая древесина + stripped_mangrove_log: Обтёсанное мангровое бревно + stripped_mangrove_wood: Обтёсанная мангровая древесина + stripped_oak_log: Обтёсанное дубовое бревно + stripped_oak_wood: Обтёсанная дубовая древесина + stripped_spruce_log: Обтёсанное еловое бревно + stripped_spruce_wood: Обтёсанная еловая древесина + stripped_warped_hyphae: Очищенные искажённые гифы + stripped_warped_stem: Очищенный искажённый стебель + structure_block: Блок-конструктор + structure_void: Пустой блок + sugar_cane: Сахарный тростник + sunflower: Подсолнух + suspicious_gravel: Подозрительный гравий + suspicious_sand: Подозрительный песок + sweet_berry_bush: Куст сладких ягод + tall_grass: Высокая трава + tall_seagrass: Высокая морская трава + target: Мишень + terracotta: Терракота + tinted_glass: Тонированное стекло + tnt: Динамит + torch: Факел + torchflower: Факельник + torchflower_crop: Росток факельника + trapped_chest: Сундук-ловушка + tripwire: Растяжка + tripwire_hook: Крюк + tube_coral: Трубчатый коралл + tube_coral_block: Блок трубчатого коралла + tube_coral_fan: Веерный трубчатый коралл + tube_coral_wall_fan: Горизонтальный веерный трубчатый коралл + tuff: Туф + turtle_egg: Черепашье яйцо + twisting_vines: Вьющаяся лоза + twisting_vines_plant: Стебель вьющейся лозы + verdant_froglight: Малахитовая квампа + vine: Лианы + void_air: Вакуум + wall_torch: Настенный факел + warped_button: Искажённая кнопка + warped_door: Искажённая дверь + warped_fence: Искажённый забор + warped_fence_gate: Искажённая калитка + warped_fungus: Искажённый гриб + warped_hanging_sign: Искажённая подвесная табличка + warped_hyphae: Искажённые гифы + warped_nylium: Искажённый нилий + warped_planks: Искажённые доски + warped_pressure_plate: Искажённая нажимная плита + warped_roots: Искажённые корни + warped_sign: Искажённая табличка + warped_slab: Искажённая плита + warped_stairs: Искажённые ступеньки + warped_stem: Искажённый стебель + warped_trapdoor: Искажённый люк + warped_wall_hanging_sign: Искажённая настенная подвесная табличка + warped_wall_sign: Искажённая настенная табличка + warped_wart_block: Блок искажённого нароста + water: Вода + water_cauldron: Котёл с водой + waxed_copper_block: Вощёный медный блок + waxed_cut_copper: Вощёный резной медный блок + waxed_cut_copper_slab: Вощёная резная медная плита + waxed_cut_copper_stairs: Вощёные резные медные ступеньки + waxed_exposed_copper: Вощёный потемневший медный блок + waxed_exposed_cut_copper: Вощёный потемневший резной медный блок + waxed_exposed_cut_copper_slab: Вощёная потемневшая резная медная плита + waxed_exposed_cut_copper_stairs: Вощёные потемневшие резные медные ступеньки + waxed_oxidized_copper: Вощёный окисленный медный блок + waxed_oxidized_cut_copper: Вощёный окисленный резной медный блок + waxed_oxidized_cut_copper_slab: Вощёная окисленная резная медная плита + waxed_oxidized_cut_copper_stairs: Вощёные окисленные резные медные ступеньки + waxed_weathered_copper: Вощёный состаренный медный блок + waxed_weathered_cut_copper: Вощёный состаренный резной медный блок + waxed_weathered_cut_copper_slab: Вощёная состаренная резная медная плита + waxed_weathered_cut_copper_stairs: Вощёные состаренные резные медные ступеньки + weathered_copper: Состаренный медный блок + weathered_cut_copper: Состаренный резной медный блок + weathered_cut_copper_slab: Состаренная резная медная плита + weathered_cut_copper_stairs: Состаренные резные медные ступеньки + weeping_vines: Плакучая лоза + weeping_vines_plant: Стебель плакучей лозы + wet_sponge: Мокрая губка + wheat: Пшеница + white_banner: Белый флаг + white_bed: Белая кровать + white_candle: Белая свеча + white_candle_cake: Торт с белой свечой + white_carpet: Белый ковёр + white_concrete: Белый бетон + white_concrete_powder: Белый сухой бетон + white_glazed_terracotta: Белая глазурованная керамика + white_shulker_box: Белый шалкеровый ящик + white_stained_glass: Белое стекло + white_stained_glass_pane: Белая стеклянная панель + white_terracotta: Белая керамика + white_tulip: Белый тюльпан + white_wool: Белая шерсть + wither_rose: Роза визера + wither_skeleton_skull: Череп визер-скелета + wither_skeleton_wall_skull: Настенный череп визер-скелета + yellow_banner: Жёлтый флаг + yellow_bed: Жёлтая кровать + yellow_candle: Жёлтая свеча + yellow_candle_cake: Торт с жёлтой свечой + yellow_carpet: Жёлтый ковёр + yellow_concrete: Жёлтый бетон + yellow_concrete_powder: Жёлтый сухой бетон + yellow_glazed_terracotta: Жёлтая глазурованная керамика + yellow_shulker_box: Жёлтый шалкеровый ящик + yellow_stained_glass: Жёлтое стекло + yellow_stained_glass_pane: Жёлтая стеклянная панель + yellow_terracotta: Жёлтая керамика + yellow_wool: Жёлтая шерсть + zombie_head: Голова зомби + zombie_wall_head: Настенная голова зомби + acacia_boat: Акациевая лодка + acacia_chest_boat: Акациевая грузовая лодка + allay_spawn_egg: Яйцо призыва тихони + amethyst_shard: Осколок аметиста + angler_pottery_shard: Глиняный черепок «Рыбак» + angler_pottery_sherd: Глиняный черепок «Рыбак» + apple: Яблоко + archer_pottery_shard: Глиняный черепок «Лучник» + archer_pottery_sherd: Глиняный черепок «Лучник» + armor_stand: Стойка для брони + arms_up_pottery_shard: Глиняный черепок «Руки вверх» + arms_up_pottery_sherd: Глиняный черепок «Руки вверх» + arrow: Стрела + axolotl_bucket: Аксолотль в ведре + axolotl_spawn_egg: Яйцо призыва аксолотля + baked_potato: Печёный картофель + bamboo_chest_raft: Грузовой бамбуковый плот + bamboo_raft: Бамбуковый плот + bat_spawn_egg: Яйцо призыва летучей мыши + bee_spawn_egg: Яйцо призыва пчелы + beef: Сырая говядина + beetroot: Свёкла + beetroot_seeds: Семена свёклы + beetroot_soup: Свекольный суп + birch_boat: Берёзовая лодка + birch_chest_boat: Берёзовая грузовая лодка + black_dye: Чёрный краситель + blade_pottery_shard: Глиняный черепок «Клинок» + blade_pottery_sherd: Глиняный черепок «Клинок» + blaze_powder: Огненный порошок + blaze_rod: Огненный стержень + blaze_spawn_egg: Яйцо призыва всполоха + blue_dye: Синий краситель + bone: Кость + bone_meal: Костная мука + book: Книга + bow: Лук + bowl: Миска + bread: Хлеб + brewer_pottery_shard: Глиняный черепок «Зельевар» + brewer_pottery_sherd: Глиняный черепок «Зельевар» + brick: Кирпич + brown_dye: Коричневый краситель + brush: Кисть + bucket: Ведро + bundle: Мешок + burn_pottery_shard: Глиняный черепок «Пламя» + burn_pottery_sherd: Глиняный черепок «Пламя» + camel_spawn_egg: Яйцо призыва верблюда + carrot: Морковь + carrot_on_a_stick: Удочка с морковкой + cat_spawn_egg: Яйцо призыва кошки + cave_spider_spawn_egg: Яйцо призыва пещерного паука + chainmail_boots: Кольчужные ботинки + chainmail_chestplate: Кольчуга + chainmail_helmet: Койф + chainmail_leggings: Кольчужные поножи + charcoal: Древесный уголь + cherry_boat: Вишнёвая лодка + cherry_chest_boat: Вишнёвая грузовая лодка + chest_minecart: Грузовая вагонетка + chicken: Курятина + chicken_spawn_egg: Яйцо призыва курицы + chorus_fruit: Плод хоруса + clay_ball: Комок глины + clock: Часы + coal: Уголь + coast_armor_trim_smithing_template: Кузнечный шаблон + cocoa_beans: Какао-бобы + cod: Сырая треска + cod_bucket: Треска в ведре + cod_spawn_egg: Яйцо призыва трески + command_block_minecart: Вагонетка с командным блоком + compass: Компас + cooked_beef: Стейк + cooked_chicken: Жареная курица + cooked_cod: Жареная треска + cooked_mutton: Жареная баранина + cooked_porkchop: Жареная свинина + cooked_rabbit: Жареная крольчатина + cooked_salmon: Жареный лосось + cookie: Печенье + copper_ingot: Медный слиток + cow_spawn_egg: Яйцо призыва коровы + creeper_banner_pattern: Узор флага + creeper_spawn_egg: Яйцо призыва крипера + crossbow: Арбалет + cyan_dye: Бирюзовый краситель + danger_pottery_shard: Глиняный черепок «Угроза» + danger_pottery_sherd: Глиняный черепок «Опасность» + dark_oak_boat: Лодка из тёмного дуба + dark_oak_chest_boat: Грузовая лодка из тёмного дуба + debug_stick: Палочка отладки + diamond: Алмаз + diamond_axe: Алмазный топор + diamond_boots: Алмазные ботинки + diamond_chestplate: Алмазный нагрудник + diamond_helmet: Алмазный шлем + diamond_hoe: Алмазная мотыга + diamond_horse_armor: Алмазная конская броня + diamond_leggings: Алмазные поножи + diamond_pickaxe: Алмазная кирка + diamond_shovel: Алмазная лопата + diamond_sword: Алмазный меч + disc_fragment_5: Осколок пластинки + dolphin_spawn_egg: Яйцо призыва дельфина + donkey_spawn_egg: Яйцо призыва осла + dragon_breath: Драконье дыхание + dried_kelp: Сушёная ламинария + drowned_spawn_egg: Яйцо призыва утопленника + dune_armor_trim_smithing_template: Кузнечный шаблон + echo_shard: Осколок эха + egg: Яйцо + elder_guardian_spawn_egg: Яйцо призыва древнего стража + elytra: Элитры + emerald: Изумруд + enchanted_book: Чародейская книга + enchanted_golden_apple: Зачарованное золотое яблоко + end_crystal: Кристалл Энда + ender_dragon_spawn_egg: Яйцо призыва Эндер-дракона + ender_eye: Око Эндера + ender_pearl: Эндер-жемчуг + enderman_spawn_egg: Яйцо призыва эндермена + endermite_spawn_egg: Яйцо призыва эндермита + evoker_spawn_egg: Яйцо призыва заклинателя + experience_bottle: Пузырёк опыта + explorer_pottery_shard: Глиняный черепок «Исследователь» + explorer_pottery_sherd: Глиняный черепок «Исследователь» + eye_armor_trim_smithing_template: Кузнечный шаблон + feather: Перо + fermented_spider_eye: Маринованный паучий глаз + filled_map: Карта + fire_charge: Огненный заряд + firework_rocket: Фейерверк + firework_star: Пиротехническая звезда + fishing_rod: Удочка + flint: Кремень + flint_and_steel: Огниво + flower_banner_pattern: Узор флага + fox_spawn_egg: Яйцо призыва лисицы + friend_pottery_shard: Глиняный черепок «Друг» + friend_pottery_sherd: Глиняный черепок «Друг» + frog_spawn_egg: Яйцо призыва лягушки + furnace_minecart: Самоходная вагонетка + ghast_spawn_egg: Яйцо призыва гаста + ghast_tear: Слеза гаста + glass_bottle: Бутылочка + glistering_melon_slice: Сверкающий ломтик арбуза + globe_banner_pattern: Узор флага + glow_berries: Светящиеся ягоды + glow_ink_sac: Светящийся чернильный мешок + glow_item_frame: Светящаяся рамка + glow_squid_spawn_egg: Яйцо призыва светящегося спрута + glowstone_dust: Светокаменная пыль + goat_horn: Козий рог + goat_spawn_egg: Яйцо призыва козы + gold_ingot: Золотой слиток + gold_nugget: Кусочек золота + golden_apple: Золотое яблоко + golden_axe: Золотой топор + golden_boots: Золотые ботинки + golden_carrot: Золотая морковь + golden_chestplate: Золотой нагрудник + golden_helmet: Золотой шлем + golden_hoe: Золотая мотыга + golden_horse_armor: Золотая конская броня + golden_leggings: Золотые поножи + golden_pickaxe: Золотая кирка + golden_shovel: Золотая лопата + golden_sword: Золотой меч + gray_dye: Серый краситель + green_dye: Зелёный краситель + guardian_spawn_egg: Яйцо призыва стража + gunpowder: Порох + heart_of_the_sea: Сердце моря + heart_pottery_shard: Глиняный черепок «Сердце» + heart_pottery_sherd: Глиняный черепок «Сердце» + heartbreak_pottery_shard: Глиняный черепок «Разбитое сердце» + heartbreak_pottery_sherd: Глиняный черепок «Разбитое сердце» + hoglin_spawn_egg: Яйцо призыва хоглина + honey_bottle: Бутылочка мёда + honeycomb: Пчелиные соты + hopper_minecart: Загрузочная вагонетка + horse_spawn_egg: Яйцо призыва лошади + host_armor_trim_smithing_template: Кузнечный шаблон + howl_pottery_shard: Глиняный черепок «Вой» + howl_pottery_sherd: Глиняный черепок «Вой» + husk_spawn_egg: Яйцо призыва кадавра + ink_sac: Чернильный мешок + iron_axe: Железный топор + iron_boots: Железные ботинки + iron_chestplate: Железный нагрудник + iron_golem_spawn_egg: Яйцо призыва железного голема + iron_helmet: Железный шлем + iron_hoe: Железная мотыга + iron_horse_armor: Железная конская броня + iron_ingot: Железный слиток + iron_leggings: Железные поножи + iron_nugget: Кусочек железа + iron_pickaxe: Железная кирка + iron_shovel: Железная лопата + iron_sword: Железный меч + item_frame: Рамка + jungle_boat: Лодка из тропического дерева + jungle_chest_boat: Грузовая лодка из тропического дерева + knowledge_book: Книга знаний + lapis_lazuli: Лазурит + lava_bucket: Ведро лавы + lead: Поводок + leather: Кожа + leather_boots: Кожаные ботинки + leather_chestplate: Кожаная куртка + leather_helmet: Кожаный шлем + leather_horse_armor: Кожаная конская броня + leather_leggings: Кожаные штаны + light_blue_dye: Голубой краситель + light_gray_dye: Светло-серый краситель + lime_dye: Лаймовый краситель + lingering_potion: Туманное зелье + llama_spawn_egg: Яйцо призыва ламы + lodestone_compass: Намагниченный компас + magenta_dye: Пурпурный краситель + magma_cream: Сгусток магмы + magma_cube_spawn_egg: Яйцо призыва магмового куба + mangrove_boat: Мангровая лодка + mangrove_chest_boat: Мангровая грузовая лодка + map: Чистая карта + melon_seeds: Семена арбуза + melon_slice: Ломтик арбуза + milk_bucket: Ведро молока + minecart: Вагонетка + miner_pottery_shard: Глиняный черепок «Шахтёр» + miner_pottery_sherd: Глиняный черепок «Шахтёр» + mojang_banner_pattern: Узор флага + mooshroom_spawn_egg: Яйцо призыва муухомора + mourner_pottery_shard: Глиняный черепок «Скорбь» + mourner_pottery_sherd: Глиняный черепок «Скорбь» + mule_spawn_egg: Яйцо призыва мула + mushroom_stew: Тушёные грибы + music_disc_11: Пластинка + music_disc_13: Пластинка + music_disc_5: Пластинка + music_disc_blocks: Пластинка + music_disc_cat: Пластинка + music_disc_chirp: Пластинка + music_disc_far: Пластинка + music_disc_mall: Пластинка + music_disc_mellohi: Пластинка + music_disc_otherside: Пластинка + music_disc_pigstep: Пластинка + music_disc_relic: Пластинка + music_disc_stal: Пластинка + music_disc_strad: Пластинка + music_disc_wait: Пластинка + music_disc_ward: Пластинка + mutton: Сырая баранина + name_tag: Бирка + nautilus_shell: Раковина наутилуса + nether_brick: Незерский кирпич + nether_star: Звезда Незера + netherite_axe: Незеритовый топор + netherite_boots: Незеритовые ботинки + netherite_chestplate: Незеритовый нагрудник + netherite_helmet: Незеритовый шлем + netherite_hoe: Незеритовая мотыга + netherite_ingot: Незеритовый слиток + netherite_leggings: Незеритовые поножи + netherite_pickaxe: Незеритовая кирка + netherite_scrap: Незеритовый лом + netherite_shovel: Незеритовая лопата + netherite_sword: Незеритовый меч + netherite_upgrade_smithing_template: Кузнечный шаблон + oak_boat: Дубовая лодка + oak_chest_boat: Дубовая грузовая лодка + ocelot_spawn_egg: Яйцо призыва оцелота + orange_dye: Оранжевый краситель + painting: Картина + panda_spawn_egg: Яйцо призыва панды + paper: Бумага + parrot_spawn_egg: Яйцо призыва попугая + phantom_membrane: Мембрана фантома + phantom_spawn_egg: Яйцо призыва фантома + pig_spawn_egg: Яйцо призыва свиньи + piglin_banner_pattern: Узор флага + piglin_brute_spawn_egg: Яйцо призыва брутального пиглина + piglin_spawn_egg: Яйцо призыва пиглина + pillager_spawn_egg: Яйцо призыва разбойника + pink_dye: Розовый краситель + pitcher_pod: Стручок кувшинницы + plenty_pottery_shard: Глиняный черепок «Изобилие» + plenty_pottery_sherd: Глиняный черепок «Изобилие» + poisonous_potato: Ядовитый картофель + polar_bear_spawn_egg: Яйцо призыва белого медведя + popped_chorus_fruit: Прожаренный плод хоруса + porkchop: Сырая свинина + potato: Картофель + potion: Зелье + pottery_shard_archer: Глиняный черепок «Лучник» + pottery_shard_arms_up: Глиняный черепок «Руки вверх» + pottery_shard_prize: Глиняный черепок «Награда» + pottery_shard_skull: Глиняный черепок «Череп» + powder_snow_bucket: Ведро с рыхлым снегом + prismarine_crystals: Кристалл призмарина + prismarine_shard: Осколок призмарина + prize_pottery_shard: Глиняный черепок «Награда» + prize_pottery_sherd: Глиняный черепок «Награда» + pufferfish: Иглобрюх + pufferfish_bucket: Иглобрюх в ведре + pufferfish_spawn_egg: Яйцо призыва иглобрюха + pumpkin_pie: Тыквенный пирог + pumpkin_seeds: Семена тыквы + purple_dye: Фиолетовый краситель + quartz: Незер-кварц + rabbit: Сырая крольчатина + rabbit_foot: Кроличья лапка + rabbit_hide: Кроличья шкурка + rabbit_spawn_egg: Яйцо призыва кролика + rabbit_stew: Тушёный кролик + raiser_armor_trim_smithing_template: Кузнечный шаблон + ravager_spawn_egg: Яйцо призыва разорителя + raw_copper: Рудная медь + raw_gold: Рудное золото + raw_iron: Рудное железо + recovery_compass: Возвратный компас + red_dye: Красный краситель + redstone: Редстоуновая пыль + rib_armor_trim_smithing_template: Кузнечный шаблон + rotten_flesh: Гнилая плоть + saddle: Седло + salmon: Сырой лосось + salmon_bucket: Лосось в ведре + salmon_spawn_egg: Яйцо призыва лосося + scute: Щиток + sentry_armor_trim_smithing_template: Кузнечный шаблон + shaper_armor_trim_smithing_template: Кузнечный шаблон + sheaf_pottery_shard: Глиняный черепок «Пучок» + sheaf_pottery_sherd: Глиняный черепок «Пучок» + shears: Ножницы + sheep_spawn_egg: Яйцо призыва овцы + shelter_pottery_shard: Глиняный черепок «Дом» + shelter_pottery_sherd: Глиняный черепок «Убежище» + shield: Щит + shulker_shell: Панцирь шалкера + shulker_spawn_egg: Яйцо призыва шалкера + sign: Табличка + silence_armor_trim_smithing_template: Кузнечный шаблон + silverfish_spawn_egg: Яйцо призыва чешуйницы + skeleton_horse_spawn_egg: Яйцо призыва лошади-скелета + skeleton_spawn_egg: Яйцо призыва скелета + skull_banner_pattern: Узор флага + skull_pottery_shard: Глиняный черепок «Череп» + skull_pottery_sherd: Глиняный черепок «Череп» + slime_ball: Сгусток слизи + slime_spawn_egg: Яйцо призыва слизня + smithing_template: Кузнечный шаблон + sniffer_spawn_egg: Яйцо призыва нюхача + snort_pottery_shard: Глиняный черепок «Шмыг» + snort_pottery_sherd: Глиняный черепок «Нюхач» + snout_armor_trim_smithing_template: Кузнечный шаблон + snow_golem_spawn_egg: Яйцо призыва снежного голема + snowball: Снежок + spectral_arrow: Спектральная стрела + spider_eye: Паучий глаз + spider_spawn_egg: Яйцо призыва паука + spire_armor_trim_smithing_template: Кузнечный орнамент + splash_potion: Взрывное зелье + spruce_boat: Еловая лодка + spruce_chest_boat: Еловая грузовая лодка + spyglass: Подзорная труба + squid_spawn_egg: Яйцо призыва спрута + stick: Палка + stone_axe: Каменный топор + stone_hoe: Каменная мотыга + stone_pickaxe: Каменная кирка + stone_shovel: Каменная лопата + stone_sword: Каменный меч + stray_spawn_egg: Яйцо призыва зимогора + strider_spawn_egg: Яйцо призыва лавомерки + string: Нить + sugar: Сахар + suspicious_stew: Загадочное рагу + sweet_berries: Сладкие ягоды + tadpole_bucket: Головастик в ведре + tadpole_spawn_egg: Яйцо призыва головастика + tide_armor_trim_smithing_template: Кузнечный шаблон + tipped_arrow: Обработанная стрела + tnt_minecart: Вагонетка с динамитом + torchflower_seeds: Семена факельника + totem_of_undying: Тотем бессмертия + trader_llama_spawn_egg: Яйцо призыва ламы торговца + trident: Трезубец + tropical_fish: Тропическая рыба + tropical_fish_bucket: Тропическая рыба в ведре + tropical_fish_spawn_egg: Яйцо призыва тропической рыбы + turtle_helmet: Черепаший панцирь + turtle_spawn_egg: Яйцо призыва черепахи + vex_armor_trim_smithing_template: Шаблон Рыло + vex_spawn_egg: Яйцо призыва вредины + villager_spawn_egg: Яйцо призыва крестьянина + vindicator_spawn_egg: Яйцо призыва поборника + wandering_trader_spawn_egg: Яйцо призыва странствующего торговца + ward_armor_trim_smithing_template: Кузнечный шаблон + warden_spawn_egg: Яйцо призыва хранителя + warped_fungus_on_a_stick: Удочка с искажённым грибом + water_bucket: Ведро воды + wayfinder_armor_trim_smithing_template: Кузнечный шаблон + wheat_seeds: Семена пшеницы + white_dye: Белый краситель + wild_armor_trim_smithing_template: Кузнечный шаблон + witch_spawn_egg: Яйцо призыва ведьмы + wither_skeleton_spawn_egg: Яйцо призыва визер-скелета + wither_spawn_egg: Яйцо призыва визера + wolf_spawn_egg: Яйцо призыва волка + wooden_axe: Деревянный топор + wooden_hoe: Деревянная мотыга + wooden_pickaxe: Деревянная кирка + wooden_shovel: Деревянная лопата + wooden_sword: Деревянный меч + writable_book: Книга и перо + written_book: Завершённая книга + yellow_dye: Жёлтый краситель + zoglin_spawn_egg: Яйцо призыва зоглина + zombie_horse_spawn_egg: Яйцо призыва лошади-зомби + zombie_spawn_egg: Яйцо призыва зомби + zombie_villager_spawn_egg: Яйцо призыва крестьянина-зомби + zombified_piglin_spawn_egg: Яйцо призыва зомбифицированного пиглина +Enchantment: + aqua_affinity: Подводник + bane_of_arthropods: Бич членистоногих + binding_curse: Проклятие несъёмности + blast_protection: Взрывоустойчивость + channeling: Громовержец + depth_strider: Подводная ходьба + efficiency: Эффективность + feather_falling: Невесомость + fire_aspect: Заговор огня + fire_protection: Огнеупорность + flame: Воспламенение + fortune: Удача + frost_walker: Ледоход + impaling: Пронзатель + infinity: Бесконечность + knockback: Отдача + looting: Добыча + loyalty: Верность + luck_of_the_sea: Везучий рыбак + lure: Приманка + mending: Починка + multishot: Тройной выстрел + piercing: Пронзающая стрела + power: Сила + projectile_protection: Защита от снарядов + protection: Защита + punch: Откидывание + quick_charge: Быстрая перезарядка + respiration: Подводное дыхание + riptide: Тягун + sharpness: Острота + silk_touch: Шёлковое касание + smite: Небесная кара + soul_speed: Скорость души + sweeping: Разящий клинок + swift_sneak: Проворство + thorns: Шипы + unbreaking: Прочность + vanishing_curse: Проклятие утраты From 2bb85e32b2087dbafb0d05731d40d57779f261a0 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 1 Jan 2024 02:33:21 +0500 Subject: [PATCH 5/9] release --- .../java/su/nightexpress/nightcore/language/LangAssets.java | 2 +- .../java/su/nightexpress/nightcore/util/Placeholders.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/su/nightexpress/nightcore/language/LangAssets.java b/src/main/java/su/nightexpress/nightcore/language/LangAssets.java index f9ba9ce..04fa83b 100644 --- a/src/main/java/su/nightexpress/nightcore/language/LangAssets.java +++ b/src/main/java/su/nightexpress/nightcore/language/LangAssets.java @@ -37,7 +37,7 @@ public class LangAssets { FileUtil.create(file); - String url = "https://github.com/nulli0n/NexEngine-spigot/raw/master/assets/" + langCode + ".yml"; + String url = Placeholders.GITHUB_URL + "/raw/master/assets/" + langCode + ".yml"; try (BufferedInputStream in = new BufferedInputStream(new URL(url).openStream()); FileOutputStream fileOutputStream = new FileOutputStream(file)) { plugin.info("Downloading '" + langCode + "' assets from github..."); diff --git a/src/main/java/su/nightexpress/nightcore/util/Placeholders.java b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java index 2723c5e..fbbd1f1 100644 --- a/src/main/java/su/nightexpress/nightcore/util/Placeholders.java +++ b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java @@ -12,8 +12,8 @@ import java.util.function.UnaryOperator; public class Placeholders { - public static final String GITHUB_URL = "https://github.com/nulli0n/nightcore-spigot/"; - public static final String WIKI_MAIN_URL = GITHUB_URL + "wiki/"; + public static final String GITHUB_URL = "https://github.com/nulli0n/nightcore-spigot"; + public static final String WIKI_MAIN_URL = GITHUB_URL + "/wiki/"; public static final String WIKI_ITEMS_URL = WIKI_MAIN_URL + "Configuration-Tips#item-sections"; public static final String WIKI_LANG_URL = WIKI_MAIN_URL + "Language-Config"; From 0bbc02f65b75d94cec0d52c10cb26ef6095d8788 Mon Sep 17 00:00:00 2001 From: nulli0n <73139339+nulli0n@users.noreply.github.com> Date: Tue, 2 Jan 2024 15:05:24 +0500 Subject: [PATCH 6/9] Update README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 8b13789..03bab9f 100644 --- a/README.md +++ b/README.md @@ -1 +1,22 @@ +**nightcore** is updated version of the [NexEngine](https://github.com/nulli0n/NexEngine-spigot) utility plugin. Changes are unnoticeable for regular users. Almost all plugin's data is compatible, except Text Formations. +**Technical Changes:** +- JAR size is increased due to legacy objects, so users can use old styled data for a while. +- Reduced RAM usage by various objects. +- Optimized and improved code where possible. +- Prepare to use Spigot TextComponents where possible with custom text + tags parser. +- Getting rid of unnecessary regex usage (Tab Completer, Text Parsing, Language Messages, Command Flags). +- Many packages, classes and methods renamed/relocated so they makes more sense. +- Removed useless code. + +**Features:** +* Internal command & permission registration (without usage of plugin.yml). +* Easily create plugin commands with support of sub-commands and custom flags \[-f\]. +* Easily manage plugin configurations with auto-generated config files, and a single method to read, write and add configuration key-value. +* Easily manage plugin language with auto-generated lang files, support for multiple language configs, and great message customization (JSON, action bar, titles, sounds, prefix). +* Easily create custom GUIs with auto-generated config files and flexible menu items. +* Easily manage SQL data with query and column builders. +* Various wrappers for better handling bukkit and java objects. +* Utility classes with a wide set of frequently used methods. +* Custom text & tag parser. Get rid of those 'magic' colors: `&1&2&3`. +* Improved `Random` class with better random generation. From c9e388a133ec5ecf75a81ed0f9ec7f9b0657f4e9 Mon Sep 17 00:00:00 2001 From: nulli0n <73139339+nulli0n@users.noreply.github.com> Date: Tue, 2 Jan 2024 15:51:53 +0500 Subject: [PATCH 7/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03bab9f..0af1412 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**nightcore** is updated version of the [NexEngine](https://github.com/nulli0n/NexEngine-spigot) utility plugin. Changes are unnoticeable for regular users. Almost all plugin's data is compatible, except Text Formations. +**nightcore** is updated version of the [NexEngine](https://github.com/nulli0n/NexEngine-spigot) utility plugin. Changes are unnoticeable for regular users. Almost all plugin's data is compatible, except [Text Formations](https://github.com/nulli0n/nightcore-spigot/wiki/Text-Formation). **Technical Changes:** - JAR size is increased due to legacy objects, so users can use old styled data for a while. From 2b20221a1b5a20ba19e70574d76dda875931c870 Mon Sep 17 00:00:00 2001 From: nulli0n <73139339+nulli0n@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:37:18 +0500 Subject: [PATCH 8/9] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 0af1412..f5983e3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ +

+

nightcore

+

+✅ Minimal server version: 1.18.2
+✅ Supported software: Spigot, Paper, Pufferfish, Purpur.
+❌ Not available for Aternos and modded servers.
+
+When installed, make sure to check out the /nightcore/ folder and edit language and config files. +

+
+
+ **nightcore** is updated version of the [NexEngine](https://github.com/nulli0n/NexEngine-spigot) utility plugin. Changes are unnoticeable for regular users. Almost all plugin's data is compatible, except [Text Formations](https://github.com/nulli0n/nightcore-spigot/wiki/Text-Formation). **Technical Changes:** From 2c872e8e6db530f0aaeade24a9c17fbca701373f Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 2 Jan 2024 16:50:20 +0500 Subject: [PATCH 9/9] release --- src/main/java/su/nightexpress/nightcore/util/Placeholders.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/su/nightexpress/nightcore/util/Placeholders.java b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java index fbbd1f1..50b4deb 100644 --- a/src/main/java/su/nightexpress/nightcore/util/Placeholders.java +++ b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java @@ -15,7 +15,8 @@ public class Placeholders { public static final String GITHUB_URL = "https://github.com/nulli0n/nightcore-spigot"; public static final String WIKI_MAIN_URL = GITHUB_URL + "/wiki/"; public static final String WIKI_ITEMS_URL = WIKI_MAIN_URL + "Configuration-Tips#item-sections"; - public static final String WIKI_LANG_URL = WIKI_MAIN_URL + "Language-Config"; + public static final String WIKI_TEXT_URL = WIKI_MAIN_URL + "Text-Formation"; + public static final String WIKI_LANG_URL = WIKI_MAIN_URL + "Language-Formation"; public static final String DEFAULT = "default"; public static final String NONE = "none";