ocelotpotpie / FreedomChat

Liberate your server from the chat-reporting bourgeoisie! Disable chat signing server-side
https://modrinth.com/plugin/freedomchat
GNU General Public License v3.0
207 stars 24 forks source link

NoSuchMethod on CraftPlayer #18

Closed Hephaisto-dev closed 1 year ago

Hephaisto-dev commented 1 year ago

HI, i get this error when connecting: java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.getHandle()' at ru.bk.oharass.freedomchat.FreedomChat.on(FreedomChat.java:93) ~[FreedomChat-1.2.1.jar:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor201.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-141] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:372) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$0(PlayerList.java:309) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1361) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1338) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1331) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:114) ~[?:?] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1465) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1193) ~[paper-1.19.2.jar:git-Paper-141] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-141] at java.lang.Thread.run(Thread.java:833) ~[?:?]

e-im commented 1 year ago

Have you built the plugin yourself, or are you using a version downloaded from Modrinth?

To elaborate on that, ServerPlayer is a Mojang mapped name, while EntityPlayer is the spigot mapping for the same class.

Hephaisto-dev commented 1 year ago

I build it myself yes

e-im commented 1 year ago

Okay. You need to use the reobfJar gradle task (so ./gradlew reobfJar), and grab the artifact that does NOT end in -dev.

Let me know if this works for you.

Hephaisto-dev commented 1 year ago

Actually i use maven with a remapped spigot as a dependency maybe that is the problem

e-im commented 1 year ago

uh yeah, that will definitely not work. The plugin is developed using Mojang mappings and remapped to spigot at build time.

Hephaisto-dev commented 1 year ago

Can i use direcly spigot mapping or it's harder?

e-im commented 1 year ago

What is your actual goal here?

You can manually change all the instances where a mojang-mapped name is imported or used to spigot mappings— or even use some source remapping tool, but the plugin is very small, so there are only a few instances.

Hephaisto-dev commented 1 year ago

Hmm.. i see. Well i think i will find a way to remap with maven, good to know for the future. Thanks for the tips.