diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..097f9f9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b01da52 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +# Automatically build the project and run any configured tests for every push +# and submitted pull request. This can help catch issues that only occur on +# certain platforms or Java versions, and provides a first line of defence +# against bad commits. + +name: build +on: [pull_request, push] + +jobs: + build: + strategy: + matrix: + # Use these Java versions + java: [ + 21, # Current Java LTS + ] + runs-on: ubuntu-22.04 + steps: + - name: checkout repository + uses: actions/checkout@v4 + - name: validate gradle wrapper + uses: gradle/wrapper-validation-action@v2 + - name: setup jdk ${{ matrix.java }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'microsoft' + - name: make gradle wrapper executable + run: chmod +x ./gradlew + - name: build + run: ./gradlew build + - name: capture build artifacts + if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java + uses: actions/upload-artifact@v4 + with: + name: Artifacts + path: build/libs/ \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45c9410 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# gradle + +.gradle/ +build/ +out/ +classes/ + +# eclipse + +*.launch + +# idea + +.idea/ +*.iml +*.ipr +*.iws + +# vscode + +.settings/ +.vscode/ +bin/ +.classpath +.project + +# macos + +*.DS_Store + +# fabric + +runs/ +player/ + +# java + +hs_err_*.log +replay_*.log +*.hprof +*.jfr diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ecbc059 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..19bacca --- /dev/null +++ b/README.md @@ -0,0 +1,139 @@ +mod logo + +### Mossy - Template Fabric Mod + +--- + +Mossy is a template Fabric mod with some additional tweaks and code templates. + +### Tweaks and templates +--- +### Done +1) Multi-version modding by [Stonecutter](https://stonecutter.kikugie.dev/) plugin +2) Easy player setting (uuid and nickname) +3) Mod Menu Integration +4) Fast YACL configuration for config screen (WIP) +5) Mod Config template +6) Versioned AWs and Mixins +7) Fast `gradle.properties`, AWs and mixins generation for each version (for 1st point) +8) Split run folder for `runs/client` and `runs/server` +### Planned +9) Add support for multi-loaders + +# How to set up it +Basically, there are two ways: +1) You can fork this template mod and make your mod +2) You can integrate Mossy build system into your ready-made mod + +But we will focus on the second way. In this way you will need to copy files `stonecutter.gradle`, `settings.gradle`, `gradle.properties`, `build.gradle`, `LICENSE`, `Mossy/src/main/resources/fabric.mod.json` and optional `.gitignore`. + +Then you will need to set up `gradle.properties`. + +## About `gradle.properties` +- `Mod Properties` contains mod info +- `Main Dependencies` like `Build Dependencies`, but not versioned +- `Build Dependencies` contains build properties, usually they versioned +- `Multi-Versions` basically contains only one property, it's a `multi_versions`, versions in it should be separated with space ' ' +- `Additional Dependencies` contains additional depends, and you can add it easily: +```properties +# If you want to have it versioned, just write: +dep.MOD_ID=[VERSIONED] +# and add this property to every `Mossy/versions/[MINECRAFT VERSION]/gradle.properties`, if it's boring for you, just remove `gradle.properties` and reload gradle, each `gradle.properties` with last versions of depends will be generated. +# +# If you want to have static version, just write: +dep.MOD_ID=MOD_VERSION +# +# READ ME +# MOD_ID should be taken from Modrinth. +# `dep.` part is important. +``` + +After you can reload gradle and check all updates. + +Also don't forgot to add your dependency in `build.gradle` with this value + +## About Mixins and AWs + +After reloading gradle, in your `resources` folder you will find `mixins` and `aws` folders. In them, you will find generated mixins and AWs for each minecraft version. What version they are for is indicated in their name. + +You might be surprised that all mixins have a `.json5` extension instead of `.json`. This is needed to support comments which are needed for the [Stonecutter](https://stonecutter.kikugie.dev/) plugin. In build all mixins will be converted to `.json` by [j52j](https://github.com/kikugie/j52j). + +To understand how comments work, I recommend to check the [Stonecutter docs](https://stonecutter.kikugie.dev/stonecutter/introduction). + +AWs, in turn, have nothing unusual. + +## About `fabric.mod.json` +In Mossy, `fabric.mod.json` has some features you should know, here are the main ones: +```json5 +// ... +// Other code + "depends": { + "fabricloader": ">=${fabric_loader}", + "minecraft": ">=${minecraft}", + "java": ">=${java}", + "fabric-api": ">=${fabric_api}" + }, // needs because we have multi-versions + "accessWidener": "aws/${minecraft}.accesswidener", // needs to get path to AW for current minecraft version + "mixins": [ + "mixins/${minecraft}-${modId}.mixins.json" // needs to get path to mixing config for current minecraft version + ] +// Other code +// ... +``` + +## About `player/player.properties` + +`Mossy/player/player.properties` is just a properties file, which uses to set up minecraft runs config with properties, to set up your nickname and uuid if they are present. If you want to add it, just create `player` folder in your project, and file `player.properties` with this content: + +```properties +# Player properties +# If you don't want to change any properties, just remove it +player_nickname=Cool boy +player_uuid=Your UUID here +# After changes, you need to delete "/.idea/runConfigurations" folder and reopen project and reload gradle +``` + +## About `.json5` files +At now plugin j52j will convert all `.json5` files in `Mossy/src/main/resources/` to `.json` in build, check [this](https://github.com/kikugie/j52j?tab=readme-ov-file#configuring-the-plugin) if you wanna to safe some files from converting. + +# How to use it + +## Switching current minecraft version + +After settings and reloading gradle, you should have gradle tasks in the `stonecutter` category, select the one and you will switch the active minecraft version of the game to the selected one. +- `Refresh active project` will refresh project and update comments. +- `Reset active project` will switch current minecraft version to first of the `multi_versions` in main `gradle.properties` file. + +You can check current minecraft version in `stonecutter.gradle` file. +For more info check the [Stonecutter docs](https://stonecutter.kikugie.dev/stonecutter/introduction). + +
+Showcase +
+Showcase +
+ +## Launching current minecraft version +To run current minecraft version with your mod you will need to execute run configuration with the same version, that in `stonecutter.gradle`, to switch it, read previous text above. + +Also, your game folder is now split to `Mossy/runs/client` and `Mossy/runs/server`, boop. + +
+Showcase +
+Showcase +Showcase +
+ +## Building mod +To build your mod for each minecraft version which you write in main `gradle.properties`, you can just start specified gradle task `chiseledBuild` in `project` group, after execution you can go to `Mossy/versions/[MINECRAFT VERSION]/build/libs/your_builded_mod.jar`. + +
+Showcase +
+Showcase + +And after executing `chiseledBuild` task you can check your mods, here is example for minecraft 1.20.1: + +Showcase +
diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..6559a8b --- /dev/null +++ b/build.gradle @@ -0,0 +1,176 @@ +plugins { + id "fabric-loom" version "1.6-SNAPSHOT" + id "dev.kikugie.j52j" version "1.0.2" +} + +def modId = project.mod_id +def modName = project.mod_name +def modVersion = project.mod_version +def modMavenGroup = project.mod_group + +def modDescription = project.mod_description +def modAuthors = project.mod_authors +def modLicense = project.mod_license + +def minecraftVersion = stonecutter.current.version.toString() // Current MC version from "./versions/" folder +def lombokVersion = project.lombok_version +def fabricLoader = findProperty("build.fabric_loader") +def javaVersion = findProperty("build.java") +def fabricAPI = findProperty("build.fabric_api") + +version = "${modVersion}+${stonecutter.current.version}" +group = modMavenGroup + +j52j { + sources(sourceSets["main"]) +} + +base { + archivesName = modName +} + +repositories { + maven { url "https://maven.quiltmc.org/repository/release/" } // Stil for YACL + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } // Stil for YACL + maven { + name "Terraformers" // ModMenu + url "https://maven.terraformersmc.com/" + } + maven { + name 'Xander Maven' // YACL + url 'https://maven.isxander.dev/releases' + } +} + +dependencies { + minecraft "com.mojang:minecraft:${minecraftVersion}" + mappings "net.fabricmc:yarn:${findProperty("build.yarn")}:v2" + modImplementation "net.fabricmc:fabric-loader:${fabricLoader}" + + // Lombok + compileOnly "org.projectlombok:lombok:${lombokVersion}" + annotationProcessor "org.projectlombok:lombok:${lombokVersion}" + + // Fabric API + modImplementation "net.fabricmc.fabric-api:fabric-api:${fabricAPI}" + + // Mod Menu + modImplementation "com.terraformersmc:modmenu:${findProperty("dep.modmenu")}" + + // YACL + def minecraftVersionsWithOldYACLMaven = Set.of("1.19.4", "1.20", "1.20.2", "1.20.3") + if (minecraftVersionsWithOldYACLMaven.contains(minecraftVersion)) { + def property = findProperty("dep.yacl").toString() + def i = property.lastIndexOf("-") + if (i != -1) { + property = property.substring(0, i) + } + modImplementation "dev.isxander.yacl:yet-another-config-lib-fabric:${property}" + } else { + modImplementation "dev.isxander:yet-another-config-lib:${findProperty("dep.yacl")}" + } +} + +loom { + mixin { + defaultRefmapName.set("${modId}.refmap.json") + } + + def accessWidenerFile = project.rootProject.file("src/main/resources/aws/${minecraftVersion}-${modId}.accesswidener") + if (accessWidenerFile.exists()) { + accessWidenerPath = accessWidenerFile + } + + def playerProperties = getPlayerProperties() + def playerNickname = playerProperties.contains("player_nickname") ? playerProperties.get("player_nickname") : null // Your in-game nickname + def playerUuid = playerProperties.contains("player_uuid") ? playerProperties.get("player_uuid") : null // Your in-game uuid + + runConfigs.configureEach { config -> + config.setIdeConfigGenerated(true) // generate IDE tasks for running client, server and testmod, datagen if those are present + config.setRunDir("../../runs/${config.environment}") // use a global run directory for all versions + + if (config.getEnvironment() == "client") { // setting player properties from "./players/player.properties" file + if (playerNickname != null) { + config.programArgs("--username", playerNickname.toString()) + } + if (playerUuid != null) { + config.programArgs("--uuid", playerUuid.toString()) + } + } + } +} + +processResources { + def props = [:] + props.put("mod_id", modId.toString()) + props.put("mod_authors", modAuthors.toString()) + props.put("mod_description", modDescription.toString()) + props.put("mod_name", modName.toString()) + props.put("mod_license", modLicense .toString()) + props.put("version", version.toString()) + props.put("fabric_loader", fabricLoader.toString()) + props.put("minecraft", minecraftVersion.toString()) + props.put("java", javaVersion.toString()) + props.put("fabric_api", fabricAPI.toString()) + + props.each { key, value -> + inputs.property key, value + } + + filesMatching(["fabric.mod.json"]) { + expand(props) + } + + filesMatching("aws/*.accesswidener") { + if (!it.getName().startsWith(minecraftVersion)) { + it.exclude() + } + } + + filesMatching("mixins/*.mixins.json5") { + if (!it.getName().startsWith(minecraftVersion)) { + it.exclude() + } + } +} + +stonecutter { + swap("mod_version", "\"${findProperty("mod_version")}\";") + swap("mod_id", "\"${findProperty("mod_id")}\";") + swap("mod_name", "\"${findProperty("mod_name")}\";") +} + +tasks.withType(JavaCompile).configureEach { + it.options.release = (javaVersion as int) +} + +java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() + + def java = javaVersion as int + def ver = java > 17 ? JavaVersion.VERSION_21 : JavaVersion.VERSION_17 + sourceCompatibility = ver + targetCompatibility = ver +} + +jar { + from("LICENSE") { + rename { "${it}_${project.base.archivesName.get()}" } + } +} + +Properties getPlayerProperties() { + def playerProperties = new Properties() + def playerPropertiesFile = project.rootProject.file("player/player.properties") + if (playerPropertiesFile.exists()) { + playerPropertiesFile.withInputStream { stream -> + playerProperties.load(stream) + } + } else { + println("Failed to find player properties at ${playerPropertiesFile}") + } + return playerProperties +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..b00c87d --- /dev/null +++ b/gradle.properties @@ -0,0 +1,30 @@ +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx5G +org.gradle.parallel=true + +# Mod Properties +mod_id = mossy +mod_name = Mossy +mod_version = 1.0.0 +mod_group = net.lopymine.mossy + +mod_description = Template Fabric mod with some additional tweaks and templates for my projects +mod_authors = LopyMine +mod_license = GPL-2.0 + +# Main Dependencies +lombok_version = 1.18.32 + +# Multi-Versions +# Verified version: 1.20 1.20.1 1.20.2 1.20.3 1.20.4 1.20.5 1.20.6 +multi_versions = 1.20.6 1.20.1 + +# Build Dependencies +build.yarn = [VERSIONED] +build.fabric_loader = [VERSIONED] +build.fabric_api = [VERSIONED] +build.java = [VERSIONED] + +# Additional Dependencies, "dep." is important +dep.yacl = [VERSIONED] +dep.modmenu = [VERSIONED] \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e644113 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..b82aa23 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..1aa94a4 --- /dev/null +++ b/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..25da30d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/img/building_mod.gif b/img/building_mod.gif new file mode 100644 index 0000000..09e91bc Binary files /dev/null and b/img/building_mod.gif differ diff --git a/img/launched_mod.png b/img/launched_mod.png new file mode 100644 index 0000000..75839ea Binary files /dev/null and b/img/launched_mod.png differ diff --git a/img/launching_minecraft.gif b/img/launching_minecraft.gif new file mode 100644 index 0000000..a8c2b4b Binary files /dev/null and b/img/launching_minecraft.gif differ diff --git a/img/mod.png b/img/mod.png new file mode 100644 index 0000000..0d3e9a3 Binary files /dev/null and b/img/mod.png differ diff --git a/img/switching_version.gif b/img/switching_version.gif new file mode 100644 index 0000000..6b58c67 Binary files /dev/null and b/img/switching_version.gif differ diff --git a/player/player.properties b/player/player.properties new file mode 100644 index 0000000..d30b946 --- /dev/null +++ b/player/player.properties @@ -0,0 +1,5 @@ +# Player properties +# If you don't want to change any properties, just remove it +player_nickname=Cool boy +player_uuid=Your UUID here +# After changes, you need to delete "/.idea/runConfigurations" folder and reopen project and reload gradle \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..c9828d8 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,181 @@ +import groovy.json.JsonSlurper +import groovy.json.JsonBuilder + +pluginManagement { + repositories { + maven { + name "Fabric" + url "https://maven.fabricmc.net/" + } + maven { + name "Kiku Snapshots" + url "https://maven.kikugie.dev/snapshots" + } + maven { + name "Kiku Releases" + url "https://maven.kikugie.dev/releases" + } + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.kikugie.stonecutter" version "0.4" +} + +def multiVersions = multi_versions.split(" ") + +println "Found MC versions: ${multiVersions}" + +def additionalDepends = [] +properties.each { k, v -> + def key = k.toString() + if (key.startsWith("dep.")) { + def i = key.indexOf(".") + 1 + def modId = key.substring(i) + additionalDepends.add(modId) + } +} + +if (additionalDepends.isEmpty()) { + println "Not found any additional depends" +} else { + println "Found additional depends: ${additionalDepends}" +} + +stonecutter { + shared { + versions(multiVersions) + vcsVersion = multiVersions.first() + } + + create(rootProject) + + multiVersions.each { multiVersion -> + createGradleProperties(multiVersion, additionalDepends) + createAW(multiVersion) + createMixin(multiVersion) + } +} + +rootProject.name = mod_name + +def createAW(String version) { + def awsFolder = file("src/main/resources/aws/") + if (!awsFolder.exists() && !awsFolder.mkdirs()) { + return + } + def awFile = file("src/main/resources/aws/${version}.accesswidener") + if (awFile.exists() || !awFile.createNewFile()) { + return + } + + awFile.createNewFile() + def writer = new FileWriter(awFile) + writer.write("accessWidener v2 named\n") + writer.write("# ${version} AW\n") + writer.close() + println "Successfully created AW for ${version}" +} + +def createMixin(String version) { + def mixinsFolder = file("src/main/resources/mixins/") + if (!mixinsFolder.exists() && !mixinsFolder.mkdirs()) { + return + } + def mixinsFile = file("src/main/resources/mixins/${version}-${mod_id}.mixins.json5") + if (mixinsFile.exists() || !mixinsFile.createNewFile()) { + return + } + + def mixinContent = [ + required: true, + package: "${mod_group}.mixin", + refmap: "${mod_id}.refmap.json", + compatibilityLevel: "JAVA_17", + mixins: [], + client: [], + injectors: [ + defaultRequire: 1 + ] + ] + + mixinsFile.text = new JsonBuilder(mixinContent).toPrettyString() + println "Successfully created Mixin for ${version}" +} + +def createGradleProperties(String version, ArrayList additionalDepends) { + def folderFile = file("/versions/${version}") + if (!folderFile.exists() && !folderFile.mkdirs()) { + return + } + def gradleProperties = file("/versions/${version}/gradle.properties") + if (gradleProperties.exists() || !gradleProperties.createNewFile()) { + return + } + + def writer = new FileWriter(gradleProperties) + writer.write("# Versioned Properties\n") + writer.write("\n") + writer.write("# Java Properties\n") + writer.write("build.java=${getJavaVersion(version)}\n") + writer.write("\n") + writer.write("# Fabric Properties, check https://fabricmc.net/develop/\n") + writer.write("build.yarn=${getYarnVersion(version)}\n") + writer.write("build.fabric_loader=${getFabricLoaderVersion(version)}\n") + writer.write("build.fabric_api=${getDependVersion("fabric-api", version)}") + if (!additionalDepends.isEmpty()) { + writer.write("\n") + writer.write("\n") + writer.write("# Additional Dependencies Properties\n") + additionalDepends.each { depend -> + def dep = depend.toString() + writer.write("# ${dep}, check https://modrinth.com/mod/${dep}/versions?g=${version}\n") + writer.write("dep.${dep}=${getDependVersion(dep, version)}\n") + } + } + writer.close() + println "Successfully created gradle.properties for ${version}" +} + +static String getYarnVersion(String minecraftVersion) { + def url = new URL("https://meta.fabricmc.net/v2/versions/yarn/${minecraftVersion}?limit=1") + def json = new JsonSlurper().parseText(url.text) + return json[0]["version"].toString() +} + +static String getFabricLoaderVersion(String minecraftVersion) { + def url = new URL("https://meta.fabricmc.net/v2/versions/loader/${minecraftVersion}?limit=1") + def json = new JsonSlurper().parseText(url.text) + return json[0]["loader"]["version"].toString() +} + +static String getDependVersion(String modId, String minecraftVersion) { + def url = new URL("https://api.modrinth.com/v2/project/${modId}/version") + def json = new JsonSlurper().parseText(url.text) + + def result = json.findResult { o -> + if (o["game_versions"].contains(minecraftVersion) && o["loaders"].contains("fabric")) { + return o + } + return null + } + + if (result == null) { + return "unknown" + } + + return result["version_number"].toString() +} + +static String getJavaVersion(String version) { + if (version == "1.20.6") { + return "21" + } + if (version == "1.20.5") { + return "21" + } + return "17" +} + diff --git a/src/main/java/net/lopymine/mossy/Mossy.java b/src/main/java/net/lopymine/mossy/Mossy.java new file mode 100644 index 0000000..1a4258b --- /dev/null +++ b/src/main/java/net/lopymine/mossy/Mossy.java @@ -0,0 +1,22 @@ +package net.lopymine.mossy; + +import net.fabricmc.api.ModInitializer; + +import net.minecraft.util.Identifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Mossy implements ModInitializer { + public static final String MOD_NAME = /*$ mod_name*/ "Mossy"; + public static final String MOD_ID = /*$ mod_id*/ "mossy"; + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_NAME); + + @Override + public void onInitialize() { + LOGGER.info("{} Initialized", MOD_NAME); + } + + public static Identifier id(String path) { + return Identifier.of(MOD_ID, path); + } +} \ No newline at end of file diff --git a/src/main/java/net/lopymine/mossy/client/MossyClient.java b/src/main/java/net/lopymine/mossy/client/MossyClient.java new file mode 100644 index 0000000..f39a904 --- /dev/null +++ b/src/main/java/net/lopymine/mossy/client/MossyClient.java @@ -0,0 +1,24 @@ +package net.lopymine.mossy.client; + +import lombok.*; +import org.slf4j.*; + +import net.fabricmc.api.ClientModInitializer; + +import net.lopymine.mossy.Mossy; +import net.lopymine.mossy.config.MossyConfig; + + +public class MossyClient implements ClientModInitializer { + public static Logger LOGGER = LoggerFactory.getLogger(Mossy.MOD_NAME + "/Client"); + + @Setter + @Getter + private static MossyConfig config; + + @Override + public void onInitializeClient() { + MossyClient.config = MossyConfig.getInstance(); + LOGGER.info("{} Client Initialized", Mossy.MOD_NAME); + } +} diff --git a/src/main/java/net/lopymine/mossy/config/MossyConfig.java b/src/main/java/net/lopymine/mossy/config/MossyConfig.java new file mode 100644 index 0000000..037b6c7 --- /dev/null +++ b/src/main/java/net/lopymine/mossy/config/MossyConfig.java @@ -0,0 +1,80 @@ +package net.lopymine.mossy.config; + +import com.google.gson.*; +import lombok.*; +import org.slf4j.*; + +import com.mojang.serialization.*; +import com.mojang.serialization.codecs.RecordCodecBuilder; + +import net.fabricmc.loader.api.FabricLoader; + +import net.lopymine.mossy.Mossy; +import net.lopymine.mossy.client.MossyClient; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CompletableFuture; +import org.jetbrains.annotations.NotNull; + +@Getter +@Setter +public class MossyConfig { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + Codec.BOOL.fieldOf("mossy").forGetter(MossyConfig::isMossy) + ).apply(instance, MossyConfig::new)); + + private static final File CONFIG_FILE = FabricLoader.getInstance().getConfigDir().resolve(Mossy.MOD_ID + ".json5").toFile(); + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + private static final Logger LOGGER = LoggerFactory.getLogger(Mossy.MOD_NAME + "/Config"); + private boolean mossy; + + public MossyConfig() { + this.mossy = true; + } + + public MossyConfig(boolean mossy) { + this.mossy = mossy; + } + + public static MossyConfig getInstance() { + return MossyConfig.read(); + } + + private static @NotNull MossyConfig create() { + MossyConfig config = new MossyConfig(); + String json = GSON.toJson(CODEC.encode(config, JsonOps.INSTANCE, JsonOps.INSTANCE.empty())/*? if >=1.20.5 {*/.getOrThrow());/*?} else*//*.getOrThrow(false, LOGGER::error));*/ + try (FileWriter writer = new FileWriter(CONFIG_FILE, StandardCharsets.UTF_8)) { + writer.write(json); + } catch (Exception e) { + LOGGER.error("Failed to create config", e); + } + return config; + } + + private static MossyConfig read() { + if (!CONFIG_FILE.exists()) { + return MossyConfig.create(); + } + + try (FileReader reader = new FileReader(CONFIG_FILE, StandardCharsets.UTF_8)) { + return CODEC.decode(JsonOps.INSTANCE, JsonParser.parseReader(reader))/*? if >=1.20.5 {*/.getOrThrow()/*?} else {*//*.getOrThrow(false, LOGGER::error)*//*?}*/.getFirst(); + } catch (Exception e) { + LOGGER.error("Failed to read config", e); + } + return MossyConfig.create(); + } + + public void save() { + MossyClient.setConfig(this); + CompletableFuture.runAsync(() -> { + String json = GSON.toJson(CODEC.encode(this, JsonOps.INSTANCE, JsonOps.INSTANCE.empty())/*? if >=1.20.5 {*/.getOrThrow());/*?} else*//*.getOrThrow(false, LOGGER::error));*/ + + try (FileWriter writer = new FileWriter(CONFIG_FILE, StandardCharsets.UTF_8)) { + writer.write(json); + } catch (Exception e) { + LOGGER.error("Failed to save config", e); + } + }); + } +} diff --git a/src/main/java/net/lopymine/mossy/mixin/ExampleMixin.java b/src/main/java/net/lopymine/mossy/mixin/ExampleMixin.java new file mode 100644 index 0000000..92772ef --- /dev/null +++ b/src/main/java/net/lopymine/mossy/mixin/ExampleMixin.java @@ -0,0 +1,17 @@ +package net.lopymine.mossy.mixin; + +import net.minecraft.client.gui.screen.TitleScreen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.lopymine.mossy.client.MossyClient; + +@Mixin(TitleScreen.class) +public class ExampleMixin { + @Inject(at = @At("HEAD"), method = "init") + private void init(CallbackInfo info) { + MossyClient.LOGGER.info("Hello from Mossy Mixins!"); + } +} \ No newline at end of file diff --git a/src/main/java/net/lopymine/mossy/modmenu/ModMenuIntegration.java b/src/main/java/net/lopymine/mossy/modmenu/ModMenuIntegration.java new file mode 100644 index 0000000..b2059ae --- /dev/null +++ b/src/main/java/net/lopymine/mossy/modmenu/ModMenuIntegration.java @@ -0,0 +1,17 @@ +package net.lopymine.mossy.modmenu; + +import com.terraformersmc.modmenu.api.*; + +import net.fabricmc.loader.api.FabricLoader; + +import net.lopymine.mossy.modmenu.yacl.YACLConfigurationScreen; + +public class ModMenuIntegration implements ModMenuApi { + @Override + public ConfigScreenFactory getModConfigScreenFactory() { + if (FabricLoader.getInstance().isModLoaded("yet_another_config_lib_v3")) { + return YACLConfigurationScreen::createScreen; + } + return NoConfigLibraryScreen::createScreen; + } +} diff --git a/src/main/java/net/lopymine/mossy/modmenu/NoConfigLibraryScreen.java b/src/main/java/net/lopymine/mossy/modmenu/NoConfigLibraryScreen.java new file mode 100644 index 0000000..9889009 --- /dev/null +++ b/src/main/java/net/lopymine/mossy/modmenu/NoConfigLibraryScreen.java @@ -0,0 +1,53 @@ +package net.lopymine.mossy.modmenu; + +import com.google.common.collect.Sets; +import net.minecraft.SharedConstants; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.*; +import net.minecraft.screen.ScreenTexts; +import net.minecraft.text.Text; +import net.minecraft.util.Util; + +import net.lopymine.mossy.client.MossyClient; + +import java.net.*; +import java.util.*; +import org.jetbrains.annotations.*; + +public class NoConfigLibraryScreen { + + private NoConfigLibraryScreen() { + throw new IllegalStateException("Screen class, use createScreen(...) method!"); + } + + private static final Text TITLE = Text.translatable("mossy.modmenu.title"); + private static final Text MESSAGE = Text.translatable("mossy.modmenu.no_config_library_screen.message"); + private static final Set ALLOWED_PROTOCOLS = Sets.newHashSet("http", "https"); + private static final String YACL_MODRINTH_LINK = "https://modrinth.com/mod/yacl/versions?l=fabric&g="; + + @Contract("_ -> new") + public static @NotNull Screen createScreen(Screen parent) { + return new ConfirmScreen((open) -> NoConfigLibraryScreen.onConfirm(open, parent), NoConfigLibraryScreen.TITLE, NoConfigLibraryScreen.MESSAGE, ScreenTexts.CONTINUE, ScreenTexts.BACK); + } + + private static void onConfirm(boolean open, Screen parent) { + if (open) { + try { + String url = NoConfigLibraryScreen.YACL_MODRINTH_LINK + SharedConstants.getGameVersion().getName(); + URI link = new URI(url); + String string = link.getScheme(); + if (string == null) { + throw new URISyntaxException(url, "Missing protocol"); + } + if (!NoConfigLibraryScreen.ALLOWED_PROTOCOLS.contains(string.toLowerCase(Locale.ROOT))) { + throw new URISyntaxException(url, "Unsupported protocol: " + string.toLowerCase(Locale.ROOT)); + } + Util.getOperatingSystem().open(link); + } catch (URISyntaxException e) { + MossyClient.LOGGER.error("Can't open YACL Modrinth page:", e); + } + } else { + MinecraftClient.getInstance().setScreen(parent); + } + } +} diff --git a/src/main/java/net/lopymine/mossy/modmenu/yacl/YACLConfigurationScreen.java b/src/main/java/net/lopymine/mossy/modmenu/yacl/YACLConfigurationScreen.java new file mode 100644 index 0000000..1fbd9bd --- /dev/null +++ b/src/main/java/net/lopymine/mossy/modmenu/yacl/YACLConfigurationScreen.java @@ -0,0 +1,43 @@ +package net.lopymine.mossy.modmenu.yacl; + +import dev.isxander.yacl3.api.*; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.text.Text; + +import net.lopymine.mossy.client.MossyClient; +import net.lopymine.mossy.config.MossyConfig; +import net.lopymine.mossy.modmenu.yacl.simple.*; + +import java.util.function.Function; + +public class YACLConfigurationScreen { + + private static final Function ENABLED_OR_DISABLE_FORMATTER = state -> Text.translatable("mossy.modmenu.formatter.enable_or_disable." + state); + + private YACLConfigurationScreen() { + throw new IllegalStateException("Screen class"); + } + + public static Screen createScreen(Screen parent) { + MossyConfig defConfig = new MossyConfig(); + MossyConfig config = MossyClient.getConfig(); + + return YetAnotherConfigLib.createBuilder() + .title(Text.translatable("mossy.modmenu.title")) + .category(ConfigCategory.createBuilder() + .name(Text.translatable("mossy.modmenu.title")) + .group(getMossyGroup(defConfig, config)) + .build()) + .save(config::save) + .build() + .generateScreen(parent); + } + + private static OptionGroup getMossyGroup(MossyConfig defConfig, MossyConfig config) { + return SimpleGroupOptionBuilder.createBuilder("mossy_group").options(collector -> collector.collect( + collector.getBooleanOption("mossy_option", defConfig.isMossy(), config::isMossy, config::setMossy, ENABLED_OR_DISABLE_FORMATTER::apply, SimpleContent.IMAGE) + )).build(); + } +} + + diff --git a/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleContent.java b/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleContent.java new file mode 100644 index 0000000..e749992 --- /dev/null +++ b/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleContent.java @@ -0,0 +1,19 @@ +package net.lopymine.mossy.modmenu.yacl.simple; + +import lombok.Getter; + +@Getter +public enum SimpleContent { + NONE("none", "none"), + IMAGE("image", "png"), + WEBP("webp", "webp"), + GIF("gif", "gif"); + + private final String folder; + private final String fileExtension; + + SimpleContent(String folder, String fileExtension) { + this.folder = folder; + this.fileExtension = fileExtension; + } +} diff --git a/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleGroupOptionBuilder.java b/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleGroupOptionBuilder.java new file mode 100644 index 0000000..c7865fc --- /dev/null +++ b/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleGroupOptionBuilder.java @@ -0,0 +1,42 @@ +package net.lopymine.mossy.modmenu.yacl.simple; + +import dev.isxander.yacl3.api.*; +import dev.isxander.yacl3.api.OptionGroup.Builder; +import net.minecraft.text.Text; + +import net.lopymine.mossy.utils.ModMenuUtils; + +import java.util.function.Function; + +public class SimpleGroupOptionBuilder { + private final Builder groupBuilder; + private final String groupId; + + public SimpleGroupOptionBuilder(String groupId) { + String groupKey = ModMenuUtils.getGroupTitleKey(groupId); + this.groupId = groupId; + this.groupBuilder = OptionGroup.createBuilder() + .name(Text.translatable(groupKey)) + .description(OptionDescription.of(Text.translatable(ModMenuUtils.getDescriptionKey(groupKey)))); + } + + public static SimpleGroupOptionBuilder createBuilder(String groupId) { + return new SimpleGroupOptionBuilder(groupId); + } + + public SimpleGroupOptionBuilder options(Function[]> function) { + SimpleOptionsCollector collector = SimpleOptionsCollector.createBuilder(this.groupId); + Option[] options = function.apply(collector); + for (Option option : options) { + if (option == null) { + continue; + } + this.groupBuilder.option(option); + } + return this; + } + + public OptionGroup build() { + return this.groupBuilder.build(); + } +} diff --git a/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleOptionsCollector.java b/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleOptionsCollector.java new file mode 100644 index 0000000..7084584 --- /dev/null +++ b/src/main/java/net/lopymine/mossy/modmenu/yacl/simple/SimpleOptionsCollector.java @@ -0,0 +1,76 @@ +package net.lopymine.mossy.modmenu.yacl.simple; + +import dev.isxander.yacl3.api.*; +import dev.isxander.yacl3.api.OptionDescription.Builder; +import dev.isxander.yacl3.api.controller.*; + +import net.minecraft.text.Text; + +import net.lopymine.mossy.utils.ModMenuUtils; + +import java.util.function.*; + +public class SimpleOptionsCollector { + private final String groupId; + + private SimpleOptionsCollector(String groupId) { + this.groupId = groupId; + } + + public static SimpleOptionsCollector createBuilder(String groupId) { + return new SimpleOptionsCollector(groupId); + } + + public Option getBooleanOption(String optionId, boolean defValue, Supplier getter, Consumer setter, ValueFormatter formatter, SimpleContent content) { + return this.getOption(optionId, defValue, getter, setter, content) + .controller(o -> BooleanControllerBuilder.create(o).coloured(true).formatValue(formatter)) + .build(); + } + + public Option getFloatOptionAsSlider(String optionId, float min, float max, float step, float defValue, Supplier getter, Consumer setter, SimpleContent content) { + return this.getOption(optionId, defValue, getter, setter, content) + .controller(o -> FloatSliderControllerBuilder.create(o).range(min, max).step(step)) + .build(); + } + + public Option getBooleanOption(String optionId, boolean defValue, Supplier getter, Consumer setter, ValueFormatter formatter) { + return this.getOption(optionId, defValue, getter, setter, SimpleContent.NONE) + .controller(o -> BooleanControllerBuilder.create(o).coloured(true).formatValue(formatter)) + .build(); + } + + public Option getFloatOptionAsSlider(String optionId, float min, float max, float step, float defValue, Supplier getter, Consumer setter) { + return this.getOption(optionId, defValue, getter, setter, SimpleContent.NONE) + .controller(o -> FloatSliderControllerBuilder.create(o).range(min, max).step(step)) + .build(); + } + + private Option.Builder getOption(String optionId, C defValue, Supplier getter, Consumer setter, SimpleContent content) { + String optionKey = ModMenuUtils.getOptionKey(this.groupId, optionId); + String optionDescription = ModMenuUtils.getDescriptionKey(optionKey); + + Builder descriptionBuilder = OptionDescription.createBuilder().text(Text.translatable(optionDescription)); + if (content == SimpleContent.IMAGE) { + descriptionBuilder.image(ModMenuUtils.getContentId(content, optionId), 600, 600); + } + if (content == SimpleContent.WEBP) { + descriptionBuilder.webpImage(ModMenuUtils.getContentId(content, optionId)); + } + + return Option.createBuilder() + .name(Text.translatable(optionKey)) + .description(descriptionBuilder.build()) + .binding(defValue, getter, setter); + } + + public Option[] collect(Option... options) { + return options; + } + + public Option getIf(Option option, BooleanSupplier condition) { + if (condition.getAsBoolean()) { + return option; + } + return null; + } +} diff --git a/src/main/java/net/lopymine/mossy/utils/ModMenuUtils.java b/src/main/java/net/lopymine/mossy/utils/ModMenuUtils.java new file mode 100644 index 0000000..d9b203e --- /dev/null +++ b/src/main/java/net/lopymine/mossy/utils/ModMenuUtils.java @@ -0,0 +1,29 @@ +package net.lopymine.mossy.utils; + +import net.minecraft.util.Identifier; + +import net.lopymine.mossy.Mossy; +import net.lopymine.mossy.modmenu.yacl.simple.SimpleContent; + +public class ModMenuUtils { + + private ModMenuUtils() { + throw new IllegalStateException("Utility class"); + } + + public static String getGroupTitleKey(String groupId) { + return String.format("%s.modmenu.%s", Mossy.MOD_ID, groupId); + } + + public static String getOptionKey(String groupId, String optionId) { + return String.format("%s.modmenu.%s.option.%s", Mossy.MOD_ID, groupId, optionId); + } + + public static String getDescriptionKey(String key) { + return key + ".description"; + } + + public static Identifier getContentId(SimpleContent content, String optionId) { + return Mossy.id(String.format("textures/config/%s/%s.%s", content.getFolder(), optionId, content.getFileExtension())); + } +} diff --git a/src/main/resources/assets/mossy/lang/en_us.json b/src/main/resources/assets/mossy/lang/en_us.json new file mode 100644 index 0000000..8a8145e --- /dev/null +++ b/src/main/resources/assets/mossy/lang/en_us.json @@ -0,0 +1,14 @@ +{ + "modmenu.descriptionTranslation.mossy": "Template Fabric mod with some additional tweaks for my projects.", + + "mossy.modmenu.title": "§lMossy Client-side Configuration", + "mossy.modmenu.no_config_library_screen.message": "You need to install §6§lYet Another Config Lib [YACL]§f to open Mossy Client Configuration Screen\n\n§a§lOpen §6§lYACL §a§lModrinth page?", + + "mossy.modmenu.mossy_group": "§lMossy Group", + "mossy.modmenu.mossy_group.description": "Example Mossy Group Description.", + "mossy.modmenu.mossy_group.option.mossy_option": "Mossy Option", + "mossy.modmenu.mossy_group.option.mossy_option.description": "Example Mossy Option Description. ", + + "mossy.modmenu.formatter.enable_or_disable.true": "Enabled", + "mossy.modmenu.formatter.enable_or_disable.false": "Disabled" +} \ No newline at end of file diff --git a/src/main/resources/assets/mossy/lang/ru_ru.json b/src/main/resources/assets/mossy/lang/ru_ru.json new file mode 100644 index 0000000..0057a87 --- /dev/null +++ b/src/main/resources/assets/mossy/lang/ru_ru.json @@ -0,0 +1,14 @@ +{ + "modmenu.descriptionTranslation.mossy": "Шаблонный Fabric мод с несколькими дополнительными фишками для моих проектов.", + + "mossy.modmenu.title": "§lКлиенские настройки Mossy мода", + "mossy.modmenu.no_config_library_screen.message": "Вам нужно установить §6§lYet Another Config Lib [YACL]§f, чтобы открыть экран настроек Mossy клиента\n\n§a§lОткрыть страницу §6§lYACL §a§lна Modrinth?", + + "mossy.modmenu.mossy_group": "§lМшистый", + "mossy.modmenu.mossy_group.description": "Пример мшистого описания группы.", + "mossy.modmenu.mossy_group.option.mossy_option": "Мох", + "mossy.modmenu.mossy_group.option.mossy_option.description": "Пример мшистого описания опции.", + + "mossy.modmenu.formatter.enable_or_disable.true": "Включено", + "mossy.modmenu.formatter.enable_or_disable.false": "Отключено" +} \ No newline at end of file diff --git a/src/main/resources/assets/mossy/textures/config/image/mossy_option.png b/src/main/resources/assets/mossy/textures/config/image/mossy_option.png new file mode 100644 index 0000000..332313c Binary files /dev/null and b/src/main/resources/assets/mossy/textures/config/image/mossy_option.png differ diff --git a/src/main/resources/aws/1.20.1.accesswidener b/src/main/resources/aws/1.20.1.accesswidener new file mode 100644 index 0000000..0958812 --- /dev/null +++ b/src/main/resources/aws/1.20.1.accesswidener @@ -0,0 +1,2 @@ +accessWidener v2 named +# 1.20.1 AW \ No newline at end of file diff --git a/src/main/resources/aws/1.20.6.accesswidener b/src/main/resources/aws/1.20.6.accesswidener new file mode 100644 index 0000000..9ceec9c --- /dev/null +++ b/src/main/resources/aws/1.20.6.accesswidener @@ -0,0 +1,2 @@ +accessWidener v2 named +# 1.20.6 AW diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..c6f85cb --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,38 @@ +{ + "schemaVersion": 1, + "id": "${mod_id}", + "version": "${version}", + "name": "${mod_name}", + "description": "${mod_description}", + "authors": [ + "${mod_authors}" + ], + "contact": { + "homepage": "https://modrinth.com/mod/${mod_id}", + "issues": "https://github.com/LopyMine/${mod_id}" + }, + "license": "${mod_license}", + "icon": "icon/icon.png", + "environment": "*", + "entrypoints": { + "main": [ + "net.lopymine.mossy.Mossy" + ], + "client": [ + "net.lopymine.mossy.client.MossyClient" + ], + "modmenu": [ + "net.lopymine.mossy.modmenu.ModMenuIntegration" + ] + }, + "depends": { + "fabricloader": ">=${fabric_loader}", + "minecraft": ">=${minecraft}", + "java": ">=${java}", + "fabric-api": ">=${fabric_api}" + }, + "accessWidener": "aws/${minecraft}.accesswidener", + "mixins": [ + "mixins/${minecraft}-${mod_id}.mixins.json" + ] +} \ No newline at end of file diff --git a/src/main/resources/icon/icon.png b/src/main/resources/icon/icon.png new file mode 100644 index 0000000..b4a00a9 Binary files /dev/null and b/src/main/resources/icon/icon.png differ diff --git a/src/main/resources/mixins/1.20.1-mossy.mixins.json5 b/src/main/resources/mixins/1.20.1-mossy.mixins.json5 new file mode 100644 index 0000000..d77426e --- /dev/null +++ b/src/main/resources/mixins/1.20.1-mossy.mixins.json5 @@ -0,0 +1,15 @@ +{ + "required": true, + "package": "net.lopymine.mossy.mixin", + "refmap": "mossy.refmap.json", + "compatibilityLevel": "JAVA_17", + "mixins": [ + + ], + "client": [ + "ExampleMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/mixins/1.20.6-mossy.mixins.json5 b/src/main/resources/mixins/1.20.6-mossy.mixins.json5 new file mode 100644 index 0000000..217952f --- /dev/null +++ b/src/main/resources/mixins/1.20.6-mossy.mixins.json5 @@ -0,0 +1,15 @@ +{ + "required": true, + "package": "net.lopymine.mossy.mixin", + "refmap": "mossy.refmap.json", + "compatibilityLevel": "JAVA_17", + "mixins": [ + + ], + "client": [ + + ], + "injectors": { + "defaultRequire": 1 + } +} \ No newline at end of file diff --git a/stonecutter.gradle b/stonecutter.gradle new file mode 100644 index 0000000..8be1b68 --- /dev/null +++ b/stonecutter.gradle @@ -0,0 +1,9 @@ +plugins { + id "dev.kikugie.stonecutter" +} +stonecutter.active "1.20.6" /* [SC] DO NOT EDIT */ + +stonecutter.registerChiseled tasks.register("chiseledBuild", stonecutter.chiseled) { + setGroup "project" + ofTask "build" +} diff --git a/versions/1.20.1/gradle.properties b/versions/1.20.1/gradle.properties new file mode 100644 index 0000000..f83ebf3 --- /dev/null +++ b/versions/1.20.1/gradle.properties @@ -0,0 +1,15 @@ +# Versioned Properties + +# Java Properties +build.java=17 + +# Fabric Properties, check https://fabricmc.net/develop/ +build.yarn=1.20.1+build.10 +build.fabric_loader=0.15.11 +build.fabric_api=0.92.2+1.20.1 + +# Additional Dependencies Properties +# modmenu, check https://modrinth.com/mod/modmenu/versions?g=1.20.1 +dep.modmenu=7.2.2 +# yacl, check https://modrinth.com/mod/yacl/versions?g=1.20.1 +dep.yacl=3.5.0+1.20.1-fabric diff --git a/versions/1.20.6/gradle.properties b/versions/1.20.6/gradle.properties new file mode 100644 index 0000000..a29971c --- /dev/null +++ b/versions/1.20.6/gradle.properties @@ -0,0 +1,15 @@ +# Versioned Properties + +# Java Properties +build.java=21 + +# Fabric Properties, check https://fabricmc.net/develop/ +build.yarn=1.20.6+build.3 +build.fabric_loader=0.15.11 +build.fabric_api=0.100.0+1.20.6 + +# Additional Dependencies Properties +# modmenu, check https://modrinth.com/mod/modmenu/versions?g=1.20.6 +dep.modmenu=10.0.0-beta.1 +# yacl, check https://modrinth.com/mod/yacl/versions?g=1.20.6 +dep.yacl=3.5.0+1.20.6-fabric