From 7279f0b37335396c85f6bdd7dc67ff56e53df0f9 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 14 Jan 2017 16:48:49 +0100 Subject: Add particle animation, glow This is implemented by reusing and extending the TileAnimation code for the methods used by particles. --- src/script/common/c_content.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/script/common/c_content.h') diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 2a2228b6d..9641f5c9e 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -79,6 +79,7 @@ void push_hit_params (lua_State *L, ItemStack read_item (lua_State *L, int index, Server *srv); +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, -- cgit v1.2.3 From 88df9fb5b6c78df9485e8bf3750e2608bd78e14c Mon Sep 17 00:00:00 2001 From: red-001 Date: Tue, 31 Jan 2017 13:18:52 +0000 Subject: Add `get_wielded_item` --- src/script/common/c_content.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/script/common/c_content.h') diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 9641f5c9e..10cccbb01 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -38,6 +38,7 @@ extern "C" { #include "irrlichttypes_bloated.h" #include "util/string.h" #include "itemgroup.h" +#include "itemdef.h" namespace Json { class Value; } @@ -77,7 +78,7 @@ void push_dig_params (lua_State *L, void push_hit_params (lua_State *L, const HitParams ¶ms); -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); -- cgit v1.2.3 From 58d83a7bb2f992194c3df304b1dcbb81f98f78c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Juh=C3=A1sz?= Date: Fri, 10 Mar 2017 18:25:58 +0100 Subject: Hardware coloring for itemstacks Adds the possibility to colorize item stacks based on their metadata. In the item/node definition you can specify palette (an image file) and color (fallback color if the item has no palette or metadata). Then you can add palette_index to the metadata. Dropped itemstacks with different colors do not merge. --- src/script/common/c_content.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/script/common/c_content.h') diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 10cccbb01..949b136eb 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -89,7 +89,8 @@ void push_tool_capabilities (lua_State *L, ItemDefinition read_item_definition (lua_State *L, int index, ItemDefinition default_def); void read_object_properties (lua_State *L, int index, - ObjectProperties *prop); + ObjectProperties *prop, + IItemDefManager *idef); void push_object_properties (lua_State *L, ObjectProperties *prop); -- cgit v1.2.3 From f3fe62a0bf9e775b3e6e838f104ab605a2238792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Wed, 19 Apr 2017 23:02:07 +0200 Subject: Fix various copy instead of const ref reported by cppcheck (#5615) * Also remove InventoryList::peekItem unused function * Fix some post increment to preincrement reported by cppcheck --- src/script/common/c_content.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script/common/c_content.h') diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 949b136eb..c701c0384 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -86,8 +86,8 @@ 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 read_object_properties (lua_State *L, int index, ObjectProperties *prop, IItemDefManager *idef); -- cgit v1.2.3 From dc5bc6cac7b81ab27e0064bc25b5fd1d8d617340 Mon Sep 17 00:00:00 2001 From: Vincent Glize Date: Sat, 29 Apr 2017 12:08:16 +0200 Subject: [CSM] Add event on_place_node API lua (#5548) * [CSM] Add event on_place_node API lua --- src/script/common/c_content.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/script/common/c_content.h') diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index c701c0384..219c5eb7c 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -88,6 +88,8 @@ void push_tool_capabilities (lua_State *L, 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 read_object_properties (lua_State *L, int index, ObjectProperties *prop, IItemDefManager *idef); @@ -162,6 +164,10 @@ bool push_json_value (lua_State *L, void read_json_value (lua_State *L, Json::Value &root, int index, u8 recursion = 0); +void push_pointed_thing (lua_State *L, const PointedThing &pointed); + +void push_objectRef (lua_State *L, const u16 id); + extern struct EnumString es_TileAnimationType[]; #endif /* C_CONTENT_H_ */ -- cgit v1.2.3 From 772944daf69ab463568fbbf35a9011e4c8e6c44a Mon Sep 17 00:00:00 2001 From: red-001 Date: Sat, 20 May 2017 15:45:49 +0100 Subject: Fix CSM crash (#5779) Caused by dc5bc6c and them made worse by 5ebf8f9 --- src/script/common/c_content.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script/common/c_content.h') diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 219c5eb7c..28d8b1e8c 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -164,7 +164,7 @@ bool push_json_value (lua_State *L, void read_json_value (lua_State *L, Json::Value &root, int index, u8 recursion = 0); -void push_pointed_thing (lua_State *L, const PointedThing &pointed); +void push_pointed_thing (lua_State *L, const PointedThing &pointed, bool csm = false); void push_objectRef (lua_State *L, const u16 id); -- cgit v1.2.3 From dfa0c15ce045705f05487d623dc7beca6c945b4b Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Sun, 21 May 2017 07:40:55 -0500 Subject: [CSM] Add function to get the definition of items (#5732) Add node def and item def documentation. Please be ready for merge! --- src/script/common/c_content.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/script/common/c_content.h') diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 28d8b1e8c..9b8796297 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -39,6 +39,7 @@ extern "C" { #include "util/string.h" #include "itemgroup.h" #include "itemdef.h" +#include "c_types.h" namespace Json { class Value; } @@ -64,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 &box); + +void push_palette (lua_State *L, + const std::vector *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); @@ -90,6 +103,9 @@ void read_item_definition (lua_State *L, int index, const ItemDefinition &defaul 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, IItemDefManager *idef); @@ -147,6 +163,8 @@ std::vector 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, -- cgit v1.2.3