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

LinkageError when attempting to use Forms in Spigot #212

Closed
funniray opened this issue Oct 10, 2021 · 4 comments
Closed

LinkageError when attempting to use Forms in Spigot #212

funniray opened this issue Oct 10, 2021 · 4 comments

Comments

@funniray
Copy link
Contributor

Both Floodgate and Geyser include Cumulus in their Jars and Floodgate has an older(?) version of Cumulus. I believe this is an issue with Cumulus being shaded into the Floodgate jar mistakenly, as in all cases, Geyser (and Cumulus) should be present when Floodgate is loaded.

Here's the error that Spigot gives me when I attempt to open a form. Do note, this only happens on newer versions of Spigot. On older versions of Spigot, I was able to open forms fine.

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method 'void org.geysermc.connector.network.session.GeyserSession.sendForm(org.geysermc.cumulus.util.FormBuilder)' the class loader org.bukkit.plugin.java.PluginClassLoader @339f9461 of the current class, com/funniray/geyserutils/GeyserUtilsCommand, and the class loader org.bukkit.plugin.java.PluginClassLoader @61fd0ead for the method's defining class, org/geysermc/connector/network/session/GeyserSession, have different Class objects for the type org/geysermc/cumulus/util/FormBuilder used in the signature (com.funniray.geyserutils.GeyserUtilsCommand is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @339f9461, parent loader 'app'; org.geysermc.connector.network.session.GeyserSession is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @61fd0ead, parent loader 'app')
at com.funniray.geyserutils.GeyserUtilsCommand.onCommand(GeyserUtilsCommand.java:27) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

Here's the code I run

session.sendForm(SimpleForm.builder()
        .title("Select Server")
        .button("Survival")
        .button("Creative")
        .responseHandler((form,responseData)->{
            SimpleFormResponse response = form.parseResponse(responseData);
            if (!response.isCorrect()) {
                return;
            }

            switch (response.getClickedButtonId()) {
                case 0:
                    Utils.transfer(session,"172.200.0.1",19133);
                    break;
                case 1:
                    Utils.transfer(session,"172.200.0.1",19134);
                    break;
            }
        })
);
@Camotoy
Copy link
Member

Camotoy commented Oct 10, 2021

as in all cases, Geyser (and Cumulus) should be present when Floodgate is loaded

Incorrect - Floodgate can be run without Geyser if you use Geyser standalone, or if Floodgate Spigot is on the backends of a proxy. Can you send your Maven pom file or Gradle build file?

@Camotoy
Copy link
Member

Camotoy commented Oct 10, 2021

Also, we just added API in Floodgate to transfer a player! Judging by the session variable, you may still be using Geyser and packets. https://github.com/GeyserMC/Floodgate/blob/master/api/src/main/java/org/geysermc/floodgate/api/FloodgateApi.java#L98

@funniray
Copy link
Contributor Author

I'm not home right now, but I only depend on Spigot and Geyser-Connector -- both with the provided scope. The issue I have is with sending the form packet, as Floodgate's version of Cumulus seems to be different from Geyser's when you view the jar content for org.geysermc.cumulus in both the floodgate and cumulus jar -- causing the LinkageError.

@Tim203
Copy link
Member

Tim203 commented Nov 2, 2021

This issue at its core is the same issue as #178 and because of that I'm closing this issue in favor of #178.

@Tim203 Tim203 closed this as completed Nov 2, 2021
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

3 participants