public final class Registries
extends java.lang.Object
IRegistry objects. If you
want to access a registry without directly accessing its object, use get(ResourceName, Class).| Modifier and Type | Field | Description |
|---|---|---|
static NameRegistry<IRecipe> |
ALL_CONSTRUCTION_RECIPES |
The registry for all
IRecipe objects that are used to construct
items through the input-output system of the construction in the player's
inventory. |
static NameRegistry<IAssetLoader> |
ASSET_LOADER_REGISTRY |
The registry for all
IAssetLoader objects. |
static NameRegistry<BiomeLevel> |
BIOME_LEVEL_REGISTRY |
The registry for all
BiomeLevel objects. |
static NameRegistry<Biome> |
BIOME_REGISTRY |
The registry for all
Biome objects. |
static IndexRegistry<java.lang.Class<? extends ChatComponent>> |
CHAT_COMPONENT_REGISTRY |
The registry for all
ChatComponent objects. |
static NameRegistry<Command> |
COMMAND_REGISTRY |
The registry for all
Command objects. |
static NameRegistry<IContentLoader> |
CONTENT_LOADER_REGISTRY |
The registry for all
IContentLoader objects. |
static NameRegistry<IEffect> |
EFFECT_REGISTRY |
The registry for all
IEffect objects that can be applied to any
entity. |
static NameRegistry<java.lang.Class<? extends Entity>> |
ENTITY_REGISTRY |
The registry for all
Entity types. |
static NameRegistry<FuelInput> |
FUEL_REGISTRY |
The registry for all
FuelInput objects that determine which kinds
of items burn for how long as furnace fuel. |
static NameRegistry<java.lang.Class<? extends Information>> |
INFORMATION_REGISTRY |
The registry for all
Information types. |
static NameRegistry<Item> |
ITEM_REGISTRY |
The registry for all
Item objects. |
static NameRegistry<Keybind> |
KEYBIND_REGISTRY |
The registry for all
Keybind objects. |
static IndexRegistry<IMainMenuTheme> |
MAIN_MENU_THEMES |
The list of all
IMainMenuTheme objects. |
static ParentedNameRegistry<BasicRecipe> |
MANUAL_CONSTRUCTION_RECIPES |
The registry for all
BasicRecipe objects that are displayed on
the left side of the player's inventory. |
static NameRegistry<MortarRecipe> |
MORTAR_REGISTRY |
The registry for all
MortarRecipe objects that can be processed
in a mortar. |
static IndexRegistry<java.lang.Class<? extends IPacket>> |
PACKET_REGISTRY |
The registry for all
IPacket types. |
static IndexRegistry<IPartFactory> |
PART_REGISTRY |
The registry for all
DataPart types. |
static NameRegistry<IRegistry> |
REGISTRIES |
The registry containing all persistent
IRegistry objects. |
static NameRegistry<SmeltingRecipe> |
SMELTING_REGISTRY |
The registry for all
SmeltingRecipe objects that can be smelted
in any kind of furnace. |
static NameRegistry<SpawnBehavior> |
SPAWN_BEHAVIOR_REGISTRY |
The registry for all
SpawnBehavior objects that determine how and
where entities can randomly appear in the world. |
static IndexRegistry<ISpecialCursor> |
SPECIAL_CURSORS |
The list of all
ISpecialCursor instance. |
static NameRegistry<StatisticInitializer> |
STATISTICS_REGISTRY |
The registry for all
StatisticInitializer objects that track
certain things in the game. |
static NameRegistry<IStructure> |
STRUCTURE_REGISTRY |
The registry for all
IStructure objects. |
static NameRegistry<TileLayer> |
TILE_LAYER_REGISTRY |
The registry for all
TileLayer objects. |
static NameRegistry<Tile> |
TILE_REGISTRY |
The registry for all
Tile objects. |
static NameRegistry<TileState> |
TILE_STATE_REGISTRY |
The registry for all
TileState objects. |
static NameRegistry<java.lang.Class<? extends IWorldGenerator>> |
WORLD_GENERATORS |
The registry for all
IWorldGenerator types. |
| Constructor | Description |
|---|---|
Registries() |
| Modifier and Type | Method | Description |
|---|---|---|
static IRegistry |
get(ResourceName name) |
|
static <T extends IRegistry> |
get(ResourceName name,
java.lang.Class<T> type) |
@ApiInternal public static final NameRegistry<IRegistry> REGISTRIES
IRegistry objects. Use
IRegistry.register() to register your own registry. This is
useful both for outputting information on how full registries are, but
also for mod interaction: Other mods can register to your registries
without needing their object directly simply by getting them from this
registry. To get a registry by name, use get(ResourceName,
Class).@ApiInternal public static final NameRegistry<Tile> TILE_REGISTRY
Tile objects. Use Tile.register() to
register it.@ApiInternal public static final NameRegistry<Item> ITEM_REGISTRY
Item objects. Use Item.register() to
register it.public static final NameRegistry<java.lang.Class<? extends Entity>> ENTITY_REGISTRY
Entity types. The ResourceName
refers to the way the entity will be saved to disk when it is present in
the world. Note that, to be able to be loaded back in when the game is
started, an Entity needs to have a constructor containing only an
IWorld.@ApiInternal public static final IndexRegistry<IPartFactory> PART_REGISTRY
DataPart types. Note that this registry
should not be registered into without caution, as the index should not be
automatically determined due to it having to persist on disk when a
DataSet is stored. Either use an index that most likely no other
mods will use, create a configuration file to be able to change it or
only use existing DataParts.public static final IndexRegistry<java.lang.Class<? extends IPacket>> PACKET_REGISTRY
IPacket types. To register into this
registry, you can use IndexRegistry.getNextFreeId() to determine
an id for the packet, or directly register it using IndexRegistry.registerNextFree(Object).public static final NameRegistry<Command> COMMAND_REGISTRY
Command objects. Use Command.register() to register it.@ApiInternal public static final NameRegistry<IRecipe> ALL_CONSTRUCTION_RECIPES
IRecipe objects that are used to construct
items through the input-output system of the construction in the player's
inventory. Do not manually register recipes into this registry as this is
automatically done using BasicRecipe.register(NameRegistry). This
is a convenience registry to help with packets and networking. If you
want to get a recipe instance by its name, use IRecipe.forName(ResourceName).@ApiInternal public static final ParentedNameRegistry<BasicRecipe> MANUAL_CONSTRUCTION_RECIPES
BasicRecipe objects that are displayed on
the left side of the player's inventory. Use BasicRecipe.registerManual() to register recipes into this registry. If
you want to get a recipe instance by its name, use IRecipe.forName(ResourceName).public static final NameRegistry<java.lang.Class<? extends IWorldGenerator>> WORLD_GENERATORS
IWorldGenerator types. The ResourceName is used to save a generator to disk if it is a retroactive
generator (IWorldGenerator.generatesRetroactively()) to mark that
it has already generated in a certain chunk. However, a registry name
needs to be supplied regardless if the generator is retroactive. Note
that, to instantiate a world generator, it needs to contain a default
constructor.@ApiInternal public static final NameRegistry<Biome> BIOME_REGISTRY
Biome objects. Use Biome.register()
to register biomes into this registry.@ApiInternal public static final NameRegistry<BiomeLevel> BIOME_LEVEL_REGISTRY
BiomeLevel objects. Use BiomeLevel.register() to register biomes into this registry.@ApiInternal public static final NameRegistry<IStructure> STRUCTURE_REGISTRY
IStructure objects. Use the contents.json
file to create a new structure and have it loaded through the content
manager. If you want to get a structure by its name, use IStructure.forName(ResourceName) or if you want to get multiple
structures with similar names, use IStructure.forNamePart(String).@ApiInternal public static final NameRegistry<TileState> TILE_STATE_REGISTRY
TileState objects. This registry
automatically has objects registered into it by registering the
associated Tile objects using Tile.register(). Do not
manually register anything in it.@ApiInternal public static final NameRegistry<TileLayer> TILE_LAYER_REGISTRY
TileLayer objects. Use TileLayer.register() to register a layer into this registry.@ApiInternal public static final NameRegistry<Keybind> KEYBIND_REGISTRY
Keybind objects. Use Keybind.register() to register a keybind into this registry. This needs
to be done before IMod.preInit(IGameInstance, IApiHandler,
IEventHandler) as otherwise, the keybind's current value will not be
loaded from the Settings file automatically.public static final IndexRegistry<java.lang.Class<? extends ChatComponent>> CHAT_COMPONENT_REGISTRY
ChatComponent objects. Use IndexRegistry.getNextFreeId() to determine the component's id. When
registering custom chat components, note that, to send their information
between the server and the client, they need to contain a default
constructor.public static final IndexRegistry<IMainMenuTheme> MAIN_MENU_THEMES
IMainMenuTheme objects. Adding themes into this
list will give them a chance to be randomly chosen when the title screen
of the game is loaded up. Do not clear this list as it will crash the
game on startup.public static final NameRegistry<java.lang.Class<? extends Information>> INFORMATION_REGISTRY
Information types. Note that, to save and
load information from and to disk, they need to contain a constructor
that takes an ResourceName similar to the one that Information provides.@ApiInternal public static final NameRegistry<IAssetLoader> ASSET_LOADER_REGISTRY
IAssetLoader objects. To register one into
this registry, use IAssetLoader.register().@ApiInternal public static final NameRegistry<IContentLoader> CONTENT_LOADER_REGISTRY
IContentLoader objects. To register one into
this registry, use IContentLoader.register().public static final IndexRegistry<ISpecialCursor> SPECIAL_CURSORS
ISpecialCursor instance. Adding cursors into this
list will allow them to be displayed in place of the regular cursor when
their condition is met.@ApiInternal public static final NameRegistry<IEffect> EFFECT_REGISTRY
IEffect objects that can be applied to any
entity. To register something into this registry, use IEffect.register().@ApiInternal public static final NameRegistry<StatisticInitializer> STATISTICS_REGISTRY
StatisticInitializer objects that track
certain things in the game. To registry something into this registry, use
StatisticInitializer.register(). To get a statistic and/or modify
its value, use IStatistics which you can obtain from any AbstractEntityPlayer.@ApiInternal public static final NameRegistry<FuelInput> FUEL_REGISTRY
FuelInput objects that determine which kinds
of items burn for how long as furnace fuel. To register something into
this registry, please use FuelInput.register().@ApiInternal public static final NameRegistry<SmeltingRecipe> SMELTING_REGISTRY
SmeltingRecipe objects that can be smelted
in any kind of furnace. To register something into this registry, please
use SmeltingRecipe.register().@ApiInternal public static final NameRegistry<MortarRecipe> MORTAR_REGISTRY
MortarRecipe objects that can be processed
in a mortar. To register something into this registry, please use MortarRecipe.register().@ApiInternal public static final NameRegistry<SpawnBehavior> SPAWN_BEHAVIOR_REGISTRY
SpawnBehavior objects that determine how and
where entities can randomly appear in the world. To register something
into this registry, please use SpawnBehavior.register().public static <T extends IRegistry> T get(ResourceName name, java.lang.Class<T> type)
public static IRegistry get(ResourceName name)