]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/serverobject.h
Formspec: Create a new class for inventorylists (#9287)
[dragonfireclient.git] / src / serverobject.h
index 08f7a7e5878e3f6c1f719a91f083ded2452ed294..48689fcb49761c6257f0babf6a0e09869d2ccea8 100644 (file)
@@ -133,10 +133,10 @@ class ServerActiveObject : public ActiveObject
        {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)
        {}
@@ -170,9 +170,7 @@ class ServerActiveObject : public ActiveObject
        {}
 
        // 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(); }
@@ -180,9 +178,10 @@ class ServerActiveObject : public ActiveObject
        {}
        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)
        {