#access public static methods of another plugin
1 messages · Page 1 of 1 (latest)
then its methodnotfoundexception
yaml -> libraries
and scope provided
some of my dependencies for the util plugin arent in MavenCentral
that doesnt matter for this afaik
Yeah it still needs to be loaded from somewhere
A common way of doing so is having a lib plugin
So it's only shaded in to that and not to the other plugins
i mean to have scope provided provided, so that when the plugin loaded on the server the classes are present
Alternatively shade in to one of your plugins but not the other one
isnt my utils plugin already a lib plugin?
maybe i should give some context:
i have a TottoriUtils plugin with shaded dependencies and a TottoriLobby plugin that depends on TottoriUtils where i want to access public static methods in TottoriUtils.
i dont but it still doesnt work
What about it doesn't work
oh right:
my TottoriUtils class needs to be initialized first, and i do so from the TottoriUtils plugin
cant access methods in TottoriUtils
What happens
NoSuchMethodExceprtion
Are both plugins loaded
yea
Is lobby set to depend on Utils
yea
yes
Are you using maven or gradle
gradle
Could you send your build files for the two plugins
?paste
maybe i should also note that the method thats not found has a return type which is defined in a dependency of TottoriUtils
ill try getting some primitive from utils wait
ooh so accessing a primitive works
@high cloud do i need to publish some shaded artifact to mavenlocal ?
or idk what im doing rn but it seems to be dependency issue
Try using implementation instead of api
now i cant access the dependencies in TottoriLobby
i kinda need both api and implementation
// https://mvnrepository.com/artifact/co.aikar/taskchain-core
implementation("co.aikar:taskchain-core:3.7.2")
api("co.aikar:taskchain-core:3.7.2")
// https://mvnrepository.com/artifact/co.aikar/taskchain-bukkit
implementation("co.aikar:taskchain-bukkit:3.7.2")
api("co.aikar:taskchain-bukkit:3.7.2")
this also didnt work
ig i could shade taskchain into my lobby plugin too, but then id have 2 copies
well if it works
but if i update versions i need to change both
and id need to shade it in every consumer of TottoriUtils#
its a dilemma
Yeah that's not quite right