Exceptionflug / protocolize

A lightweight BungeeCord / Velocity protocol framework supporting items
MIT License
300 stars 39 forks source link

Incompatible with `MCKotlin` #197

Closed LittleChest closed 1 year ago

LittleChest commented 1 year ago

Describe the bug Incompatible with MCKotlin

To Reproduce Steps to reproduce the behavior:

  1. Install MCKotlin and Protocolize
  2. Install plugins that depend on MCKotlin (such as ClientCatcher)
  3. Start the proxy
  4. See error

Expected behavior Both plugins work fine

Screenshots

[06:30:05 ERROR] [clientcatcher]: Cannot load configuration
java.util.concurrent.CompletionException: kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath
        at kotlin.jvm.internal.ClassReference.error(ClassReference.kt:88) ~[?:?]
        at kotlin.jvm.internal.ClassReference.isData(ClassReference.kt:70) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.kotlin.DataClassFieldDiscoverer.discover(ObjectMapping.kt:93) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.newMapper(ObjectMapperFactoryImpl.java:131) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.computeMapper(ObjectMapperFactoryImpl.java:120) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.lambda$computeFromMap$5(ObjectMapperFactoryImpl.java:290) ~[?:?]
        at java.util.HashMap.computeIfAbsent(HashMap.java:1219) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.computeFromMap(ObjectMapperFactoryImpl.java:288) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.get(ObjectMapperFactoryImpl.java:109) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.objectmapping.ObjectMapperFactoryImpl.deserialize(ObjectMapperFactoryImpl.java:204) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.AbstractConfigurationNode.get(AbstractConfigurationNode.java:151) ~[?:?]
        at io.github._4drian3d.clientcatcher.libs.org.spongepowered.configurate.ConfigurationNode.get(ConfigurationNode.java:520) ~[?:?]
        at io.github._4drian3d.clientcatcher.ClientCatcher.loadConfig$lambda$1(ClientCatcher.kt:83) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        ... 6 more

Proxy environment Velocity 3.2.0

"plugins": [
    {
      "id": "protocolize",
      "name": "Protocolize",
      "version": "v2",
      "authors": [
        "Exceptionflug"
      ]
    },
    {
      "id": "bluedragon-jukebox",
      "name": "jukebox",
      "authors": [
        "FluxCapacitor2"
      ],
      "url": "https://bluedragonmc.com",
      "dependencies": [
        "protocolize"
      ]
    },
    {
      "id": "buildnotifiervelocity",
      "name": "BuildNotifier-Velocity",
      "version": "1.0.1",
      "authors": [
        "hyperdefined"
      ],
      "description": "Automatically check for Paper/Waterfall/Velocity/Folia updates.",
      "url": "https://github.com/hyperdefined/BuildNotifier"
    },
    {
      "id": "cleanping",
      "name": "CleanPing",
      "version": "1.4.6",
      "authors": [
        "frafol"
      ],
      "description": "Adds /ping command to check your and player\u0027s ping.",
      "dependencies": [
        "redisbungee"
      ]
    },
    {
      "id": "mckotlin-velocity",
      "name": "MCKotlin-Velocity",
      "version": "1.3.0-k1.9.10",
      "authors": [
        "4drian3d"
      ]
    },
    {
      "id": "clientcatcher",
      "name": "ClientCatcher",
      "version": "{version}",
      "authors": [
        "4drian3d"
      ],
      "dependencies": [
        "mckotlin-velocity",
        "miniplaceholders"
      ]
    },
    {
      "id": "commandwhitelist",
      "name": "CommandWhitelist",
      "version": "2.8.1",
      "authors": [
        "YouHaveTrouble"
      ],
      "description": "You decide what commands players can use or tab complete on your server!"
    },
    {
      "id": "epicguard",
      "name": "EpicGuard",
      "version": "7.5.0",
      "authors": [
        "neox",
        "4drian3d"
      ],
      "description": "Bot protection system for Minecraft servers.",
      "url": "https://github.com/4drian3d/EpicGuard"
    },
    {
      "id": "floodgate",
      "name": "floodgate",
      "version": "2.2.2-SNAPSHOT (b69-492be77)",
      "authors": [
        "GeyserMC"
      ],
      "description": "Allows Bedrock players to join Java edition servers while keeping the server in online mode",
      "url": "https://geysermc.org}"
    },
    {
      "id": "geyser",
      "name": "Geyser-Velocity",
      "version": "2.2.0-SNAPSHOT (git-master-dead91b)",
      "authors": [
        "GeyserMC"
      ],
      "url": "https://geysermc.org"
    },
    {
      "id": "justonemore",
      "name": "JustOneMore",
      "version": "1.1.0",
      "authors": [
        "xii69"
      ],
      "description": "JustOneMore plugin for Velocity"
    },
    {
      "id": "luckperms",
      "name": "LuckPerms",
      "version": "5.4.102",
      "authors": [
        "Luck"
      ],
      "description": "A permissions plugin",
      "url": "https://luckperms.net"
    },
    {
      "id": "libertybans",
      "name": "LibertyBans",
      "version": "1.1.0-M3",
      "authors": [
        "Contributors to LibertyBans"
      ],
      "description": "The be-all, end-all of discipline.",
      "url": "https://github.com/A248/LibertyBans",
      "dependencies": [
        "luckperms"
      ]
    },
    {
      "id": "maintenance",
      "name": "Maintenance",
      "version": "4.2.0",
      "authors": [
        "kennytv"
      ],
      "description": "Enable maintenance mode with a custom maintenance motd and icon.",
      "url": "https://hangar.papermc.io/kennytv/Maintenance",
      "dependencies": [
        "serverlistplus",
        "luckperms"
      ]
    },
    {
      "id": "viaversion",
      "name": "ViaVersion",
      "version": "4.7.0",
      "authors": [
        "_MylesC",
        "creeper123123321",
        "Gerrygames",
        "kennytv",
        "Matsv"
      ],
      "description": "Allow newer Minecraft versions to connect to an older server version.",
      "url": "https://viaversion.com"
    },
    {
      "id": "plan",
      "name": "Plan",
      "version": "5.5 build 2461",
      "authors": [
        "AuroraLS3"
      ],
      "description": "Player Analytics Plugin by AuroraLS3",
      "dependencies": [
        "redisbungee",
        "viaversion"
      ]
    },
    {
      "id": "raknetify",
      "name": "Raknetify (Velocity)",
      "version": "0.1.0+alpha.5.104",
      "authors": [
        "ishland"
      ],
      "description": "A Velocity plugin that allows using RakNet as Minecraft networking backend. "
    },
    {
      "id": "serverpermissions",
      "name": "ServerPermissions",
      "version": "1.3.1",
      "authors": [
        "4drian3d"
      ],
      "description": "Add permissions to access your servers",
      "url": "https://modrinth.com/plugin/serverpermissions",
      "dependencies": [
        "miniplaceholders"
      ]
    },
    {
      "id": "vcustombrand",
      "name": "VCustomBrand",
      "version": "1.0.0",
      "authors": [
        "4drian3d"
      ],
      "description": "Customize the brand to be shown to players in Velocity",
      "dependencies": [
        "miniplaceholders"
      ]
    },
    {
      "id": "velocity_tools",
      "name": "VelocityTools",
      "version": "1.1.9",
      "authors": [
        "Elytrium (https://elytrium.net/)"
      ],
      "url": "https://elytrium.net/"
    },
    {
      "id": "velocityplayerlistquery",
      "name": "VelocityPlayerListQuery",
      "version": "1.2.0",
      "authors": [
        "voruti"
      ],
      "description": "A Velocity plugin that shows current players in the server list.",
      "url": "https://github.com/voruti/VelocityPlayerListQuery"
    },
    {
      "id": "viarewind",
      "name": "ViaRewind",
      "version": "3.0.0",
      "authors": [
        "Gerrygames",
        "FlorianMichael/EnZaXD",
        "creeper123123321"
      ],
      "url": "https://viaversion.com/rewind",
      "dependencies": [
        "viaversion",
        "viabackwards"
      ]
    }
  ]

Minecraft versions used Client: 1.20.1 Server: 1.20.2 (ViaVersion)

Exceptionflug commented 1 year ago

Hey, this issue is not a Protocolize issue. Please contact the developer of MCKotlin or ClientCatcher regarding this topic.

LittleChest commented 1 year ago

Hey, this issue is not a Protocolize issue. Please contact the developer of MCKotlin or ClientCatcher regarding this topic.

sorry to disturb you

4drian3d commented 1 year ago

Hey, this issue is not a Protocolize issue. Please contact the developer of MCKotlin or ClientCatcher regarding this topic.

It is not an incompatibility between protocolize and ClientCatcher/MCKotlin, it is an incompatibility of other plugins that include Kotlin stdlib in their classpath without relocating and without all the libraries that MCKotlin includes, the error occurs when taking priority this incomplete Kotlin version, ClientCatcher can not access Kotlin reflect, which is the cause of the error. Sorry that the issue has arrived here, Protocolize works fine with ClientCatcher and MCKotlin, it's not my fault, in this case it would be Jukebox's problem.