Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can`t use Mixin #2

Open
Artemisia-Elre opened this issue Oct 13, 2024 · 0 comments
Open

Can`t use Mixin #2

Artemisia-Elre opened this issue Oct 13, 2024 · 0 comments

Comments

@Artemisia-Elre
Copy link

Artemisia-Elre commented Oct 13, 2024

I want to make extensions of this mod for my modpack,but when i use mixin to AbstractSpell.class and build. Return Errors

����: Unable to locate obfuscation mapping for @shadow field
@shadow protected int baseManaCost;
^
����: Unable to locate obfuscation mapping for @shadow field
@shadow protected int manaCostPerLevel;
^
����: Unable to locate obfuscation mapping for @shadow method
@shadow public abstract int getLevel(int level, @org.jetbrains.annotations.Nullable LivingEntity caster);
^
����: Unable to locate obfuscation mapping for @overwrite method
public int getManaCost(int level, @nullable LivingEntity caster) {
^

import io.redspace.ironsspellbooks.api.spells.AbstractSpell;
import io.redspace.ironsspellbooks.config.ServerConfigs;
import net.minecraft.world.entity.LivingEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

import javax.annotation.Nullable;

@mixin(AbstractSpell.class)
public abstract class AbstractSpellMixin {
@shadow protected int baseManaCost;

@Shadow protected int manaCostPerLevel;

@Shadow public abstract int getLevel(int level, @org.jetbrains.annotations.Nullable LivingEntity caster);

/**
 * @author
 * @reason
 */
@Overwrite
public int getManaCost(int level, @Nullable LivingEntity caster) {
    return (int)((double)(this.baseManaCost + this.manaCostPerLevel * (this.getLevel(level, caster) - 1)) * ServerConfigs.getSpellConfig((AbstractSpell) (Object)this).manaMultiplier());
}

}

@Artemisia-Elre Artemisia-Elre changed the title Cant use the mixin in SpellBooks source Can`t use Mixin Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant