GithubHelp home page GithubHelp logo

btw-gradle-fabric-example's Introduction

BTW-gradle-fabric-example

This repository is based on the BTW-Gradle and the Example Mod repositories, combining them to enable fabric development for the Better Than Wolves mod. This repository was only tested for client-side development yet.

Quick Start

  • Clone this repository
  • Acquire the full BTW sources and put them under src/btw/java
  • (Optional) Put the BTW resources (textures, etc.) under src/btw/resources
  • Run the gradle task btwJar
  • Run the gradle task build and then runClient
  • (Optional) Put the vanilla MC resources (sounds) under run/resources

BTW Source Code

To get access to the Better Than Wolves source code, please refer to the BTW-Gradle repository or (alternatively) the BTW-Public repository, which also offers a way to generate the sources.

Development

Similar to the BTW-Gradle project, this repository comes with a few configuration files for IntelliJ IDEA.

In this repository, there is an example implementation of a fabric mod that is a BTW-Addon at the same time. Base class overwrites, either for initializing your BTW-Addon or for changes to the functionality of MC are in many cases not needed anymore. (But they are still possible, put the overwriting-sources under main/java/net/minecraft/src. This requires your mod to be loaded as a coremod, which is currently not supported in a dev-environment - only in production.) The addon initialization is taken care of by the PreLaunchInitializer.

For functionality changes to base classes, please have a look at mixins, which enable you to inject code at runtime, offering much better compatibility. Most fabric-mixin tutorials should apply here, but keep in mind that no fabric-api is available yet, just bare mixins. An even more powerful alternative is fabric-asm, but this has not been tested yet.

If you use reflection, please keep in mind that it is now, in many cases at least, not needed anymore, in addition to the fact that fabric remaps Minecraft at runtime into an intermediary form, which is different from the obfuscated one. To get the intermediary names of classes, fields, and methods, have a look at the mappings under custom_mappings.

Releasing Mods/Addons

If you want to run fabric mods with BTW in a non-dev environment, you have to either use the BTW-fabric MultiMC instance (recommended) or follow the installation instructions for the Vanilla launcher.

Drop on by the discord server if you need help: BTW Discord.

The mod file for the release is generated by the Gradle task remapJar and then put into release.

After successfully importing the MultiMC instance, you can put your mod file into the mods folder of your installation. If it is a coremod, put it into coremods.

Issues & Troubleshooting

More troubleshooting is still todo. Feel free to message me on Discord.

MultiMC Remarks

  • The MultiMC instance should support most BTW versions and their addons, install them normally via Add to Minecraft.jar.
  • Addons developed outside of the fabric environment that use Java reflection might not work if they reference obfuscated names via Strings (as mentioned above). Porting those addons is a simple process though, as only the new intermediary names have to be adopted.

License

This project incorporates:

btw-gradle-fabric-example's People

Contributors

arminias avatar abbyread avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.