|
Botcraft 1.21.10
|
A client you can use if you only want to use behaviour trees and don't need to add any custom Handle functions. More...
#include <SimpleBehaviourClient.hpp>
Public Member Functions | |
| SimpleBehaviourClient (const bool use_renderer_) | |
| virtual | ~SimpleBehaviourClient () |
Public Member Functions inherited from Botcraft::TemplatedBehaviourClient< SimpleBehaviourClient > | |
| TemplatedBehaviourClient (const bool use_renderer_) | |
| virtual | ~TemplatedBehaviourClient () |
| void | SetBehaviourTree (const std::shared_ptr< BehaviourTree< SimpleBehaviourClient > > &tree_, const std::map< std::string, std::any > &blackboard_={}) |
| Save the given tree to replace the current one as soon as possible. | |
| virtual void | Yield () override |
| Can be called to pause the execution of the internal tree function. | |
| void | StartBehaviour () |
| Start the behaviour thread loop. | |
| void | RunBehaviourUntilClosed () |
| Blocking call, will return only when the client is disconnected from the server. | |
| void | BehaviourStep () |
| Perform one step of the behaviour tree. | |
| void | SyncAction (const int timeout_ms, Args &&... args) |
| Set a tree to execute the given action once and block until done. | |
| void | SyncAction (Args &&... args) |
| Set a tree to execute the given action once and block until done. | |
| void | OnTreeChanged (const BaseNode *root) |
| void | OnFullTreeStart () |
| void | OnNodeStartTick () |
| void | OnNodeEndTick (const Status s) |
| void | OnNodeTickChild (const size_t i) |
Public Member Functions inherited from Botcraft::BehaviourClient | |
| BehaviourClient (const bool use_renderer_) | |
| virtual | ~BehaviourClient () |
| Blackboard & | GetBlackboard () |
| void | OnReset () override |
| void | OnValueChanged (const std::string &key, const std::any &value) override |
| void | OnValueRemoved (const std::string &key) override |
Public Member Functions inherited from Botcraft::ManagersClient | |
| ManagersClient (const bool use_renderer_) | |
| virtual | ~ManagersClient () |
| virtual void | Disconnect () override |
| void | SetSharedWorld (const std::shared_ptr< World > world_) |
| bool | GetAutoRespawn () const |
| void | SetAutoRespawn (const bool b) |
| int | SendInventoryTransaction (const std::shared_ptr< ProtocolCraft::ServerboundContainerClickPacket > &transaction) |
| std::shared_ptr< World > | GetWorld () const |
| std::shared_ptr< EntityManager > | GetEntityManager () const |
| std::shared_ptr< LocalPlayer > | GetLocalPlayer () const |
| std::shared_ptr< InventoryManager > | GetInventoryManager () const |
| std::shared_ptr< PhysicsManager > | GetPhysicsManager () const |
| std::string | GetPlayerName (const ProtocolCraft::UUID &uuid) const |
| Get the name of a connected player. | |
| int | GetDayTime () const |
| Get the current tick. | |
Public Member Functions inherited from Botcraft::ConnectionClient | |
| ConnectionClient () | |
| virtual | ~ConnectionClient () |
| void | Connect (const std::string &address, const std::string &login) |
| Connect the client in offline mode if login is not empty, fallback to Microsoft auth flow if empty. | |
| void | ConnectMicrosoft (const std::string &address, const std::string &cache_key="") |
| Connect the client in online mode. | |
| void | ConnectMinecraftToken (const std::string &address, const std::string &minecraft_token) |
| Connect the client in online mode using the provided minecraft token. | |
| bool | GetShouldBeClosed () const |
| void | SetShouldBeClosed (const bool b) |
| std::shared_ptr< NetworkManager > | GetNetworkManager () const |
| void | SendChatMessage (const std::string &msg) |
| Send a message in the game chat. | |
| void | SendChatCommand (const std::string &command) |
| Send a command in the game chat. | |
| void | Respawn () |
| Ask to respawn when dead. | |
A client you can use if you only want to use behaviour trees and don't need to add any custom Handle functions.
In case you need to react to packets, just inherit either this class, or BaseBehaviourClient the same way it's done here.
Definition at line 10 of file SimpleBehaviourClient.hpp.
| Botcraft::SimpleBehaviourClient::SimpleBehaviourClient | ( | const bool | use_renderer_ | ) |
Definition at line 5 of file SimpleBehaviourClient.cpp.
|
virtual |
Definition at line 10 of file SimpleBehaviourClient.cpp.