From 31c789fd1170cf484767f76b9d7609e5b498e3c8 Mon Sep 17 00:00:00 2001 From: Will Toll Date: Mon, 1 Jun 2020 11:18:16 -0500 Subject: [PATCH] Fixed the nether biome mixin (#652) Fixed the nether biome mixin on MultiNoiseBiomeSource solving #650 --- .../fabric/mixin/biome/MixinTheNetherDimension.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/mixin/biome/MixinTheNetherDimension.java b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/mixin/biome/MixinTheNetherDimension.java index 5cacf35cb..a425d5602 100644 --- a/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/mixin/biome/MixinTheNetherDimension.java +++ b/fabric-biomes-v1/src/main/java/net/fabricmc/fabric/mixin/biome/MixinTheNetherDimension.java @@ -19,6 +19,8 @@ package net.fabricmc.fabric.mixin.biome; import java.util.ArrayList; import java.util.List; +import com.google.common.collect.ImmutableList; +import com.mojang.datafixers.util.Pair; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyArg; @@ -31,10 +33,10 @@ import net.fabricmc.fabric.impl.biome.InternalBiomeData; @Mixin(MultiNoiseBiomeSource.class) public class MixinTheNetherDimension { @ModifyArg(method = "method_28467", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/biome/source/MultiNoiseBiomeSource;(JLjava/util/List;Ljava/util/Optional;)V")) - private static List modifyNetherBiomes(List list) { + private static List> modifyNetherBiomes(List> list) { // the provided set is immutable, so we construct our own - List newList = new ArrayList<>(list); - newList.addAll(InternalBiomeData.getNetherBiomes()); + List> newList = new ArrayList<>(list); + newList.addAll(InternalBiomeData.getNetherBiomes().stream().flatMap((biome) -> biome.streamNoises().map((point) -> Pair.of(point, biome))).collect(ImmutableList.toImmutableList())); return newList; } }