From de03eb6e3c0b90e8c15dec1ef9ddc13335476d3a Mon Sep 17 00:00:00 2001 From: cpw Date: Thu, 3 Sep 2020 12:08:59 -0400 Subject: [PATCH] Fix compiler issue in eclipse properly Signed-off-by: cpw --- src/main/java/net/minecraftforge/registries/GameData.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/registries/GameData.java b/src/main/java/net/minecraftforge/registries/GameData.java index df9276912..587738169 100644 --- a/src/main/java/net/minecraftforge/registries/GameData.java +++ b/src/main/java/net/minecraftforge/registries/GameData.java @@ -72,6 +72,7 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.loot.GlobalLootModifierSerializer; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.RegistryEvent.MissingMappings; +import net.minecraftforge.fml.ModContainer; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.ModLoadingStage; import net.minecraftforge.fml.common.EnhancedRuntimeException; @@ -94,6 +95,8 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.function.BiConsumer; +import java.util.function.BiFunction; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -339,7 +342,8 @@ public class GameData keys.add(0, BLOCKS.func_240901_a_()); keys.add(1, ITEMS.func_240901_a_()); - return keys.stream().map(rl -> (ModLoadingStage.EventGenerator)(mc -> RegistryManager.ACTIVE.getRegistry(rl).getRegisterEvent(rl))); + final Function> modContainerEventGeneratorFunction = rl -> RegistryManager.ACTIVE.getRegistry(rl).getRegisterEvent(rl); + return keys.stream().map(rl -> ModLoadingStage.EventGenerator.fromFunction(mc -> modContainerEventGeneratorFunction.apply(rl))); } public static ModLoadingStage.EventDispatcher> buildRegistryEventDispatch() {