Opt to not load the `WrappedBlockState`s
Is your feature request related to a problem? Please describe.
Due to the nature of being on a 1.8 server with zero budget, heap space is gold.
For my purposes (which I'd imagine many relate to) this heap space is wasted space.
Describe the solution you'd like
Allow for not loading the WrappedBlockStates when using the SpigotPacketEventsBuilder.
Kind of like this, but not awful.
Describe alternatives you've considered to solve your solution without us adding this as a feature?
- [x] Copy paste the class and just comment it out (hacky)
- [ ] Buy better servers (no money)
- [ ] Instrument the class at runtime (why would you do this)
- [ ] Use reflection to empty the maps (...no)
- [ ] Use
sun.misc.Unsafeto free the memory (technically unsafe, as the name implies) - [ ] Coerce the memory into loading into specific pages, then forcibly put into swap (degrades gc performance)
you never know if WrappedBlockStates will be needed or not. It would be a shading-only feature.
Maybe provide the functionality to customize it for plugins that shades PacketEvents?
For example adding an option called MappingExemptStrategy with ALL, CURRENT_VERSION, NONE, and load the mappings that matches the strategy etc etc.
I would be more in favor of a system property or just reverting back to lazy-loading the mappings. On spigot/paper everything except the server version isn't used anyway, as far as I know.