KevinDaGame / VoxelSniper-Reimagined

The premier long-distance brush editor for Minecraft, reimagined!
GNU Lesser General Public License v2.1
62 stars 6 forks source link

Clear worlds and player cache when logical server stops #215

Closed KevinDaGame closed 1 year ago

KevinDaGame commented 1 year ago

What type of PR is this? (check all applicable)

Description

The cache was not cleared, meaning that if you rejoined a world, the mod would still take from the cache, and crash the logical server because it's invalid.

Also implemented the unload world listener to prevent memory leak

QA Instructions, Screenshots, Recordings

  1. load a singleplayer world
  2. do snipe actions
  3. leave and load again
  4. do snipe actions
  5. see that it works

Added/updated tests?

[optional] What gif best describes this PR or how it makes you feel?

alt_text

KevinDaGame commented 1 year ago

LGTM, but just a thought, shouldn't we also remove Players when they leave? Doesn't look like we are doing that on Forge (although it does any matter for servers)

Good point. I have implemented it