Skip to content
Tslat edited this page Mar 24, 2023 · 4 revisions

Developer Usage

Setup

First we'll need to add in the maven repo and dependency to the build.gradle file

Repository

repositories {
	maven {
		name = "TslatEffectsLib (TEL) Maven Repo"
		url = "https://dl.cloudsmith.io/public/tslat/tel/maven/"
	}
}

Dependency

Then add in the dependency to your dependencies block: Forge:

dependencies {
	implementation fg.deobf("net.tslat.effectslib:TslatEffectsLib-forge-${project.minecraft_version}:${project.tel_version}")
	// Example: implementation fg.deobf("net.tslat.effectslib:TslatEffectsLib-forge-1.19.3:1.5")
}

Fabric/Quilt:

dependencies {
	modImplementation "net.tslat.effectslib:TslatEffectsLib-fabric-${project.minecraft_version}:${project.tel_version}"
	// Example: modImplementation "net.tslat.effectslib:TslatEffectsLib-fabric-1.19.3:1.5"
}

Mixin Plugin markers

You'll need to add plugin marker support to your settings.gradle file so that MixinGradle can function properly:

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (requested.id.toString() == 'org.spongepowered.mixin') {
                useModule("org.spongepowered:mixingradle:${requested.version}")
            }
        }
    }
}

Forge Mixin Support

TEL uses mixins to run, and if you're on Forge you will need to include mixin support for it to run in your IDE

// Include the mixin plugin in your plugins block at the top of your build.gradle
plugins {
	id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
}

// Then add the refmap properties to your run configurations
runs {
	client {
		// Other existing lines here
		property 'mixin.env.remapRefMap', 'true'
		property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
	}

	server {
		// Other existing lines here
		property 'mixin.env.remapRefMap', 'true'
		property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
	}
}

// Then add the annotations processor to your dependencies
dependencies {
	// Other dependencies here

    if (System.getProperty("idea.sync.active") != "true") {
        annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
    }
}

Then refresh your gradle project and regen your run configurations, and you're good to go!

Usage

Almost all of the files useful to you as a mod developer will be found in the api package.

Of particular note is the ExtendedMobEffect class, which is what you would make your effects extend instead of the vanilla MobEffect, for most of TEL to work

Clone this wiki locally