├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── api ├── build.gradle.kts └── src │ └── main │ └── java │ └── cloud │ └── polars │ └── animations │ └── api │ ├── AnimationsAPI.java │ ├── bone │ ├── Bone.java │ ├── BoneFactory.java │ ├── BoneType.java │ ├── CameraBone.java │ └── ItemDisplayBone.java │ ├── emote │ ├── Skin.java │ └── SkinFactory.java │ ├── entity │ ├── VirtualDisplayEntity.java │ ├── VirtualEntity.java │ └── VirtualItemDisplayEntity.java │ ├── event │ ├── bone │ │ └── PlayerBoneInteractEvent.java │ └── cutscene │ │ ├── PlayerCutsceneEnterEvent.java │ │ └── PlayerCutsceneExitEvent.java │ ├── parser │ ├── AJRigParser.java │ ├── BlenderRigParser.java │ ├── GenericParser.java │ ├── Parser.java │ └── ParserType.java │ └── rig │ ├── AnimationFactory.java │ ├── SkeletonFactory.java │ └── type │ ├── Animation.java │ └── Skeleton.java ├── build-logic ├── build.gradle.kts ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── cloud.polars.animations.build-logic.gradle.kts │ ├── cloud.polars.animations.java-conventions.gradle.kts │ ├── cloud.polars.animations.paperweight-conventions.gradle.kts │ ├── cloud.polars.animations.platform-conventions.gradle.kts │ ├── cloud.polars.animations.publish-conventions.gradle.kts │ ├── cloud.polars.animations.shadow-conventions.gradle.kts │ └── extensions.kt ├── build.gradle.kts ├── core ├── build.gradle.kts └── src │ └── main │ └── java │ └── cloud │ └── polars │ └── animations │ └── core │ └── AnimationsCore.java ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── mcanim.py ├── platform └── spigot │ ├── adapters │ ├── nms │ │ └── r1_20_4_R1 │ │ │ └── build.gradle.kts │ └── provider │ │ ├── build.gradle.kts │ │ └── src │ │ └── main │ │ └── java │ │ └── cloud │ │ └── polars │ │ └── animations │ │ └── NMSProvider.java │ ├── build.gradle.kts │ └── src │ └── main │ ├── java │ └── cloud │ │ └── polars │ │ └── animations │ │ └── spigot │ │ └── AnimationsSpigot.java │ └── resources │ └── plugin.yml └── settings.gradle.kts /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build/ 3 | */build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### IntelliJ IDEA ### 9 | .idea/modules.xml 10 | .idea/jarRepositories.xml 11 | .idea/compiler.xml 12 | .idea/libraries/ 13 | *.iws 14 | *.iml 15 | *.ipr 16 | out/ 17 | !**/src/main/**/out/ 18 | !**/src/test/**/out/ 19 | .idea/* 20 | .idea/ 21 | 22 | ### Eclipse ### 23 | .apt_generated 24 | .classpath 25 | .factorypath 26 | .project 27 | .settings 28 | .springBeans 29 | .sts4-cache 30 | bin/ 31 | !**/src/main/**/bin/ 32 | !**/src/test/**/bin/ 33 | 34 | ### NetBeans ### 35 | /nbproject/private/ 36 | /nbbuild/ 37 | /dist/ 38 | /nbdist/ 39 | /.nb-gradle/ 40 | 41 | ### VS Code ### 42 | .vscode/ 43 | 44 | ### Mac OS ### 45 | .DS_Store 46 | 47 | ## Temp Files ## 48 | *.ini 49 | 50 | */.gradle/ -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to Animations 3 | 4 | First off, thanks for taking the time to contribute! ❤️ 5 | 6 | All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 7 | 8 | > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: 9 | > - Star the project 10 | > - Tweet about it 11 | > - Refer this project in your project's readme 12 | > - Mention the project at local meetups and tell your friends/colleagues 13 | 14 | ## Table of Contents 15 | 16 | - [I Have a Question](#i-have-a-question) 17 | - [I Want To Contribute](#i-want-to-contribute) 18 | - [Reporting Bugs](#reporting-bugs) 19 | - [Suggesting Enhancements](#suggesting-enhancements) 20 | - [Your First Code Contribution](#your-first-code-contribution) 21 | - ~~Improving the Documentation~~ **Coming Soon**! 22 | 23 | ## I Have a Question 24 | 25 | > If you want to ask a question, we assume that you have read the available [Documentation](). 26 | 27 | Before you ask a question, it is best to search for existing [Issues](https://github.com/administrateclouds/animations/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. 28 | 29 | If you then still feel the need to ask a question and need clarification, we recommend the following: 30 | 31 | - Open an [Issue](https://github.com/administrateclouds/animations/issues/new). 32 | - Provide as much context as you can about what you're running into. 33 | - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. 34 | 35 | We will then take care of the issue as soon as possible. 36 | 37 | ## I Want To Contribute 38 | 39 | > ### Legal Notice 40 | > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. 41 | 42 | ### Reporting Bugs 43 | 44 | 45 | #### Before Submitting a Bug Report 46 | 47 | A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. 48 | 49 | - Make sure that you are using the latest version. 50 | - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)). 51 | - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/administrateclouds/animationsissues?q=label%3Abug). 52 | - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. 53 | - Collect information about the bug: 54 | - Stack trace (Traceback) 55 | - OS, Platform and Version (Windows, Linux, macOS, x86, ARM) 56 | - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. 57 | - Possibly your input and the output 58 | - Can you reliably reproduce the issue? And can you also reproduce it with older versions? 59 | 60 | #### How Do I Submit a Good Bug Report? 61 | 62 | > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . 63 | 64 | We use GitHub issues to track bugs and errors. If you run into an issue with the project: 65 | 66 | - Open an [Issue](https://github.com/administrateclouds/animations/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) 67 | - Explain the behavior you would expect and the actual behavior. 68 | - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. 69 | - Provide the information you collected in the previous section. 70 | 71 | Once it's filed: 72 | 73 | - The project team will label the issue accordingly. 74 | - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. 75 | - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). 76 | 77 | 78 | ### Suggesting Enhancements 79 | 80 | This section guides you through submitting an enhancement suggestion for Animations, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. 81 | 82 | #### Before Submitting an Enhancement 83 | 84 | - Make sure that you are using the latest version. 85 | - Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration. 86 | - Perform a [search](https://github.com/administrateclouds/animations/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. 87 | - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. 88 | 89 | #### How Do I Submit a Good Enhancement Suggestion? 90 | 91 | Enhancement suggestions are tracked as [GitHub issues](https://github.com/administrateclouds/animations/issues). 92 | 93 | - Use a **clear and descriptive title** for the issue to identify the suggestion. 94 | - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. 95 | - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. 96 | - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. 97 | - **Explain why this enhancement would be useful** to most Animations users. You may also want to point out the other projects that solved it better and which could serve as inspiration. 98 | 99 | ## Styleguides 100 | ### Commit Messages 101 | 102 | We ask that you follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 103 | 104 | ## Attribution 105 | This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! 106 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Animations 3 | 4 | [![License](https://img.shields.io/github/license/administrateclouds/animations?style=flat-square)](LICENSE) 5 | [![Stars](https://img.shields.io/github/stars/administrateclouds/animations?style=flat-square)](#) 6 | 7 | Animations is a fully-featured free and open-source animation system for Minecraft Servers utilizing Resource Packs. This project is licensed under a **AGPL** license. 8 | 9 | ![alt text](https://us-east-1.tixte.net/uploads/i.itspolar.dev/javaw_IQ7XaVDNBB.gif) 10 |
11 | *Animation by CloudX, Skin by DisneyArchitect* 12 | 13 | ## Features 14 | - **Universal Support**. Create animations without restrictions, using either [Blender](https://www.blender.org/) or [Blockbench](https://www.blockbench.net/) using the [AnimatedJava](https://github.com/Animated-Java/animated-java) plugin by SnaveSutit with their JSON exporter. 15 | - **Squash & Stretch Support** with Display Entities, allowing you to use typical animation standards for your Minecraft animated rigs! 16 | - **Runs at the Game Framerate**. Thanks to Display Entities, we are also able to make animations smooth regardless of your servers' TPS with their build-in interpolation! 17 | - **Free and open-source**. The code is free and open for anyone to audit and contribute to. 18 | 19 | ## Compatibility 20 | 21 | You can use this plugin on any Minecraft server running the latest version of the game, at this point, that is **1.20.4**. 22 | 23 | Please note that this is currently in very early snapshot releases, so you will need to build this project yourself until we are ready to begin creating public releases! 24 | ## FAQ 25 | 26 | #### How can I use AnimatedJava? 27 | 28 | You're likely better off reading the Animated Java Docs located [here](https://animated-java.dev/docs/home), you need to utilise the **JSON Exporter** in order to work with this plugin. 29 | 30 | #### How can I export my Blender Animations? 31 | 32 | 33 | You can use our custom plugin `mcanim.py` which will export your animations as a `.mcanim` file. 34 | 35 | #### How does it look so... smooth? 36 | 37 | We utilise the Display Entities' built in interpolation duration to allow for rigs to run at the game's framerate. 38 | 39 | #### Am I allowed to use this on my projects? 40 | Of course! This would not be a public resource if we didn't want you to use it. We believe that animation systems should **not** be gate-kept by big projects which have the money to pay developers, however we ask that you please follow our license and provide attribution to this project where ever you can and please leave a star :) 41 | 42 | #### Does it have an API? 43 | 44 | Not currently, as this is the rewritten version of our Animation System. The API is very early, however there will be events to check when a player clicks a rig when this is out of snapshot releases. 45 | ## Authors 46 | 47 | - [@polargh](https://www.github.com/polargh) 48 | - [@56738](https://www.github.com/56738) 49 | - [@Reasonlesss](https://www.github.com/Reasonlesss) 50 | 51 | 52 | ## Contributing 53 | 54 | Contributions are always welcome! 55 | 56 | See `contributing.md` for ways to get started. 57 | 58 | -------------------------------------------------------------------------------- /api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("cloud.polars.animations.publish-conventions") 3 | } 4 | 5 | dependencies { 6 | compileOnly(libs.paper.api) 7 | compileOnly(libs.joml) 8 | } -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/AnimationsAPI.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api; 2 | 3 | import cloud.polars.animations.api.parser.GenericParser; 4 | import cloud.polars.animations.api.rig.SkeletonFactory; 5 | import cloud.polars.animations.api.rig.type.Skeleton; 6 | import org.bukkit.World; 7 | import org.jetbrains.annotations.ApiStatus; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public interface AnimationsAPI { 11 | 12 | @NotNull 13 | Skeleton createSkeleton(@NotNull World world); 14 | 15 | @NotNull 16 | SkeletonFactory createSkeletonFactory(@NotNull World world); 17 | 18 | @NotNull GenericParser getParser(); 19 | 20 | final class Provider { 21 | private static AnimationsAPI instance; 22 | 23 | public Provider() {} 24 | 25 | @NotNull 26 | public static AnimationsAPI getInstance() { 27 | return instance; 28 | } 29 | 30 | @ApiStatus.Internal 31 | public static void setInstance(AnimationsAPI instance) { 32 | Provider.instance = instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/bone/Bone.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.bone; 2 | 3 | import org.bukkit.NamespacedKey; 4 | import org.bukkit.World; 5 | import org.jetbrains.annotations.NotNull; 6 | import org.jetbrains.annotations.Nullable; 7 | import org.joml.Matrix4d; 8 | import org.joml.Matrix4dc; 9 | 10 | public interface Bone { 11 | @NotNull 12 | Matrix4d getTransform(); 13 | 14 | @NotNull 15 | Matrix4d getPosition(); 16 | 17 | void add(@NotNull Bone bone); 18 | 19 | void remove(@NotNull Bone bone); 20 | 21 | void update(@NotNull Matrix4dc position); 22 | 23 | @Nullable 24 | Bone findBone(@NotNull NamespacedKey key); 25 | 26 | void spawn(@NotNull World world); 27 | 28 | void remove(); 29 | } 30 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/bone/BoneFactory.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.bone; 2 | 3 | import org.bukkit.NamespacedKey; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | public interface BoneFactory { 7 | @NotNull T createBone(@NotNull NamespacedKey key); 8 | } 9 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/bone/BoneType.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.bone; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | public interface BoneType { 6 | @NotNull String getName(); 7 | 8 | @NotNull Class getType(); 9 | 10 | @NotNull BoneFactory getBoneFactory(); 11 | } 12 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/bone/CameraBone.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.bone; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import org.bukkit.entity.Player; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public interface CameraBone extends Bone { 8 | void addViewer(@NotNull Player viewer); 9 | 10 | void removeViewer(@NotNull Player viewer); 11 | } 12 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/bone/ItemDisplayBone.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.bone; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import org.bukkit.inventory.ItemStack; 5 | 6 | public interface ItemDisplayBone extends Bone { 7 | ItemStack getItem(); 8 | 9 | void setItem(ItemStack item); 10 | } 11 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/emote/Skin.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.emote; 2 | 3 | public class Skin { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/emote/SkinFactory.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.emote; 2 | 3 | public class SkinFactory { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/entity/VirtualDisplayEntity.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.entity; 2 | 3 | public class VirtualDisplayEntity { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/entity/VirtualEntity.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.entity; 2 | 3 | public class VirtualEntity { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/entity/VirtualItemDisplayEntity.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.entity; 2 | 3 | public class VirtualItemDisplayEntity { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/event/bone/PlayerBoneInteractEvent.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.event.bone; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.event.HandlerList; 6 | import org.bukkit.event.player.PlayerEvent; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class PlayerBoneInteractEvent extends PlayerEvent { 10 | @NotNull 11 | private Bone bone; 12 | private boolean attack; 13 | 14 | public PlayerBoneInteractEvent(@NotNull Player who, @NotNull Bone bone, boolean attack) { 15 | super(who); 16 | this.bone = bone; 17 | this.attack = attack; 18 | } 19 | 20 | @NotNull 21 | public Bone getBone() { 22 | return bone; 23 | } 24 | 25 | public boolean isAttack() { 26 | return attack; 27 | } 28 | 29 | private static final HandlerList handlers = new HandlerList(); 30 | 31 | @Override 32 | public @NotNull HandlerList getHandlers() { 33 | return handlers; 34 | } 35 | 36 | public static HandlerList getHandlerList() { 37 | return handlers; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/event/cutscene/PlayerCutsceneEnterEvent.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.event.cutscene; 2 | 3 | public class PlayerCutsceneEnterEvent { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/event/cutscene/PlayerCutsceneExitEvent.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.event.cutscene; 2 | 3 | public class PlayerCutsceneExitEvent { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/parser/AJRigParser.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.parser; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import cloud.polars.animations.api.parser.Parser; 5 | import cloud.polars.animations.api.rig.type.Animation; 6 | import cloud.polars.animations.api.rig.type.Skeleton; 7 | 8 | import java.io.File; 9 | import java.util.List; 10 | 11 | public class AJRigParser implements Parser { 12 | @Override 13 | public Animation parse(File file) { 14 | return null; 15 | } 16 | 17 | @Override 18 | public Skeleton createRig() { 19 | return null; 20 | } 21 | 22 | @Override 23 | public List getBones() { 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/parser/BlenderRigParser.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.parser; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import cloud.polars.animations.api.parser.Parser; 5 | import cloud.polars.animations.api.rig.type.Animation; 6 | import cloud.polars.animations.api.rig.type.Skeleton; 7 | 8 | import java.io.File; 9 | import java.util.List; 10 | 11 | public class BlenderRigParser implements Parser { 12 | @Override 13 | public Animation parse(File file) { 14 | return null; 15 | } 16 | 17 | @Override 18 | public Skeleton createRig() { 19 | return null; 20 | } 21 | 22 | @Override 23 | public List getBones() { 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/parser/GenericParser.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.parser; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import cloud.polars.animations.api.rig.type.Animation; 5 | import cloud.polars.animations.api.rig.type.Skeleton; 6 | 7 | import java.io.File; 8 | import java.util.List; 9 | 10 | public class GenericParser implements Parser { 11 | 12 | private ParserType parserType; 13 | 14 | public GenericParser(ParserType parserType) { 15 | this.parserType = parserType; 16 | } 17 | 18 | @Override 19 | public Animation parse(File file) { 20 | switch (parserType) { 21 | case ANIMATED_JAVA -> { 22 | return new AJRigParser().parse(file); 23 | } 24 | default -> { 25 | return new BlenderRigParser().parse(file); 26 | } 27 | } 28 | } 29 | 30 | @Override 31 | public Skeleton createRig() { 32 | return null; 33 | } 34 | 35 | @Override 36 | public List getBones() { 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/parser/Parser.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.parser; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import cloud.polars.animations.api.rig.type.Animation; 5 | import cloud.polars.animations.api.rig.type.Skeleton; 6 | 7 | import java.io.File; 8 | import java.util.List; 9 | 10 | public interface Parser { 11 | Animation parse(File file); 12 | 13 | Skeleton createRig(); 14 | 15 | List getBones(); 16 | } 17 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/parser/ParserType.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.parser; 2 | 3 | public enum ParserType { 4 | BLENDER, 5 | ANIMATED_JAVA, 6 | // CUTSCENE, 7 | // CUSTOM 8 | } 9 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/rig/AnimationFactory.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.rig; 2 | 3 | import cloud.polars.animations.api.rig.type.Animation; 4 | import cloud.polars.animations.api.rig.type.Skeleton; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import java.util.List; 8 | 9 | public interface AnimationFactory { 10 | Animation create(@NotNull Iterable<@NotNull Skeleton> skeletons); 11 | 12 | default Animation create(@NotNull Skeleton... skeletons) { 13 | return create(List.of(skeletons)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/rig/SkeletonFactory.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.rig; 2 | 3 | import cloud.polars.animations.api.rig.type.Skeleton; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | public interface SkeletonFactory { 7 | @NotNull Skeleton createSkeleton(); 8 | } 9 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/rig/type/Animation.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.rig.type; 2 | 3 | public interface Animation { 4 | int getFrame(); 5 | 6 | void setFrame(int frame); 7 | 8 | boolean next(); 9 | 10 | int getDuration(); 11 | } 12 | -------------------------------------------------------------------------------- /api/src/main/java/cloud/polars/animations/api/rig/type/Skeleton.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.api.rig.type; 2 | 3 | import cloud.polars.animations.api.bone.Bone; 4 | import org.bukkit.entity.Player; 5 | import org.jetbrains.annotations.NotNull; 6 | import org.jetbrains.annotations.Nullable; 7 | import org.joml.Matrix4d; 8 | 9 | import java.util.Collection; 10 | import java.util.function.Predicate; 11 | 12 | public interface Skeleton { 13 | @NotNull 14 | Bone getRootBone(); 15 | 16 | @NotNull 17 | Matrix4d getPosition(); 18 | 19 | double getRange(); 20 | 21 | void setRange(double range); 22 | 23 | @Nullable 24 | Predicate getVisibilityPredicate(); 25 | 26 | void setVisibilityPredicate(@Nullable Predicate predicate); 27 | 28 | void setViewers(@Nullable Collection viewers); 29 | 30 | void spawn(); 31 | 32 | void remove(); 33 | } 34 | -------------------------------------------------------------------------------- /build-logic/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | repositories { 6 | gradlePluginPortal() 7 | } 8 | 9 | dependencies { 10 | implementation(libs.shadow) 11 | implementation(libs.paperweight) 12 | implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) 13 | } -------------------------------------------------------------------------------- /build-logic/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | } 5 | versionCatalogs { 6 | create("libs") { 7 | from(files("../gradle/libs.versions.toml")) 8 | } 9 | } 10 | } 11 | 12 | rootProject.name = "build-logic" -------------------------------------------------------------------------------- /build-logic/src/main/kotlin/cloud.polars.animations.build-logic.gradle.kts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/administrateclouds/animations/408382b648dedbb7fd3431bcd6e524e7df688d1d/build-logic/src/main/kotlin/cloud.polars.animations.build-logic.gradle.kts -------------------------------------------------------------------------------- /build-logic/src/main/kotlin/cloud.polars.animations.java-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `java-library` 3 | `maven-publish` 4 | } 5 | 6 | val Project.libs: VersionCatalog 7 | get() = extensions.getByType(VersionCatalogsExtension::class.java).named("libs") 8 | 9 | repositories { 10 | mavenCentral() 11 | maven("https://papermc.io/repo/repository/maven-public/") 12 | maven("https://ci.mg-dev.eu/plugin/repository/everything") 13 | } 14 | 15 | group = properties["group"] as String 16 | version = properties["version"] as String 17 | java.sourceCompatibility = JavaVersion.VERSION_17 18 | 19 | publishing { 20 | publications.create("maven") { 21 | from(components["java"]) 22 | } 23 | } 24 | 25 | tasks.withType() { 26 | options.encoding = "UTF-8" 27 | } 28 | 29 | tasks.withType() { 30 | options.encoding = "UTF-8" 31 | } 32 | 33 | tasks { 34 | processResources { 35 | filesMatching(listOf("plugin.yml")) { 36 | expand( 37 | "id" to properties["id"], 38 | "name" to properties["pluginName"], 39 | "version" to properties["version"], 40 | "spigotApiVersion" to parseApiVersion(libs.findVersion("paper").get().toString()), 41 | "description" to properties["description"], 42 | "url" to properties["url"], 43 | "authors" to properties["authors"] 44 | ) 45 | } 46 | } 47 | } 48 | 49 | fun parseApiVersion(input: String): String { 50 | val regex = Regex("""^(\d+\.\d+)""") 51 | val matchResult = regex.find(input) 52 | val version = matchResult?.groupValues?.get(1) 53 | 54 | return version ?: "unknown" 55 | } -------------------------------------------------------------------------------- /build-logic/src/main/kotlin/cloud.polars.animations.paperweight-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("cloud.polars.animations.java-conventions") 3 | id("io.papermc.paperweight.userdev") 4 | } 5 | 6 | tasks { 7 | assemble { 8 | dependsOn(reobfJar) 9 | } 10 | } -------------------------------------------------------------------------------- /build-logic/src/main/kotlin/cloud.polars.animations.platform-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | application 3 | id("cloud.polars.animations.publish-conventions") 4 | } -------------------------------------------------------------------------------- /build-logic/src/main/kotlin/cloud.polars.animations.publish-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("cloud.polars.animations.shadow-conventions") 3 | } -------------------------------------------------------------------------------- /build-logic/src/main/kotlin/cloud.polars.animations.shadow-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar 2 | 3 | plugins { 4 | id("cloud.polars.animations.java-conventions") 5 | id("com.github.johnrengelman.shadow") 6 | } 7 | 8 | tasks { 9 | named("jar") { 10 | archiveClassifier.set("unshaded") 11 | from(project.rootProject.file("LICENSE")) 12 | } 13 | 14 | val shadowJar = named("shadowJar") { 15 | archiveBaseName.set(project.name) 16 | archiveVersion.set("") 17 | archiveClassifier.set("") 18 | 19 | // relocations here 20 | // relocate("tld.domain.package", "cloud.polars.animations.libs") 21 | } 22 | 23 | named("build") { 24 | dependsOn(shadowJar) 25 | } 26 | } -------------------------------------------------------------------------------- /build-logic/src/main/kotlin/extensions.kt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/administrateclouds/animations/408382b648dedbb7fd3431bcd6e524e7df688d1d/build-logic/src/main/kotlin/extensions.kt -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `java-library` 3 | eclipse 4 | id("cloud.polars.animations.build-logic") 5 | } 6 | 7 | allprojects { 8 | group = properties["group"] as String + "." + properties["id"] as String 9 | version = properties["version"] as String 10 | description = properties["description"] as String 11 | } 12 | 13 | var platforms = setOf( 14 | projects.platform.spigot 15 | ).map { it.dependencyProject } 16 | 17 | subprojects { 18 | apply { 19 | plugin("java-library") 20 | plugin("cloud.polars.animations.build-logic") 21 | } 22 | 23 | when(this) { 24 | in platforms -> plugins.apply("cloud.polars.animations.platform-conventions") 25 | else -> plugins.apply("cloud.polars.animations.java-conventions") 26 | } 27 | } -------------------------------------------------------------------------------- /core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("cloud.polars.animations.publish-conventions") 3 | } 4 | 5 | dependencies { 6 | compileOnly(libs.joml) 7 | compileOnly(libs.cloud.core) 8 | compileOnly(libs.cloud.annotations) 9 | compileOnly(libs.cloud.minecraft.extras) 10 | compileOnly(libs.adventure.api) 11 | compileOnly(libs.adventure.text.minimessage) 12 | compileOnly(libs.adventure.text.serializer.gson) 13 | compileOnly(libs.adventure.text.serializer.legacy) 14 | implementation(projects.api) 15 | } -------------------------------------------------------------------------------- /core/src/main/java/cloud/polars/animations/core/AnimationsCore.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.core; 2 | 3 | public class AnimationsCore { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | group=cloud.polars 2 | id=animations 3 | version=1.0.0 4 | pluginName=Animations 5 | description=A fully-featured free and open-source animation system for Minecraft Servers utilizing Resource Packs. 6 | authors=polargh,56738,Reasonlesss,Kas-tle 7 | url=https://github.com/administrateclouds/animations -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | cloud = "1.8.4" 3 | paper = "1.20.4-R0.1-SNAPSHOT" 4 | paperweight = "1.5.5" 5 | easyarmorstands = "2.0.1" 6 | shadow = "8.1.1" 7 | joml = "1.10.5" 8 | adventure-api = "4.16.0" 9 | adventure-platform = "4.3.2" 10 | 11 | [libraries] 12 | cloud-core = { module = "cloud.commandframework:cloud-core", version.ref = "cloud" } 13 | cloud-annotations = { module = "cloud.commandframework:cloud-annotations", version.ref = "cloud" } 14 | cloud-minecraft-extras = { module = "cloud.commandframework:cloud-minecraft-extras", version.ref = "cloud" } 15 | cloud-paper = { module = "cloud.commandframework:cloud-paper", version.ref = "cloud" } 16 | easyarmorstands-api = { module = "me.m56738:easyarmorstands-api", version.ref = "easyarmorstands" } 17 | paper-api = { module = "io.papermc.paper:paper-api", version.ref = "paper"} 18 | joml = { module = "org.joml:joml", version.ref = "joml" } 19 | adventure-api = { module = "net.kyori:adventure-api", version.ref = "adventure-api" } 20 | adventure-platform-bukkit = { module = "net.kyori:adventure-platform-bukkit", version.ref = "adventure-platform" } 21 | adventure-text-minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure-api" } 22 | adventure-text-serializer-gson = { module = "net.kyori:adventure-text-serializer-gson", version.ref = "adventure-api" } 23 | adventure-text-serializer-legacy = { module = "net.kyori:adventure-text-serializer-legacy", version.ref = "adventure-api" } 24 | paperweight = { group = "io.papermc.paperweight", name = "paperweight-userdev", version.ref = "paperweight" } 25 | shadow = { group = "com.github.johnrengelman", name = "shadow", version.ref = "shadow" } 26 | 27 | [plugins] 28 | paperweight = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight" } 29 | shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/administrateclouds/animations/408382b648dedbb7fd3431bcd6e524e7df688d1d/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /mcanim.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | import bpy_extras 3 | import struct 4 | 5 | bl_info = { 6 | "name": "MCExporter", 7 | "description": "Animation exporter for MC", 8 | "author": "56738", 9 | "version": (1, 0), 10 | "blender": (3, 5, 0), 11 | "location": "File > Export", 12 | } 13 | 14 | 15 | def write_matrix(file, value): 16 | for col in value.col: 17 | for cell in col: 18 | file.write(struct.pack('>d', cell)) 19 | 20 | 21 | def write_int(file, value): 22 | file.write(struct.pack('>I', value)) 23 | 24 | 25 | def write_str(file, value): 26 | encoded = value.encode('utf-8') 27 | file.write(struct.pack('>H', len(encoded))) 28 | file.write(encoded) 29 | 30 | 31 | class Channel: 32 | def __init__(self, name: str, kind: str): 33 | self.name = name 34 | self.kind = kind 35 | 36 | def export(self, file, mat): 37 | pass 38 | 39 | 40 | class Element: 41 | def __init__(self, name: str): 42 | self.name = name 43 | self.channels = [] 44 | 45 | def add_channel(self, channel: Channel): 46 | self.channels.append(channel) 47 | 48 | 49 | class MatrixChannel(Channel): 50 | def __init__(self, name: str): 51 | super().__init__(name, 'mat4') 52 | 53 | def get_mat(self): 54 | pass 55 | 56 | def export(self, file, mat): 57 | write_matrix(file, mat @ self.get_mat()) 58 | 59 | 60 | class ObjectPositionChannel(MatrixChannel): 61 | def __init__(self, name, obj): 62 | super().__init__(name) 63 | self.obj = obj 64 | 65 | def get_mat(self): 66 | return self.obj.matrix_world 67 | 68 | 69 | class BonePositionChannel(ObjectPositionChannel): 70 | def __init__(self, name, obj, bone): 71 | super().__init__(name) 72 | self.obj = obj 73 | self.bone = bone 74 | self.pose_bone = obj.pose.bones[bone.name] 75 | 76 | def get_mat(self): 77 | return super().get_mat() @ self.bone.matrix 78 | 79 | 80 | def write_elements(file, elements): 81 | write_int(file, len(elements)) 82 | for e in elements: 83 | write_str(file, e.name) 84 | write_int(file, len(e.channels)) 85 | for ch in e.channels: 86 | write_str(file, ch.name) 87 | write_str(file, ch.kind) 88 | 89 | 90 | def write_frame(file, mat, elements): 91 | for e in elements: 92 | for ch in e.channels: 93 | ch.export(file, mat) 94 | 95 | 96 | def write_frames(file, mat, elements, scene, frame_start, frame_end): 97 | write_int(file, frame_end - frame_start + 1) 98 | frame_current = scene.frame_current 99 | for frame in range(frame_start, frame_end + 1): 100 | scene.frame_set(frame) 101 | write_frame(file, mat, elements) 102 | scene.frame_set(frame_current) 103 | 104 | 105 | def write_anim(file, scene, frame_start, frame_end): 106 | elements = [] 107 | 108 | for obj in scene.objects: 109 | if 'mc' in obj: 110 | e = Element(obj['mc']) 111 | e.add_channel(ObjectPositionChannel('matrix', obj)) 112 | elements.append(e) 113 | 114 | if obj.type == 'ARMATURE': 115 | for bone in obj.data.bones: 116 | if 'mc' in bone: 117 | e = Element(bone['mc']) 118 | e.add_channel(BonePositionChannel('matrix', obj, bone)) 119 | elements.append(e) 120 | 121 | global_mat = bpy_extras.io_utils.axis_conversion(to_forward='Z', to_up='Y').to_4x4() 122 | 123 | file.write(b'MCANIM01') 124 | write_elements(file, elements) 125 | write_frames(file, global_mat, elements, scene, frame_start, frame_end) 126 | 127 | 128 | def export_anim(context, filepath): 129 | with open(filepath, 'wb') as file: 130 | scene = context.scene 131 | write_anim(file, scene, scene.frame_start, scene.frame_end) 132 | return {'FINISHED'} 133 | 134 | 135 | class ExportMCAnimation(bpy.types.Operator, bpy_extras.io_utils.ExportHelper): 136 | """Save an animation""" 137 | bl_idname = 'export_anim.mcanim' 138 | bl_label = "Export MC animation" 139 | 140 | filename_ext = '.mcanim' 141 | 142 | def execute(self, context): 143 | keywords = self.as_keywords( 144 | ignore=( 145 | 'check_existing', 146 | ) 147 | ) 148 | return export_anim(context, **keywords) 149 | 150 | 151 | def menu_func_export(self, context): 152 | self.layout.operator(ExportMCAnimation.bl_idname, text="Animation (.mcanim)") 153 | 154 | 155 | def register(): 156 | bpy.utils.register_class(ExportMCAnimation) 157 | bpy.types.TOPBAR_MT_file_export.append(menu_func_export) 158 | 159 | 160 | def unregister(): 161 | bpy.utils.unregister_class(ExportMCAnimation) 162 | bpy.types.TOPBAR_MT_file_export.remove(menu_func_export) 163 | 164 | 165 | if __name__ == '__main__': 166 | register() 167 | -------------------------------------------------------------------------------- /platform/spigot/adapters/nms/r1_20_4_R1/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("cloud.polars.animations.paperweight-conventions") 3 | } 4 | 5 | dependencies { 6 | compileOnly(libs.paper.api) 7 | implementation(projects.platform.spigot.adapters.provider) 8 | paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT") 9 | } -------------------------------------------------------------------------------- /platform/spigot/adapters/provider/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compileOnly(libs.paper.api) 3 | } -------------------------------------------------------------------------------- /platform/spigot/adapters/provider/src/main/java/cloud/polars/animations/NMSProvider.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations; 2 | 3 | public interface NMSProvider {} -------------------------------------------------------------------------------- /platform/spigot/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compileOnly(variantOf(libs.easyarmorstands.api) { classifier("all") }) { 3 | isTransitive = false 4 | } 5 | compileOnly(libs.paper.api) 6 | implementation(libs.joml) 7 | implementation(libs.cloud.paper) 8 | implementation(libs.cloud.annotations) 9 | implementation(libs.cloud.minecraft.extras) 10 | implementation(libs.adventure.platform.bukkit) 11 | implementation(libs.adventure.text.minimessage) 12 | implementation(libs.adventure.text.serializer.gson) 13 | implementation(libs.adventure.text.serializer.legacy) 14 | implementation(projects.core) 15 | implementation(projects.platform.spigot.adapters.provider) 16 | implementation(project(":platform:spigot:adapters:nms:r1_20_4_R1")) 17 | } 18 | 19 | application { 20 | mainClass.set("cloud.polars.animations.spigot.AnimationsSpigot") 21 | } 22 | 23 | tasks.withType { 24 | archiveBaseName.set("Animations-Spigot") 25 | } -------------------------------------------------------------------------------- /platform/spigot/src/main/java/cloud/polars/animations/spigot/AnimationsSpigot.java: -------------------------------------------------------------------------------- 1 | package cloud.polars.animations.spigot; 2 | 3 | import cloud.commandframework.annotations.AnnotationParser; 4 | import cloud.commandframework.arguments.parser.StandardParameters; 5 | import cloud.commandframework.bukkit.BukkitCommandManager.BrigadierFailureException; 6 | import cloud.commandframework.bukkit.CloudBukkitCapabilities; 7 | import cloud.commandframework.execution.CommandExecutionCoordinator; 8 | import cloud.commandframework.meta.CommandMeta; 9 | import cloud.commandframework.paper.PaperCommandManager; 10 | import net.kyori.adventure.platform.bukkit.BukkitAudiences; 11 | import org.bukkit.command.CommandSender; 12 | import org.bukkit.plugin.java.JavaPlugin; 13 | 14 | import java.util.function.Function; 15 | import java.util.logging.Level; 16 | 17 | public class AnimationsSpigot extends JavaPlugin { 18 | private static AnimationsSpigot instance; 19 | private BukkitAudiences audiences; 20 | 21 | private PaperCommandManager commandManager; 22 | private AnnotationParser annotationParser; 23 | 24 | @Override 25 | public void onLoad() { 26 | instance = this; 27 | } 28 | 29 | @Override 30 | public void onEnable() { 31 | audiences = BukkitAudiences.create(this); 32 | 33 | try { 34 | commandManager = new PaperCommandManager<>( 35 | this, 36 | CommandExecutionCoordinator.simpleCoordinator(), 37 | Function.identity(), 38 | Function.identity() 39 | ); 40 | } catch (Exception e) { 41 | throw new RuntimeException(e); 42 | } 43 | 44 | if (commandManager.hasCapability(CloudBukkitCapabilities.BRIGADIER)) { 45 | try { 46 | commandManager.registerBrigadier(); 47 | } catch (BrigadierFailureException e) { 48 | getLogger().log(Level.WARNING, "Failed to register Brigadier Mappings"); 49 | } 50 | } 51 | 52 | annotationParser = new AnnotationParser<>( 53 | commandManager, 54 | CommandSender.class, 55 | p -> CommandMeta.simple() 56 | .with(CommandMeta.DESCRIPTION, p.get(StandardParameters.DESCRIPTION, "No description")) 57 | .build() 58 | ); 59 | } 60 | 61 | public static AnimationsSpigot getInstance() { 62 | return instance; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /platform/spigot/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: ${name} 2 | version: '${version}' 3 | website: ${url} 4 | authors: [${authors}] 5 | main: 'cloud.polars.animations.spigot.AnimationsSpigot' 6 | api-version: '${spigotApiVersion}' 7 | dependencies: 8 | server: 9 | EasyArmorStands: 10 | required: false 11 | load: BEFORE -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "Animations" 2 | 3 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 4 | 5 | include(":api") 6 | include(":core") 7 | 8 | include(":platform:spigot") 9 | include(":platform:spigot:adapters:provider") 10 | include(":platform:spigot:adapters:nms:r1_20_4_R1") 11 | 12 | 13 | pluginManagement { 14 | repositories { 15 | gradlePluginPortal() 16 | } 17 | includeBuild("build-logic") 18 | } --------------------------------------------------------------------------------