mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-22 23:58:02 -05:00
Fixed the nether biome mixin (#652)
Fixed the nether biome mixin on MultiNoiseBiomeSource solving #650
This commit is contained in:
parent
c6ab3e1b2d
commit
31c789fd11
1 changed files with 5 additions and 3 deletions
|
@ -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;<init>(JLjava/util/List;Ljava/util/Optional;)V"))
|
||||
private static List<Biome> modifyNetherBiomes(List<Biome> list) {
|
||||
private static List<Pair<Biome.MixedNoisePoint, Biome>> modifyNetherBiomes(List<Pair<Biome.MixedNoisePoint, Biome>> list) {
|
||||
// the provided set is immutable, so we construct our own
|
||||
List<Biome> newList = new ArrayList<>(list);
|
||||
newList.addAll(InternalBiomeData.getNetherBiomes());
|
||||
List<Pair<Biome.MixedNoisePoint, Biome>> newList = new ArrayList<>(list);
|
||||
newList.addAll(InternalBiomeData.getNetherBiomes().stream().flatMap((biome) -> biome.streamNoises().map((point) -> Pair.of(point, biome))).collect(ImmutableList.toImmutableList()));
|
||||
return newList;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue