From 2d3e4fff06f22d4943443acf9bc78a1d08cf6cf9 Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:55:05 +0900 Subject: [PATCH] Fix inconsistency of placed feature locations `BiomeSource#getBiomes` mixin applies to all biome sources, including one for Overworld. The return value is a set; however one caller in the worldgen code iterates over it: `PlacedFeatureIndexer`. Using a hash set here randomizes the return value, affecting feature placement. Use a linked hash set instead. --- .../net/fabricmc/fabric/mixin/biome/BiomeSourceMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/mixin/biome/BiomeSourceMixin.java b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/mixin/biome/BiomeSourceMixin.java index 546d5b2cf6..766cdbf822 100644 --- a/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/mixin/biome/BiomeSourceMixin.java +++ b/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/mixin/biome/BiomeSourceMixin.java @@ -17,7 +17,7 @@ package net.fabricmc.fabric.mixin.biome; import java.util.Collections; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Set; import java.util.function.Supplier; @@ -33,7 +33,7 @@ public class BiomeSourceMixin { @Redirect(method = "getBiomes", at = @At(value = "INVOKE", target = "Ljava/util/function/Supplier;get()Ljava/lang/Object;")) private Object getBiomes(Supplier>> instance) { - var biomes = new HashSet<>(instance.get()); + var biomes = new LinkedHashSet<>(instance.get()); fabric_modifyBiomeSet(biomes); return Collections.unmodifiableSet(biomes); }