IntelligenceModding / AdvancedPeripherals

Advanced Peripherals adds many new features to the computercraft modification
https://advancedperipherals.netlify.app/
Apache License 2.0
108 stars 74 forks source link

java runtime exception with rs bridge #544

Closed BunnyStardust closed 11 months ago

BunnyStardust commented 11 months ago

Describe

I wrote the code:

rs = peripheral.wrap("back") 
for k, v in pairs (rs.listItems()) do
 print (k, v)
end

and received an error of "Java Exception Thrown: java.lang.RuntimeException: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER"

**This is on an Apex sever running many mods.

Full details from server log below:**

06.01 23:30:44 [Server] Server thread/ERROR [ne.mi.fm.lo.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER
06.01 23:30:44 [Server] Server thread/ERROR [da.co.co.co.LuaContext/COMPUTER_ERROR.JAVA]: Error running task
06.01 23:30:44 [Server] INFO java.lang.RuntimeException: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER
06.01 23:30:44 [Server] INFO at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:57) ~[fmlloader-1.20.1-47.2.17.jar%2369!/:1.0] {}
06.01 23:30:44 [Server] INFO at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar%2355!/:?] {}
06.01 23:30:44 [Server] INFO at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar%2355!/:?] {}
06.01 23:30:44 [Server] INFO at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar%2355!/:?] {}
06.01 23:30:44 [Server] INFO at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?] {}
06.01 23:30:44 [Server] INFO at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
06.01 23:30:44 [Server] INFO at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.10.jar:?] {}
06.01 23:30:44 [Server] INFO at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
06.01 23:30:44 [Server] INFO at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.10.jar:?] {}
06.01 23:30:44 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] {}
06.01 23:30:44 [Server] INFO at io.ejekta.bountiful.content.BountyItem.m_7626_(BountyItem.java:35) ~[Bountiful-6.0.3+1.20.1-forge.jar%23261!/:?] {re:classloading}
06.01 23:30:44 [Server] INFO at net.minecraft.world.item.ItemStack.m_41786_(ItemStack.java:580) ~[server-1.20.1-20230612.114412-srg.jar%23389!/:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack,pl:mixin:APP:placebo.mixins.json:ItemStackMixin,pl:mixin:APP:apotheosis.mixins.json:ItemStackMixin,pl:mixin:APP:attributeslib.mixins.json:ItemStackMixin,pl:mixin:APP:veinmining.mixins.json:ItemStackMixin,pl:mixin:APP:fastsuite.mixins.json:ItemStackMixin,pl:mixin:APP:bettercombat.mixins.json:ItemStackMixin,pl:mixin:A}
06.01 23:30:44 [Server] INFO at net.minecraft.world.item.ItemStack.m_41611_(ItemStack.java:911) ~[server-1.20.1-20230612.114412-srg.jar%23389!/:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack,pl:mixin:APP:placebo.mixins.json:ItemStackMixin,pl:mixin:APP:apotheosis.mixins.json:ItemStackMixin,pl:mixin:APP:attributeslib.mixins.json:ItemStackMixin,pl:mixin:APP:veinmining.mixins.json:ItemStackMixin,pl:mixin:APP:fastsuite.mixins.json:ItemStackMixin,pl:mixin:APP:bettercombat.mixins.json:ItemStackMixin,pl:mixin:A}
06.01 23:30:44 [Server] INFO at de.srendi.advancedperipherals.common.util.inventory.ItemUtil.getFingerprint(ItemUtil.java:56) ~[AdvancedPeripherals-1.20.1-0.7.35b.jar%23244!/:0.7.35b] {re:classloading}
06.01 23:30:44 [Server] INFO at de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorage.getObjectFromStack(RefinedStorage.java:202) ~[AdvancedPeripherals-1.20.1-0.7.35b.jar%23244!/:0.7.35b] {re:classloading}
06.01 23:30:44 [Server] INFO at de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorage.lambda$listItems$1(RefinedStorage.java:104) ~[AdvancedPeripherals-1.20.1-0.7.35b.jar%23244!/:0.7.35b] {re:classloading}
06.01 23:30:44 [Server] INFO at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {re:mixin}
06.01 23:30:44 [Server] INFO at de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorage.listItems(RefinedStorage.java:104) ~[AdvancedPeripherals-1.20.1-0.7.35b.jar%23244!/:0.7.35b] {re:classloading}
06.01 23:30:44 [Server] INFO at de.srendi.advancedperipherals.common.addons.computercraft.peripheral.RsBridgePeripheral.listItems(RsBridgePeripheral.java:68) ~[AdvancedPeripherals-1.20.1-0.7.35b.jar%23244!/:0.7.35b] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.core.asm.PeripheralMethodSupplier.lambda$static$0(PeripheralMethodSupplier.java:28) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.core.asm.PeripheralMethodSupplier.lambda$static$2(PeripheralMethodSupplier.java:35) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.api.lua.TaskCallback.execute(TaskCallback.java:30) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.core.computer.LuaContext.lambda$issueMainThreadTask$0(LuaContext.java:29) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.core.computer.mainthread.MainThreadExecutor.execute(MainThreadExecutor.java:138) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.core.computer.mainthread.MainThread.tick(MainThread.java:139) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.shared.computer.core.ServerContext.tick(ServerContext.java:156) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.shared.CommonHooks.onServerTickStart(CommonHooks.java:48) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.shared.ForgeCommonHooks.onServerTick(ForgeCommonHooks.java:50) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading}
06.01 23:30:44 [Server] INFO at dan200.computercraft.shared.__ForgeCommonHooks_onServerTick_ServerTickEvent.invoke(.dynamic) ~[cc-tweaked-1.20.1-forge-1.109.3.jar%23265!/:1.109.3] {re:classloading,pl:eventbus:B}
06.01 23:30:44 [Server] INFO at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {}
06.01 23:30:44 [Server] INFO at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {}
06.01 23:30:44 [Server] INFO at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {}
06.01 23:30:44 [Server] INFO at net.minecraftforge.event.ForgeEventFactory.onPreServerTick(ForgeEventFactory.java:945) ~[forge-1.20.1-47.2.17-universal.jar%23394!/:?] {re:mixin,re:classloading,pl:mixin:APP:aether.mixins.json:common.ForgeEventFactoryMixin,pl:mixin:A}
06.01 23:30:44 [Server] INFO at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:812) ~[server-1.20.1-20230612.114412-srg.jar%23389!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:fastload.mixins.json:server.MinecraftServerMixin,pl:mixin:A}
06.01 23:30:44 [Server] INFO at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23389!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:fastload.mixins.json:server.MinecraftServerMixin,pl:mixin:A}
06.01 23:30:44 [Server] INFO at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23389!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:fastload.mixins.json:server.MinecraftServerMixin,pl:mixin:A}
06.01 23:30:44 [Server] INFO at java.lang.Thread.run(Thread.java:840) ~[?:?] {re:mixin}

Is there any way I can fix this or is it a bug with the mod?

Steps to reproduce

  1. Install various mods
  2. Write code to access the items of refined storage
  3. Run the code

Multiplayer?

Yes

Version

1.20.1-0.7.32b (Latest 1.20.1)

Minecraft, Forge and maybe other related mods versions

Forge 47.2.0, actual AP version is 1.20.1-0.7.35b

Screenshots or Videos

No response

Crashlog/log

No response

zyxkad commented 11 months ago

what mod did you used?

zyxkad commented 11 months ago

This looks like you put a client side mod on server, not AP issue

zyxkad commented 11 months ago

and please wrap your logs in the codeblock ``` // logs ```

or, upload it to https://gist.github.com and public the link here

SirEndii commented 11 months ago

Please report to https://github.com/ejektaflex/Bountiful

We use the display name of items to calculate the fingerprint. Bountiful puts timers(?) or other stuff into the display name, which uses the Minecraft Client class which crashes the server/prevents execution.

See https://github.com/ejektaflex/Bountiful/blob/971b7a21321c1fa317a225bdeb8f89976c4b33f9/common/src/main/java/io/ejekta/bountiful/content/BountyItem.kt#L35