- Clone this repository via
- SSH
git clone git@github.com:TerraFirmaCraft-The-Final-Frontier/RoughlyEnoughIDs.gitor - HTTPS
git clone https://github.com/TerraFirmaCraft-The-Final-Frontier/RoughlyEnoughIDs.git
- Build using the
gradlew buildcommand. Jar will be in build/libs
Gradle for this project requires Java 25 or higher!
Running on:
- Gradle 9.2.1
- RetroFuturaGradle 2.0.2
- Forge 14.23.5.2847
Since v2.3.0, this mod provides an API to allow mod authors to add REID compatibility. Generally, most mods will already be supported out of the box - this API is for certain elements of mods that require explicit support, either from REID's side through mixins, or from the mod's side. The API currently provides:
BiomeApi: Reading/writing biome ids in REID format. Any mod with mechanics that manually change biomes in a chunk should use this.- Various classes for compatibility: see
api/compatpackage.
See the javadocs for each api service for more details.
Before the API existed, some mods added compatibility for JEID/REID's extended biomes like so:
public static void setBiome(World world, BlockPos pos, int id) {
Chunk chunk = world.getChunk(pos);
int i = ((pos.getZ() & 15) << 4) | (pos.getX() & 15);
// JEID/REID biome update
if (jeidLoaded && chunk instanceof INewChunk) {
((INewChunk) chunk).getIntBiomeArray()[i] = id;
}
// Vanilla biome update
else {
chunk.getBiomeArray()[i] = (byte) id;
}
}(See an example here by Bewitchment).
The BiomeApi seeks to simplify this usage; now all you would need to update the biome in REID format is:
public static void setBiome(World world, BlockPos pos, int id) {
Chunk chunk = world.getChunk(pos);
// REID biome update
if (reidApiLoaded) {
BiomeApi.INSTANCE.updateBiome(chunk, pos, id);
}
// Vanilla biome update
else {
// The index is only needed for vanilla now!
int i = ((pos.getZ() & 15) << 4) | (pos.getX() & 15);
chunk.getBiomeArray()[i] = (byte) id;
}
}This could also allow future versions of REID to change its biome format without breaking your compatibility code.
