public interface IGameInstance extends IMod
IGraphics and IAssetManager.
Notice that this instance represents both the server and the client, however
some methods that are not implemented on the dedicated server (like graphics
and rendering methods) will throw an UnsupportedOperationException.
To access any methods from this class, use RockBottomAPI.getGame().| Modifier and Type | Method and Description |
|---|---|
void |
exit() |
IAssetManager |
getAssetManager()
Gets the
IAssetManager of the current game instance. |
IChatLog |
getChatLog()
Gets the
IChatLog of the current game instance. |
java.net.URLClassLoader |
getClassLoader()
Gets the
URLClassLoader that the game is using to load its own
classes and classes from jars out of the mods folder. |
IDataManager |
getDataManager()
Gets the
IDataManager of the current game instance. |
default float |
getDisplayRatio()
Deprecated.
|
int |
getFpsAverage() |
IGraphics |
getGraphics()
Gets the
IGraphics context of the current game instance. |
IGuiManager |
getGuiManager()
Gets the
IGuiManager of the current game instance. |
default float |
getGuiScale()
Deprecated.
|
default float |
getHeightInGui()
Deprecated.
|
default float |
getHeightInWorld()
Deprecated.
|
org.newdawn.slick.Input |
getInput()
Gets the
Input of the current game instance. |
IInteractionManager |
getInteractionManager()
Gets the
IInteractionManager of the current game instance. |
default float |
getMouseInGuiX()
Deprecated.
|
default float |
getMouseInGuiY()
Deprecated.
|
IParticleManager |
getParticleManager()
Gets the
IParticleManager of the current game instance. |
AbstractEntityPlayer |
getPlayer()
Gets the
AbstractEntityPlayer of the current game instance. |
IPlayerDesign |
getPlayerDesign()
Gets the
IPlayerDesign that defines what the player looks like. |
Settings |
getSettings()
Gets the
Settings of the current game instance. |
IToaster |
getToaster()
Gets the
IToaster of the current game instance. |
int |
getTotalTicks()
Gets the total amount of ticks the game has been running for.
|
int |
getTpsAverage() |
java.util.UUID |
getUniqueId()
Gets the
UUID of the current game instance. |
default float |
getWidthInGui()
Deprecated.
|
default float |
getWidthInWorld()
Deprecated.
|
IWorld |
getWorld()
Gets the
IWorld of the current game instance. |
default float |
getWorldScale()
Deprecated.
|
default boolean |
isChunkBorderDebug()
Deprecated.
|
default boolean |
isDebug()
Deprecated.
|
boolean |
isDedicatedServer()
Gets if the game is currently in dedicated server mode.
|
default boolean |
isItemInfoDebug()
Deprecated.
|
default boolean |
isLightDebug()
Deprecated.
|
void |
joinWorld(DataSet playerSet,
WorldInfo info,
DynamicRegistryInfo regInfo) |
void |
openIngameMenu() |
void |
quitWorld() |
void |
scheduleAction(java.util.function.Supplier<java.lang.Boolean> action)
Schedules an action to be run next tick.
|
void |
setFullscreen(boolean fullscreen) |
void |
setUniqueId(java.util.UUID id) |
void |
startWorld(java.io.File worldFile,
WorldInfo info,
boolean isNewlyCreated) |
getDescription, getDisplayName, getId, getModGuiClass, getResourceLocation, getSortingPriority, getVersion, init, initAssets, isCompatibleWithModVersion, isDisableable, isRequiredOnClient, isRequiredOnServer, postInit, postPostInit, preInit, prePreInit@ApiInternal void startWorld(java.io.File worldFile, WorldInfo info, boolean isNewlyCreated)
@ApiInternal void joinWorld(DataSet playerSet, WorldInfo info, DynamicRegistryInfo regInfo)
@ApiInternal void quitWorld()
@ApiInternal void openIngameMenu()
void scheduleAction(java.util.function.Supplier<java.lang.Boolean> action)
IPacket that run asynchronously to avoid a ConcurrentModificationException being thrown. The action's boolean value determines if the action should be rescheduled (run again
the next tick). Note: This should NOT be used for actions that run each
tick. For that, use WorldTickEvent.action - The action to be run next tickIDataManager getDataManager()
IDataManager of the current game instance. This can be
used for accessing locations on disk like the save folder or the game
folder itself. Additionally, it can save IPropSettings.Settings getSettings()
Settings of the current game instance. These store all
of the values that can be edited in the settings gui.AbstractEntityPlayer getPlayer()
AbstractEntityPlayer of the current game instance. Note
that this is not implemented on the dedicated server.java.lang.UnsupportedOperationException - on the dedicated serverIGuiManager getGuiManager()
IGuiManager of the current game instance. This can be
used to open Guis and fade the screen in and out. Note that this is not
implemented on the dedicated server.java.lang.UnsupportedOperationException - on the dedicated serverIInteractionManager getInteractionManager()
IInteractionManager of the current game instance. This
can be used to access the positions in the world that the player is
currently breaking. Note that this is not implemented on the dedicated
server.java.lang.UnsupportedOperationException - on the dedicated serverIChatLog getChatLog()
IChatLog of the current game instance. This can be used
to write messages and commands into the in-game chat.IWorld getWorld()
IWorld of the current game instance. In the title
screen, this value is unassigned.IAssetManager getAssetManager()
IAssetManager of the current game instance. This can be
used to get graphics, sounds and various other assets. Note that this is
not implemented on the dedicated server.java.lang.UnsupportedOperationException - on the dedicated serverIGraphics getGraphics()
IGraphics context of the current game instance. This can
be used to draw various shapes and interact with the OpenGL context.IParticleManager getParticleManager()
IParticleManager of the current game instance. This can
be used to spawn and render particles. Note that this is not implemented
on the dedicated server.java.lang.UnsupportedOperationException - on the dedicated serverjava.util.UUID getUniqueId()
UUID of the current game instance. This will be applied
to the player as soon as a world starts. Note that the dedicated server
does not have a unique id.java.lang.UnsupportedOperationException - on the dedicated server@ApiInternal int getTpsAverage()
@ApiInternal int getFpsAverage()
java.net.URLClassLoader getClassLoader()
URLClassLoader that the game is using to load its own
classes and classes from jars out of the mods folder.@ApiInternal void setFullscreen(boolean fullscreen)
int getTotalTicks()
IPlayerDesign getPlayerDesign()
IPlayerDesign that defines what the player looks like.
Note that this is not implemented on the dedicated server.java.lang.UnsupportedOperationException - on the dedicated serverboolean isDedicatedServer()
@ApiInternal void setUniqueId(java.util.UUID id)
org.newdawn.slick.Input getInput()
Input of the current game instance. This is a slick
implemented class that allows for the polling of inputs. Note that, when
using Keybind, Keybind.isDown() and Keybind.isPressed() should be used instead. Note that this is not
implemented on the dedicated server.java.lang.UnsupportedOperationException - on the dedicated server@ApiInternal void exit()
IToaster getToaster()
IToaster of the current game instance. This is the
system that displays Toast objects, which are the little pop-up
messages in the top left. Note that this is not implemented on the
dedicated server.java.lang.UnsupportedOperationException - on the dedicated server@Deprecated default float getDisplayRatio()
IGraphics.getDisplayRatio()@Deprecated default float getGuiScale()
IGraphics.getGuiScale()@Deprecated default float getWorldScale()
IGraphics.getWorldScale()@Deprecated default float getWidthInWorld()
IGraphics.getWidthInWorld()@Deprecated default float getHeightInWorld()
IGraphics.getHeightInWorld()@Deprecated default float getWidthInGui()
IGraphics.getWidthInGui()@Deprecated default float getHeightInGui()
IGraphics.getHeightInGui()@Deprecated default float getMouseInGuiX()
IGraphics.getMouseInGuiX()@Deprecated default float getMouseInGuiY()
IGraphics.getMouseInGuiY()@Deprecated default boolean isDebug()
IGraphics.isDebug()@Deprecated default boolean isLightDebug()
IGraphics.isLightDebug()@Deprecated default boolean isItemInfoDebug()
IGraphics.isItemInfoDebug()@Deprecated default boolean isChunkBorderDebug()
IGraphics.isChunkBorderDebug()