OHakimen / MorePeripherals

Adds new peripherals for CC:Tweaked
MIT License
8 stars 2 forks source link

[1.18.2] FTB Plexiglass mountain: grinder interface loses sword #12

Closed 1480c1 closed 2 years ago

1480c1 commented 2 years ago

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:

https://user-images.githubusercontent.com/8345542/193141674-1e242c50-a649-4afd-ab9a-0afdfa3c267c.mp4

OHakimen commented 2 years ago

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

1480c1 commented 2 years ago

Do you have a link to the commit that fixes it, or is it a local patch? Is it https://github.com/JheffersonMarques/MorePeripherals/commit/ee89d0a9fe123fa0f422856524a55a09adf89104#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

1480c1 commented 2 years ago

Opened an issue on FTB's side https://github.com/FTBTeam/FTB-Modpack-Issues/issues/1360

1480c1 commented 2 years ago

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

1480c1 commented 2 years ago

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

1480c1 commented 2 years ago

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

OHakimen commented 2 years ago

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

need to investigate it further

1480c1 commented 2 years ago

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.

OHakimen commented 2 years ago

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 ?

1480c1 commented 2 years ago

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

Does not work, sword or no sword, same behavior

OHakimen commented 2 years ago

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

OHakimen commented 2 years ago

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

1480c1 commented 2 years ago

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.

OHakimen commented 2 years ago

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

thx for all the help so far :D

1480c1 commented 2 years ago

Thanks for being responsive

OHakimen commented 2 years ago

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 .-.

OHakimen commented 2 years ago

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

1480c1 commented 2 years ago

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

1480c1 commented 2 years ago

Thanks for the fix

1480c1 commented 2 years ago

Tested 1.7.3 and can confirm it works 🥳