generated from DM-Earth/Fabric-Mod-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/dm/earth/deferred_registries/helper/BiomeRegistryHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.dm.earth.deferred_registries.helper; | ||
|
||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.BuiltinRegistries; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.util.registry.RegistryKey; | ||
import net.minecraft.world.biome.Biome; | ||
|
||
public class BiomeRegistryHelper { | ||
public static <T> void registerBiome(Biome biome, Identifier id) { | ||
RegistryKey<Biome> biomeKey = RegistryKey.of(Registry.BIOME_KEY, id); | ||
BuiltinRegistries.add(BuiltinRegistries.BIOME, biomeKey, biome); | ||
} | ||
|
||
public static boolean isBiomeKey(RegistryKey<?> registryKey) { | ||
return registryKey.equals(Registry.BIOME_KEY); | ||
} | ||
} |