BKCommonLib icon indicating copy to clipboard operation
BKCommonLib copied to clipboard

Error with BedwarsREL

Open Vennntox opened this issue 2 years ago • 1 comments

BkCommonLib version: BKCommonLib 1.19.4-v1
Spigot version: 1.8.8

Problem or bug:

11:16:00 [WARNING] java.lang.ClassCastException: com.bergerkiller.bukkit.common.internal.hooks.LookupEntityClassMap cannot be cast to java.util.HashMap
11:16:00 [WARNING] 	at io.github.bedwarsrel.com.v1_8_r3.TNTSheepRegister.registerEntities(TNTSheepRegister.java:43)
11:16:00 [WARNING] 	at io.github.bedwarsrel.shop.Specials.TNTSheepListener.<init>(TNTSheepListener.java:30)
11:16:00 [WARNING] 	at io.github.bedwarsrel.shop.Specials.SpecialItem.loadSpecials(SpecialItem.java:38)
11:16:00 [WARNING] 	at io.github.bedwarsrel.BedwarsRel.registerListener(BedwarsRel.java:897)
11:16:00 [WARNING] 	at io.github.bedwarsrel.BedwarsRel.onEnable(BedwarsRel.java:791)
11:16:00 [WARNING] 	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
11:16:01 [WARNING] 	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340)
11:16:01 [WARNING] 	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405)
11:16:01 [WARNING] 	at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357)
11:16:01 [WARNING] 	at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317)
11:16:01 [WARNING] 	at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414)
11:16:01 [WARNING] 	at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378)
11:16:01 [WARNING] 	at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333)
11:16:01 [WARNING] 	at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263)
11:16:01 [WARNING] 	at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525)
11:16:01 [WARNING] 	at java.lang.Thread.run(Unknown Source)

Expected behaviour:

Steps to reproduce:

Plugins BedwarsREL and BKCommonLib 1.19.4-v1

Vennntox avatar May 28 '23 09:05 Vennntox

Looks like its going wrong because that plugin is casting the field to its hidden implementation HashMap rather than the field type, Map. https://github.com/BedwarsRel/BedwarsRel/blob/master/v1_8_r3/src/main/java/io/github/bedwarsrel/com/v1_8_r3/TNTSheepRegister.java#L36

The easiest would be if they simply swap the cast from HashMap to Map. I could make that hook class implement HashMap too but then it might break in other cases if some version uses LinkedHashmap or whatever.

That hook class is there to make sure custom entities (Traincarts) properly load in when chunks load.

If that plugin is still maintained you could open an issue ticket there and reference this one.

bergerkiller avatar May 28 '23 09:05 bergerkiller