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

Refactor forge classes #37

Closed AnimalsWritingCode closed 1 year ago

AnimalsWritingCode commented 1 year ago

This PR refactors a lot of the forge version of the mod. The summary is:

  1. Updates mod version to 1.2.0.0 since there are breaking changes to the API.
    1. The format here is MAJORMOD.MAJORAPI.MINOR.PATCH based on this suggestion from forge: https://docs.minecraftforge.net/en/stable/gettingstarted/versioning/#versioning
  2. Updates to MC 1.19.2 and forge 43.2.0.
  3. Sets the display test to IGNORE_ALL_VERSION since this is a client-only mod and shouldn't give any version errors if it's not on the server.
  4. Registers a key binding into the controls page so it can be remapped.
  5. Registers the /ghost command so that it can be autocompleted. This also removes the requirement to check all chat messages.
  6. Separates the mod lifecycle events, forge events, and block refresh code into their own classes.
  7. Adds a 10-second cooldown to the block refresh to limit packet rate. There is a new localization string with a message to inform the user. This is hard coded instead of configurable so that users cannot lower it.
    1. It may be worthwhile in the future to add the ability for a server to optionally configure this cooldown or disable the mod. I think this could be done without forcing servers to install the mod by falling back to the 10 seconds if the mod is not present/configured on the server side.
  8. Replaces the nested for loops with BlockPos.betweenClosed when getting the blocks to refresh.

Fixes #35

AnimalsWritingCode commented 1 year ago

Going to just go ahead and close this since it isn't going to be accepted.