8#include <unordered_set>
96 virtual void step(
float dtime,
bool send_recommended){}
134 float time_from_last_punch = 1000000.0f,
135 u16 initial_wear = 0)
148 virtual void setAnimation(
v2f frames,
float frame_speed,
float frame_blend,
bool frame_loop)
150 virtual void getAnimation(
v2f *frames,
float *frame_speed,
float *frame_blend,
bool *frame_loop)
161 {
static std::unordered_set<object_t> rv;
return rv; }
226 using Observers = std::optional<std::unordered_set<std::string>>;
std::unordered_map< std::string, BoneOverride > BoneOverrideMap
Definition activeobject.h:134
ActiveObjectType
Definition activeobject.h:14
static v2f dir(const v2f &pos_dist)
Definition camera.cpp:191
Definition activeobject.h:141
virtual ActiveObjectType getType() const =0
Definition inventory.h:314
Definition serveractiveobject.h:41
v3f getBasePosition() const
Definition serveractiveobject.h:65
virtual void setAnimationSpeed(float frame_speed)
Definition serveractiveobject.h:152
virtual void addPos(const v3f &added_pos)
Definition serveractiveobject.h:75
virtual bool setWieldedItem(const ItemStack &item)
Definition serveractiveobject.cpp:31
virtual BoneOverride getBoneOverride(const std::string &bone)
Definition serveractiveobject.h:156
virtual Inventory * getInventory() const
Definition serveractiveobject.h:169
void markForDeactivation()
Definition serveractiveobject.cpp:69
virtual bool shouldUnload() const
Definition serveractiveobject.h:127
virtual void setBoneOverride(const std::string &bone, const BoneOverride &props)
Definition serveractiveobject.h:154
ServerEnvironment * m_env
Definition serveractiveobject.h:247
virtual void setPos(const v3f &pos)
Definition serveractiveobject.h:73
virtual void onMarkedForDeactivation()
Definition serveractiveobject.h:244
const Observers & recalculateEffectiveObservers()
Force a recalculation of final observers (including all parents).
Definition serveractiveobject.cpp:112
const Observers & getEffectiveObservers()
Cache m_effective_observers with the names of all observers, also indirect observers (object attachme...
Definition serveractiveobject.cpp:89
virtual u32 punch(v3f dir, const ToolCapabilities *toolcap=nullptr, ServerActiveObject *puncher=nullptr, float time_from_last_punch=1000000.0f, u16 initial_wear=0)
Definition serveractiveobject.h:131
virtual std::string getClientInitializationData(u16 protocol_version)
Definition serveractiveobject.h:102
bool m_static_exists
Definition serveractiveobject.h:218
virtual ItemStack getWieldedItem(ItemStack *selected, ItemStack *hand=nullptr) const
Definition serveractiveobject.cpp:22
std::optional< Observers > m_effective_observers
Definition serveractiveobject.h:242
bool isEffectivelyObservedBy(const std::string &player_name)
Whether the object is sent to player_name
Definition serveractiveobject.cpp:121
virtual const BoneOverrideMap & getBoneOverrides() const
Definition serveractiveobject.h:158
virtual void getAnimation(v2f *frames, float *frame_speed, float *frame_blend, bool *frame_loop)
Definition serveractiveobject.h:150
std::unordered_set< u32 > m_attached_particle_spawners
Definition serveractiveobject.h:249
virtual void setInventoryModified()
Definition serveractiveobject.h:172
bool m_pending_deactivation
Definition serveractiveobject.h:259
std::optional< std::unordered_set< std::string > > Observers
Definition serveractiveobject.h:226
void markForRemoval()
Definition serveractiveobject.cpp:61
ServerActiveObject(ServerEnvironment *env, v3f pos)
Definition serveractiveobject.cpp:10
virtual void addedToEnvironment(u32 dtime_s)
Definition serveractiveobject.h:54
u16 m_known_by_count
Definition serveractiveobject.h:199
virtual ActiveObjectType getSendType() const
Definition serveractiveobject.h:50
void invalidateEffectiveObservers()
Invalidate final observer cache.
Definition serveractiveobject.cpp:82
void detachParticleSpawner(u32 id)
Definition serveractiveobject.h:185
virtual u16 getHP() const
Definition serveractiveobject.h:141
bool isPendingRemoval() const
Definition serveractiveobject.h:208
void attachParticleSpawner(u32 id)
Definition serveractiveobject.h:181
std::string generateUpdateInfantCommand(u16 infant_id, u16 protocol_version)
Definition serveractiveobject.cpp:36
virtual void setAnimation(v2f frames, float frame_speed, float frame_blend, bool frame_loop)
Definition serveractiveobject.h:148
virtual void setArmorGroups(const ItemGroupList &armor_groups)
Definition serveractiveobject.h:144
virtual const ItemGroupList & getArmorGroups() const
Definition serveractiveobject.h:146
virtual float getMinimumSavedMovement()
Definition serveractiveobject.cpp:17
void dumpAOMessagesToQueue(std::queue< ActiveObjectMessage > &queue)
Definition serveractiveobject.cpp:53
virtual ServerActiveObject * getParent() const
Definition serveractiveobject.h:162
ServerEnvironment * getEnv()
Definition serveractiveobject.h:67
std::queue< ActiveObjectMessage > m_messages_out
Definition serveractiveobject.h:275
virtual const std::unordered_set< object_t > & getAttachmentChildIds() const
Definition serveractiveobject.h:160
virtual std::string getWieldList() const
Definition serveractiveobject.h:174
virtual void notifyObjectPropertiesModified()
Definition serveractiveobject.h:165
virtual void getStaticData(std::string *result) const
Definition serveractiveobject.h:109
virtual void rightClick(ServerActiveObject *clicker)
Definition serveractiveobject.h:137
virtual u16 getWieldIndex() const
Definition serveractiveobject.h:176
virtual void removingFromEnvironment()
Definition serveractiveobject.h:56
virtual void step(float dtime, bool send_recommended)
Definition serveractiveobject.h:96
virtual std::string getDescription()
Definition serveractiveobject.h:84
virtual bool isStaticAllowed() const
Definition serveractiveobject.h:119
v3s16 m_static_block
Definition serveractiveobject.h:223
void setBasePosition(v3f pos)
Definition serveractiveobject.h:66
virtual void onMarkedForRemoval()
Definition serveractiveobject.h:245
virtual ObjectProperties * accessObjectProperties()
Definition serveractiveobject.h:163
virtual InventoryLocation getInventoryLocation() const
Definition serveractiveobject.cpp:77
Observers m_observers
Definition serveractiveobject.h:227
virtual ~ServerActiveObject()=default
virtual void moveTo(v3f pos, bool continuous)
Definition serveractiveobject.h:78
virtual void setHP(s32 hp, const PlayerHPChangeReason &reason)
Definition serveractiveobject.h:139
bool m_pending_removal
Definition serveractiveobject.h:270
bool isGone() const
Definition serveractiveobject.h:205
v3f m_base_position
Definition serveractiveobject.h:248
Definition serverenvironment.h:219
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
std::unordered_map< std::string, int > ItemGroupList
Definition itemgroup.h:10
Definition activeobject.h:63
Definition inventorymanager.h:18
Definition inventory.h:19
Definition object_properties.h:15
Definition player_sao.h:227