InnovativeOnlineIndustries / Titanium

Other
8 stars 25 forks source link

Allow get access to LazyOptionals in ICapabilityHolder components #79

Closed FreneticScribbler closed 3 years ago

FreneticScribbler commented 3 years ago

I want to be able to do this: this.multiInventoryComponent.getLazyOptionals().forEach(o -> o.invalidate()); this.multiTankComponent.getLazyOptionals().forEach(o -> o.invalidate());

Where necessary (when invalidateCaps is called from my tile) to neatly invalidate all of my machine capabilities. Out of curiosity, how does stuff that depends on ActiveTile handle this? Manually?

Buuz135 commented 3 years ago

Currently it doesnt invalidate, can you add it to the pr too?

FreneticScribbler commented 3 years ago

Yep will do :+1:

FreneticScribbler commented 3 years ago

Because invalidateCaps is called on chunk unload I'm unclear if I need to manually rebuild the optionals when the chunk is reloaded. Since I don't use ActiveTile I need someone else who does to test it...

Buuz135 commented 3 years ago

When a chunk loads the tile gets constructed again. So it doesnt need to get rebuilt.