Skip to content

Commit

Permalink
add back int ID syncing, with a big disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
IchHabeHunger54 committed Feb 21, 2024
1 parent 31b5bf2 commit ff5d5b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/concepts/registries.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ Let's start by creating the [registry key][resourcekey] and the registry itself:
// Of course, all mentions of spells can and should be replaced with whatever your registry actually is.
public static final ResourceKey<Registry<Spell>> SPELL_REGISTRY_KEY = ResourceKey.createRegistryKey(new ResourceLocation("yourmodid", "spells"));
public static final Registry<YourRegistryContents> SPELL_REGISTRY = new RegistryBuilder<>(SPELL_REGISTRY_KEY)
// If you want to enable integer id syncing, for networking.
// Never use integer ids yourself, even if this is enabled! This is purely intended to reduce bandwidth.
.sync(true)
// The default key. Similar to minecraft:air for blocks. This is optional.
.defaultKey(new ResourceLocation("yourmodid", "empty"))
// Effectively limits the max count. Generally discouraged, but may make sense in settings such as networking.
Expand Down

1 comment on commit ff5d5b1

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: ff5d5b12eb61997f84fbd250188cfcdfeaa055ee
Status: ✅ Deploy successful!
Preview URL: https://5976fb2f.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-48.neoforged-docs-previews.pages.dev

Please sign in to comment.