1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Move client code out of ItemDefManager (#15967)

This commit is contained in:
cx384 2025-04-04 18:58:14 +02:00 committed by GitHub
parent a6d4cd7c15
commit 52b974184d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 195 additions and 163 deletions

View file

@ -17,14 +17,7 @@
#include "util/pointabilities.h"
#include "util/pointedthing.h"
class IGameDef;
class Client;
struct ToolCapabilities;
struct ItemMesh;
struct ItemStack;
typedef std::vector<video::SColor> Palette; // copied from src/client/texturesource.h
namespace irr::video { class ITexture; }
using namespace irr;
/*
Base item definition
@ -142,30 +135,6 @@ public:
virtual bool isKnown(const std::string &name) const=0;
virtual void serialize(std::ostream &os, u16 protocol_version)=0;
/* Client-specific methods */
// TODO: should be moved elsewhere in the future
// Get item inventory texture
virtual video::ITexture* getInventoryTexture(const ItemStack &item, Client *client) const
{ return nullptr; }
/**
* Get wield mesh
* @returns nullptr if there is an inventory image
*/
virtual ItemMesh* getWieldMesh(const ItemStack &item, Client *client) const
{ return nullptr; }
// Get item palette
virtual Palette* getPalette(const ItemStack &item, Client *client) const
{ return nullptr; }
// Returns the base color of an item stack: the color of all
// tiles that do not define their own color.
virtual video::SColor getItemstackColor(const ItemStack &stack,
Client *client) const
{ return video::SColor(0); }
};
class IWritableItemDefManager : public IItemDefManager