Luanti 5.11.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
8#include <string>
9#include <iostream>
10#include <map>
11#include "mapnode.h"
12#include "nameidmapping.h"
13#if CHECK_CLIENT_BUILD()
14#include "client/tile.h"
15#include <IMeshManipulator.h>
16class Client;
17#endif
18#include "itemgroup.h"
19#include "sound.h" // SoundSpec
20#include "constants.h" // BS
21#include "texture_override.h" // TextureOverride
22#include "tileanimation.h"
23#include "util/pointabilities.h"
24
25class IItemDefManager;
26class ITextureSource;
27class IShaderSource;
28class IGameDef;
29class NodeResolver;
30#if BUILD_UNITTESTS
31class TestSchematic;
32#endif
33
35{
38 ContentParamType_END // Dummy for validity check
39};
40
42{
44 // Need 8-bit param2
46 // Flowing liquid properties
48 // Direction for chests and furnaces and such (with axis rotation)
50 // Direction for signs, torches and such
52 // Block level like FLOWINGLIQUID
54 // 2D rotation
56 // Mesh options for plants
58 // Index for palette
60 // 3 bits of palette index, then facedir
62 // 5 bits of palette index, then wallmounted
64 // Glasslike framed drawtype internal liquid level, param2 values 0 to 63
66 // 3 bits of palette index, then degrotate
68 // Simplified direction for chests and furnaces and such (4 directions)
70 // 6 bits of palette index, then 4dir
72 // Dummy for validity check
74};
75
76enum LiquidType : u8
77{
81 LiquidType_END // Dummy for validity check
82};
83
84enum NodeBoxType : u8
85{
86 NODEBOX_REGULAR, // Regular block; allows buildable_to
87 NODEBOX_FIXED, // Static separately defined box(es)
88 NODEBOX_WALLMOUNTED, // Box for wall mounted nodes; (top, bottom, side)
89 NODEBOX_LEVELED, // Same as fixed, but with dynamic height from param2. for snow, ...
90 NODEBOX_CONNECTED, // optionally draws nodeboxes if a neighbor node attaches
91};
92
94{
95 std::vector<aabb3f> connect_top;
96 std::vector<aabb3f> connect_bottom;
97 std::vector<aabb3f> connect_front;
98 std::vector<aabb3f> connect_left;
99 std::vector<aabb3f> connect_back;
100 std::vector<aabb3f> connect_right;
101 std::vector<aabb3f> disconnected_top;
102 std::vector<aabb3f> disconnected_bottom;
103 std::vector<aabb3f> disconnected_front;
104 std::vector<aabb3f> disconnected_left;
105 std::vector<aabb3f> disconnected_back;
106 std::vector<aabb3f> disconnected_right;
107 std::vector<aabb3f> disconnected;
108 std::vector<aabb3f> disconnected_sides;
109};
110
112{
114 // NODEBOX_REGULAR (no parameters)
115 // NODEBOX_FIXED
116 std::vector<aabb3f> fixed;
117 // NODEBOX_WALLMOUNTED
120 aabb3f wall_side = dummybox; // being at the -X side
121 // NODEBOX_CONNECTED
122 // (kept externally to not bloat the structure)
123 std::shared_ptr<NodeBoxConnected> connected;
124
126 { reset(); }
127 ~NodeBox() = default;
128
130 if (!connected)
131 connected = std::make_shared<NodeBoxConnected>();
132 return *connected;
133 }
134 inline const NodeBoxConnected &getConnected() const {
135 assert(connected);
136 return *connected;
137 }
138
139 void reset();
140 void serialize(std::ostream &os, u16 protocol_version) const;
141 void deSerialize(std::istream &is);
142
143private:
145 static constexpr aabb3f dummybox = aabb3f({0, 0, 0});
146};
147
148struct MapNode;
149class NodeMetadata;
150
156
162
169
184
186{
187 // A basic solid block
189 // Nothing is drawn
191 // Do not draw face towards same kind of flowing/source liquid
193 // A very special kind of thing
195 // Glass-like, don't draw faces towards other glass
197 // Leaves-like, draw all faces no matter what
199 // Enabled -> ndt_allfaces, disabled -> ndt_normal
201 // Single plane perpendicular to a surface
203 // Single plane parallel to a surface
205 // 2 vertical planes in a 'X' shape diagonal to XZ axes.
206 // paramtype2 = "meshoptions" allows various forms, sizes and
207 // vertical and horizontal random offsets.
209 // Fenceposts that connect to neighboring fenceposts with horizontal bars
211 // Selects appropriate junction texture to connect like rails to
212 // neighboring raillikes.
214 // Custom Lua-definable structure of multiple cuboids
216 // Glass-like, draw connected frames and all visible faces.
217 // param2 > 0 defines 64 levels of internal liquid
218 // Uses 3 textures, one for frames, second for faces,
219 // optional third is a 'special tile' for the liquid.
221 // Draw faces slightly rotated and only on neighboring nodes
223 // Enabled -> ndt_glasslike_framed, disabled -> ndt_glasslike
225 // Uses static meshes
227 // Combined plantlike-on-solid
229
230 // Dummy for validity check
233
234// Mesh options for NDT_PLANTLIKE with CPT2_MESHOPTIONS
235static const u8 MO_MASK_STYLE = 0x07;
236static const u8 MO_BIT_RANDOM_OFFSET = 0x08;
237static const u8 MO_BIT_SCALE_SQRT2 = 0x10;
238static const u8 MO_BIT_RANDOM_OFFSET_Y = 0x20;
246
253
254enum AlphaMode : u8 {
258 ALPHAMODE_LEGACY_COMPAT, /* only sent by old servers, equals OPAQUE */
259 AlphaMode_END // Dummy for validity check
261
262
263/*
264 Stand-alone definition of a TileSpec (basically a server-side TileSpec)
265*/
266
268{
269 std::string name = "";
270 bool backface_culling = true; // Takes effect only in special cases
272 bool tileable_vertical = true;
274 bool has_color = false;
276 video::SColor color = video::SColor(0xFFFFFFFF);
278 u8 scale = 0;
279
281
283 {
285 }
286
287 void serialize(std::ostream &os, u16 protocol_version) const;
288 void deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_version);
289};
290
291// Defines the number of special tiles per nodedef
292//
293// NOTE: When changing this value, the enum entries of OverrideTarget and
294// parser in TextureOverrideSource must be updated so that all special
295// tiles can be overridden.
296#define CF_SPECIAL_COUNT 6
297
299{
300 // PROTOCOL_VERSION >= 37. This is legacy and should not be increased anymore,
301 // write checks that depend directly on the protocol version instead.
302 static const u8 CONTENTFEATURES_VERSION = 13;
303
304 /*
305 Cached stuff
306 */
307#if CHECK_CLIENT_BUILD()
308 // 0 1 2 3 4 5
309 // up down right left back front
310 TileSpec tiles[6];
311 // Special tiles
312 TileSpec special_tiles[CF_SPECIAL_COUNT];
313 u8 solidness; // Used when choosing which face is drawn
314 u8 visual_solidness; // When solidness=0, this tells how it looks like
315 bool backface_culling;
316#endif
317
318 // Server-side cached callback existence for fast skipping
322
323 // "float" group
324 bool floats;
325
326 /*
327 Actual data
328 */
329
330 // --- GENERAL PROPERTIES ---
331
332 std::string name; // "" = undefined node
333 ItemGroupList groups; // Same as in itemdef
334 // Type of MapNode::param1
336 // Type of MapNode::param2
338
339 // --- VISUAL PROPERTIES ---
340
342 std::string mesh;
343#if CHECK_CLIENT_BUILD()
344 scene::IMesh *mesh_ptr; // mesh in case of mesh node
345 video::SColor minimap_color;
346#endif
347 float visual_scale; // Misc. scale parameter
349 // These will be drawn over the base tiles.
353 // The color of the node.
354 video::SColor color;
355 std::string palette_name;
356 std::vector<video::SColor> *palette;
357 // Used for waving leaves/plants
359 // for NDT_CONNECTED pairing
361 std::vector<std::string> connects_to;
362 std::vector<content_t> connects_to_ids;
363 // Post effect color, drawn when the camera is inside the node.
364 video::SColor post_effect_color;
366 // Flowing liquid or leveled nodebox, value = default level
368 // Maximum value for leveled nodes
370
371 // --- LIGHTING-RELATED ---
372
375 // Amount of light the node emits
377
378 // --- MAP GENERATION ---
379
380 // True for all ground-like things like stone and mud, false for eg. trees
382
383 // --- INTERACTION PROPERTIES ---
384
385 // This is used for collision detection.
386 // Also for general solidness queries.
388 // Player can point to these, point through or it is blocking
390 // Player can dig these
392 // Player can climb these
394 // Player can build on these
396 // Player cannot build to these (placement prediction disabled)
399 // client dig prediction
401 // how slow players move through
403
404 // --- LIQUID PROPERTIES ---
405
406 // Whether the node is non-liquid, source liquid or flowing liquid
408 // If true, movement (e.g. of players) inside this node is liquid-like.
410 // If the content is liquid, this is the flowing version of the liquid.
413 // If the content is liquid, this is the source version of the liquid.
416 // Viscosity for fluid flow, ranging from 1 to 7, with
417 // 1 giving almost instantaneous propagation and 7 being
418 // the slowest possible
420 // Is liquid renewable (new liquid source will be created between 2 existing)
422 // Number of flowing liquids surrounding source
425 // Liquids flow into and replace node
427
428 // --- NODEBOXES ---
429
433
434 // --- SOUND PROPERTIES ---
435
439
440 // --- LEGACY ---
441
442 // Compatibility with old maps
443 // Set to true if paramtype used to be 'facedir_simple'
445 // Set to true if wall_mounted used to be set to true
447
448 /*
449 Methods
450 */
451
454 void reset();
455 void serialize(std::ostream &os, u16 protocol_version) const;
456 void deSerialize(std::istream &is, u16 protocol_version);
457
458 /*
459 Some handy methods
460 */
462 {
463 switch (drawtype) {
464 case NDT_NORMAL:
465 case NDT_LIQUID:
467 case NDT_NODEBOX:
468 case NDT_MESH:
470 break;
471 default:
473 break;
474 }
475 }
476
478 {
479 switch (drawtype) {
480 case NDT_TORCHLIKE:
481 case NDT_SIGNLIKE:
482 case NDT_FIRELIKE:
483 case NDT_RAILLIKE:
484 case NDT_PLANTLIKE:
486 case NDT_MESH:
487 return false;
488 default:
489 return true;
490 }
491 }
492
493 bool isLiquid() const{
494 return (liquid_type != LIQUID_NONE);
495 }
496
497 bool isLiquidRender() const {
499 }
500
507
516
517 int getGroup(const std::string &group) const
518 {
519 return itemgroup_get(groups, group);
520 }
521
522#if CHECK_CLIENT_BUILD()
523 void updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc,
524 scene::IMeshManipulator *meshmanip, Client *client, const TextureSettings &tsettings);
525#endif
526
527private:
528 void setAlphaFromLegacy(u8 legacy_alpha);
529
530 u8 getAlphaForLegacy() const;
531};
532
546public:
553
560 inline const ContentFeatures& get(content_t c) const {
561 return
562 (c < m_content_features.size() && !m_content_features[c].name.empty()) ?
564 }
565
572 inline const ContentFeatures& get(const MapNode &n) const {
573 return get(n.getContent());
574 }
575
577 // No bound check is necessary, since the array's length is CONTENT_MAX + 1.
579 }
580
582 return getLightingFlags(n.getContent());
583 }
584
591 const ContentFeatures& get(const std::string &name) const;
592
600 bool getId(const std::string &name, content_t &result) const;
601
607 content_t getId(const std::string &name) const;
608
617 bool getIds(const std::string &name, std::vector<content_t> &result) const;
618
624 inline core::aabbox3d<s16> getSelectionBoxIntUnion() const {
626 }
627
637 bool nodeboxConnects(MapNode from, MapNode to,
638 u8 connect_face) const;
639
645 void pendNodeResolve(NodeResolver *nr) const;
646
652
662 content_t set(const std::string &name, const ContentFeatures &def);
663
670 content_t allocateDummy(const std::string &name);
671
677 void removeNode(const std::string &name);
678
683 void updateAliases(IItemDefManager *idef);
684
691 void applyTextureOverrides(const std::vector<TextureOverride> &overrides);
692
702 void updateTextures(IGameDef *gamedef, void *progress_cbk_args);
703
708 void serialize(std::ostream &os, u16 protocol_version) const;
709
716 void deSerialize(std::istream &is, u16 protocol_version);
717
722 inline void setNodeRegistrationStatus(bool completed) {
724 }
725
732
738
744 void resolveCrossrefs();
745
746private:
751 void clear();
752
758
766 void addNameIdMapping(content_t i, const std::string &name);
767
775
781
783 std::vector<ContentFeatures> m_content_features;
784
787
793 std::unordered_map<std::string, content_t> m_name_id_mapping_with_aliases;
794
800 std::unordered_map<std::string, std::vector<content_t>> m_group_to_items;
801
809
812
817 aabb3f m_selection_box_union{{0.0f, 0.0f, 0.0f}};
818
824 core::aabbox3d<s16> m_selection_box_int_union{{0, 0, 0}};
825
830 mutable std::vector<NodeResolver *> m_pending_resolve_callbacks;
831
836};
837
839
840// NodeResolver: Queue for node names which are then translated
841// to content_t after the NodeDefManager was initialized
843public:
844 NodeResolver();
845 virtual ~NodeResolver();
846 // Callback which is run as soon NodeDefManager is ready
847 virtual void resolveNodeNames() = 0;
848
849 // required because this class is used as mixin for ObjDef
850 void cloneTo(NodeResolver *res) const;
851
852 bool getIdFromNrBacklog(content_t *result_out,
853 const std::string &node_alt, content_t c_fallback,
854 bool error_on_fallback = true);
855 bool getIdsFromNrBacklog(std::vector<content_t> *result_out,
856 bool all_required = false, content_t c_fallback = CONTENT_IGNORE);
857
858 inline bool isResolveDone() const { return m_resolve_done; }
859 void reset(bool resolve_done = false);
860
861 // Vector containing all node names in the resolve "queue"
862 std::vector<std::string> m_nodenames;
863 // Specifies the "set size" of node names which are to be processed
864 // this is used for getIdsFromNrBacklog
865 // TODO: replace or remove
866 std::vector<size_t> m_nnlistsizes;
867
868protected:
869 friend class NodeDefManager; // m_ndef
870
871 const NodeDefManager *m_ndef = nullptr;
872 // Index of the next "m_nodenames" entry to resolve
874
875private:
876#if BUILD_UNITTESTS
877 // Unittest requires access to m_resolve_done
878 friend class TestSchematic;
879#endif
880 void nodeResolveInternal();
881
882 // Index of the next "m_nnlistsizes" entry to process
884 bool m_resolve_done = false;
885};
Definition client.h:104
Definition gamedef.h:36
Definition itemdef.h:129
Definition shader.h:203
Definition texturesource.h:36
Definition nameidmapping.h:17
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:545
core::aabbox3d< s16 > getSelectionBoxIntUnion() const
Definition nodedef.h:624
~NodeDefManager()
Definition nodedef.cpp:982
aabb3f m_selection_box_union
Definition nodedef.h:817
content_t allocateDummy(const std::string &name)
Definition nodedef.cpp:1332
void setNodeRegistrationStatus(bool completed)
Definition nodedef.h:722
core::aabbox3d< s16 > m_selection_box_int_union
Definition nodedef.h:824
void resolveCrossrefs()
Definition nodedef.cpp:1607
std::unordered_map< std::string, std::vector< content_t > > m_group_to_items
Definition nodedef.h:800
void eraseIdFromGroups(content_t id)
Definition nodedef.cpp:1268
void removeNode(const std::string &name)
Definition nodedef.cpp:1341
bool nodeboxConnects(MapNode from, MapNode to, u8 connect_face) const
Definition nodedef.cpp:1625
ContentLightingFlags getLightingFlags(const MapNode &n) const
Definition nodedef.h:581
std::vector< NodeResolver * > m_pending_resolve_callbacks
Definition nodedef.h:830
bool m_node_registration_complete
True if all nodes have been registered.
Definition nodedef.h:811
void pendNodeResolve(NodeResolver *nr) const
Definition nodedef.cpp:1556
content_t m_next_id
Definition nodedef.h:808
bool cancelNodeResolveCallback(NodeResolver *nr) const
Definition nodedef.cpp:1566
const ContentFeatures & get(content_t c) const
Definition nodedef.h:560
void resetNodeResolveState()
Definition nodedef.cpp:1594
void updateTextures(IGameDef *gamedef, void *progress_cbk_args)
Definition nodedef.cpp:1433
void applyTextureOverrides(const std::vector< TextureOverride > &overrides)
Definition nodedef.cpp:1372
content_t set(const std::string &name, const ContentFeatures &def)
Definition nodedef.cpp:1289
const ContentFeatures & get(const MapNode &n) const
Definition nodedef.h:572
void fixSelectionBoxIntUnion()
Definition nodedef.cpp:1251
std::unordered_map< std::string, content_t > m_name_id_mapping_with_aliases
Definition nodedef.h:793
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:1457
void deSerialize(std::istream &is, u16 protocol_version)
Definition nodedef.cpp:1486
bool getIds(const std::string &name, std::vector< content_t > &result) const
Definition nodedef.cpp:1087
void clear()
Definition nodedef.cpp:993
void updateAliases(IItemDefManager *idef)
Definition nodedef.cpp:1357
void addNameIdMapping(content_t i, const std::string &name)
Definition nodedef.cpp:1543
NodeDefManager()
Definition nodedef.cpp:976
ContentLightingFlags getLightingFlags(content_t c) const
Definition nodedef.h:576
NameIdMapping m_name_id_mapping
A mapping for fast conversion between names and IDs.
Definition nodedef.h:786
bool getId(const std::string &name, content_t &result) const
Definition nodedef.cpp:1068
std::vector< ContentFeatures > m_content_features
Features indexed by ID.
Definition nodedef.h:783
ContentLightingFlags m_content_lighting_flag_cache[CONTENT_MAX+1L]
Definition nodedef.h:835
content_t allocateId()
Definition nodedef.cpp:1120
void runNodeResolveCallbacks()
Definition nodedef.cpp:1583
Definition nodemetadata.h:24
Definition nodedef.h:842
const NodeDefManager * m_ndef
Definition nodedef.h:871
bool isResolveDone() const
Definition nodedef.h:858
bool m_resolve_done
Definition nodedef.h:884
void cloneTo(NodeResolver *res) const
Definition nodedef.cpp:1719
void nodeResolveInternal()
Definition nodedef.cpp:1731
std::vector< size_t > m_nnlistsizes
Definition nodedef.h:866
std::vector< std::string > m_nodenames
Definition nodedef.h:862
virtual void resolveNodeNames()=0
void reset(bool resolve_done=false)
Definition nodedef.cpp:1812
NodeResolver()
Definition nodedef.cpp:1706
u32 m_nodenames_idx
Definition nodedef.h:873
u32 m_nnlistsizes_idx
Definition nodedef.h:883
bool getIdsFromNrBacklog(std::vector< content_t > *result_out, bool all_required=false, content_t c_fallback=CONTENT_IGNORE)
Definition nodedef.cpp:1774
virtual ~NodeResolver()
Definition nodedef.cpp:1712
bool getIdFromNrBacklog(content_t *result_out, const std::string &node_alt, content_t c_fallback, bool error_on_fallback=true)
Definition nodedef.cpp:1744
Definition test_schematic.cpp:11
Definition nodedef.h:170
TextureSettings()=default
int node_texture_size
Definition nodedef.h:175
LeavesStyle leaves_style
Definition nodedef.h:172
bool enable_minimap
Definition nodedef.h:178
bool translucent_liquids
Definition nodedef.h:176
AutoScale autoscale_mode
Definition nodedef.h:174
WorldAlignMode world_aligned_mode
Definition nodedef.h:173
void readSettings()
Definition nodedef.cpp:270
bool connected_glass
Definition nodedef.h:177
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:58
#define CONTENT_MAX
Definition mapnode.h:23
#define CONTENT_UNKNOWN
Definition mapnode.h:40
u16 content_t
Definition mapnode.h:22
Definition activeobjectmgr.cpp:11
NodeDefManager * createNodeDefManager()
Definition nodedef.cpp:1550
PlantlikeStyle
Definition nodedef.h:239
@ PLANT_STYLE_STAR
Definition nodedef.h:242
@ PLANT_STYLE_CROSS
Definition nodedef.h:240
@ PLANT_STYLE_CROSS2
Definition nodedef.h:241
@ PLANT_STYLE_HASH2
Definition nodedef.h:244
@ PLANT_STYLE_HASH
Definition nodedef.h:243
AutoScale
Definition nodedef.h:157
@ AUTOSCALE_DISABLE
Definition nodedef.h:158
@ AUTOSCALE_FORCE
Definition nodedef.h:160
@ AUTOSCALE_ENABLE
Definition nodedef.h:159
LeavesStyle
Definition nodedef.h:151
@ LEAVES_SIMPLE
Definition nodedef.h:153
@ LEAVES_FANCY
Definition nodedef.h:152
@ LEAVES_OPAQUE
Definition nodedef.h:154
static const u8 MO_BIT_RANDOM_OFFSET_Y
Definition nodedef.h:238
ContentParamType2
Definition nodedef.h:42
@ CPT2_DEGROTATE
Definition nodedef.h:55
@ CPT2_COLORED_DEGROTATE
Definition nodedef.h:67
@ CPT2_FULL
Definition nodedef.h:45
@ CPT2_COLORED_4DIR
Definition nodedef.h:71
@ CPT2_WALLMOUNTED
Definition nodedef.h:51
@ CPT2_MESHOPTIONS
Definition nodedef.h:57
@ CPT2_FACEDIR
Definition nodedef.h:49
@ CPT2_4DIR
Definition nodedef.h:69
@ ContentParamType2_END
Definition nodedef.h:73
@ CPT2_COLOR
Definition nodedef.h:59
@ CPT2_COLORED_WALLMOUNTED
Definition nodedef.h:63
@ CPT2_GLASSLIKE_LIQUID_LEVEL
Definition nodedef.h:65
@ CPT2_NONE
Definition nodedef.h:43
@ CPT2_FLOWINGLIQUID
Definition nodedef.h:47
@ CPT2_COLORED_FACEDIR
Definition nodedef.h:61
@ CPT2_LEVELED
Definition nodedef.h:53
LiquidType
Definition nodedef.h:77
@ LIQUID_FLOWING
Definition nodedef.h:79
@ LIQUID_NONE
Definition nodedef.h:78
@ LiquidType_END
Definition nodedef.h:81
@ LIQUID_SOURCE
Definition nodedef.h:80
#define CF_SPECIAL_COUNT
Definition nodedef.h:296
static const u8 MO_BIT_RANDOM_OFFSET
Definition nodedef.h:236
static const u8 MO_MASK_STYLE
Definition nodedef.h:235
ContentParamType
Definition nodedef.h:35
@ CPT_LIGHT
Definition nodedef.h:37
@ ContentParamType_END
Definition nodedef.h:38
@ CPT_NONE
Definition nodedef.h:36
AlphaMode
Definition nodedef.h:254
@ ALPHAMODE_LEGACY_COMPAT
Definition nodedef.h:258
@ ALPHAMODE_CLIP
Definition nodedef.h:256
@ ALPHAMODE_OPAQUE
Definition nodedef.h:257
@ ALPHAMODE_BLEND
Definition nodedef.h:255
@ AlphaMode_END
Definition nodedef.h:259
static const u8 MO_BIT_SCALE_SQRT2
Definition nodedef.h:237
NodeDrawType
Definition nodedef.h:186
@ NDT_SIGNLIKE
Definition nodedef.h:204
@ NDT_FIRELIKE
Definition nodedef.h:222
@ NDT_FLOWINGLIQUID
Definition nodedef.h:194
@ NDT_RAILLIKE
Definition nodedef.h:213
@ NDT_NORMAL
Definition nodedef.h:188
@ NDT_TORCHLIKE
Definition nodedef.h:202
@ NDT_ALLFACES
Definition nodedef.h:198
@ NDT_NODEBOX
Definition nodedef.h:215
@ NDT_FENCELIKE
Definition nodedef.h:210
@ NDT_PLANTLIKE_ROOTED
Definition nodedef.h:228
@ NDT_GLASSLIKE
Definition nodedef.h:196
@ NDT_LIQUID
Definition nodedef.h:192
@ NodeDrawType_END
Definition nodedef.h:231
@ NDT_GLASSLIKE_FRAMED_OPTIONAL
Definition nodedef.h:224
@ NDT_AIRLIKE
Definition nodedef.h:190
@ NDT_MESH
Definition nodedef.h:226
@ NDT_GLASSLIKE_FRAMED
Definition nodedef.h:220
@ NDT_ALLFACES_OPTIONAL
Definition nodedef.h:200
@ NDT_PLANTLIKE
Definition nodedef.h:208
WorldAlignMode
Definition nodedef.h:163
@ WORLDALIGN_FORCE_NODEBOX
Definition nodedef.h:167
@ WORLDALIGN_DISABLE
Definition nodedef.h:164
@ WORLDALIGN_ENABLE
Definition nodedef.h:165
@ WORLDALIGN_FORCE
Definition nodedef.h:166
AlignStyle
Definition nodedef.h:247
@ ALIGN_STYLE_USER_DEFINED
Definition nodedef.h:250
@ ALIGN_STYLE_NODE
Definition nodedef.h:248
@ AlignStyle_END
Definition nodedef.h:251
@ ALIGN_STYLE_WORLD
Definition nodedef.h:249
NodeBoxType
Definition nodedef.h:85
@ NODEBOX_CONNECTED
Definition nodedef.h:90
@ NODEBOX_REGULAR
Definition nodedef.h:86
@ NODEBOX_FIXED
Definition nodedef.h:87
@ NODEBOX_WALLMOUNTED
Definition nodedef.h:88
@ NODEBOX_LEVELED
Definition nodedef.h:89
PointabilityType
Definition pointabilities.h:13
Definition nodedef.h:299
TileDef tiledef_special[CF_SPECIAL_COUNT]
Definition nodedef.h:351
bool light_propagates
Definition nodedef.h:373
void setDefaultAlphaMode()
Definition nodedef.h:461
ItemGroupList groups
Definition nodedef.h:333
ContentParamType param_type
Definition nodedef.h:335
u8 drowning
Definition nodedef.h:424
bool sameLiquidRender(const ContentFeatures &f) const
Definition nodedef.h:501
void reset()
Definition nodedef.cpp:326
std::string name
Definition nodedef.h:332
u8 light_source
Definition nodedef.h:376
bool climbable
Definition nodedef.h:393
TileDef tiledef[6]
Definition nodedef.h:348
bool has_on_destruct
Definition nodedef.h:320
std::string liquid_alternative_source
Definition nodedef.h:414
bool isLiquid() const
Definition nodedef.h:493
bool liquid_move_physics
Definition nodedef.h:409
video::SColor post_effect_color
Definition nodedef.h:364
SoundSpec sound_dug
Definition nodedef.h:438
ContentLightingFlags getLightingFlags() const
Definition nodedef.h:508
NodeBox node_box
Definition nodedef.h:430
bool legacy_wallmounted
Definition nodedef.h:446
u8 liquid_viscosity
Definition nodedef.h:419
video::SColor color
Definition nodedef.h:354
content_t liquid_alternative_source_id
Definition nodedef.h:415
bool buildable_to
Definition nodedef.h:395
ContentParamType2 param_type_2
Definition nodedef.h:337
bool legacy_facedir_simple
Definition nodedef.h:444
bool isLiquidRender() const
Definition nodedef.h:497
void deSerialize(std::istream &is, u16 protocol_version)
Definition nodedef.cpp:538
enum LiquidType liquid_type
Definition nodedef.h:407
bool needsBackfaceCulling() const
Definition nodedef.h:477
u8 leveled_max
Definition nodedef.h:369
float visual_scale
Definition nodedef.h:347
std::string palette_name
Definition nodedef.h:355
static const u8 CONTENTFEATURES_VERSION
Definition nodedef.h:302
bool is_ground_content
Definition nodedef.h:381
SoundSpec sound_dig
Definition nodedef.h:437
std::vector< std::string > connects_to
Definition nodedef.h:361
SoundSpec sound_footstep
Definition nodedef.h:436
bool floodable
Definition nodedef.h:426
std::vector< video::SColor > * palette
Definition nodedef.h:356
bool sunlight_propagates
Definition nodedef.h:374
bool post_effect_color_shaded
Definition nodedef.h:365
ContentFeatures()
Definition nodedef.cpp:309
bool walkable
Definition nodedef.h:387
std::string liquid_alternative_flowing
Definition nodedef.h:411
u32 damage_per_second
Definition nodedef.h:398
bool liquid_renewable
Definition nodedef.h:421
u8 getAlphaForLegacy() const
Definition nodedef.cpp:427
u8 move_resistance
Definition nodedef.h:402
NodeBox collision_box
Definition nodedef.h:432
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:434
bool floats
Definition nodedef.h:324
TileDef tiledef_overlay[6]
Definition nodedef.h:350
bool has_after_destruct
Definition nodedef.h:321
u8 leveled
Definition nodedef.h:367
AlphaMode alpha
Definition nodedef.h:352
u8 connect_sides
Definition nodedef.h:360
~ContentFeatures()
Definition nodedef.cpp:314
void setAlphaFromLegacy(u8 legacy_alpha)
Definition nodedef.cpp:411
u8 waving
Definition nodedef.h:358
bool has_on_construct
Definition nodedef.h:319
NodeBox selection_box
Definition nodedef.h:431
u8 liquid_range
Definition nodedef.h:423
bool diggable
Definition nodedef.h:391
std::string mesh
Definition nodedef.h:342
int getGroup(const std::string &group) const
Definition nodedef.h:517
PointabilityType pointable
Definition nodedef.h:389
bool rightclickable
Definition nodedef.h:397
content_t liquid_alternative_flowing_id
Definition nodedef.h:412
enum NodeDrawType drawtype
Definition nodedef.h:341
std::string node_dig_prediction
Definition nodedef.h:400
std::vector< content_t > connects_to_ids
Definition nodedef.h:362
Definition mapnode.h:63
bool light_propagates
Definition mapnode.h:66
bool sunlight_propagates
Definition mapnode.h:67
u8 light_source
Definition mapnode.h:64
bool has_light
Definition mapnode.h:65
Definition mapnode.h:124
content_t getContent() const noexcept
Definition mapnode.h:162
Definition nodedef.h:94
std::vector< aabb3f > connect_back
Definition nodedef.h:99
std::vector< aabb3f > connect_right
Definition nodedef.h:100
std::vector< aabb3f > disconnected
Definition nodedef.h:107
std::vector< aabb3f > disconnected_front
Definition nodedef.h:103
std::vector< aabb3f > connect_top
Definition nodedef.h:95
std::vector< aabb3f > disconnected_sides
Definition nodedef.h:108
std::vector< aabb3f > connect_bottom
Definition nodedef.h:96
std::vector< aabb3f > disconnected_bottom
Definition nodedef.h:102
std::vector< aabb3f > disconnected_right
Definition nodedef.h:106
std::vector< aabb3f > disconnected_back
Definition nodedef.h:105
std::vector< aabb3f > connect_front
Definition nodedef.h:97
std::vector< aabb3f > disconnected_top
Definition nodedef.h:101
std::vector< aabb3f > disconnected_left
Definition nodedef.h:104
std::vector< aabb3f > connect_left
Definition nodedef.h:98
Definition nodedef.h:112
NodeBoxConnected & getConnected()
Definition nodedef.h:129
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:49
std::shared_ptr< NodeBoxConnected > connected
Definition nodedef.h:123
const NodeBoxConnected & getConnected() const
Definition nodedef.h:134
NodeBox()
Definition nodedef.h:125
void deSerialize(std::istream &is)
Definition nodedef.cpp:109
std::vector< aabb3f > fixed
Definition nodedef.h:116
aabb3f wall_top
Definition nodedef.h:118
enum NodeBoxType type
Definition nodedef.h:113
aabb3f wall_side
Definition nodedef.h:120
~NodeBox()=default
aabb3f wall_bottom
Definition nodedef.h:119
void reset()
Definition nodedef.cpp:36
static constexpr aabb3f dummybox
Definition nodedef.h:145
Describes the sound information for playback.
Definition sound.h:20
Definition tileanimation.h:18
enum TileAnimationType type
Definition tileanimation.h:19
Definition nodedef.h:268
u8 scale
Definition nodedef.h:278
TileDef()
Definition nodedef.h:282
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:186
AlignStyle align_style
Definition nodedef.h:277
std::string name
Definition nodedef.h:269
video::SColor color
The color of the tile.
Definition nodedef.h:276
bool backface_culling
Definition nodedef.h:270
bool has_color
If true, the tile has its own color.
Definition nodedef.h:274
bool tileable_horizontal
Definition nodedef.h:271
bool tileable_vertical
Definition nodedef.h:272
void deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_version)
Definition nodedef.cpp:241
struct TileAnimationParams animation
Definition nodedef.h:280
Definition tile.h:143
@ TAT_NONE
Definition tileanimation.h:12