refinedmods / refinedstorage2

Refined Storage is a mass storage mod for Minecraft that offers the player a network-based storage system, allowing them to store items and fluids on a massively expandable device network.

Home Page:https://refinedmods.com/refined-storage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow mixed storages

raoulvdberge opened this issue · comments

Describe your enhancement

  • Remove ResourceList and Storage generic soup.
  • StorageChannel exists to segregate storage types from each other. However, if we remove the generics requirement on Storage we can have a single mixed StorageChannel. Segregation is not needed at that point (it was needed to satisfy the generic), so a natural consequence is that we can use StorageNetworkComponent and let that be the single StorageChannel for the network.
  • If there is a single storage channel, blocks like the disk drive don't need to maintain a storage per storage channel. They can expose one storage for all the storage channels, making it easy to reason about.
  • We do remove some compile time safety because we remove a generic. However, 1) it's a natural consequence if we want to allow mixed storage channels and 2) the compile time safety was mostly gone anyway already due to all the unchecked and rawtypes operations.
  • We add ResourceKey to provide some level of safety (no Object)
  • We can remove StorageChannelType (there is now a single StorageChannel so..) and move some logic to ResourceKey and introduce ResourceType.