DevLeoko / AdvancedBan

AdvancedBan is a Spigot plugin to manage punishments on single servers and server networks
GNU General Public License v3.0
156 stars 128 forks source link

When called from the API, "this.mi" is null #639

Closed ichiru5555 closed 3 months ago

ichiru5555 commented 3 months ago

What version of AdvancedBan (/AdvancedBan) are you using? 2.3.0

What kind of server do you have (Bungeecord/single server)? bungeecord

What server version (/version) are you using? latest

Any error/log post it through pastebin.com and link it here. (Also include /plugins/AdvancedBan/logs/latest.log) Cannot invoke "me.leoko.advancedban.MethodInterface.log(String)" because "this.mi" is null

Add any additional information below. I want to run getMute from the API, but I get the error "Cannot invoke "me.leoko.advancedban.MethodInterface.log(String)" because "this.mi" is null". Can you tell me how to solve this?

Hopefuls commented 3 months ago

This is caused by incorrect maven pom.xml settings, ensure you're not shading/including advancedgui into your exported jar.

ichiru5555 commented 3 months ago

I have not included Advancedgui in the dependencies in pom.xml.

Hopefuls commented 3 months ago

How have you included advancedban then?

ichiru5555 commented 3 months ago

`

com.github.DevLeoko
<artifactId>AdvancedBan</artifactId>
<version>v2.3.0</version>

`

Hopefuls commented 3 months ago

That is including advancedban through the pom.xml.

Take a look at https://howtodoinjava.com/maven/maven-dependency-scopes/ to understand how to set scopes on maven dependencies.

ichiru5555 commented 3 months ago

Was it wrong to write the code written in README.md in pom.xml?

Hopefuls commented 3 months ago

Was it wrong to write the code written in README.md in pom.xml?

It does not have the scope set as I've provided above, you need to include that in order to tell maven to not include the actual advancedban jar into the compiled jar.

ichiru5555 commented 3 months ago

Is the error "Cannot invoke "net.md_5.bungee.protocol.MinecraftEncoder.getProtocol()" because the return value of "io.netty.channel.ChannelPipeline.get(java.lang.Class)" is null" coming from AdvancedBan?

Hopefuls commented 3 months ago

What is the full stacktrace/full error? There should be more to it

If you need quicker help, you could also join our discord @ https://discord.gg/zycVCTn67K

ichiru5555 commented 3 months ago

No, it was only this one sentence.

Hopefuls commented 3 months ago

There should be more, otherwise cant tell if it is or not

ichiru5555 commented 3 months ago

I would like to mute it, is the following code correct? manager.getPunishments(player.getUniqueId().toString(), PunishmentType.MUTE, true);

Hopefuls commented 3 months ago

That is not correct, take a look at the uuid manager

I once again suggest asking through our discord for better support.

ichiru5555 commented 3 months ago

Thank you