Skip to content

DontTouchMyHentai/RoughlyEnoughIDs

 
 

Repository files navigation

Roughly Enough IDs

Modrinth: Roughly Enough IDs CurseForge: Roughly Enough IDs

RoughlyEnoughIDs logo

Building

  1. Clone this repository via
  • SSH git clone git@github.com:TerraFirmaCraft-The-Final-Frontier/RoughlyEnoughIDs.git or
  • HTTPS git clone https://github.com/TerraFirmaCraft-The-Final-Frontier/RoughlyEnoughIDs.git
  1. Build using the gradlew build command. 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

API

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/compat package.

See the javadocs for each api service for more details.

Usage example

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.

About

Fork of JustEnoughIDs. Minecraft 1.13+ chunk format in 1.12.2, removing the block, item, & biome ID limits.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%