generated from Fabricators-of-Create/create-multiloader-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
- Loading branch information
Showing
1 changed file
with
38 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,50 @@ | ||
# Create Multi-Loader Addon Template | ||
A template based on Architectury for creating addons for Create on Forge, Fabric, and Quilt, simultaneously. | ||
# Create cobblestone | ||
|
||
## How does it work? | ||
This template is powered by the [Architectury](https://github.com/architectury) toolchain. | ||
Architectury allows developers to create the majority of their mod in common, loader-agnostic code that | ||
only touches Minecraft itself. This can be found in the [common](common) subproject. Each loader target | ||
also has its own subproject: those being [forge](forge) and [fabric](fabric). (Quilt support: you | ||
shouldn't need anything special and the Fabric version should work fine, but it is possible to add a | ||
`quilt` subproject if needed.) These loader-specific projects bridge between their respective loaders | ||
and the common code. | ||
Create cobblestone is a create mod addon that focusses on reducing the lag generated by cobblestone generators. Ideal for server wanting to keep the tps above 10 without buying a very expensive server. The mod does not only add cobblestone generators, but also stone generators, basalt generators, limestone generators and scoria generators. | ||
|
||
This system can be extended to work with Create as well as plain Minecraft. The common project gives | ||
access to most of Create, Registrate, and Flywheel. | ||
## Download | ||
[Modrinth](https://modrinth.com/mod/create-cobblestone) | ||
[Curseforge](https://www.curseforge.com/minecraft/mc-mods/create-cobblestone) | ||
|
||
## Limitations | ||
Minecraft has a lot of differences across loaders. You'll need to manage these differences using | ||
abstractions. Architectury does provide an [API](https://github.com/architectury/architectury-api) | ||
which you may use if desired, but it means you have another dependency to worry about. | ||
## Crafting | ||
### Cobblestone generator | ||
![https://cdn.modrinth.com/data/ihpnEd80/images/98fa6466b29eb5024ea642319d28c68719ac6c7f.png](https://cdn.modrinth.com/data/ihpnEd80/images/98fa6466b29eb5024ea642319d28c68719ac6c7f.png) | ||
|
||
This also applies to Create, which underwent significant changes in porting to Fabric. This means a lot | ||
of it will be different between loaders. The `common` project is only capable of referencing the code | ||
on one loader (Fabric in this template), so you should be careful to not reference things that don't | ||
exist on the other one. Test often, and check the code on both loaders. When you do need to use these | ||
changed things, that leads us to... | ||
### Generator types | ||
The included generator types in the mod are: | ||
- Cobblestone | ||
- Stone | ||
- Basalt | ||
- Limestone | ||
- Scoria | ||
|
||
## Solutions | ||
There's a bunch of ways to work around the differences. | ||
The [deepslate generators datapack](https://modrinth.com/datapack/create-cobblestone-deepslate-generators) adds the following generators: | ||
- Deepslate | ||
- Cobbled deepslate | ||
|
||
First is Architectury API. It provides cross-loader abstractions that can be used in common code for | ||
a decent amount of Minecraft. However, it means you need to worry about another dependency. It also | ||
doesn't really help with Create. | ||
All the generators above can be enabled and disabled using the config. Disabling a generator while it is being used in the world will replace the generator with an empty one. | ||
|
||
Next is the `@ExpectPlatform` annotation. It allows the implementation of a method to be replaced | ||
at compile time per-loader, letting you make your own abstractions. It is part of the Architectury | ||
plugin and does not cause an extra dependency. However, it can only be placed on static methods. See | ||
[ExampleExpectPlatform](common/src/main/java/net/createcobblestone/ExampleExpectPlatform.java) in common | ||
for an example. | ||
## Stress Units to cobblestone ratio | ||
The amount of cobblestone per tick is scaled with the rpm, and the rpm is scaled with stress units. With the default configuration each 8 rpm gives one additional cobblestone per tick, and each rpm increases the stress with 8. In other words: one piece of cobblestone/tick costs 64SU. | ||
![8 rpm = 1 cobblestone/tick = 64 SU](https://cdn.modrinth.com/data/ihpnEd80/images/0c623573f25a99f5174a479514ff925d19738073.png) | ||
|
||
Finally, simply have a common interface with implementation based on the loader. You might have a | ||
`PlatformHelper` common interface, with a static instance somewhere. On Fabric, set it to a | ||
`FabricPlatformHelper`, and a `ForgePlatformHelper` on Forge. The implementation is kept as a detail | ||
so you can use your helper from common code. | ||
## Config | ||
### rates | ||
The stress per rpm and the rpm per cobblestone per tick are configurable. | ||
![https://cdn.modrinth.com/data/ihpnEd80/images/bf91b89821370226ebeb5894b755e7f9a1f97ace.png](https://cdn.modrinth.com/data/ihpnEd80/images/bf91b89821370226ebeb5894b755e7f9a1f97ace.png) | ||
### Generator types | ||
The generator types are also configurable. By default are all enabled, except for deepslate and cobbled deepslate. Those generator types also require a datapack to be installed. | ||
![https://cdn.modrinth.com/data/ihpnEd80/images/6fcd51448bd9df885a6428a22fd7999026556cb7.png](https://cdn.modrinth.com/data/ihpnEd80/images/6fcd51448bd9df885a6428a22fd7999026556cb7.png) | ||
|
||
## Features | ||
- Access to Create and all of its dependencies on both loaders | ||
- Mojang Mappings base, with Quilt Mappings and Parchment providing Javadoc and parameters | ||
- VineFlower decompiler for high quality Minecraft sources: `gradlew genSourcesWithVineflower` | ||
- GitHub Actions automatic build workflow | ||
- Machete Gradle plugin to shrink jar file sizes | ||
- Developer QOL: Mod Menu, LazyDFU, JEI | ||
## Custom generators | ||
Custom generators can be added by installing a datapack. For an example pack check out the [deepslate generators datapack](https://modrinth.com/datapack/create-cobblestone-deepslate-generators). | ||
|
||
## Use | ||
Ready to get started? First you'll want to create a new repository using this template. You can do it | ||
through GitHub with the big green button near the top that says `Use this template`. | ||
## Example usage | ||
### Minimal | ||
![Minimal example](https://cdn.modrinth.com/data/ihpnEd80/images/27c5c58c6673c8d46ad795858555eb6c61111962.png) | ||
|
||
Once you've got your repository set up, you'll want to change all the branding to your mod instead | ||
of the template. Every `examplemod`, every placeholder. | ||
### Extended drawers: | ||
![Extended drawers example](https://cdn.modrinth.com/data/ihpnEd80/images/fa56da691ea4b4d751673104748f16f8eb75de7a.png) | ||
|
||
You're free to change your license: CC0 lets you do whatever you want. Base Create is MIT, for reference. | ||
|
||
Replace this README with information about your addon. Give it an icon and change the metadata in the | ||
[fabric.mod.json](fabric/src/main/resources/fabric.mod.json) and the | ||
[mods.toml](forge/src/main/resources/META-INF/mods.toml). | ||
|
||
Configure your dependencies. Each subproject `build.gradle` has optional dependencies commented. | ||
Either remove them or uncomment them. For Fabric, set your preferred recipe viewer with | ||
`fabric_recipe_viewer` in the root [gradle.properties](gradle.properties). | ||
|
||
Remember to remove any example code you don't need anymore. | ||
|
||
Get modding! | ||
|
||
## Notes | ||
- Architectury does not merge jars; When you build, you get separate jars for each loader. | ||
There is an independent project that can merge these into one if desired called | ||
[Forgix](https://github.com/PacifistMC/Forgix). | ||
- The file names and versions of jars are configured in the root [build.gradle](build.gradle). Feel | ||
free to change the format if desired, but make sure it follows SemVer to work well on Fabric. | ||
- When publishing, you should always let GitHub Actions build your release jars. These builds will | ||
have build number metadata, and will be compressed by the Machete plugin. | ||
|
||
## Other Templates | ||
- [Fabric-only template](https://github.com/Fabricators-of-Create/create-fabric-addon-template) | ||
- [Forge-only template](https://github.com/kotakotik22/CreateAddonTemplate) | ||
|
||
## Help | ||
Questions? Join us in the #devchat channel of the [Create Discord](https://discord.com/invite/hmaD7Se). | ||
|
||
## License | ||
|
||
This template is available under the CC0 license. Feel free to do as you wish with it. | ||
## Balancing | ||
Do note that this mod makes it far more easy to generate cobblestone. If you feel its unbalanced, change the recipe for the cobblestone generator to something more difficult using a datapack or cubejs. Or change the config to make the generators generate less cobblestone. |