VolmitSoftware / React

Smart Server Performance
https://volmit.com
GNU General Public License v3.0
95 stars 52 forks source link

React 6.654 reports java.lang.ClassCastException on 1.17.1 server startup. #604

Closed eternitymoe closed 1 year ago

eternitymoe commented 3 years ago

Describe the bug React 6.654 reports java.lang.ClassCastException on 1.17.1 server startup. Also the plugin reports version as 6.653 but it actually is 6.654

To Reproduce Run React on a 1.17.1 server.

Screenshots or Video Recordings )RG8S8HVT0~US)WD0ZA$ST

Server and Plugin Informations React 6.654 Paper 1.17.1 build 119

Additional context Part of error log: [11:04:24 INFO]: Preparing spawn area: 0% [11:04:24 INFO]: Preparing spawn area: 0% [11:04:24 INFO]: Preparing spawn area: 0% [11:04:24 INFO]: Preparing spawn area: 0% [11:04:24 INFO]: Time elapsed: 1884 ms [11:04:24 WARN]: java.lang.ClassCastException: class net.minecraft.world.level.entity.EntityTickList cannot be cast to class net.minecraft.world.level.TickListServer (net.minecraft.world.level.entity.EntityTickList and net.minecraft.world.level.TickListServer are in unnamed module of loader 'app') [11:04:24 WARN]: at primal.bukkit.nms.Catalyst17.getTickList(Catalyst17.java:341) [11:04:24 WARN]: at com.volmit.react.util.TickListSplitter.(TickListSplitter.java:31) [11:04:24 WARN]: at com.volmit.react.controller.TickListController.on(TickListController.java:31) [11:04:24 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor97.execute(Unknown Source) [11:04:24 WARN]: at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) [11:04:24 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) [11:04:24 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [11:04:24 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) [11:04:24 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:622) [11:04:24 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) [11:04:24 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) [11:04:24 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) [11:04:24 WARN]: at java.base/java.lang.Thread.run(Thread.java:831) [11:04:24 INFO]: Preparing start region for dimension minecraft:the_nether [11:04:25 INFO]: Preparing spawn area: 0% [11:04:25 INFO]: Preparing spawn area: 0% [11:04:25 INFO]: Preparing spawn area: 0% [11:04:26 INFO]: Time elapsed: 1218 ms [11:04:26 WARN]: java.lang.ClassCastException: class net.minecraft.world.level.entity.EntityTickList cannot be cast to class net.minecraft.world.level.TickListServer (net.minecraft.world.level.entity.EntityTickList and net.minecraft.world.level.TickListServer are in unnamed module of loader 'app') [11:04:26 WARN]: at primal.bukkit.nms.Catalyst17.getTickList(Catalyst17.java:341) [11:04:26 WARN]: at com.volmit.react.util.TickListSplitter.(TickListSplitter.java:31) [11:04:26 WARN]: at com.volmit.react.controller.TickListController.on(TickListController.java:31) [11:04:26 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor97.execute(Unknown Source) [11:04:26 WARN]: at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) [11:04:26 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) [11:04:26 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [11:04:26 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) [11:04:26 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:622) [11:04:26 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) [11:04:26 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) [11:04:26 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) [11:04:26 WARN]: at java.base/java.lang.Thread.run(Thread.java:831) [11:04:26 INFO]: Preparing start region for dimension minecraft:the_end [11:04:26 INFO]: Preparing spawn area: 0% [11:04:26 INFO]: Preparing spawn area: 0% [11:04:26 INFO]: Time elapsed: 814 ms [11:04:26 WARN]: java.lang.ClassCastException: class net.minecraft.world.level.entity.EntityTickList cannot be cast to class net.minecraft.world.level.TickListServer (net.minecraft.world.level.entity.EntityTickList and net.minecraft.world.level.TickListServer are in unnamed module of loader 'app') [11:04:26 WARN]: at primal.bukkit.nms.Catalyst17.getTickList(Catalyst17.java:341) [11:04:26 WARN]: at com.volmit.react.util.TickListSplitter.(TickListSplitter.java:31) [11:04:26 WARN]: at com.volmit.react.controller.TickListController.on(TickListController.java:31) [11:04:26 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor97.execute(Unknown Source) [11:04:26 WARN]: at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) [11:04:26 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) [11:04:26 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [11:04:26 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) [11:04:26 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:622) [11:04:26 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) [11:04:26 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) [11:04:26 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) [11:04:26 WARN]: at java.base/java.lang.Thread.run(Thread.java:831)

Frerduro commented 3 years ago

Please send full latest.log.

eternitymoe commented 3 years ago

PS C:\Users\bakamoe\Desktop\test> java '-XX:+UseCompressedOops' '-XX:+UseG1GC' '-Dfile.encoding=UTF-8' '-Dcom.mojang.eula.agree=true' -Xmx12G -Xms12G -jar Paper-1.17.1-b121.jar nogui --world-dir ./worlds System Info: Java 16 (Java HotSpot(TM) 64-Bit Server VM 16.0.1+9-24) Host: Windows 10 10.0 (amd64) Loading libraries, please wait... [05:44:09 ERROR]: Failed to load properties from file: server.properties [05:44:09 WARN]: Failed to load eula.txt [05:44:09 INFO]: [STDERR]: You have used the Spigot command line EULA agreement flag. [05:44:09 INFO]: [STDERR]: By using this setting you are indicating your agreement to Mojang's EULA (https://account.mojang.com/documents/minecraft_eula). [05:44:09 INFO]: [STDERR]: If you do not agree to the above EULA please stop your server and remove this flag immediately. [05:44:10 INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' [05:44:10 INFO]: Found new data pack file/bukkit, loading it automatically [05:44:10 INFO]: Reloading ResourceManager: Default, bukkit [05:44:10 INFO]: Loaded 7 recipes [05:44:11 INFO]: Starting minecraft server version 1.17.1 [05:44:11 INFO]: Loading properties [05:44:11 INFO]: This server is running Paper version git-Paper-121 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: b854e7e) [05:44:11 INFO]: Debug logging is disabled [05:44:11 INFO]: Server Ping Player Sample Count: 12 [05:44:11 INFO]: Using 4 threads for Netty based IO [05:44:11 INFO]: Default game type: SURVIVAL [05:44:11 INFO]: Generating keypair [05:44:11 INFO]: Starting Minecraft server on :25565 [05:44:11 INFO]: Using default channel type [05:44:12 WARN]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug! [05:44:15 WARN]: Legacy plugin React v6.653 does not specify an api-version. [05:44:15 INFO]: [ProtocolLib] Loading ProtocolLib v4.7.0 [05:44:16 INFO]: [React] Loading React v6.653 [05:44:16 INFO]: [ProtocolLib] Enabling ProtocolLib v4.7.0 [05:44:16 INFO]: [ProtocolLib] Started structure compiler thread. [05:44:16 INFO]: [React] Enabling React v6.653 [05:44:17 INFO]: [React] Selected R1_17 [05:44:17 INFO]: React: Language: enUS [05:44:17 INFO]: Preparing level "world" [05:44:20 WARN]: Unable to find spawn biome [05:44:21 WARN]: Unable to find spawn biome [05:44:21 INFO]: Preparing start region for dimension minecraft:overworld [05:44:21 INFO]: Preparing spawn area: 0% [05:44:21 INFO]: Preparing spawn area: 0% [05:44:21 INFO]: Time elapsed: 661 ms [05:44:21 WARN]: java.lang.ClassCastException: class net.minecraft.world.level.entity.EntityTickList cannot be cast to class net.minecraft.world.level.TickListServer (net.minecraft.world.level.entity.EntityTickList and net.minecraft.world.level.TickListServer are in unnamed module of loader 'app') [05:44:21 WARN]: at primal.bukkit.nms.Catalyst17.getTickList(Catalyst17.java:341) [05:44:21 WARN]: at com.volmit.react.util.TickListSplitter.(TickListSplitter.java:31) [05:44:21 WARN]: at com.volmit.react.controller.TickListController.on(TickListController.java:31) [05:44:21 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor71.execute(Unknown Source) [05:44:21 WARN]: at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) [05:44:21 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) [05:44:21 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [05:44:21 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) [05:44:21 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:622) [05:44:21 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) [05:44:21 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) [05:44:21 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) [05:44:21 WARN]: at java.base/java.lang.Thread.run(Thread.java:831) [05:44:21 INFO]: Preparing start region for dimension minecraft:the_nether [05:44:22 INFO]: Preparing spawn area: 0% [05:44:22 INFO]: Preparing spawn area: 0% [05:44:22 INFO]: Time elapsed: 809 ms [05:44:22 WARN]: java.lang.ClassCastException: class net.minecraft.world.level.entity.EntityTickList cannot be cast to class net.minecraft.world.level.TickListServer (net.minecraft.world.level.entity.EntityTickList and net.minecraft.world.level.TickListServer are in unnamed module of loader 'app') [05:44:22 WARN]: at primal.bukkit.nms.Catalyst17.getTickList(Catalyst17.java:341) [05:44:22 WARN]: at com.volmit.react.util.TickListSplitter.(TickListSplitter.java:31) [05:44:22 WARN]: at com.volmit.react.controller.TickListController.on(TickListController.java:31) [05:44:22 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor71.execute(Unknown Source) [05:44:22 WARN]: at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) [05:44:22 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) [05:44:22 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [05:44:22 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) [05:44:22 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:622) [05:44:22 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) [05:44:22 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) [05:44:22 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) [05:44:22 WARN]: at java.base/java.lang.Thread.run(Thread.java:831) [05:44:22 INFO]: Preparing start region for dimension minecraft:the_end 05:44:23 INFO: Preparing spawn area: 0% 05:44:23 INFO: Preparing spawn area: 0% 05:44:23 INFO: Time elapsed: 855 ms [05:44:23 WARN]: java.lang.ClassCastException: class net.minecraft.world.level.entity.EntityTickList cannot be cast to class net.minecraft.world.level.TickListServer (net.minecraft.world.level.entity.EntityTickList and net.minecraft.world.level.TickListServer are in unnamed module of loader 'app') [05:44:23 WARN]: at primal.bukkit.nms.Catalyst17.getTickList(Catalyst17.java:341) [05:44:23 WARN]: at com.volmit.react.util.TickListSplitter.(TickListSplitter.java:31) [05:44:23 WARN]: at com.volmit.react.controller.TickListController.on(TickListController.java:31) [05:44:23 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor71.execute(Unknown Source) [05:44:23 WARN]: at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) [05:44:23 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) [05:44:23 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [05:44:23 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) [05:44:23 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:622) [05:44:23 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) [05:44:23 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) [05:44:23 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) [05:44:23 WARN]: at java.base/java.lang.Thread.run(Thread.java:831) 05:44:23 INFO: Running delayed init tasks

05:44:23 INFO: Timings Reset

eternitymoe commented 3 years ago

Here is the full startup log for a NEW 1.17.1 paper server with React and no any config modifiled.

Platform: Windows 10 21H1 x64 Java Version: Java 16 Plugins: React, ProtocolLib

HarvelsX commented 3 years ago

This issue occurs due to the replacement of TickListServer with EntityTickList in newer versions of Paper assemblies (possibly others). A simple way out of the situation is to change the method for obtaining the list of server ticks: https://github.com/VolmitSoftware/React/blob/master/src/main/java/primal/bukkit/nms/Catalyst17.java#L333

on (this will probably only work for Paper, did not consider changes in Bukkit, Spigot):

try
         {
             Field f = WorldServer.class.getDeclaredField("F");
-            Field ff = TickListServer.class.getDeclaredField("d");
+            Field ff = EntityTickList.class.getDeclaredField("entities");
             f.setAccessible(true);
             ff.setAccessible(true);
-            TickListServer<?> l = (TickListServer<?>) f.get(((CraftWorld) world).getHandle());
-            return (Set<Object>) ff.get(l);
+            EntityTickList l = (EntityTickList) f.get(((CraftWorld) world).getHandle());
+            return Sets.newHashSet(ff.get(l));
         }