Skip to content

Commit 37e7e75

Browse files
committed
First commit of 2.0 code
1 parent a0c9eda commit 37e7e75

File tree

139 files changed

+8814
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+8814
-0
lines changed

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directories
5+
**/build/
6+
!src/**/build/
7+
8+
# (Screws up the MC dev plugin for Older IntelliJ Versions)
9+
src/btw/**
10+
11+
# Ignore local Minecraft folder
12+
.minecraft
13+
14+
# IntelliJ
15+
*.iml
16+
.idea/workspace.xml
17+
.idea/tasks.xml
18+
.idea/gradle.xml
19+
.idea/assetWizardSettings.xml
20+
.idea/dictionaries
21+
.idea/libraries
22+
.idea/jarRepositories.xml
23+
24+
**/run/

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries-with-intellij-classes.xml

+65
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Minecraft_Client.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Minecraft_Server.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/uiDesigner.xml

+124
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# BTW-gradle-fabric-example
2+
3+
This repository is based on the [BTW-Gradle](https://github.com/BTW-Community/BTW-gradle) and the [Example Mod](https://github.com/minecraft-cursed-legacy/Example-Mod)
4+
repositories, combining them to enable fabric development for the Better Than Wolves mod.
5+
**This repository was only tested for client-side development yet.**
6+
7+
## Quick Start
8+
9+
* Clone this repository
10+
* Acquire the full BTW sources and put them under `src/btw/java`
11+
* (Optional) Put the BTW resources (textures, etc.) under `src/btw/resources`
12+
* Run the gradle task *btwJar*
13+
* Run the gradle task *build* and then *runClient*
14+
* (Optional) Put the vanilla MC resources (sounds) under `run/resources`
15+
16+
## BTW Source Code
17+
18+
To get access to the Better Than Wolves source code, please refer to the [BTW-Gradle repository](https://github.com/BTW-Community/BTW-gradle)
19+
or (alternatively) the [BTW-Public repository](https://github.com/BTW-Community/BTW-Public), which also offers a way to generate the sources.
20+
21+
## Development
22+
23+
Similar to the [BTW-Gradle](https://github.com/BTW-Community/BTW-gradle) project, this repository comes with a few configuration files for IntelliJ IDEA.
24+
25+
In this repository, there is an example implementation of a fabric mod that is a BTW-Addon at the same time. Base class overwrites,
26+
either for initializing your BTW-Addon or for changes to the functionality of MC are in many cases not needed
27+
anymore. (But they are still possible, put the overwriting-sources under `main/java/net/minecraft/src`.
28+
This requires your mod to be loaded as a coremod, which is currently not supported in a dev-environment - only in production.) The
29+
addon initialization is taken care of by the PreLaunchInitializer.
30+
31+
For functionality changes to base classes, please have a look at mixins, which enable you
32+
to inject code at runtime, offering much better compatibility. Most fabric-mixin tutorials should apply here, but keep in
33+
mind that no fabric-api is available yet, just bare mixins. An even more powerful alternative is fabric-asm, but this has not
34+
been tested yet.
35+
36+
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
37+
remaps Minecraft at runtime into an intermediary form, which is different from the obfuscated one. To get the intermediary names
38+
of classes, fields, and methods, have a look at the mappings under `custom_mappings`.
39+
40+
## Releasing Mods/Addons
41+
42+
If you want to run fabric mods with BTW in a non-dev environment, you have to either use
43+
the [BTW-fabric MultiMC instance](https://github.com/BTW-Community/cursed-fabric-loader/releases/latest) (recommended) or
44+
follow the [installation instructions for the Vanilla launcher](https://github.com/BTW-Community/legacy-fabric-installer/releases/latest).
45+
46+
47+
Drop on by the discord server if you need help: [BTW Discord](https://discord.gg/fhMK5kx).
48+
49+
The mod file for the release is generated by the Gradle task *remapJar* and then put into `release`.
50+
51+
After successfully importing the MultiMC instance, you can put your mod file into the mods folder of your installation.
52+
If it is a coremod, put it into coremods.
53+
54+
## Issues & Troubleshooting
55+
56+
* How do I obtain the BTW-sources? *Please refer to [BTW-Gradle](https://github.com/BTW-Community/BTW-gradle) or [BTW-Public](https://github.com/BTW-Community/BTW-Public).*
57+
58+
More troubleshooting is still todo. Feel free to message me on Discord.
59+
60+
## MultiMC Remarks
61+
* The MultiMC instance should support most BTW versions and their addons, install them normally via `Add to Minecraft.jar`.
62+
* Addons developed outside of the fabric environment that use
63+
Java reflection might not work if they reference obfuscated names via Strings (as mentioned above).
64+
Porting those addons is a simple process though, as only the new intermediary names have to be adopted.
65+
66+
## License
67+
This project incorporates:
68+
* A modified version of [Fabric Loom](https://github.com/FabricMC/fabric-loom) (MIT)
69+
* A precompiled version of [Tiny Remapper](https://github.com/FabricMC/tiny-remapper) (LGPL-3.0)

0 commit comments

Comments
 (0)