Fix too many registries being sent from server to client

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw 2019-06-23 19:54:34 -04:00
parent 216b536967
commit e5acea60e6
No known key found for this signature in database
GPG Key ID: 8EB3DF749553B1B7
2 changed files with 5 additions and 3 deletions

View File

@ -62,7 +62,7 @@ public class FMLHandshakeMessages
{
this.mods = ModList.get().getMods().stream().map(ModInfo::getModId).collect(Collectors.toList());
this.channels = NetworkRegistry.buildChannelVersions();
this.registries = RegistryManager.registryNames();
this.registries = RegistryManager.getRegistryNamesForSyncToClient();
}
private S2CModList(List<String> mods, Map<ResourceLocation, String> channels, List<ResourceLocation> registries)

View File

@ -190,8 +190,10 @@ public class RegistryManager
collect(Collectors.toList()) : Collections.emptyList();
}
public static List<ResourceLocation> registryNames()
public static List<ResourceLocation> getRegistryNamesForSyncToClient()
{
return new ArrayList<>(ACTIVE.registries.keySet());
return ACTIVE.registries.keySet().stream().
filter(resloc -> ACTIVE.synced.contains(resloc)).
collect(Collectors.toList());
}
}