class file for dev.onyxstudios.cca.api.v3.component.ComponentV3 not found
TheLOL003 opened this issue · 8 comments
I am trying to use the getEquipped() method but I am getting an error: class file for dev.onyxstudios.cca.api.v3.component.ComponentV3 not found
This is my code:
public List<ItemStack> getTrinkets(LivingEntity p) {
Optional<TrinketComponent> trinket = TrinketsApi.getTrinketComponent(p);
if (trinket.isEmpty()) {
return null;
}
return trinket.get().getEquipped(it-> true).stream().map(pair -> pair.getRight()).toList();
}
How can I fix this?
Do you have any more info? Are you sure you're depending on the correct version of the mod for your version of minecraft?
I am using the version 3.6.0 for Minecraft 1.19.4 and fabric as modloader (loader version 0.14.19 and api version 0.76.0). I am depending on it using modImplementation "dev.emi:trinkets:3.6.0"
It looks like this; https://pastebin.com/uWHiRKks
I had the same problem when upgrading to Loom 1.1 (Loom 1.0 doesn't have this issue). You can add modImplementation "dev.emi:trinkets:5.1.0"
to manually fix it.
This issue is caused by the fact that Trinkets depends on CCA with the modImplementation
config - this should be modApi
since CCA classes are exposed as part of Trinket's public API. It has not manifested previously because Loom <1.0 did not properly implement this distinction for dependencies.
I had the same problem when upgrading to Loom 1.1 (Loom 1.0 doesn't have this issue). You can add
modImplementation "dev.emi:trinkets:5.1.0"
to manually fix it.
Did you replace or add the mod implementation? I'm also getting the error of .isEquipped(). Like OP, I'm on 1.19.4, Trinkets 3.6.0, and loom 1.2.
EDIT: I managed to fix this by adding CCA API and ModImplementation in the build.gradle and it worked like a charm.