gbl / AntiGhost

Mod that requests the server to send surrounding blocks to you, to get rid of ghost blocks
MIT License
28 stars 16 forks source link

adds registration for keybinding back through mod bus (resolves #35) #39

Closed contra1337 closed 1 year ago

contra1337 commented 1 year ago

the docs are a bit unclear but to register the keymapping, it needs to go through the mod event bus instead of just in the mod class itself. this can be directly registered through an instance of the mod bus, or through a separate class annotated with @ModBusSubscriber. I chose the former to reduce scope of changes. The key is then checked through the ClientTickEvent as suggested

ref: https://docs.minecraftforge.net/en/latest/misc/keymappings/ resolves: https://github.com/gbl/AntiGhost/issues/35

one thing to consider is a timeout or locking mechanism for the keybind activation, instead of allowing it to trigger every tick while held. this is not a newly introduced issue however, it exists when using InputEvent.Key as well

also I did not change the version, not sure how you are managing this presently