Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::LocalPlayer Class Reference

#include <LocalPlayer.hpp>

Inheritance diagram for Botcraft::LocalPlayer:
Botcraft::PlayerEntity Botcraft::LivingEntity Botcraft::Entity

Public Member Functions

 LocalPlayer ()
 
virtual ~LocalPlayer ()
 
Vector3< double > GetFrontVector () const
 
Vector3< double > GetXZVector () const
 
Vector3< double > GetRightVector () const
 
GameType GetGameMode () const
 
char GetAbilitiesFlags () const
 
bool GetInvulnerable () const
 
bool GetFlying () const
 
bool GetMayFly () const
 
bool GetInstabuild () const
 If true, the player can break any block in no time (creative mode)
 
bool GetMayBuild () const
 
float GetFlyingSpeed () const
 
float GetWalkingSpeed () const
 
float GetHealth () const
 
int GetFood () const
 
float GetFoodSaturation () const
 
bool GetDirtyInputs () const
 
bool IsClimbing () const
 
bool IsInWater () const
 
bool IsInLava () const
 
bool IsInFluid () const
 
void SetGameMode (const GameType game_mode_)
 
void SetAbilitiesFlags (const char abilities_flags_)
 
void SetFlyingSpeed (const float flying_speed_)
 
void SetWalkingSpeed (const float walking_speed_)
 
void SetHealth (const float health_)
 
void SetFood (const int food_)
 
void SetFoodSaturation (const float food_saturation_)
 
void SetDirtyInputs ()
 
virtual void SetPosition (const Vector3< double > &pos) override
 
virtual void SetX (const double x) override
 
virtual void SetY (const double y) override
 
virtual void SetZ (const double z) override
 
virtual void SetYaw (const float yaw_) override
 Set Yaw angle (horizontal plane orientation)
 
virtual void SetPitch (const float pitch_) override
 Set Pitch angle (look up is -90°, look down is 90°)
 
void SetInputsForward (const float f)
 
void AddInputsForward (const float f)
 
void SetInputsLeft (const float f)
 
void AddInputsLeft (const float f)
 
void SetInputsJump (const bool b)
 
void SetInputsSneak (const bool b)
 
void SetInputsSprint (const bool b)
 
void SetInputs (const PlayerInputs &inputs_)
 
virtual bool IsLocalPlayer () const override
 
virtual bool IsRemotePlayer () const override
 
void LookAt (const Vector3< double > &pos, const bool set_pitch=false)
 
- Public Member Functions inherited from Botcraft::PlayerEntity
 PlayerEntity ()
 
virtual ~PlayerEntity ()
 
virtual std::string GetName () const override
 Get the name of this entity TYPE as a string. For player name see NetworkManager::GetMyName()
 
virtual EntityType GetType () const override
 
AABB GetCollider (const Pose pose) const
 
double GetHeight (const Pose pose) const
 
double GetWidth (const Pose pose) const
 
double GetEyeHeight () const
 
virtual ProtocolCraft::Json::Value Serialize () const override
 
virtual void SetMetadataValue (const int index, const std::any &value) override
 
float GetDataPlayerAbsorptionId () const
 
int GetDataScoreId () const
 
char GetDataPlayerModeCustomisation () const
 
char GetDataPlayerMainHand () const
 
ProtocolCraft::NBT::Value GetDataShoulderLeft () const
 
ProtocolCraft::NBT::Value GetDataShoulderRight () const
 
void SetDataPlayerAbsorptionId (const float data_player_absorption_id)
 
void SetDataScoreId (const int data_score_id)
 
void SetDataPlayerModeCustomisation (const char data_player_mode_customisation)
 
void SetDataPlayerMainHand (const char data_player_main_hand)
 
void SetDataShoulderLeft (const ProtocolCraft::NBT::Value &data_shoulder_left)
 
void SetDataShoulderRight (const ProtocolCraft::NBT::Value &data_shoulder_right)
 
double GetAttributeAttackDamageValue () const
 
double GetAttributeAttackSpeedValue () const
 
double GetAttributeLuckValue () const
 
double GetAttributePlayerBlockInteractionRangeValue () const
 
double GetAttributePlayerEntityInteractionRangeValue () const
 
double GetAttributePlayerBlockBreakSpeedValue () const
 
double GetAttributePlayerSubmergedMiningSpeedValue () const
 
double GetAttributePlayerSneakingSpeedValue () const
 
double GetAttributePlayerMiningEfficiencyValue () const
 
double GetAttributePlayerSweepingDamageRatioValue () const
 
AABB GetCollider () const
 
double GetHeight () const
 
double GetWidth () const
 
- Public Member Functions inherited from Botcraft::LivingEntity
 LivingEntity ()
 
virtual ~LivingEntity ()
 
virtual bool IsLivingEntity () const override
 
char GetDataLivingEntityFlags () const
 
float GetDataHealthId () const
 
std::vector< ProtocolCraft::ParticleGetDataEffectParticles () const
 
bool GetDataEffectAmbienceId () const
 
int GetDataArrowCountId () const
 
int GetDataStingerCountId () const
 
std::optional< PositionGetSleepingPosId () const
 
void SetDataLivingEntityFlags (const char data_living_entity_flags)
 
void SetDataHealthId (const float data_health_id)
 
void SetDataEffectParticles (const std::vector< ProtocolCraft::Particle > &data_effect_particles)
 
void SetDataEffectAmbienceId (const bool data_effect_ambience_id)
 
void SetDataArrowCountId (const int data_arrow_count_id)
 
void SetDataStingerCountId (const int data_stinger_count_id)
 
void SetSleepingPosId (const std::optional< Position > &sleeping_pos_id)
 
std::optional< EntityAttributeGetAttribute (const EntityAttribute::Type type) const
 
void SetAttributeBaseValue (const EntityAttribute::Type type, const double value)
 
void RemoveAttributeModifier (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key)
 
void SetAttributeModifier (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key, const EntityAttribute::Modifier &modifier)
 
void ClearModifiers (const EntityAttribute::Type type)
 
void AddAttribute (const EntityAttribute &attribute)
 
double GetAttributeMaxHealthValue () const
 
double GetAttributeKnockbackResistanceValue () const
 
double GetAttributeMovementSpeedValue () const
 
double GetAttributeArmorValue () const
 
double GetAttributeArmorToughnessValue () const
 
double GetAttributeMaxAbsorptionValue () const
 
double GetAttributeStepHeightValue () const
 
double GetAttributeScaleValue () const
 
double GetAttributeGravityValue () const
 
double GetAttributeSafeFallDistanceValue () const
 
double GetAttributeFallDamageMultiplierValue () const
 
double GetAttributeJumpStrengthValue () const
 
double GetAttributeOxygenBonusValue () const
 
double GetAttributeBurningTimeValue () const
 
double GetAttributeExplosionKnockbackResistanceValue () const
 
double GetAttributeWaterMovementEfficiencyValue () const
 
double GetAttributeMovementEfficiencyValue () const
 
double GetAttributeAttackKnockbackValue () const
 
- Public Member Functions inherited from Botcraft::Entity
 Entity ()
 
virtual ~Entity ()
 
AABB GetCollider () const
 
double GetWidth () const
 
double GetHeight () const
 
void LoadMetadataFromRawArray (const std::vector< unsigned char > &data)
 
char GetDataSharedFlagsId () const
 
bool GetDataSharedFlagsId (const EntitySharedFlagsId id) const
 
int GetDataAirSupplyId () const
 
std::optional< ProtocolCraft::ChatGetDataCustomName () const
 
bool GetDataCustomNameVisible () const
 
bool GetDataSilent () const
 
bool GetDataNoGravity () const
 
Pose GetDataPose () const
 
int GetDataTicksFrozen () const
 
void SetDataSharedFlagsId (const char data_shared_flags_id)
 
void SetDataSharedFlagsId (const EntitySharedFlagsId id, const bool b)
 
void SetDataAirSupplyId (const int data_air_supply_id)
 
void SetDataCustomName (const std::optional< ProtocolCraft::Chat > &data_custom_name)
 
void SetDataCustomNameVisible (const bool data_custom_name_visible)
 
void SetDataSilent (const bool data_silent)
 
void SetDataNoGravity (const bool data_no_gravity)
 
void SetDataPose (const Pose data_pose)
 
void SetDataTicksFrozen (const int data_ticks_frozen)
 
int GetEntityID () const
 
ProtocolCraft::UUID GetUUID () const
 
Vector3< double > GetPosition () const
 
double GetX () const
 
double GetY () const
 
double GetZ () const
 
float GetYaw () const
 
float GetPitch () const
 
Vector3< double > GetSpeed () const
 
double GetSpeedX () const
 
double GetSpeedY () const
 
double GetSpeedZ () const
 
bool GetOnGround () const
 
std::map< EquipmentSlot, ProtocolCraft::SlotGetEquipments () const
 
ProtocolCraft::Slot GetEquipment (const EquipmentSlot slot) const
 
std::vector< EntityEffectGetEffects () const
 
std::vector< Renderer::FaceGetFaces (const bool reset_uptodate_status)
 
bool GetAreRenderedFacesUpToDate () const
 
void SetEntityID (const int entity_id_)
 
void SetUUID (const ProtocolCraft::UUID &uuid_)
 
void SetSpeed (const Vector3< double > &speed_)
 
void SetSpeedX (const double speed_x_)
 
void SetSpeedY (const double speed_y_)
 
void SetSpeedZ (const double speed_z_)
 
void SetOnGround (const bool on_ground_)
 
void SetEquipment (const EquipmentSlot slot, const ProtocolCraft::Slot &item)
 
void SetEffects (const std::vector< EntityEffect > &effects_)
 
void AddEffect (const EntityEffect &effect)
 
void RemoveEffect (const EntityEffectType type)
 
void SetAreRenderedFacesUpToDate (const bool are_rendered_faces_up_to_date_)
 
virtual bool IsAbstractArrow () const
 
virtual bool IsAnimal () const
 
virtual bool IsAmbientCreature () const
 
virtual bool IsMonster () const
 
virtual bool IsDisplay () const
 
virtual bool IsVehicle () const
 
virtual bool IsTamableAnimal () const
 
virtual bool IsAbstractSchoolingFish () const
 
virtual bool IsWaterAnimal () const
 
virtual bool IsAbstractChestedHorse () const
 
virtual bool IsAbstractHurtingProjectile () const
 
virtual bool IsMob () const
 
virtual bool IsSpellcasterIllager () const
 
virtual bool IsProjectile () const
 
virtual bool IsFlyingMob () const
 
virtual bool IsAbstractHorse () const
 
virtual bool IsAbstractGolem () const
 
virtual bool IsHangingEntity () const
 
virtual bool IsFireball () const
 
virtual bool IsAbstractMinecart () const
 
virtual bool IsAbstractMinecartContainer () const
 
virtual bool IsShoulderRidingEntity () const
 
virtual bool IsAbstractPiglin () const
 
virtual bool IsAbstractIllager () const
 
virtual bool IsAbstractFish () const
 
virtual bool IsRaider () const
 
virtual bool IsAbstractSkeleton () const
 
virtual bool IsThrowableItemProjectile () const
 
virtual bool IsAbstractVillager () const
 
virtual bool IsAgeableMob () const
 
virtual bool IsPathfinderMob () const
 
virtual bool IsPatrollingMonster () const
 
virtual bool IsThrowableProjectile () const
 
virtual bool IsAbstractWindCharge () const
 
virtual bool IsBlockAttachedEntity () const
 
virtual bool IsAbstractBoat () const
 
virtual bool IsAbstractChestBoat () const
 
virtual bool IsAgeableWaterCreature () const
 
virtual bool IsBoat () const
 
virtual bool IsChestBoat () const
 
virtual bool IsChestRaft () const
 
virtual bool IsRaft () const
 

Private Member Functions

void UpdateVectors ()
 
void ResetInputs ()
 
void SetAbilitiesFlagsImpl (const char abilities_flags_)
 
void UpdateAbilitiesFlagsImpl ()
 

Private Attributes

Vector3< double > front_vector
 
Vector3< double > xz_vector
 
Vector3< double > right_vector
 
PlayerInputs inputs
 
bool dirty_inputs
 
GameType game_mode
 
char abilities_flags
 
bool invulnerable
 
bool flying
 Flying in creative/spectator.
 
bool may_fly
 If this player can fly in creative/spectator.
 
bool instabuild
 Insta break blocks in creative.
 
bool may_build
 
float flying_speed
 
float walking_speed
 
float health
 
int food
 
float food_saturation
 
bool in_water
 
bool in_lava
 
bool under_water
 
bool crouching
 
bool horizontal_collision
 
bool on_climbable
 
Vector3< double > stuck_speed_multiplier
 
int jump_delay
 
int fly_jump_trigger_time
 
int sprint_double_tap_trigger_time
 
std::optional< Positionsupporting_block_pos
 
bool on_ground_without_supporting_block
 
bool previous_sprinting
 
bool previous_shift_key_down
 
Vector3< double > previous_position
 
float previous_yaw
 
float previous_pitch
 
bool previous_on_ground
 
bool previous_jump
 
bool previous_sneak
 
float previous_forward
 
bool previous_horizontal_collision
 
PlayerInputs last_sent_inputs
 

Friends

class PhysicsManager
 

Additional Inherited Members

- Static Public Member Functions inherited from Botcraft::PlayerEntity
static std::string GetClassName ()
 
static EntityType GetClassType ()
 
- Static Public Member Functions inherited from Botcraft::Entity
static std::shared_ptr< EntityCreateEntity (const EntityType type)
 
- Static Public Attributes inherited from Botcraft::LivingEntity
static const std::string speed_modifier_powder_snow_key = "minecraft:powder_snow"
 
static const std::string speed_modifier_sprinting_key = "minecraft:sprinting"
 
- Protected Member Functions inherited from Botcraft::PlayerEntity
virtual double GetEyeHeightImpl () const
 
virtual double GetWidthImpl () const override
 
virtual double GetHeightImpl () const override
 
AABB GetColliderImpl (const Pose pose) const
 
double GetAttributePlayerSneakingSpeedValueImpl () const
 
AABB GetColliderImpl () const
 
- Protected Member Functions inherited from Botcraft::LivingEntity
double GetAttributeMovementSpeedValueImpl () const
 
void RemoveAttributeModifierImpl (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key)
 
void SetAttributeModifierImpl (const EntityAttribute::Type type, const EntityAttribute::ModifierKey &key, const EntityAttribute::Modifier &modifier)
 
char GetDataLivingEntityFlagsImpl () const
 
std::optional< PositionGetSleepingPosIdImpl () const
 
double GetAttributeStepHeightValueImpl () const
 
double GetAttributeGravityValueImpl () const
 
double GetAttributeJumpStrengthValueImpl () const
 
double GetAttributeWaterMovementEfficiencyValueImpl () const
 
double GetAttributeMovementEfficiencyValueImpl () const
 
- Protected Member Functions inherited from Botcraft::Entity
virtual void InitializeFaces ()
 
void OnSizeUpdated ()
 
char GetDataSharedFlagsIdImpl () const
 
bool GetDataSharedFlagsIdImpl (const EntitySharedFlagsId id) const
 
void SetDataSharedFlagsIdImpl (const char data_shared_flags_id)
 
void SetDataSharedFlagsIdImpl (const EntitySharedFlagsId id, const bool b)
 
Pose GetDataPoseImpl () const
 
void SetDataPoseImpl (const Pose data_pose)
 
AABB GetColliderImpl () const
 
- Protected Attributes inherited from Botcraft::LivingEntity
std::map< EntityAttribute::Type, EntityAttributeattributes
 
- Protected Attributes inherited from Botcraft::Entity
std::shared_mutex entity_mutex
 
int entity_id
 
ProtocolCraft::UUID uuid
 
Vector3< double > position
 
float yaw
 
float pitch
 
Vector3< double > speed
 
bool on_ground
 
std::map< EquipmentSlot, ProtocolCraft::Slotequipments
 Items on this entity.
 
std::vector< EntityEffecteffects
 
std::map< std::string, std::any > metadata
 
std::vector< FaceDescriptorface_descriptors
 
std::vector< Renderer::Facefaces
 
bool are_rendered_faces_up_to_date
 
- Static Protected Attributes inherited from Botcraft::PlayerEntity
static constexpr int metadata_count = 6
 
static const std::array< std::string, metadata_countmetadata_names
 
static constexpr int hierarchy_metadata_count = LivingEntity::metadata_count + LivingEntity::hierarchy_metadata_count
 
- Static Protected Attributes inherited from Botcraft::LivingEntity
static constexpr int metadata_count = 7
 
static const std::array< std::string, metadata_countmetadata_names
 
static constexpr int hierarchy_metadata_count = Entity::metadata_count + Entity::hierarchy_metadata_count
 
- Static Protected Attributes inherited from Botcraft::Entity
static constexpr int metadata_count = 8
 
static const std::array< std::string, metadata_countmetadata_names
 
static constexpr int hierarchy_metadata_count = 0
 

Detailed Description

Definition at line 18 of file LocalPlayer.hpp.

Constructor & Destructor Documentation

◆ LocalPlayer()

◆ ~LocalPlayer()

Botcraft::LocalPlayer::~LocalPlayer ( )
virtual

Definition at line 62 of file LocalPlayer.cpp.

Member Function Documentation

◆ AddInputsForward()

void Botcraft::LocalPlayer::AddInputsForward ( const float  f)

◆ AddInputsLeft()

void Botcraft::LocalPlayer::AddInputsLeft ( const float  f)

◆ GetAbilitiesFlags()

char Botcraft::LocalPlayer::GetAbilitiesFlags ( ) const

Definition at line 93 of file LocalPlayer.cpp.

References abilities_flags, and Botcraft::Entity::entity_mutex.

◆ GetDirtyInputs()

bool Botcraft::LocalPlayer::GetDirtyInputs ( ) const

Definition at line 159 of file LocalPlayer.cpp.

References dirty_inputs, and Botcraft::Entity::entity_mutex.

◆ GetFlying()

bool Botcraft::LocalPlayer::GetFlying ( ) const

Definition at line 105 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and flying.

◆ GetFlyingSpeed()

float Botcraft::LocalPlayer::GetFlyingSpeed ( ) const

Definition at line 129 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and flying_speed.

◆ GetFood()

int Botcraft::LocalPlayer::GetFood ( ) const

Definition at line 147 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and food.

◆ GetFoodSaturation()

float Botcraft::LocalPlayer::GetFoodSaturation ( ) const

Definition at line 153 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and food_saturation.

◆ GetFrontVector()

Vector3< double > Botcraft::LocalPlayer::GetFrontVector ( ) const

Definition at line 68 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and front_vector.

◆ GetGameMode()

GameType Botcraft::LocalPlayer::GetGameMode ( ) const

Definition at line 87 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and game_mode.

◆ GetHealth()

float Botcraft::LocalPlayer::GetHealth ( ) const

Definition at line 141 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and health.

◆ GetInstabuild()

bool Botcraft::LocalPlayer::GetInstabuild ( ) const

If true, the player can break any block in no time (creative mode)

Returns
Instabuild ability value

Definition at line 117 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and instabuild.

◆ GetInvulnerable()

bool Botcraft::LocalPlayer::GetInvulnerable ( ) const

Definition at line 99 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and invulnerable.

◆ GetMayBuild()

bool Botcraft::LocalPlayer::GetMayBuild ( ) const

Definition at line 123 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and may_build.

◆ GetMayFly()

bool Botcraft::LocalPlayer::GetMayFly ( ) const

Definition at line 111 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and may_fly.

◆ GetRightVector()

Vector3< double > Botcraft::LocalPlayer::GetRightVector ( ) const

Definition at line 80 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and right_vector.

◆ GetWalkingSpeed()

float Botcraft::LocalPlayer::GetWalkingSpeed ( ) const

Definition at line 135 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and walking_speed.

◆ GetXZVector()

Vector3< double > Botcraft::LocalPlayer::GetXZVector ( ) const

Definition at line 74 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and xz_vector.

◆ IsClimbing()

bool Botcraft::LocalPlayer::IsClimbing ( ) const

Definition at line 165 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and on_climbable.

◆ IsInFluid()

bool Botcraft::LocalPlayer::IsInFluid ( ) const

Definition at line 183 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, in_lava, and in_water.

◆ IsInLava()

bool Botcraft::LocalPlayer::IsInLava ( ) const

Definition at line 177 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and in_lava.

◆ IsInWater()

bool Botcraft::LocalPlayer::IsInWater ( ) const

Definition at line 171 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and in_water.

◆ IsLocalPlayer()

bool Botcraft::LocalPlayer::IsLocalPlayer ( ) const
overridevirtual

Reimplemented from Botcraft::Entity.

Definition at line 339 of file LocalPlayer.cpp.

◆ IsRemotePlayer()

bool Botcraft::LocalPlayer::IsRemotePlayer ( ) const
overridevirtual

Reimplemented from Botcraft::PlayerEntity.

Definition at line 344 of file LocalPlayer.cpp.

◆ LookAt()

◆ ResetInputs()

◆ SetAbilitiesFlags()

void Botcraft::LocalPlayer::SetAbilitiesFlags ( const char  abilities_flags_)

Definition at line 196 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and SetAbilitiesFlagsImpl().

◆ SetAbilitiesFlagsImpl()

void Botcraft::LocalPlayer::SetAbilitiesFlagsImpl ( const char  abilities_flags_)
private

Definition at line 404 of file LocalPlayer.cpp.

References abilities_flags, flying, instabuild, invulnerable, may_build, and may_fly.

Referenced by SetAbilitiesFlags().

◆ SetDirtyInputs()

void Botcraft::LocalPlayer::SetDirtyInputs ( )

Definition at line 232 of file LocalPlayer.cpp.

References dirty_inputs, and Botcraft::Entity::entity_mutex.

◆ SetFlyingSpeed()

void Botcraft::LocalPlayer::SetFlyingSpeed ( const float  flying_speed_)

Definition at line 202 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and flying_speed.

◆ SetFood()

void Botcraft::LocalPlayer::SetFood ( const int  food_)

Definition at line 220 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and food.

◆ SetFoodSaturation()

void Botcraft::LocalPlayer::SetFoodSaturation ( const float  food_saturation_)

Definition at line 226 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and food_saturation.

◆ SetGameMode()

void Botcraft::LocalPlayer::SetGameMode ( const GameType  game_mode_)

Definition at line 190 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and game_mode.

◆ SetHealth()

void Botcraft::LocalPlayer::SetHealth ( const float  health_)

Definition at line 214 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and health.

◆ SetInputs()

void Botcraft::LocalPlayer::SetInputs ( const PlayerInputs inputs_)

Definition at line 332 of file LocalPlayer.cpp.

References dirty_inputs, Botcraft::Entity::entity_mutex, and inputs.

◆ SetInputsForward()

void Botcraft::LocalPlayer::SetInputsForward ( const float  f)

◆ SetInputsJump()

void Botcraft::LocalPlayer::SetInputsJump ( const bool  b)

◆ SetInputsLeft()

void Botcraft::LocalPlayer::SetInputsLeft ( const float  f)

◆ SetInputsSneak()

void Botcraft::LocalPlayer::SetInputsSneak ( const bool  b)

◆ SetInputsSprint()

void Botcraft::LocalPlayer::SetInputsSprint ( const bool  b)

◆ SetPitch()

void Botcraft::LocalPlayer::SetPitch ( const float  pitch_)
overridevirtual

Set Pitch angle (look up is -90°, look down is 90°)

Parameters
pitch_New pitch, in degree

Reimplemented from Botcraft::Entity.

Definition at line 273 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, Botcraft::Entity::pitch, and UpdateVectors().

◆ SetPosition()

void Botcraft::LocalPlayer::SetPosition ( const Vector3< double > &  pos)
overridevirtual

Reimplemented from Botcraft::Entity.

Definition at line 239 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and Botcraft::Entity::position.

◆ SetWalkingSpeed()

void Botcraft::LocalPlayer::SetWalkingSpeed ( const float  walking_speed_)

Definition at line 208 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, and walking_speed.

◆ SetX()

void Botcraft::LocalPlayer::SetX ( const double  x)
overridevirtual

◆ SetY()

void Botcraft::LocalPlayer::SetY ( const double  y)
overridevirtual

◆ SetYaw()

void Botcraft::LocalPlayer::SetYaw ( const float  yaw_)
overridevirtual

Set Yaw angle (horizontal plane orientation)

Parameters
yaw_New yaw, in degree

Reimplemented from Botcraft::Entity.

Definition at line 263 of file LocalPlayer.cpp.

References Botcraft::Entity::entity_mutex, UpdateVectors(), and Botcraft::Entity::yaw.

◆ SetZ()

void Botcraft::LocalPlayer::SetZ ( const double  z)
overridevirtual

◆ UpdateAbilitiesFlagsImpl()

void Botcraft::LocalPlayer::UpdateAbilitiesFlagsImpl ( )
private

Definition at line 414 of file LocalPlayer.cpp.

References abilities_flags, flying, instabuild, invulnerable, may_build, and may_fly.

Referenced by LocalPlayer().

◆ UpdateVectors()

void Botcraft::LocalPlayer::UpdateVectors ( )
private

Friends And Related Symbol Documentation

◆ PhysicsManager

friend class PhysicsManager
friend

Definition at line 20 of file LocalPlayer.hpp.

Member Data Documentation

◆ abilities_flags

char Botcraft::LocalPlayer::abilities_flags
private

◆ crouching

bool Botcraft::LocalPlayer::crouching
private

Definition at line 127 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ dirty_inputs

◆ fly_jump_trigger_time

int Botcraft::LocalPlayer::fly_jump_trigger_time
private

Definition at line 132 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ flying

bool Botcraft::LocalPlayer::flying
private

Flying in creative/spectator.

Definition at line 110 of file LocalPlayer.hpp.

Referenced by GetFlying(), LocalPlayer(), SetAbilitiesFlagsImpl(), and UpdateAbilitiesFlagsImpl().

◆ flying_speed

float Botcraft::LocalPlayer::flying_speed
private

Definition at line 116 of file LocalPlayer.hpp.

Referenced by GetFlyingSpeed(), LocalPlayer(), and SetFlyingSpeed().

◆ food

int Botcraft::LocalPlayer::food
private

Definition at line 120 of file LocalPlayer.hpp.

Referenced by GetFood(), LocalPlayer(), and SetFood().

◆ food_saturation

float Botcraft::LocalPlayer::food_saturation
private

Definition at line 121 of file LocalPlayer.hpp.

Referenced by GetFoodSaturation(), LocalPlayer(), and SetFoodSaturation().

◆ front_vector

Vector3<double> Botcraft::LocalPlayer::front_vector
private

Definition at line 98 of file LocalPlayer.hpp.

Referenced by GetFrontVector(), LocalPlayer(), and UpdateVectors().

◆ game_mode

GameType Botcraft::LocalPlayer::game_mode
private

Definition at line 105 of file LocalPlayer.hpp.

Referenced by GetGameMode(), LocalPlayer(), and SetGameMode().

◆ health

float Botcraft::LocalPlayer::health
private

Definition at line 119 of file LocalPlayer.hpp.

Referenced by GetHealth(), LocalPlayer(), and SetHealth().

◆ horizontal_collision

bool Botcraft::LocalPlayer::horizontal_collision
private

Definition at line 128 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ in_lava

bool Botcraft::LocalPlayer::in_lava
private

Definition at line 125 of file LocalPlayer.hpp.

Referenced by IsInFluid(), IsInLava(), and LocalPlayer().

◆ in_water

bool Botcraft::LocalPlayer::in_water
private

Definition at line 124 of file LocalPlayer.hpp.

Referenced by IsInFluid(), IsInWater(), and LocalPlayer().

◆ inputs

◆ instabuild

bool Botcraft::LocalPlayer::instabuild
private

Insta break blocks in creative.

Definition at line 114 of file LocalPlayer.hpp.

Referenced by GetInstabuild(), LocalPlayer(), SetAbilitiesFlagsImpl(), and UpdateAbilitiesFlagsImpl().

◆ invulnerable

bool Botcraft::LocalPlayer::invulnerable
private

◆ jump_delay

int Botcraft::LocalPlayer::jump_delay
private

Definition at line 131 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ last_sent_inputs

PlayerInputs Botcraft::LocalPlayer::last_sent_inputs
private

Definition at line 148 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ may_build

bool Botcraft::LocalPlayer::may_build
private

◆ may_fly

bool Botcraft::LocalPlayer::may_fly
private

If this player can fly in creative/spectator.

Definition at line 112 of file LocalPlayer.hpp.

Referenced by GetMayFly(), LocalPlayer(), SetAbilitiesFlagsImpl(), and UpdateAbilitiesFlagsImpl().

◆ on_climbable

bool Botcraft::LocalPlayer::on_climbable
private

Definition at line 129 of file LocalPlayer.hpp.

Referenced by IsClimbing(), and LocalPlayer().

◆ on_ground_without_supporting_block

bool Botcraft::LocalPlayer::on_ground_without_supporting_block
private

Definition at line 135 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_forward

float Botcraft::LocalPlayer::previous_forward
private

Definition at line 145 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_horizontal_collision

bool Botcraft::LocalPlayer::previous_horizontal_collision
private

Definition at line 147 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_jump

bool Botcraft::LocalPlayer::previous_jump
private

Definition at line 143 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_on_ground

bool Botcraft::LocalPlayer::previous_on_ground
private

Definition at line 142 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_pitch

float Botcraft::LocalPlayer::previous_pitch
private

Definition at line 141 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_position

Vector3<double> Botcraft::LocalPlayer::previous_position
private

Definition at line 139 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_shift_key_down

bool Botcraft::LocalPlayer::previous_shift_key_down
private

Definition at line 138 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_sneak

bool Botcraft::LocalPlayer::previous_sneak
private

Definition at line 144 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_sprinting

bool Botcraft::LocalPlayer::previous_sprinting
private

Definition at line 137 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ previous_yaw

float Botcraft::LocalPlayer::previous_yaw
private

Definition at line 140 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ right_vector

Vector3<double> Botcraft::LocalPlayer::right_vector
private

Definition at line 100 of file LocalPlayer.hpp.

Referenced by GetRightVector(), LocalPlayer(), and UpdateVectors().

◆ sprint_double_tap_trigger_time

int Botcraft::LocalPlayer::sprint_double_tap_trigger_time
private

Definition at line 133 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ stuck_speed_multiplier

Vector3<double> Botcraft::LocalPlayer::stuck_speed_multiplier
private

Definition at line 130 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ supporting_block_pos

std::optional<Position> Botcraft::LocalPlayer::supporting_block_pos
private

Definition at line 134 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ under_water

bool Botcraft::LocalPlayer::under_water
private

Definition at line 126 of file LocalPlayer.hpp.

Referenced by LocalPlayer().

◆ walking_speed

float Botcraft::LocalPlayer::walking_speed
private

Definition at line 117 of file LocalPlayer.hpp.

Referenced by GetWalkingSpeed(), LocalPlayer(), and SetWalkingSpeed().

◆ xz_vector

Vector3<double> Botcraft::LocalPlayer::xz_vector
private

Definition at line 99 of file LocalPlayer.hpp.

Referenced by GetXZVector(), and UpdateVectors().


The documentation for this class was generated from the following files: