LordDeatHunter / FabricaeExNihilo

Fabricate from nothing
MIT License
11 stars 9 forks source link

Mutable Barrel mode recipe #27

Closed TheDrawingCoder-Gamer closed 1 year ago

TheDrawingCoder-Gamer commented 2 years ago

Recipe's barrel modes are mutable, which is not what recipes should be. Probably should make an immutable version to prevent silly issues stemming from fetching an invalid output.

MattiDragon commented 2 years ago

I don't really know of a good way to architect this. Would every mode have an immutable version, if so serial logic becomes way more complicated. A flag would be possible, but would probably not cover all edge cases

TheDrawingCoder-Gamer commented 2 years ago

Simply wrapping a mutable one with controlled access and copys on wrap and unwrap would work

This is also why I prefer langs like scala - they have types built around being immutable and come with extra copy fields that make it easy to change without truly changing.

MattiDragon commented 1 year ago

This might have already been fixed. If not it will be fixed with the barrel rework in the 1.20 version