User Tools

Site Tools


tutorial:ores

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:ores [2019/08/19 19:24] – [Adding ores to a biome] core -> ore jamieswhiteshirttutorial:ores [2019/08/19 19:31] – [Iterating Biome Registry] Rewrite jamieswhiteshirt
Line 37: Line 37:
 ==== Iterating Biome Registry ==== ==== Iterating Biome Registry ====
  
-What we need to do next is loop over the existing biomes (Vanilla's and modded biomes added before your mod loaded) as well as register to the Registry event to ensure that your ore is added to biomes loaded after your mod.+What we need to do next is process all biomes that have been registered as well as all biomes that will be registered in the future (as added by other mods). We first iterate over the current registry, then register a listener that will be called for future additions.
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
Line 43: Line 43:
 public void onInitialize() { public void onInitialize() {
  //Loop over existing biomes  //Loop over existing biomes
- Registry.BIOME.stream().forEach(this::handleBiome);+ Registry.BIOME.forEach(this::handleBiome);
  
  //Listen for other biomes being registered  //Listen for other biomes being registered
tutorial/ores.txt · Last modified: 2023/12/18 01:03 by solidblock