I'm making a paper plugin and I'm using gradle
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = 'citizens-repo'
url = 'https://maven.citizensnpcs.co/repo'
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
compileOnly('net.citizensnpcs:citizens-main:2.0.39-SNAPSHOT') {
exclude group: '*', module: '*'
}
}
Intellij recognizes the citizens api, and I'm using the same version on the server: Citizens-2.0.39-b3902.jar
I also added softdepend: [Citizens] to my paper-plugin.yml
Here's my code for trying to wait for Citizens to be enabled:
@EventHandler
public void onCitizensEnable(CitizensEnableEvent event){
handleNPCS();
}
public void handleNPCS(){
if(!isLobby){
return;
}
if (!getServer().getPluginManager().isPluginEnabled("Citizens")) {
return;
}
NPC survivalNPC = CitizensAPI.getNPCRegistry().getById(21);
if(survivalNPC == null){
getLogger().warning("Survival NPC doesn't exist");
}
else{
survivalNPC.setName("CLICK TO PLAY");
}
}
For some reason, it says that the event doesn't exist
[13:08:30 ERROR]: [PrinterLobby] Failed to register events for class org.printer.printerCore.PrinterCore because net/citizensnpcs/api/event/CitizensEnableEvent does not exist.