API Component
com.eu.habbo.api.APIComponent
The APIComponent class in the Arcturus project is responsible for managing API actions and providing access to them. This documentation will guide you on how to access and use the different methods provided by this component.
Accessing the API Component
To access the API Component instance, you need to use the Emulator class. Here's an example of how you can do it:
java
APIComponent api = Emulator.getComponent(APIComponent.class);Methods
The APIComponent class provides the following methods:
getAction
java
<T extends APIAction<?, ?>> T getAction(Class<T> type)Returns an instance of the specified APIAction class. If the action has not been initialized before, it will be instantiated and added to the actions map. You can then use this instance to execute the API action.
Example Usage
Here's an example of how you can use the APIComponent methods to get an instance of an APIAction class:
java
// Get an instance of the APIAction class
SampleAPIAction action = api.getAction(SampleAPIAction.class);
// Execute the API action
action.execute();