Apollounknowndev / lithostitched

A library mod with new configurability and compatibility enhancements for worldgen
MIT License
6 stars 3 forks source link

Minimal side effect in mixin #16

Open SettingDust opened 6 days ago

SettingDust commented 6 days ago

The ChunkMapMixin is redirecting RandomState#create. Why not inject at return and use a RandomStateAccessor set the values instead of replacing the object?

Can you push the latest code so that I can contribute?

Apollounknowndev commented 4 days ago

I don't see why this would matter? It gets applied the same either way, and WrapOperation means it won't break if another mod mixins the same method.

SettingDust commented 4 days ago

It's redirecting on 1.20.1

Apollounknowndev commented 4 days ago

It's far more effort to move off of a @Redirect; The object has to basically be reconstructed. Unless you have a specific use case where this breaks another mod, it won't be fixed.

SettingDust commented 4 days ago

What's to reconstruct? WrapOperation or Inject is enough to modify the field like how the Lithostitched do it now

Apollounknowndev commented 4 days ago

You can't simply swap out the noise router in the random state, all the noise router fields need to be mapped/visited again and several fields need to be re-accessed. It's a hassle. Hard to explain without showing the code which I can't access at the moment.