diff options
Diffstat (limited to 'src/serverobject.h')
-rw-r--r-- | src/serverobject.h | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/serverobject.h b/src/serverobject.h index 4a9430107..48689fcb4 100644 --- a/src/serverobject.h +++ b/src/serverobject.h @@ -133,10 +133,10 @@ public: {return true;} // Returns tool wear - virtual int punch(v3f dir, - const ToolCapabilities *toolcap=NULL, - ServerActiveObject *puncher=NULL, - float time_from_last_punch=1000000) + virtual u16 punch(v3f dir, + const ToolCapabilities *toolcap = nullptr, + ServerActiveObject *puncher = nullptr, + float time_from_last_punch = 1000000.0f) { return 0; } virtual void rightClick(ServerActiveObject *clicker) {} @@ -147,7 +147,7 @@ public: virtual void setArmorGroups(const ItemGroupList &armor_groups) {} - virtual const ItemGroupList &getArmorGroups() + virtual const ItemGroupList &getArmorGroups() const { static ItemGroupList rv; return rv; } virtual void setPhysicsOverride(float physics_override_speed, float physics_override_jump, float physics_override_gravity) {} @@ -161,17 +161,7 @@ public: {} virtual void getBonePosition(const std::string &bone, v3f *position, v3f *lotation) {} - virtual void setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation) - {} - virtual void getAttachment(int *parent_id, std::string *bone, v3f *position, v3f *rotation) - {} - virtual void clearChildAttachments() {} - virtual void clearParentAttachment() {} - virtual void addAttachmentChild(int child_id) - {} - virtual void removeAttachmentChild(int child_id) - {} - virtual const std::unordered_set<int> &getAttachmentChildIds() + virtual const std::unordered_set<int> &getAttachmentChildIds() const { static std::unordered_set<int> rv; return rv; } virtual ServerActiveObject *getParent() const { return nullptr; } virtual ObjectProperties* accessObjectProperties() @@ -180,9 +170,7 @@ public: {} // Inventory and wielded item - virtual Inventory* getInventory() - { return NULL; } - virtual const Inventory* getInventory() const + virtual Inventory *getInventory() const { return NULL; } virtual InventoryLocation getInventoryLocation() const { return InventoryLocation(); } @@ -190,9 +178,10 @@ public: {} virtual std::string getWieldList() const { return ""; } - virtual int getWieldIndex() const + virtual u16 getWieldIndex() const { return 0; } - virtual ItemStack getWieldedItem() const; + virtual ItemStack getWieldedItem(ItemStack *selected, + ItemStack *hand = nullptr) const; virtual bool setWieldedItem(const ItemStack &item); inline void attachParticleSpawner(u32 id) { |