Andavin / Images

A custom image loading plugin for Spigot.
71 stars 31 forks source link

1.21 Fix Mentioned in #86 doesnt work #93

Closed BenTheMan69 closed 1 month ago

BenTheMan69 commented 1 month ago

the 1.21 fix that got mentioned in #86 doesnt work as intended. i own a Paper/Spigot 1.21 Server and the plugin fails to load. Heres what it says in the console:

07.07 12:32:16 [Server] ERROR Could not load plugin 'images-2.3.4.jar' in folder 'plugins/.paper-remapped' 07.07 12:32:16 [Server] INFO org.bukkit.plugin.InvalidPluginException: java.lang.ExceptionInInitializerError 07.07 12:32:16 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:129) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:535) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:290) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1219) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] 07.07 12:32:16 [Server] INFO Caused by: java.lang.ExceptionInInitializerError 07.07 12:32:16 [Server] INFO at images-2.3.4.jar/com.andavin.images.Versioned.(Versioned.java:42) ~[images-2.3.4.jar:?] 07.07 12:32:16 [Server] INFO at images-2.3.4.jar/com.andavin.images.Images.(Images.java:97) ~[images-2.3.4.jar:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.Class.forName0(Native Method) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.Class.forName(Class.java:534) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.Class.forName(Class.java:513) ~[?:?] 07.07 12:32:16 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:32:16 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:125) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO ... 9 more 07.07 12:32:16 [Server] INFO Caused by: java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 4 07.07 12:32:16 [Server] INFO at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4861) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.String.substring(String.java:2830) ~[?:?] 07.07 12:32:16 [Server] INFO at images-2.3.4.jar/com.andavin.util.MinecraftVersion.(MinecraftVersion.java:180) ~[images-2.3.4.jar:?] 07.07 12:32:16 [Server] INFO at images-2.3.4.jar/com.andavin.images.Versioned.(Versioned.java:42) ~[images-2.3.4.jar:?] 07.07 12:32:16 [Server] INFO at images-2.3.4.jar/com.andavin.images.Images.(Images.java:97) ~[images-2.3.4.jar:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.Class.forName0(Native Method) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.Class.forName(Class.java:534) ~[?:?] 07.07 12:32:16 [Server] INFO at java.base/java.lang.Class.forName(Class.java:513) ~[?:?] 07.07 12:32:16 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:32:16 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:125) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:32:16 [Server] INFO ... 9 more

Help is appretiated! Thanks!

resi23 commented 1 month ago

Have you try 2.3.4-paperfix? works for me 1.21 paper newst build

BenTheMan69 commented 1 month ago

Gave you try 2.3.4-paperfix? works for me 1.21 paper newst build

do i put the "dirty fix" together with the 2.3.4 file in the plugins folder or just the paperfix by itself? i tried both and didnt work for me

resi23 commented 1 month ago

Only this https://github.com/resi23/Images/releases/tag/v2.3.4-PaperFix

This is the complete plugin with the fix for paper.

BenTheMan69 commented 1 month ago

Nope. unfortinuetly still the same

07.07 12:40:41 [Server] ERROR Error occurred while enabling Images v2.3.4 (Is it up to date?) 07.07 12:40:41 [Server] INFO java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketAdapter 07.07 12:40:41 [Server] INFO at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] 07.07 12:40:41 [Server] INFO at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[?:?] 07.07 12:40:41 [Server] INFO at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?] 07.07 12:40:41 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:243) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:40:41 [Server] INFO at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?] 07.07 12:40:41 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:169) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:40:41 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:40:41 [Server] INFO at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] 07.07 12:40:41 [Server] INFO at images-2.3.4-PaperFix.jar/com.andavin.images.Images.onEnable(Images.java:119) ~[images-2.3.4-PaperFix.jar:?] 07.07 12:40:41 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:40:41 [Server] INFO at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:40:41 [Server] INFO at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:629) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:578) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:752) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:514) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:327) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1219) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.jar:1.21-46-2fa5e0e] 07.07 12:40:41 [Server] INFO at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] 07.07 12:40:41 [Server] INFO Caused by: java.lang.ClassNotFoundException: com.comphenix.protocol.events.PacketAdapter 07.07 12:40:41 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:197) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:40:41 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?] 07.07 12:40:41 [Server] INFO at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] 07.07 12:40:41 [Server] INFO ... 21 more 07.07 12:40:41 [Server] INFO Disabling Images v2.3.4

resi23 commented 1 month ago

hmm i have no problems on paper 1.21 build 46 you have ProtocolLib?

resi23 commented 1 month ago

The Last error say he dont find ProtocolLib class

BenTheMan69 commented 1 month ago

oh wait it says that protocollib failed to load aswell one second let me check that

BenTheMan69 commented 1 month ago

thats weird. i downloaded the newest version from spigotmc and it still fails to load.

07.07 12:48:57 [Server] INFO Loading server plugin ProtocolLib v5.2.0-SNAPSHOT-679 07.07 12:48:57 [Server] WARN Version (MC: 1.21.0) has not yet been tested! Proceed with caution. 07.07 12:48:58 [Server] ERROR Assuming package version: v1_21_R1 07.07 12:48:58 [Server] ERROR INTERNAL ERROR: Cannot load ProtocolLib. 07.07 12:48:58 [Server] INFO If this problem hasn't already been reported, please open a ticket 07.07 12:48:58 [Server] INFO at https://github.com/dmulloy2/ProtocolLib/issues with the following data: 07.07 12:48:58 [Server] INFO Stack Trace: 07.07 12:48:58 [Server] INFO java.lang.IllegalArgumentException: Unable to find a field that matches {modifiers=[required: 10000, banned: 1000], type={ type input instanceof interface java.util.Map }} 07.07 12:48:58 [Server] INFO at ProtocolLib.jar//com.comphenix.protocol.reflect.FuzzyReflection.getField(FuzzyReflection.java:352) 07.07 12:48:58 [Server] INFO at ProtocolLib.jar//com.comphenix.protocol.injector.packet.PacketRegistry.createNewRegister(PacketRegistry.java:183) 07.07 12:48:58 [Server] INFO at ProtocolLib.jar//com.comphenix.protocol.injector.packet.PacketRegistry.initialize(PacketRegistry.java:334) 07.07 12:48:58 [Server] INFO at ProtocolLib.jar//com.comphenix.protocol.injector.packet.PacketRegistry.getClientPacketTypes(PacketRegistry.java:369) 07.07 12:48:58 [Server] INFO at ProtocolLib.jar//com.comphenix.protocol.injector.PacketFilterManager.(PacketFilterManager.java:120) 07.07 12:48:58 [Server] INFO at ProtocolLib.jar//com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:121) 07.07 12:48:58 [Server] INFO at ProtocolLib.jar//com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:183) 07.07 12:48:58 [Server] INFO at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:59) 07.07 12:48:58 [Server] INFO at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:18) 07.07 12:48:58 [Server] INFO at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) 07.07 12:48:58 [Server] INFO at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) 07.07 12:48:58 [Server] INFO at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:535) 07.07 12:48:58 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:290) 07.07 12:48:58 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1219) 07.07 12:48:58 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) 07.07 12:48:58 [Server] INFO at java.base/java.lang.Thread.run(Thread.java:1583) 07.07 12:48:58 [Server] INFO Dump: 07.07 12:48:58 [Server] INFO Parameters: 07.07 12:48:58 [Server] INFO [NULL] 07.07 12:48:58 [Server] INFO Sender: 07.07 12:48:58 [Server] INFO com.comphenix.protocol.ProtocolLib@3fe784a0[ 07.07 12:48:58 [Server] INFO statistics= 07.07 12:48:58 [Server] INFO packetTask= 07.07 12:48:58 [Server] INFO tickCounter=0 07.07 12:48:58 [Server] INFO configExpectedMod=-1 07.07 12:48:58 [Server] INFO updater=com.comphenix.protocol.updater.SpigotUpdater@46056991 07.07 12:48:58 [Server] INFO redirectHandler= 07.07 12:48:58 [Server] INFO scheduler=com.comphenix.protocol.scheduler.DefaultScheduler@45c43775 07.07 12:48:58 [Server] INFO commandProtocol= 07.07 12:48:58 [Server] INFO commandPacket= 07.07 12:48:58 [Server] INFO commandFilter= 07.07 12:48:58 [Server] INFO packetLogging= 07.07 12:48:58 [Server] INFO skipDisable=false 07.07 12:48:58 [Server] INFO isEnabled=false 07.07 12:48:58 [Server] INFO loader=io.papermc.paper.plugin.manager.DummyBukkitPluginLoader@37ba3a98 07.07 12:48:58 [Server] INFO server=CraftServer{serverName=Paper,serverVersion=1.21-46-2fa5e0e,minecraftVersion=1.21} 07.07 12:48:58 [Server] INFO file=plugins/.paper-remapped/ProtocolLib.jar 07.07 12:48:58 [Server] INFO description=org.bukkit.plugin.PluginDescriptionFile@7f4543b2 07.07 12:48:58 [Server] INFO pluginMeta=org.bukkit.plugin.PluginDescriptionFile@7f4543b2 07.07 12:48:58 [Server] INFO dataFolder=plugins/ProtocolLib 07.07 12:48:58 [Server] INFO classLoader=PluginClassLoader{plugin=ProtocolLib v5.2.0-SNAPSHOT-679, pluginEnabled=false, url=plugins/.paper-remapped/ProtocolLib.jar} 07.07 12:48:58 [Server] INFO naggable=true 07.07 12:48:58 [Server] INFO newConfig=YamlConfiguration[path='', root='YamlConfiguration'] 07.07 12:48:58 [Server] INFO configFile=plugins/ProtocolLib/config.yml 07.07 12:48:58 [Server] INFO logger=com.destroystokyo.paper.utils.PaperPluginLogger@a8fedd4 07.07 12:48:58 [Server] INFO lifecycleEventManager=io.papermc.paper.plugin.lifecycle.event.PaperLifecycleEventManager@30903e7a 07.07 12:48:58 [Server] INFO allowsLifecycleRegistration=true 07.07 12:48:58 [Server] INFO ] 07.07 12:48:58 [Server] INFO Version: 07.07 12:48:58 [Server] INFO ProtocolLib v5.2.0-SNAPSHOT-679 07.07 12:48:58 [Server] INFO Java Version: 07.07 12:48:58 [Server] INFO 21 07.07 12:48:58 [Server] INFO Server: 07.07 12:48:58 [Server] INFO 1.21-46-2fa5e0e (MC: 1.21) 07.07 12:48:58 [Server] INFO Loading server plugin PlaceholderAPI v2.11.6 07.07 12:48:58 [Server] INFO Loading server plugin LuckPerms v5.4.134 07.07 12:48:58 [Server] INFO Loading server plugin Geyser-Spigot v2.4.0-SNAPSHOT 07.07 12:49:00 [Server] INFO Loading extensions... 07.07 12:49:00 [Server] INFO Loaded 0 extension(s) 07.07 12:49:00 [Server] INFO Loading server plugin NoteBlockAPI v1.6.2 07.07 12:49:00 [Server] INFO Loading server plugin Images v2.3.4 07.07 12:49:00 [Server] INFO Loading server plugin TabList v5.7.6 07.07 12:49:00 [Server] INFO Loading server plugin Falling v1.18.1 07.07 12:49:00 [Server] INFO Loading server plugin WorldEdit v7.3.4+6823-6263244 07.07 12:49:01 [Server] INFO Got request to register class com.sk89q.worldedit.bukkit.BukkitServerInterface with WorldEdit [com.sk89q.worldedit.extension.platform.PlatformManager@29a224c0] 07.07 12:49:01 [Server] INFO Loading server plugin GeyserUpdater v1.6.4 07.07 12:49:01 [Server] INFO Loading server plugin InvSeePlusPlus v0.28.0 07.07 12:49:01 [Server] INFO Loading server plugin BedHome v2.35 07.07 12:49:01 [Server] INFO Loading server plugin MusicBox v2.1.2 07.07 12:49:01 [Server] INFO Loading server plugin DiscordIntegration v3.5.2 07.07 12:49:01 [Server] INFO Loading server plugin InvisibleItemFrames v2.16.1 07.07 12:49:01 [Server] INFO Loading server plugin Join-Leave v2.4.3 07.07 12:49:01 [Server] INFO Join-Leave Essentials is not installed. Essentials functions Disabled. 07.07 12:49:01 [Server] INFO Loading server plugin Vivecraft-Spigot-Extensions v1.21-1 07.07 12:49:01 [Server] INFO Server permissions file permissions.yml is empty, ignoring it 07.07 12:49:01 [Server] INFO Enabling ProtocolLib v5.2.0-SNAPSHOT-679 07.07 12:49:01 [Server] ERROR ** 07.07 12:49:01 [Server] ERROR ProtocolLib does not support plugin reloaders! 07.07 12:49:01 [Server] ERROR Please use the built-in reload command! 07.07 12:49:01 [Server] ERROR ** 07.07 12:49:01 [Server] INFO Disabling ProtocolLib v5.2.0-SNAPSHOT-679

resi23 commented 1 month ago

^^

        Plugin protocolLib = Bukkit.getPluginManager().getPlugin("ProtocolLib");
        if (protocolLib != null) { // ProtocolLib is present so use it for higher stability
            this.protocolLib = true;
            Logger.info("ProtocolLib detected. Enabling generic packet handling...");
            ProtocolLibListener.register(this, LISTENER_TASKS, BRIDGE);
        }

Yes, it checks whether the protocol exists but not whether it is enabled. I think that is where the error comes from. You have it on there but it is not enabled and therefore the class cannot find it

resi23 commented 1 month ago

use https://ci.dmulloy2.net/job/ProtocolLib/723/ latest dev build

resi23 commented 1 month ago

On Spigot is the 5.2.0 this is not 1.21 you need 5.3.0

BenTheMan69 commented 1 month ago

hey thanks that worked wondefully! i didnt see that small comment on the PlaceholderLib page that said to download the latest dev build for 1.21. thanks for your help!

resi23 commented 1 month ago

Perfect :)