mekanism / Mekanism

A mod for Minecraft
MIT License
1.39k stars 531 forks source link

Mekanism Reactor - Open Computers setInjectionRate "Invalid Parameters" #8061

Closed weiserhase closed 5 months ago

weiserhase commented 7 months ago

Issue description

I cannot set the Injection Rate of the Fusion Reactor with the OpenComputer Adapter. I tried multiple things like reinstalling the modpack(1.12.2 Pack), creating a new computer/reactor. But still can't get it to work. The script i use silent fails and does nothing except for the executing it in the lua REPL. I got it to work in one situation but i dont know how exactly i could reproduce it.

The Issue seems to be closely related to #2972

Steps to reproduce

Executing this script :

   local component= require("component")
   local reactor = component.reactor_logic_adapter
   print(reactor.getInjectionRate())
   print(reactor.setInjectionRate(10))
   print(reactor.getInjectionRate())

Which Produces

     2
     "Invalid Prameters"
     2

Minecraft version

1.20.1 or earlier (No longer being developed)

NeoForge version

Not Neoforge but: forge-1.12.2-14.23.5.2860.jar

Mekanism version

Older

Other relevant versions

Mekanism-1.12.2-9.8.3.390.jar OpenComputers-MC1.12.2-1.8.3+274990f.jar

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

weiserhase commented 6 months ago

I investigated the problems further and i founf the following docs https://github.com/mekanism/Mekanism/blob/216cf0db516b5791ea04748ba914b967b9a9e1f7/src/datagen/generated/mekanism/data/mekanism/computer_help/methods.json#L3541 That suggests the method of calling with an integer should work.

pupnewfster commented 5 months ago

What you are referencing is from modern versions of the game. This old methods for it can be found here: https://github.com/mekanism/Mekanism/blob/1.7.10/src/main/java/mekanism/generators/common/tile/reactor/TileEntityReactorLogicAdapter.java#L139-L202