MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.6k stars 434 forks source link

Add ability to robots to obtain nearby experience orbs #3702

Open zeng-github01 opened 7 months ago

zeng-github01 commented 7 months ago

Temporary fix #3289

Existing bug: The format of settings.conf is wrong and cannot be parsed correctly, which will cause a crash.

A temporary fix has been made to this bug. Looks like a past patch oversight caused the crash, so it needs to be reviewed

zeng-github01 commented 7 months ago

It looks like the cause of the crash is two missing configuration entries, something the past patch missed.

zeng-github01 commented 7 months ago

@asiekierka After investigation, Minecraft does not fire any events when a transaction is triggered. Only some experience orbs will be spawned This problem cannot be fixed through ordinary solutions in the current version.

The only solution might be to add a custom event trigger to “useRecipe” through a mixin or ASM

A feasible method is to imitate this submission and add a logic to absorb experience balls in Trade.scala when the complateTrade judgment is completed, but there may be a lag.

Or just like this PR, giving players the power to customize

zeng-github01 commented 7 months ago

@asiekierka The patch has been tested and meets the expected results