Fix Biomes not properly copying over ids loaded from the save to the new Dynamic Registry.

This commit is contained in:
LexManos 2020-11-01 20:30:38 -08:00
parent fed7beab89
commit 7d00d015f3
2 changed files with 17 additions and 4 deletions

View file

@ -0,0 +1,11 @@
--- a/net/minecraft/util/registry/DynamicRegistries.java
+++ b/net/minecraft/util/registry/DynamicRegistries.java
@@ -90,6 +90,8 @@
RegistryKey<? extends Registry<E>> registrykey = p_243607_2_.func_243622_a();
boolean flag = !registrykey.equals(Registry.field_243549_ar) && !registrykey.equals(Registry.field_239698_ad_);
Registry<E> registry = field_243600_c.func_243612_b(registrykey);
+ if (!registrykey.equals(Registry.field_239698_ad_))
+ registry = ((Registry<Registry<E>>)WorldGenRegistries.field_243650_b).func_230516_a_((RegistryKey<Registry<E>>)registrykey);
MutableRegistry<E> mutableregistry = p_243607_0_.func_243612_b(registrykey);
for(Entry<RegistryKey<E>, E> entry : registry.func_239659_c_()) {

View file

@ -22,6 +22,7 @@ package net.minecraftforge.registries;
import java.util.BitSet; import java.util.BitSet;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -840,11 +841,12 @@ public class ForgeRegistry<V extends IForgeRegistryEntry<V>> implements IForgeRe
public static class Snapshot public static class Snapshot
{ {
public final Map<ResourceLocation, Integer> ids = Maps.newTreeMap(); private static final Comparator<ResourceLocation> sorter = (a,b) -> a.compareNamespaced(b);
public final Map<ResourceLocation, ResourceLocation> aliases = Maps.newTreeMap(); public final Map<ResourceLocation, Integer> ids = Maps.newTreeMap(sorter);
public final Map<ResourceLocation, ResourceLocation> aliases = Maps.newTreeMap(sorter);
public final Set<Integer> blocked = Sets.newTreeSet(); public final Set<Integer> blocked = Sets.newTreeSet();
public final Set<ResourceLocation> dummied = Sets.newTreeSet(); public final Set<ResourceLocation> dummied = Sets.newTreeSet(sorter);
public final Map<ResourceLocation, String> overrides = Maps.newTreeMap(); public final Map<ResourceLocation, String> overrides = Maps.newTreeMap(sorter);
private PacketBuffer binary = null; private PacketBuffer binary = null;
public CompoundNBT write() public CompoundNBT write()