Clarify in the LazyOptional which methods carry the lazyness over to the returned value and which don't. (#6750)

For consistency, this meant making a few changes:
- Renamed the existing lazy mapping method to lazyMap, to indicate that it doesn't run the mapping immediately.
- Added a new implementation of map(), which returns Optional<T>, and resolves the value in the process.
- Changed filter() to return Optional, since there's no way to filter lazily.
- Added a new method resolve(), which helps convert the custom LazyOptional class into a standard Optional, for use
with library methods that expect Optional<T>.

* Update License headers.
This commit is contained in:
David Quintana authored and GitHub committed 2020-08-25 03:11:28 +02:00
1 parent 625cd746ef
commit 600e68cace
16 files changed
+208 -20

No files matched your search

@@ -16,6 +16,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Biomes are completely redone in 1.16.2, reevaluate
package net.minecraftforge.common;