{"id":16368002,"url":"https://github.com/ephys/cookiecore","last_synced_at":"2025-07-09T03:10:57.888Z","repository":{"id":19146668,"uuid":"22377000","full_name":"ephys/CookieCore","owner":"ephys","description":"Utils for my mods","archived":false,"fork":false,"pushed_at":"2022-07-18T17:02:53.000Z","size":460,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"1.18.2","last_synced_at":"2025-04-07T17:11:36.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ephys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-29T11:01:05.000Z","updated_at":"2024-10-01T02:21:51.000Z","dependencies_parsed_at":"2022-08-21T00:10:15.680Z","dependency_job_id":null,"html_url":"https://github.com/ephys/CookieCore","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ephys/CookieCore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2FCookieCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2FCookieCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2FCookieCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2FCookieCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ephys","download_url":"https://codeload.github.com/ephys/CookieCore/tar.gz/refs/heads/1.18.2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephys%2FCookieCore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264384389,"owners_count":23599612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T02:51:23.990Z","updated_at":"2025-07-09T03:10:57.866Z","avatar_url":"https://github.com/ephys.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CookieCore\n\nLibrary mod for ephys' mods.\n\n## Config Generation\n\nIn the constructor of your mod, add `ConfigSynchronizer.synchronizeConfig();` (`be.ephys.cookiecore.config.ConfigSynchronizer`) to launch config synchronization for your mod.\n\nThen in any class, you can declare static configuration fields:\n\n```java\nclass MyFeature {\n  @Config(name = \"myfeature.enabled\", description = \"Enable 'MyFeature'\")\n  @Config.BooleanDefault(value = true)\n  public static ForgeConfigSpec.BooleanValue enabled;\n}\n```\n\nFields annotated with `@Config` + `@Config.\u003ctype\u003eDefault` will be set to an instance of `ForgeConfigSpec.ConfigValue` that you can use.\n\nOne of the `@Config.\u003ctype\u003eDefault` annotations *must* be specified.\n\n### Supported config types\n\n**string:**\n\n```java\nclass MyFeature {\n  @Config(name = \"namespace.subnamespace.key\")\n  @Config.StringDefault(\"default value\")\n  public static ForgeConfigSpec.ConfigValue\u003cString\u003e myConfigValue;\n}\n```\n\n**string list:**\n\n*important*: Due to limitations in both the TOML parser, and Java annotations, the `StringListDefault` accepts an ARRAY of strings,\n    but the `ForgeConfigSpec.ConfigValue\u003c\u003e` must use a `List` as its generic!\n\n```java\nclass MyFeature {\n  @Config(name = \"namespace.subnamespace.key\")\n  @Config.StringListDefault({\"value1\", \"value2\"})\n  public static ForgeConfigSpec.ConfigValue\u003cList\u003cString\u003e\u003e myConfigValue;\n}\n```\n\n**boolean:**\n\n```java\nclass MyFeature {\n  @Config(name = \"myfeature.enabled\", description = \"Enable 'MyFeature'\")\n  @Config.BooleanDefault(value = true)\n  public static ForgeConfigSpec.BooleanValue enabled;\n}\n```\n\n**int:**\n\n```java\nclass MyFeature {\n  @Config(name = \"range_computation.base_range\", description = \"What is the beacon base range?\")\n  @Config.IntDefault(10)\n  public static ForgeConfigSpec.IntValue baseRange;\n}\n```\n\n**long:**\n\n```java\nclass MyFeature {\n  @Config(name = \"range_computation.base_range\", description = \"What is the beacon base range?\")\n  @Config.LongDefault(10)\n  public static ForgeConfigSpec.LongValue baseRange;\n}\n```\n\n**double:**\n\n```java\nclass MyFeature {\n  @Config(name = \"range_computation.base_range\", description = \"What is the beacon base range?\")\n  @Config.DoubleDefault(10.5)\n  public static ForgeConfigSpec.DoubleValue baseRange;\n}\n```\n\n*enum:**\n\n```java\nclass MyFeature {\n  @Config(name = \"range_computation.vertical_range_type\")\n  @Config.EnumDefault(value = \"FullHeight\", enumType = BeaconVerticalRangeType.class)\n  // BeaconVerticalRangeType is an enum\n  public static ForgeConfigSpec.EnumValue\u003cBeaconVerticalRangeType\u003e verticalRangeType;\n}\n```\n\n### Escape hatch\n\nIf you need to build part of the config object yourself, you can use `@OnBuildConfig` on a *static* method.\n\n```java\nclass MyFeature {\n  public static ForgeConfigSpec.IntValue configValue;\n  \n  @OnBuildConfig()\n  public static onBuildConfig(ForgeConfigSpec.Builder rootBuilder) {\n    configValue = rootBuilder.defineInRange(\"my_config_value\", 5, 0, 10);\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephys%2Fcookiecore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fephys%2Fcookiecore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephys%2Fcookiecore/lists"}