paperclone22 / Nomad-Books-Redux

A Minecraft Fabric mod introducing books containing encampments for immediate deployment, for players that are always on the go.
GNU General Public License v3.0
4 stars 0 forks source link

Support multiple versions #7

Open paperclone22 opened 2 months ago

paperclone22 commented 2 months ago

Support popular game versions, similarly to how Distant Horizons does (track the save minor versions).

Start by moving common (core) logic into a common directory. Note that DH has a properties file for each minecraft version. Note DH also has directories for common/fabric/neoforge, but not for minecraft versions eg 1.xx.x.

paperclone22 commented 2 months ago

look into access wideners (in DH common resources)

paperclone22 commented 3 weeks ago

Looks like DH uses a modified version of Jareds Multiloader

This would be the best place for me to start:

  1. [x] Pull the repo.
  2. [x] Build it empty.
  3. [x] Check that it works for all platforms & versions. (Fabric & NeoForge)
    1. [x] Fabric works after tweaking fabric.mod.json > .depends.minecraft:1.21 to .depends.minecraft:["1.21","1.21.1"] ⭐ ⭐ ⭐ I referenced DH for this. They use property named compatible_minecraft_versions for this
    2. [x] Neoforge works no problem
  4. [ ] Then try to add my mod.
paperclone22 commented 3 weeks ago

Other References:


paperclone22 commented 2 weeks ago

Looks like Multiloader is setup for multi-platform/loader, but not explicitly multi-version.

DH uses (from what I can tell) Access Wideners to support multiple versions

paperclone22 commented 2 weeks ago

I really don't want to have multiple branches that I need to switch between and support in parallel. Hence the purpose of this Issue thread

paperclone22 commented 2 weeks ago

There's a sentiment floating around that Kotlin is better supported in Intelij. This isn't a high priority but I could consider converting to kotlin eg. build.gradle.kts

paperclone22 commented 2 weeks ago

There's a sentiment floating around that Kotlin is better supported in Intelij. This isn't a high priority but I could consider converting to kotlin eg. build.gradle.kts

I don't want to fool with fabric-language-kotlin right now, but for future reference here's how: Using Kotlin with Fabric [Fabric Wiki]

also here's a handy tool - Convert Groovy to Kotlin Online | Gradle Kotlinize

paperclone22 commented 2 weeks ago

MidnightLib doesn't have a neoforge build.

I should switch to either of these for config:

paperclone22 commented 2 weeks ago

Crafting results with custom nbt/components was added in 1.20.5. If switching to that for all my recipes is significantly less complicated to maintain, then 1.20.5 will become the minimum version supported by this mod.

This will likely need me to create full item types for deployed books as nomad_book_deployed, nether_nomad_book_deployed, creative_nomad_book_deployed since component crafting is only specifiable in the result.

It may also be nice to switch some of the recipes to smithing

paperclone22 commented 2 weeks ago

I'm realizing that the main reason DH is able to get away with only one branch is because the only hook into minecraft it needs is rendering (which is pretty version agnostic). I'm not going to be able to do that with what I'm doing.

I will need a branch for at least every major version ... or just follow the latest

paperclone22 commented 1 week ago

Architecturay could also be an option for multiplatform support.

here's how to get neoforge to work with Yarn Mappings

paperclone22 commented 1 week ago

NeoForge Support

This is the only other platform I care about & Syntra Connector + ForgifiedFabricAPI is all that's needed to support NeoForge

Use (Neo)ForgifiedFabricAPI

ForgifiedFabricAPI info

If you're a Fabric developer looking to bring your mod to NeoForge, yet you don't want to spend precious time rewriting your mod from scratch, the Forgified Fabric API comes to the rescue! Along with our implementation of the Fabric Loader's APIs, you'll be able to keep the vast majority of your code unchanged and still provide a native version of your mod built for NeoForge.

The Forgified Farbic API can be added to your development environment with only a few lines of code, no additional setup required. You can then consume any of the Fabric APIs just like you would on Fabric.

repositories {
    maven {
        url "https://maven.su5ed.dev/releases"
    }
}

dependencies {  
    implementation "org.sinytra.forgified-fabric-api:forgified-fabric-api:FABRIC_API_VERSION"
}