Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethod on CraftPlayer #18

Closed
Hephaisto-dev opened this issue Nov 13, 2022 · 8 comments
Closed

NoSuchMethod on CraftPlayer #18

Hephaisto-dev opened this issue Nov 13, 2022 · 8 comments

Comments

@Hephaisto-dev
Copy link

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
Copy link
Collaborator

e-im commented Nov 13, 2022

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
Copy link
Author

I build it myself yes

@e-im
Copy link
Collaborator

e-im commented Nov 13, 2022

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
Copy link
Author

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

@e-im
Copy link
Collaborator

e-im commented Nov 13, 2022

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

@Hephaisto-dev
Copy link
Author

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

@e-im
Copy link
Collaborator

e-im commented Nov 13, 2022

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
Copy link
Author

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.

@e-im e-im closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants