More Peripherals

More Peripherals

219k Downloads

[1.18.2] FTB Plexiglass mountain: grinder interface loses sword

1480c1 opened this issue · 20 comments

commented

Reproduction steps:

  1. Place down Grinder
  2. Place wooden sword in Grinder and keep the GUI open
  3. Observe it disappearing between 0-3 seconds

Reproduction video:

repro.mp4
commented

I also did restart the server, but stilll had same issue

commented

Unless 1.7.2 requires an updated mod else where, it seems attack() might be broken for servers

image

image

server log:

[19:15:01] [ComputerCraft-Coroutine-1/FATAL] [ne.mi.fm.lo.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER
[19:15:01] [ComputerCraft-Coroutine-1/ERROR] [computercraft/]: Error calling call on dan200.computercraft.core.apis.PeripheralAPI@7eb99db9
java.lang.RuntimeException: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER
        at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:57) ~[fmlloader-1.18.2-40.1.76.jar%2317!/:1.0] {}
        at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-9.1.3.jar%235!/:?] {}
        at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-9.1.3.jar%235!/:?] {}
        at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-9.1.3.jar%235!/:?] {}
        at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:110) ~[securejarhandler-1.0.3.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.lambda$findClass$16(ModuleClassLoader.java:216) ~[securejarhandler-1.0.3.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:226) ~[securejarhandler-1.0.3.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:216) ~[securejarhandler-1.0.3.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:132) ~[securejarhandler-1.0.3.jar:?] {}
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?] {}
        at com.hakimen.peripherals.peripherals.GrinderPeripheral.attack(GrinderPeripheral.java:69) ~[MorePeripherals_1.18.2-1.7.2.jar%23190!/:1.4] {re:classloading,pl:epic_rei_lmao:B}
        at com.hakimen.peripherals.peripherals.GrinderPeripheral$cc$attack8.apply(CC generated method) ~[?:?] {re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading}
        at dan200.computercraft.core.apis.PeripheralAPI$PeripheralWrapper.call(PeripheralAPI.java:112) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at dan200.computercraft.core.apis.PeripheralAPI.call(PeripheralAPI.java:361) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at dan200.computercraft.core.apis.PeripheralAPI$cc$call61.apply(CC generated method) ~[?:?] {re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading,re:classloading}
        at dan200.computercraft.core.lua.ResultInterpreterFunction.invoke(ResultInterpreterFunction.java:61) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.function.ResumableVarArgFunction.invoke(ResumableVarArgFunction.java:77) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.function.LuaInterpreter.execute(LuaInterpreter.java:491) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.function.LuaInterpretedFunction.invoke(LuaInterpretedFunction.java:149) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.OperationHelper.invoke(OperationHelper.java:486) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.OperationHelper.invoke(OperationHelper.java:481) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.lib.BaseLib.pcall(BaseLib.java:436) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.lib.BaseLib.access$500(BaseLib.java:59) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.lib.BaseLib$BaseLibR.invoke(BaseLib.java:334) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.function.ResumableVarArgFunction.invoke(ResumableVarArgFunction.java:77) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.OperationHelper.invoke(OperationHelper.java:486) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.function.LuaInterpreter.execute(LuaInterpreter.java:403) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.function.LuaInterpretedFunction.resume(LuaInterpretedFunction.java:196) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.debug.DebugFrame.resume(DebugFrame.java:243) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.LuaThread.loop(LuaThread.java:566) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at cc.tweaked.internal.cobalt.LuaThread$1.run(LuaThread.java:463) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at dan200.computercraft.core.lua.CobaltLuaMachine.lambda$new$1(CobaltLuaMachine.java:82) ~[cc-tweaked-1.18.2-1.100.9.jar%2372!/:1.100.9] {re:classloading,pl:epic_rei_lmao:B}
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?] {}
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?] {}
        at java.lang.Thread.run(Unknown Source) [?:?] {}

I checked cc: tweaked and it seem cc-tweaked-1.18.2-1.100.9.jar does match the latest available at https://www.curseforge.com/minecraft/mc-mods/cc-tweaked/files

commented

I did check and hasSword() and other functions work fine, and attack() worked fine in 1.7.1

commented

hmm, seems like the fakeplayer that is instancied is some how tied to a client instance

need to investigate it further

commented

i have a feeling that its the usage of the fakeplayer that breaks that

commented

Perhaps this might be of interest:

Calling attack() without any mobs nearby (including myself) throws no error, but having an entity nearby does. Based on my nonexistent knowledge of java, that probably implies that the error is being thrown somewhere around https://github.com/JheffersonMarques/MorePeripherals/blob/a7cb4fa754cd854b976fda4ba7e3ff36f9be2091/src/main/java/com/hakimen/peripherals/peripherals/GrinderPeripheral.java#L57-L67 rather than when it's being instantiated or something.

commented

Perhaps this might be of interest:

Calling attack() without any mobs nearby (including myself) throws no error, but having an entity nearby does. Based on my nonexistent knowledge of java, that probably implies that the error is being thrown somewhere around

can you check if it works when it's without a sword ?

commented

can you check if it works when it's without a sword ?

Does not work, sword or no sword, same behavior

commented

i can't try it now, but tomorrow morning i'm gonna try to fix it

thx for all the help so far :D

commented

a possible fix would be removing the fakeplayer entirely and appling the damage directly, tho enchanted swords would have no difference

commented

I tested create's deployer, and it seems to attack properly, so I think there might be some merit in peeking at their code, licenses permitting.

The main reason I didn't use the deployer was because trying to extract the items from it without extracting the sword seems to be impossible without some other stuff, and I wanted to try cc.

commented

Thanks for being responsive

commented

hello, thx for sharing, i've fixed it on a patch some days ago, the latest version is 1.7.2 for 1.18.2

commented

Do you have a link to the commit that fixes it, or is it a local patch? Is it ee89d0a#diff-cc3fea7e5b82ba26bf7832678113bd34566077ce481684a57e9133641e98c2c3R40

I guess based on https://feed-the-beast.com/modpack/96_ftb_plexiglass_mountain/versions MorePeripherals_1.18.2-1.7.1.jar, the fix is not yet in, I guess I will need to ping ftb's issue tracker

commented

Opened an issue on FTB's side FTBTeam/FTB-Modpack-Issues#1360

commented

so, i found out what was breaking it

image

i've put this on the attack() to see test the sword desapearing and forgot to remove it .-.

commented

With the issue fixed, i've rebuild the mod, and put on curseforge, its the 1.7.3 version for 1.18.2, so i'm going to mark this as resolved and close the issue

thanks for the cooperation :D

commented

Ah, so that's where that message was appearing from. I didn't see it in the repo so I thought it was from somewhere else while I was in creative

commented

Thanks for the fix

commented

Tested 1.7.3 and can confirm it works 🥳