HomeJavaModsRatatouille
Ratatouille
Ratatouille — screenshot 1

Ratatouille

A library for doctor4t's mods and supporter cosmetics

Features

Library

Additional Goodies

Supporter Cosmetics

Gallery

Expand gallery

Plushies Cosmetics screen

Documentation

Expand documentation

Setup (build.gradle)

Expand Gradle details
repositories {
    maven {
        name = 'Ladysnake Mods'
        url = 'https://maven.ladysnake.org/releases'
}

dependencies {
    modImplementation "dev.doctor4t:ratatouille:${project.ratatouille_version}"
}

Custom model armor util

Expand Custom model armor util details

This util allows you to easily register new armor sets that use a custom model with a single method call (and that custom model as the game does need to know what you wish to render).

Step 1: Defining the model

Before we can add our custom armor, we need a model that respects a few rules. You can find an armor template model (Blockbench model file) and texture in the RESOURCES folder of the repository. While you can edit this model and texture freely in order to shape up the armor of your dreams, please note that the existing groups are very important and while you can add new sub-groups to them, you cannot and should not delete any existing group as they allow the library to know what should be displayed when a player (or armor stand or mob) dons armor pieces:

Once you have finalized your model, you can export it with Blockbench: File -> Export -> Export Java Entity. Open the generated Java class and copy the lines between ModelPartData modelPartData = modelData.getRoot(); and the line right before the return (included) in getTexturedModelData(). Ratatouille adds a new model class type that simplifies armor model definition called CustomArmorModelDefinition; extend that class and implement the addModelParts method by pasting the snippet you copied from the generated model class. Then implement getTexture(); the simplest way to do so is to have a static Identifier for your armor texture in your Model Definition class and return that, but if you wish to do a special logic that varies the returned texture you can naturally do so as well.

Step 2: Registering the custom armor with Ratatouille

The second - and last - step is to register your custom armor rendering in your client initialization. Call CustomModelArmorUtil.registerCustomArmor and give it the required parameters:

Registering your armor through this method call will take care of everything for you, like creating the textured model data, model layer and appending the feature to the player / armor stand / mob renderers. If you need to access the model data or model layer of the armor, you can find them in the CustomModelArmorUtil.CUSTOM_ARMOR_MODELS HashMap by using the armor's displayConditions as the key.

Ambience util

Expand Ambience util details This util allows you to easily register ambient loops as general background audio or block entity dependant audio.

Registering background ambience

To register a background ambience, all you need to do is call the AmbienceUtil.registerBackgroundAmbience method in your client initializer class and give it a new BackgroundAmbience object with the required parameters:

Registering Block entity ambience

To register a block entity ambience, all you need to do is call the AmbienceUtil.registerBlockEntityAmbience method in your client initializer class and give it the BlockEntityType<? extends BlockEntity> that should play said ambience and a new BlockEntityAmbience object with the required parameters:

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more