#No Citizens API

1 messages · Page 1 of 1 (latest)

novel wedge
#

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.
bronze doveBOT
#

(printer0767) How to wait for Citizens to be enabled

bronze doveBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

midnight holly
#

it looks correct to me... @novel wedge

novel wedge
#

It seems like it can't find the plugin at runtime

#

Even though it's installed in the server

#

I can't use any of the api's functionality

#

If I try to, I get errors like this

[21:11:47 ERROR]: Could not pass event PlayerInteractEntityEvent to PrinterCore v1.0-SNAPSHOT
java.lang.NoClassDefFoundError: net/citizensnpcs/api/CitizensAPI
#
NPC npc = CitizensAPI.getNPCRegistry().getNPC(event.getRightClicked());
if (npc == null) {
    return;
}
#

I mean the plugin is there

#

And I'm using the same gradle thing as the wiki

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: '*'
    }
}
#

No Citizens API

rigid raptor
#

I also added softdepend: [Citizens] to my paper-plugin.yml
Are you using plugin.yml or paper-plugin.yml?

rigid raptor
# novel wedge paper-plugin.yml

Well, that uses an entirely different syntax, check Paper docs - although unless you specifically need any of the Paper plugins features you should consider just using the normal system

novel wedge
#

so i just need to find how softdepend works with this syntax

rigid raptor
#

It's all on Paper's documentation, either switch to plugin.yml or use the correct syntax for paper-plugin.yml

novel wedge
noble chasmBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@novel wedge