public final class RockBottomAPI
extends java.lang.Object
IRegistry objects
and other important data.| Modifier and Type | Field and 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<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<java.lang.Class<? extends Entity>> |
ENTITY_REGISTRY
The registry for all
Entity types. |
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 NameRegistry<BasicRecipe> |
MANUAL_CONSTRUCTION_RECIPES
The registry for all
BasicRecipe objects that are displayed on
the left side of the player's inventory. |
static IndexRegistry<java.lang.Class<? extends IPacket>> |
PACKET_REGISTRY
The registry for all
IPacket types. |
static IndexRegistry<java.lang.Class<? extends DataPart>> |
PART_REGISTRY
The registry for all
DataPart types. |
static IndexRegistry<ISpecialCursor> |
SPECIAL_CURSORS
The list of all
ISpecialCursor instance. |
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 java.lang.String |
VERSION
The current API version equal to the version in the build.gradle file.
|
static NameRegistry<java.lang.Class<? extends IWorldGenerator>> |
WORLD_GENERATORS
The registry for all
IWorldGenerator types. |
| Constructor and Description |
|---|
RockBottomAPI() |
| Modifier and Type | Method and Description |
|---|---|
static IResourceName |
createInternalRes(java.lang.String resource)
Convenience call to
IModLoader.createResourceName(IMod, String)
that creates a resource with IGameInstance as the holding mod. |
static java.util.logging.Logger |
createLogger(java.lang.String name)
Convenience call to
IApiHandler.createLogger(String) that creates
a Logger with a specified name. |
static IResourceName |
createRes(IMod mod,
java.lang.String resource)
Convenience call to
IModLoader.createResourceName(IMod, String)
that creates an IResourceName bound to the specified IMod. |
static IResourceName |
createRes(java.lang.String combined)
Convenience call to
IModLoader.createResourceName(String) that
creates an IResourceName from a combined string. |
static java.util.List<IRegistry> |
getAllRegistries() |
static IApiHandler |
getApiHandler()
Returns the
IApiHandler object initialized by the game on
startup. |
static IEventHandler |
getEventHandler()
Returns the
IEventHandler object initialized by the game on
startup. |
static IGameInstance |
getGame()
Returns the
IGameInstance object initialized as the game on
startup. |
static IModLoader |
getModLoader()
Returns the
IModLoader object initialized by the game on startup. |
static INetHandler |
getNet()
Returns the
INetHandler object initialized by the game on
startup. |
static java.util.logging.Logger |
logger()
Convenience call to
IApiHandler.logger() that returns the game's
internal logger |
static void |
registerRegistry(IRegistry registry) |
static void |
setInternals(Internals intern) |
public static final java.lang.String VERSION
@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 IResourceName
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<java.lang.Class<? extends DataPart>> 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.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.@ApiInternal public static final NameRegistry<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.public static final NameRegistry<java.lang.Class<? extends IWorldGenerator>> WORLD_GENERATORS
IWorldGenerator types. The IResourceName is used to save a generator to disk if it is a IRetroactiveGenerator 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<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 IResourceName 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().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.public static IApiHandler getApiHandler()
IApiHandler object initialized by the game on
startup. The API handler contains a set of useful helper methods that can
be used to do various things.public static INetHandler getNet()
INetHandler object initialized by the game on
startup. The net handler contains a set of methods to deal with
multiplayer and networking.public static IEventHandler getEventHandler()
IEventHandler object initialized by the game on
startup. The event handler contains a set of methods to deal with
subscribing, firing and listening to events.public static IGameInstance getGame()
IGameInstance object initialized as the game on
startup. This is also an instance of the IMod that the game
represents. The game instance contains references to the player, the
asset manager, the graphics context and various other things.public static IModLoader getModLoader()
IModLoader object initialized by the game on startup.
The mod loader contains a set of methods to deal with mod interaction and
loading and finding mods.@ApiInternal public static IResourceName createInternalRes(java.lang.String resource)
IModLoader.createResourceName(IMod, String)
that creates a resource with IGameInstance as the holding mod.resource - The name of the resourcepublic static IResourceName createRes(IMod mod, java.lang.String resource)
IModLoader.createResourceName(IMod, String)
that creates an IResourceName bound to the specified IMod.mod - The modresource - The resourcepublic static IResourceName createRes(java.lang.String combined)
IModLoader.createResourceName(String) that
creates an IResourceName from a combined string.combined - The combined string representing a resource bound to a
modpublic static java.util.logging.Logger createLogger(java.lang.String name)
IApiHandler.createLogger(String) that creates
a Logger with a specified name.name - The logger's display name@ApiInternal public static java.util.logging.Logger logger()
IApiHandler.logger() that returns the game's
internal loggerpublic static void registerRegistry(IRegistry registry)
public static java.util.List<IRegistry> getAllRegistries()
@ApiInternal public static void setInternals(Internals intern)