Interface ICoreClientAPI
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
The core api implemented by the client. The main interface for accessing the client. Contains all sub components and some miscellaneous methods.
public interface ICoreClientAPI : ICoreAPI, ICoreAPICommon
- Inherited Members
- Extension Methods
Properties
Ambient
API Component to control the clients ambient values
IAmbientManager Ambient { get; }
Property Value
BlockTextureAtlas
API for the Block Texture Atlas
IBlockTextureAtlasAPI BlockTextureAtlas { get; }
Property Value
ColorPreset
Fetch color configs, used for accessibility e.g. for knapping wireframe gridlines
IColorPresets ColorPreset { get; }
Property Value
CurrentMusicTrack
Returns the currently playing music track, if any is playing
IMusicTrack CurrentMusicTrack { get; }
Property Value
ElapsedMilliseconds
Amount of milliseconds ellapsed since client startup
long ElapsedMilliseconds { get; }
Property Value
EntityTextureAtlas
API for the Entity Texture Atlas
ITextureAtlasAPI EntityTextureAtlas { get; }
Property Value
Event
API Component for registering to various Events
IClientEventAPI Event { get; }
Property Value
Forms
Platform independent ui methods and features.
IXPlatformInterface Forms { get; }
Property Value
Gui
API for GUI Related methods
IGuiAPI Gui { get; }
Property Value
HideGuis
If true, the player is in gui-less mode (through the F4 key)
bool HideGuis { get; }
Property Value
InWorldEllapsedMilliseconds
Amount of milliseconds ellapsed while in a running game that is not paused
long InWorldEllapsedMilliseconds { get; }
Property Value
Input
API for Mouse / Keyboard input related things
IInputAPI Input { get; }
Property Value
IsGamePaused
True if the game is currently paused (only available in singleplayer)
bool IsGamePaused { get; }
Property Value
IsShuttingDown
True if the client is currently in the process of exiting
bool IsShuttingDown { get; }
Property Value
IsSinglePlayer
True if this is a singleplayer session
bool IsSinglePlayer { get; }
Property Value
ItemTextureAtlas
API for the Item Texture Atlas
IItemTextureAtlasAPI ItemTextureAtlas { get; }
Property Value
LinkProtocols
Add your own link protocol here if you want to implement a custom protocol. E.g. image://url-to-picture
Dictionary<string, Action<LinkTextComponent>> LinkProtocols { get; }
Property Value
MacroManager
Api to the client side macros system
IMacroManager MacroManager { get; }
Property Value
Network
API for doing sending/receiving network packets
IClientNetworkAPI Network { get; }
Property Value
OpenedGuis
Active GUI objects.
IEnumerable<object> OpenedGuis { get; }
Property Value
OpenedToLan
bool OpenedToLan { get; }
Property Value
PlayerReadyFired
True if all SendPlayerNowReady() was sent, signalling the player is now ready (called by the character selector upon submit)
bool PlayerReadyFired { get; }
Property Value
Render
API for Rendering stuff onto the screen using OpenGL
IRenderAPI Render { get; }
Property Value
Settings
The clients game settings as stored in the clientsettings.json
ISettings Settings { get; }
Property Value
Shader
API for Rendering stuff onto the screen using OpenGL
IShaderAPI Shader { get; }
Property Value
TagConverters
Add your own rich text elements here. Your will need to convert a VTML tag into a RichTextComponentBase element.
Dictionary<string, Tag2RichTextDelegate> TagConverters { get; }
Property Value
Tesselator
API for Meshing in the Mainthread. Thread safe.
ITesselatorAPI Tesselator { get; }
Property Value
TesselatorManager
Holds the default meshes of all blocks
ITesselatorManager TesselatorManager { get; }
Property Value
World
API for accessing anything in the game world
IClientWorldAccessor World { get; }
Property Value
Methods
PauseGame(bool)
void PauseGame(bool paused)
Parameters
paused
bool
RegisterCommand(string, string, string, ClientChatCommandDelegate)
Registers a chat command
[Obsolete("Use ChatCommand subapi instead")]
bool RegisterCommand(string command, string descriptionMsg, string syntaxMsg, ClientChatCommandDelegate handler)
Parameters
command
stringdescriptionMsg
stringsyntaxMsg
stringhandler
ClientChatCommandDelegate
Returns
RegisterCommand(ClientChatCommand)
Registers a chat command
[Obsolete("Use ChatCommand subapi instead")]
bool RegisterCommand(ClientChatCommand chatcommand)
Parameters
chatcommand
ClientChatCommand
Returns
RegisterEntityRendererClass(string, Type)
Registers an entity renderer for given entity
void RegisterEntityRendererClass(string className, Type rendererType)
Parameters
RegisterLinkProtocol(string, Action<LinkTextComponent>)
Register a link protocol handler
void RegisterLinkProtocol(string protocolname, Action<LinkTextComponent> onLinkClicked)
Parameters
protocolname
stringonLinkClicked
Action<LinkTextComponent>
SendChatMessage(string, int, string)
Sends a chat message to the server
void SendChatMessage(string message, int groupId, string data = null)
Parameters
SendChatMessage(string, string)
Sends a chat message to the server in the players currently active channel
void SendChatMessage(string message, string data = null)
Parameters
ShowChatMessage(string)
Shows a client side only chat message in the current chat channel. Uses the same code paths a server => client message takes. Does not execute client commands.
void ShowChatMessage(string message)
Parameters
message
string
StartTrack(AssetLocation, float, EnumSoundType, Action<ILoadedSound>)
Tells the music engine to load and immediately start given track once loaded, if the priority is higher than the currently playing track. May also be stopped while playing if another track with a higher priority is started. If you supply an onLoaded method the track is not started immediately and you can manually start it at any given time by calling sound.Start()
MusicTrack StartTrack(AssetLocation soundLocation, float priority, EnumSoundType soundType, Action<ILoadedSound> onLoaded = null)
Parameters
soundLocation
AssetLocationpriority
floatsoundType
EnumSoundTypeonLoaded
Action<ILoadedSound>
Returns
TriggerChatMessage(string)
Same as ShowChatMessage(string) but will also execute client commands if they are prefixed with a dot.
void TriggerChatMessage(string message)
Parameters
message
string
TriggerIngameDiscovery(object, string, string)
Triggers a discovery event. HudDiscoveryMessage registers to this event and fades in/out a "discovery message" on the players screen
void TriggerIngameDiscovery(object sender, string errorCode, string text)
Parameters
TriggerIngameError(object, string, string)
Triggers an in-game-error event. HudIngameError registers to this event and shows a vibrating red text on the players screen
void TriggerIngameError(object sender, string errorCode, string text)