
Seven segment display causes a crash in dedicated servers
Voxelstice opened this issue ยท 5 comments
to start off, i have NO idea if this bug happens in singleplayer. i have never used the seven segment display block in singleplayer, and i only tried it in multiplayer because someone asked what that block is, and i wanted to figure it out.
this crash only started after i placed creative generator on the power port side of this block. the server continued to crash after. only solution was loading a backup
- Minecraft Version: 1.20.1 Forge 47.4.0
- Create Version: 6.0.6
- Create: The Factory Must Grow Version: 1.0.2c
java.lang.NoClassDefFoundError: net/minecraft/client/renderer/blockentity/BlockEntityRenderer
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] {}
at java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[?:?] {}
at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:119) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.10.jar:?] {}
at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] {}
at net.minecraftforge.eventbus.EventSubclassTransformer.buildEvents(EventSubclassTransformer.java:97) ~[eventbus-6.0.5.jar%2352!/:?] {}
at net.minecraftforge.eventbus.EventSubclassTransformer.transform(EventSubclassTransformer.java:48) ~[eventbus-6.0.5.jar%2352!/:?] {}
at net.minecraftforge.eventbus.EventBusEngine.processClass(EventBusEngine.java:26) ~[eventbus-6.0.5.jar%2352!/:?] {}
at net.minecraftforge.eventbus.service.ModLauncherService.processClassWithFlags(ModLauncherService.java:32) ~[eventbus-6.0.5.jar%2352!/:6.0.5+6.0.5+master.eb8e549b] {}
at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar%2355!/:?] {}
at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar%2355!/:?] {}
at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar%2355!/:?] {}
at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.10.jar:?] {}
at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] {}
at com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayBlockEntity.getSegments(SegmentedDisplayBlockEntity.java:74) ~[tfmg-1.0.2c.jar%23208!/:1.0.2c] {re:classloading,pl:rei_plugin_compatibilities:B}
at com.drmangotea.tfmg.content.electricity.utilities.segmented_display.SegmentedDisplayBlockEntity.lazyTick(SegmentedDisplayBlockEntity.java:65) ~[tfmg-1.0.2c.jar%23208!/:1.0.2c] {re:classloading,pl:rei_plugin_compatibilities:B}
at com.simibubi.create.foundation.blockEntity.SmartBlockEntity.tick(SmartBlockEntity.java:81) ~[create-1.20.1-6.0.6.jar%23172!/:6.0.6] {re:mixin,re:classloading,pl:rei_plugin_compatibilities:B}
at com.drmangotea.tfmg.content.electricity.base.ElectricBlockEntity.tick(ElectricBlockEntity.java:223) ~[tfmg-1.0.2c.jar%23208!/:1.0.2c] {re:classloading,pl:rei_plugin_compatibilities:B}
at com.simibubi.create.foundation.blockEntity.SmartBlockEntityTicker.m_155252_(SmartBlockEntityTicker.java:15) ~[create-1.20.1-6.0.6.jar%23172!/:6.0.6] {re:classloading,pl:rei_plugin_compatibilities:B}
at net.minecraft.world.level.chunk.LevelChunk$BoundTickingBlockEntity.m_142224_(LevelChunk.java:689) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading,pl:rei_plugin_compatibilities:B}
at net.minecraft.world.level.chunk.LevelChunk$RebindableTickingBlockEntityWrapper.m_142224_(LevelChunk.java:782) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading,pl:rei_plugin_compatibilities:B}
at net.minecraft.world.level.Level.m_46463_(Level.java:468) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:rei_plugin_compatibilities:B,pl:mixin:APP:sereneseasons.mixins.json:MixinLevel,pl:mixin:APP:create_new_age.mixins.json:LevelMixin,pl:mixin:APP:refurbished_furniture.common.mixins.json:LevelMixin,pl:mixin:A}
at net.minecraft.server.level.ServerLevel.m_8793_(ServerLevel.java:351) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:rei_plugin_compatibilities:B,pl:mixin:APP:glitchcore.mixins.json:MixinServerLevel,pl:mixin:APP:sereneseasons.mixins.json:MixinServerLevel,pl:mixin:APP:refurbished_furniture.common.mixins.json:ServerLevelMixin,pl:mixin:APP:create.mixins.json:accessor.ServerLevelAccessor,pl:mixin:A}
at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:893) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:rei_plugin_compatibilities:B,pl:mixin:A}
at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:283) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:rei_plugin_compatibilities:B,pl:mixin:APP:mixins/common/nochatreports.mixins.json:server.MixinDedicatedServer,pl:mixin:A}
at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:814) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:rei_plugin_compatibilities:B,pl:mixin:A}
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:rei_plugin_compatibilities:B,pl:mixin:A}
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:rei_plugin_compatibilities:B,pl:mixin:A}
at java.lang.Thread.run(Thread.java:840) ~[?:?] {}
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.blockentity.BlockEntityRenderer
at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:141) ~[securejarhandler-2.1.10.jar:?] {}
at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] {}
... 36 more
here's the full crash report:
ctfmg-crash-report.txt
i'd assume this issue is likely from the lack of serverside checking for a renderer object
I presume what happens is that the code for rendering seven segment displays is not ran on the client but on the server, or on both. As the dedicated server does not need to render anything, it is stripped of all rendering code so that explains the class not found. Should be a pretty simple fix?
I've dug through the code and found the problem: in SegmentedDisplayBlockEntity.java on line 75 and further, the current code is as follows:
List<Integer> segments = SegmentedDisplayRenderer.SYMBOLS_TO_SEGMENTS.get(getDisplayedStrings().get(true).toLowerCase());
List<Integer> segments2 = SegmentedDisplayRenderer.SYMBOLS_TO_SEGMENTS.get(getDisplayedStrings().get(false).toLowerCase());
The SegmentedDisplayRenderer extends SafeBlockEntityRenderer, which (I suspect) basically nukes the class on server builds. This is however completely unnecessary as the public static Map<String, List<Integer>> SYMBOLS_TO_SEGMENTS
does not require to be safely handled on only the client side. Therefore, I suggest moving this map to another file, say SegmentedDisplaySegments.java
, which will NOT be client-side only, and will therefore no longer crash the game.
It appears there is way more of these kinds of things, in my case not even letting me run a dedicated server. For example, TFMGPipes.java
runs in both server and client but uses TFMGPipeAttachmentModel
which is only in the client.
Hi, I've made a fix for this issue in PR #226.