Skip to content

Commit

Permalink
fix an oversight
Browse files Browse the repository at this point in the history
  • Loading branch information
IchHabeHunger54 committed Feb 23, 2024
1 parent 55873a1 commit cdf58f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/concepts/registries.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ BuiltInRegistries.BLOCKS.getKey(ExampleBlocksClass.EXAMPLE_BLOCK.get()); // retu
If you just want to check for the presence of an object, this is also possible, though only with keys:

```java
Registries.BLOCKS.containsKey(new ResourceLocation("minecraft", "dirt")); // true
Registries.BLOCKS.containsKey(new ResourceLocation("create", "brass_ingot")); // true only if Create is installed
BuiltInRegistries.BLOCKS.containsKey(new ResourceLocation("minecraft", "dirt")); // true
BuiltInRegistries.BLOCKS.containsKey(new ResourceLocation("create", "brass_ingot")); // true only if Create is installed
```

As the last example shows, this is possible with any mod id, and thus a perfect way to check if a certain item from another mod exists.
Expand Down

1 comment on commit cdf58f2

@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: cdf58f2f23423f8341c5c00d37fc08415b502d2c
Status: ✅ Deploy successful!
Preview URL: https://12cdef86.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-48.neoforged-docs-previews.pages.dev

Please sign in to comment.