-
Notifications
You must be signed in to change notification settings - Fork 83
API version: 1.0
Use the class hunternif.mc.atlas.api.AtlasAPI
to obtain a reference to the API. There are 2 actual APIs: BiomeAPI and TileAPI. Each texture must be a tilesheet following the Autotile layout! (see Editing Textures)
Allows other mods to register custom textures for biomes. The workflow:
- During initialization of your mod, on the client set textures for your biome IDs.
- Save the config, so the textures will be loaded automatically next time, or manually modified by the players.
In order to allow players to manually customize their texture configs, consider using the methods setTextureIfNone
, which will only set the texture for biome ID if it was not present in the config file. Methods setTexture
will override the config.
Consider saving the config only if some texture was actually changed (i.e. setTextureIfNone
returned true
), so that the config file is not overwritten too often. That makes it easier for players to modify the file manually.
Each texture setter method accepts an array of textures. The purpose of this is to choose a random texture for each tile, so that the map has a better, more varied look.
Allows other mods to put custom tiles in the Atlases. The workflow:
- Decide on a unique name for you custom tile (i.e.
zeldaSwordSkillsDungeon
) - During initialization of your mod, on the client set textures for that unique name.
- Anytime during the game, put your custom tile at chunk coordinates.
Use the method putCustomTile(world, dimension, tileName, chunkX, chunkZ)
. In case of a custom building, the appropriate time to do this is when the building is generated, summoned etc. This will put your custom tile on every Atlas for every player, if they have seen that chunk.
Adjacent tiles with the same tile name will be "stitched" together like biomes. So if you want, for example, to have separate little buildings, you must use different tile names for each building, or make a tilesheet that only consists of single-tile-sized buildings, without transitions.