]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/common/c_content.h
[CSM] Add function to get the definition of items (#5732)
[dragonfireclient.git] / src / script / common / c_content.h
index 32fdb4f043ffac05667025d2b872cd589cc5d319..9b87962971dee5b732992efdca1d2b505e803a9e 100644 (file)
@@ -38,6 +38,8 @@ extern "C" {
 #include "irrlichttypes_bloated.h"
 #include "util/string.h"
 #include "itemgroup.h"
+#include "itemdef.h"
+#include "c_types.h"
 
 namespace Json { class Value; }
 
@@ -63,8 +65,20 @@ class Schematic;
 
 
 ContentFeatures    read_content_features     (lua_State *L, int index);
+void               push_content_features     (lua_State *L,
+                                              const ContentFeatures &c);
+
+void               push_nodebox              (lua_State *L,
+                                              const NodeBox &box);
+void               push_box                  (lua_State *L,
+                                              const std::vector<aabb3f> &box);
+
+void               push_palette              (lua_State *L,
+                                              const std::vector<video::SColor> *palette);
+
 TileDef            read_tiledef              (lua_State *L, int index,
                                               u8 drawtype);
+
 void               read_soundspec            (lua_State *L, int index,
                                               SimpleSoundSpec &spec);
 NodeBox            read_nodebox              (lua_State *L, int index);
@@ -77,17 +91,24 @@ void               push_dig_params           (lua_State *L,
 void               push_hit_params           (lua_State *L,
                                               const HitParams &params);
 
-ItemStack          read_item                 (lua_State *L, int index, Server *srv);
+ItemStack          read_item                 (lua_State *L, int index, IItemDefManager *idef);
 
+struct TileAnimationParams read_animation_definition(lua_State *L, int index);
 
 ToolCapabilities   read_tool_capabilities    (lua_State *L, int table);
 void               push_tool_capabilities    (lua_State *L,
                                               const ToolCapabilities &prop);
 
-ItemDefinition     read_item_definition      (lua_State *L, int index,
-                                              ItemDefinition default_def);
+void read_item_definition (lua_State *L, int index, const ItemDefinition &default_def,
+               ItemDefinition &def);
+void               push_item_definition      (lua_State *L,
+                                              const ItemDefinition &i);
+void               push_item_definition_full (lua_State *L,
+                                              const ItemDefinition &i);
+
 void               read_object_properties    (lua_State *L, int index,
-                                              ObjectProperties *prop);
+                                              ObjectProperties *prop,
+                                              IItemDefManager *idef);
 void               push_object_properties    (lua_State *L,
                                               ObjectProperties *prop);
 
@@ -142,6 +163,8 @@ std::vector<ItemStack> read_items            (lua_State *L,
 void               read_soundspec            (lua_State *L,
                                               int index,
                                               SimpleSoundSpec &spec);
+void               push_soundspec            (lua_State *L,
+                                              const SimpleSoundSpec &spec);
 
 bool               string_to_enum            (const EnumString *spec,
                                               int &result,
@@ -159,6 +182,10 @@ bool               push_json_value           (lua_State *L,
 void               read_json_value           (lua_State *L, Json::Value &root,
                                               int index, u8 recursion = 0);
 
-extern struct EnumString es_AnimationType[];
+void               push_pointed_thing        (lua_State *L, const PointedThing &pointed, bool csm = false);
+
+void               push_objectRef            (lua_State *L, const u16 id);
+
+extern struct EnumString es_TileAnimationType[];
 
 #endif /* C_CONTENT_H_ */