Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
nodedef.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include <functional>
8#include <string>
9#include <iostream>
10#include <memory> // shared_ptr
11#include "mapnode.h"
12#include "nameidmapping.h"
13#include "itemgroup.h"
14#include "sound_spec.h"
15#include "texture_override.h" // TextureOverride
16#include "tileanimation.h"
17#include "util/pointabilities.h"
18
19class IItemDefManager;
20class ITextureSource;
21class IShaderSource;
22class IGameDef;
23class NodeResolver;
24#if BUILD_UNITTESTS
25class TestSchematic;
26#endif
27#if CHECK_CLIENT_BUILD()
28struct NodeVisuals;
29#endif
30
32{
35 ContentParamType_END // Dummy for validity check
36};
37
39{
41 // Need 8-bit param2
43 // Flowing liquid properties
45 // Direction for chests and furnaces and such (with axis rotation)
47 // Direction for signs, torches and such
49 // Block level like FLOWINGLIQUID
51 // 2D rotation
53 // Mesh options for plants
55 // Index for palette
57 // 3 bits of palette index, then facedir
59 // 5 bits of palette index, then wallmounted
61 // Glasslike framed drawtype internal liquid level, param2 values 0 to 63
63 // 3 bits of palette index, then degrotate
65 // Simplified direction for chests and furnaces and such (4 directions)
67 // 6 bits of palette index, then 4dir
69 // Dummy for validity check
71};
72
73enum LiquidType : u8
74{
78 LiquidType_END // Dummy for validity check
79};
80
81enum NodeBoxType : u8
82{
83 NODEBOX_REGULAR, // Regular block; allows buildable_to
84 NODEBOX_FIXED, // Static separately defined box(es)
85 NODEBOX_WALLMOUNTED, // Box for wall mounted nodes; (top, bottom, side)
86 NODEBOX_LEVELED, // Same as fixed, but with dynamic height from param2. for snow, ...
87 NODEBOX_CONNECTED, // optionally draws nodeboxes if a neighbor node attaches
88};
89
91{
92 std::vector<aabb3f> connect_top;
93 std::vector<aabb3f> connect_bottom;
94 std::vector<aabb3f> connect_front;
95 std::vector<aabb3f> connect_left;
96 std::vector<aabb3f> connect_back;
97 std::vector<aabb3f> connect_right;
98 std::vector<aabb3f> disconnected_top;
99 std::vector<aabb3f> disconnected_bottom;
100 std::vector<aabb3f> disconnected_front;
101 std::vector<aabb3f> disconnected_left;
102 std::vector<aabb3f> disconnected_back;
103 std::vector<aabb3f> disconnected_right;
104 std::vector<aabb3f> disconnected;
105 std::vector<aabb3f> disconnected_sides;
106};
107
109{
111 // NODEBOX_REGULAR (no parameters)
112 // NODEBOX_FIXED
113 std::vector<aabb3f> fixed;
114 // NODEBOX_WALLMOUNTED
117 aabb3f wall_side = dummybox; // being at the -X side
118 // NODEBOX_CONNECTED
119 // (kept externally to not bloat the structure)
120 std::shared_ptr<NodeBoxConnected> connected;
121
123 { reset(); }
124 ~NodeBox() = default;
125
127 if (!connected)
128 connected = std::make_shared<NodeBoxConnected>();
129 return *connected;
130 }
131 inline const NodeBoxConnected &getConnected() const {
132 assert(connected);
133 return *connected;
134 }
135
136 void reset();
137 void serialize(std::ostream &os, u16 protocol_version) const;
138 void deSerialize(std::istream &is);
139
140private:
142 static constexpr aabb3f dummybox = aabb3f({0, 0, 0});
143};
144
145struct MapNode;
146
152
158
165
180
182{
183 // A basic solid block
185 // Nothing is drawn
187 // Do not draw face towards same kind of flowing/source liquid
189 // A very special kind of thing
191 // Glass-like, don't draw faces towards other glass
193 // Leaves-like, draw all faces no matter what
195 // Enabled -> ndt_allfaces, disabled -> ndt_normal
197 // Single plane perpendicular to a surface
199 // Single plane parallel to a surface
201 // 2 vertical planes in a 'X' shape diagonal to XZ axes.
202 // paramtype2 = "meshoptions" allows various forms, sizes and
203 // vertical and horizontal random offsets.
205 // Fenceposts that connect to neighboring fenceposts with horizontal bars
207 // Selects appropriate junction texture to connect like rails to
208 // neighboring raillikes.
210 // Custom Lua-definable structure of multiple cuboids
212 // Glass-like, draw connected frames and all visible faces.
213 // param2 > 0 defines 64 levels of internal liquid
214 // Uses 3 textures, one for frames, second for faces,
215 // optional third is a 'special tile' for the liquid.
217 // Draw faces slightly rotated and only on neighboring nodes
219 // Enabled -> ndt_glasslike_framed, disabled -> ndt_glasslike
221 // Uses static meshes
223 // Combined plantlike-on-solid
225
226 // Dummy for validity check
229
230// Mesh options for NDT_PLANTLIKE with CPT2_MESHOPTIONS
231static const u8 MO_MASK_STYLE = 0x07;
232static const u8 MO_BIT_RANDOM_OFFSET = 0x08;
233static const u8 MO_BIT_SCALE_SQRT2 = 0x10;
234static const u8 MO_BIT_RANDOM_OFFSET_Y = 0x20;
242
249
250enum AlphaMode : u8 {
254 ALPHAMODE_LEGACY_COMPAT, /* only sent by old servers, equals OPAQUE */
255 AlphaMode_END // Dummy for validity check
257
258/*
259 Stand-alone definition of a TileSpec (basically a server-side TileSpec)
260*/
261
263{
264 std::string name = "";
265 bool backface_culling = true; // Takes effect only in special cases
267 bool tileable_vertical = true;
269 bool has_color = false;
271 video::SColor color = video::SColor(0xFFFFFFFF);
273 u8 scale = 0;
274
276
278 {
280 }
281
282 void serialize(std::ostream &os, u16 protocol_version) const;
283 void deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_version);
284};
285
286// Defines the number of special tiles per nodedef
287//
288// NOTE: When changing this value, the enum entries of OverrideTarget and
289// parser in TextureOverrideSource must be updated so that all special
290// tiles can be overridden.
291#define CF_SPECIAL_COUNT 6
292
294{
295 // PROTOCOL_VERSION >= 37. This is legacy and should not be increased anymore,
296 // write checks that depend directly on the protocol version instead.
297 static const u8 CONTENTFEATURES_VERSION = 13;
298
299 // Server-side cached callback existence for fast skipping
303
304 // "float" group
305 bool floats;
306
307 /*
308 Actual data
309 */
310
311 // --- GENERAL PROPERTIES ---
312
313 std::string name; // "" = undefined node
314 ItemGroupList groups; // Same as in itemdef
315 // Type of MapNode::param1
317 // Type of MapNode::param2
319
320 // --- VISUAL PROPERTIES ---
321
323 std::string mesh;
324 float visual_scale; // Misc. scale parameter
326 // These will be drawn over the base tiles.
330 // The color of the node.
331 video::SColor color;
332 std::string palette_name;
333 // Used for waving leaves/plants
335 // for NDT_CONNECTED pairing
337 std::vector<std::string> connects_to;
338 std::vector<content_t> connects_to_ids;
339 // Post effect color, drawn when the camera is inside the node.
340 video::SColor post_effect_color;
342 // Flowing liquid or leveled nodebox, value = default level
344 // Maximum value for leveled nodes
346
347 // --- CLIENT ONLY ---
348
349#if CHECK_CLIENT_BUILD()
350 // The Client class fills this for its NodeDefManager using fillNodeVisuals,
351 // thus for ContentFeatures of a Client it is not a nullptr.
352 NodeVisuals *visuals = nullptr;
353#endif
354
355 // --- LIGHTING-RELATED ---
356
359 // Amount of light the node emits
361
362 // --- MAP GENERATION ---
363
364 // True for all ground-like things like stone and mud, false for eg. trees
366
367 // --- INTERACTION PROPERTIES ---
368
369 // This is used for collision detection.
370 // Also for general solidness queries.
372 // Player can point to these, point through or it is blocking
374 // Player can dig these
376 // Player can climb these
378 // Player can build on these
380 // Player cannot build to these (placement prediction disabled)
383 // client dig prediction
385 // how slow players move through
387
388 // --- LIQUID PROPERTIES ---
389
390 // Whether the node is non-liquid, source liquid or flowing liquid
392 // If true, movement (e.g. of players) inside this node is liquid-like.
394 // If the content is liquid, this is the flowing version of the liquid.
397 // If the content is liquid, this is the source version of the liquid.
400 // Viscosity for fluid flow, ranging from 1 to 7, with
401 // 1 giving almost instantaneous propagation and 7 being
402 // the slowest possible
404 // Is liquid renewable (new liquid source will be created between 2 existing)
406 // Number of flowing liquids surrounding source
409 // Liquids flow into and replace node
411
412 // --- NODEBOXES ---
413
417
418 // --- SOUND PROPERTIES ---
419
423
424 // --- LEGACY ---
425
426 // Compatibility with old maps
427 // Set to true if paramtype used to be 'facedir_simple'
429 // Set to true if wall_mounted used to be set to true
431
432 /*
433 Methods
434 */
435
438 void reset();
439 void serialize(std::ostream &os, u16 protocol_version) const;
440 void deSerialize(std::istream &is, u16 protocol_version);
441
442 /*
443 Some handy methods
444 */
446 {
447 switch (drawtype) {
448 case NDT_NORMAL:
449 case NDT_LIQUID:
451 case NDT_NODEBOX:
452 case NDT_MESH:
454 break;
455 default:
457 break;
458 }
459 }
460
461
462 bool isLiquid() const{
463 return (liquid_type != LIQUID_NONE);
464 }
465
466 bool isLiquidRender() const {
468 }
469
476
485
486 int getGroup(const std::string &group) const
487 {
488 return itemgroup_get(groups, group);
489 }
490
491private:
492 void setAlphaFromLegacy(u8 legacy_alpha);
493
494 u8 getAlphaForLegacy() const;
495};
496
510public:
516
523 inline const ContentFeatures& get(content_t c) const {
524 return
525 (c < m_content_features.size() && !m_content_features[c].name.empty()) ?
527 }
528
535 inline const ContentFeatures& get(const MapNode &n) const {
536 return get(n.getContent());
537 }
538
540 // No bound check is necessary, since the array's length is CONTENT_MAX + 1.
542 }
543
545 return getLightingFlags(n.getContent());
546 }
547
554 const ContentFeatures& get(const std::string &name) const;
555
563 bool getId(const std::string &name, content_t &result) const;
564
570 content_t getId(const std::string &name) const;
571
580 bool getIds(const std::string &name, std::vector<content_t> &result) const;
581
587 inline core::aabbox3d<s16> getSelectionBoxIntUnion() const {
589 }
590
600 bool nodeboxConnects(MapNode from, MapNode to,
601 u8 connect_face) const;
602
608 void pendNodeResolve(NodeResolver *nr) const;
609
615
625 content_t set(const std::string &name, const ContentFeatures &def);
626
633 content_t allocateDummy(const std::string &name);
634
640 void removeNode(const std::string &name);
641
646 void updateAliases(IItemDefManager *idef);
647
654 void applyTextureOverrides(const std::vector<TextureOverride> &overrides);
655
661 void applyFunction(const std::function<void(ContentFeatures&)> &function);
662
667 inline u32 size() const
668 {
669 return m_content_features.size();
670 }
671
676 void serialize(std::ostream &os, u16 protocol_version) const;
677
684 void deSerialize(std::istream &is, u16 protocol_version);
685
690 inline void setNodeRegistrationStatus(bool completed) {
692 }
693
700
706
712 void resolveCrossrefs();
713
714#if CHECK_CLIENT_BUILD()
715 // Set of all shader IDs used by leaves-like nodes
716 // (kind of a hack but is needed for dynamic shadows)
717 std::vector<u32> m_leaves_materials;
718#endif
719
720private:
725 void clear();
726
732
740 void addNameIdMapping(content_t i, const std::string &name);
741
749
755
757 std::vector<ContentFeatures> m_content_features;
758
761
767 std::unordered_map<std::string, content_t> m_name_id_mapping_with_aliases;
768
774 std::unordered_map<std::string, std::vector<content_t>> m_group_to_items;
775
783
786
791 aabb3f m_selection_box_union{{0.0f, 0.0f, 0.0f}};
792
798 core::aabbox3d<s16> m_selection_box_int_union{{0, 0, 0}};
799
804 mutable std::vector<NodeResolver *> m_pending_resolve_callbacks;
805
810};
811
813
814// NodeResolver: Queue for node names which are then translated
815// to content_t after the NodeDefManager was initialized
817public:
818 NodeResolver();
819 virtual ~NodeResolver();
820 // Callback which is run as soon NodeDefManager is ready
821 virtual void resolveNodeNames() = 0;
822
823 // required because this class is used as mixin for ObjDef
824 void cloneTo(NodeResolver *res) const;
825
826 bool getIdFromNrBacklog(content_t *result_out,
827 const std::string &node_alt, content_t c_fallback,
828 bool error_on_fallback = true);
829 bool getIdsFromNrBacklog(std::vector<content_t> *result_out,
830 bool all_required = false, content_t c_fallback = CONTENT_IGNORE);
831
832 inline bool isResolveDone() const { return m_resolve_done; }
833 void reset(bool resolve_done = false);
834
835 // Vector containing all node names in the resolve "queue"
836 std::vector<std::string> m_nodenames;
837 // Specifies the "set size" of node names which are to be processed
838 // this is used for getIdsFromNrBacklog
839 // TODO: replace or remove
840 std::vector<size_t> m_nnlistsizes;
841
842protected:
843 friend class NodeDefManager; // m_ndef
844
845 const NodeDefManager *m_ndef = nullptr;
846 // Index of the next "m_nodenames" entry to resolve
848
849private:
850#if BUILD_UNITTESTS
851 // Unittest requires access to m_resolve_done
852 friend class TestSchematic;
853#endif
854 void nodeResolveInternal();
855
856 // Index of the next "m_nnlistsizes" entry to process
858 bool m_resolve_done = false;
859};
Definition gamedef.h:26
Definition itemdef.h:146
Definition shader.h:241
Definition texturesource.h:45
Definition nameidmapping.h:17
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:509
core::aabbox3d< s16 > getSelectionBoxIntUnion() const
Definition nodedef.h:587
aabb3f m_selection_box_union
Definition nodedef.h:791
content_t allocateDummy(const std::string &name)
Definition nodedef.cpp:1003
void setNodeRegistrationStatus(bool completed)
Definition nodedef.h:690
core::aabbox3d< s16 > m_selection_box_int_union
Definition nodedef.h:798
void resolveCrossrefs()
Definition nodedef.cpp:1255
std::unordered_map< std::string, std::vector< content_t > > m_group_to_items
Definition nodedef.h:774
void eraseIdFromGroups(content_t id)
Definition nodedef.cpp:940
void removeNode(const std::string &name)
Definition nodedef.cpp:1012
bool nodeboxConnects(MapNode from, MapNode to, u8 connect_face) const
Definition nodedef.cpp:1273
ContentLightingFlags getLightingFlags(const MapNode &n) const
Definition nodedef.h:544
std::vector< NodeResolver * > m_pending_resolve_callbacks
Definition nodedef.h:804
bool m_node_registration_complete
True if all nodes have been registered.
Definition nodedef.h:785
void pendNodeResolve(NodeResolver *nr) const
Definition nodedef.cpp:1211
content_t m_next_id
Definition nodedef.h:782
bool cancelNodeResolveCallback(NodeResolver *nr) const
Definition nodedef.cpp:1221
const ContentFeatures & get(content_t c) const
Definition nodedef.h:523
void resetNodeResolveState()
Definition nodedef.cpp:1249
u32 size() const
Definition nodedef.h:667
void applyTextureOverrides(const std::vector< TextureOverride > &overrides)
Definition nodedef.cpp:1043
content_t set(const std::string &name, const ContentFeatures &def)
Definition nodedef.cpp:961
const ContentFeatures & get(const MapNode &n) const
Definition nodedef.h:535
void fixSelectionBoxIntUnion()
Definition nodedef.cpp:923
std::unordered_map< std::string, content_t > m_name_id_mapping_with_aliases
Definition nodedef.h:767
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:1113
void deSerialize(std::istream &is, u16 protocol_version)
Definition nodedef.cpp:1141
bool getIds(const std::string &name, std::vector< content_t > &result) const
Definition nodedef.cpp:754
void clear()
Definition nodedef.cpp:661
void updateAliases(IItemDefManager *idef)
Definition nodedef.cpp:1028
void applyFunction(const std::function< void(ContentFeatures &)> &function)
Definition nodedef.cpp:1107
void addNameIdMapping(content_t i, const std::string &name)
Definition nodedef.cpp:1198
NodeDefManager()
Definition nodedef.cpp:656
ContentLightingFlags getLightingFlags(content_t c) const
Definition nodedef.h:539
NameIdMapping m_name_id_mapping
A mapping for fast conversion between names and IDs.
Definition nodedef.h:760
bool getId(const std::string &name, content_t &result) const
Definition nodedef.cpp:736
std::vector< ContentFeatures > m_content_features
Features indexed by ID.
Definition nodedef.h:757
ContentLightingFlags m_content_lighting_flag_cache[CONTENT_MAX+1L]
Definition nodedef.h:809
content_t allocateId()
Definition nodedef.cpp:787
void runNodeResolveCallbacks()
Definition nodedef.cpp:1238
Definition nodedef.h:816
const NodeDefManager * m_ndef
Definition nodedef.h:845
bool isResolveDone() const
Definition nodedef.h:832
bool m_resolve_done
Definition nodedef.h:858
void cloneTo(NodeResolver *res) const
Definition nodedef.cpp:1367
void nodeResolveInternal()
Definition nodedef.cpp:1379
std::vector< size_t > m_nnlistsizes
Definition nodedef.h:840
std::vector< std::string > m_nodenames
Definition nodedef.h:836
virtual void resolveNodeNames()=0
void reset(bool resolve_done=false)
Definition nodedef.cpp:1460
NodeResolver()
Definition nodedef.cpp:1354
u32 m_nodenames_idx
Definition nodedef.h:847
u32 m_nnlistsizes_idx
Definition nodedef.h:857
bool getIdsFromNrBacklog(std::vector< content_t > *result_out, bool all_required=false, content_t c_fallback=CONTENT_IGNORE)
Definition nodedef.cpp:1422
virtual ~NodeResolver()
Definition nodedef.cpp:1360
bool getIdFromNrBacklog(content_t *result_out, const std::string &node_alt, content_t c_fallback, bool error_on_fallback=true)
Definition nodedef.cpp:1392
Definition test_schematic.cpp:11
Definition nodedef.h:166
TextureSettings()=default
int node_texture_size
Definition nodedef.h:171
LeavesStyle leaves_style
Definition nodedef.h:168
bool enable_minimap
Definition nodedef.h:174
bool translucent_liquids
Definition nodedef.h:172
AutoScale autoscale_mode
Definition nodedef.h:170
WorldAlignMode world_aligned_mode
Definition nodedef.h:169
void readSettings()
Definition nodedef.cpp:266
bool connected_glass
Definition nodedef.h:173
core::aabbox3d< f32 > aabb3f
Definition irr_aabb3d.h:11
std::unordered_map< std::string, int > ItemGroupList
Definition itemgroup.h:10
static int itemgroup_get(const ItemGroupList &groups, const std::string &name)
Definition itemgroup.h:12
#define CONTENT_IGNORE
Definition mapnode.h:57
#define CONTENT_MAX
Definition mapnode.h:22
#define CONTENT_UNKNOWN
Definition mapnode.h:39
u16 content_t
Definition mapnode.h:21
NodeDefManager * createNodeDefManager()
Definition nodedef.cpp:1205
PlantlikeStyle
Definition nodedef.h:235
@ PLANT_STYLE_STAR
Definition nodedef.h:238
@ PLANT_STYLE_CROSS
Definition nodedef.h:236
@ PLANT_STYLE_CROSS2
Definition nodedef.h:237
@ PLANT_STYLE_HASH2
Definition nodedef.h:240
@ PLANT_STYLE_HASH
Definition nodedef.h:239
AutoScale
Definition nodedef.h:153
@ AUTOSCALE_DISABLE
Definition nodedef.h:154
@ AUTOSCALE_FORCE
Definition nodedef.h:156
@ AUTOSCALE_ENABLE
Definition nodedef.h:155
LeavesStyle
Definition nodedef.h:147
@ LEAVES_SIMPLE
Definition nodedef.h:149
@ LEAVES_FANCY
Definition nodedef.h:148
@ LEAVES_OPAQUE
Definition nodedef.h:150
static const u8 MO_BIT_RANDOM_OFFSET_Y
Definition nodedef.h:234
ContentParamType2
Definition nodedef.h:39
@ CPT2_DEGROTATE
Definition nodedef.h:52
@ CPT2_COLORED_DEGROTATE
Definition nodedef.h:64
@ CPT2_FULL
Definition nodedef.h:42
@ CPT2_COLORED_4DIR
Definition nodedef.h:68
@ CPT2_WALLMOUNTED
Definition nodedef.h:48
@ CPT2_MESHOPTIONS
Definition nodedef.h:54
@ CPT2_FACEDIR
Definition nodedef.h:46
@ CPT2_4DIR
Definition nodedef.h:66
@ ContentParamType2_END
Definition nodedef.h:70
@ CPT2_COLOR
Definition nodedef.h:56
@ CPT2_COLORED_WALLMOUNTED
Definition nodedef.h:60
@ CPT2_GLASSLIKE_LIQUID_LEVEL
Definition nodedef.h:62
@ CPT2_NONE
Definition nodedef.h:40
@ CPT2_FLOWINGLIQUID
Definition nodedef.h:44
@ CPT2_COLORED_FACEDIR
Definition nodedef.h:58
@ CPT2_LEVELED
Definition nodedef.h:50
LiquidType
Definition nodedef.h:74
@ LIQUID_FLOWING
Definition nodedef.h:76
@ LIQUID_NONE
Definition nodedef.h:75
@ LiquidType_END
Definition nodedef.h:78
@ LIQUID_SOURCE
Definition nodedef.h:77
#define CF_SPECIAL_COUNT
Definition nodedef.h:291
static const u8 MO_BIT_RANDOM_OFFSET
Definition nodedef.h:232
static const u8 MO_MASK_STYLE
Definition nodedef.h:231
ContentParamType
Definition nodedef.h:32
@ CPT_LIGHT
Definition nodedef.h:34
@ ContentParamType_END
Definition nodedef.h:35
@ CPT_NONE
Definition nodedef.h:33
AlphaMode
Definition nodedef.h:250
@ ALPHAMODE_LEGACY_COMPAT
Definition nodedef.h:254
@ ALPHAMODE_CLIP
Definition nodedef.h:252
@ ALPHAMODE_OPAQUE
Definition nodedef.h:253
@ ALPHAMODE_BLEND
Definition nodedef.h:251
@ AlphaMode_END
Definition nodedef.h:255
static const u8 MO_BIT_SCALE_SQRT2
Definition nodedef.h:233
NodeDrawType
Definition nodedef.h:182
@ NDT_SIGNLIKE
Definition nodedef.h:200
@ NDT_FIRELIKE
Definition nodedef.h:218
@ NDT_FLOWINGLIQUID
Definition nodedef.h:190
@ NDT_RAILLIKE
Definition nodedef.h:209
@ NDT_NORMAL
Definition nodedef.h:184
@ NDT_TORCHLIKE
Definition nodedef.h:198
@ NDT_ALLFACES
Definition nodedef.h:194
@ NDT_NODEBOX
Definition nodedef.h:211
@ NDT_FENCELIKE
Definition nodedef.h:206
@ NDT_PLANTLIKE_ROOTED
Definition nodedef.h:224
@ NDT_GLASSLIKE
Definition nodedef.h:192
@ NDT_LIQUID
Definition nodedef.h:188
@ NodeDrawType_END
Definition nodedef.h:227
@ NDT_GLASSLIKE_FRAMED_OPTIONAL
Definition nodedef.h:220
@ NDT_AIRLIKE
Definition nodedef.h:186
@ NDT_MESH
Definition nodedef.h:222
@ NDT_GLASSLIKE_FRAMED
Definition nodedef.h:216
@ NDT_ALLFACES_OPTIONAL
Definition nodedef.h:196
@ NDT_PLANTLIKE
Definition nodedef.h:204
WorldAlignMode
Definition nodedef.h:159
@ WORLDALIGN_FORCE_NODEBOX
Definition nodedef.h:163
@ WORLDALIGN_DISABLE
Definition nodedef.h:160
@ WORLDALIGN_ENABLE
Definition nodedef.h:161
@ WORLDALIGN_FORCE
Definition nodedef.h:162
AlignStyle
Definition nodedef.h:243
@ ALIGN_STYLE_USER_DEFINED
Definition nodedef.h:246
@ ALIGN_STYLE_NODE
Definition nodedef.h:244
@ AlignStyle_END
Definition nodedef.h:247
@ ALIGN_STYLE_WORLD
Definition nodedef.h:245
NodeBoxType
Definition nodedef.h:82
@ NODEBOX_CONNECTED
Definition nodedef.h:87
@ NODEBOX_REGULAR
Definition nodedef.h:83
@ NODEBOX_FIXED
Definition nodedef.h:84
@ NODEBOX_WALLMOUNTED
Definition nodedef.h:85
@ NODEBOX_LEVELED
Definition nodedef.h:86
PointabilityType
Definition pointabilities.h:13
Definition nodedef.h:294
TileDef tiledef_special[CF_SPECIAL_COUNT]
Definition nodedef.h:328
bool light_propagates
Definition nodedef.h:357
void setDefaultAlphaMode()
Definition nodedef.h:445
ItemGroupList groups
Definition nodedef.h:314
ContentParamType param_type
Definition nodedef.h:316
u8 drowning
Definition nodedef.h:408
bool sameLiquidRender(const ContentFeatures &f) const
Definition nodedef.h:470
void reset()
Definition nodedef.cpp:319
std::string name
Definition nodedef.h:313
u8 light_source
Definition nodedef.h:360
bool climbable
Definition nodedef.h:377
TileDef tiledef[6]
Definition nodedef.h:325
bool has_on_destruct
Definition nodedef.h:301
std::string liquid_alternative_source
Definition nodedef.h:398
bool isLiquid() const
Definition nodedef.h:462
bool liquid_move_physics
Definition nodedef.h:393
video::SColor post_effect_color
Definition nodedef.h:340
SoundSpec sound_dug
Definition nodedef.h:422
ContentLightingFlags getLightingFlags() const
Definition nodedef.h:477
NodeBox node_box
Definition nodedef.h:414
bool legacy_wallmounted
Definition nodedef.h:430
u8 liquid_viscosity
Definition nodedef.h:403
video::SColor color
Definition nodedef.h:331
content_t liquid_alternative_source_id
Definition nodedef.h:399
bool buildable_to
Definition nodedef.h:379
ContentParamType2 param_type_2
Definition nodedef.h:318
bool legacy_facedir_simple
Definition nodedef.h:428
bool isLiquidRender() const
Definition nodedef.h:466
void deSerialize(std::istream &is, u16 protocol_version)
Definition nodedef.cpp:520
enum LiquidType liquid_type
Definition nodedef.h:391
u8 leveled_max
Definition nodedef.h:345
float visual_scale
Definition nodedef.h:324
std::string palette_name
Definition nodedef.h:332
static const u8 CONTENTFEATURES_VERSION
Definition nodedef.h:297
bool is_ground_content
Definition nodedef.h:365
SoundSpec sound_dig
Definition nodedef.h:421
std::vector< std::string > connects_to
Definition nodedef.h:337
SoundSpec sound_footstep
Definition nodedef.h:420
bool floodable
Definition nodedef.h:410
bool sunlight_propagates
Definition nodedef.h:358
bool post_effect_color_shaded
Definition nodedef.h:341
ContentFeatures()
Definition nodedef.cpp:307
bool walkable
Definition nodedef.h:371
std::string liquid_alternative_flowing
Definition nodedef.h:395
u32 damage_per_second
Definition nodedef.h:382
bool liquid_renewable
Definition nodedef.h:405
u8 getAlphaForLegacy() const
Definition nodedef.cpp:409
u8 move_resistance
Definition nodedef.h:386
NodeBox collision_box
Definition nodedef.h:416
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:416
bool floats
Definition nodedef.h:305
TileDef tiledef_overlay[6]
Definition nodedef.h:327
bool has_after_destruct
Definition nodedef.h:302
u8 leveled
Definition nodedef.h:343
AlphaMode alpha
Definition nodedef.h:329
u8 connect_sides
Definition nodedef.h:336
~ContentFeatures()
Definition nodedef.cpp:312
void setAlphaFromLegacy(u8 legacy_alpha)
Definition nodedef.cpp:393
u8 waving
Definition nodedef.h:334
bool has_on_construct
Definition nodedef.h:300
NodeBox selection_box
Definition nodedef.h:415
u8 liquid_range
Definition nodedef.h:407
bool diggable
Definition nodedef.h:375
std::string mesh
Definition nodedef.h:323
int getGroup(const std::string &group) const
Definition nodedef.h:486
PointabilityType pointable
Definition nodedef.h:373
bool rightclickable
Definition nodedef.h:381
content_t liquid_alternative_flowing_id
Definition nodedef.h:396
enum NodeDrawType drawtype
Definition nodedef.h:322
std::string node_dig_prediction
Definition nodedef.h:384
std::vector< content_t > connects_to_ids
Definition nodedef.h:338
Definition mapnode.h:62
bool light_propagates
Definition mapnode.h:65
bool sunlight_propagates
Definition mapnode.h:66
u8 light_source
Definition mapnode.h:63
bool has_light
Definition mapnode.h:64
Definition mapnode.h:123
content_t getContent() const noexcept
Definition mapnode.h:165
Definition nodedef.h:91
std::vector< aabb3f > connect_back
Definition nodedef.h:96
std::vector< aabb3f > connect_right
Definition nodedef.h:97
std::vector< aabb3f > disconnected
Definition nodedef.h:104
std::vector< aabb3f > disconnected_front
Definition nodedef.h:100
std::vector< aabb3f > connect_top
Definition nodedef.h:92
std::vector< aabb3f > disconnected_sides
Definition nodedef.h:105
std::vector< aabb3f > connect_bottom
Definition nodedef.h:93
std::vector< aabb3f > disconnected_bottom
Definition nodedef.h:99
std::vector< aabb3f > disconnected_right
Definition nodedef.h:103
std::vector< aabb3f > disconnected_back
Definition nodedef.h:102
std::vector< aabb3f > connect_front
Definition nodedef.h:94
std::vector< aabb3f > disconnected_top
Definition nodedef.h:98
std::vector< aabb3f > disconnected_left
Definition nodedef.h:101
std::vector< aabb3f > connect_left
Definition nodedef.h:95
Definition nodedef.h:109
NodeBoxConnected & getConnected()
Definition nodedef.h:126
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:41
std::shared_ptr< NodeBoxConnected > connected
Definition nodedef.h:120
const NodeBoxConnected & getConnected() const
Definition nodedef.h:131
NodeBox()
Definition nodedef.h:122
void deSerialize(std::istream &is)
Definition nodedef.cpp:101
std::vector< aabb3f > fixed
Definition nodedef.h:113
aabb3f wall_top
Definition nodedef.h:115
enum NodeBoxType type
Definition nodedef.h:110
aabb3f wall_side
Definition nodedef.h:117
~NodeBox()=default
aabb3f wall_bottom
Definition nodedef.h:116
void reset()
Definition nodedef.cpp:28
static constexpr aabb3f dummybox
Definition nodedef.h:142
Definition node_visuals.h:23
Describes the sound information for playback.
Definition sound_spec.h:18
Definition tileanimation.h:18
enum TileAnimationType type
Definition tileanimation.h:19
Definition nodedef.h:263
u8 scale
Definition nodedef.h:273
TileDef()
Definition nodedef.h:277
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:178
AlignStyle align_style
Definition nodedef.h:272
std::string name
Definition nodedef.h:264
video::SColor color
The color of the tile.
Definition nodedef.h:271
bool backface_culling
Definition nodedef.h:265
bool has_color
If true, the tile has its own color.
Definition nodedef.h:269
bool tileable_horizontal
Definition nodedef.h:266
bool tileable_vertical
Definition nodedef.h:267
void deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_version)
Definition nodedef.cpp:233
struct TileAnimationParams animation
Definition nodedef.h:275
@ TAT_NONE
Definition tileanimation.h:12