Add a fire ward necklace that makes the player invulnerable to fire #18

Merged
BlakeRain merged 4 commits from BlakeRain/utamacraft:main into main 2023-12-02 01:05:55 +00:00
3 changed files with 47 additions and 0 deletions
Showing only changes of commit e9aabbe0b4 - Show all commits

View File

@ -3,6 +3,7 @@ plugins {
id 'maven-publish' id 'maven-publish'
id 'net.minecraftforge.gradle' version '6.0.+' id 'net.minecraftforge.gradle' version '6.0.+'
id 'org.parchmentmc.librarian.forgegradle' version '1.+' id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id 'org.spongepowered.mixin' version '0.7.+'
} }
wrapper { wrapper {
@ -151,6 +152,8 @@ dependencies {
// The userdev artifact is a special name and will get all sorts of transformations applied to it. // The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
// compile against the JEI API but do not include it at runtime // compile against the JEI API but do not include it at runtime
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")) compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")) compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}"))
@ -164,6 +167,15 @@ dependencies {
runtimeOnly(fg.deobf("mekanism:Mekanism:${minecraft_version}-${mekanism_version}")) runtimeOnly(fg.deobf("mekanism:Mekanism:${minecraft_version}-${mekanism_version}"))
} }
mixin {
// MixinGradle Settings
add sourceSets.main, "mixins.${mod_id}.refmap.json"
config "mixins.${mod_id}.json"
debug.verbose = true
debug.export = true
}
// This task will expand all declared properties from Gradle (gradle.properties) in the specified resource targets. // This task will expand all declared properties from Gradle (gradle.properties) in the specified resource targets.
// Properties are expanded using `${}` Groovy notation. // Properties are expanded using `${}` Groovy notation.
tasks.named('processResources', ProcessResources).configure { tasks.named('processResources', ProcessResources).configure {

View File

@ -0,0 +1,20 @@
package net.banutama.utamacraft.mixin;
import com.mojang.logging.LogUtils;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(Entity.class)
public class EntityMixin {
@Inject(at = @At("HEAD"), method = "isInvulnerableTo", cancellable = true)
private void checkInvulnerabilities(DamageSource source, CallbackInfoReturnable<Boolean> cir) {
LogUtils.getLogger().info("DamageSource is fire");
if (source.isFire()) {
LogUtils.getLogger().info("DamageSource is fire");
}
}
}

View File

@ -0,0 +1,15 @@
{
"required": true,
"minVersion": "0.8",
"package": "net.banutama.utamacraft.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"EntityMixin"
],
"client": [
],
"injectors": {
"defaultRequire": 1
},
"refmap": "utamacraft.refmap.json"
}