Trinkets (Fabric)

Trinkets (Fabric)

22M Downloads

"class file for dev.onyxstudios.cca.api.v3.component.ComponentV3 not found" when calling isEquipped(Item item) for TrinketComponent

xSpleet opened this issue · 4 comments

commented

I am trying to call isEquipped(Item item) for a TrinketComponent to check if my mod item is in any of the slots I added. I get an error "Cannot access dev.onyxstudios.cca.api.v3.component.ComponentV3". When I try to start the debug I get the error stated in the title. When I try to import it it can't find it, but it works in the files of the TrinketsApi.
EDIT: getEquipped(Item item) and getAllEquipped() throws the same error
Here is the code I am trying to run.
Minecraft version: 1.19.3
Trinkets version: 3.5.1

package xspleet.magpie.mixin;

import dev.emi.trinkets.api.TrinketComponent;
import dev.emi.trinkets.api.TrinketsApi;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.damage.EntityDamageSource;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import org.apache.commons.lang3.ObjectUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import xspleet.magpie.effect.ModStatusEffects;
import xspleet.magpie.item.ModItems;
import xspleet.magpie.item.custom.ForkItem;

import java.util.Objects;
import java.util.Random;

import static xspleet.magpie.item.ModItems.FORK;

...

@ModifyVariable(method = "damage", at = @At("HEAD"), ordinal = 0)
    private float injected(float amount)
    {
        if(playerAttacker!=null)
        {
            if(TrinketsApi.getTrinketComponent(playerAttacker).isPresent())
            {
                TrinketComponent trinketComponent = TrinketsApi.getTrinketComponent(playerAttacker).get();


                if(trinketComponent.isEquipped(FORK))//ERROR


                {
                    if(playerAttacker.getWorld().hasRain(playerAttacker.getBlockPos()))
                    {
                        return amount + 6;
                    }
                    else
                    {
                        return amount + 2;
                    }
                }
            }
        }
        return amount;
    }
commented

I get the same error

commented

Me too. By the way, which ending do u have in Omori? 🗿

commented

Are you updated to the latest release of trinkets? Make sure to have the CCA maven specified correctly, it has changed a couple times.

commented

Sorry, forgot to close it!
I already solved the issue, seemed to be a problem with my IDE.