Skip to content

Commit

Permalink
Add no op example
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt committed Sep 13, 2024
1 parent d790441 commit 859b391
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions docs/worldgen/biomemodifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ These Biome Modifiers are registered by NeoForge for anyone to use. The JSON exa

### None

This Biome Modifier has no operation and will do no modification. Pack makers and players can use this in a Datapack to disable mods' Biome Modifiers by overriding their Biome Modifier jsons with the below. There is no Datagen code to make this modifier.
This Biome Modifier has no operation and will do no modification. Pack makers and players can use this in a Datapack to disable mods' Biome Modifiers by overriding their Biome Modifier jsons with the below.

<Tabs>
<TabItem value="json" label="JSON" default>
Expand All @@ -45,6 +45,27 @@ This Biome Modifier has no operation and will do no modification. Pack makers an
{
"type": "neoforge:none"
}
```

</TabItem>
<TabItem value="datagen" label="Datagen">

```java
// Define keys for Datapack registry objects
public static final ResourceKey<BiomeModifier> NO_OP_EXAMPLE =
ResourceKey.create(
NeoForgeRegistries.Keys.BIOME_MODIFIERS, // The registry this key is for
ResourceLocation.fromNamespaceAndPath(MOD_ID, "no_op_example") // The registry name
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {

// Register the Biome Modifiers
bootstrap.register(NO_OP_EXAMPLE, NoneBiomeModifier.INSTANCE);
})
```

</TabItem>
Expand Down Expand Up @@ -92,8 +113,8 @@ public static final ResourceKey<BiomeModifier> ADD_FEATURES_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down Expand Up @@ -166,8 +187,8 @@ public static final ResourceKey<BiomeModifier> REMOVE_FEATURES_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down Expand Up @@ -247,8 +268,8 @@ public static final ResourceKey<BiomeModifier> ADD_SPAWNS_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down Expand Up @@ -310,8 +331,8 @@ public static final ResourceKey<BiomeModifier> REMOVE_SPAWNS_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down Expand Up @@ -379,8 +400,8 @@ public static final ResourceKey<BiomeModifier> ADD_SPAWN_COSTS_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down Expand Up @@ -442,8 +463,8 @@ public static final ResourceKey<BiomeModifier> REMOVE_SPAWN_COSTS_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down Expand Up @@ -506,8 +527,8 @@ public static final ResourceKey<BiomeModifier> ADD_CARVERS_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down Expand Up @@ -573,8 +594,8 @@ public static final ResourceKey<BiomeModifier> REMOVE_CARVERS_EXAMPLE =
);

// For some RegistrySetBuilder BUILDER
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
// being passed to DatapackBuiltinEntriesProvider
// in a listener for GatherDataEvent
BUILDER.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, bootstrap -> {
// Lookup any necessary registries
// Static registries only need to be looked up if you need to grab the tag data
Expand Down

1 comment on commit 859b391

@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: 859b3913b6f8907e2ac219293ad6257ede23a5cc
Status: ✅ Deploy successful!
Preview URL: https://07a47fc5.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-161.neoforged-docs-previews.pages.dev

Please sign in to comment.