User Tools

Site Tools


tutorial:world_presets

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:world_presets [2022/07/27 00:17] – add github link miirtutorial:world_presets [2023/02/03 21:34] (current) – Link is no longer available fx
Line 1: Line 1:
-====== Adding World Presets ====== +====== Adding World Presets [1.19.2 AND BELOW] ======  
-A ''WorldPreset'' is a wrapper class around a ''ChunkGenerator''. The preset is shown on the "More World Options" screen, on the "World Type" button. The vanilla world presets are Default, Large Biomes, AMPLIFIED, Single Biome, Superflat, and Debug Mode.+A ''WorldPreset'' is a wrapper class around a ''ChunkGenerator'' that allows you to create a world with a preconfigured chunk generator. The preset is shown on the "More World Options" screen, on the "World Type" button. The vanilla world presets are Default, Large Biomes, AMPLIFIED, Single Biome, Superflat, and Debug Mode.
  
 In this tutorial, we will add a simple world preset which generates nothing in a world. In this tutorial, we will add a simple world preset which generates nothing in a world.
Line 6: Line 6:
 ===== Creating a World Preset ===== ===== Creating a World Preset =====
  
-A world preset requires a ''ChunkGenerator''. You can create your own by extending the ''ChunkGenerator'' class, but here, we will modify the ''FlatChunkGenerator'' to create a void world.+A world preset requires a ''ChunkGenerator''. You can [[tutorial:chunkgenerator|create your own]]((99% of the time, this is not necessary-- see the chunk generator page for more details)), but here, we will modify the ''FlatChunkGenerator'' to create a void world.
  
 In order to implement a preset, we first need access to the ''WorldPresets$Registrar'' inner class. For that, we can use a simple [[tutorial:accesswideners|access widener]]. This could be done without an access widener, but it is much simpler to use one in this case. Your access widener should look like this: In order to implement a preset, we first need access to the ''WorldPresets$Registrar'' inner class. For that, we can use a simple [[tutorial:accesswideners|access widener]]. This could be done without an access widener, but it is much simpler to use one in this case. Your access widener should look like this:
Line 62: Line 62:
 </code> </code>
  
-And, of course, you'll probably want a translation file. I'm using English, so my lang file will be at ''src/main/assets/wiki-example/lang/en_us.json'':+And, of course, you'll probably want a translation file. I'm using English, so my lang file will be at ''src/main/resources/assets/wiki-example/lang/en_us.json'':
 <code> <code>
 { {
Line 70: Line 70:
  
 And you're done! And you're done!
- 
-For more information, the code used in this example can be found [[https://github.com/itsmiir/wiki-example/blob/1.19/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java|on Github]]. 
tutorial/world_presets.1658881070.txt.gz · Last modified: 2022/07/27 00:17 by miir