MrCrayfish / Controllable

Adds in the ability to use a controller to play Minecraft Java Edition
https://mrcrayfish.com/mods?id=controllable
GNU General Public License v3.0
266 stars 76 forks source link

[Question] How do I use the events with the 1.20 version of the mod ? #479

Closed getItemFromBlock closed 7 months ago

getItemFromBlock commented 7 months ago

Hello, sorry to bother you again.

I am updating my mod for MC 1.20.1, and I can't figure out how to reimplement the events such as ControllerEvent.ButtonInput. It seems the code changed on Controllable's side, but I did not found any other informations about this.

Could you help me out on this ?

Thanks in advance

MrCrayfish commented 7 months ago

In 1.20 and above, all my mods switched to a multiloader design. This means that all events had to be reworked.

You can find the new events here: https://github.com/MrCrayfish/Controllable/blob/multiloader/1.20.X/Common/src/main/java/com/mrcrayfish/controllable/event/ControllerEvents.java

Events can be registered simply by ControllerEvents.<EVENT>.register(...)

BUTTON should be the event you are after.

getItemFromBlock commented 7 months ago

Thanks, I managed to reimplement almost everything

There is just one last thing left, how can I change the buttons labels shown to the player ? I implemented a GatherActions class and registered it using ControllerEvents.GATHER_ACTIONS.register(GatherEvent);, but it seems that the event is not being called. Do I have to do something else ?