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

added paperlib to fix teleportation on folia #1576

Open
wants to merge 3 commits into
base: 2.0
Choose a base branch
from

Conversation

J4n-T
Copy link
Contributor

@J4n-T J4n-T commented Jun 29, 2024

Fixes #1572 and includes the suggested improvements from @MWHunter

@J4n-T
Copy link
Contributor Author

J4n-T commented Jun 29, 2024

I added paperlib how they described it here

@J4n-T
Copy link
Contributor Author

J4n-T commented Jun 29, 2024

What is not legit about that?

@Anthony01M
Copy link
Contributor

Just to make sure, have you tested this on:

  1. A Spigot server
  2. A Paper (or fork) server
  3. On folia (since that's what you're supposed to be fixing)?

(I might be wrong here since I don't have much knowledge of PaperLib) Personally I don't like the way you're doing this and don't believe it would work on non-paper/non-paper-fork (maybe also legacy versions?) which would require you to check if the server is Folia or not, and see if you should use PaperLib or use player.teleport depending on what is being used maybe.

@J4n-T
Copy link
Contributor Author

J4n-T commented Jun 29, 2024

I tested it on Folia 1.20.4, Paper 1.20.4 and Spigot 1.8.8. teleportation works (PaperLib has fallbacks for those plattforms). HOWEVER I got following error running the command:

[13:26:33 ERROR]: [ACF] java.lang.ExceptionInInitializerError
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.player.User.sendMessage(User.java:183)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.commands.GrimSpectate.onSpectate(GrimSpectate.java:47)
[13:26:33 ERROR]: [ACF]         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[13:26:33 ERROR]: [ACF]         at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.acf.RegisteredCommand.invoke(RegisteredCommand.java:152)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.acf.BaseCommand.executeCommand(BaseCommand.java:578)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.acf.BaseCommand.execute(BaseCommand.java:513)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.acf.RootCommand.execute(RootCommand.java:99)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.acf.BukkitRootCommand.execute(BukkitRootCommand.java:84)
[13:26:33 ERROR]: [ACF]         at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
[13:26:33 ERROR]: [ACF]         at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
[13:26:33 ERROR]: [ACF]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
[13:26:33 ERROR]: [ACF]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[13:26:33 ERROR]: [ACF]         at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[13:26:33 ERROR]: [ACF]         at java.base/java.lang.Thread.run(Thread.java:1583)
[13:26:33 ERROR]: [ACF] Caused by: java.lang.IllegalArgumentException: No enum constant ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.player.ClientVersion.V_1_20_1
[13:26:33 ERROR]: [ACF]         at java.base/java.lang.Enum.valueOf(Enum.java:293)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.player.ClientVersion.valueOf(ClientVersion.java:41)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.com.github.retrooper.packetevents.util.mappings.TypesBuilder.load(TypesBuilder.java:57)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.com.github.retrooper.packetevents.util.mappings.TypesBuilder.<init>(TypesBuilder.java:41)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.com.github.retrooper.packetevents.util.mappings.TypesBuilder.<init>(TypesBuilder.java:46)
[13:26:33 ERROR]: [ACF]         at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.chat.ChatTypes.<clinit>(ChatTypes.java:42)
[13:26:33 ERROR]: [ACF]         ... 24 more```

I'm not sure if this is related to my change. I'll try to package it without the changes to see if it is caused my me

@J4n-T
Copy link
Contributor Author

J4n-T commented Jun 29, 2024

I builded the plugin without my changes in a seperate clean vm and still get the same issue. I guess it's not related?

@SamB440 SamB440 added the status: rebase required The pull request needs rebasing onto the merge branch label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: rebase required The pull request needs rebasing onto the merge branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GrimSpectate Command is not folia compatible
3 participants