commit 1ff1774b1c017babed7bedd192d5cc5b9d104100 Author: Alexander Medvedev Date: Wed Apr 29 12:57:22 2026 +0200 first commit diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8c10b5b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "wit/repo"] + path = wit/repo + url = https://github.com/Pumpkin-MC/Pumpkin.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..979f4b9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,677 @@ + 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 international 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 modifying 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 the + Corresponding Source is located. 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 if 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 surcharge for exercising rights granted under this +License, and you may not impose any (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 any recipient 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/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..e0d3378 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/PumpkinApi.csproj b/PumpkinApi.csproj new file mode 100644 index 0000000..01e3af1 --- /dev/null +++ b/PumpkinApi.csproj @@ -0,0 +1,27 @@ + + + + net10.0 + enable + enable + 12.0 + true + + $(NoWarn);CS0169;CS0649;CS8618 + + + PumpkinMC.PumpkinApi + 0.1.0-dev + PumpkinMC Contributors + Pumpkin server plugin API bindings for C# (.NET) + https://github.com/Pumpkin-MC/pumpkin-api-cs + git + GPL-3.0-or-later + README.md + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d17f425 --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +# Pumpkin Plugin API for C# (.NET) + +This package provides everything needed to write a Pumpkin server plugin compiled to WebAssembly using C# (.NET 10+). + +## Quick start + +1. Create a new C# Class Library project for your plugin: + ```bash + dotnet new classlib -n MyPumpkinPlugin + cd MyPumpkinPlugin + ``` + +2. Add a `NuGet.Config` to your project to include the .NET experimental feed: + ```xml + + + + + + + ``` + +3. Add the required packages: + ```bash + dotnet add package PumpkinMC.PumpkinApi + dotnet add package ByteCodeAlliance.Componentize.DotNet.Wasm.SDK --prerelease + ``` + +4. Configure your `.csproj` to target `wasi-wasm`: + ```xml + + net10.0 + wasi-wasm + + ``` + +5. Implement your plugin by implementing the interfaces from the package (e.g., `PluginWorld.IPluginWorldExports` and `PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.IMetadataExports`). + +```csharp +using PluginWorld; +using PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0; +using PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +namespace MyPumpkinPlugin; + +public class MyPlugin : IPluginWorldExports, IMetadataExports +{ + public static void InitPlugin() { } + + public static void OnLoad(IContextImports.Context context) + { + ILoggingImports.Log(ILoggingImports.Level.Info, "C# plugin loaded!"); + } + + public static void OnUnload(IContextImports.Context context) { } + + public static IEventImports.Event HandleEvent(uint eventId, IServerImports.Server server, IEventImports.Event @event) + { + return @event; + } + + public static int HandleCommand(uint commandId, ICommandImports.CommandSender sender, IServerImports.Server server, ICommandImports.ConsumedArgs args) + { + return 0; + } + + public static void HandleTask(uint handlerId, IServerImports.Server server) { } + + public static IMetadataExports.PluginMetadata Metadata() + { + return new IMetadataExports.PluginMetadata( + "my-csharp-plugin", + "0.1.0", + "An example C# plugin.", + ["you"], + [] + ); + } +} +``` + +5. Build your plugin into a WebAssembly component: + +```bash +dotnet build -c Release +``` + +The output will contain a `.wasm` file that you can use in your Pumpkin server. diff --git a/bin/Release/PumpkinMC.PumpkinApi.0.1.0-dev.nupkg b/bin/Release/PumpkinMC.PumpkinApi.0.1.0-dev.nupkg new file mode 100644 index 0000000..ebefe58 Binary files /dev/null and b/bin/Release/PumpkinMC.PumpkinApi.0.1.0-dev.nupkg differ diff --git a/bin/Release/net10.0/PumpkinApi.deps.json b/bin/Release/net10.0/PumpkinApi.deps.json new file mode 100644 index 0000000..0870a11 --- /dev/null +++ b/bin/Release/net10.0/PumpkinApi.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v10.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v10.0": { + "PumpkinApi/0.1.0-dev": { + "runtime": { + "PumpkinApi.dll": {} + } + } + } + }, + "libraries": { + "PumpkinApi/0.1.0-dev": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/bin/Release/net10.0/PumpkinApi.dll b/bin/Release/net10.0/PumpkinApi.dll new file mode 100644 index 0000000..383f1c1 Binary files /dev/null and b/bin/Release/net10.0/PumpkinApi.dll differ diff --git a/bin/Release/net10.0/PumpkinApi.pdb b/bin/Release/net10.0/PumpkinApi.pdb new file mode 100644 index 0000000..69b617a Binary files /dev/null and b/bin/Release/net10.0/PumpkinApi.pdb differ diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..5386d43 --- /dev/null +++ b/generate.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Ensure the submodule is initialized +git submodule update --init + +# Generate the C# bindings +mkdir -p src/gen +wit-bindgen csharp --runtime native-aot --out-dir src/gen -w plugin wit/repo/pumpkin-plugin-wit/v0.1 + +echo "Bindings generated successfully in src/gen/" diff --git a/obj/PumpkinApi.csproj.nuget.dgspec.json b/obj/PumpkinApi.csproj.nuget.dgspec.json new file mode 100644 index 0000000..3bdbff0 --- /dev/null +++ b/obj/PumpkinApi.csproj.nuget.dgspec.json @@ -0,0 +1,349 @@ +{ + "format": 1, + "restore": { + "/home/alex/Documents/Development/Rust/pumpkin-api-cs/PumpkinApi.csproj": {} + }, + "projects": { + "/home/alex/Documents/Development/Rust/pumpkin-api-cs/PumpkinApi.csproj": { + "version": "0.1.0-dev", + "restore": { + "projectUniqueName": "/home/alex/Documents/Development/Rust/pumpkin-api-cs/PumpkinApi.csproj", + "projectName": "PumpkinMC.PumpkinApi", + "projectPath": "/home/alex/Documents/Development/Rust/pumpkin-api-cs/PumpkinApi.csproj", + "packagesPath": "/home/alex/.nuget/packages/", + "outputPath": "/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/alex/Documents/Development/Rust/pumpkin-api-cs/NuGet.Config", + "/home/alex/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net10.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {}, + "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json": {} + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "all" + }, + "SdkAnalysisLevel": "10.0.100" + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[10.0.4, 10.0.4]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/10.0.104/PortableRuntimeIdentifierGraph.json", + "packagesToPrune": { + "Microsoft.CSharp": "(,4.7.32767]", + "Microsoft.VisualBasic": "(,10.4.32767]", + "Microsoft.Win32.Primitives": "(,4.3.32767]", + "Microsoft.Win32.Registry": "(,5.0.32767]", + "runtime.any.System.Collections": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.any.System.Globalization": "(,4.3.32767]", + "runtime.any.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.any.System.IO": "(,4.3.32767]", + "runtime.any.System.Reflection": "(,4.3.32767]", + "runtime.any.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.any.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.any.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.any.System.Runtime": "(,4.3.32767]", + "runtime.any.System.Runtime.Handles": "(,4.3.32767]", + "runtime.any.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.any.System.Text.Encoding": "(,4.3.32767]", + "runtime.any.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.any.System.Threading.Tasks": "(,4.3.32767]", + "runtime.any.System.Threading.Timer": "(,4.3.32767]", + "runtime.aot.System.Collections": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.aot.System.Globalization": "(,4.3.32767]", + "runtime.aot.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.aot.System.IO": "(,4.3.32767]", + "runtime.aot.System.Reflection": "(,4.3.32767]", + "runtime.aot.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.aot.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.aot.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.aot.System.Runtime": "(,4.3.32767]", + "runtime.aot.System.Runtime.Handles": "(,4.3.32767]", + "runtime.aot.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.aot.System.Threading.Tasks": "(,4.3.32767]", + "runtime.aot.System.Threading.Timer": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.unix.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.unix.System.Console": "(,4.3.32767]", + "runtime.unix.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.unix.System.IO.FileSystem": "(,4.3.32767]", + "runtime.unix.System.Net.Primitives": "(,4.3.32767]", + "runtime.unix.System.Net.Sockets": "(,4.3.32767]", + "runtime.unix.System.Private.Uri": "(,4.3.32767]", + "runtime.unix.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.win.System.Console": "(,4.3.32767]", + "runtime.win.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.win.System.IO.FileSystem": "(,4.3.32767]", + "runtime.win.System.Net.Primitives": "(,4.3.32767]", + "runtime.win.System.Net.Sockets": "(,4.3.32767]", + "runtime.win.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win10-arm-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-arm64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win10-x64-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-x86-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7-x86.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7.System.Private.Uri": "(,4.3.32767]", + "runtime.win8-arm.runtime.native.System.IO.Compression": "(,4.3.32767]", + "System.AppContext": "(,4.3.32767]", + "System.Buffers": "(,5.0.32767]", + "System.Collections": "(,4.3.32767]", + "System.Collections.Concurrent": "(,4.3.32767]", + "System.Collections.Immutable": "(,10.0.32767]", + "System.Collections.NonGeneric": "(,4.3.32767]", + "System.Collections.Specialized": "(,4.3.32767]", + "System.ComponentModel": "(,4.3.32767]", + "System.ComponentModel.Annotations": "(,4.3.32767]", + "System.ComponentModel.EventBasedAsync": "(,4.3.32767]", + "System.ComponentModel.Primitives": "(,4.3.32767]", + "System.ComponentModel.TypeConverter": "(,4.3.32767]", + "System.Console": "(,4.3.32767]", + "System.Data.Common": "(,4.3.32767]", + "System.Data.DataSetExtensions": "(,4.4.32767]", + "System.Diagnostics.Contracts": "(,4.3.32767]", + "System.Diagnostics.Debug": "(,4.3.32767]", + "System.Diagnostics.DiagnosticSource": "(,10.0.32767]", + "System.Diagnostics.FileVersionInfo": "(,4.3.32767]", + "System.Diagnostics.Process": "(,4.3.32767]", + "System.Diagnostics.StackTrace": "(,4.3.32767]", + "System.Diagnostics.TextWriterTraceListener": "(,4.3.32767]", + "System.Diagnostics.Tools": "(,4.3.32767]", + "System.Diagnostics.TraceSource": "(,4.3.32767]", + "System.Diagnostics.Tracing": "(,4.3.32767]", + "System.Drawing.Primitives": "(,4.3.32767]", + "System.Dynamic.Runtime": "(,4.3.32767]", + "System.Formats.Asn1": "(,10.0.32767]", + "System.Formats.Tar": "(,10.0.32767]", + "System.Globalization": "(,4.3.32767]", + "System.Globalization.Calendars": "(,4.3.32767]", + "System.Globalization.Extensions": "(,4.3.32767]", + "System.IO": "(,4.3.32767]", + "System.IO.Compression": "(,4.3.32767]", + "System.IO.Compression.ZipFile": "(,4.3.32767]", + "System.IO.FileSystem": "(,4.3.32767]", + "System.IO.FileSystem.AccessControl": "(,4.4.32767]", + "System.IO.FileSystem.DriveInfo": "(,4.3.32767]", + "System.IO.FileSystem.Primitives": "(,4.3.32767]", + "System.IO.FileSystem.Watcher": "(,4.3.32767]", + "System.IO.IsolatedStorage": "(,4.3.32767]", + "System.IO.MemoryMappedFiles": "(,4.3.32767]", + "System.IO.Pipelines": "(,10.0.32767]", + "System.IO.Pipes": "(,4.3.32767]", + "System.IO.Pipes.AccessControl": "(,5.0.32767]", + "System.IO.UnmanagedMemoryStream": "(,4.3.32767]", + "System.Linq": "(,4.3.32767]", + "System.Linq.AsyncEnumerable": "(,10.0.32767]", + "System.Linq.Expressions": "(,4.3.32767]", + "System.Linq.Parallel": "(,4.3.32767]", + "System.Linq.Queryable": "(,4.3.32767]", + "System.Memory": "(,5.0.32767]", + "System.Net.Http": "(,4.3.32767]", + "System.Net.Http.Json": "(,10.0.32767]", + "System.Net.NameResolution": "(,4.3.32767]", + "System.Net.NetworkInformation": "(,4.3.32767]", + "System.Net.Ping": "(,4.3.32767]", + "System.Net.Primitives": "(,4.3.32767]", + "System.Net.Requests": "(,4.3.32767]", + "System.Net.Security": "(,4.3.32767]", + "System.Net.ServerSentEvents": "(,10.0.32767]", + "System.Net.Sockets": "(,4.3.32767]", + "System.Net.WebHeaderCollection": "(,4.3.32767]", + "System.Net.WebSockets": "(,4.3.32767]", + "System.Net.WebSockets.Client": "(,4.3.32767]", + "System.Numerics.Vectors": "(,5.0.32767]", + "System.ObjectModel": "(,4.3.32767]", + "System.Private.DataContractSerialization": "(,4.3.32767]", + "System.Private.Uri": "(,4.3.32767]", + "System.Reflection": "(,4.3.32767]", + "System.Reflection.DispatchProxy": "(,6.0.32767]", + "System.Reflection.Emit": "(,4.7.32767]", + "System.Reflection.Emit.ILGeneration": "(,4.7.32767]", + "System.Reflection.Emit.Lightweight": "(,4.7.32767]", + "System.Reflection.Extensions": "(,4.3.32767]", + "System.Reflection.Metadata": "(,10.0.32767]", + "System.Reflection.Primitives": "(,4.3.32767]", + "System.Reflection.TypeExtensions": "(,4.3.32767]", + "System.Resources.Reader": "(,4.3.32767]", + "System.Resources.ResourceManager": "(,4.3.32767]", + "System.Resources.Writer": "(,4.3.32767]", + "System.Runtime": "(,4.3.32767]", + "System.Runtime.CompilerServices.Unsafe": "(,7.0.32767]", + "System.Runtime.CompilerServices.VisualC": "(,4.3.32767]", + "System.Runtime.Extensions": "(,4.3.32767]", + "System.Runtime.Handles": "(,4.3.32767]", + "System.Runtime.InteropServices": "(,4.3.32767]", + "System.Runtime.InteropServices.RuntimeInformation": "(,4.3.32767]", + "System.Runtime.Loader": "(,4.3.32767]", + "System.Runtime.Numerics": "(,4.3.32767]", + "System.Runtime.Serialization.Formatters": "(,4.3.32767]", + "System.Runtime.Serialization.Json": "(,4.3.32767]", + "System.Runtime.Serialization.Primitives": "(,4.3.32767]", + "System.Runtime.Serialization.Xml": "(,4.3.32767]", + "System.Security.AccessControl": "(,6.0.32767]", + "System.Security.Claims": "(,4.3.32767]", + "System.Security.Cryptography.Algorithms": "(,4.3.32767]", + "System.Security.Cryptography.Cng": "(,5.0.32767]", + "System.Security.Cryptography.Csp": "(,4.3.32767]", + "System.Security.Cryptography.Encoding": "(,4.3.32767]", + "System.Security.Cryptography.OpenSsl": "(,5.0.32767]", + "System.Security.Cryptography.Primitives": "(,4.3.32767]", + "System.Security.Cryptography.X509Certificates": "(,4.3.32767]", + "System.Security.Principal": "(,4.3.32767]", + "System.Security.Principal.Windows": "(,5.0.32767]", + "System.Security.SecureString": "(,4.3.32767]", + "System.Text.Encoding": "(,4.3.32767]", + "System.Text.Encoding.CodePages": "(,10.0.32767]", + "System.Text.Encoding.Extensions": "(,4.3.32767]", + "System.Text.Encodings.Web": "(,10.0.32767]", + "System.Text.Json": "(,10.0.32767]", + "System.Text.RegularExpressions": "(,4.3.32767]", + "System.Threading": "(,4.3.32767]", + "System.Threading.AccessControl": "(,10.0.32767]", + "System.Threading.Channels": "(,10.0.32767]", + "System.Threading.Overlapped": "(,4.3.32767]", + "System.Threading.Tasks": "(,4.3.32767]", + "System.Threading.Tasks.Dataflow": "(,10.0.32767]", + "System.Threading.Tasks.Extensions": "(,5.0.32767]", + "System.Threading.Tasks.Parallel": "(,4.3.32767]", + "System.Threading.Thread": "(,4.3.32767]", + "System.Threading.ThreadPool": "(,4.3.32767]", + "System.Threading.Timer": "(,4.3.32767]", + "System.ValueTuple": "(,4.5.32767]", + "System.Xml.ReaderWriter": "(,4.3.32767]", + "System.Xml.XDocument": "(,4.3.32767]", + "System.Xml.XmlDocument": "(,4.3.32767]", + "System.Xml.XmlSerializer": "(,4.3.32767]", + "System.Xml.XPath": "(,4.3.32767]", + "System.Xml.XPath.XDocument": "(,5.0.32767]" + } + } + } + } + } +} \ No newline at end of file diff --git a/obj/PumpkinApi.csproj.nuget.g.props b/obj/PumpkinApi.csproj.nuget.g.props new file mode 100644 index 0000000..1c6c18f --- /dev/null +++ b/obj/PumpkinApi.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/alex/.nuget/packages/ + /home/alex/.nuget/packages/ + PackageReference + 7.0.0 + + + + + \ No newline at end of file diff --git a/obj/PumpkinApi.csproj.nuget.g.targets b/obj/PumpkinApi.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/obj/PumpkinApi.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/obj/Release/PumpkinMC.PumpkinApi.0.1.0-dev.nuspec b/obj/Release/PumpkinMC.PumpkinApi.0.1.0-dev.nuspec new file mode 100644 index 0000000..bc9f3dd --- /dev/null +++ b/obj/Release/PumpkinMC.PumpkinApi.0.1.0-dev.nuspec @@ -0,0 +1,20 @@ + + + + PumpkinMC.PumpkinApi + 0.1.0-dev + PumpkinMC Contributors + GPL-3.0-or-later + https://licenses.nuget.org/GPL-3.0-or-later + README.md + Pumpkin server plugin API bindings for C# (.NET) + + + + + + + + + + \ No newline at end of file diff --git a/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs b/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs new file mode 100644 index 0000000..925b135 --- /dev/null +++ b/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")] diff --git a/obj/Release/net10.0/PumpkinApi.AssemblyInfo.cs b/obj/Release/net10.0/PumpkinApi.AssemblyInfo.cs new file mode 100644 index 0000000..2f18405 --- /dev/null +++ b/obj/Release/net10.0/PumpkinApi.AssemblyInfo.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("PumpkinMC Contributors")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] +[assembly: System.Reflection.AssemblyDescriptionAttribute("Pumpkin server plugin API bindings for C# (.NET)")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.1.0-dev")] +[assembly: System.Reflection.AssemblyProductAttribute("PumpkinApi")] +[assembly: System.Reflection.AssemblyTitleAttribute("PumpkinApi")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/Pumpkin-MC/pumpkin-api-cs")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/obj/Release/net10.0/PumpkinApi.AssemblyInfoInputs.cache b/obj/Release/net10.0/PumpkinApi.AssemblyInfoInputs.cache new file mode 100644 index 0000000..f5a4b74 --- /dev/null +++ b/obj/Release/net10.0/PumpkinApi.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +200d64c1b82f7a6396630e55162364d9d715146da5ee00ace6806cd51a4441a9 diff --git a/obj/Release/net10.0/PumpkinApi.GeneratedMSBuildEditorConfig.editorconfig b/obj/Release/net10.0/PumpkinApi.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..54cbc2c --- /dev/null +++ b/obj/Release/net10.0/PumpkinApi.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,17 @@ +is_global = true +build_property.TargetFramework = net10.0 +build_property.TargetFrameworkIdentifier = .NETCoreApp +build_property.TargetFrameworkVersion = v10.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = PumpkinApi +build_property.ProjectDir = /home/alex/Documents/Development/Rust/pumpkin-api-cs/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 10.0 +build_property.EnableCodeStyleSeverity = diff --git a/obj/Release/net10.0/PumpkinApi.GlobalUsings.g.cs b/obj/Release/net10.0/PumpkinApi.GlobalUsings.g.cs new file mode 100644 index 0000000..d12bcbc --- /dev/null +++ b/obj/Release/net10.0/PumpkinApi.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using System; +global using System.Collections.Generic; +global using System.IO; +global using System.Linq; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; diff --git a/obj/Release/net10.0/PumpkinApi.assets.cache b/obj/Release/net10.0/PumpkinApi.assets.cache new file mode 100644 index 0000000..601fc40 Binary files /dev/null and b/obj/Release/net10.0/PumpkinApi.assets.cache differ diff --git a/obj/Release/net10.0/PumpkinApi.csproj.CoreCompileInputs.cache b/obj/Release/net10.0/PumpkinApi.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7bbc2c7 --- /dev/null +++ b/obj/Release/net10.0/PumpkinApi.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +eabf36b0f657105612c32ab100916f90b2229089c54ecb8d86432c8011e96e8d diff --git a/obj/Release/net10.0/PumpkinApi.csproj.FileListAbsolute.txt b/obj/Release/net10.0/PumpkinApi.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..ea96326 --- /dev/null +++ b/obj/Release/net10.0/PumpkinApi.csproj.FileListAbsolute.txt @@ -0,0 +1,12 @@ +/home/alex/Documents/Development/Rust/pumpkin-api-cs/bin/Release/net10.0/PumpkinApi.deps.json +/home/alex/Documents/Development/Rust/pumpkin-api-cs/bin/Release/net10.0/PumpkinApi.dll +/home/alex/Documents/Development/Rust/pumpkin-api-cs/bin/Release/net10.0/PumpkinApi.pdb +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/PumpkinApi.GeneratedMSBuildEditorConfig.editorconfig +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/PumpkinApi.AssemblyInfoInputs.cache +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/PumpkinApi.AssemblyInfo.cs +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/PumpkinApi.csproj.CoreCompileInputs.cache +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/PumpkinApi.sourcelink.json +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/PumpkinApi.dll +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/refint/PumpkinApi.dll +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/PumpkinApi.pdb +/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/Release/net10.0/ref/PumpkinApi.dll diff --git a/obj/Release/net10.0/PumpkinApi.dll b/obj/Release/net10.0/PumpkinApi.dll new file mode 100644 index 0000000..383f1c1 Binary files /dev/null and b/obj/Release/net10.0/PumpkinApi.dll differ diff --git a/obj/Release/net10.0/PumpkinApi.pdb b/obj/Release/net10.0/PumpkinApi.pdb new file mode 100644 index 0000000..69b617a Binary files /dev/null and b/obj/Release/net10.0/PumpkinApi.pdb differ diff --git a/obj/Release/net10.0/PumpkinApi.sourcelink.json b/obj/Release/net10.0/PumpkinApi.sourcelink.json new file mode 100644 index 0000000..c3110f6 --- /dev/null +++ b/obj/Release/net10.0/PumpkinApi.sourcelink.json @@ -0,0 +1 @@ +{"documents":{"/home/alex/Documents/Development/Rust/pumpkin-api-cs/wit/repo/*":"https://raw.githubusercontent.com/Pumpkin-MC/Pumpkin/6f2c3cd5e37a3c39e1e5f27c1300d31bd97fe936/*"}} \ No newline at end of file diff --git a/obj/Release/net10.0/ref/PumpkinApi.dll b/obj/Release/net10.0/ref/PumpkinApi.dll new file mode 100644 index 0000000..99db318 Binary files /dev/null and b/obj/Release/net10.0/ref/PumpkinApi.dll differ diff --git a/obj/Release/net10.0/refint/PumpkinApi.dll b/obj/Release/net10.0/refint/PumpkinApi.dll new file mode 100644 index 0000000..99db318 Binary files /dev/null and b/obj/Release/net10.0/refint/PumpkinApi.dll differ diff --git a/obj/project.assets.json b/obj/project.assets.json new file mode 100644 index 0000000..682072e --- /dev/null +++ b/obj/project.assets.json @@ -0,0 +1,354 @@ +{ + "version": 3, + "targets": { + "net10.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net10.0": [] + }, + "packageFolders": { + "/home/alex/.nuget/packages/": {} + }, + "project": { + "version": "0.1.0-dev", + "restore": { + "projectUniqueName": "/home/alex/Documents/Development/Rust/pumpkin-api-cs/PumpkinApi.csproj", + "projectName": "PumpkinMC.PumpkinApi", + "projectPath": "/home/alex/Documents/Development/Rust/pumpkin-api-cs/PumpkinApi.csproj", + "packagesPath": "/home/alex/.nuget/packages/", + "outputPath": "/home/alex/Documents/Development/Rust/pumpkin-api-cs/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/alex/Documents/Development/Rust/pumpkin-api-cs/NuGet.Config", + "/home/alex/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net10.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {}, + "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json": {} + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "all" + }, + "SdkAnalysisLevel": "10.0.100" + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[10.0.4, 10.0.4]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/10.0.104/PortableRuntimeIdentifierGraph.json", + "packagesToPrune": { + "Microsoft.CSharp": "(,4.7.32767]", + "Microsoft.VisualBasic": "(,10.4.32767]", + "Microsoft.Win32.Primitives": "(,4.3.32767]", + "Microsoft.Win32.Registry": "(,5.0.32767]", + "runtime.any.System.Collections": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.any.System.Globalization": "(,4.3.32767]", + "runtime.any.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.any.System.IO": "(,4.3.32767]", + "runtime.any.System.Reflection": "(,4.3.32767]", + "runtime.any.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.any.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.any.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.any.System.Runtime": "(,4.3.32767]", + "runtime.any.System.Runtime.Handles": "(,4.3.32767]", + "runtime.any.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.any.System.Text.Encoding": "(,4.3.32767]", + "runtime.any.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.any.System.Threading.Tasks": "(,4.3.32767]", + "runtime.any.System.Threading.Timer": "(,4.3.32767]", + "runtime.aot.System.Collections": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.aot.System.Globalization": "(,4.3.32767]", + "runtime.aot.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.aot.System.IO": "(,4.3.32767]", + "runtime.aot.System.Reflection": "(,4.3.32767]", + "runtime.aot.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.aot.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.aot.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.aot.System.Runtime": "(,4.3.32767]", + "runtime.aot.System.Runtime.Handles": "(,4.3.32767]", + "runtime.aot.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.aot.System.Threading.Tasks": "(,4.3.32767]", + "runtime.aot.System.Threading.Timer": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.unix.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.unix.System.Console": "(,4.3.32767]", + "runtime.unix.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.unix.System.IO.FileSystem": "(,4.3.32767]", + "runtime.unix.System.Net.Primitives": "(,4.3.32767]", + "runtime.unix.System.Net.Sockets": "(,4.3.32767]", + "runtime.unix.System.Private.Uri": "(,4.3.32767]", + "runtime.unix.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.win.System.Console": "(,4.3.32767]", + "runtime.win.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.win.System.IO.FileSystem": "(,4.3.32767]", + "runtime.win.System.Net.Primitives": "(,4.3.32767]", + "runtime.win.System.Net.Sockets": "(,4.3.32767]", + "runtime.win.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win10-arm-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-arm64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win10-x64-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-x86-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7-x86.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7.System.Private.Uri": "(,4.3.32767]", + "runtime.win8-arm.runtime.native.System.IO.Compression": "(,4.3.32767]", + "System.AppContext": "(,4.3.32767]", + "System.Buffers": "(,5.0.32767]", + "System.Collections": "(,4.3.32767]", + "System.Collections.Concurrent": "(,4.3.32767]", + "System.Collections.Immutable": "(,10.0.32767]", + "System.Collections.NonGeneric": "(,4.3.32767]", + "System.Collections.Specialized": "(,4.3.32767]", + "System.ComponentModel": "(,4.3.32767]", + "System.ComponentModel.Annotations": "(,4.3.32767]", + "System.ComponentModel.EventBasedAsync": "(,4.3.32767]", + "System.ComponentModel.Primitives": "(,4.3.32767]", + "System.ComponentModel.TypeConverter": "(,4.3.32767]", + "System.Console": "(,4.3.32767]", + "System.Data.Common": "(,4.3.32767]", + "System.Data.DataSetExtensions": "(,4.4.32767]", + "System.Diagnostics.Contracts": "(,4.3.32767]", + "System.Diagnostics.Debug": "(,4.3.32767]", + "System.Diagnostics.DiagnosticSource": "(,10.0.32767]", + "System.Diagnostics.FileVersionInfo": "(,4.3.32767]", + "System.Diagnostics.Process": "(,4.3.32767]", + "System.Diagnostics.StackTrace": "(,4.3.32767]", + "System.Diagnostics.TextWriterTraceListener": "(,4.3.32767]", + "System.Diagnostics.Tools": "(,4.3.32767]", + "System.Diagnostics.TraceSource": "(,4.3.32767]", + "System.Diagnostics.Tracing": "(,4.3.32767]", + "System.Drawing.Primitives": "(,4.3.32767]", + "System.Dynamic.Runtime": "(,4.3.32767]", + "System.Formats.Asn1": "(,10.0.32767]", + "System.Formats.Tar": "(,10.0.32767]", + "System.Globalization": "(,4.3.32767]", + "System.Globalization.Calendars": "(,4.3.32767]", + "System.Globalization.Extensions": "(,4.3.32767]", + "System.IO": "(,4.3.32767]", + "System.IO.Compression": "(,4.3.32767]", + "System.IO.Compression.ZipFile": "(,4.3.32767]", + "System.IO.FileSystem": "(,4.3.32767]", + "System.IO.FileSystem.AccessControl": "(,4.4.32767]", + "System.IO.FileSystem.DriveInfo": "(,4.3.32767]", + "System.IO.FileSystem.Primitives": "(,4.3.32767]", + "System.IO.FileSystem.Watcher": "(,4.3.32767]", + "System.IO.IsolatedStorage": "(,4.3.32767]", + "System.IO.MemoryMappedFiles": "(,4.3.32767]", + "System.IO.Pipelines": "(,10.0.32767]", + "System.IO.Pipes": "(,4.3.32767]", + "System.IO.Pipes.AccessControl": "(,5.0.32767]", + "System.IO.UnmanagedMemoryStream": "(,4.3.32767]", + "System.Linq": "(,4.3.32767]", + "System.Linq.AsyncEnumerable": "(,10.0.32767]", + "System.Linq.Expressions": "(,4.3.32767]", + "System.Linq.Parallel": "(,4.3.32767]", + "System.Linq.Queryable": "(,4.3.32767]", + "System.Memory": "(,5.0.32767]", + "System.Net.Http": "(,4.3.32767]", + "System.Net.Http.Json": "(,10.0.32767]", + "System.Net.NameResolution": "(,4.3.32767]", + "System.Net.NetworkInformation": "(,4.3.32767]", + "System.Net.Ping": "(,4.3.32767]", + "System.Net.Primitives": "(,4.3.32767]", + "System.Net.Requests": "(,4.3.32767]", + "System.Net.Security": "(,4.3.32767]", + "System.Net.ServerSentEvents": "(,10.0.32767]", + "System.Net.Sockets": "(,4.3.32767]", + "System.Net.WebHeaderCollection": "(,4.3.32767]", + "System.Net.WebSockets": "(,4.3.32767]", + "System.Net.WebSockets.Client": "(,4.3.32767]", + "System.Numerics.Vectors": "(,5.0.32767]", + "System.ObjectModel": "(,4.3.32767]", + "System.Private.DataContractSerialization": "(,4.3.32767]", + "System.Private.Uri": "(,4.3.32767]", + "System.Reflection": "(,4.3.32767]", + "System.Reflection.DispatchProxy": "(,6.0.32767]", + "System.Reflection.Emit": "(,4.7.32767]", + "System.Reflection.Emit.ILGeneration": "(,4.7.32767]", + "System.Reflection.Emit.Lightweight": "(,4.7.32767]", + "System.Reflection.Extensions": "(,4.3.32767]", + "System.Reflection.Metadata": "(,10.0.32767]", + "System.Reflection.Primitives": "(,4.3.32767]", + "System.Reflection.TypeExtensions": "(,4.3.32767]", + "System.Resources.Reader": "(,4.3.32767]", + "System.Resources.ResourceManager": "(,4.3.32767]", + "System.Resources.Writer": "(,4.3.32767]", + "System.Runtime": "(,4.3.32767]", + "System.Runtime.CompilerServices.Unsafe": "(,7.0.32767]", + "System.Runtime.CompilerServices.VisualC": "(,4.3.32767]", + "System.Runtime.Extensions": "(,4.3.32767]", + "System.Runtime.Handles": "(,4.3.32767]", + "System.Runtime.InteropServices": "(,4.3.32767]", + "System.Runtime.InteropServices.RuntimeInformation": "(,4.3.32767]", + "System.Runtime.Loader": "(,4.3.32767]", + "System.Runtime.Numerics": "(,4.3.32767]", + "System.Runtime.Serialization.Formatters": "(,4.3.32767]", + "System.Runtime.Serialization.Json": "(,4.3.32767]", + "System.Runtime.Serialization.Primitives": "(,4.3.32767]", + "System.Runtime.Serialization.Xml": "(,4.3.32767]", + "System.Security.AccessControl": "(,6.0.32767]", + "System.Security.Claims": "(,4.3.32767]", + "System.Security.Cryptography.Algorithms": "(,4.3.32767]", + "System.Security.Cryptography.Cng": "(,5.0.32767]", + "System.Security.Cryptography.Csp": "(,4.3.32767]", + "System.Security.Cryptography.Encoding": "(,4.3.32767]", + "System.Security.Cryptography.OpenSsl": "(,5.0.32767]", + "System.Security.Cryptography.Primitives": "(,4.3.32767]", + "System.Security.Cryptography.X509Certificates": "(,4.3.32767]", + "System.Security.Principal": "(,4.3.32767]", + "System.Security.Principal.Windows": "(,5.0.32767]", + "System.Security.SecureString": "(,4.3.32767]", + "System.Text.Encoding": "(,4.3.32767]", + "System.Text.Encoding.CodePages": "(,10.0.32767]", + "System.Text.Encoding.Extensions": "(,4.3.32767]", + "System.Text.Encodings.Web": "(,10.0.32767]", + "System.Text.Json": "(,10.0.32767]", + "System.Text.RegularExpressions": "(,4.3.32767]", + "System.Threading": "(,4.3.32767]", + "System.Threading.AccessControl": "(,10.0.32767]", + "System.Threading.Channels": "(,10.0.32767]", + "System.Threading.Overlapped": "(,4.3.32767]", + "System.Threading.Tasks": "(,4.3.32767]", + "System.Threading.Tasks.Dataflow": "(,10.0.32767]", + "System.Threading.Tasks.Extensions": "(,5.0.32767]", + "System.Threading.Tasks.Parallel": "(,4.3.32767]", + "System.Threading.Thread": "(,4.3.32767]", + "System.Threading.ThreadPool": "(,4.3.32767]", + "System.Threading.Timer": "(,4.3.32767]", + "System.ValueTuple": "(,4.5.32767]", + "System.Xml.ReaderWriter": "(,4.3.32767]", + "System.Xml.XDocument": "(,4.3.32767]", + "System.Xml.XmlDocument": "(,4.3.32767]", + "System.Xml.XmlSerializer": "(,4.3.32767]", + "System.Xml.XPath": "(,4.3.32767]", + "System.Xml.XPath.XDocument": "(,5.0.32767]" + } + } + } + } +} \ No newline at end of file diff --git a/obj/project.nuget.cache b/obj/project.nuget.cache new file mode 100644 index 0000000..dfbc5fa --- /dev/null +++ b/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "Oa2ROurmFEc=", + "success": true, + "projectFilePath": "/home/alex/Documents/Development/Rust/pumpkin-api-cs/PumpkinApi.csproj", + "expectedPackageFiles": [ + "/home/alex/.nuget/packages/microsoft.aspnetcore.app.ref/10.0.4/microsoft.aspnetcore.app.ref.10.0.4.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/src/Impl.cs b/src/Impl.cs new file mode 100644 index 0000000..45f85d9 --- /dev/null +++ b/src/Impl.cs @@ -0,0 +1,55 @@ +using PluginWorld; +using PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0; +using PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +namespace PluginWorld +{ + // wit-bindgen generates calls to a partial class named [WorldName]ExportsImpl + // and [InterfaceName]ExportsImpl. We must provide these implementations. + + public partial class PluginWorldExportsImpl : IPluginWorldExports + { + public static void InitPlugin() + { + } + + public static void OnLoad(IContextImports.Context context) + { + } + + public static void OnUnload(IContextImports.Context context) + { + } + + public static IEventImports.Event HandleEvent(uint eventId, IServerImports.Server server, IEventImports.Event @event) + { + return @event; + } + + public static int HandleCommand(uint commandId, ICommandImports.CommandSender sender, IServerImports.Server server, ICommandImports.ConsumedArgs args) + { + return 0; + } + + public static void HandleTask(uint handlerId, IServerImports.Server server) + { + } + } +} + +namespace PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0 +{ + public partial class MetadataExportsImpl : IMetadataExports + { + public static IMetadataExports.PluginMetadata GetMetadata() + { + return new IMetadataExports.PluginMetadata( + "csharp-plugin", + "0.1.0", + new List { "Author" }, + "A Pumpkin plugin written in C#", + new List() + ); + } + } +} diff --git a/src/gen/Plugin.cs b/src/gen/Plugin.cs new file mode 100644 index 0000000..e13838c --- /dev/null +++ b/src/gen/Plugin.cs @@ -0,0 +1,1892 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; +using System.Runtime.InteropServices; +using System.Collections.Concurrent; +using System.Threading; +using System.Threading.Tasks; + +namespace PluginWorld { + + public interface IPluginWorldImports{ + + } + + public interface IPluginWorldExports{ + static abstract void InitPlugin(); + + static abstract void OnLoad(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context context); + + static abstract void OnUnload(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context context); + + static abstract global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event HandleEvent(uint eventId, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server server, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event @event); + + static abstract int HandleCommand(uint commandId, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSender sender, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server server, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.ConsumedArgs args); + + static abstract void HandleTask(uint handlerId, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server server); + + } + + public readonly struct None {} + + [global::System.Runtime.InteropServices.StructLayoutAttribute(global::System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly struct Result + { + public readonly byte Tag; + private readonly object value; + + private Result(byte tag, object value) + { + Tag = tag; + this.value = value; + } + + public static Result Ok(TOk ok) + { + return new Result(Tags.Ok, ok!); + } + + public static Result Err(TErr err) + { + return new Result(Tags.Err, err!); + } + + public bool IsOk => Tag == Tags.Ok; + public bool IsErr => Tag == Tags.Err; + + public TOk AsOk + { + get + { + if (Tag == Tags.Ok) + { + return (TOk)value; + } + + throw new global::System.ArgumentException("expected k, got " + Tag); + } + } + + public TErr AsErr + { + get + { + if (Tag == Tags.Err) + { + return (TErr)value; + } + + throw new global::System.ArgumentException("expected Err, got " + Tag); + } + } + + public class Tags + { + public const byte Ok = 0; + public const byte Err = 1; + } + } + + public class Option { + private static Option none = new (); + + private Option() + { + HasValue = false; + } + + public Option(T v) + { + HasValue = true; + Value = v; + } + + public static Option None => none; + + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute(true, nameof(Value))] + public bool HasValue { get; } + + public T? Value { get; } + } + + public class WitException: global::System.Exception { + public object Value { get; } + public uint NestingLevel { get; } + + public WitException(object v, uint level) + { + Value = v; + NestingLevel = level; + } + } + + public class WitException: WitException { + public T TypedValue { get { return (T)this.Value;} } + + public WitException(T v, uint level) : base(v!, level) + { + } + } + + public static class InteropReturnArea + { + [global::System.Runtime.CompilerServices.InlineArrayAttribute(9)] + [global::System.Runtime.InteropServices.StructLayoutAttribute(global::System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)] + internal struct ReturnArea + { + private ulong buffer; + + internal unsafe nint AddressOfReturnArea() + { + return (nint)global::System.Runtime.CompilerServices.Unsafe.AsPointer(ref buffer); + } + } + + [global::System.ThreadStaticAttribute] + [global::System.Runtime.CompilerServices.FixedAddressValueTypeAttribute] + internal static ReturnArea returnArea = default; + } + + public static class MemoryHelper + { + public static unsafe void* AlignStackPtr(void* stackAddress, uint alignment) + { + return (void*)(((nint)stackAddress) + ((int)alignment - 1) & -(int)alignment); + } + } + + namespace Imports { + public partial class PluginWorldImportsInterop : IPluginWorldImports + {} + } + namespace Exports { + public static class PluginWorldInterop + { + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "init-plugin")] + public static unsafe void wasmExportInitPlugin() { + + PluginWorldExportsImpl.InitPlugin(); + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "on-load")] + public static unsafe nint wasmExportOnLoad(int p0) { + + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context.THandle(p0)); + Result ret; + + try + { + + PluginWorldExportsImpl.OnLoad((resource)); + ret = Result.Ok(new None()); + } + catch (WitException e) + { + switch (e.NestingLevel) + { + case 0: + { + ret = Result.Err((string) e.Value); + break; + } + + default: throw new global::System.ArgumentException($"invalid nesting level: {e.NestingLevel}"); + } + } + + var ptr = InteropReturnArea.returnArea.AddressOfReturnArea(); + + switch (ret.Tag) { + case 0: { + + *(byte*)(ptr + 0) = (byte)0; + + break; + } + case 1: { + string payload2 = ret.AsErr; + *(byte*)(ptr + 0) = (byte)1; + + var stringSpan = global::System.MemoryExtensions.AsSpan(payload2); + var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan); + var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span(strPtr, length)); + + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = length; + new global::System.Span((void*)((byte*)ptr + 4), 1)[0] = (nint)(int)strPtr; + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + ret); + } + return ptr; + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_on-load")] + public static unsafe void cabi_post_wasmExportOnLoad(nint p0) { + + switch (new global::System.Span((byte*)p0 + 0, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 4), 1)[0]); + + break; + } + } + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "on-unload")] + public static unsafe nint wasmExportOnUnload(int p0) { + + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context.THandle(p0)); + Result ret; + + try + { + + PluginWorldExportsImpl.OnUnload((resource)); + ret = Result.Ok(new None()); + } + catch (WitException e) + { + switch (e.NestingLevel) + { + case 0: + { + ret = Result.Err((string) e.Value); + break; + } + + default: throw new global::System.ArgumentException($"invalid nesting level: {e.NestingLevel}"); + } + } + + var ptr = InteropReturnArea.returnArea.AddressOfReturnArea(); + + switch (ret.Tag) { + case 0: { + + *(byte*)(ptr + 0) = (byte)0; + + break; + } + case 1: { + string payload2 = ret.AsErr; + *(byte*)(ptr + 0) = (byte)1; + + var stringSpan = global::System.MemoryExtensions.AsSpan(payload2); + var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan); + var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span(strPtr, length)); + + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = length; + new global::System.Span((void*)((byte*)ptr + 4), 1)[0] = (nint)(int)strPtr; + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + ret); + } + return ptr; + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_on-unload")] + public static unsafe void cabi_post_wasmExportOnUnload(nint p0) { + + switch (new global::System.Span((byte*)p0 + 0, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 4), 1)[0]); + + break; + } + } + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "handle-event")] + public static unsafe nint wasmExportHandleEvent(nint p0) { + + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server.THandle(new global::System.Span((void*)((byte*)p0 + 4), 1)[0])); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event lifted159; + + switch (new global::System.Span((byte*)p0 + 8, 1)[0]) { + case 0: { + var resource0 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + var resource1 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span((void*)((byte*)p0 + 20), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerJoinEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerJoinEventData ( + resource0, resource1, (new global::System.Span((byte*)p0 + 24, 1)[0] != 0))); + break; + } + case 1: { + var resource4 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + var resource5 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span((void*)((byte*)p0 + 20), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerLeaveEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLeaveEventData ( + resource4, resource5, (new global::System.Span((byte*)p0 + 24, 1)[0] != 0))); + break; + } + case 2: { + var resource8 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + var resource9 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span((void*)((byte*)p0 + 20), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerLoginEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLoginEventData ( + resource8, resource9, (new global::System.Span((byte*)p0 + 24, 1)[0] != 0))); + break; + } + case 3: { + var resource12 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 24), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + } + + var array = new global::System.Collections.Generic.List(new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + for (int index = 0; index < new global::System.Span((void*)((byte*)p0 + 32), 1)[0]; ++index) { + nint basePtr14 = new global::System.Span((void*)((byte*)p0 + 28), 1)[0] + (index * 4); + var resource15 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)basePtr14 + 0), 1)[0])); + + array.Add(resource15); + } + + if (new global::System.Span((void*)((byte*)p0 + 32), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerChatEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChatEventData ( + resource12, str, array, (new global::System.Span((byte*)p0 + 36, 1)[0] != 0))); + break; + } + case 4: { + var resource18 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + var str19 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 24), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerCommandSendEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCommandSendEventData ( + resource18, str19, (new global::System.Span((byte*)p0 + 28, 1)[0] != 0))); + break; + } + case 5: { + var resource22 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + var str23 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 24), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerPermissionCheckEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerPermissionCheckEventData ( + resource22, str23, (new global::System.Span((byte*)p0 + 28, 1)[0] != 0))); + break; + } + case 6: { + var resource26 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerMoveEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerMoveEventData ( + resource26, (new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 40), 1)[0]), (new global::System.Span((void*)((byte*)p0 + 48), 1)[0], new global::System.Span((void*)((byte*)p0 + 56), 1)[0], new global::System.Span((void*)((byte*)p0 + 64), 1)[0]), (new global::System.Span((byte*)p0 + 72, 1)[0] != 0))); + break; + } + case 7: { + var resource29 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerTeleportEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerTeleportEventData ( + resource29, (new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 40), 1)[0]), (new global::System.Span((void*)((byte*)p0 + 48), 1)[0], new global::System.Span((void*)((byte*)p0 + 56), 1)[0], new global::System.Span((void*)((byte*)p0 + 64), 1)[0]), (new global::System.Span((byte*)p0 + 72, 1)[0] != 0))); + break; + } + case 8: { + var resource32 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + var resource33 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)p0 + 20), 1)[0])); + var resource34 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)p0 + 24), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerChangeWorldEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangeWorldEventData ( + resource32, resource33, resource34, (new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 40), 1)[0], new global::System.Span((void*)((byte*)p0 + 48), 1)[0]), new global::System.Span((void*)((byte*)p0 + 56), 1)[0], new global::System.Span((void*)((byte*)p0 + 60), 1)[0], (new global::System.Span((byte*)p0 + 64, 1)[0] != 0))); + break; + } + case 9: { + var resource37 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerExpChangeEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerExpChangeEventData ( + resource37, new global::System.Span((void*)((byte*)p0 + 20), 1)[0])); + break; + } + case 10: { + var resource40 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerItemHeldEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerItemHeldEventData ( + resource40, ((byte)new global::System.Span((byte*)p0 + 20, 1)[0]), ((byte)new global::System.Span((byte*)p0 + 21, 1)[0]), (new global::System.Span((byte*)p0 + 22, 1)[0] != 0))); + break; + } + case 11: { + var resource43 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerChangedMainHandEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangedMainHandEventData ( + resource43, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand)new global::System.Span((byte*)p0 + 20, 1)[0])); + break; + } + case 12: { + var resource46 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerGamemodeChangeEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerGamemodeChangeEventData ( + resource46, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode)new global::System.Span((byte*)p0 + 20, 1)[0], (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode)new global::System.Span((byte*)p0 + 21, 1)[0], (new global::System.Span((byte*)p0 + 22, 1)[0] != 0))); + break; + } + case 13: { + var resource49 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + var str50 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 24), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + } + + var array51 = new byte[new global::System.Span((void*)((byte*)p0 + 32), 1)[0]]; + new global::System.Span((void*)(new global::System.Span((void*)((byte*)p0 + 28), 1)[0]), new global::System.Span((void*)((byte*)p0 + 32), 1)[0]).CopyTo(new global::System.Span(array51)); + + if (new global::System.Span((void*)((byte*)p0 + 32), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerCustomPayloadEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCustomPayloadEventData ( + resource49, str50, array51)); + break; + } + case 14: { + var resource54 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + string? lifted; + + switch (new global::System.Span((byte*)p0 + 20, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + var str59 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 28), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + } + + lifted = str59; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)p0 + 20, 1)[0])); + } + + var str60 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 36), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 36), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + } + + var str61 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 40), 1)[0], new global::System.Span((void*)((byte*)p0 + 44), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 44), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 40), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerFishEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerFishEventData ( + resource54, lifted, str60, str61, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerFishState)new global::System.Span((byte*)p0 + 48, 1)[0], (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand)new global::System.Span((byte*)p0 + 49, 1)[0], new global::System.Span((void*)((byte*)p0 + 52), 1)[0], (new global::System.Span((byte*)p0 + 56, 1)[0] != 0))); + break; + } + case 15: { + var resource64 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + var str65 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 24), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + } + + var str66 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 36), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 36), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerEggThrowEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerEggThrowEventData ( + resource64, str65, (new global::System.Span((byte*)p0 + 28, 1)[0] != 0), ((byte)new global::System.Span((byte*)p0 + 29, 1)[0]), str66, (new global::System.Span((byte*)p0 + 40, 1)[0] != 0))); + break; + } + case 16: { + var resource69 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerInteractUnknownEntityEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractUnknownEntityEventData ( + resource69, new global::System.Span((void*)((byte*)p0 + 20), 1)[0], (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.EntityInteractionAction)new global::System.Span((byte*)p0 + 24, 1)[0], (new global::System.Span((byte*)p0 + 25, 1)[0] != 0))); + break; + } + case 17: { + var resource72 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + (int, int, int)? lifted77; + + switch (new global::System.Span((byte*)p0 + 24, 1)[0]) { + case 0: { + lifted77 = null; + break; + } + + case 1: { + + lifted77 = (new global::System.Span((void*)((byte*)p0 + 28), 1)[0], new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 36), 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)p0 + 24, 1)[0])); + } + + var str78 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 40), 1)[0], new global::System.Span((void*)((byte*)p0 + 44), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 44), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 40), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerInteractEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractEventData ( + resource72, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InteractAction)new global::System.Span((byte*)p0 + 20, 1)[0], lifted77, str78, (new global::System.Span((byte*)p0 + 48, 1)[0] != 0))); + break; + } + case 18: { + var resource81 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerToggleSneakEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSneakEventData ( + resource81, (new global::System.Span((byte*)p0 + 20, 1)[0] != 0), (new global::System.Span((byte*)p0 + 21, 1)[0] != 0))); + break; + } + case 19: { + var resource84 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerToggleFlightEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleFlightEventData ( + resource84, (new global::System.Span((byte*)p0 + 20, 1)[0] != 0), (new global::System.Span((byte*)p0 + 21, 1)[0] != 0))); + break; + } + case 20: { + var resource87 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerToggleSprintEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSprintEventData ( + resource87, (new global::System.Span((byte*)p0 + 20, 1)[0] != 0), (new global::System.Span((byte*)p0 + 21, 1)[0] != 0))); + break; + } + case 21: { + var resource90 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + string? lifted96; + + switch (new global::System.Span((byte*)p0 + 20, 1)[0]) { + case 0: { + lifted96 = null; + break; + } + + case 1: { + + var str95 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 28), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + } + + lifted96 = str95; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)p0 + 20, 1)[0])); + } + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? lifted102; + + switch (new global::System.Span((byte*)p0 + 40, 1)[0]) { + case 0: { + lifted102 = null; + break; + } + + case 1: { + + var str101 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 44), 1)[0], new global::System.Span((void*)((byte*)p0 + 48), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 48), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 44), 1)[0]); + } + + lifted102 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack ( + str101, ((byte)new global::System.Span((byte*)p0 + 52, 1)[0])); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)p0 + 40, 1)[0])); + } + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? lifted108; + + switch (new global::System.Span((byte*)p0 + 56, 1)[0]) { + case 0: { + lifted108 = null; + break; + } + + case 1: { + + var str107 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 60), 1)[0], new global::System.Span((void*)((byte*)p0 + 64), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 64), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 60), 1)[0]); + } + + lifted108 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack ( + str107, ((byte)new global::System.Span((byte*)p0 + 68, 1)[0])); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)p0 + 56, 1)[0])); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.InventoryClickEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryClickEventData ( + resource90, lifted96, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ClickType)new global::System.Span((byte*)p0 + 32, 1)[0], ((short)new global::System.Span((void*)((byte*)p0 + 34), 1)[0]), ((short)new global::System.Span((void*)((byte*)p0 + 36), 1)[0]), lifted102, lifted108, new global::System.Span((void*)((byte*)p0 + 72), 1)[0], (new global::System.Span((byte*)p0 + 76, 1)[0] != 0))); + break; + } + case 22: { + var resource111 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + string? lifted117; + + switch (new global::System.Span((byte*)p0 + 20, 1)[0]) { + case 0: { + lifted117 = null; + break; + } + + case 1: { + + var str116 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 28), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + } + + lifted117 = str116; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)p0 + 20, 1)[0])); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.InventoryCloseEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryCloseEventData ( + resource111, lifted117)); + break; + } + case 23: { + var resource120 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockRedstoneEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockRedstoneEventData ( + resource120, ((ushort)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]), (new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 28), 1)[0], new global::System.Span((void*)((byte*)p0 + 32), 1)[0]), new global::System.Span((void*)((byte*)p0 + 36), 1)[0], new global::System.Span((void*)((byte*)p0 + 40), 1)[0], (new global::System.Span((byte*)p0 + 44, 1)[0] != 0))); + break; + } + case 24: { + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? lifted128; + + switch (new global::System.Span((byte*)p0 + 16, 1)[0]) { + case 0: { + lifted128 = null; + break; + } + + case 1: { + var resource127 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 20), 1)[0])); + + lifted128 = resource127; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)p0 + 16, 1)[0])); + } + + var str129 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 28), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockBreakEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBreakEventData ( + lifted128, str129, (new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 36), 1)[0], new global::System.Span((void*)((byte*)p0 + 40), 1)[0]), unchecked((uint)(new global::System.Span((void*)((byte*)p0 + 44), 1)[0])), (new global::System.Span((byte*)p0 + 48, 1)[0] != 0), (new global::System.Span((byte*)p0 + 49, 1)[0] != 0))); + break; + } + case 25: { + + var str132 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0], new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 20), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + } + + var str133 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 28), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockBurnEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBurnEventData ( + str132, str133, (new global::System.Span((byte*)p0 + 32, 1)[0] != 0))); + break; + } + case 26: { + + var str136 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0], new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 20), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + } + + var resource137 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 28), 1)[0])); + + var str138 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 36), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 36), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockCanBuildEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockCanBuildEventData ( + str136, (new global::System.Span((byte*)p0 + 24, 1)[0] != 0), resource137, str138, (new global::System.Span((byte*)p0 + 40, 1)[0] != 0))); + break; + } + case 27: { + var resource141 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + var str142 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 24), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + } + + var str143 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 36), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 36), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockGrowEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockGrowEventData ( + resource141, str142, ((ushort)new global::System.Span((void*)((byte*)p0 + 28), 1)[0]), str143, ((ushort)new global::System.Span((void*)((byte*)p0 + 40), 1)[0]), (new global::System.Span((void*)((byte*)p0 + 44), 1)[0], new global::System.Span((void*)((byte*)p0 + 48), 1)[0], new global::System.Span((void*)((byte*)p0 + 52), 1)[0]), (new global::System.Span((byte*)p0 + 56, 1)[0] != 0))); + break; + } + case 28: { + var resource146 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + var str147 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 24), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + } + + var str148 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 28), 1)[0], new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 32), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 28), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockPlaceEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockPlaceEventData ( + resource146, str147, str148, (new global::System.Span((void*)((byte*)p0 + 36), 1)[0], new global::System.Span((void*)((byte*)p0 + 40), 1)[0], new global::System.Span((void*)((byte*)p0 + 44), 1)[0]), (new global::System.Span((byte*)p0 + 48, 1)[0] != 0), (new global::System.Span((byte*)p0 + 49, 1)[0] != 0))); + break; + } + case 29: { + + var str151 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0], new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + if (new global::System.Span((void*)((byte*)p0 + 20), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + } + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.ServerCommandEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerCommandEventData ( + str151, (new global::System.Span((byte*)p0 + 24, 1)[0] != 0))); + break; + } + case 30: { + var resource154 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.SpawnChangeEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.SpawnChangeEventData ( + resource154, (new global::System.Span((void*)((byte*)p0 + 20), 1)[0], new global::System.Span((void*)((byte*)p0 + 24), 1)[0], new global::System.Span((void*)((byte*)p0 + 28), 1)[0]), new global::System.Span((void*)((byte*)p0 + 32), 1)[0], new global::System.Span((void*)((byte*)p0 + 36), 1)[0], (new global::System.Span((void*)((byte*)p0 + 40), 1)[0], new global::System.Span((void*)((byte*)p0 + 44), 1)[0], new global::System.Span((void*)((byte*)p0 + 48), 1)[0]), new global::System.Span((void*)((byte*)p0 + 52), 1)[0], new global::System.Span((void*)((byte*)p0 + 56), 1)[0])); + break; + } + case 31: { + var resource157 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span((void*)((byte*)p0 + 16), 1)[0])); + var resource158 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span((void*)((byte*)p0 + 20), 1)[0])); + + lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.ServerBroadcastEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerBroadcastEventData ( + resource157, resource158, (new global::System.Span((byte*)p0 + 24, 1)[0] != 0))); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)p0 + 8, 1)[0]); + } + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event ret; + ret = PluginWorldExportsImpl.HandleEvent((unchecked((uint)(new global::System.Span((void*)((byte*)p0 + 0), 1)[0]))), (resource), (lifted159)); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)p0); + + var ptr = InteropReturnArea.returnArea.AddressOfReturnArea(); + + switch (ret.Tag) { + case 0: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerJoinEventData payload = ret.AsPlayerJoinEvent; + *(byte*)(ptr + 0) = (byte)0; + var handle = payload.player.Handle; + payload.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle; + var handle162 = payload.joinMessage.Handle; + payload.joinMessage.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = handle162; + *(byte*)(ptr + 16) = (byte)(payload.cancelled ? 1 : 0); + + break; + } + case 1: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLeaveEventData payload165 = ret.AsPlayerLeaveEvent; + *(byte*)(ptr + 0) = (byte)1; + var handle166 = payload165.player.Handle; + payload165.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle166; + var handle167 = payload165.leaveMessage.Handle; + payload165.leaveMessage.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = handle167; + *(byte*)(ptr + 16) = (byte)(payload165.cancelled ? 1 : 0); + + break; + } + case 2: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLoginEventData payload170 = ret.AsPlayerLoginEvent; + *(byte*)(ptr + 0) = (byte)2; + var handle171 = payload170.player.Handle; + payload170.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle171; + var handle172 = payload170.kickMessage.Handle; + payload170.kickMessage.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = handle172; + *(byte*)(ptr + 16) = (byte)(payload170.cancelled ? 1 : 0); + + break; + } + case 3: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChatEventData payload175 = ret.AsPlayerChatEvent; + *(byte*)(ptr + 0) = (byte)3; + var handle176 = payload175.player.Handle; + payload175.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle176; + + var stringSpan = global::System.MemoryExtensions.AsSpan(payload175.message); + var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan); + var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span(strPtr, length)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr; + + var bufferSize = 4 * (nuint)payload175.recipients.Count; + void* address = global::System.Runtime.InteropServices.NativeMemory.AlignedAlloc(bufferSize, 4); + + for (int index180 = 0; index180 < payload175.recipients.Count; ++index180) { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player element177 = payload175.recipients[index180]; + int basePtr178 = (int)address + (index180 * 4); + var handle179 = element177.Handle; + element177.Handle = 0; + new global::System.Span((void*)((byte*)basePtr178 + 0), 1)[0] = handle179; + + } + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = payload175.recipients.Count; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = (nint)(int)address; + *(byte*)(ptr + 28) = (byte)(payload175.cancelled ? 1 : 0); + + break; + } + case 4: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCommandSendEventData payload183 = ret.AsPlayerCommandSendEvent; + *(byte*)(ptr + 0) = (byte)4; + var handle184 = payload183.player.Handle; + payload183.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle184; + + var stringSpan189 = global::System.MemoryExtensions.AsSpan(payload183.command); + var length187 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan189); + var strPtr185 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length187); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan189, new global::System.Span(strPtr185, length187)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length187; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr185; + *(byte*)(ptr + 20) = (byte)(payload183.cancelled ? 1 : 0); + + break; + } + case 5: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerPermissionCheckEventData payload192 = ret.AsPlayerPermissionCheckEvent; + *(byte*)(ptr + 0) = (byte)5; + var handle193 = payload192.player.Handle; + payload192.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle193; + + var stringSpan198 = global::System.MemoryExtensions.AsSpan(payload192.permission); + var length196 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan198); + var strPtr194 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length196); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan198, new global::System.Span(strPtr194, length196)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length196; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr194; + *(byte*)(ptr + 20) = (byte)(payload192.permissionResult ? 1 : 0); + + break; + } + case 6: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerMoveEventData payload201 = ret.AsPlayerMoveEvent; + *(byte*)(ptr + 0) = (byte)6; + var handle202 = payload201.player.Handle; + payload201.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle202; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = unchecked((double)payload201.fromPosition.Item1); + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = unchecked((double)payload201.fromPosition.Item2); + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = unchecked((double)payload201.fromPosition.Item3); + new global::System.Span((void*)((byte*)ptr + 40), 1)[0] = unchecked((double)payload201.toPosition.Item1); + new global::System.Span((void*)((byte*)ptr + 48), 1)[0] = unchecked((double)payload201.toPosition.Item2); + new global::System.Span((void*)((byte*)ptr + 56), 1)[0] = unchecked((double)payload201.toPosition.Item3); + *(byte*)(ptr + 64) = (byte)(payload201.cancelled ? 1 : 0); + + break; + } + case 7: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerTeleportEventData payload205 = ret.AsPlayerTeleportEvent; + *(byte*)(ptr + 0) = (byte)7; + var handle206 = payload205.player.Handle; + payload205.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle206; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = unchecked((double)payload205.fromPosition.Item1); + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = unchecked((double)payload205.fromPosition.Item2); + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = unchecked((double)payload205.fromPosition.Item3); + new global::System.Span((void*)((byte*)ptr + 40), 1)[0] = unchecked((double)payload205.toPosition.Item1); + new global::System.Span((void*)((byte*)ptr + 48), 1)[0] = unchecked((double)payload205.toPosition.Item2); + new global::System.Span((void*)((byte*)ptr + 56), 1)[0] = unchecked((double)payload205.toPosition.Item3); + *(byte*)(ptr + 64) = (byte)(payload205.cancelled ? 1 : 0); + + break; + } + case 8: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangeWorldEventData payload209 = ret.AsPlayerChangeWorldEvent; + *(byte*)(ptr + 0) = (byte)8; + var handle210 = payload209.player.Handle; + payload209.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle210; + var handle211 = payload209.previousWorld.Handle; + payload209.previousWorld.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = handle211; + var handle212 = payload209.newWorld.Handle; + payload209.newWorld.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = handle212; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = unchecked((double)payload209.position.Item1); + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = unchecked((double)payload209.position.Item2); + new global::System.Span((void*)((byte*)ptr + 40), 1)[0] = unchecked((double)payload209.position.Item3); + new global::System.Span((void*)((byte*)ptr + 48), 1)[0] = unchecked((float)payload209.yaw); + new global::System.Span((void*)((byte*)ptr + 52), 1)[0] = unchecked((float)payload209.pitch); + *(byte*)(ptr + 56) = (byte)(payload209.cancelled ? 1 : 0); + + break; + } + case 9: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerExpChangeEventData payload215 = ret.AsPlayerExpChangeEvent; + *(byte*)(ptr + 0) = (byte)9; + var handle216 = payload215.player.Handle; + payload215.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle216; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = payload215.amount; + + break; + } + case 10: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerItemHeldEventData payload219 = ret.AsPlayerItemHeldEvent; + *(byte*)(ptr + 0) = (byte)10; + var handle220 = payload219.player.Handle; + payload219.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle220; + *(byte*)(ptr + 12) = (byte)payload219.previousSlot; + *(byte*)(ptr + 13) = (byte)payload219.newSlot; + *(byte*)(ptr + 14) = (byte)(payload219.cancelled ? 1 : 0); + + break; + } + case 11: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangedMainHandEventData payload223 = ret.AsPlayerChangedMainHandEvent; + *(byte*)(ptr + 0) = (byte)11; + var handle224 = payload223.player.Handle; + payload223.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle224; + *(byte*)(ptr + 12) = (byte)(int)payload223.mainHand; + + break; + } + case 12: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerGamemodeChangeEventData payload227 = ret.AsPlayerGamemodeChangeEvent; + *(byte*)(ptr + 0) = (byte)12; + var handle228 = payload227.player.Handle; + payload227.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle228; + *(byte*)(ptr + 12) = (byte)(int)payload227.previousGamemode; + *(byte*)(ptr + 13) = (byte)(int)payload227.newGamemode; + *(byte*)(ptr + 14) = (byte)(payload227.cancelled ? 1 : 0); + + break; + } + case 13: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCustomPayloadEventData payload231 = ret.AsPlayerCustomPayloadEvent; + *(byte*)(ptr + 0) = (byte)13; + var handle232 = payload231.player.Handle; + payload231.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle232; + + var stringSpan237 = global::System.MemoryExtensions.AsSpan(payload231.channel); + var length235 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan237); + var strPtr233 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length235); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan237, new global::System.Span(strPtr233, length235)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length235; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr233; + + var byteLength = (1) * payload231.data.Length; + var address238 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)(byteLength)); + global::System.MemoryExtensions.AsSpan(payload231.data).CopyTo(new global::System.Span(address238,byteLength)); + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = payload231.data.Length; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = (nint)(int)(address238); + + break; + } + case 14: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerFishEventData payload241 = ret.AsPlayerFishEvent; + *(byte*)(ptr + 0) = (byte)14; + var handle242 = payload241.player.Handle; + payload241.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle242; + + if (payload241.caughtUuid != null) { + var payload248 = (string) payload241.caughtUuid; + *(byte*)(ptr + 12) = (byte)1; + + var stringSpan253 = global::System.MemoryExtensions.AsSpan(payload248); + var length251 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan253); + var strPtr249 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length251); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan253, new global::System.Span(strPtr249, length251)); + + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = length251; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr249; + + } else { + + *(byte*)(ptr + 12) = (byte)0; + + } + + var stringSpan258 = global::System.MemoryExtensions.AsSpan(payload241.caughtType); + var length256 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan258); + var strPtr254 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length256); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan258, new global::System.Span(strPtr254, length256)); + + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = length256; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr254; + + var stringSpan263 = global::System.MemoryExtensions.AsSpan(payload241.hookUuid); + var length261 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan263); + var strPtr259 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length261); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan263, new global::System.Span(strPtr259, length261)); + + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = length261; + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = (nint)(int)strPtr259; + *(byte*)(ptr + 40) = (byte)(int)payload241.state; + *(byte*)(ptr + 41) = (byte)(int)payload241.hand; + new global::System.Span((void*)((byte*)ptr + 44), 1)[0] = payload241.expToDrop; + *(byte*)(ptr + 48) = (byte)(payload241.cancelled ? 1 : 0); + + break; + } + case 15: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerEggThrowEventData payload266 = ret.AsPlayerEggThrowEvent; + *(byte*)(ptr + 0) = (byte)15; + var handle267 = payload266.player.Handle; + payload266.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle267; + + var stringSpan272 = global::System.MemoryExtensions.AsSpan(payload266.eggUuid); + var length270 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan272); + var strPtr268 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length270); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan272, new global::System.Span(strPtr268, length270)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length270; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr268; + *(byte*)(ptr + 20) = (byte)(payload266.hatching ? 1 : 0); + *(byte*)(ptr + 21) = (byte)payload266.numHatches; + + var stringSpan277 = global::System.MemoryExtensions.AsSpan(payload266.hatchingType); + var length275 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan277); + var strPtr273 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length275); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan277, new global::System.Span(strPtr273, length275)); + + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = length275; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr273; + *(byte*)(ptr + 32) = (byte)(payload266.cancelled ? 1 : 0); + + break; + } + case 16: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractUnknownEntityEventData payload280 = ret.AsPlayerInteractUnknownEntityEvent; + *(byte*)(ptr + 0) = (byte)16; + var handle281 = payload280.player.Handle; + payload280.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle281; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = payload280.entityId; + *(byte*)(ptr + 16) = (byte)(int)payload280.action; + *(byte*)(ptr + 17) = (byte)(payload280.cancelled ? 1 : 0); + + break; + } + case 17: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractEventData payload284 = ret.AsPlayerInteractEvent; + *(byte*)(ptr + 0) = (byte)17; + var handle285 = payload284.player.Handle; + payload284.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle285; + *(byte*)(ptr + 12) = (byte)(int)payload284.action; + + if (payload284.clickedPos != null) { + var payload291 = ((int, int, int)) payload284.clickedPos; + *(byte*)(ptr + 16) = (byte)1; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = payload291.Item1; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = payload291.Item2; + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = payload291.Item3; + + } else { + + *(byte*)(ptr + 16) = (byte)0; + + } + + var stringSpan296 = global::System.MemoryExtensions.AsSpan(payload284.block); + var length294 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan296); + var strPtr292 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length294); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan296, new global::System.Span(strPtr292, length294)); + + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = length294; + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = (nint)(int)strPtr292; + *(byte*)(ptr + 40) = (byte)(payload284.cancelled ? 1 : 0); + + break; + } + case 18: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSneakEventData payload299 = ret.AsPlayerToggleSneakEvent; + *(byte*)(ptr + 0) = (byte)18; + var handle300 = payload299.player.Handle; + payload299.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle300; + *(byte*)(ptr + 12) = (byte)(payload299.isSneaking ? 1 : 0); + *(byte*)(ptr + 13) = (byte)(payload299.cancelled ? 1 : 0); + + break; + } + case 19: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleFlightEventData payload303 = ret.AsPlayerToggleFlightEvent; + *(byte*)(ptr + 0) = (byte)19; + var handle304 = payload303.player.Handle; + payload303.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle304; + *(byte*)(ptr + 12) = (byte)(payload303.isFlying ? 1 : 0); + *(byte*)(ptr + 13) = (byte)(payload303.cancelled ? 1 : 0); + + break; + } + case 20: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSprintEventData payload307 = ret.AsPlayerToggleSprintEvent; + *(byte*)(ptr + 0) = (byte)20; + var handle308 = payload307.player.Handle; + payload307.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle308; + *(byte*)(ptr + 12) = (byte)(payload307.isSprinting ? 1 : 0); + *(byte*)(ptr + 13) = (byte)(payload307.cancelled ? 1 : 0); + + break; + } + case 21: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryClickEventData payload311 = ret.AsInventoryClickEvent; + *(byte*)(ptr + 0) = (byte)21; + var handle312 = payload311.player.Handle; + payload311.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle312; + + if (payload311.windowType != null) { + var payload318 = (string) payload311.windowType; + *(byte*)(ptr + 12) = (byte)1; + + var stringSpan323 = global::System.MemoryExtensions.AsSpan(payload318); + var length321 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan323); + var strPtr319 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length321); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan323, new global::System.Span(strPtr319, length321)); + + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = length321; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr319; + + } else { + + *(byte*)(ptr + 12) = (byte)0; + + } + *(byte*)(ptr + 24) = (byte)(int)payload311.clickType; + new global::System.Span((void*)((byte*)ptr + 26), 1)[0] = (short)payload311.slot; + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = (short)payload311.rawSlot; + + if (payload311.clickedItem != null) { + var payload329 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack) payload311.clickedItem; + *(byte*)(ptr + 32) = (byte)1; + + var stringSpan334 = global::System.MemoryExtensions.AsSpan(payload329.registryKey); + var length332 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan334); + var strPtr330 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length332); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan334, new global::System.Span(strPtr330, length332)); + + new global::System.Span((void*)((byte*)ptr + 40), 1)[0] = length332; + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = (nint)(int)strPtr330; + *(byte*)(ptr + 44) = (byte)payload329.count; + + } else { + + *(byte*)(ptr + 32) = (byte)0; + + } + + if (payload311.cursor != null) { + var payload340 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack) payload311.cursor; + *(byte*)(ptr + 48) = (byte)1; + + var stringSpan345 = global::System.MemoryExtensions.AsSpan(payload340.registryKey); + var length343 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan345); + var strPtr341 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length343); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan345, new global::System.Span(strPtr341, length343)); + + new global::System.Span((void*)((byte*)ptr + 56), 1)[0] = length343; + new global::System.Span((void*)((byte*)ptr + 52), 1)[0] = (nint)(int)strPtr341; + *(byte*)(ptr + 60) = (byte)payload340.count; + + } else { + + *(byte*)(ptr + 48) = (byte)0; + + } + new global::System.Span((void*)((byte*)ptr + 64), 1)[0] = payload311.hotbarButton; + *(byte*)(ptr + 68) = (byte)(payload311.cancelled ? 1 : 0); + + break; + } + case 22: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryCloseEventData payload348 = ret.AsInventoryCloseEvent; + *(byte*)(ptr + 0) = (byte)22; + var handle349 = payload348.player.Handle; + payload348.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle349; + + if (payload348.windowType != null) { + var payload355 = (string) payload348.windowType; + *(byte*)(ptr + 12) = (byte)1; + + var stringSpan360 = global::System.MemoryExtensions.AsSpan(payload355); + var length358 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan360); + var strPtr356 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length358); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan360, new global::System.Span(strPtr356, length358)); + + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = length358; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr356; + + } else { + + *(byte*)(ptr + 12) = (byte)0; + + } + + break; + } + case 23: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockRedstoneEventData payload363 = ret.AsBlockRedstoneEvent; + *(byte*)(ptr + 0) = (byte)23; + var handle364 = payload363.targetWorld.Handle; + payload363.targetWorld.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle364; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (short)payload363.stateId; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = payload363.blockPosition.Item1; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = payload363.blockPosition.Item2; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = payload363.blockPosition.Item3; + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = payload363.oldCurrent; + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = payload363.newCurrent; + *(byte*)(ptr + 36) = (byte)(payload363.cancelled ? 1 : 0); + + break; + } + case 24: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBreakEventData payload367 = ret.AsBlockBreakEvent; + *(byte*)(ptr + 0) = (byte)24; + + if (payload367.player != null) { + var payload373 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player) payload367.player; + *(byte*)(ptr + 8) = (byte)1; + var handle374 = payload373.Handle; + payload373.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = handle374; + + } else { + + *(byte*)(ptr + 8) = (byte)0; + + } + + var stringSpan379 = global::System.MemoryExtensions.AsSpan(payload367.block); + var length377 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan379); + var strPtr375 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length377); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan379, new global::System.Span(strPtr375, length377)); + + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = length377; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr375; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = payload367.blockPosition.Item1; + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = payload367.blockPosition.Item2; + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = payload367.blockPosition.Item3; + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = unchecked((int)(payload367.exp)); + *(byte*)(ptr + 40) = (byte)(payload367.shouldDrop ? 1 : 0); + *(byte*)(ptr + 41) = (byte)(payload367.cancelled ? 1 : 0); + + break; + } + case 25: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBurnEventData payload382 = ret.AsBlockBurnEvent; + *(byte*)(ptr + 0) = (byte)25; + + var stringSpan387 = global::System.MemoryExtensions.AsSpan(payload382.ignitingBlock); + var length385 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan387); + var strPtr383 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length385); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan387, new global::System.Span(strPtr383, length385)); + + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = length385; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = (nint)(int)strPtr383; + + var stringSpan392 = global::System.MemoryExtensions.AsSpan(payload382.block); + var length390 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan392); + var strPtr388 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length390); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan392, new global::System.Span(strPtr388, length390)); + + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = length390; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr388; + *(byte*)(ptr + 24) = (byte)(payload382.cancelled ? 1 : 0); + + break; + } + case 26: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockCanBuildEventData payload395 = ret.AsBlockCanBuildEvent; + *(byte*)(ptr + 0) = (byte)26; + + var stringSpan400 = global::System.MemoryExtensions.AsSpan(payload395.blockToBuild); + var length398 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan400); + var strPtr396 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length398); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan400, new global::System.Span(strPtr396, length398)); + + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = length398; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = (nint)(int)strPtr396; + *(byte*)(ptr + 16) = (byte)(payload395.buildable ? 1 : 0); + var handle401 = payload395.player.Handle; + payload395.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = handle401; + + var stringSpan406 = global::System.MemoryExtensions.AsSpan(payload395.block); + var length404 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan406); + var strPtr402 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length404); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan406, new global::System.Span(strPtr402, length404)); + + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = length404; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr402; + *(byte*)(ptr + 32) = (byte)(payload395.cancelled ? 1 : 0); + + break; + } + case 27: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockGrowEventData payload409 = ret.AsBlockGrowEvent; + *(byte*)(ptr + 0) = (byte)27; + var handle410 = payload409.targetWorld.Handle; + payload409.targetWorld.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle410; + + var stringSpan415 = global::System.MemoryExtensions.AsSpan(payload409.oldBlock); + var length413 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan415); + var strPtr411 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length413); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan415, new global::System.Span(strPtr411, length413)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length413; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr411; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = (short)payload409.oldStateId; + + var stringSpan420 = global::System.MemoryExtensions.AsSpan(payload409.newBlock); + var length418 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan420); + var strPtr416 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length418); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan420, new global::System.Span(strPtr416, length418)); + + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = length418; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr416; + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = (short)payload409.newStateId; + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = payload409.blockPosition.Item1; + new global::System.Span((void*)((byte*)ptr + 40), 1)[0] = payload409.blockPosition.Item2; + new global::System.Span((void*)((byte*)ptr + 44), 1)[0] = payload409.blockPosition.Item3; + *(byte*)(ptr + 48) = (byte)(payload409.cancelled ? 1 : 0); + + break; + } + case 28: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockPlaceEventData payload423 = ret.AsBlockPlaceEvent; + *(byte*)(ptr + 0) = (byte)28; + var handle424 = payload423.player.Handle; + payload423.player.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle424; + + var stringSpan429 = global::System.MemoryExtensions.AsSpan(payload423.blockPlaced); + var length427 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan429); + var strPtr425 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length427); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan429, new global::System.Span(strPtr425, length427)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length427; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr425; + + var stringSpan434 = global::System.MemoryExtensions.AsSpan(payload423.blockPlacedAgainst); + var length432 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan434); + var strPtr430 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length432); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan434, new global::System.Span(strPtr430, length432)); + + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = length432; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = (nint)(int)strPtr430; + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = payload423.blockPosition.Item1; + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = payload423.blockPosition.Item2; + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = payload423.blockPosition.Item3; + *(byte*)(ptr + 40) = (byte)(payload423.canBuild ? 1 : 0); + *(byte*)(ptr + 41) = (byte)(payload423.cancelled ? 1 : 0); + + break; + } + case 29: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerCommandEventData payload437 = ret.AsServerCommandEvent; + *(byte*)(ptr + 0) = (byte)29; + + var stringSpan442 = global::System.MemoryExtensions.AsSpan(payload437.command); + var length440 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan442); + var strPtr438 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length440); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan442, new global::System.Span(strPtr438, length440)); + + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = length440; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = (nint)(int)strPtr438; + *(byte*)(ptr + 16) = (byte)(payload437.cancelled ? 1 : 0); + + break; + } + case 30: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.SpawnChangeEventData payload445 = ret.AsSpawnChangeEvent; + *(byte*)(ptr + 0) = (byte)30; + var handle446 = payload445.targetWorld.Handle; + payload445.targetWorld.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle446; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = payload445.previousPosition.Item1; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = payload445.previousPosition.Item2; + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = payload445.previousPosition.Item3; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = unchecked((float)payload445.previousYaw); + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = unchecked((float)payload445.previousPitch); + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = payload445.newPosition.Item1; + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = payload445.newPosition.Item2; + new global::System.Span((void*)((byte*)ptr + 40), 1)[0] = payload445.newPosition.Item3; + new global::System.Span((void*)((byte*)ptr + 44), 1)[0] = unchecked((float)payload445.newYaw); + new global::System.Span((void*)((byte*)ptr + 48), 1)[0] = unchecked((float)payload445.newPitch); + + break; + } + case 31: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerBroadcastEventData payload449 = ret.AsServerBroadcastEvent; + *(byte*)(ptr + 0) = (byte)31; + var handle450 = payload449.message.Handle; + payload449.message.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle450; + var handle451 = payload449.sender.Handle; + payload449.sender.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = handle451; + *(byte*)(ptr + 16) = (byte)(payload449.cancelled ? 1 : 0); + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + ret); + } + return ptr; + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_handle-event")] + public static unsafe void cabi_post_wasmExportHandleEvent(nint p0) { + + switch (new global::System.Span((byte*)p0 + 0, 1)[0]) { + case 0: { + + break; + } + case 1: { + + break; + } + case 2: { + + break; + } + case 3: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + + break; + } + case 4: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + + break; + } + case 5: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + + break; + } + case 6: { + + break; + } + case 7: { + + break; + } + case 8: { + + break; + } + case 9: { + + break; + } + case 10: { + + break; + } + case 11: { + + break; + } + case 12: { + + break; + } + case 13: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + + break; + } + case 14: { + + switch (new global::System.Span((byte*)p0 + 12, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + + break; + } + } + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + + break; + } + case 15: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + + break; + } + case 16: { + + break; + } + case 17: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + + break; + } + case 18: { + + break; + } + case 19: { + + break; + } + case 20: { + + break; + } + case 21: { + + switch (new global::System.Span((byte*)p0 + 12, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + + break; + } + } + + switch (new global::System.Span((byte*)p0 + 32, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 36), 1)[0]); + + break; + } + } + + switch (new global::System.Span((byte*)p0 + 48, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 52), 1)[0]); + + break; + } + } + + break; + } + case 22: { + + switch (new global::System.Span((byte*)p0 + 12, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + + break; + } + } + + break; + } + case 23: { + + break; + } + case 24: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + + break; + } + case 25: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 8), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + + break; + } + case 26: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 8), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + + break; + } + case 27: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + + break; + } + case 28: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 20), 1)[0]); + + break; + } + case 29: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 8), 1)[0]); + + break; + } + case 30: { + + break; + } + case 31: { + + break; + } + } + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "handle-command")] + public static unsafe nint wasmExportHandleCommand(int p0, int p1, int p2, int p3) { + + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSender(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSender.THandle(p1)); + var resource0 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server.THandle(p2)); + var resource1 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.ConsumedArgs(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.ConsumedArgs.THandle(p3)); + Result ret; + + try + { + + ret = Result.Ok(PluginWorldExportsImpl.HandleCommand((unchecked((uint)(p0))), (resource), (resource0), (resource1))); + } + catch (WitException e) + { + switch (e.NestingLevel) + { + case 0: + { + ret = Result.Err((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandError) e.Value); + break; + } + + default: throw new global::System.ArgumentException($"invalid nesting level: {e.NestingLevel}"); + } + } + + var ptr = InteropReturnArea.returnArea.AddressOfReturnArea(); + + switch (ret.Tag) { + case 0: { + int payload = ret.AsOk; + *(byte*)(ptr + 0) = (byte)0; + new global::System.Span((void*)((byte*)ptr + 4), 1)[0] = payload; + + break; + } + case 1: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandError payload4 = ret.AsErr; + *(byte*)(ptr + 0) = (byte)1; + + switch (payload4.Tag) { + case 0: { + string? payload7 = payload4.AsInvalidConsumption; + *(byte*)(ptr + 4) = (byte)0; + + if (payload7 != null) { + var payload13 = (string) payload7; + *(byte*)(ptr + 8) = (byte)1; + + var stringSpan = global::System.MemoryExtensions.AsSpan(payload13); + var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan); + var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span(strPtr, length)); + + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = length; + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr; + + } else { + + *(byte*)(ptr + 8) = (byte)0; + + } + + break; + } + case 1: { + + *(byte*)(ptr + 4) = (byte)1; + + break; + } + case 2: { + + *(byte*)(ptr + 4) = (byte)2; + + break; + } + case 3: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent payload22 = payload4.AsCommandFailed; + *(byte*)(ptr + 4) = (byte)3; + var handle = payload22.Handle; + payload22.Handle = 0; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = handle; + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + payload4); + } + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + ret); + } + return ptr; + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_handle-command")] + public static unsafe void cabi_post_wasmExportHandleCommand(nint p0) { + + switch (new global::System.Span((byte*)p0 + 0, 1)[0]) { + case 0: { + + break; + } + case 1: { + + switch (new global::System.Span((byte*)p0 + 4, 1)[0]) { + case 0: { + + switch (new global::System.Span((byte*)p0 + 8, 1)[0]) { + case 0: { + + break; + } + case 1: { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 12), 1)[0]); + + break; + } + } + + break; + } + case 1: { + + break; + } + case 2: { + + break; + } + case 3: { + + break; + } + } + + break; + } + } + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "handle-task")] + public static unsafe void wasmExportHandleTask(int p0, int p1) { + + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server.THandle(p1)); + PluginWorldExportsImpl.HandleTask((unchecked((uint)(p0))), (resource)); + + } + } + } + +} diff --git a/src/gen/PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.IMetadataExports.cs b/src/gen/PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.IMetadataExports.cs new file mode 100644 index 0000000..1256f70 --- /dev/null +++ b/src/gen/PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.IMetadataExports.cs @@ -0,0 +1,26 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0; + +public interface IMetadataExports { + + public struct PluginMetadata { + public string name; + public string version; + public global::System.Collections.Generic.List authors; + public string description; + public global::System.Collections.Generic.List dependencies; + + public PluginMetadata(string name, string version, global::System.Collections.Generic.List authors, string description, global::System.Collections.Generic.List dependencies) { + this.name = name; + this.version = version; + this.authors = authors; + this.description = description; + this.dependencies = dependencies; + } + } + static abstract global::PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.IMetadataExports.PluginMetadata GetMetadata(); + +} diff --git a/src/gen/PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.MetadataExportsInterop.cs b/src/gen/PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.MetadataExportsInterop.cs new file mode 100644 index 0000000..5e62767 --- /dev/null +++ b/src/gen/PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.MetadataExportsInterop.cs @@ -0,0 +1,107 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0 +{ + public static class MetadataExportsInterop { + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "pumpkin:plugin/metadata@0.1.0#get-metadata")] + public static unsafe nint wasmExportGetMetadata() { + + global::PluginWorld.wit.Exports.pumpkin.plugin.v0_1_0.IMetadataExports.PluginMetadata ret; + ret = MetadataExportsImpl.GetMetadata(); + + var ptr = InteropReturnArea.returnArea.AddressOfReturnArea(); + + var stringSpan = global::System.MemoryExtensions.AsSpan(ret.name); + var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan); + var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span(strPtr, length)); + + new global::System.Span((void*)((byte*)ptr + 4), 1)[0] = length; + new global::System.Span((void*)((byte*)ptr + 0), 1)[0] = (nint)(int)strPtr; + + var stringSpan4 = global::System.MemoryExtensions.AsSpan(ret.version); + var length2 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan4); + var strPtr0 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length2); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan4, new global::System.Span(strPtr0, length2)); + + new global::System.Span((void*)((byte*)ptr + 12), 1)[0] = length2; + new global::System.Span((void*)((byte*)ptr + 8), 1)[0] = (nint)(int)strPtr0; + + var bufferSize = 8 * (nuint)ret.authors.Count; + void* address = global::System.Runtime.InteropServices.NativeMemory.AlignedAlloc(bufferSize, 4); + + for (int index = 0; index < ret.authors.Count; ++index) { + string element = ret.authors[index]; + int basePtr = (int)address + (index * 8); + + var stringSpan9 = global::System.MemoryExtensions.AsSpan(element); + var length7 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan9); + var strPtr5 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length7); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan9, new global::System.Span(strPtr5, length7)); + + new global::System.Span((void*)((byte*)basePtr + 4), 1)[0] = length7; + new global::System.Span((void*)((byte*)basePtr + 0), 1)[0] = (nint)(int)strPtr5; + + } + new global::System.Span((void*)((byte*)ptr + 20), 1)[0] = ret.authors.Count; + new global::System.Span((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)address; + + var stringSpan14 = global::System.MemoryExtensions.AsSpan(ret.description); + var length12 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan14); + var strPtr10 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length12); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan14, new global::System.Span(strPtr10, length12)); + + new global::System.Span((void*)((byte*)ptr + 28), 1)[0] = length12; + new global::System.Span((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr10; + + var bufferSize24 = 8 * (nuint)ret.dependencies.Count; + void* address23 = global::System.Runtime.InteropServices.NativeMemory.AlignedAlloc(bufferSize24, 4); + + for (int index22 = 0; index22 < ret.dependencies.Count; ++index22) { + string element15 = ret.dependencies[index22]; + int basePtr16 = (int)address23 + (index22 * 8); + + var stringSpan21 = global::System.MemoryExtensions.AsSpan(element15); + var length19 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan21); + var strPtr17 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length19); + global::System.Text.Encoding.UTF8.GetBytes(stringSpan21, new global::System.Span(strPtr17, length19)); + + new global::System.Span((void*)((byte*)basePtr16 + 4), 1)[0] = length19; + new global::System.Span((void*)((byte*)basePtr16 + 0), 1)[0] = (nint)(int)strPtr17; + + } + new global::System.Span((void*)((byte*)ptr + 36), 1)[0] = ret.dependencies.Count; + new global::System.Span((void*)((byte*)ptr + 32), 1)[0] = (nint)(int)address23; + return ptr; + + } + + [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_pumpkin:plugin/metadata@0.1.0#get-metadata")] + public static unsafe void cabi_post_wasmExportGetMetadata(nint p0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 0), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 8), 1)[0]); + + for (int index = 0; index < new global::System.Span((void*)((byte*)p0 + 20), 1)[0]; ++index) { + int basePtr = (int)new global::System.Span((void*)((byte*)p0 + 16), 1)[0] + (index * 8); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)basePtr + 0), 1)[0]); + + } + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 16), 1)[0]); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 24), 1)[0]); + + for (int index2 = 0; index2 < new global::System.Span((void*)((byte*)p0 + 36), 1)[0]; ++index2) { + int basePtr1 = (int)new global::System.Span((void*)((byte*)p0 + 32), 1)[0] + (index2 * 8); + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)basePtr1 + 0), 1)[0]); + + } + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)p0 + 32), 1)[0]); + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.BlockEntityImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.BlockEntityImportsInterop.cs new file mode 100644 index 0000000..06aa0b7 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.BlockEntityImportsInterop.cs @@ -0,0 +1,100 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class BlockEntityImportsInterop { + + internal static class BlockEntity + { + + public static class ResourceLocationWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]block-entity.resource-location"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportResourceLocation(int p0, nint p1); + } + + public static class GetPositionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]block-entity.get-position"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetPosition(int p0, nint p1); + } + + public static class GetIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]block-entity.get-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetId(int p0); + } + + public static class IsDirtyWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]block-entity.is-dirty"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsDirty(int p0); + } + + public static class ClearDirtyWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]block-entity.clear-dirty"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportClearDirty(int p0); + } + + } + + internal static class CommandBlockEntity + { + + public static class GetBlockEntityWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.get-block-entity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetBlockEntity(int p0); + } + + public static class LastOutputWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.last-output"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportLastOutput(int p0, nint p1); + } + + public static class TrackOutputWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.track-output"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportTrackOutput(int p0); + } + + public static class SuccessCountWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.success-count"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportSuccessCount(int p0); + } + + public static class CommandWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.command"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportCommand(int p0, nint p1); + } + + public static class AutoWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.auto"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportAuto(int p0); + } + + public static class ConditionMetWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.condition-met"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportConditionMet(int p0); + } + + public static class PoweredWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[method]command-block-entity.powered"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportPowered(int p0); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.BossBarImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.BossBarImportsInterop.cs new file mode 100644 index 0000000..00ebf50 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.BossBarImportsInterop.cs @@ -0,0 +1,107 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class BossBarImportsInterop { + + internal static class BossBar + { + + public static class ConstructorWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[constructor]boss-bar"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportConstructor(int p0, int p1, int p2); + } + + public static class GetTitleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.get-title"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetTitle(int p0); + } + + public static class SetTitleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.set-title"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetTitle(int p0, int p1); + } + + public static class GetHealthWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.get-health"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetHealth(int p0); + } + + public static class SetHealthWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.set-health"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetHealth(int p0, float p1); + } + + public static class GetColorWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.get-color"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetColor(int p0); + } + + public static class SetColorWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.set-color"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetColor(int p0, int p1); + } + + public static class GetDivisionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.get-division"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetDivision(int p0); + } + + public static class SetDivisionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.set-division"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetDivision(int p0, int p1); + } + + public static class GetMetadataWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.get-metadata"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetMetadata(int p0, nint p1); + } + + public static class SetMetadataWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.set-metadata"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetMetadata(int p0, int p1, int p2, int p3); + } + + public static class AddPlayerWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.add-player"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAddPlayer(int p0, int p1); + } + + public static class RemovePlayerWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.remove-player"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRemovePlayer(int p0, int p1); + } + + public static class GetPlayersWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.get-players"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetPlayers(int p0, nint p1); + } + + public static class RemoveAllWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[method]boss-bar.remove-all"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRemoveAll(int p0); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.CommandImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.CommandImportsInterop.cs new file mode 100644 index 0000000..3cef9b5 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.CommandImportsInterop.cs @@ -0,0 +1,176 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class CommandImportsInterop { + + internal static class ConsumedArgs + { + + public static class GetValueWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]consumed-args.get-value"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetValue(int p0, nint p1, int p2, nint p3); + } + + } + + internal static class CommandSender + { + + public static class GetCommandSenderTypeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.get-command-sender-type"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetCommandSenderType(int p0, nint p1); + } + + public static class SendMessageWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.send-message"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSendMessage(int p0, int p1); + } + + public static class SetSuccessCountWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.set-success-count"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetSuccessCount(int p0, int p1); + } + + public static class IsPlayerWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.is-player"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsPlayer(int p0); + } + + public static class IsConsoleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.is-console"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsConsole(int p0); + } + + public static class AsPlayerWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.as-player"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAsPlayer(int p0, nint p1); + } + + public static class PermissionLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.permission-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportPermissionLevel(int p0); + } + + public static class HasPermissionLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.has-permission-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportHasPermissionLevel(int p0, int p1); + } + + public static class HasPermissionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.has-permission"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportHasPermission(int p0, int p1, nint p2, int p3); + } + + public static class PositionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.position"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportPosition(int p0, nint p1); + } + + public static class WorldWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.world"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportWorld(int p0, nint p1); + } + + public static class GetLocaleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.get-locale"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetLocale(int p0); + } + + public static class ShouldReceiveFeedbackWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.should-receive-feedback"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportShouldReceiveFeedback(int p0); + } + + public static class ShouldBroadcastConsoleToOpsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.should-broadcast-console-to-ops"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportShouldBroadcastConsoleToOps(int p0); + } + + public static class ShouldTrackOutputWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-sender.should-track-output"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportShouldTrackOutput(int p0); + } + + } + + internal static class CommandNode + { + + public static class LiteralWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[static]command-node.literal"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportLiteral(nint p0, int p1); + } + + public static class ArgumentWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[static]command-node.argument"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportArgument(nint p0, int p1, int p2, nint p3, long p4, int p5, long p6); + } + + public static class ThenWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-node.then"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportThen(int p0, int p1); + } + + public static class ExecuteWithHandlerIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-node.execute-with-handler-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportExecuteWithHandlerId(int p0, int p1); + } + + public static class RequireWithHandlerIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command-node.require-with-handler-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRequireWithHandlerId(int p0, int p1); + } + + } + + internal static class Command + { + + public static class ConstructorWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[constructor]command"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportConstructor(nint p0, int p1, nint p2, int p3); + } + + public static class ThenWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command.then"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportThen(int p0, int p1); + } + + public static class ExecuteWithHandlerIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[method]command.execute-with-handler-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportExecuteWithHandlerId(int p0, int p1); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.CommonImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.CommonImportsInterop.cs new file mode 100644 index 0000000..e11ecb6 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.CommonImportsInterop.cs @@ -0,0 +1,12 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class CommonImportsInterop { + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ContextImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ContextImportsInterop.cs new file mode 100644 index 0000000..3ba93da --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ContextImportsInterop.cs @@ -0,0 +1,47 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class ContextImportsInterop { + + internal static class Context + { + + public static class RegisterEventWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/context@0.1.0", EntryPoint = "[method]context.register-event"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRegisterEvent(int p0, int p1, int p2, int p3, int p4); + } + + public static class RegisterCommandWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/context@0.1.0", EntryPoint = "[method]context.register-command"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRegisterCommand(int p0, int p1, nint p2, int p3); + } + + public static class RegisterPermissionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/context@0.1.0", EntryPoint = "[method]context.register-permission"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRegisterPermission(int p0, nint p1, int p2, nint p3, int p4, int p5, int p6, nint p7, int p8, nint p9); + } + + public static class GetDataFolderWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/context@0.1.0", EntryPoint = "[method]context.get-data-folder"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetDataFolder(int p0, nint p1); + } + + public static class GetServerWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/context@0.1.0", EntryPoint = "[method]context.get-server"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetServer(int p0); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.EntityImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.EntityImportsInterop.cs new file mode 100644 index 0000000..710f42e --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.EntityImportsInterop.cs @@ -0,0 +1,12 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class EntityImportsInterop { + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.EventImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.EventImportsInterop.cs new file mode 100644 index 0000000..ded162c --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.EventImportsInterop.cs @@ -0,0 +1,12 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class EventImportsInterop { + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.GuiImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.GuiImportsInterop.cs new file mode 100644 index 0000000..7d8a3f4 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.GuiImportsInterop.cs @@ -0,0 +1,83 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class GuiImportsInterop { + + internal static class Gui + { + + public static class ConstructorWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[constructor]gui"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportConstructor(int p0, int p1); + } + + public static class SetItemWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.set-item"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetItem(int p0, int p1, nint p2, int p3, int p4); + } + + public static class GetItemWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.get-item"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetItem(int p0, int p1, nint p2); + } + + public static class GetTypeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.get-type"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetType(int p0); + } + + public static class GetTitleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.get-title"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetTitle(int p0); + } + + public static class GetSizeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.get-size"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetSize(int p0); + } + + public static class ClearItemsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.clear-items"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportClearItems(int p0); + } + + public static class SetAllowGrabItemsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.set-allow-grab-items"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetAllowGrabItems(int p0, int p1); + } + + public static class GetAllowGrabItemsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.get-allow-grab-items"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetAllowGrabItems(int p0); + } + + public static class SetAllowPutItemsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.set-allow-put-items"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetAllowPutItems(int p0, int p1); + } + + public static class GetAllowPutItemsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[method]gui.get-allow-put-items"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetAllowPutItems(int p0); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.I18nImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.I18nImportsInterop.cs new file mode 100644 index 0000000..82f1fa3 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.I18nImportsInterop.cs @@ -0,0 +1,24 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class I18nImportsInterop { + + public static class TranslateWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/i18n@0.1.0", EntryPoint = "translate"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportTranslate(nint p0, int p1, int p2, nint p3); + } + + public static class LoadTranslationsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/i18n@0.1.0", EntryPoint = "load-translations"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportLoadTranslations(nint p0, int p1, nint p2, int p3, int p4); + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.cs new file mode 100644 index 0000000..d6d58e6 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.cs @@ -0,0 +1,222 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IBlockEntityImports { + + public class BlockEntityType { + public readonly byte Tag; + private readonly object? value; + + private BlockEntityType(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static BlockEntityType CommandBlockEntity(CommandBlockEntity commandBlockEntity) { + return new BlockEntityType(Tags.CommandBlockEntity, commandBlockEntity); + } + + public CommandBlockEntity AsCommandBlockEntity + { + get + { + if (Tag == Tags.CommandBlockEntity) + return (CommandBlockEntity)value!; + else + throw new global::System.ArgumentException("expected CommandBlockEntity, got " + Tag); + } + } + + public class Tags { + public const byte CommandBlockEntity = 0; + } + } + + public class BlockEntity: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public BlockEntity(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[resource-drop]block-entity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe string ResourceLocation() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + BlockEntityImportsInterop.BlockEntity.ResourceLocationWasmInterop.wasmImportResourceLocation(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe (int, int, int) GetPosition() + { + var handle = this.Handle; + + var retArea = stackalloc uint[4]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + BlockEntityImportsInterop.BlockEntity.GetPositionWasmInterop.wasmImportGetPosition(handle, ptr); + return (new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + + } + + public unsafe uint GetId() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.BlockEntity.GetIdWasmInterop.wasmImportGetId(handle); + return unchecked((uint)(result)); + + } + + public unsafe bool IsDirty() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.BlockEntity.IsDirtyWasmInterop.wasmImportIsDirty(handle); + return (result != 0); + + } + + public unsafe void ClearDirty() + { + var handle = this.Handle; + BlockEntityImportsInterop.BlockEntity.ClearDirtyWasmInterop.wasmImportClearDirty(handle); + + } + + } + + public class CommandBlockEntity: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public CommandBlockEntity(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/block-entity@0.1.0", EntryPoint = "[resource-drop]command-block-entity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.BlockEntity GetBlockEntity() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.CommandBlockEntity.GetBlockEntityWasmInterop.wasmImportGetBlockEntity(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.BlockEntity(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.BlockEntity.THandle(result)); + return resource; + + } + + public unsafe string LastOutput() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + BlockEntityImportsInterop.CommandBlockEntity.LastOutputWasmInterop.wasmImportLastOutput(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe bool TrackOutput() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.CommandBlockEntity.TrackOutputWasmInterop.wasmImportTrackOutput(handle); + return (result != 0); + + } + + public unsafe uint SuccessCount() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.CommandBlockEntity.SuccessCountWasmInterop.wasmImportSuccessCount(handle); + return unchecked((uint)(result)); + + } + + public unsafe string Command() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + BlockEntityImportsInterop.CommandBlockEntity.CommandWasmInterop.wasmImportCommand(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe bool Auto() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.CommandBlockEntity.AutoWasmInterop.wasmImportAuto(handle); + return (result != 0); + + } + + public unsafe bool ConditionMet() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.CommandBlockEntity.ConditionMetWasmInterop.wasmImportConditionMet(handle); + return (result != 0); + + } + + public unsafe bool Powered() + { + var handle = this.Handle; + var result = BlockEntityImportsInterop.CommandBlockEntity.PoweredWasmInterop.wasmImportPowered(handle); + return (result != 0); + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.cs new file mode 100644 index 0000000..ac2b0e2 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.cs @@ -0,0 +1,209 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IBossBarImports { + + /** + * Represents the color of a boss bar. + */ + + public enum BossBarColor { + PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE + } + + /** + * Represents the notches/divisions of a boss bar. + */ + + public enum BossBarDivision { + NO_DIVISION, NOTCHES_6, NOTCHES_10, NOTCHES_12, NOTCHES_20 + } + + /** + * Metadata flags that can be toggled on a boss bar. + */ + + public struct BossBarMetadata { + public bool darkenSky; + public bool dragonBar; + public bool createFog; + + public BossBarMetadata(bool darkenSky, bool dragonBar, bool createFog) { + this.darkenSky = darkenSky; + this.dragonBar = dragonBar; + this.createFog = createFog; + } + } + + /** + * Represents a boss bar that can be shown to players. + */ + + public class BossBar: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public BossBar(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/boss-bar@0.1.0", EntryPoint = "[resource-drop]boss-bar"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe BossBar(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent title, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarColor color, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarDivision division) + { + var handle = title.Handle; + title.Handle = 0; + var result = BossBarImportsInterop.BossBar.ConstructorWasmInterop.wasmImportConstructor(handle, (int)color, (int)division); + this.Handle = result; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent GetTitle() + { + var handle = this.Handle; + var result = BossBarImportsInterop.BossBar.GetTitleWasmInterop.wasmImportGetTitle(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(result)); + return resource; + + } + + public unsafe void SetTitle(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent title) + { + var handle = this.Handle; + var handle0 = title.Handle; + title.Handle = 0; + BossBarImportsInterop.BossBar.SetTitleWasmInterop.wasmImportSetTitle(handle, handle0); + + } + + public unsafe float GetHealth() + { + var handle = this.Handle; + var result = BossBarImportsInterop.BossBar.GetHealthWasmInterop.wasmImportGetHealth(handle); + return result; + + } + + public unsafe void SetHealth(float health) + { + var handle = this.Handle; + BossBarImportsInterop.BossBar.SetHealthWasmInterop.wasmImportSetHealth(handle, health); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarColor GetColor() + { + var handle = this.Handle; + var result = BossBarImportsInterop.BossBar.GetColorWasmInterop.wasmImportGetColor(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarColor)result; + + } + + public unsafe void SetColor(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarColor color) + { + var handle = this.Handle; + BossBarImportsInterop.BossBar.SetColorWasmInterop.wasmImportSetColor(handle, (int)color); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarDivision GetDivision() + { + var handle = this.Handle; + var result = BossBarImportsInterop.BossBar.GetDivisionWasmInterop.wasmImportGetDivision(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarDivision)result; + + } + + public unsafe void SetDivision(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarDivision division) + { + var handle = this.Handle; + BossBarImportsInterop.BossBar.SetDivisionWasmInterop.wasmImportSetDivision(handle, (int)division); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarMetadata GetMetadata() + { + var handle = this.Handle; + + var retArea = stackalloc byte[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 1); + BossBarImportsInterop.BossBar.GetMetadataWasmInterop.wasmImportGetMetadata(handle, ptr); + return new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarMetadata ( + (new global::System.Span((byte*)ptr + 0, 1)[0] != 0), (new global::System.Span((byte*)ptr + 1, 1)[0] != 0), (new global::System.Span((byte*)ptr + 2, 1)[0] != 0)); + + } + + public unsafe void SetMetadata(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBossBarImports.BossBarMetadata metadata) + { + var handle = this.Handle; + BossBarImportsInterop.BossBar.SetMetadataWasmInterop.wasmImportSetMetadata(handle, (metadata.darkenSky ? 1 : 0), (metadata.dragonBar ? 1 : 0), (metadata.createFog ? 1 : 0)); + + } + + public unsafe void AddPlayer(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player) + { + var handle = this.Handle; + var handle0 = player.Handle; + player.Handle = 0; + BossBarImportsInterop.BossBar.AddPlayerWasmInterop.wasmImportAddPlayer(handle, handle0); + + } + + public unsafe void RemovePlayer(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player) + { + var handle = this.Handle; + var handle0 = player.Handle; + player.Handle = 0; + BossBarImportsInterop.BossBar.RemovePlayerWasmInterop.wasmImportRemovePlayer(handle, handle0); + + } + + public unsafe global::System.Collections.Generic.List GetPlayers() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + BossBarImportsInterop.BossBar.GetPlayersWasmInterop.wasmImportGetPlayers(handle, ptr); + + var array = new global::System.Collections.Generic.List(new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + for (int index = 0; index < new global::System.Span((void*)((byte*)ptr + 4), 1)[0]; ++index) { + nint basePtr = new global::System.Span((void*)((byte*)ptr + 0), 1)[0] + (index * 4); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)basePtr + 0), 1)[0])); + + array.Add(resource); + } + + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + return array; + + } + + public unsafe void RemoveAll() + { + var handle = this.Handle; + BossBarImportsInterop.BossBar.RemoveAllWasmInterop.wasmImportRemoveAll(handle); + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.cs new file mode 100644 index 0000000..fc95f86 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.cs @@ -0,0 +1,2236 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface ICommandImports { + + public enum Gamemode { + SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR + } + + public enum BossbarColor { + PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE + } + + public enum BossbarStyle { + NO_DIVISION, NOTCHES6, NOTCHES10, NOTCHES12, NOTCHES20 + } + + public enum SoundCategory { + MASTER, MUSIC, RECORDS, WEATHER, BLOCKS, HOSTILE, NEUTRAL, PLAYERS, AMBIENT, VOICE, UI + } + + public enum EntityAnchor { + FEET, EYES + } + + public class Number { + public readonly byte Tag; + private readonly object? value; + + private Number(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static Number Float64(double float64) { + return new Number(Tags.Float64, float64); + } + + public static Number Float32(float float32) { + return new Number(Tags.Float32, float32); + } + + public static Number Int32(int int32) { + return new Number(Tags.Int32, int32); + } + + public static Number Int64(long int64) { + return new Number(Tags.Int64, int64); + } + + public double AsFloat64 + { + get + { + if (Tag == Tags.Float64) + return (double)value!; + else + throw new global::System.ArgumentException("expected Float64, got " + Tag); + } + } + + public float AsFloat32 + { + get + { + if (Tag == Tags.Float32) + return (float)value!; + else + throw new global::System.ArgumentException("expected Float32, got " + Tag); + } + } + + public int AsInt32 + { + get + { + if (Tag == Tags.Int32) + return (int)value!; + else + throw new global::System.ArgumentException("expected Int32, got " + Tag); + } + } + + public long AsInt64 + { + get + { + if (Tag == Tags.Int64) + return (long)value!; + else + throw new global::System.ArgumentException("expected Int64, got " + Tag); + } + } + + public class Tags { + public const byte Float64 = 0; + public const byte Float32 = 1; + public const byte Int32 = 2; + public const byte Int64 = 3; + } + } + + public class NotInBounds { + public readonly byte Tag; + private readonly object? value; + + private NotInBounds(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static NotInBounds LowerBound((Number, Number) lowerBound) { + return new NotInBounds(Tags.LowerBound, lowerBound); + } + + public static NotInBounds UpperBound((Number, Number) upperBound) { + return new NotInBounds(Tags.UpperBound, upperBound); + } + + public (Number, Number) AsLowerBound + { + get + { + if (Tag == Tags.LowerBound) + return ((Number, Number))value!; + else + throw new global::System.ArgumentException("expected LowerBound, got " + Tag); + } + } + + public (Number, Number) AsUpperBound + { + get + { + if (Tag == Tags.UpperBound) + return ((Number, Number))value!; + else + throw new global::System.ArgumentException("expected UpperBound, got " + Tag); + } + } + + public class Tags { + public const byte LowerBound = 0; + public const byte UpperBound = 1; + } + } + + public class Arg { + public readonly byte Tag; + private readonly object? value; + + private Arg(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static Arg Entities(global::System.Collections.Generic.List entities) { + return new Arg(Tags.Entities, entities); + } + + public static Arg Entity(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity entity) { + return new Arg(Tags.Entity, entity); + } + + public static Arg Players(global::System.Collections.Generic.List players) { + return new Arg(Tags.Players, players); + } + + public static Arg BlockPos((int, int, int) blockPos) { + return new Arg(Tags.BlockPos, blockPos); + } + + public static Arg Pos3d((double, double, double) pos3d) { + return new Arg(Tags.Pos3d, pos3d); + } + + public static Arg Pos2d((double, double) pos2d) { + return new Arg(Tags.Pos2d, pos2d); + } + + public static Arg Rotation((float, bool, float, bool) rotation) { + return new Arg(Tags.Rotation, rotation); + } + + public static Arg GameMode(Gamemode gameMode) { + return new Arg(Tags.GameMode, gameMode); + } + + public static Arg Difficulty(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Difficulty difficulty) { + return new Arg(Tags.Difficulty, difficulty); + } + + public static Arg Item(string item) { + return new Arg(Tags.Item, item); + } + + public static Arg ItemPredicate(string itemPredicate) { + return new Arg(Tags.ItemPredicate, itemPredicate); + } + + public static Arg ResourceLocation(string resourceLocation) { + return new Arg(Tags.ResourceLocation, resourceLocation); + } + + public static Arg Block(string block) { + return new Arg(Tags.Block, block); + } + + public static Arg BlockPredicate(string blockPredicate) { + return new Arg(Tags.BlockPredicate, blockPredicate); + } + + public static Arg BossbarColor(BossbarColor bossbarColor) { + return new Arg(Tags.BossbarColor, bossbarColor); + } + + public static Arg BossbarStyle(BossbarStyle bossbarStyle) { + return new Arg(Tags.BossbarStyle, bossbarStyle); + } + + public static Arg Particle(string particle) { + return new Arg(Tags.Particle, particle); + } + + public static Arg Msg(string msg) { + return new Arg(Tags.Msg, msg); + } + + public static Arg TextComponent(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent textComponent) { + return new Arg(Tags.TextComponent, textComponent); + } + + public static Arg Time(int time) { + return new Arg(Tags.Time, time); + } + + public static Arg Num(Result num) { + return new Arg(Tags.Num, num); + } + + public static Arg @bool(bool @bool) { + return new Arg(Tags.@bool, @bool); + } + + public static Arg Simple(string simple) { + return new Arg(Tags.Simple, simple); + } + + public static Arg SoundCategory(SoundCategory soundCategory) { + return new Arg(Tags.SoundCategory, soundCategory); + } + + public static Arg DamageType(string damageType) { + return new Arg(Tags.DamageType, damageType); + } + + public static Arg Effect(string effect) { + return new Arg(Tags.Effect, effect); + } + + public static Arg Enchantment(string enchantment) { + return new Arg(Tags.Enchantment, enchantment); + } + + public static Arg EntityAnchor(EntityAnchor entityAnchor) { + return new Arg(Tags.EntityAnchor, entityAnchor); + } + + public global::System.Collections.Generic.List AsEntities + { + get + { + if (Tag == Tags.Entities) + return (global::System.Collections.Generic.List)value!; + else + throw new global::System.ArgumentException("expected Entities, got " + Tag); + } + } + + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity AsEntity + { + get + { + if (Tag == Tags.Entity) + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity)value!; + else + throw new global::System.ArgumentException("expected Entity, got " + Tag); + } + } + + public global::System.Collections.Generic.List AsPlayers + { + get + { + if (Tag == Tags.Players) + return (global::System.Collections.Generic.List)value!; + else + throw new global::System.ArgumentException("expected Players, got " + Tag); + } + } + + public (int, int, int) AsBlockPos + { + get + { + if (Tag == Tags.BlockPos) + return ((int, int, int))value!; + else + throw new global::System.ArgumentException("expected BlockPos, got " + Tag); + } + } + + public (double, double, double) AsPos3d + { + get + { + if (Tag == Tags.Pos3d) + return ((double, double, double))value!; + else + throw new global::System.ArgumentException("expected Pos3d, got " + Tag); + } + } + + public (double, double) AsPos2d + { + get + { + if (Tag == Tags.Pos2d) + return ((double, double))value!; + else + throw new global::System.ArgumentException("expected Pos2d, got " + Tag); + } + } + + public (float, bool, float, bool) AsRotation + { + get + { + if (Tag == Tags.Rotation) + return ((float, bool, float, bool))value!; + else + throw new global::System.ArgumentException("expected Rotation, got " + Tag); + } + } + + public Gamemode AsGameMode + { + get + { + if (Tag == Tags.GameMode) + return (Gamemode)value!; + else + throw new global::System.ArgumentException("expected GameMode, got " + Tag); + } + } + + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Difficulty AsDifficulty + { + get + { + if (Tag == Tags.Difficulty) + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Difficulty)value!; + else + throw new global::System.ArgumentException("expected Difficulty, got " + Tag); + } + } + + public string AsItem + { + get + { + if (Tag == Tags.Item) + return (string)value!; + else + throw new global::System.ArgumentException("expected Item, got " + Tag); + } + } + + public string AsItemPredicate + { + get + { + if (Tag == Tags.ItemPredicate) + return (string)value!; + else + throw new global::System.ArgumentException("expected ItemPredicate, got " + Tag); + } + } + + public string AsResourceLocation + { + get + { + if (Tag == Tags.ResourceLocation) + return (string)value!; + else + throw new global::System.ArgumentException("expected ResourceLocation, got " + Tag); + } + } + + public string AsBlock + { + get + { + if (Tag == Tags.Block) + return (string)value!; + else + throw new global::System.ArgumentException("expected Block, got " + Tag); + } + } + + public string AsBlockPredicate + { + get + { + if (Tag == Tags.BlockPredicate) + return (string)value!; + else + throw new global::System.ArgumentException("expected BlockPredicate, got " + Tag); + } + } + + public BossbarColor AsBossbarColor + { + get + { + if (Tag == Tags.BossbarColor) + return (BossbarColor)value!; + else + throw new global::System.ArgumentException("expected BossbarColor, got " + Tag); + } + } + + public BossbarStyle AsBossbarStyle + { + get + { + if (Tag == Tags.BossbarStyle) + return (BossbarStyle)value!; + else + throw new global::System.ArgumentException("expected BossbarStyle, got " + Tag); + } + } + + public string AsParticle + { + get + { + if (Tag == Tags.Particle) + return (string)value!; + else + throw new global::System.ArgumentException("expected Particle, got " + Tag); + } + } + + public string AsMsg + { + get + { + if (Tag == Tags.Msg) + return (string)value!; + else + throw new global::System.ArgumentException("expected Msg, got " + Tag); + } + } + + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent AsTextComponent + { + get + { + if (Tag == Tags.TextComponent) + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent)value!; + else + throw new global::System.ArgumentException("expected TextComponent, got " + Tag); + } + } + + public int AsTime + { + get + { + if (Tag == Tags.Time) + return (int)value!; + else + throw new global::System.ArgumentException("expected Time, got " + Tag); + } + } + + public Result AsNum + { + get + { + if (Tag == Tags.Num) + return (Result)value!; + else + throw new global::System.ArgumentException("expected Num, got " + Tag); + } + } + + public bool AsBool + { + get + { + if (Tag == Tags.@bool) + return (bool)value!; + else + throw new global::System.ArgumentException("expected @bool, got " + Tag); + } + } + + public string AsSimple + { + get + { + if (Tag == Tags.Simple) + return (string)value!; + else + throw new global::System.ArgumentException("expected Simple, got " + Tag); + } + } + + public SoundCategory AsSoundCategory + { + get + { + if (Tag == Tags.SoundCategory) + return (SoundCategory)value!; + else + throw new global::System.ArgumentException("expected SoundCategory, got " + Tag); + } + } + + public string AsDamageType + { + get + { + if (Tag == Tags.DamageType) + return (string)value!; + else + throw new global::System.ArgumentException("expected DamageType, got " + Tag); + } + } + + public string AsEffect + { + get + { + if (Tag == Tags.Effect) + return (string)value!; + else + throw new global::System.ArgumentException("expected Effect, got " + Tag); + } + } + + public string AsEnchantment + { + get + { + if (Tag == Tags.Enchantment) + return (string)value!; + else + throw new global::System.ArgumentException("expected Enchantment, got " + Tag); + } + } + + public EntityAnchor AsEntityAnchor + { + get + { + if (Tag == Tags.EntityAnchor) + return (EntityAnchor)value!; + else + throw new global::System.ArgumentException("expected EntityAnchor, got " + Tag); + } + } + + public class Tags { + public const byte Entities = 0; + public const byte Entity = 1; + public const byte Players = 2; + public const byte BlockPos = 3; + public const byte Pos3d = 4; + public const byte Pos2d = 5; + public const byte Rotation = 6; + public const byte GameMode = 7; + public const byte Difficulty = 8; + public const byte Item = 9; + public const byte ItemPredicate = 10; + public const byte ResourceLocation = 11; + public const byte Block = 12; + public const byte BlockPredicate = 13; + public const byte BossbarColor = 14; + public const byte BossbarStyle = 15; + public const byte Particle = 16; + public const byte Msg = 17; + public const byte TextComponent = 18; + public const byte Time = 19; + public const byte Num = 20; + public const byte @bool = 21; + public const byte Simple = 22; + public const byte SoundCategory = 23; + public const byte DamageType = 24; + public const byte Effect = 25; + public const byte Enchantment = 26; + public const byte EntityAnchor = 27; + } + } + + public class CommandSenderType { + public readonly byte Tag; + private readonly object? value; + + private CommandSenderType(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static CommandSenderType Rcon() { + return new CommandSenderType(Tags.Rcon, null); + } + + public static CommandSenderType Console() { + return new CommandSenderType(Tags.Console, null); + } + + public static CommandSenderType Player(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player) { + return new CommandSenderType(Tags.Player, player); + } + + public static CommandSenderType CommandBlock((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.CommandBlockEntity, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World) commandBlock) { + return new CommandSenderType(Tags.CommandBlock, commandBlock); + } + + public static CommandSenderType Dummy() { + return new CommandSenderType(Tags.Dummy, null); + } + + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player AsPlayer + { + get + { + if (Tag == Tags.Player) + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player)value!; + else + throw new global::System.ArgumentException("expected Player, got " + Tag); + } + } + + public (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.CommandBlockEntity, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World) AsCommandBlock + { + get + { + if (Tag == Tags.CommandBlock) + return ((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.CommandBlockEntity, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World))value!; + else + throw new global::System.ArgumentException("expected CommandBlock, got " + Tag); + } + } + + public class Tags { + public const byte Rcon = 0; + public const byte Console = 1; + public const byte Player = 2; + public const byte CommandBlock = 3; + public const byte Dummy = 4; + } + } + + public enum PermissionLevel { + ZERO, ONE, TWO, THREE, FOUR + } + + public enum StringType { + SINGLE_WORD, QUOTABLE, GREEDY + } + + public class ArgumentType { + public readonly byte Tag; + private readonly object? value; + + private ArgumentType(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static ArgumentType @bool() { + return new ArgumentType(Tags.@bool, null); + } + + public static ArgumentType @float((float?, float?) @float) { + return new ArgumentType(Tags.@float, @float); + } + + public static ArgumentType @double((double?, double?) @double) { + return new ArgumentType(Tags.@double, @double); + } + + public static ArgumentType Integer((int?, int?) integer) { + return new ArgumentType(Tags.Integer, integer); + } + + public static ArgumentType @long((long?, long?) @long) { + return new ArgumentType(Tags.@long, @long); + } + + public static ArgumentType @string(StringType @string) { + return new ArgumentType(Tags.@string, @string); + } + + public static ArgumentType Entities() { + return new ArgumentType(Tags.Entities, null); + } + + public static ArgumentType Entity() { + return new ArgumentType(Tags.Entity, null); + } + + public static ArgumentType Players() { + return new ArgumentType(Tags.Players, null); + } + + public static ArgumentType GameProfile() { + return new ArgumentType(Tags.GameProfile, null); + } + + public static ArgumentType BlockPos() { + return new ArgumentType(Tags.BlockPos, null); + } + + public static ArgumentType Position3d() { + return new ArgumentType(Tags.Position3d, null); + } + + public static ArgumentType Position2d() { + return new ArgumentType(Tags.Position2d, null); + } + + public static ArgumentType BlockState() { + return new ArgumentType(Tags.BlockState, null); + } + + public static ArgumentType BlockPredicate() { + return new ArgumentType(Tags.BlockPredicate, null); + } + + public static ArgumentType Item() { + return new ArgumentType(Tags.Item, null); + } + + public static ArgumentType ItemPredicate() { + return new ArgumentType(Tags.ItemPredicate, null); + } + + public static ArgumentType Component() { + return new ArgumentType(Tags.Component, null); + } + + public static ArgumentType Rotation() { + return new ArgumentType(Tags.Rotation, null); + } + + public static ArgumentType ResourceLocation() { + return new ArgumentType(Tags.ResourceLocation, null); + } + + public static ArgumentType EntityAnchor() { + return new ArgumentType(Tags.EntityAnchor, null); + } + + public static ArgumentType Gamemode() { + return new ArgumentType(Tags.Gamemode, null); + } + + public static ArgumentType Difficulty() { + return new ArgumentType(Tags.Difficulty, null); + } + + public static ArgumentType Time(int time) { + return new ArgumentType(Tags.Time, time); + } + + public static ArgumentType Resource(string resource) { + return new ArgumentType(Tags.Resource, resource); + } + + public (float?, float?) AsFloat + { + get + { + if (Tag == Tags.@float) + return ((float?, float?))value!; + else + throw new global::System.ArgumentException("expected @float, got " + Tag); + } + } + + public (double?, double?) AsDouble + { + get + { + if (Tag == Tags.@double) + return ((double?, double?))value!; + else + throw new global::System.ArgumentException("expected @double, got " + Tag); + } + } + + public (int?, int?) AsInteger + { + get + { + if (Tag == Tags.Integer) + return ((int?, int?))value!; + else + throw new global::System.ArgumentException("expected Integer, got " + Tag); + } + } + + public (long?, long?) AsLong + { + get + { + if (Tag == Tags.@long) + return ((long?, long?))value!; + else + throw new global::System.ArgumentException("expected @long, got " + Tag); + } + } + + public StringType AsString + { + get + { + if (Tag == Tags.@string) + return (StringType)value!; + else + throw new global::System.ArgumentException("expected @string, got " + Tag); + } + } + + public int AsTime + { + get + { + if (Tag == Tags.Time) + return (int)value!; + else + throw new global::System.ArgumentException("expected Time, got " + Tag); + } + } + + public string AsResource + { + get + { + if (Tag == Tags.Resource) + return (string)value!; + else + throw new global::System.ArgumentException("expected Resource, got " + Tag); + } + } + + public class Tags { + public const byte @bool = 0; + public const byte @float = 1; + public const byte @double = 2; + public const byte Integer = 3; + public const byte @long = 4; + public const byte @string = 5; + public const byte Entities = 6; + public const byte Entity = 7; + public const byte Players = 8; + public const byte GameProfile = 9; + public const byte BlockPos = 10; + public const byte Position3d = 11; + public const byte Position2d = 12; + public const byte BlockState = 13; + public const byte BlockPredicate = 14; + public const byte Item = 15; + public const byte ItemPredicate = 16; + public const byte Component = 17; + public const byte Rotation = 18; + public const byte ResourceLocation = 19; + public const byte EntityAnchor = 20; + public const byte Gamemode = 21; + public const byte Difficulty = 22; + public const byte Time = 23; + public const byte Resource = 24; + } + } + + public class CommandError { + public readonly byte Tag; + private readonly object? value; + + private CommandError(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static CommandError InvalidConsumption(string? invalidConsumption) { + return new CommandError(Tags.InvalidConsumption, invalidConsumption); + } + + public static CommandError InvalidRequirement() { + return new CommandError(Tags.InvalidRequirement, null); + } + + public static CommandError PermissionDenied() { + return new CommandError(Tags.PermissionDenied, null); + } + + public static CommandError CommandFailed(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent commandFailed) { + return new CommandError(Tags.CommandFailed, commandFailed); + } + + public string? AsInvalidConsumption + { + get + { + if (Tag == Tags.InvalidConsumption) + return (string?)value!; + else + throw new global::System.ArgumentException("expected InvalidConsumption, got " + Tag); + } + } + + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent AsCommandFailed + { + get + { + if (Tag == Tags.CommandFailed) + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent)value!; + else + throw new global::System.ArgumentException("expected CommandFailed, got " + Tag); + } + } + + public class Tags { + public const byte InvalidConsumption = 0; + public const byte InvalidRequirement = 1; + public const byte PermissionDenied = 2; + public const byte CommandFailed = 3; + } + } + + public class ConsumedArgs: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public ConsumedArgs(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[resource-drop]consumed-args"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg GetValue(string key) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(key); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var retArea = stackalloc ulong[8]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 8); + CommandImportsInterop.ConsumedArgs.GetValueWasmInterop.wasmImportGetValue(handle, strPtr.ToInt32(), length, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg lifted127; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + + var array = new global::System.Collections.Generic.List(new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + for (int index = 0; index < new global::System.Span((void*)((byte*)ptr + 12), 1)[0]; ++index) { + nint basePtr1 = new global::System.Span((void*)((byte*)ptr + 8), 1)[0] + (index * 4); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity.THandle(new global::System.Span((void*)((byte*)basePtr1 + 0), 1)[0])); + + array.Add(resource); + } + + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Entities(array); + break; + } + case 1: { + var resource4 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity.THandle(new global::System.Span((void*)((byte*)ptr + 8), 1)[0])); + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Entity(resource4); + break; + } + case 2: { + + var array10 = new global::System.Collections.Generic.List(new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + for (int index11 = 0; index11 < new global::System.Span((void*)((byte*)ptr + 12), 1)[0]; ++index11) { + nint basePtr8 = new global::System.Span((void*)((byte*)ptr + 8), 1)[0] + (index11 * 4); + var resource9 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)basePtr8 + 0), 1)[0])); + + array10.Add(resource9); + } + + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Players(array10); + break; + } + case 3: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.BlockPos((new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0], new global::System.Span((void*)((byte*)ptr + 16), 1)[0])); + break; + } + case 4: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Pos3d((new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 16), 1)[0], new global::System.Span((void*)((byte*)ptr + 24), 1)[0])); + break; + } + case 5: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Pos2d((new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 16), 1)[0])); + break; + } + case 6: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Rotation((new global::System.Span((void*)((byte*)ptr + 8), 1)[0], (new global::System.Span((byte*)ptr + 12, 1)[0] != 0), new global::System.Span((void*)((byte*)ptr + 16), 1)[0], (new global::System.Span((byte*)ptr + 20, 1)[0] != 0))); + break; + } + case 7: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.GameMode((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Gamemode)new global::System.Span((byte*)ptr + 8, 1)[0]); + break; + } + case 8: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Difficulty((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Difficulty)new global::System.Span((byte*)ptr + 8, 1)[0]); + break; + } + case 9: { + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Item(str); + break; + } + case 10: { + + var str28 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.ItemPredicate(str28); + break; + } + case 11: { + + var str31 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.ResourceLocation(str31); + break; + } + case 12: { + + var str34 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Block(str34); + break; + } + case 13: { + + var str37 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.BlockPredicate(str37); + break; + } + case 14: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.BossbarColor((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.BossbarColor)new global::System.Span((byte*)ptr + 8, 1)[0]); + break; + } + case 15: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.BossbarStyle((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.BossbarStyle)new global::System.Span((byte*)ptr + 8, 1)[0]); + break; + } + case 16: { + + var str44 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Particle(str44); + break; + } + case 17: { + + var str47 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Msg(str47); + break; + } + case 18: { + var resource50 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span((void*)((byte*)ptr + 8), 1)[0])); + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.TextComponent(resource50); + break; + } + case 19: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Time(new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + break; + } + case 20: { + + Result lifted108; + + switch (new global::System.Span((byte*)ptr + 8, 1)[0]) { + case 0: { + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number lifted; + + switch (new global::System.Span((byte*)ptr + 16, 1)[0]) { + case 0: { + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float64(new global::System.Span((void*)((byte*)ptr + 24), 1)[0]); + break; + } + case 1: { + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float32(new global::System.Span((void*)((byte*)ptr + 24), 1)[0]); + break; + } + case 2: { + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int32(new global::System.Span((void*)((byte*)ptr + 24), 1)[0]); + break; + } + case 3: { + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int64(new global::System.Span((void*)((byte*)ptr + 24), 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 16, 1)[0]); + } + + lifted108 = Result.Ok(lifted); + break; + } + case 1: { + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.NotInBounds lifted107; + + switch (new global::System.Span((byte*)ptr + 16, 1)[0]) { + case 0: { + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number lifted77; + + switch (new global::System.Span((byte*)ptr + 24, 1)[0]) { + case 0: { + + lifted77 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float64(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + case 1: { + + lifted77 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float32(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + case 2: { + + lifted77 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int32(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + case 3: { + + lifted77 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int64(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 24, 1)[0]); + } + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number lifted86; + + switch (new global::System.Span((byte*)ptr + 40, 1)[0]) { + case 0: { + + lifted86 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float64(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + case 1: { + + lifted86 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float32(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + case 2: { + + lifted86 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int32(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + case 3: { + + lifted86 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int64(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 40, 1)[0]); + } + + lifted107 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.NotInBounds.LowerBound((lifted77, lifted86)); + break; + } + case 1: { + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number lifted97; + + switch (new global::System.Span((byte*)ptr + 24, 1)[0]) { + case 0: { + + lifted97 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float64(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + case 1: { + + lifted97 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float32(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + case 2: { + + lifted97 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int32(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + case 3: { + + lifted97 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int64(new global::System.Span((void*)((byte*)ptr + 32), 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 24, 1)[0]); + } + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number lifted106; + + switch (new global::System.Span((byte*)ptr + 40, 1)[0]) { + case 0: { + + lifted106 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float64(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + case 1: { + + lifted106 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Float32(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + case 2: { + + lifted106 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int32(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + case 3: { + + lifted106 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Number.Int64(new global::System.Span((void*)((byte*)ptr + 48), 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 40, 1)[0]); + } + + lifted107 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.NotInBounds.UpperBound((lifted97, lifted106)); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 16, 1)[0]); + } + + lifted108 = Result.Err(lifted107); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 8, 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Num(lifted108); + break; + } + case 21: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.@bool((new global::System.Span((byte*)ptr + 8, 1)[0] != 0)); + break; + } + case 22: { + + var str113 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Simple(str113); + break; + } + case 23: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.SoundCategory((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.SoundCategory)new global::System.Span((byte*)ptr + 8, 1)[0]); + break; + } + case 24: { + + var str118 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.DamageType(str118); + break; + } + case 25: { + + var str121 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Effect(str121); + break; + } + case 26: { + + var str124 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 12), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + } + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.Enchantment(str124); + break; + } + case 27: { + + lifted127 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Arg.EntityAnchor((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.EntityAnchor)new global::System.Span((byte*)ptr + 8, 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 0, 1)[0]); + } + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return lifted127; + + } + + } + + public class CommandSender: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public CommandSender(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[resource-drop]command-sender"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSenderType GetCommandSenderType() + { + var handle = this.Handle; + + var retArea = stackalloc uint[4]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + CommandImportsInterop.CommandSender.GetCommandSenderTypeWasmInterop.wasmImportGetCommandSenderType(handle, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSenderType lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSenderType.Rcon(); + break; + } + case 1: { + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSenderType.Console(); + break; + } + case 2: { + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSenderType.Player(resource); + break; + } + case 3: { + var resource6 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.CommandBlockEntity(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IBlockEntityImports.CommandBlockEntity.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + var resource7 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)ptr + 8), 1)[0])); + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSenderType.CommandBlock((resource6, resource7)); + break; + } + case 4: { + + lifted = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSenderType.Dummy(); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 0, 1)[0]); + } + return lifted; + + } + + public unsafe void SendMessage(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent text) + { + var handle = this.Handle; + var handle0 = text.Handle; + text.Handle = 0; + CommandImportsInterop.CommandSender.SendMessageWasmInterop.wasmImportSendMessage(handle, handle0); + + } + + public unsafe void SetSuccessCount(int count) + { + var handle = this.Handle; + CommandImportsInterop.CommandSender.SetSuccessCountWasmInterop.wasmImportSetSuccessCount(handle, count); + + } + + public unsafe bool IsPlayer() + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.IsPlayerWasmInterop.wasmImportIsPlayer(handle); + return (result != 0); + + } + + public unsafe bool IsConsole() + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.IsConsoleWasmInterop.wasmImportIsConsole(handle); + return (result != 0); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? AsPlayer() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + CommandImportsInterop.CommandSender.AsPlayerWasmInterop.wasmImportAsPlayer(handle, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + + lifted = resource; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.PermissionLevel PermissionLevel() + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.PermissionLevelWasmInterop.wasmImportPermissionLevel(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.PermissionLevel)result; + + } + + public unsafe bool HasPermissionLevel(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.PermissionLevel level) + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.HasPermissionLevelWasmInterop.wasmImportHasPermissionLevel(handle, (int)level); + return (result != 0); + + } + + public unsafe bool HasPermission(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server server, string node) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + var handle0 = server.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(node); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var result = CommandImportsInterop.CommandSender.HasPermissionWasmInterop.wasmImportHasPermission(handle, handle0, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return (result != 0); + + } + + public unsafe (double, double, double)? Position() + { + var handle = this.Handle; + + var retArea = stackalloc ulong[5]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 8); + CommandImportsInterop.CommandSender.PositionWasmInterop.wasmImportPosition(handle, ptr); + + (double, double, double)? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + lifted = (new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 16), 1)[0], new global::System.Span((void*)((byte*)ptr + 24), 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World? World() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + CommandImportsInterop.CommandSender.WorldWasmInterop.wasmImportWorld(handle, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + + lifted = resource; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Locale GetLocale() + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.GetLocaleWasmInterop.wasmImportGetLocale(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Locale)result; + + } + + public unsafe bool ShouldReceiveFeedback() + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.ShouldReceiveFeedbackWasmInterop.wasmImportShouldReceiveFeedback(handle); + return (result != 0); + + } + + public unsafe bool ShouldBroadcastConsoleToOps() + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.ShouldBroadcastConsoleToOpsWasmInterop.wasmImportShouldBroadcastConsoleToOps(handle); + return (result != 0); + + } + + public unsafe bool ShouldTrackOutput() + { + var handle = this.Handle; + var result = CommandImportsInterop.CommandSender.ShouldTrackOutputWasmInterop.wasmImportShouldTrackOutput(handle); + return (result != 0); + + } + + } + + public class CommandNode: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public CommandNode(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[resource-drop]command-node"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public static unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode Literal(string name) + { + var cleanups = new global::System.Collections.Generic.List(); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var result = CommandImportsInterop.CommandNode.LiteralWasmInterop.wasmImportLiteral(strPtr.ToInt32(), length); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode.THandle(result)); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return resource; + + } + + public static unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode Argument(string name, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.ArgumentType argType) + { + var cleanups = new global::System.Collections.Generic.List(); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + int lowered139; + nint lowered140; + long lowered141; + int lowered142; + long lowered143; + + switch (argType.Tag) { + case 0: { + + lowered139 = 0; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 1: { + (float?, float?) payload2 = argType.AsFloat; + + int lowered; + float lowered9; + + if (payload2.Item1 != null) { + var payload8 = (float) payload2.Item1; + + lowered = 1; + lowered9 = payload8; + + } else { + + lowered = 0; + lowered9 = 0.0F; + + } + + int lowered16; + float lowered17; + + if (payload2.Item2 != null) { + var payload15 = (float) payload2.Item2; + + lowered16 = 1; + lowered17 = payload15; + + } else { + + lowered16 = 0; + lowered17 = 0.0F; + + } + + lowered139 = 1; + lowered140 = lowered; + lowered141 = global::System.BitConverter.SingleToInt32Bits(lowered9); + lowered142 = lowered16; + lowered143 = global::System.BitConverter.SingleToInt32Bits(lowered17); + + break; + } + case 2: { + (double?, double?) payload20 = argType.AsDouble; + + int lowered27; + double lowered28; + + if (payload20.Item1 != null) { + var payload26 = (double) payload20.Item1; + + lowered27 = 1; + lowered28 = payload26; + + } else { + + lowered27 = 0; + lowered28 = 0.0D; + + } + + int lowered35; + double lowered36; + + if (payload20.Item2 != null) { + var payload34 = (double) payload20.Item2; + + lowered35 = 1; + lowered36 = payload34; + + } else { + + lowered35 = 0; + lowered36 = 0.0D; + + } + + lowered139 = 2; + lowered140 = lowered27; + lowered141 = global::System.BitConverter.DoubleToInt64Bits(lowered28); + lowered142 = lowered35; + lowered143 = global::System.BitConverter.DoubleToInt64Bits(lowered36); + + break; + } + case 3: { + (int?, int?) payload39 = argType.AsInteger; + + int lowered46; + int lowered47; + + if (payload39.Item1 != null) { + var payload45 = (int) payload39.Item1; + + lowered46 = 1; + lowered47 = payload45; + + } else { + + lowered46 = 0; + lowered47 = 0; + + } + + int lowered54; + int lowered55; + + if (payload39.Item2 != null) { + var payload53 = (int) payload39.Item2; + + lowered54 = 1; + lowered55 = payload53; + + } else { + + lowered54 = 0; + lowered55 = 0; + + } + + lowered139 = 3; + lowered140 = lowered46; + lowered141 = (long) (lowered47); + lowered142 = lowered54; + lowered143 = (long) (lowered55); + + break; + } + case 4: { + (long?, long?) payload58 = argType.AsLong; + + int lowered65; + long lowered66; + + if (payload58.Item1 != null) { + var payload64 = (long) payload58.Item1; + + lowered65 = 1; + lowered66 = payload64; + + } else { + + lowered65 = 0; + lowered66 = 0L; + + } + + int lowered73; + long lowered74; + + if (payload58.Item2 != null) { + var payload72 = (long) payload58.Item2; + + lowered73 = 1; + lowered74 = payload72; + + } else { + + lowered73 = 0; + lowered74 = 0L; + + } + + lowered139 = 4; + lowered140 = lowered65; + lowered141 = lowered66; + lowered142 = lowered73; + lowered143 = lowered74; + + break; + } + case 5: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.StringType payload77 = argType.AsString; + + lowered139 = 5; + lowered140 = (int)payload77; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 6: { + + lowered139 = 6; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 7: { + + lowered139 = 7; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 8: { + + lowered139 = 8; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 9: { + + lowered139 = 9; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 10: { + + lowered139 = 10; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 11: { + + lowered139 = 11; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 12: { + + lowered139 = 12; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 13: { + + lowered139 = 13; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 14: { + + lowered139 = 14; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 15: { + + lowered139 = 15; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 16: { + + lowered139 = 16; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 17: { + + lowered139 = 17; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 18: { + + lowered139 = 18; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 19: { + + lowered139 = 19; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 20: { + + lowered139 = 20; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 21: { + + lowered139 = 21; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 22: { + + lowered139 = 22; + lowered140 = 0; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 23: { + int payload131 = argType.AsTime; + + lowered139 = 23; + lowered140 = payload131; + lowered141 = 0L; + lowered142 = 0; + lowered143 = 0L; + + break; + } + case 24: { + string payload134 = argType.AsResource; + + var utf8Bytes136 = global::System.Text.Encoding.UTF8.GetBytes(payload134); + var length137 = utf8Bytes136.Length; + var gcHandle138 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes136, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr135 = gcHandle138.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle138.Free()); + + lowered139 = 24; + lowered140 = strPtr135.ToInt32(); + lowered141 = (long) (length137); + lowered142 = 0; + lowered143 = 0L; + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + argType); + } + var result = CommandImportsInterop.CommandNode.ArgumentWasmInterop.wasmImportArgument(strPtr.ToInt32(), length, lowered139, lowered140, lowered141, lowered142, lowered143); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode.THandle(result)); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return resource; + + } + + public unsafe void Then(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode node) + { + var handle = this.Handle; + var handle0 = node.Handle; + node.Handle = 0; + CommandImportsInterop.CommandNode.ThenWasmInterop.wasmImportThen(handle, handle0); + + } + + public unsafe void ExecuteWithHandlerId(uint handlerId) + { + var handle = this.Handle; + CommandImportsInterop.CommandNode.ExecuteWithHandlerIdWasmInterop.wasmImportExecuteWithHandlerId(handle, unchecked((int)(handlerId))); + + } + + public unsafe void RequireWithHandlerId(uint handlerId) + { + var handle = this.Handle; + CommandImportsInterop.CommandNode.RequireWithHandlerIdWasmInterop.wasmImportRequireWithHandlerId(handle, unchecked((int)(handlerId))); + + } + + } + + public class Command: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public Command(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/command@0.1.0", EntryPoint = "[resource-drop]command"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe Command(global::System.Collections.Generic.List names, string description) + { + var cleanups = new global::System.Collections.Generic.List(); + + void* address; + if ((8 * names.Count) < 1024) { + var retArea = stackalloc uint[2 * names.Count + 1]; + address = MemoryHelper.AlignStackPtr(retArea, 4); + } + else + { + var bufferSize = 8 * (nuint)names.Count; + address = global::System.Runtime.InteropServices.NativeMemory.AlignedAlloc(bufferSize, 4); + cleanups.Add(() => global::System.Runtime.InteropServices.NativeMemory.AlignedFree(address)); + } + + for (int index = 0; index < names.Count; ++index) { + string element = names[index]; + int basePtr = (int)address + (index * 8); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(element); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + new global::System.Span((void*)((byte*)basePtr + 4), 1)[0] = length; + new global::System.Span((void*)((byte*)basePtr + 0), 1)[0] = (nint)strPtr.ToInt32(); + + } + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(description); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + var result = CommandImportsInterop.Command.ConstructorWasmInterop.wasmImportConstructor((int)address, names.Count, strPtr0.ToInt32(), length2); + this.Handle = result; + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void Then(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandNode node) + { + var handle = this.Handle; + var handle0 = node.Handle; + node.Handle = 0; + CommandImportsInterop.Command.ThenWasmInterop.wasmImportThen(handle, handle0); + + } + + public unsafe void ExecuteWithHandlerId(uint handlerId) + { + var handle = this.Handle; + CommandImportsInterop.Command.ExecuteWithHandlerIdWasmInterop.wasmImportExecuteWithHandlerId(handle, unchecked((int)(handlerId))); + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.cs new file mode 100644 index 0000000..ec37c12 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.cs @@ -0,0 +1,105 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface ICommonImports { + + /** + * Represents the hands of a player. + */ + + public enum Hand { + LEFT, RIGHT + } + + /** + * Represents the game modes available in Minecraft. + */ + + public enum GameMode { + SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR + } + + /** + * The 16 base Minecraft colors. + */ + + public enum NamedColor { + BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, GOLD, GRAY, DARK_GRAY, BLUE, GREEN, AQUA, RED, LIGHT_PURPLE, YELLOW, WHITE + } + + /** + * An RGB color represented by its red, green, and blue components. + */ + + public struct RgbColor { + public byte r; + public byte g; + public byte b; + + public RgbColor(byte r, byte g, byte b) { + this.r = r; + this.g = g; + this.b = b; + } + } + + /** + * An ARGB color with alpha (transparency) channel. + */ + + public struct ArgbColor { + public byte a; + public byte r; + public byte g; + public byte b; + + public ArgbColor(byte a, byte r, byte g, byte b) { + this.a = a; + this.r = r; + this.g = g; + this.b = b; + } + } + + /** + * Represents a stack of items with its type and count. + */ + + public struct ItemStack { + public string registryKey; + public byte count; + + public ItemStack(string registryKey, byte count) { + this.registryKey = registryKey; + this.count = count; + } + } + + /** + * Represents the type of click interaction in a GUI. + */ + + public enum ClickType { + LEFT, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, MIDDLE, DROP, CONTROL_DROP, DOUBLE_CLICK, NUMBER_KEY, UNKNOWN + } + + /** + * Represents the various poses an entity can be in. + */ + + public enum EntityPose { + STANDING, FALL_FLYING, SLEEPING, SWIMMING, SPIN_ATTACK, CROUCHING, LONG_JUMPING, DYING, CROAKING, USING_TONGUE, SITTING, ROARING, SNIFFING, EMERGING, DIGGING, SLIDING, SHOOTING, INHALING + } + + /** + * All Minecraft-supported locales. + */ + + public enum Locale { + AF_ZA, AR_SA, AST_ES, AZ_AZ, BA_RU, BAR, BE_BY, BG_BG, BR_FR, BRB, BS_BA, CA_ES, CS_CZ, CY_GB, DA_DK, DE_AT, DE_CH, DE_DE, EL_GR, EN_AU, EN_CA, EN_GB, EN_NZ, EN_PT, EN_UD, EN_US, ENP, ENWS, EO_UY, ES_AR, ES_CL, ES_EC, ES_ES, ES_MX, ES_UY, ES_VE, ESAN, ET_EE, EU_ES, FA_IR, FI_FI, FIL_PH, FO_FO, FR_CA, FR_FR, FRA_DE, FUR_IT, FY_NL, GA_IE, GD_GB, GL_ES, HAW_US, HE_IL, HI_IN, HR_HR, HU_HU, HY_AM, ID_ID, IG_NG, IO_EN, IS_IS, ISV, IT_IT, JA_JP, JBO_EN, KA_GE, KK_KZ, KN_IN, KO_KR, KSH, KW_GB, LA_LA, LB_LU, LI_LI, LMO, LO_LA, LOL_US, LT_LT, LV_LV, LZH, MK_MK, MN_MN, MS_MY, MT_MT, NAH, NDS_DE, NL_BE, NL_NL, NN_NO, NO_NO, OC_FR, OVD, PL_PL, PT_BR, PT_PT, QYA_AA, RO_RO, RPR, RU_RU, RY_UA, SAH_SAH, SE_NO, SK_SK, SL_SI, SO_SO, SQ_AL, SR_CS, SR_SP, SV_SE, SXU, SZL, TA_IN, TH_TH, TL_PH, TLH_AA, TOK, TR_TR, TT_RU, UK_UA, VAL_ES, VEC_IT, VI_VN, YI_DE, YO_NG, ZH_CN, ZH_HK, ZH_TW, ZLM_ARAB + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.cs new file mode 100644 index 0000000..1bb6d5a --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.cs @@ -0,0 +1,212 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IContextImports { + + /** + * A contextual handle for plugin-related operations. + */ + + public class Context: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public Context(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/context@0.1.0", EntryPoint = "[resource-drop]context"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe void RegisterEvent(uint handlerId, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.EventType eventType, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.EventPriority eventPriority, bool blocking) + { + var handle = this.Handle; + ContextImportsInterop.Context.RegisterEventWasmInterop.wasmImportRegisterEvent(handle, unchecked((int)(handlerId)), (int)eventType, (int)eventPriority, (blocking ? 1 : 0)); + + } + + public unsafe void RegisterCommand(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.Command command, string permission) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + var handle0 = command.Handle; + command.Handle = 0; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(permission); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + ContextImportsInterop.Context.RegisterCommandWasmInterop.wasmImportRegisterCommand(handle, handle0, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void RegisterPermission(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.Permission permission) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(permission.node); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(permission.description); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + + int lowered; + int lowered10; + + switch (permission.@default.Tag) { + case 0: { + + lowered = 0; + lowered10 = 0; + + break; + } + case 1: { + + lowered = 1; + lowered10 = 0; + + break; + } + case 2: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.PermissionLevel payload9 = permission.@default.AsOp; + + lowered = 2; + lowered10 = (int)payload9; + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + permission.@default); + } + + void* address; + if ((12 * permission.children.Count) < 1024) { + var retArea = stackalloc uint[3 * permission.children.Count + 1]; + address = MemoryHelper.AlignStackPtr(retArea, 4); + } + else + { + var bufferSize = 12 * (nuint)permission.children.Count; + address = global::System.Runtime.InteropServices.NativeMemory.AlignedAlloc(bufferSize, 4); + cleanups.Add(() => global::System.Runtime.InteropServices.NativeMemory.AlignedFree(address)); + } + + for (int index = 0; index < permission.children.Count; ++index) { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.PermissionChild element11 = permission.children[index]; + int basePtr12 = (int)address + (index * 12); + + var utf8Bytes14 = global::System.Text.Encoding.UTF8.GetBytes(element11.node); + var length15 = utf8Bytes14.Length; + var gcHandle16 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes14, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr13 = gcHandle16.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle16.Free()); + new global::System.Span((void*)((byte*)basePtr12 + 4), 1)[0] = length15; + new global::System.Span((void*)((byte*)basePtr12 + 0), 1)[0] = (nint)strPtr13.ToInt32(); + *(byte*)(basePtr12 + 8) = (byte)(element11.value ? 1 : 0); + + } + + var retArea17 = stackalloc uint[4]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea17, 4); + ContextImportsInterop.Context.RegisterPermissionWasmInterop.wasmImportRegisterPermission(handle, strPtr.ToInt32(), length, strPtr0.ToInt32(), length2, lowered, lowered10, (int)address, permission.children.Count, ptr); + + Result lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + + lifted = Result.Ok(new global::PluginWorld.None()); + break; + } + case 1: { + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 8), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + } + + lifted = Result.Err(str); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span((byte*)ptr + 0, 1)[0]); + } + + foreach (var cleanup in cleanups) + { + cleanup(); + } + if (lifted.IsOk) + { + var tmp = lifted.AsOk; + return ; + } + else + { + throw new WitException(lifted.AsErr!, 0); + } + + } + + public unsafe string GetDataFolder() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + ContextImportsInterop.Context.GetDataFolderWasmInterop.wasmImportGetDataFolder(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server GetServer() + { + var handle = this.Handle; + var result = ContextImportsInterop.Context.GetServerWasmInterop.wasmImportGetServer(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server.THandle(result)); + return resource; + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.cs new file mode 100644 index 0000000..1bef463 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.cs @@ -0,0 +1,1020 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IEventImports { + + public enum EventPriority { + HIGHEST, HIGH, NORMAL, LOW, LOWEST + } + + public struct PlayerJoinEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent joinMessage; + public bool cancelled; + + public PlayerJoinEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent joinMessage, bool cancelled) { + this.player = player; + this.joinMessage = joinMessage; + this.cancelled = cancelled; + } + } + + public struct PlayerLeaveEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent leaveMessage; + public bool cancelled; + + public PlayerLeaveEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent leaveMessage, bool cancelled) { + this.player = player; + this.leaveMessage = leaveMessage; + this.cancelled = cancelled; + } + } + + public struct PlayerLoginEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent kickMessage; + public bool cancelled; + + public PlayerLoginEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent kickMessage, bool cancelled) { + this.player = player; + this.kickMessage = kickMessage; + this.cancelled = cancelled; + } + } + + public struct PlayerChatEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string message; + public global::System.Collections.Generic.List recipients; + public bool cancelled; + + public PlayerChatEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string message, global::System.Collections.Generic.List recipients, bool cancelled) { + this.player = player; + this.message = message; + this.recipients = recipients; + this.cancelled = cancelled; + } + } + + public struct PlayerCommandSendEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string command; + public bool cancelled; + + public PlayerCommandSendEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string command, bool cancelled) { + this.player = player; + this.command = command; + this.cancelled = cancelled; + } + } + + public struct PlayerPermissionCheckEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string permission; + public bool permissionResult; + + public PlayerPermissionCheckEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string permission, bool permissionResult) { + this.player = player; + this.permission = permission; + this.permissionResult = permissionResult; + } + } + + public struct PlayerMoveEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public (double, double, double) fromPosition; + public (double, double, double) toPosition; + public bool cancelled; + + public PlayerMoveEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, (double, double, double) fromPosition, (double, double, double) toPosition, bool cancelled) { + this.player = player; + this.fromPosition = fromPosition; + this.toPosition = toPosition; + this.cancelled = cancelled; + } + } + + public struct PlayerTeleportEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public (double, double, double) fromPosition; + public (double, double, double) toPosition; + public bool cancelled; + + public PlayerTeleportEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, (double, double, double) fromPosition, (double, double, double) toPosition, bool cancelled) { + this.player = player; + this.fromPosition = fromPosition; + this.toPosition = toPosition; + this.cancelled = cancelled; + } + } + + public struct PlayerChangeWorldEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World previousWorld; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World newWorld; + public (double, double, double) position; + public float yaw; + public float pitch; + public bool cancelled; + + public PlayerChangeWorldEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World previousWorld, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World newWorld, (double, double, double) position, float yaw, float pitch, bool cancelled) { + this.player = player; + this.previousWorld = previousWorld; + this.newWorld = newWorld; + this.position = position; + this.yaw = yaw; + this.pitch = pitch; + this.cancelled = cancelled; + } + } + + public struct PlayerExpChangeEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public int amount; + + public PlayerExpChangeEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, int amount) { + this.player = player; + this.amount = amount; + } + } + + public struct PlayerItemHeldEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public byte previousSlot; + public byte newSlot; + public bool cancelled; + + public PlayerItemHeldEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, byte previousSlot, byte newSlot, bool cancelled) { + this.player = player; + this.previousSlot = previousSlot; + this.newSlot = newSlot; + this.cancelled = cancelled; + } + } + + public struct PlayerChangedMainHandEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand mainHand; + + public PlayerChangedMainHandEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand mainHand) { + this.player = player; + this.mainHand = mainHand; + } + } + + public struct PlayerGamemodeChangeEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode previousGamemode; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode newGamemode; + public bool cancelled; + + public PlayerGamemodeChangeEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode previousGamemode, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode newGamemode, bool cancelled) { + this.player = player; + this.previousGamemode = previousGamemode; + this.newGamemode = newGamemode; + this.cancelled = cancelled; + } + } + + public struct PlayerCustomPayloadEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string channel; + public byte[] data; + + public PlayerCustomPayloadEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string channel, byte[] data) { + this.player = player; + this.channel = channel; + this.data = data; + } + } + + public enum PlayerFishState { + FISHING, CAUGHT_FISH, CAUGHT_ENTITY, IN_GROUND, FAILED_ATTEMPT, REEL_IN, BITE + } + + public struct PlayerFishEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string? caughtUuid; + public string caughtType; + public string hookUuid; + public PlayerFishState state; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand hand; + public int expToDrop; + public bool cancelled; + + public PlayerFishEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string? caughtUuid, string caughtType, string hookUuid, PlayerFishState state, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand hand, int expToDrop, bool cancelled) { + this.player = player; + this.caughtUuid = caughtUuid; + this.caughtType = caughtType; + this.hookUuid = hookUuid; + this.state = state; + this.hand = hand; + this.expToDrop = expToDrop; + this.cancelled = cancelled; + } + } + + public struct PlayerEggThrowEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string eggUuid; + public bool hatching; + public byte numHatches; + public string hatchingType; + public bool cancelled; + + public PlayerEggThrowEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string eggUuid, bool hatching, byte numHatches, string hatchingType, bool cancelled) { + this.player = player; + this.eggUuid = eggUuid; + this.hatching = hatching; + this.numHatches = numHatches; + this.hatchingType = hatchingType; + this.cancelled = cancelled; + } + } + + public enum EntityInteractionAction { + INTERACT, ATTACK, INTERACT_AT + } + + public enum InteractAction { + LEFT_CLICK_BLOCK, LEFT_CLICK_AIR, RIGHT_CLICK_AIR, RIGHT_CLICK_BLOCK + } + + public struct PlayerInteractEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public InteractAction action; + public (int, int, int)? clickedPos; + public string block; + public bool cancelled; + + public PlayerInteractEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, InteractAction action, (int, int, int)? clickedPos, string block, bool cancelled) { + this.player = player; + this.action = action; + this.clickedPos = clickedPos; + this.block = block; + this.cancelled = cancelled; + } + } + + public struct PlayerToggleSneakEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public bool isSneaking; + public bool cancelled; + + public PlayerToggleSneakEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, bool isSneaking, bool cancelled) { + this.player = player; + this.isSneaking = isSneaking; + this.cancelled = cancelled; + } + } + + public struct PlayerToggleFlightEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public bool isFlying; + public bool cancelled; + + public PlayerToggleFlightEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, bool isFlying, bool cancelled) { + this.player = player; + this.isFlying = isFlying; + this.cancelled = cancelled; + } + } + + public struct PlayerToggleSprintEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public bool isSprinting; + public bool cancelled; + + public PlayerToggleSprintEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, bool isSprinting, bool cancelled) { + this.player = player; + this.isSprinting = isSprinting; + this.cancelled = cancelled; + } + } + + public struct PlayerInteractUnknownEntityEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public int entityId; + public EntityInteractionAction action; + public bool cancelled; + + public PlayerInteractUnknownEntityEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, int entityId, EntityInteractionAction action, bool cancelled) { + this.player = player; + this.entityId = entityId; + this.action = action; + this.cancelled = cancelled; + } + } + + public struct InventoryClickEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string? windowType; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ClickType clickType; + public short slot; + public short rawSlot; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? clickedItem; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? cursor; + public int hotbarButton; + public bool cancelled; + + public InventoryClickEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string? windowType, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ClickType clickType, short slot, short rawSlot, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? clickedItem, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? cursor, int hotbarButton, bool cancelled) { + this.player = player; + this.windowType = windowType; + this.clickType = clickType; + this.slot = slot; + this.rawSlot = rawSlot; + this.clickedItem = clickedItem; + this.cursor = cursor; + this.hotbarButton = hotbarButton; + this.cancelled = cancelled; + } + } + + public struct InventoryCloseEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string? windowType; + + public InventoryCloseEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string? windowType) { + this.player = player; + this.windowType = windowType; + } + } + + public struct BlockRedstoneEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World targetWorld; + public ushort stateId; + public (int, int, int) blockPosition; + public int oldCurrent; + public int newCurrent; + public bool cancelled; + + public BlockRedstoneEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World targetWorld, ushort stateId, (int, int, int) blockPosition, int oldCurrent, int newCurrent, bool cancelled) { + this.targetWorld = targetWorld; + this.stateId = stateId; + this.blockPosition = blockPosition; + this.oldCurrent = oldCurrent; + this.newCurrent = newCurrent; + this.cancelled = cancelled; + } + } + + public struct BlockBreakEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? player; + public string block; + public (int, int, int) blockPosition; + public uint exp; + public bool shouldDrop; + public bool cancelled; + + public BlockBreakEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? player, string block, (int, int, int) blockPosition, uint exp, bool shouldDrop, bool cancelled) { + this.player = player; + this.block = block; + this.blockPosition = blockPosition; + this.exp = exp; + this.shouldDrop = shouldDrop; + this.cancelled = cancelled; + } + } + + public struct BlockBurnEventData { + public string ignitingBlock; + public string block; + public bool cancelled; + + public BlockBurnEventData(string ignitingBlock, string block, bool cancelled) { + this.ignitingBlock = ignitingBlock; + this.block = block; + this.cancelled = cancelled; + } + } + + public struct BlockCanBuildEventData { + public string blockToBuild; + public bool buildable; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string block; + public bool cancelled; + + public BlockCanBuildEventData(string blockToBuild, bool buildable, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string block, bool cancelled) { + this.blockToBuild = blockToBuild; + this.buildable = buildable; + this.player = player; + this.block = block; + this.cancelled = cancelled; + } + } + + public struct BlockGrowEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World targetWorld; + public string oldBlock; + public ushort oldStateId; + public string newBlock; + public ushort newStateId; + public (int, int, int) blockPosition; + public bool cancelled; + + public BlockGrowEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World targetWorld, string oldBlock, ushort oldStateId, string newBlock, ushort newStateId, (int, int, int) blockPosition, bool cancelled) { + this.targetWorld = targetWorld; + this.oldBlock = oldBlock; + this.oldStateId = oldStateId; + this.newBlock = newBlock; + this.newStateId = newStateId; + this.blockPosition = blockPosition; + this.cancelled = cancelled; + } + } + + public struct BlockPlaceEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player; + public string blockPlaced; + public string blockPlacedAgainst; + public (int, int, int) blockPosition; + public bool canBuild; + public bool cancelled; + + public BlockPlaceEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player, string blockPlaced, string blockPlacedAgainst, (int, int, int) blockPosition, bool canBuild, bool cancelled) { + this.player = player; + this.blockPlaced = blockPlaced; + this.blockPlacedAgainst = blockPlacedAgainst; + this.blockPosition = blockPosition; + this.canBuild = canBuild; + this.cancelled = cancelled; + } + } + + public struct ServerCommandEventData { + public string command; + public bool cancelled; + + public ServerCommandEventData(string command, bool cancelled) { + this.command = command; + this.cancelled = cancelled; + } + } + + public struct SpawnChangeEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World targetWorld; + public (int, int, int) previousPosition; + public float previousYaw; + public float previousPitch; + public (int, int, int) newPosition; + public float newYaw; + public float newPitch; + + public SpawnChangeEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World targetWorld, (int, int, int) previousPosition, float previousYaw, float previousPitch, (int, int, int) newPosition, float newYaw, float newPitch) { + this.targetWorld = targetWorld; + this.previousPosition = previousPosition; + this.previousYaw = previousYaw; + this.previousPitch = previousPitch; + this.newPosition = newPosition; + this.newYaw = newYaw; + this.newPitch = newPitch; + } + } + + public struct ServerBroadcastEventData { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent message; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent sender; + public bool cancelled; + + public ServerBroadcastEventData(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent message, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent sender, bool cancelled) { + this.message = message; + this.sender = sender; + this.cancelled = cancelled; + } + } + + public enum EventType { + PLAYER_JOIN_EVENT, PLAYER_LEAVE_EVENT, PLAYER_LOGIN_EVENT, PLAYER_CHAT_EVENT, PLAYER_COMMAND_SEND_EVENT, PLAYER_PERMISSION_CHECK_EVENT, PLAYER_MOVE_EVENT, PLAYER_TELEPORT_EVENT, PLAYER_CHANGE_WORLD_EVENT, PLAYER_EXP_CHANGE_EVENT, PLAYER_ITEM_HELD_EVENT, PLAYER_CHANGED_MAIN_HAND_EVENT, PLAYER_GAMEMODE_CHANGE_EVENT, PLAYER_CUSTOM_PAYLOAD_EVENT, PLAYER_FISH_EVENT, PLAYER_EGG_THROW_EVENT, PLAYER_INTERACT_UNKNOWN_ENTITY_EVENT, PLAYER_INTERACT_EVENT, PLAYER_TOGGLE_SNEAK_EVENT, PLAYER_TOGGLE_FLIGHT_EVENT, PLAYER_TOGGLE_SPRINT_EVENT, INVENTORY_CLICK_EVENT, INVENTORY_CLOSE_EVENT, BLOCK_REDSTONE_EVENT, BLOCK_BREAK_EVENT, BLOCK_BURN_EVENT, BLOCK_CAN_BUILD_EVENT, BLOCK_GROW_EVENT, BLOCK_PLACE_EVENT, SERVER_COMMAND_EVENT, SPAWN_CHANGE_EVENT, SERVER_BROADCAST_EVENT + } + + public class Event { + public readonly byte Tag; + private readonly object? value; + + private Event(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static Event PlayerJoinEvent(PlayerJoinEventData playerJoinEvent) { + return new Event(Tags.PlayerJoinEvent, playerJoinEvent); + } + + public static Event PlayerLeaveEvent(PlayerLeaveEventData playerLeaveEvent) { + return new Event(Tags.PlayerLeaveEvent, playerLeaveEvent); + } + + public static Event PlayerLoginEvent(PlayerLoginEventData playerLoginEvent) { + return new Event(Tags.PlayerLoginEvent, playerLoginEvent); + } + + public static Event PlayerChatEvent(PlayerChatEventData playerChatEvent) { + return new Event(Tags.PlayerChatEvent, playerChatEvent); + } + + public static Event PlayerCommandSendEvent(PlayerCommandSendEventData playerCommandSendEvent) { + return new Event(Tags.PlayerCommandSendEvent, playerCommandSendEvent); + } + + public static Event PlayerPermissionCheckEvent(PlayerPermissionCheckEventData playerPermissionCheckEvent) { + return new Event(Tags.PlayerPermissionCheckEvent, playerPermissionCheckEvent); + } + + public static Event PlayerMoveEvent(PlayerMoveEventData playerMoveEvent) { + return new Event(Tags.PlayerMoveEvent, playerMoveEvent); + } + + public static Event PlayerTeleportEvent(PlayerTeleportEventData playerTeleportEvent) { + return new Event(Tags.PlayerTeleportEvent, playerTeleportEvent); + } + + public static Event PlayerChangeWorldEvent(PlayerChangeWorldEventData playerChangeWorldEvent) { + return new Event(Tags.PlayerChangeWorldEvent, playerChangeWorldEvent); + } + + public static Event PlayerExpChangeEvent(PlayerExpChangeEventData playerExpChangeEvent) { + return new Event(Tags.PlayerExpChangeEvent, playerExpChangeEvent); + } + + public static Event PlayerItemHeldEvent(PlayerItemHeldEventData playerItemHeldEvent) { + return new Event(Tags.PlayerItemHeldEvent, playerItemHeldEvent); + } + + public static Event PlayerChangedMainHandEvent(PlayerChangedMainHandEventData playerChangedMainHandEvent) { + return new Event(Tags.PlayerChangedMainHandEvent, playerChangedMainHandEvent); + } + + public static Event PlayerGamemodeChangeEvent(PlayerGamemodeChangeEventData playerGamemodeChangeEvent) { + return new Event(Tags.PlayerGamemodeChangeEvent, playerGamemodeChangeEvent); + } + + public static Event PlayerCustomPayloadEvent(PlayerCustomPayloadEventData playerCustomPayloadEvent) { + return new Event(Tags.PlayerCustomPayloadEvent, playerCustomPayloadEvent); + } + + public static Event PlayerFishEvent(PlayerFishEventData playerFishEvent) { + return new Event(Tags.PlayerFishEvent, playerFishEvent); + } + + public static Event PlayerEggThrowEvent(PlayerEggThrowEventData playerEggThrowEvent) { + return new Event(Tags.PlayerEggThrowEvent, playerEggThrowEvent); + } + + public static Event PlayerInteractUnknownEntityEvent(PlayerInteractUnknownEntityEventData playerInteractUnknownEntityEvent) { + return new Event(Tags.PlayerInteractUnknownEntityEvent, playerInteractUnknownEntityEvent); + } + + public static Event PlayerInteractEvent(PlayerInteractEventData playerInteractEvent) { + return new Event(Tags.PlayerInteractEvent, playerInteractEvent); + } + + public static Event PlayerToggleSneakEvent(PlayerToggleSneakEventData playerToggleSneakEvent) { + return new Event(Tags.PlayerToggleSneakEvent, playerToggleSneakEvent); + } + + public static Event PlayerToggleFlightEvent(PlayerToggleFlightEventData playerToggleFlightEvent) { + return new Event(Tags.PlayerToggleFlightEvent, playerToggleFlightEvent); + } + + public static Event PlayerToggleSprintEvent(PlayerToggleSprintEventData playerToggleSprintEvent) { + return new Event(Tags.PlayerToggleSprintEvent, playerToggleSprintEvent); + } + + public static Event InventoryClickEvent(InventoryClickEventData inventoryClickEvent) { + return new Event(Tags.InventoryClickEvent, inventoryClickEvent); + } + + public static Event InventoryCloseEvent(InventoryCloseEventData inventoryCloseEvent) { + return new Event(Tags.InventoryCloseEvent, inventoryCloseEvent); + } + + public static Event BlockRedstoneEvent(BlockRedstoneEventData blockRedstoneEvent) { + return new Event(Tags.BlockRedstoneEvent, blockRedstoneEvent); + } + + public static Event BlockBreakEvent(BlockBreakEventData blockBreakEvent) { + return new Event(Tags.BlockBreakEvent, blockBreakEvent); + } + + public static Event BlockBurnEvent(BlockBurnEventData blockBurnEvent) { + return new Event(Tags.BlockBurnEvent, blockBurnEvent); + } + + public static Event BlockCanBuildEvent(BlockCanBuildEventData blockCanBuildEvent) { + return new Event(Tags.BlockCanBuildEvent, blockCanBuildEvent); + } + + public static Event BlockGrowEvent(BlockGrowEventData blockGrowEvent) { + return new Event(Tags.BlockGrowEvent, blockGrowEvent); + } + + public static Event BlockPlaceEvent(BlockPlaceEventData blockPlaceEvent) { + return new Event(Tags.BlockPlaceEvent, blockPlaceEvent); + } + + public static Event ServerCommandEvent(ServerCommandEventData serverCommandEvent) { + return new Event(Tags.ServerCommandEvent, serverCommandEvent); + } + + public static Event SpawnChangeEvent(SpawnChangeEventData spawnChangeEvent) { + return new Event(Tags.SpawnChangeEvent, spawnChangeEvent); + } + + public static Event ServerBroadcastEvent(ServerBroadcastEventData serverBroadcastEvent) { + return new Event(Tags.ServerBroadcastEvent, serverBroadcastEvent); + } + + public PlayerJoinEventData AsPlayerJoinEvent + { + get + { + if (Tag == Tags.PlayerJoinEvent) + return (PlayerJoinEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerJoinEvent, got " + Tag); + } + } + + public PlayerLeaveEventData AsPlayerLeaveEvent + { + get + { + if (Tag == Tags.PlayerLeaveEvent) + return (PlayerLeaveEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerLeaveEvent, got " + Tag); + } + } + + public PlayerLoginEventData AsPlayerLoginEvent + { + get + { + if (Tag == Tags.PlayerLoginEvent) + return (PlayerLoginEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerLoginEvent, got " + Tag); + } + } + + public PlayerChatEventData AsPlayerChatEvent + { + get + { + if (Tag == Tags.PlayerChatEvent) + return (PlayerChatEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerChatEvent, got " + Tag); + } + } + + public PlayerCommandSendEventData AsPlayerCommandSendEvent + { + get + { + if (Tag == Tags.PlayerCommandSendEvent) + return (PlayerCommandSendEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerCommandSendEvent, got " + Tag); + } + } + + public PlayerPermissionCheckEventData AsPlayerPermissionCheckEvent + { + get + { + if (Tag == Tags.PlayerPermissionCheckEvent) + return (PlayerPermissionCheckEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerPermissionCheckEvent, got " + Tag); + } + } + + public PlayerMoveEventData AsPlayerMoveEvent + { + get + { + if (Tag == Tags.PlayerMoveEvent) + return (PlayerMoveEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerMoveEvent, got " + Tag); + } + } + + public PlayerTeleportEventData AsPlayerTeleportEvent + { + get + { + if (Tag == Tags.PlayerTeleportEvent) + return (PlayerTeleportEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerTeleportEvent, got " + Tag); + } + } + + public PlayerChangeWorldEventData AsPlayerChangeWorldEvent + { + get + { + if (Tag == Tags.PlayerChangeWorldEvent) + return (PlayerChangeWorldEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerChangeWorldEvent, got " + Tag); + } + } + + public PlayerExpChangeEventData AsPlayerExpChangeEvent + { + get + { + if (Tag == Tags.PlayerExpChangeEvent) + return (PlayerExpChangeEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerExpChangeEvent, got " + Tag); + } + } + + public PlayerItemHeldEventData AsPlayerItemHeldEvent + { + get + { + if (Tag == Tags.PlayerItemHeldEvent) + return (PlayerItemHeldEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerItemHeldEvent, got " + Tag); + } + } + + public PlayerChangedMainHandEventData AsPlayerChangedMainHandEvent + { + get + { + if (Tag == Tags.PlayerChangedMainHandEvent) + return (PlayerChangedMainHandEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerChangedMainHandEvent, got " + Tag); + } + } + + public PlayerGamemodeChangeEventData AsPlayerGamemodeChangeEvent + { + get + { + if (Tag == Tags.PlayerGamemodeChangeEvent) + return (PlayerGamemodeChangeEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerGamemodeChangeEvent, got " + Tag); + } + } + + public PlayerCustomPayloadEventData AsPlayerCustomPayloadEvent + { + get + { + if (Tag == Tags.PlayerCustomPayloadEvent) + return (PlayerCustomPayloadEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerCustomPayloadEvent, got " + Tag); + } + } + + public PlayerFishEventData AsPlayerFishEvent + { + get + { + if (Tag == Tags.PlayerFishEvent) + return (PlayerFishEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerFishEvent, got " + Tag); + } + } + + public PlayerEggThrowEventData AsPlayerEggThrowEvent + { + get + { + if (Tag == Tags.PlayerEggThrowEvent) + return (PlayerEggThrowEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerEggThrowEvent, got " + Tag); + } + } + + public PlayerInteractUnknownEntityEventData AsPlayerInteractUnknownEntityEvent + { + get + { + if (Tag == Tags.PlayerInteractUnknownEntityEvent) + return (PlayerInteractUnknownEntityEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerInteractUnknownEntityEvent, got " + Tag); + } + } + + public PlayerInteractEventData AsPlayerInteractEvent + { + get + { + if (Tag == Tags.PlayerInteractEvent) + return (PlayerInteractEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerInteractEvent, got " + Tag); + } + } + + public PlayerToggleSneakEventData AsPlayerToggleSneakEvent + { + get + { + if (Tag == Tags.PlayerToggleSneakEvent) + return (PlayerToggleSneakEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerToggleSneakEvent, got " + Tag); + } + } + + public PlayerToggleFlightEventData AsPlayerToggleFlightEvent + { + get + { + if (Tag == Tags.PlayerToggleFlightEvent) + return (PlayerToggleFlightEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerToggleFlightEvent, got " + Tag); + } + } + + public PlayerToggleSprintEventData AsPlayerToggleSprintEvent + { + get + { + if (Tag == Tags.PlayerToggleSprintEvent) + return (PlayerToggleSprintEventData)value!; + else + throw new global::System.ArgumentException("expected PlayerToggleSprintEvent, got " + Tag); + } + } + + public InventoryClickEventData AsInventoryClickEvent + { + get + { + if (Tag == Tags.InventoryClickEvent) + return (InventoryClickEventData)value!; + else + throw new global::System.ArgumentException("expected InventoryClickEvent, got " + Tag); + } + } + + public InventoryCloseEventData AsInventoryCloseEvent + { + get + { + if (Tag == Tags.InventoryCloseEvent) + return (InventoryCloseEventData)value!; + else + throw new global::System.ArgumentException("expected InventoryCloseEvent, got " + Tag); + } + } + + public BlockRedstoneEventData AsBlockRedstoneEvent + { + get + { + if (Tag == Tags.BlockRedstoneEvent) + return (BlockRedstoneEventData)value!; + else + throw new global::System.ArgumentException("expected BlockRedstoneEvent, got " + Tag); + } + } + + public BlockBreakEventData AsBlockBreakEvent + { + get + { + if (Tag == Tags.BlockBreakEvent) + return (BlockBreakEventData)value!; + else + throw new global::System.ArgumentException("expected BlockBreakEvent, got " + Tag); + } + } + + public BlockBurnEventData AsBlockBurnEvent + { + get + { + if (Tag == Tags.BlockBurnEvent) + return (BlockBurnEventData)value!; + else + throw new global::System.ArgumentException("expected BlockBurnEvent, got " + Tag); + } + } + + public BlockCanBuildEventData AsBlockCanBuildEvent + { + get + { + if (Tag == Tags.BlockCanBuildEvent) + return (BlockCanBuildEventData)value!; + else + throw new global::System.ArgumentException("expected BlockCanBuildEvent, got " + Tag); + } + } + + public BlockGrowEventData AsBlockGrowEvent + { + get + { + if (Tag == Tags.BlockGrowEvent) + return (BlockGrowEventData)value!; + else + throw new global::System.ArgumentException("expected BlockGrowEvent, got " + Tag); + } + } + + public BlockPlaceEventData AsBlockPlaceEvent + { + get + { + if (Tag == Tags.BlockPlaceEvent) + return (BlockPlaceEventData)value!; + else + throw new global::System.ArgumentException("expected BlockPlaceEvent, got " + Tag); + } + } + + public ServerCommandEventData AsServerCommandEvent + { + get + { + if (Tag == Tags.ServerCommandEvent) + return (ServerCommandEventData)value!; + else + throw new global::System.ArgumentException("expected ServerCommandEvent, got " + Tag); + } + } + + public SpawnChangeEventData AsSpawnChangeEvent + { + get + { + if (Tag == Tags.SpawnChangeEvent) + return (SpawnChangeEventData)value!; + else + throw new global::System.ArgumentException("expected SpawnChangeEvent, got " + Tag); + } + } + + public ServerBroadcastEventData AsServerBroadcastEvent + { + get + { + if (Tag == Tags.ServerBroadcastEvent) + return (ServerBroadcastEventData)value!; + else + throw new global::System.ArgumentException("expected ServerBroadcastEvent, got " + Tag); + } + } + + public class Tags { + public const byte PlayerJoinEvent = 0; + public const byte PlayerLeaveEvent = 1; + public const byte PlayerLoginEvent = 2; + public const byte PlayerChatEvent = 3; + public const byte PlayerCommandSendEvent = 4; + public const byte PlayerPermissionCheckEvent = 5; + public const byte PlayerMoveEvent = 6; + public const byte PlayerTeleportEvent = 7; + public const byte PlayerChangeWorldEvent = 8; + public const byte PlayerExpChangeEvent = 9; + public const byte PlayerItemHeldEvent = 10; + public const byte PlayerChangedMainHandEvent = 11; + public const byte PlayerGamemodeChangeEvent = 12; + public const byte PlayerCustomPayloadEvent = 13; + public const byte PlayerFishEvent = 14; + public const byte PlayerEggThrowEvent = 15; + public const byte PlayerInteractUnknownEntityEvent = 16; + public const byte PlayerInteractEvent = 17; + public const byte PlayerToggleSneakEvent = 18; + public const byte PlayerToggleFlightEvent = 19; + public const byte PlayerToggleSprintEvent = 20; + public const byte InventoryClickEvent = 21; + public const byte InventoryCloseEvent = 22; + public const byte BlockRedstoneEvent = 23; + public const byte BlockBreakEvent = 24; + public const byte BlockBurnEvent = 25; + public const byte BlockCanBuildEvent = 26; + public const byte BlockGrowEvent = 27; + public const byte BlockPlaceEvent = 28; + public const byte ServerCommandEvent = 29; + public const byte SpawnChangeEvent = 30; + public const byte ServerBroadcastEvent = 31; + } + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IGuiImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IGuiImports.cs new file mode 100644 index 0000000..34ee3a1 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IGuiImports.cs @@ -0,0 +1,163 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IGuiImports { + + public enum GuiType { + GENERIC_9X1, GENERIC_9X2, GENERIC_9X3, GENERIC_9X4, GENERIC_9X5, GENERIC_9X6, GENERIC_3X3, CRAFTER_3X3, ANVIL, BEACON, BLAST_FURNACE, BREWING_STAND, CRAFTING, ENCHANTMENT, FURNACE, GRINDSTONE, HOPPER, LECTERN, LOOM, MERCHANT, SHULKER_BOX, SMITHING, SMOKER, CARTOGRAPHY_TABLE, STONECUTTER + } + + public class Gui: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public Gui(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/gui@0.1.0", EntryPoint = "[resource-drop]gui"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe Gui(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IGuiImports.GuiType type, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent title) + { + var handle = title.Handle; + title.Handle = 0; + var result = GuiImportsInterop.Gui.ConstructorWasmInterop.wasmImportConstructor((int)type, handle); + this.Handle = result; + + } + + public unsafe void SetItem(uint slot, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack item) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(item.registryKey); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + GuiImportsInterop.Gui.SetItemWasmInterop.wasmImportSetItem(handle, unchecked((int)(slot)), strPtr.ToInt32(), length, item.count); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? GetItem(uint slot) + { + var handle = this.Handle; + + var retArea = stackalloc uint[5]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + GuiImportsInterop.Gui.GetItemWasmInterop.wasmImportGetItem(handle, unchecked((int)(slot)), ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 8), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + } + + lifted = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack ( + str, ((byte)new global::System.Span((byte*)ptr + 12, 1)[0])); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + public new unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IGuiImports.GuiType GetType() + { + var handle = this.Handle; + var result = GuiImportsInterop.Gui.GetTypeWasmInterop.wasmImportGetType(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IGuiImports.GuiType)result; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent GetTitle() + { + var handle = this.Handle; + var result = GuiImportsInterop.Gui.GetTitleWasmInterop.wasmImportGetTitle(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(result)); + return resource; + + } + + public unsafe uint GetSize() + { + var handle = this.Handle; + var result = GuiImportsInterop.Gui.GetSizeWasmInterop.wasmImportGetSize(handle); + return unchecked((uint)(result)); + + } + + public unsafe void ClearItems() + { + var handle = this.Handle; + GuiImportsInterop.Gui.ClearItemsWasmInterop.wasmImportClearItems(handle); + + } + + public unsafe void SetAllowGrabItems(bool allow) + { + var handle = this.Handle; + GuiImportsInterop.Gui.SetAllowGrabItemsWasmInterop.wasmImportSetAllowGrabItems(handle, (allow ? 1 : 0)); + + } + + public unsafe bool GetAllowGrabItems() + { + var handle = this.Handle; + var result = GuiImportsInterop.Gui.GetAllowGrabItemsWasmInterop.wasmImportGetAllowGrabItems(handle); + return (result != 0); + + } + + public unsafe void SetAllowPutItems(bool allow) + { + var handle = this.Handle; + GuiImportsInterop.Gui.SetAllowPutItemsWasmInterop.wasmImportSetAllowPutItems(handle, (allow ? 1 : 0)); + + } + + public unsafe bool GetAllowPutItems() + { + var handle = this.Handle; + var result = GuiImportsInterop.Gui.GetAllowPutItemsWasmInterop.wasmImportGetAllowPutItems(handle); + return (result != 0); + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.II18nImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.II18nImports.cs new file mode 100644 index 0000000..5bef7d9 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.II18nImports.cs @@ -0,0 +1,63 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface II18nImports { + + public static unsafe string Translate(string key, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Locale locale) + { + var cleanups = new global::System.Collections.Generic.List(); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(key); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + I18nImportsInterop.TranslateWasmInterop.wasmImportTranslate(strPtr.ToInt32(), length, (int)locale, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return str; + + } + + public static unsafe void LoadTranslations(string @namespace, string json, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Locale locale) + { + var cleanups = new global::System.Collections.Generic.List(); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(@namespace); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(json); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + I18nImportsInterop.LoadTranslationsWasmInterop.wasmImportLoadTranslations(strPtr.ToInt32(), length, strPtr0.ToInt32(), length2, (int)locale); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ILoggingImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ILoggingImports.cs new file mode 100644 index 0000000..8af8e54 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ILoggingImports.cs @@ -0,0 +1,66 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface ILoggingImports { + + public enum Level { + TRACE, DEBUG, INFO, WARN, ERROR + } + + public static unsafe void Log(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ILoggingImports.Level level, string message) + { + var cleanups = new global::System.Collections.Generic.List(); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(message); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + LoggingImportsInterop.LogWasmInterop.wasmImportLog((int)level, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public static unsafe void LogTracing(byte[] @event) + { + var cleanups = new global::System.Collections.Generic.List(); + + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(@event, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var listPtr = gcHandle.AddrOfPinnedObject(); + cleanups.Add(()=> gcHandle.Free()); + LoggingImportsInterop.LogTracingWasmInterop.wasmImportLogTracing((nint)listPtr, (@event).Length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public static unsafe void LogTracing(global::System.Span @event) + { + fixed (void* listPtr = @event) + { + LoggingImportsInterop.LogTracingWasmInterop.wasmImportLogTracing((nint)listPtr, (@event).Length); + } + + } + + public static unsafe void LogTracing(global::System.Memory @event) + { + fixed (void* listPtr = @event.Span) + { + LoggingImportsInterop.LogTracingWasmInterop.wasmImportLogTracing((nint)listPtr, (@event).Length); + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.cs new file mode 100644 index 0000000..8ac065e --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.cs @@ -0,0 +1,100 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IPermissionImports { + + /** + * Represents the player's permission level + * + * Permission levels determine the player's access to commands and server operations. + * Each numeric level corresponds to a specific role: + * - `Zero`: `normal`: Player can use basic commands. + * - `One`: `moderator`: Player can bypass spawn protection. + * - `Two`: `gamemaster`: Player or executor can use more commands and player can use command blocks. + * - `Three`: `admin`: Player or executor can use commands related to multiplayer management. + * - `Four`: `owner`: Player or executor can use all of the commands, including commands related to server management. + */ + + public enum PermissionLevel { + ZERO, ONE, TWO, THREE, FOUR + } + + /** + * Describes the default behavior for permissions + */ + + public class PermissionDefault { + public readonly byte Tag; + private readonly object? value; + + private PermissionDefault(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static PermissionDefault Deny() { + return new PermissionDefault(Tags.Deny, null); + } + + public static PermissionDefault Allow() { + return new PermissionDefault(Tags.Allow, null); + } + + public static PermissionDefault Op(PermissionLevel op) { + return new PermissionDefault(Tags.Op, op); + } + + public PermissionLevel AsOp + { + get + { + if (Tag == Tags.Op) + return (PermissionLevel)value!; + else + throw new global::System.ArgumentException("expected Op, got " + Tag); + } + } + + public class Tags { + public const byte Deny = 0; + public const byte Allow = 1; + public const byte Op = 2; + } + } + + /** + * A child permission entry + */ + + public struct PermissionChild { + public string node; + public bool value; + + public PermissionChild(string node, bool value) { + this.node = node; + this.value = value; + } + } + + /** + * Defines a permission node in the system + */ + + public struct Permission { + public string node; + public string description; + public PermissionDefault @default; + public global::System.Collections.Generic.List children; + + public Permission(string node, string description, PermissionDefault @default, global::System.Collections.Generic.List children) { + this.node = node; + this.description = description; + this.@default = @default; + this.children = children; + } + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.cs new file mode 100644 index 0000000..bd5d9dd --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.cs @@ -0,0 +1,924 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IPlayerImports { + + /** + * Various abilities a player can have. + */ + + public struct PlayerAbilities { + public bool invulnerable; + public bool flying; + public bool allowFlying; + public bool creative; + public bool allowModifyWorld; + public float flySpeed; + public float walkSpeed; + + public PlayerAbilities(bool invulnerable, bool flying, bool allowFlying, bool creative, bool allowModifyWorld, float flySpeed, float walkSpeed) { + this.invulnerable = invulnerable; + this.flying = flying; + this.allowFlying = allowFlying; + this.creative = creative; + this.allowModifyWorld = allowModifyWorld; + this.flySpeed = flySpeed; + this.walkSpeed = walkSpeed; + } + } + + /** + * Represents a player's skin textures and metadata. + */ + + public struct PlayerSkin { + public string value; + public string? signature; + + public PlayerSkin(string value, string? signature) { + this.value = value; + this.signature = signature; + } + } + + /** + * Flags representing visible skin parts. + */ + + public enum SkinParts : byte { + CAPE = 1 << 0, + JACKET = 1 << 1, + LEFT_SLEEVE = 1 << 2, + RIGHT_SLEEVE = 1 << 3, + LEFT_PANTS_LEG = 1 << 4, + RIGHT_PANTS_LEG = 1 << 5, + HAT = 1 << 6, + } + + /** + * A handle to a player on the server. + */ + + public class Player: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public Player(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[resource-drop]player"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity AsEntity() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.AsEntityWasmInterop.wasmImportAsEntity(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity.THandle(result)); + return resource; + + } + + public unsafe string GetId() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetIdWasmInterop.wasmImportGetId(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe string GetName() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetNameWasmInterop.wasmImportGetName(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe (double, double, double) GetPosition() + { + var handle = this.Handle; + + var retArea = stackalloc ulong[4]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 8); + PlayerImportsInterop.Player.GetPositionWasmInterop.wasmImportGetPosition(handle, ptr); + return (new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 16), 1)[0]); + + } + + public unsafe float GetYaw() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetYawWasmInterop.wasmImportGetYaw(handle); + return result; + + } + + public unsafe float GetPitch() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetPitchWasmInterop.wasmImportGetPitch(handle); + return result; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World GetWorld() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetWorldWasmInterop.wasmImportGetWorld(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(result)); + return resource; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode GetGamemode() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetGamemodeWasmInterop.wasmImportGetGamemode(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode)result; + + } + + public unsafe bool SetGamemode(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode mode) + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.SetGamemodeWasmInterop.wasmImportSetGamemode(handle, (int)mode); + return (result != 0); + + } + + public unsafe string GetLocale() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetLocaleWasmInterop.wasmImportGetLocale(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe uint GetPing() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetPingWasmInterop.wasmImportGetPing(handle); + return unchecked((uint)(result)); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.PermissionLevel GetPermissionLevel() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetPermissionLevelWasmInterop.wasmImportGetPermissionLevel(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.PermissionLevel)result; + + } + + public unsafe void SetPermissionLevel(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPermissionImports.PermissionLevel level) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetPermissionLevelWasmInterop.wasmImportSetPermissionLevel(handle, (int)level); + + } + + public unsafe void SetPermission(string node, bool value) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(node); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + PlayerImportsInterop.Player.SetPermissionWasmInterop.wasmImportSetPermission(handle, strPtr.ToInt32(), length, (value ? 1 : 0)); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void UnsetPermission(string node) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(node); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + PlayerImportsInterop.Player.UnsetPermissionWasmInterop.wasmImportUnsetPermission(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe bool? HasPermissionSet(string node) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(node); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var retArea = stackalloc byte[2]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 1); + PlayerImportsInterop.Player.HasPermissionSetWasmInterop.wasmImportHasPermissionSet(handle, strPtr.ToInt32(), length, ptr); + + bool? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + lifted = (new global::System.Span((byte*)ptr + 1, 1)[0] != 0); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return lifted; + + } + + public unsafe bool HasPermission(string node) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(node); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var result = PlayerImportsInterop.Player.HasPermissionWasmInterop.wasmImportHasPermission(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return (result != 0); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent GetDisplayName() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetDisplayNameWasmInterop.wasmImportGetDisplayName(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(result)); + return resource; + + } + + public unsafe void SetDisplayName(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent displayName) + { + var handle = this.Handle; + var handle0 = displayName.Handle; + displayName.Handle = 0; + PlayerImportsInterop.Player.SetDisplayNameWasmInterop.wasmImportSetDisplayName(handle, handle0); + + } + + public unsafe void SendSystemMessage(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent text, bool overlay) + { + var handle = this.Handle; + var handle0 = text.Handle; + text.Handle = 0; + PlayerImportsInterop.Player.SendSystemMessageWasmInterop.wasmImportSendSystemMessage(handle, handle0, (overlay ? 1 : 0)); + + } + + public unsafe void SetTabListHeaderFooter(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent header, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent footer) + { + var handle = this.Handle; + var handle0 = header.Handle; + header.Handle = 0; + var handle1 = footer.Handle; + footer.Handle = 0; + PlayerImportsInterop.Player.SetTabListHeaderFooterWasmInterop.wasmImportSetTabListHeaderFooter(handle, handle0, handle1); + + } + + public unsafe void SetTabListOrder(int order) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetTabListOrderWasmInterop.wasmImportSetTabListOrder(handle, order); + + } + + public unsafe void SetTabListLatency(int latency) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetTabListLatencyWasmInterop.wasmImportSetTabListLatency(handle, latency); + + } + + public unsafe void SetTabListListed(bool listed) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetTabListListedWasmInterop.wasmImportSetTabListListed(handle, (listed ? 1 : 0)); + + } + + public unsafe void ShowTitle(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent text) + { + var handle = this.Handle; + var handle0 = text.Handle; + text.Handle = 0; + PlayerImportsInterop.Player.ShowTitleWasmInterop.wasmImportShowTitle(handle, handle0); + + } + + public unsafe void ShowSubtitle(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent text) + { + var handle = this.Handle; + var handle0 = text.Handle; + text.Handle = 0; + PlayerImportsInterop.Player.ShowSubtitleWasmInterop.wasmImportShowSubtitle(handle, handle0); + + } + + public unsafe void ShowActionbar(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent text) + { + var handle = this.Handle; + var handle0 = text.Handle; + text.Handle = 0; + PlayerImportsInterop.Player.ShowActionbarWasmInterop.wasmImportShowActionbar(handle, handle0); + + } + + public unsafe void SendTitleAnimation(int fadeIn, int stay, int fadeOut) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SendTitleAnimationWasmInterop.wasmImportSendTitleAnimation(handle, fadeIn, stay, fadeOut); + + } + + public unsafe void Teleport((double, double, double) position, float? yaw, float? pitch, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World world) + { + var handle = this.Handle; + + int lowered; + float lowered3; + + if (yaw != null) { + var payload2 = (float) yaw; + + lowered = 1; + lowered3 = payload2; + + } else { + + lowered = 0; + lowered3 = 0.0F; + + } + + int lowered10; + float lowered11; + + if (pitch != null) { + var payload9 = (float) pitch; + + lowered10 = 1; + lowered11 = payload9; + + } else { + + lowered10 = 0; + lowered11 = 0.0F; + + } + var handle12 = world.Handle; + world.Handle = 0; + PlayerImportsInterop.Player.TeleportWasmInterop.wasmImportTeleport(handle, position.Item1, position.Item2, position.Item3, lowered, lowered3, lowered10, lowered11, handle12); + + } + + public unsafe void TeleportWorld(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World worldRef, (double, double, double) position, float? yaw, float? pitch) + { + var handle = this.Handle; + var handle0 = worldRef.Handle; + worldRef.Handle = 0; + + int lowered; + float lowered4; + + if (yaw != null) { + var payload3 = (float) yaw; + + lowered = 1; + lowered4 = payload3; + + } else { + + lowered = 0; + lowered4 = 0.0F; + + } + + int lowered11; + float lowered12; + + if (pitch != null) { + var payload10 = (float) pitch; + + lowered11 = 1; + lowered12 = payload10; + + } else { + + lowered11 = 0; + lowered12 = 0.0F; + + } + PlayerImportsInterop.Player.TeleportWorldWasmInterop.wasmImportTeleportWorld(handle, handle0, position.Item1, position.Item2, position.Item3, lowered, lowered4, lowered11, lowered12); + + } + + public unsafe void Kick(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent message) + { + var handle = this.Handle; + var handle0 = message.Handle; + message.Handle = 0; + PlayerImportsInterop.Player.KickWasmInterop.wasmImportKick(handle, handle0); + + } + + public unsafe void Respawn() + { + var handle = this.Handle; + PlayerImportsInterop.Player.RespawnWasmInterop.wasmImportRespawn(handle); + + } + + public unsafe void OpenGui(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IGuiImports.Gui guiRef) + { + var handle = this.Handle; + var handle0 = guiRef.Handle; + guiRef.Handle = 0; + PlayerImportsInterop.Player.OpenGuiWasmInterop.wasmImportOpenGui(handle, handle0); + + } + + public unsafe void Ban(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent? reason) + { + var handle = this.Handle; + + int lowered; + int lowered4; + + if (reason != null) { + var payload2 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent) reason; + var handle3 = payload2.Handle; + payload2.Handle = 0; + + lowered = 1; + lowered4 = handle3; + + } else { + + lowered = 0; + lowered4 = 0; + + } + PlayerImportsInterop.Player.BanWasmInterop.wasmImportBan(handle, lowered, lowered4); + + } + + public unsafe void BanIp(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent? reason) + { + var handle = this.Handle; + + int lowered; + int lowered4; + + if (reason != null) { + var payload2 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent) reason; + var handle3 = payload2.Handle; + payload2.Handle = 0; + + lowered = 1; + lowered4 = handle3; + + } else { + + lowered = 0; + lowered4 = 0; + + } + PlayerImportsInterop.Player.BanIpWasmInterop.wasmImportBanIp(handle, lowered, lowered4); + + } + + public unsafe byte GetSelectedSlot() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetSelectedSlotWasmInterop.wasmImportGetSelectedSlot(handle); + return ((byte)result); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? GetItemInHand(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand hand) + { + var handle = this.Handle; + + var retArea = stackalloc uint[5]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetItemInHandWasmInterop.wasmImportGetItemInHand(handle, (int)hand, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 8), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + } + + lifted = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack ( + str, ((byte)new global::System.Span((byte*)ptr + 12, 1)[0])); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? GetInventoryItem(byte slot) + { + var handle = this.Handle; + + var retArea = stackalloc uint[5]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetInventoryItemWasmInterop.wasmImportGetInventoryItem(handle, slot, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 8), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + } + + lifted = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack ( + str, ((byte)new global::System.Span((byte*)ptr + 12, 1)[0])); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + public unsafe float GetHealth() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetHealthWasmInterop.wasmImportGetHealth(handle); + return result; + + } + + public unsafe void SetHealth(float health) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetHealthWasmInterop.wasmImportSetHealth(handle, health); + + } + + public unsafe float GetMaxHealth() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetMaxHealthWasmInterop.wasmImportGetMaxHealth(handle); + return result; + + } + + public unsafe void SetMaxHealth(float maxHealth) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetMaxHealthWasmInterop.wasmImportSetMaxHealth(handle, maxHealth); + + } + + public unsafe byte GetFoodLevel() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetFoodLevelWasmInterop.wasmImportGetFoodLevel(handle); + return ((byte)result); + + } + + public unsafe void SetFoodLevel(byte foodLevel) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetFoodLevelWasmInterop.wasmImportSetFoodLevel(handle, foodLevel); + + } + + public unsafe float GetSaturation() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetSaturationWasmInterop.wasmImportGetSaturation(handle); + return result; + + } + + public unsafe void SetSaturation(float saturation) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetSaturationWasmInterop.wasmImportSetSaturation(handle, saturation); + + } + + public unsafe float GetExhaustion() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetExhaustionWasmInterop.wasmImportGetExhaustion(handle); + return result; + + } + + public unsafe void SetExhaustion(float exhaustion) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetExhaustionWasmInterop.wasmImportSetExhaustion(handle, exhaustion); + + } + + public unsafe float GetAbsorption() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetAbsorptionWasmInterop.wasmImportGetAbsorption(handle); + return result; + + } + + public unsafe void SetAbsorption(float absorption) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetAbsorptionWasmInterop.wasmImportSetAbsorption(handle, absorption); + + } + + public unsafe int GetExperienceLevel() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetExperienceLevelWasmInterop.wasmImportGetExperienceLevel(handle); + return result; + + } + + public unsafe float GetExperienceProgress() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetExperienceProgressWasmInterop.wasmImportGetExperienceProgress(handle); + return result; + + } + + public unsafe int GetExperiencePoints() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetExperiencePointsWasmInterop.wasmImportGetExperiencePoints(handle); + return result; + + } + + public unsafe void SetExperienceLevel(int level) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetExperienceLevelWasmInterop.wasmImportSetExperienceLevel(handle, level); + + } + + public unsafe void SetExperienceProgress(float progress) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetExperienceProgressWasmInterop.wasmImportSetExperienceProgress(handle, progress); + + } + + public unsafe void SetExperiencePoints(int points) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetExperiencePointsWasmInterop.wasmImportSetExperiencePoints(handle, points); + + } + + public unsafe void AddExperienceLevels(int levels) + { + var handle = this.Handle; + PlayerImportsInterop.Player.AddExperienceLevelsWasmInterop.wasmImportAddExperienceLevels(handle, levels); + + } + + public unsafe void AddExperiencePoints(int points) + { + var handle = this.Handle; + PlayerImportsInterop.Player.AddExperiencePointsWasmInterop.wasmImportAddExperiencePoints(handle, points); + + } + + public unsafe bool IsFlying() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.IsFlyingWasmInterop.wasmImportIsFlying(handle); + return (result != 0); + + } + + public unsafe void SetFlying(bool flying) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetFlyingWasmInterop.wasmImportSetFlying(handle, (flying ? 1 : 0)); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.PlayerAbilities GetAbilities() + { + var handle = this.Handle; + + var retArea = stackalloc uint[5]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetAbilitiesWasmInterop.wasmImportGetAbilities(handle, ptr); + return new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.PlayerAbilities ( + (new global::System.Span((byte*)ptr + 0, 1)[0] != 0), (new global::System.Span((byte*)ptr + 1, 1)[0] != 0), (new global::System.Span((byte*)ptr + 2, 1)[0] != 0), (new global::System.Span((byte*)ptr + 3, 1)[0] != 0), (new global::System.Span((byte*)ptr + 4, 1)[0] != 0), new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]); + + } + + public unsafe void SetAbilities(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.PlayerAbilities abilities) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetAbilitiesWasmInterop.wasmImportSetAbilities(handle, (abilities.invulnerable ? 1 : 0), (abilities.flying ? 1 : 0), (abilities.allowFlying ? 1 : 0), (abilities.creative ? 1 : 0), (abilities.allowModifyWorld ? 1 : 0), abilities.flySpeed, abilities.walkSpeed); + + } + + public unsafe string GetIp() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetIpWasmInterop.wasmImportGetIp(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.PlayerSkin? GetSkin() + { + var handle = this.Handle; + + var retArea = stackalloc uint[7]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + PlayerImportsInterop.Player.GetSkinWasmInterop.wasmImportGetSkin(handle, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.PlayerSkin? lifted7; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted7 = null; + break; + } + + case 1: { + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 8), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + } + + string? lifted; + + switch (new global::System.Span((byte*)ptr + 12, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + var str6 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 16), 1)[0], new global::System.Span((void*)((byte*)ptr + 20), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 20), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 16), 1)[0]); + } + + lifted = str6; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 12, 1)[0])); + } + + lifted7 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.PlayerSkin ( + str, lifted); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted7; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.SkinParts GetSkinParts() + { + var handle = this.Handle; + var result = PlayerImportsInterop.Player.GetSkinPartsWasmInterop.wasmImportGetSkinParts(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.SkinParts)(result); + + } + + public unsafe void SetSkinParts(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.SkinParts parts) + { + var handle = this.Handle; + PlayerImportsInterop.Player.SetSkinPartsWasmInterop.wasmImportSetSkinParts(handle, (int)parts); + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ISchedulerImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ISchedulerImports.cs new file mode 100644 index 0000000..f96901c --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ISchedulerImports.cs @@ -0,0 +1,29 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface ISchedulerImports { + + public static unsafe uint ScheduleDelayedTask(uint handlerId, ulong delayTicks) + { + var result = SchedulerImportsInterop.ScheduleDelayedTaskWasmInterop.wasmImportScheduleDelayedTask(unchecked((int)(handlerId)), unchecked((long)(delayTicks))); + return unchecked((uint)(result)); + + } + + public static unsafe uint ScheduleRepeatingTask(uint handlerId, ulong delayTicks, ulong periodTicks) + { + var result = SchedulerImportsInterop.ScheduleRepeatingTaskWasmInterop.wasmImportScheduleRepeatingTask(unchecked((int)(handlerId)), unchecked((long)(delayTicks)), unchecked((long)(periodTicks))); + return unchecked((uint)(result)); + + } + + public static unsafe void CancelTask(uint taskId) + { + SchedulerImportsInterop.CancelTaskWasmInterop.wasmImportCancelTask(unchecked((int)(taskId))); + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.cs new file mode 100644 index 0000000..4f2a881 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.cs @@ -0,0 +1,314 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IScoreboardImports { + + public enum RenderType { + INTEGER, HEARTS + } + + public enum DisplaySlot { + PLAYER_LIST, SIDEBAR, BELOW_NAME, SIDEBAR_TEAM_BLACK, SIDEBAR_TEAM_DARK_BLUE, SIDEBAR_TEAM_DARK_GREEN, SIDEBAR_TEAM_DARK_AQUA, SIDEBAR_TEAM_DARK_RED, SIDEBAR_TEAM_DARK_PURPLE, SIDEBAR_TEAM_GOLD, SIDEBAR_TEAM_GRAY, SIDEBAR_TEAM_DARK_GRAY, SIDEBAR_TEAM_BLUE, SIDEBAR_TEAM_GREEN, SIDEBAR_TEAM_AQUA, SIDEBAR_TEAM_RED, SIDEBAR_TEAM_LIGHT_PURPLE, SIDEBAR_TEAM_YELLOW, SIDEBAR_TEAM_WHITE + } + + public enum NametagVisibility { + ALWAYS, NEVER, HIDE_FOR_OTHER_TEAMS, HIDE_FOR_OWN_TEAM + } + + public enum CollisionRule { + ALWAYS, NEVER, PUSH_OTHER_TEAMS, PUSH_OWN_TEAM + } + + public struct TeamSettings { + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent displayName; + public bool friendlyFire; + public bool seeFriendlyInvisibles; + public NametagVisibility nametagVisibility; + public CollisionRule collisionRule; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.NamedColor color; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent prefix; + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent suffix; + + public TeamSettings(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent displayName, bool friendlyFire, bool seeFriendlyInvisibles, NametagVisibility nametagVisibility, CollisionRule collisionRule, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.NamedColor color, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent prefix, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent suffix) { + this.displayName = displayName; + this.friendlyFire = friendlyFire; + this.seeFriendlyInvisibles = seeFriendlyInvisibles; + this.nametagVisibility = nametagVisibility; + this.collisionRule = collisionRule; + this.color = color; + this.prefix = prefix; + this.suffix = suffix; + } + } + + public class Scoreboard: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public Scoreboard(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[resource-drop]scoreboard"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe void AddObjective(string name, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent displayName, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.RenderType renderType) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var handle0 = displayName.Handle; + displayName.Handle = 0; + ScoreboardImportsInterop.Scoreboard.AddObjectiveWasmInterop.wasmImportAddObjective(handle, strPtr.ToInt32(), length, handle0, (int)renderType); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void RemoveObjective(string name) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + ScoreboardImportsInterop.Scoreboard.RemoveObjectiveWasmInterop.wasmImportRemoveObjective(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void SetDisplaySlot(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.DisplaySlot slot, string objectiveName) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(objectiveName); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + ScoreboardImportsInterop.Scoreboard.SetDisplaySlotWasmInterop.wasmImportSetDisplaySlot(handle, (int)slot, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void UpdateScore(string entityName, string objectiveName, int value) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(entityName); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(objectiveName); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + ScoreboardImportsInterop.Scoreboard.UpdateScoreWasmInterop.wasmImportUpdateScore(handle, strPtr.ToInt32(), length, strPtr0.ToInt32(), length2, value); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void RemoveScore(string entityName, string objectiveName) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(entityName); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(objectiveName); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + ScoreboardImportsInterop.Scoreboard.RemoveScoreWasmInterop.wasmImportRemoveScore(handle, strPtr.ToInt32(), length, strPtr0.ToInt32(), length2); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void CreateTeam(string name, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.TeamSettings settings) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var handle0 = settings.displayName.Handle; + settings.displayName.Handle = 0; + var handle1 = settings.prefix.Handle; + settings.prefix.Handle = 0; + var handle2 = settings.suffix.Handle; + settings.suffix.Handle = 0; + ScoreboardImportsInterop.Scoreboard.CreateTeamWasmInterop.wasmImportCreateTeam(handle, strPtr.ToInt32(), length, handle0, (settings.friendlyFire ? 1 : 0), (settings.seeFriendlyInvisibles ? 1 : 0), (int)settings.nametagVisibility, (int)settings.collisionRule, (int)settings.color, handle1, handle2); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void RemoveTeam(string name) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + ScoreboardImportsInterop.Scoreboard.RemoveTeamWasmInterop.wasmImportRemoveTeam(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void UpdateTeam(string name, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.TeamSettings settings) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var handle0 = settings.displayName.Handle; + settings.displayName.Handle = 0; + var handle1 = settings.prefix.Handle; + settings.prefix.Handle = 0; + var handle2 = settings.suffix.Handle; + settings.suffix.Handle = 0; + ScoreboardImportsInterop.Scoreboard.UpdateTeamWasmInterop.wasmImportUpdateTeam(handle, strPtr.ToInt32(), length, handle0, (settings.friendlyFire ? 1 : 0), (settings.seeFriendlyInvisibles ? 1 : 0), (int)settings.nametagVisibility, (int)settings.collisionRule, (int)settings.color, handle1, handle2); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void AddPlayerToTeam(string teamName, string playerName) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(teamName); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(playerName); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + ScoreboardImportsInterop.Scoreboard.AddPlayerToTeamWasmInterop.wasmImportAddPlayerToTeam(handle, strPtr.ToInt32(), length, strPtr0.ToInt32(), length2); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void RemovePlayerFromTeam(string teamName, string playerName) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(teamName); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(playerName); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + ScoreboardImportsInterop.Scoreboard.RemovePlayerFromTeamWasmInterop.wasmImportRemovePlayerFromTeam(handle, strPtr.ToInt32(), length, strPtr0.ToInt32(), length2); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.cs new file mode 100644 index 0000000..67342ab --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.cs @@ -0,0 +1,479 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IServerImports { + + /** + * Represents the difficulty setting of a Minecraft server. + */ + + public enum Difficulty { + PEACEFUL, EASY, NORMAL, HARD + } + + /** + * Represents the three main Minecraft dimensions. + */ + + public enum Dimension { + OVERWORLD, NETHER, END + } + + public class CommandSender { + public readonly byte Tag; + private readonly object? value; + + private CommandSender(byte tag, object? value) { + this.Tag = tag; + this.value = value; + } + + public static CommandSender Console() { + return new CommandSender(Tags.Console, null); + } + + public static CommandSender Player(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player player) { + return new CommandSender(Tags.Player, player); + } + + public global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player AsPlayer + { + get + { + if (Tag == Tags.Player) + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player)value!; + else + throw new global::System.ArgumentException("expected Player, got " + Tag); + } + } + + public class Tags { + public const byte Console = 0; + public const byte Player = 1; + } + } + + /** + * Represents the global server instance. + */ + + public class Server: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public Server(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[resource-drop]server"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Difficulty GetDifficulty() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetDifficultyWasmInterop.wasmImportGetDifficulty(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Difficulty)result; + + } + + public unsafe uint GetPlayerCount() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetPlayerCountWasmInterop.wasmImportGetPlayerCount(handle); + return unchecked((uint)(result)); + + } + + public unsafe double GetMspt() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetMsptWasmInterop.wasmImportGetMspt(handle); + return result; + + } + + public unsafe double GetTps() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetTpsWasmInterop.wasmImportGetTps(handle); + return result; + + } + + public unsafe global::System.Collections.Generic.List GetAllPlayers() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + ServerImportsInterop.Server.GetAllPlayersWasmInterop.wasmImportGetAllPlayers(handle, ptr); + + var array = new global::System.Collections.Generic.List(new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + for (int index = 0; index < new global::System.Span((void*)((byte*)ptr + 4), 1)[0]; ++index) { + nint basePtr = new global::System.Span((void*)((byte*)ptr + 0), 1)[0] + (index * 4); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)basePtr + 0), 1)[0])); + + array.Add(resource); + } + + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + return array; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? GetPlayerByName(string name) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + ServerImportsInterop.Server.GetPlayerByNameWasmInterop.wasmImportGetPlayerByName(handle, strPtr.ToInt32(), length, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + + lifted = resource; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return lifted; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? GetPlayerByUuid(string id) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(id); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + ServerImportsInterop.Server.GetPlayerByUuidWasmInterop.wasmImportGetPlayerByUuid(handle, strPtr.ToInt32(), length, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + + lifted = resource; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return lifted; + + } + + public unsafe global::System.Collections.Generic.List GetAllWorlds() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + ServerImportsInterop.Server.GetAllWorldsWasmInterop.wasmImportGetAllWorlds(handle, ptr); + + var array = new global::System.Collections.Generic.List(new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + for (int index = 0; index < new global::System.Span((void*)((byte*)ptr + 4), 1)[0]; ++index) { + nint basePtr = new global::System.Span((void*)((byte*)ptr + 0), 1)[0] + (index * 4); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)basePtr + 0), 1)[0])); + + array.Add(resource); + } + + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + return array; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World? GetWorldByName(string name) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + ServerImportsInterop.Server.GetWorldByNameWasmInterop.wasmImportGetWorldByName(handle, strPtr.ToInt32(), length, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + + lifted = resource; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return lifted; + + } + + public unsafe void ExecuteCommand(string command, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.CommandSender sender) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(command); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + int lowered; + int lowered4; + + switch (sender.Tag) { + case 0: { + + lowered = 0; + lowered4 = 0; + + break; + } + case 1: { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player payload2 = sender.AsPlayer; + var handle3 = payload2.Handle; + payload2.Handle = 0; + + lowered = 1; + lowered4 = handle3; + + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + sender); + } + ServerImportsInterop.Server.ExecuteCommandWasmInterop.wasmImportExecuteCommand(handle, strPtr.ToInt32(), length, lowered, lowered4); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World CreateWorld(string name, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Dimension dimension) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(name); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var result = ServerImportsInterop.Server.CreateWorldWasmInterop.wasmImportCreateWorld(handle, strPtr.ToInt32(), length, (int)dimension); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(result)); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return resource; + + } + + public unsafe void Broadcast(string message) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(message); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + ServerImportsInterop.Server.BroadcastWasmInterop.wasmImportBroadcast(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void BroadcastTabListHeaderFooter(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent header, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent footer) + { + var handle = this.Handle; + var handle0 = header.Handle; + header.Handle = 0; + var handle1 = footer.Handle; + footer.Handle = 0; + ServerImportsInterop.Server.BroadcastTabListHeaderFooterWasmInterop.wasmImportBroadcastTabListHeaderFooter(handle, handle0, handle1); + + } + + public unsafe uint GetMaxPlayers() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetMaxPlayersWasmInterop.wasmImportGetMaxPlayers(handle); + return unchecked((uint)(result)); + + } + + public unsafe bool IsHardcore() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.IsHardcoreWasmInterop.wasmImportIsHardcore(handle); + return (result != 0); + + } + + public unsafe bool IsOnlineMode() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.IsOnlineModeWasmInterop.wasmImportIsOnlineMode(handle); + return (result != 0); + + } + + public unsafe string GetMotd() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + ServerImportsInterop.Server.GetMotdWasmInterop.wasmImportGetMotd(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe bool HasWhitelist() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.HasWhitelistWasmInterop.wasmImportHasWhitelist(handle); + return (result != 0); + + } + + public unsafe bool GetAllowNether() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetAllowNetherWasmInterop.wasmImportGetAllowNether(handle); + return (result != 0); + + } + + public unsafe bool GetAllowEnd() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetAllowEndWasmInterop.wasmImportGetAllowEnd(handle); + return (result != 0); + + } + + public unsafe byte GetViewDistance() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetViewDistanceWasmInterop.wasmImportGetViewDistance(handle); + return ((byte)result); + + } + + public unsafe byte GetSimulationDistance() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetSimulationDistanceWasmInterop.wasmImportGetSimulationDistance(handle); + return ((byte)result); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode GetDefaultGamemode() + { + var handle = this.Handle; + var result = ServerImportsInterop.Server.GetDefaultGamemodeWasmInterop.wasmImportGetDefaultGamemode(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode)result; + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.cs new file mode 100644 index 0000000..3a9eaba --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.cs @@ -0,0 +1,411 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface ITextImports { + + public class TextComponent: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public TextComponent(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[resource-drop]text-component"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public static unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent Text(string plain) + { + var cleanups = new global::System.Collections.Generic.List(); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(plain); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + var result = TextImportsInterop.TextComponent.TextWasmInterop.wasmImportText(strPtr.ToInt32(), length); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(result)); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return resource; + + } + + public static unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent Translate(string key, global::System.Collections.Generic.List with) + { + var cleanups = new global::System.Collections.Generic.List(); + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(key); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + void* address; + if ((4 * with.Count) < 1024) { + var retArea = stackalloc uint[1 * with.Count + 1]; + address = MemoryHelper.AlignStackPtr(retArea, 4); + } + else + { + var bufferSize = 4 * (nuint)with.Count; + address = global::System.Runtime.InteropServices.NativeMemory.AlignedAlloc(bufferSize, 4); + cleanups.Add(() => global::System.Runtime.InteropServices.NativeMemory.AlignedFree(address)); + } + + for (int index = 0; index < with.Count; ++index) { + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent element = with[index]; + int basePtr = (int)address + (index * 4); + var handle = element.Handle; + element.Handle = 0; + new global::System.Span((void*)((byte*)basePtr + 0), 1)[0] = handle; + + } + var result = TextImportsInterop.TextComponent.TranslateWasmInterop.wasmImportTranslate(strPtr.ToInt32(), length, (int)address, with.Count); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(result)); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + return resource; + + } + + public unsafe void AddChild(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent child) + { + var handle = this.Handle; + var handle0 = child.Handle; + child.Handle = 0; + TextImportsInterop.TextComponent.AddChildWasmInterop.wasmImportAddChild(handle, handle0); + + } + + public unsafe void AddText(string text) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(text); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.AddTextWasmInterop.wasmImportAddText(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe string GetText() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + TextImportsInterop.TextComponent.GetTextWasmInterop.wasmImportGetText(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe byte[] Encode() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + TextImportsInterop.TextComponent.EncodeWasmInterop.wasmImportEncode(handle, ptr); + + var array = new byte[new global::System.Span((void*)((byte*)ptr + 4), 1)[0]]; + new global::System.Span((void*)(new global::System.Span((void*)((byte*)ptr + 0), 1)[0]), new global::System.Span((void*)((byte*)ptr + 4), 1)[0]).CopyTo(new global::System.Span(array)); + + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + return array; + + } + + public unsafe void ColorNamed(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.NamedColor color) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.ColorNamedWasmInterop.wasmImportColorNamed(handle, (int)color); + + } + + public unsafe void ColorRgb(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.RgbColor color) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.ColorRgbWasmInterop.wasmImportColorRgb(handle, color.r, color.g, color.b); + + } + + public unsafe void Bold(bool value) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.BoldWasmInterop.wasmImportBold(handle, (value ? 1 : 0)); + + } + + public unsafe void Italic(bool value) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.ItalicWasmInterop.wasmImportItalic(handle, (value ? 1 : 0)); + + } + + public unsafe void Underlined(bool value) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.UnderlinedWasmInterop.wasmImportUnderlined(handle, (value ? 1 : 0)); + + } + + public unsafe void Strikethrough(bool value) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.StrikethroughWasmInterop.wasmImportStrikethrough(handle, (value ? 1 : 0)); + + } + + public unsafe void Obfuscated(bool value) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.ObfuscatedWasmInterop.wasmImportObfuscated(handle, (value ? 1 : 0)); + + } + + public unsafe void Insertion(string text) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(text); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.InsertionWasmInterop.wasmImportInsertion(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void Font(string font) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(font); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.FontWasmInterop.wasmImportFont(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void ShadowColor(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ArgbColor color) + { + var handle = this.Handle; + TextImportsInterop.TextComponent.ShadowColorWasmInterop.wasmImportShadowColor(handle, color.a, color.r, color.g, color.b); + + } + + public unsafe void ClickOpenUrl(string url) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(url); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.ClickOpenUrlWasmInterop.wasmImportClickOpenUrl(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void ClickRunCommand(string command) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(command); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.ClickRunCommandWasmInterop.wasmImportClickRunCommand(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void ClickSuggestCommand(string command) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(command); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.ClickSuggestCommandWasmInterop.wasmImportClickSuggestCommand(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void ClickCopyToClipboard(string text) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(text); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.ClickCopyToClipboardWasmInterop.wasmImportClickCopyToClipboard(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void HoverShowText(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent text) + { + var handle = this.Handle; + var handle0 = text.Handle; + text.Handle = 0; + TextImportsInterop.TextComponent.HoverShowTextWasmInterop.wasmImportHoverShowText(handle, handle0); + + } + + public unsafe void HoverShowItem(string item) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(item); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + TextImportsInterop.TextComponent.HoverShowItemWasmInterop.wasmImportHoverShowItem(handle, strPtr.ToInt32(), length); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void HoverShowEntity(string entityType, string id, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent? name) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(entityType); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + + var utf8Bytes1 = global::System.Text.Encoding.UTF8.GetBytes(id); + var length2 = utf8Bytes1.Length; + var gcHandle3 = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes1, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr0 = gcHandle3.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle3.Free()); + + int lowered; + int lowered8; + + if (name != null) { + var payload6 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent) name; + var handle7 = payload6.Handle; + payload6.Handle = 0; + + lowered = 1; + lowered8 = handle7; + + } else { + + lowered = 0; + lowered8 = 0; + + } + TextImportsInterop.TextComponent.HoverShowEntityWasmInterop.wasmImportHoverShowEntity(handle, strPtr.ToInt32(), length, strPtr0.ToInt32(), length2, lowered, lowered8); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.cs new file mode 100644 index 0000000..e89d200 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.cs @@ -0,0 +1,779 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0; + +public interface IWorldImports { + + /** + * Defines how a block reacts when pushed by a piston. + */ + + public enum PistonBehavior { + NORMAL, DESTROY, BLOCK, IGNORE, PUSH_ONLY + } + + /** + * Categories for sounds to control their volume independently. + */ + + public enum SoundCategory { + MASTER, MUSIC, RECORDS, WEATHER, BLOCKS, HOSTILE, NEUTRAL, PLAYERS, AMBIENT, VOICE + } + + /** + * Defines how an explosion interacts with blocks in the world. + */ + + public enum ExplosionInteraction { + NONE, BLOCK, MOB, TNT, TRIGGER + } + + /** + * Flags used to control block updates and notifications. + */ + + public enum BlockFlags : byte { + NOTIFY_NEIGHBORS = 1 << 0, + NOTIFY_LISTENERS = 1 << 1, + FORCE_STATE = 1 << 2, + SKIP_DROPS = 1 << 3, + MOVED = 1 << 4, + SKIP_REDSTONE_WIRE_STATE_REPLACEMENT = 1 << 5, + SKIP_BLOCK_ENTITY_REPLACED_CALLBACK = 1 << 6, + SKIP_BLOCK_ADDED_CALLBACK = 1 << 7, + } + + /** + * Detailed information about a block's state. + */ + + public struct BlockState { + public ushort id; + public byte luminance; + public byte opacity; + public float hardness; + public bool isAir; + public bool isLiquid; + public bool isSolid; + public bool isFullCube; + public PistonBehavior pistonBehavior; + public bool hasRandomTicks; + + public BlockState(ushort id, byte luminance, byte opacity, float hardness, bool isAir, bool isLiquid, bool isSolid, bool isFullCube, PistonBehavior pistonBehavior, bool hasRandomTicks) { + this.id = id; + this.luminance = luminance; + this.opacity = opacity; + this.hardness = hardness; + this.isAir = isAir; + this.isLiquid = isLiquid; + this.isSolid = isSolid; + this.isFullCube = isFullCube; + this.pistonBehavior = pistonBehavior; + this.hasRandomTicks = hasRandomTicks; + } + } + + /** + * A simple wrapper for a block state ID. + */ + + public struct BlockStateId { + public ushort id; + + public BlockStateId(ushort id) { + this.id = id; + } + } + + /** + * A position in the world grid. + */ + + public struct BlockPos { + public int x; + public int y; + public int z; + + public BlockPos(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + } + + /** + * Represents a cardinal direction or block face. + */ + + public enum BlockDirection { + DOWN, UP, NORTH, SOUTH, WEST, EAST + } + + /** + * Result of a raycast operation. + */ + + public struct RaycastResult { + public BlockPos pos; + public BlockDirection face; + + public RaycastResult(BlockPos pos, BlockDirection face) { + this.pos = pos; + this.face = face; + } + } + + public class Entity: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public Entity(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[resource-drop]entity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe uint GetId() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetIdWasmInterop.wasmImportGetId(handle); + return unchecked((uint)(result)); + + } + + public unsafe string GetUuid() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.Entity.GetUuidWasmInterop.wasmImportGetUuid(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public new unsafe string GetType() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.Entity.GetTypeWasmInterop.wasmImportGetType(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe (double, double, double) GetPosition() + { + var handle = this.Handle; + + var retArea = stackalloc ulong[4]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 8); + WorldImportsInterop.Entity.GetPositionWasmInterop.wasmImportGetPosition(handle, ptr); + return (new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 16), 1)[0]); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World GetWorld() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetWorldWasmInterop.wasmImportGetWorld(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(result)); + return resource; + + } + + public unsafe float GetYaw() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetYawWasmInterop.wasmImportGetYaw(handle); + return result; + + } + + public unsafe float GetPitch() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetPitchWasmInterop.wasmImportGetPitch(handle); + return result; + + } + + public unsafe float GetHeadYaw() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetHeadYawWasmInterop.wasmImportGetHeadYaw(handle); + return result; + + } + + public unsafe bool IsOnGround() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsOnGroundWasmInterop.wasmImportIsOnGround(handle); + return (result != 0); + + } + + public unsafe bool IsSneaking() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsSneakingWasmInterop.wasmImportIsSneaking(handle); + return (result != 0); + + } + + public unsafe void SetSneaking(bool sneaking) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetSneakingWasmInterop.wasmImportSetSneaking(handle, (sneaking ? 1 : 0)); + + } + + public unsafe bool IsSprinting() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsSprintingWasmInterop.wasmImportIsSprinting(handle); + return (result != 0); + + } + + public unsafe void SetSprinting(bool sprinting) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetSprintingWasmInterop.wasmImportSetSprinting(handle, (sprinting ? 1 : 0)); + + } + + public unsafe bool IsSwimming() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsSwimmingWasmInterop.wasmImportIsSwimming(handle); + return (result != 0); + + } + + public unsafe void SetSwimming(bool swimming) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetSwimmingWasmInterop.wasmImportSetSwimming(handle, (swimming ? 1 : 0)); + + } + + public unsafe bool IsInvisible() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsInvisibleWasmInterop.wasmImportIsInvisible(handle); + return (result != 0); + + } + + public unsafe void SetInvisible(bool invisible) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetInvisibleWasmInterop.wasmImportSetInvisible(handle, (invisible ? 1 : 0)); + + } + + public unsafe bool IsGlowing() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsGlowingWasmInterop.wasmImportIsGlowing(handle); + return (result != 0); + + } + + public unsafe void SetGlowing(bool glowing) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetGlowingWasmInterop.wasmImportSetGlowing(handle, (glowing ? 1 : 0)); + + } + + public unsafe bool IsFallFlying() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsFallFlyingWasmInterop.wasmImportIsFallFlying(handle); + return (result != 0); + + } + + public unsafe void SetFallFlying(bool fallFlying) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetFallFlyingWasmInterop.wasmImportSetFallFlying(handle, (fallFlying ? 1 : 0)); + + } + + public unsafe bool IsOnFire() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsOnFireWasmInterop.wasmImportIsOnFire(handle); + return (result != 0); + + } + + public unsafe void SetOnFire(bool onFire) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetOnFireWasmInterop.wasmImportSetOnFire(handle, (onFire ? 1 : 0)); + + } + + public unsafe void Teleport((double, double, double) pos, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World worldRef) + { + var handle = this.Handle; + var handle0 = worldRef.Handle; + worldRef.Handle = 0; + WorldImportsInterop.Entity.TeleportWasmInterop.wasmImportTeleport(handle, pos.Item1, pos.Item2, pos.Item3, handle0); + + } + + public unsafe void SetVelocity((double, double, double) velocity) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetVelocityWasmInterop.wasmImportSetVelocity(handle, velocity.Item1, velocity.Item2, velocity.Item3); + + } + + public unsafe (double, double, double) GetVelocity() + { + var handle = this.Handle; + + var retArea = stackalloc ulong[4]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 8); + WorldImportsInterop.Entity.GetVelocityWasmInterop.wasmImportGetVelocity(handle, ptr); + return (new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 16), 1)[0]); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.EntityPose GetPose() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetPoseWasmInterop.wasmImportGetPose(handle); + return (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.EntityPose)result; + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent GetName() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetNameWasmInterop.wasmImportGetName(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(result)); + return resource; + + } + + public unsafe void SetCustomName(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent name) + { + var handle = this.Handle; + var handle0 = name.Handle; + name.Handle = 0; + WorldImportsInterop.Entity.SetCustomNameWasmInterop.wasmImportSetCustomName(handle, handle0); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent? GetCustomName() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.Entity.GetCustomNameWasmInterop.wasmImportGetCustomName(handle, ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span((void*)((byte*)ptr + 4), 1)[0])); + + lifted = resource; + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + public unsafe void SetCustomNameVisible(bool visible) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetCustomNameVisibleWasmInterop.wasmImportSetCustomNameVisible(handle, (visible ? 1 : 0)); + + } + + public unsafe bool IsCustomNameVisible() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsCustomNameVisibleWasmInterop.wasmImportIsCustomNameVisible(handle); + return (result != 0); + + } + + public unsafe bool IsInvulnerable() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.IsInvulnerableWasmInterop.wasmImportIsInvulnerable(handle); + return (result != 0); + + } + + public unsafe void SetInvulnerable(bool invulnerable) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetInvulnerableWasmInterop.wasmImportSetInvulnerable(handle, (invulnerable ? 1 : 0)); + + } + + public unsafe int GetFireTicks() + { + var handle = this.Handle; + var result = WorldImportsInterop.Entity.GetFireTicksWasmInterop.wasmImportGetFireTicks(handle); + return result; + + } + + public unsafe void SetFireTicks(int ticks) + { + var handle = this.Handle; + WorldImportsInterop.Entity.SetFireTicksWasmInterop.wasmImportSetFireTicks(handle, ticks); + + } + + public unsafe void Remove() + { + var handle = this.Handle; + WorldImportsInterop.Entity.RemoveWasmInterop.wasmImportRemove(handle); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.RaycastResult? Raycast(double maxDistance, bool fluidHandling) + { + var handle = this.Handle; + + var retArea = stackalloc uint[6]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.Entity.RaycastWasmInterop.wasmImportRaycast(handle, maxDistance, (fluidHandling ? 1 : 0), ptr); + + global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.RaycastResult? lifted; + + switch (new global::System.Span((byte*)ptr + 0, 1)[0]) { + case 0: { + lifted = null; + break; + } + + case 1: { + + lifted = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.RaycastResult ( + new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockPos ( + new global::System.Span((void*)((byte*)ptr + 4), 1)[0], new global::System.Span((void*)((byte*)ptr + 8), 1)[0], new global::System.Span((void*)((byte*)ptr + 12), 1)[0]), (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockDirection)new global::System.Span((byte*)ptr + 16, 1)[0]); + break; + } + + default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span((byte*)ptr + 0, 1)[0])); + } + return lifted; + + } + + } + + /** + * Represents a Minecraft world (dimension). + */ + + public class World: global::System.IDisposable { + internal int Handle { get; set; } + + public readonly record struct THandle(int Handle); + + public World(THandle handle) { + Handle = handle.Handle; + } + + public void Dispose() { + Dispose(true); + } + + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[resource-drop]world"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + private static extern void wasmImportResourceDrop(int p0); + + protected virtual void Dispose(bool disposing) { + if (disposing && Handle != 0) { + wasmImportResourceDrop(Handle); + Handle = 0; + } + } + + public unsafe string GetId() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.World.GetIdWasmInterop.wasmImportGetId(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe ushort GetBlockStateId(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockPos pos) + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetBlockStateIdWasmInterop.wasmImportGetBlockStateId(handle, pos.x, pos.y, pos.z); + return ((ushort)result); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockState GetBlockState(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockPos pos) + { + var handle = this.Handle; + + var retArea = stackalloc uint[5]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.World.GetBlockStateWasmInterop.wasmImportGetBlockState(handle, pos.x, pos.y, pos.z, ptr); + return new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockState ( + ((ushort)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]), ((byte)new global::System.Span((byte*)ptr + 2, 1)[0]), ((byte)new global::System.Span((byte*)ptr + 3, 1)[0]), new global::System.Span((void*)((byte*)ptr + 4), 1)[0], (new global::System.Span((byte*)ptr + 8, 1)[0] != 0), (new global::System.Span((byte*)ptr + 9, 1)[0] != 0), (new global::System.Span((byte*)ptr + 10, 1)[0] != 0), (new global::System.Span((byte*)ptr + 11, 1)[0] != 0), (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.PistonBehavior)new global::System.Span((byte*)ptr + 12, 1)[0], (new global::System.Span((byte*)ptr + 13, 1)[0] != 0)); + + } + + public unsafe void SetBlockState(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockPos pos, ushort state, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.BlockFlags updateFlags) + { + var handle = this.Handle; + WorldImportsInterop.World.SetBlockStateWasmInterop.wasmImportSetBlockState(handle, pos.x, pos.y, pos.z, state, (int)updateFlags); + + } + + public unsafe ulong GetTimeOfDay() + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetTimeOfDayWasmInterop.wasmImportGetTimeOfDay(handle); + return unchecked((ulong)(result)); + + } + + public unsafe void SetTimeOfDay(ulong time) + { + var handle = this.Handle; + WorldImportsInterop.World.SetTimeOfDayWasmInterop.wasmImportSetTimeOfDay(handle, unchecked((long)(time))); + + } + + public unsafe ulong GetWorldAge() + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetWorldAgeWasmInterop.wasmImportGetWorldAge(handle); + return unchecked((ulong)(result)); + + } + + public unsafe string GetDimension() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.World.GetDimensionWasmInterop.wasmImportGetDimension(handle, ptr); + + var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0], new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + + return str; + + } + + public unsafe int GetTopBlockY(int x, int z) + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetTopBlockYWasmInterop.wasmImportGetTopBlockY(handle, x, z); + return result; + + } + + public unsafe int GetMotionBlockingHeight(int x, int z) + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetMotionBlockingHeightWasmInterop.wasmImportGetMotionBlockingHeight(handle, x, z); + return result; + + } + + public unsafe bool IsRaining() + { + var handle = this.Handle; + var result = WorldImportsInterop.World.IsRainingWasmInterop.wasmImportIsRaining(handle); + return (result != 0); + + } + + public unsafe void SetRaining(bool raining) + { + var handle = this.Handle; + WorldImportsInterop.World.SetRainingWasmInterop.wasmImportSetRaining(handle, (raining ? 1 : 0)); + + } + + public unsafe bool IsThundering() + { + var handle = this.Handle; + var result = WorldImportsInterop.World.IsThunderingWasmInterop.wasmImportIsThundering(handle); + return (result != 0); + + } + + public unsafe void SetThundering(bool thundering) + { + var handle = this.Handle; + WorldImportsInterop.World.SetThunderingWasmInterop.wasmImportSetThundering(handle, (thundering ? 1 : 0)); + + } + + public unsafe void BroadcastSystemMessage(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent message, bool overlay) + { + var handle = this.Handle; + var handle0 = message.Handle; + message.Handle = 0; + WorldImportsInterop.World.BroadcastSystemMessageWasmInterop.wasmImportBroadcastSystemMessage(handle, handle0, (overlay ? 1 : 0)); + + } + + public unsafe global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.Scoreboard GetScoreboard() + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetScoreboardWasmInterop.wasmImportGetScoreboard(handle); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.Scoreboard(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IScoreboardImports.Scoreboard.THandle(result)); + return resource; + + } + + public unsafe void PlaySound(string sound, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.SoundCategory category, (double, double, double) pos, float volume, float pitch) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(sound); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + WorldImportsInterop.World.PlaySoundWasmInterop.wasmImportPlaySound(handle, strPtr.ToInt32(), length, (int)category, pos.Item1, pos.Item2, pos.Item3, volume, pitch); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void SpawnParticle(string particle, (double, double, double) pos, (double, double, double) offset, float maxSpeed, int count) + { + var cleanups = new global::System.Collections.Generic.List(); + var handle = this.Handle; + + var utf8Bytes = global::System.Text.Encoding.UTF8.GetBytes(particle); + var length = utf8Bytes.Length; + var gcHandle = global::System.Runtime.InteropServices.GCHandle.Alloc(utf8Bytes, global::System.Runtime.InteropServices.GCHandleType.Pinned); + var strPtr = gcHandle.AddrOfPinnedObject(); + + cleanups.Add(()=> gcHandle.Free()); + WorldImportsInterop.World.SpawnParticleWasmInterop.wasmImportSpawnParticle(handle, strPtr.ToInt32(), length, pos.Item1, pos.Item2, pos.Item3, offset.Item1, offset.Item2, offset.Item3, maxSpeed, count); + + foreach (var cleanup in cleanups) + { + cleanup(); + } + + } + + public unsafe void CreateExplosion((double, double, double) pos, float power, bool createFire, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.ExplosionInteraction interaction) + { + var handle = this.Handle; + WorldImportsInterop.World.CreateExplosionWasmInterop.wasmImportCreateExplosion(handle, pos.Item1, pos.Item2, pos.Item3, power, (createFire ? 1 : 0), (int)interaction); + + } + + public unsafe int GetSeaLevel() + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetSeaLevelWasmInterop.wasmImportGetSeaLevel(handle); + return result; + + } + + public unsafe int GetMinY() + { + var handle = this.Handle; + var result = WorldImportsInterop.World.GetMinYWasmInterop.wasmImportGetMinY(handle); + return result; + + } + + public unsafe global::System.Collections.Generic.List GetEntities() + { + var handle = this.Handle; + + var retArea = stackalloc uint[3]; + var ptr = (nint)MemoryHelper.AlignStackPtr(retArea, 4); + WorldImportsInterop.World.GetEntitiesWasmInterop.wasmImportGetEntities(handle, ptr); + + var array = new global::System.Collections.Generic.List(new global::System.Span((void*)((byte*)ptr + 4), 1)[0]); + for (int index = 0; index < new global::System.Span((void*)((byte*)ptr + 4), 1)[0]; ++index) { + nint basePtr = new global::System.Span((void*)((byte*)ptr + 0), 1)[0] + (index * 4); + var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.Entity.THandle(new global::System.Span((void*)((byte*)basePtr + 0), 1)[0])); + + array.Add(resource); + } + + if (new global::System.Span((void*)((byte*)ptr + 4), 1)[0] > 0) { + global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span((void*)((byte*)ptr + 0), 1)[0]); + } + return array; + + } + + } + +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.LoggingImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.LoggingImportsInterop.cs new file mode 100644 index 0000000..ec1d2f6 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.LoggingImportsInterop.cs @@ -0,0 +1,24 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class LoggingImportsInterop { + + public static class LogWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/logging@0.1.0", EntryPoint = "log"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportLog(int p0, nint p1, int p2); + } + + public static class LogTracingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/logging@0.1.0", EntryPoint = "log-tracing"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportLogTracing(nint p0, int p1); + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.PermissionImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.PermissionImportsInterop.cs new file mode 100644 index 0000000..b625f56 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.PermissionImportsInterop.cs @@ -0,0 +1,12 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class PermissionImportsInterop { + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.PlayerImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.PlayerImportsInterop.cs new file mode 100644 index 0000000..f834ebe --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.PlayerImportsInterop.cs @@ -0,0 +1,413 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class PlayerImportsInterop { + + internal static class Player + { + + public static class AsEntityWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.as-entity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportAsEntity(int p0); + } + + public static class GetIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetId(int p0, nint p1); + } + + public static class GetNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetName(int p0, nint p1); + } + + public static class GetPositionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-position"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetPosition(int p0, nint p1); + } + + public static class GetYawWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-yaw"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetYaw(int p0); + } + + public static class GetPitchWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-pitch"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetPitch(int p0); + } + + public static class GetWorldWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-world"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetWorld(int p0); + } + + public static class GetGamemodeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-gamemode"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetGamemode(int p0); + } + + public static class SetGamemodeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-gamemode"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportSetGamemode(int p0, int p1); + } + + public static class GetLocaleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-locale"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetLocale(int p0, nint p1); + } + + public static class GetPingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-ping"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetPing(int p0); + } + + public static class GetPermissionLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-permission-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetPermissionLevel(int p0); + } + + public static class SetPermissionLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-permission-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetPermissionLevel(int p0, int p1); + } + + public static class SetPermissionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-permission"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetPermission(int p0, nint p1, int p2, int p3); + } + + public static class UnsetPermissionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.unset-permission"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportUnsetPermission(int p0, nint p1, int p2); + } + + public static class HasPermissionSetWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.has-permission-set"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportHasPermissionSet(int p0, nint p1, int p2, nint p3); + } + + public static class HasPermissionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.has-permission"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportHasPermission(int p0, nint p1, int p2); + } + + public static class GetDisplayNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-display-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetDisplayName(int p0); + } + + public static class SetDisplayNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-display-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetDisplayName(int p0, int p1); + } + + public static class SendSystemMessageWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.send-system-message"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSendSystemMessage(int p0, int p1, int p2); + } + + public static class SetTabListHeaderFooterWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-tab-list-header-footer"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetTabListHeaderFooter(int p0, int p1, int p2); + } + + public static class SetTabListOrderWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-tab-list-order"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetTabListOrder(int p0, int p1); + } + + public static class SetTabListLatencyWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-tab-list-latency"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetTabListLatency(int p0, int p1); + } + + public static class SetTabListListedWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-tab-list-listed"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetTabListListed(int p0, int p1); + } + + public static class ShowTitleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.show-title"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportShowTitle(int p0, int p1); + } + + public static class ShowSubtitleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.show-subtitle"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportShowSubtitle(int p0, int p1); + } + + public static class ShowActionbarWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.show-actionbar"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportShowActionbar(int p0, int p1); + } + + public static class SendTitleAnimationWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.send-title-animation"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSendTitleAnimation(int p0, int p1, int p2, int p3); + } + + public static class TeleportWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.teleport"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportTeleport(int p0, double p1, double p2, double p3, int p4, float p5, int p6, float p7, int p8); + } + + public static class TeleportWorldWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.teleport-world"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportTeleportWorld(int p0, int p1, double p2, double p3, double p4, int p5, float p6, int p7, float p8); + } + + public static class KickWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.kick"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportKick(int p0, int p1); + } + + public static class RespawnWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.respawn"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRespawn(int p0); + } + + public static class OpenGuiWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.open-gui"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportOpenGui(int p0, int p1); + } + + public static class BanWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.ban"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportBan(int p0, int p1, int p2); + } + + public static class BanIpWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.ban-ip"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportBanIp(int p0, int p1, int p2); + } + + public static class GetSelectedSlotWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-selected-slot"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetSelectedSlot(int p0); + } + + public static class GetItemInHandWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-item-in-hand"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetItemInHand(int p0, int p1, nint p2); + } + + public static class GetInventoryItemWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-inventory-item"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetInventoryItem(int p0, int p1, nint p2); + } + + public static class GetHealthWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-health"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetHealth(int p0); + } + + public static class SetHealthWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-health"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetHealth(int p0, float p1); + } + + public static class GetMaxHealthWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-max-health"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetMaxHealth(int p0); + } + + public static class SetMaxHealthWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-max-health"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetMaxHealth(int p0, float p1); + } + + public static class GetFoodLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-food-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetFoodLevel(int p0); + } + + public static class SetFoodLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-food-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetFoodLevel(int p0, int p1); + } + + public static class GetSaturationWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-saturation"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetSaturation(int p0); + } + + public static class SetSaturationWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-saturation"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetSaturation(int p0, float p1); + } + + public static class GetExhaustionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-exhaustion"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetExhaustion(int p0); + } + + public static class SetExhaustionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-exhaustion"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetExhaustion(int p0, float p1); + } + + public static class GetAbsorptionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-absorption"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetAbsorption(int p0); + } + + public static class SetAbsorptionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-absorption"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetAbsorption(int p0, float p1); + } + + public static class GetExperienceLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-experience-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetExperienceLevel(int p0); + } + + public static class GetExperienceProgressWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-experience-progress"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetExperienceProgress(int p0); + } + + public static class GetExperiencePointsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-experience-points"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetExperiencePoints(int p0); + } + + public static class SetExperienceLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-experience-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetExperienceLevel(int p0, int p1); + } + + public static class SetExperienceProgressWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-experience-progress"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetExperienceProgress(int p0, float p1); + } + + public static class SetExperiencePointsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-experience-points"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetExperiencePoints(int p0, int p1); + } + + public static class AddExperienceLevelsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.add-experience-levels"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAddExperienceLevels(int p0, int p1); + } + + public static class AddExperiencePointsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.add-experience-points"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAddExperiencePoints(int p0, int p1); + } + + public static class IsFlyingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.is-flying"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsFlying(int p0); + } + + public static class SetFlyingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-flying"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetFlying(int p0, int p1); + } + + public static class GetAbilitiesWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-abilities"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetAbilities(int p0, nint p1); + } + + public static class SetAbilitiesWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-abilities"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetAbilities(int p0, int p1, int p2, int p3, int p4, int p5, float p6, float p7); + } + + public static class GetIpWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-ip"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetIp(int p0, nint p1); + } + + public static class GetSkinWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-skin"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetSkin(int p0, nint p1); + } + + public static class GetSkinPartsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.get-skin-parts"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetSkinParts(int p0); + } + + public static class SetSkinPartsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/player@0.1.0", EntryPoint = "[method]player.set-skin-parts"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetSkinParts(int p0, int p1); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.SchedulerImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.SchedulerImportsInterop.cs new file mode 100644 index 0000000..2cc8908 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.SchedulerImportsInterop.cs @@ -0,0 +1,30 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class SchedulerImportsInterop { + + public static class ScheduleDelayedTaskWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scheduler@0.1.0", EntryPoint = "schedule-delayed-task"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportScheduleDelayedTask(int p0, long p1); + } + + public static class ScheduleRepeatingTaskWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scheduler@0.1.0", EntryPoint = "schedule-repeating-task"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportScheduleRepeatingTask(int p0, long p1, long p2); + } + + public static class CancelTaskWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scheduler@0.1.0", EntryPoint = "cancel-task"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportCancelTask(int p0); + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ScoreboardImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ScoreboardImportsInterop.cs new file mode 100644 index 0000000..29ca0a5 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ScoreboardImportsInterop.cs @@ -0,0 +1,77 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class ScoreboardImportsInterop { + + internal static class Scoreboard + { + + public static class AddObjectiveWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.add-objective"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAddObjective(int p0, nint p1, int p2, int p3, int p4); + } + + public static class RemoveObjectiveWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.remove-objective"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRemoveObjective(int p0, nint p1, int p2); + } + + public static class SetDisplaySlotWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.set-display-slot"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetDisplaySlot(int p0, int p1, nint p2, int p3); + } + + public static class UpdateScoreWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.update-score"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportUpdateScore(int p0, nint p1, int p2, nint p3, int p4, int p5); + } + + public static class RemoveScoreWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.remove-score"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRemoveScore(int p0, nint p1, int p2, nint p3, int p4); + } + + public static class CreateTeamWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.create-team"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportCreateTeam(int p0, nint p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10); + } + + public static class RemoveTeamWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.remove-team"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRemoveTeam(int p0, nint p1, int p2); + } + + public static class UpdateTeamWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.update-team"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportUpdateTeam(int p0, nint p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10); + } + + public static class AddPlayerToTeamWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.add-player-to-team"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAddPlayerToTeam(int p0, nint p1, int p2, nint p3, int p4); + } + + public static class RemovePlayerFromTeamWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/scoreboard@0.1.0", EntryPoint = "[method]scoreboard.remove-player-from-team"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRemovePlayerFromTeam(int p0, nint p1, int p2, nint p3, int p4); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ServerImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ServerImportsInterop.cs new file mode 100644 index 0000000..0d3b510 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ServerImportsInterop.cs @@ -0,0 +1,155 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class ServerImportsInterop { + + internal static class Server + { + + public static class GetDifficultyWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-difficulty"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetDifficulty(int p0); + } + + public static class GetPlayerCountWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-player-count"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetPlayerCount(int p0); + } + + public static class GetMsptWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-mspt"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern double wasmImportGetMspt(int p0); + } + + public static class GetTpsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-tps"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern double wasmImportGetTps(int p0); + } + + public static class GetAllPlayersWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-all-players"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetAllPlayers(int p0, nint p1); + } + + public static class GetPlayerByNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-player-by-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetPlayerByName(int p0, nint p1, int p2, nint p3); + } + + public static class GetPlayerByUuidWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-player-by-uuid"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetPlayerByUuid(int p0, nint p1, int p2, nint p3); + } + + public static class GetAllWorldsWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-all-worlds"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetAllWorlds(int p0, nint p1); + } + + public static class GetWorldByNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-world-by-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetWorldByName(int p0, nint p1, int p2, nint p3); + } + + public static class ExecuteCommandWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.execute-command"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportExecuteCommand(int p0, nint p1, int p2, int p3, int p4); + } + + public static class CreateWorldWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.create-world"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportCreateWorld(int p0, nint p1, int p2, int p3); + } + + public static class BroadcastWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.broadcast"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportBroadcast(int p0, nint p1, int p2); + } + + public static class BroadcastTabListHeaderFooterWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.broadcast-tab-list-header-footer"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportBroadcastTabListHeaderFooter(int p0, int p1, int p2); + } + + public static class GetMaxPlayersWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-max-players"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetMaxPlayers(int p0); + } + + public static class IsHardcoreWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.is-hardcore"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsHardcore(int p0); + } + + public static class IsOnlineModeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.is-online-mode"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsOnlineMode(int p0); + } + + public static class GetMotdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-motd"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetMotd(int p0, nint p1); + } + + public static class HasWhitelistWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.has-whitelist"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportHasWhitelist(int p0); + } + + public static class GetAllowNetherWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-allow-nether"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetAllowNether(int p0); + } + + public static class GetAllowEndWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-allow-end"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetAllowEnd(int p0); + } + + public static class GetViewDistanceWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-view-distance"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetViewDistance(int p0); + } + + public static class GetSimulationDistanceWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-simulation-distance"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetSimulationDistance(int p0); + } + + public static class GetDefaultGamemodeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/server@0.1.0", EntryPoint = "[method]server.get-default-gamemode"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetDefaultGamemode(int p0); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.TextImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.TextImportsInterop.cs new file mode 100644 index 0000000..072b87f --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.TextImportsInterop.cs @@ -0,0 +1,155 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class TextImportsInterop { + + internal static class TextComponent + { + + public static class TextWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[static]text-component.text"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportText(nint p0, int p1); + } + + public static class TranslateWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[static]text-component.translate"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportTranslate(nint p0, int p1, nint p2, int p3); + } + + public static class AddChildWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.add-child"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAddChild(int p0, int p1); + } + + public static class AddTextWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.add-text"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportAddText(int p0, nint p1, int p2); + } + + public static class GetTextWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.get-text"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetText(int p0, nint p1); + } + + public static class EncodeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.encode"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportEncode(int p0, nint p1); + } + + public static class ColorNamedWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.color-named"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportColorNamed(int p0, int p1); + } + + public static class ColorRgbWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.color-rgb"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportColorRgb(int p0, int p1, int p2, int p3); + } + + public static class BoldWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.bold"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportBold(int p0, int p1); + } + + public static class ItalicWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.italic"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportItalic(int p0, int p1); + } + + public static class UnderlinedWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.underlined"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportUnderlined(int p0, int p1); + } + + public static class StrikethroughWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.strikethrough"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportStrikethrough(int p0, int p1); + } + + public static class ObfuscatedWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.obfuscated"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportObfuscated(int p0, int p1); + } + + public static class InsertionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.insertion"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportInsertion(int p0, nint p1, int p2); + } + + public static class FontWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.font"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportFont(int p0, nint p1, int p2); + } + + public static class ShadowColorWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.shadow-color"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportShadowColor(int p0, int p1, int p2, int p3, int p4); + } + + public static class ClickOpenUrlWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.click-open-url"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportClickOpenUrl(int p0, nint p1, int p2); + } + + public static class ClickRunCommandWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.click-run-command"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportClickRunCommand(int p0, nint p1, int p2); + } + + public static class ClickSuggestCommandWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.click-suggest-command"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportClickSuggestCommand(int p0, nint p1, int p2); + } + + public static class ClickCopyToClipboardWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.click-copy-to-clipboard"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportClickCopyToClipboard(int p0, nint p1, int p2); + } + + public static class HoverShowTextWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.hover-show-text"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportHoverShowText(int p0, int p1); + } + + public static class HoverShowItemWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.hover-show-item"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportHoverShowItem(int p0, nint p1, int p2); + } + + public static class HoverShowEntityWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/text@0.1.0", EntryPoint = "[method]text-component.hover-show-entity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportHoverShowEntity(int p0, nint p1, int p2, nint p3, int p4, int p5, int p6); + } + + } + + } +} diff --git a/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.WorldImportsInterop.cs b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.WorldImportsInterop.cs new file mode 100644 index 0000000..2dccd42 --- /dev/null +++ b/src/gen/PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.WorldImportsInterop.cs @@ -0,0 +1,382 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +using System; + +namespace PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0 +{ + public static class WorldImportsInterop { + + internal static class Entity + { + + public static class GetIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetId(int p0); + } + + public static class GetUuidWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-uuid"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetUuid(int p0, nint p1); + } + + public static class GetTypeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-type"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetType(int p0, nint p1); + } + + public static class GetPositionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-position"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetPosition(int p0, nint p1); + } + + public static class GetWorldWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-world"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetWorld(int p0); + } + + public static class GetYawWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-yaw"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetYaw(int p0); + } + + public static class GetPitchWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-pitch"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetPitch(int p0); + } + + public static class GetHeadYawWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-head-yaw"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern float wasmImportGetHeadYaw(int p0); + } + + public static class IsOnGroundWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-on-ground"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsOnGround(int p0); + } + + public static class IsSneakingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-sneaking"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsSneaking(int p0); + } + + public static class SetSneakingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-sneaking"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetSneaking(int p0, int p1); + } + + public static class IsSprintingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-sprinting"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsSprinting(int p0); + } + + public static class SetSprintingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-sprinting"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetSprinting(int p0, int p1); + } + + public static class IsSwimmingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-swimming"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsSwimming(int p0); + } + + public static class SetSwimmingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-swimming"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetSwimming(int p0, int p1); + } + + public static class IsInvisibleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-invisible"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsInvisible(int p0); + } + + public static class SetInvisibleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-invisible"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetInvisible(int p0, int p1); + } + + public static class IsGlowingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-glowing"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsGlowing(int p0); + } + + public static class SetGlowingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-glowing"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetGlowing(int p0, int p1); + } + + public static class IsFallFlyingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-fall-flying"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsFallFlying(int p0); + } + + public static class SetFallFlyingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-fall-flying"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetFallFlying(int p0, int p1); + } + + public static class IsOnFireWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-on-fire"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsOnFire(int p0); + } + + public static class SetOnFireWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-on-fire"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetOnFire(int p0, int p1); + } + + public static class TeleportWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.teleport"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportTeleport(int p0, double p1, double p2, double p3, int p4); + } + + public static class SetVelocityWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-velocity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetVelocity(int p0, double p1, double p2, double p3); + } + + public static class GetVelocityWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-velocity"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetVelocity(int p0, nint p1); + } + + public static class GetPoseWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-pose"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetPose(int p0); + } + + public static class GetNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetName(int p0); + } + + public static class SetCustomNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-custom-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetCustomName(int p0, int p1); + } + + public static class GetCustomNameWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-custom-name"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetCustomName(int p0, nint p1); + } + + public static class SetCustomNameVisibleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-custom-name-visible"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetCustomNameVisible(int p0, int p1); + } + + public static class IsCustomNameVisibleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-custom-name-visible"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsCustomNameVisible(int p0); + } + + public static class IsInvulnerableWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.is-invulnerable"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsInvulnerable(int p0); + } + + public static class SetInvulnerableWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-invulnerable"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetInvulnerable(int p0, int p1); + } + + public static class GetFireTicksWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.get-fire-ticks"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetFireTicks(int p0); + } + + public static class SetFireTicksWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.set-fire-ticks"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetFireTicks(int p0, int p1); + } + + public static class RemoveWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.remove"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRemove(int p0); + } + + public static class RaycastWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]entity.raycast"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportRaycast(int p0, double p1, int p2, nint p3); + } + + } + + internal static class World + { + + public static class GetIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetId(int p0, nint p1); + } + + public static class GetBlockStateIdWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-block-state-id"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetBlockStateId(int p0, int p1, int p2, int p3); + } + + public static class GetBlockStateWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-block-state"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetBlockState(int p0, int p1, int p2, int p3, nint p4); + } + + public static class SetBlockStateWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.set-block-state"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetBlockState(int p0, int p1, int p2, int p3, int p4, int p5); + } + + public static class GetTimeOfDayWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-time-of-day"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern long wasmImportGetTimeOfDay(int p0); + } + + public static class SetTimeOfDayWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.set-time-of-day"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetTimeOfDay(int p0, long p1); + } + + public static class GetWorldAgeWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-world-age"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern long wasmImportGetWorldAge(int p0); + } + + public static class GetDimensionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-dimension"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetDimension(int p0, nint p1); + } + + public static class GetTopBlockYWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-top-block-y"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetTopBlockY(int p0, int p1, int p2); + } + + public static class GetMotionBlockingHeightWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-motion-blocking-height"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetMotionBlockingHeight(int p0, int p1, int p2); + } + + public static class IsRainingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.is-raining"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsRaining(int p0); + } + + public static class SetRainingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.set-raining"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetRaining(int p0, int p1); + } + + public static class IsThunderingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.is-thundering"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportIsThundering(int p0); + } + + public static class SetThunderingWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.set-thundering"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSetThundering(int p0, int p1); + } + + public static class BroadcastSystemMessageWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.broadcast-system-message"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportBroadcastSystemMessage(int p0, int p1, int p2); + } + + public static class GetScoreboardWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-scoreboard"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetScoreboard(int p0); + } + + public static class PlaySoundWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.play-sound"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportPlaySound(int p0, nint p1, int p2, int p3, double p4, double p5, double p6, float p7, float p8); + } + + public static class SpawnParticleWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.spawn-particle"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportSpawnParticle(int p0, nint p1, int p2, double p3, double p4, double p5, double p6, double p7, double p8, float p9, int p10); + } + + public static class CreateExplosionWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.create-explosion"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportCreateExplosion(int p0, double p1, double p2, double p3, float p4, int p5, int p6); + } + + public static class GetSeaLevelWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-sea-level"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetSeaLevel(int p0); + } + + public static class GetMinYWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-min-y"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern int wasmImportGetMinY(int p0); + } + + public static class GetEntitiesWasmInterop + { + [global::System.Runtime.InteropServices.DllImportAttribute("pumpkin:plugin/world@0.1.0", EntryPoint = "[method]world.get-entities"), global::System.Runtime.InteropServices.WasmImportLinkageAttribute] + public static extern void wasmImportGetEntities(int p0, nint p1); + } + + } + + } +} diff --git a/src/gen/PluginWorld_component_type.wit b/src/gen/PluginWorld_component_type.wit new file mode 100644 index 0000000..d01ca48 --- /dev/null +++ b/src/gen/PluginWorld_component_type.wit @@ -0,0 +1,1399 @@ +package pumpkin:plugin@0.1.0; + +interface logging { + enum level { + trace, + debug, + info, + warn, + error, + } + + log: func(level: level, message: string); + + log-tracing: func(event: list); +} + +interface common { + type raw-text-component = list; + + type block-position = tuple; + + type position = tuple; + + enum hand { + left, + right, + } + + enum game-mode { + survival, + creative, + adventure, + spectator, + } + + enum named-color { + black, + dark-blue, + dark-green, + dark-aqua, + dark-red, + dark-purple, + gold, + gray, + dark-gray, + blue, + green, + aqua, + red, + light-purple, + yellow, + white, + } + + record rgb-color { + r: u8, + g: u8, + b: u8, + } + + record argb-color { + a: u8, + r: u8, + g: u8, + b: u8, + } + + record item-stack { + registry-key: string, + count: u8, + } + + enum click-type { + left, + right, + shift-left, + shift-right, + middle, + drop, + control-drop, + double-click, + number-key, + unknown, + } + + enum entity-pose { + standing, + fall-flying, + sleeping, + swimming, + spin-attack, + crouching, + long-jumping, + dying, + croaking, + using-tongue, + sitting, + roaring, + sniffing, + emerging, + digging, + sliding, + shooting, + inhaling, + } + + enum locale { + af-za, + ar-sa, + ast-es, + az-az, + ba-ru, + bar, + be-by, + bg-bg, + br-fr, + brb, + bs-ba, + ca-es, + cs-cz, + cy-gb, + da-dk, + de-at, + de-ch, + de-de, + el-gr, + en-au, + en-ca, + en-gb, + en-nz, + en-pt, + en-ud, + en-us, + enp, + enws, + eo-uy, + es-ar, + es-cl, + es-ec, + es-es, + es-mx, + es-uy, + es-ve, + esan, + et-ee, + eu-es, + fa-ir, + fi-fi, + fil-ph, + fo-fo, + fr-ca, + fr-fr, + fra-de, + fur-it, + fy-nl, + ga-ie, + gd-gb, + gl-es, + haw-us, + he-il, + hi-in, + hr-hr, + hu-hu, + hy-am, + id-id, + ig-ng, + io-en, + is-is, + isv, + it-it, + ja-jp, + jbo-en, + ka-ge, + kk-kz, + kn-in, + ko-kr, + ksh, + kw-gb, + la-la, + lb-lu, + li-li, + lmo, + lo-la, + lol-us, + lt-lt, + lv-lv, + lzh, + mk-mk, + mn-mn, + ms-my, + mt-mt, + nah, + nds-de, + nl-be, + nl-nl, + nn-no, + no-no, + oc-fr, + ovd, + pl-pl, + pt-br, + pt-pt, + qya-aa, + ro-ro, + rpr, + ru-ru, + ry-ua, + sah-sah, + se-no, + sk-sk, + sl-si, + so-so, + sq-al, + sr-cs, + sr-sp, + sv-se, + sxu, + szl, + ta-in, + th-th, + tl-ph, + tlh-aa, + tok, + tr-tr, + tt-ru, + uk-ua, + val-es, + vec-it, + vi-vn, + yi-de, + yo-ng, + zh-cn, + zh-hk, + zh-tw, + zlm-arab, + } +} + +interface text { + use common.{named-color, rgb-color, argb-color}; + + resource text-component { + text: static func(plain: string) -> text-component; + translate: static func(key: string, %with: list) -> text-component; + add-child: func(child: text-component); + add-text: func(text: string); + get-text: func() -> string; + encode: func() -> list; + color-named: func(color: named-color); + color-rgb: func(color: rgb-color); + bold: func(value: bool); + italic: func(value: bool); + underlined: func(value: bool); + strikethrough: func(value: bool); + obfuscated: func(value: bool); + insertion: func(text: string); + font: func(font: string); + shadow-color: func(color: argb-color); + click-open-url: func(url: string); + click-run-command: func(command: string); + click-suggest-command: func(command: string); + click-copy-to-clipboard: func(text: string); + hover-show-text: func(text: text-component); + hover-show-item: func(item: string); + hover-show-entity: func(entity-type: string, id: string, name: option); + } +} + +interface gui { + use text.{text-component}; + use common.{item-stack, click-type}; + + enum gui-type { + generic-9x1, + generic-9x2, + generic-9x3, + generic-9x4, + generic-9x5, + generic-9x6, + generic-3x3, + crafter-3x3, + anvil, + beacon, + blast-furnace, + brewing-stand, + crafting, + enchantment, + furnace, + grindstone, + hopper, + lectern, + loom, + merchant, + shulker-box, + smithing, + smoker, + cartography-table, + stonecutter, + } + + resource gui { + constructor(%type: gui-type, title: text-component); + set-item: func(slot: u32, item: item-stack); + get-item: func(slot: u32) -> option; + get-type: func() -> gui-type; + get-title: func() -> text-component; + get-size: func() -> u32; + clear-items: func(); + set-allow-grab-items: func(allow: bool); + get-allow-grab-items: func() -> bool; + set-allow-put-items: func(allow: bool); + get-allow-put-items: func() -> bool; + } +} + +interface scoreboard { + use text.{text-component}; + use common.{named-color}; + + enum render-type { + integer, + hearts, + } + + enum display-slot { + player-list, + sidebar, + below-name, + sidebar-team-black, + sidebar-team-dark-blue, + sidebar-team-dark-green, + sidebar-team-dark-aqua, + sidebar-team-dark-red, + sidebar-team-dark-purple, + sidebar-team-gold, + sidebar-team-gray, + sidebar-team-dark-gray, + sidebar-team-blue, + sidebar-team-green, + sidebar-team-aqua, + sidebar-team-red, + sidebar-team-light-purple, + sidebar-team-yellow, + sidebar-team-white, + } + + enum nametag-visibility { + always, + never, + hide-for-other-teams, + hide-for-own-team, + } + + enum collision-rule { + always, + never, + push-other-teams, + push-own-team, + } + + record team-settings { + display-name: text-component, + friendly-fire: bool, + see-friendly-invisibles: bool, + nametag-visibility: nametag-visibility, + collision-rule: collision-rule, + color: named-color, + prefix: text-component, + suffix: text-component, + } + + resource scoreboard { + add-objective: func(name: string, display-name: text-component, render-type: render-type); + remove-objective: func(name: string); + set-display-slot: func(slot: display-slot, objective-name: string); + update-score: func(entity-name: string, objective-name: string, value: s32); + remove-score: func(entity-name: string, objective-name: string); + create-team: func(name: string, settings: team-settings); + remove-team: func(name: string); + update-team: func(name: string, settings: team-settings); + add-player-to-team: func(team-name: string, player-name: string); + remove-player-from-team: func(team-name: string, player-name: string); + } +} + +interface %world { + use common.{position, entity-pose}; + use text.{text-component}; + use scoreboard.{scoreboard}; + + enum piston-behavior { + normal, + destroy, + block, + ignore, + push-only, + } + + enum sound-category { + master, + music, + records, + weather, + blocks, + hostile, + neutral, + players, + ambient, + voice, + } + + enum explosion-interaction { + none, + block, + mob, + tnt, + trigger, + } + + flags block-flags { + notify-neighbors, + notify-listeners, + force-state, + skip-drops, + moved, + skip-redstone-wire-state-replacement, + skip-block-entity-replaced-callback, + skip-block-added-callback, + } + + record block-state { + id: u16, + luminance: u8, + opacity: u8, + hardness: f32, + is-air: bool, + is-liquid: bool, + is-solid: bool, + is-full-cube: bool, + piston-behavior: piston-behavior, + has-random-ticks: bool, + } + + record block-state-id { + id: u16, + } + + record block-pos { + x: s32, + y: s32, + z: s32, + } + + resource entity { + get-id: func() -> u32; + get-uuid: func() -> string; + get-type: func() -> string; + get-position: func() -> position; + get-world: func() -> %world; + get-yaw: func() -> f32; + get-pitch: func() -> f32; + get-head-yaw: func() -> f32; + is-on-ground: func() -> bool; + is-sneaking: func() -> bool; + set-sneaking: func(sneaking: bool); + is-sprinting: func() -> bool; + set-sprinting: func(sprinting: bool); + is-swimming: func() -> bool; + set-swimming: func(swimming: bool); + is-invisible: func() -> bool; + set-invisible: func(invisible: bool); + is-glowing: func() -> bool; + set-glowing: func(glowing: bool); + is-fall-flying: func() -> bool; + set-fall-flying: func(fall-flying: bool); + is-on-fire: func() -> bool; + set-on-fire: func(on-fire: bool); + teleport: func(pos: position, world-ref: %world); + set-velocity: func(velocity: position); + get-velocity: func() -> position; + get-pose: func() -> entity-pose; + get-name: func() -> text-component; + set-custom-name: func(name: text-component); + get-custom-name: func() -> option; + set-custom-name-visible: func(visible: bool); + is-custom-name-visible: func() -> bool; + is-invulnerable: func() -> bool; + set-invulnerable: func(invulnerable: bool); + get-fire-ticks: func() -> s32; + set-fire-ticks: func(ticks: s32); + remove: func(); + raycast: func(max-distance: f64, fluid-handling: bool) -> option; + } + + enum block-direction { + down, + up, + north, + south, + west, + east, + } + + record raycast-result { + pos: block-pos, + face: block-direction, + } + + resource %world { + get-id: func() -> string; + get-block-state-id: func(pos: block-pos) -> u16; + get-block-state: func(pos: block-pos) -> block-state; + set-block-state: func(pos: block-pos, state: u16, update-flags: block-flags); + get-time-of-day: func() -> u64; + set-time-of-day: func(time: u64); + get-world-age: func() -> u64; + get-dimension: func() -> string; + get-top-block-y: func(x: s32, z: s32) -> s32; + get-motion-blocking-height: func(x: s32, z: s32) -> s32; + is-raining: func() -> bool; + set-raining: func(raining: bool); + is-thundering: func() -> bool; + set-thundering: func(thundering: bool); + broadcast-system-message: func(message: text-component, overlay: bool); + get-scoreboard: func() -> scoreboard; + play-sound: func(sound: string, category: sound-category, pos: position, volume: f32, pitch: f32); + spawn-particle: func(particle: string, pos: position, offset: position, max-speed: f32, count: s32); + create-explosion: func(pos: position, power: f32, create-fire: bool, interaction: explosion-interaction); + get-sea-level: func() -> s32; + get-min-y: func() -> s32; + get-entities: func() -> list; + } +} + +interface entity { + use %world.{entity}; +} + +interface permission { + enum permission-level { + zero, + one, + two, + three, + four, + } + + variant permission-default { + deny, + allow, + op(permission-level), + } + + record permission-child { + node: string, + value: bool, + } + + record permission { + node: string, + description: string, + default: permission-default, + children: list, + } +} + +interface player { + use common.{hand, item-stack, position, game-mode}; + use %world.{%world}; + use entity.{entity}; + use permission.{permission-level}; + use text.{text-component}; + use gui.{gui}; + + record player-abilities { + invulnerable: bool, + flying: bool, + allow-flying: bool, + creative: bool, + allow-modify-world: bool, + fly-speed: f32, + walk-speed: f32, + } + + record player-skin { + value: string, + signature: option, + } + + flags skin-parts { + cape, + jacket, + left-sleeve, + right-sleeve, + left-pants-leg, + right-pants-leg, + hat, + } + + resource player { + as-entity: func() -> entity; + get-id: func() -> string; + get-name: func() -> string; + get-position: func() -> position; + get-yaw: func() -> f32; + get-pitch: func() -> f32; + get-world: func() -> %world; + get-gamemode: func() -> game-mode; + set-gamemode: func(mode: game-mode) -> bool; + get-locale: func() -> string; + get-ping: func() -> u32; + get-permission-level: func() -> permission-level; + set-permission-level: func(level: permission-level); + set-permission: func(node: string, value: bool); + unset-permission: func(node: string); + has-permission-set: func(node: string) -> option; + has-permission: func(node: string) -> bool; + get-display-name: func() -> text-component; + set-display-name: func(display-name: text-component); + send-system-message: func(text: text-component, overlay: bool); + set-tab-list-header-footer: func(header: text-component, footer: text-component); + set-tab-list-order: func(order: s32); + set-tab-list-latency: func(latency: s32); + set-tab-list-listed: func(listed: bool); + show-title: func(text: text-component); + show-subtitle: func(text: text-component); + show-actionbar: func(text: text-component); + send-title-animation: func(fade-in: s32, stay: s32, fade-out: s32); + teleport: func(position: position, yaw: option, pitch: option, %world: %world); + teleport-world: func(world-ref: %world, position: position, yaw: option, pitch: option); + kick: func(message: text-component); + respawn: func(); + open-gui: func(gui-ref: gui); + ban: func(reason: option); + ban-ip: func(reason: option); + get-selected-slot: func() -> u8; + get-item-in-hand: func(hand: hand) -> option; + get-inventory-item: func(slot: u8) -> option; + get-health: func() -> f32; + set-health: func(health: f32); + get-max-health: func() -> f32; + set-max-health: func(max-health: f32); + get-food-level: func() -> u8; + set-food-level: func(food-level: u8); + get-saturation: func() -> f32; + set-saturation: func(saturation: f32); + get-exhaustion: func() -> f32; + set-exhaustion: func(exhaustion: f32); + get-absorption: func() -> f32; + set-absorption: func(absorption: f32); + get-experience-level: func() -> s32; + get-experience-progress: func() -> f32; + get-experience-points: func() -> s32; + set-experience-level: func(level: s32); + set-experience-progress: func(progress: f32); + set-experience-points: func(points: s32); + add-experience-levels: func(levels: s32); + add-experience-points: func(points: s32); + is-flying: func() -> bool; + set-flying: func(flying: bool); + get-abilities: func() -> player-abilities; + set-abilities: func(abilities: player-abilities); + get-ip: func() -> string; + get-skin: func() -> option; + get-skin-parts: func() -> skin-parts; + set-skin-parts: func(parts: skin-parts); + } +} + +interface server { + use player.{player}; + use common.{game-mode}; + use %world.{%world}; + use text.{text-component}; + + enum difficulty { + peaceful, + easy, + normal, + hard, + } + + enum dimension { + overworld, + nether, + end, + } + + variant command-sender { + console, + player(player), + } + + resource server { + get-difficulty: func() -> difficulty; + get-player-count: func() -> u32; + get-mspt: func() -> f64; + get-tps: func() -> f64; + get-all-players: func() -> list; + get-player-by-name: func(name: string) -> option; + get-player-by-uuid: func(id: string) -> option; + get-all-worlds: func() -> list<%world>; + get-world-by-name: func(name: string) -> option<%world>; + execute-command: func(command: string, sender: command-sender); + create-world: func(name: string, dimension: dimension) -> %world; + broadcast: func(message: string); + broadcast-tab-list-header-footer: func(header: text-component, footer: text-component); + get-max-players: func() -> u32; + is-hardcore: func() -> bool; + is-online-mode: func() -> bool; + get-motd: func() -> string; + has-whitelist: func() -> bool; + get-allow-nether: func() -> bool; + get-allow-end: func() -> bool; + get-view-distance: func() -> u8; + get-simulation-distance: func() -> u8; + get-default-gamemode: func() -> game-mode; + } +} + +interface block-entity { + use common.{block-position}; + + resource block-entity { + resource-location: func() -> string; + get-position: func() -> block-position; + get-id: func() -> u32; + is-dirty: func() -> bool; + clear-dirty: func(); + } + + resource command-block-entity { + get-block-entity: func() -> block-entity; + last-output: func() -> string; + track-output: func() -> bool; + success-count: func() -> u32; + command: func() -> string; + auto: func() -> bool; + condition-met: func() -> bool; + powered: func() -> bool; + } + + variant block-entity-type { + command-block-entity(command-block-entity), + } +} + +interface command { + use %world.{%world}; + use entity.{entity}; + use player.{player}; + use block-entity.{command-block-entity}; + use common.{position, block-position, locale}; + use server.{server, difficulty}; + use text.{text-component}; + + enum gamemode { + survival, + creative, + adventure, + spectator, + } + + enum bossbar-color { + pink, + blue, + red, + green, + yellow, + purple, + white, + } + + enum bossbar-style { + no-division, + notches6, + notches10, + notches12, + notches20, + } + + enum sound-category { + master, + music, + records, + weather, + blocks, + hostile, + neutral, + players, + ambient, + voice, + ui, + } + + enum entity-anchor { + feet, + eyes, + } + + variant number { + %float64(f64), + %float32(f32), + int32(s32), + int64(s64), + } + + variant not-in-bounds { + lower-bound(tuple), + upper-bound(tuple), + } + + variant arg { + entities(list), + entity(entity), + players(list), + block-pos(block-position), + pos3d(position), + pos2d(tuple), + rotation(tuple), + game-mode(gamemode), + difficulty(difficulty), + item(string), + item-predicate(string), + resource-location(string), + block(string), + block-predicate(string), + bossbar-color(bossbar-color), + bossbar-style(bossbar-style), + particle(string), + msg(string), + text-component(text-component), + time(s32), + num(result), + %bool(bool), + simple(string), + sound-category(sound-category), + damage-type(string), + effect(string), + enchantment(string), + entity-anchor(entity-anchor), + } + + resource consumed-args { + get-value: func(key: string) -> arg; + } + + variant command-sender-type { + rcon, + console, + player(player), + command-block(tuple), + dummy, + } + + enum permission-level { + zero, + one, + two, + three, + four, + } + + resource command-sender { + get-command-sender-type: func() -> command-sender-type; + send-message: func(text: text-component); + set-success-count: func(count: s32); + is-player: func() -> bool; + is-console: func() -> bool; + as-player: func() -> option; + permission-level: func() -> permission-level; + has-permission-level: func(level: permission-level) -> bool; + has-permission: func(server: borrow, node: string) -> bool; + position: func() -> option; + %world: func() -> option<%world>; + get-locale: func() -> locale; + should-receive-feedback: func() -> bool; + should-broadcast-console-to-ops: func() -> bool; + should-track-output: func() -> bool; + } + + enum string-type { + single-word, + quotable, + greedy, + } + + variant argument-type { + %bool, + float(tuple, option>), + double(tuple, option>), + integer(tuple, option>), + long(tuple, option>), + %string(string-type), + entities, + entity, + players, + game-profile, + block-pos, + position3d, + position2d, + block-state, + block-predicate, + item, + item-predicate, + component, + rotation, + resource-location, + entity-anchor, + gamemode, + difficulty, + time(s32), + %resource(string), + } + + variant command-error { + invalid-consumption(option), + invalid-requirement, + permission-denied, + command-failed(text-component), + } + + resource command-node { + literal: static func(name: string) -> command-node; + argument: static func(name: string, arg-type: argument-type) -> command-node; + then: func(node: command-node); + execute-with-handler-id: func(handler-id: u32); + require-with-handler-id: func(handler-id: u32); + } + + resource command { + constructor(names: list, description: string); + then: func(node: command-node); + execute-with-handler-id: func(handler-id: u32); + } +} + +interface event { + use common.{block-position, game-mode, hand, item-stack, position, click-type}; + use player.{player}; + use text.{text-component}; + use %world.{%world}; + + enum event-priority { + highest, + high, + normal, + low, + lowest, + } + + record player-join-event-data { + player: player, + join-message: text-component, + cancelled: bool, + } + + record player-leave-event-data { + player: player, + leave-message: text-component, + cancelled: bool, + } + + record player-login-event-data { + player: player, + kick-message: text-component, + cancelled: bool, + } + + record player-chat-event-data { + player: player, + message: string, + recipients: list, + cancelled: bool, + } + + record player-command-send-event-data { + player: player, + command: string, + cancelled: bool, + } + + record player-permission-check-event-data { + player: player, + permission: string, + permission-result: bool, + } + + record player-move-event-data { + player: player, + from-position: position, + to-position: position, + cancelled: bool, + } + + record player-teleport-event-data { + player: player, + from-position: position, + to-position: position, + cancelled: bool, + } + + record player-change-world-event-data { + player: player, + previous-world: %world, + new-world: %world, + position: position, + yaw: f32, + pitch: f32, + cancelled: bool, + } + + record player-exp-change-event-data { + player: player, + amount: s32, + } + + record player-item-held-event-data { + player: player, + previous-slot: u8, + new-slot: u8, + cancelled: bool, + } + + record player-changed-main-hand-event-data { + player: player, + main-hand: hand, + } + + record player-gamemode-change-event-data { + player: player, + previous-gamemode: game-mode, + new-gamemode: game-mode, + cancelled: bool, + } + + record player-custom-payload-event-data { + player: player, + channel: string, + data: list, + } + + enum player-fish-state { + fishing, + caught-fish, + caught-entity, + in-ground, + failed-attempt, + reel-in, + bite, + } + + record player-fish-event-data { + player: player, + caught-uuid: option, + caught-type: string, + hook-uuid: string, + state: player-fish-state, + hand: hand, + exp-to-drop: s32, + cancelled: bool, + } + + record player-egg-throw-event-data { + player: player, + egg-uuid: string, + hatching: bool, + num-hatches: u8, + hatching-type: string, + cancelled: bool, + } + + enum entity-interaction-action { + interact, + attack, + interact-at, + } + + enum interact-action { + left-click-block, + left-click-air, + right-click-air, + right-click-block, + } + + record player-interact-event-data { + player: player, + action: interact-action, + clicked-pos: option, + block: string, + cancelled: bool, + } + + record player-toggle-sneak-event-data { + player: player, + is-sneaking: bool, + cancelled: bool, + } + + record player-toggle-flight-event-data { + player: player, + is-flying: bool, + cancelled: bool, + } + + record player-toggle-sprint-event-data { + player: player, + is-sprinting: bool, + cancelled: bool, + } + + record player-interact-unknown-entity-event-data { + player: player, + entity-id: s32, + action: entity-interaction-action, + cancelled: bool, + } + + record inventory-click-event-data { + player: player, + window-type: option, + click-type: click-type, + slot: s16, + raw-slot: s16, + clicked-item: option, + cursor: option, + hotbar-button: s32, + cancelled: bool, + } + + record inventory-close-event-data { + player: player, + window-type: option, + } + + record block-redstone-event-data { + target-world: %world, + state-id: u16, + block-position: block-position, + old-current: s32, + new-current: s32, + cancelled: bool, + } + + record block-break-event-data { + player: option, + block: string, + block-position: block-position, + exp: u32, + should-drop: bool, + cancelled: bool, + } + + record block-burn-event-data { + igniting-block: string, + block: string, + cancelled: bool, + } + + record block-can-build-event-data { + block-to-build: string, + buildable: bool, + player: player, + block: string, + cancelled: bool, + } + + record block-grow-event-data { + target-world: %world, + old-block: string, + old-state-id: u16, + new-block: string, + new-state-id: u16, + block-position: block-position, + cancelled: bool, + } + + record block-place-event-data { + player: player, + block-placed: string, + block-placed-against: string, + block-position: block-position, + can-build: bool, + cancelled: bool, + } + + record server-command-event-data { + command: string, + cancelled: bool, + } + + record spawn-change-event-data { + target-world: %world, + previous-position: block-position, + previous-yaw: f32, + previous-pitch: f32, + new-position: block-position, + new-yaw: f32, + new-pitch: f32, + } + + record server-broadcast-event-data { + message: text-component, + sender: text-component, + cancelled: bool, + } + + enum event-type { + player-join-event, + player-leave-event, + player-login-event, + player-chat-event, + player-command-send-event, + player-permission-check-event, + player-move-event, + player-teleport-event, + player-change-world-event, + player-exp-change-event, + player-item-held-event, + player-changed-main-hand-event, + player-gamemode-change-event, + player-custom-payload-event, + player-fish-event, + player-egg-throw-event, + player-interact-unknown-entity-event, + player-interact-event, + player-toggle-sneak-event, + player-toggle-flight-event, + player-toggle-sprint-event, + inventory-click-event, + inventory-close-event, + block-redstone-event, + block-break-event, + block-burn-event, + block-can-build-event, + block-grow-event, + block-place-event, + server-command-event, + spawn-change-event, + server-broadcast-event, + } + + variant event { + player-join-event(player-join-event-data), + player-leave-event(player-leave-event-data), + player-login-event(player-login-event-data), + player-chat-event(player-chat-event-data), + player-command-send-event(player-command-send-event-data), + player-permission-check-event(player-permission-check-event-data), + player-move-event(player-move-event-data), + player-teleport-event(player-teleport-event-data), + player-change-world-event(player-change-world-event-data), + player-exp-change-event(player-exp-change-event-data), + player-item-held-event(player-item-held-event-data), + player-changed-main-hand-event(player-changed-main-hand-event-data), + player-gamemode-change-event(player-gamemode-change-event-data), + player-custom-payload-event(player-custom-payload-event-data), + player-fish-event(player-fish-event-data), + player-egg-throw-event(player-egg-throw-event-data), + player-interact-unknown-entity-event(player-interact-unknown-entity-event-data), + player-interact-event(player-interact-event-data), + player-toggle-sneak-event(player-toggle-sneak-event-data), + player-toggle-flight-event(player-toggle-flight-event-data), + player-toggle-sprint-event(player-toggle-sprint-event-data), + inventory-click-event(inventory-click-event-data), + inventory-close-event(inventory-close-event-data), + block-redstone-event(block-redstone-event-data), + block-break-event(block-break-event-data), + block-burn-event(block-burn-event-data), + block-can-build-event(block-can-build-event-data), + block-grow-event(block-grow-event-data), + block-place-event(block-place-event-data), + server-command-event(server-command-event-data), + spawn-change-event(spawn-change-event-data), + server-broadcast-event(server-broadcast-event-data), + } +} + +interface context { + use server.{server}; + use event.{event-type, event-priority}; + use command.{command}; + use permission.{permission}; + + resource context { + register-event: func(handler-id: u32, event-type: event-type, event-priority: event-priority, blocking: bool); + register-command: func(command: command, permission: string); + register-permission: func(permission: permission) -> result<_, string>; + get-data-folder: func() -> string; + get-server: func() -> server; + } +} + +interface i18n { + use common.{locale}; + + translate: func(key: string, locale: locale) -> string; + + load-translations: func(namespace: string, json: string, locale: locale); +} + +interface scheduler { + schedule-delayed-task: func(handler-id: u32, delay-ticks: u64) -> u32; + + schedule-repeating-task: func(handler-id: u32, delay-ticks: u64, period-ticks: u64) -> u32; + + cancel-task: func(task-id: u32); +} + +interface boss-bar { + use text.{text-component}; + use player.{player}; + + enum boss-bar-color { + pink, + blue, + red, + green, + yellow, + purple, + white, + } + + enum boss-bar-division { + no-division, + notches-6, + notches-10, + notches-12, + notches-20, + } + + record boss-bar-metadata { + darken-sky: bool, + dragon-bar: bool, + create-fog: bool, + } + + resource boss-bar { + constructor(title: text-component, color: boss-bar-color, division: boss-bar-division); + get-title: func() -> text-component; + set-title: func(title: text-component); + get-health: func() -> f32; + set-health: func(health: f32); + get-color: func() -> boss-bar-color; + set-color: func(color: boss-bar-color); + get-division: func() -> boss-bar-division; + set-division: func(division: boss-bar-division); + get-metadata: func() -> boss-bar-metadata; + set-metadata: func(metadata: boss-bar-metadata); + add-player: func(player: player); + remove-player: func(player: player); + get-players: func() -> list; + remove-all: func(); + } +} + +interface metadata { + record plugin-metadata { + name: string, + version: string, + authors: list, + description: string, + dependencies: list, + } + + get-metadata: func() -> plugin-metadata; +} + +world plugin { + import logging; + import common; + import text; + import gui; + import scoreboard; + import %world; + import entity; + import permission; + import player; + import server; + import block-entity; + import command; + import event; + import context; + import i18n; + import scheduler; + import boss-bar; + use context.{context}; + use event.{event}; + use server.{server as server-instance}; + use command.{command-sender, consumed-args, command-error}; + + export init-plugin: func(); + export on-load: func(context: context) -> result<_, string>; + export on-unload: func(context: context) -> result<_, string>; + export handle-event: func(event-id: u32, server: server-instance, event: event) -> event; + export handle-command: func(command-id: u32, sender: command-sender, server: server-instance, args: consumed-args) -> result; + export handle-task: func(handler-id: u32, server: server-instance); + export metadata; +} diff --git a/src/gen/PluginWorld_wasm_import_linkage_attribute.cs b/src/gen/PluginWorld_wasm_import_linkage_attribute.cs new file mode 100644 index 0000000..de28d35 --- /dev/null +++ b/src/gen/PluginWorld_wasm_import_linkage_attribute.cs @@ -0,0 +1,11 @@ +// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT! +// +#nullable enable + +#if !NET9_0_OR_GREATER +// temporarily add this attribute until it is available in dotnet 9 +namespace System.Runtime.InteropServices +{ + internal partial class WasmImportLinkageAttribute : global::System.Attribute {} +} +#endif