Luanti 5.10.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; // 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};
143
144struct MapNode;
145class NodeMetadata;
146
152
158
165
181
183{
184 // A basic solid block
186 // Nothing is drawn
188 // Do not draw face towards same kind of flowing/source liquid
190 // A very special kind of thing
192 // Glass-like, don't draw faces towards other glass
194 // Leaves-like, draw all faces no matter what
196 // Enabled -> ndt_allfaces, disabled -> ndt_normal
198 // Single plane perpendicular to a surface
200 // Single plane parallel to a surface
202 // 2 vertical planes in a 'X' shape diagonal to XZ axes.
203 // paramtype2 = "meshoptions" allows various forms, sizes and
204 // vertical and horizontal random offsets.
206 // Fenceposts that connect to neighboring fenceposts with horizontal bars
208 // Selects appropriate junction texture to connect like rails to
209 // neighboring raillikes.
211 // Custom Lua-definable structure of multiple cuboids
213 // Glass-like, draw connected frames and all visible faces.
214 // param2 > 0 defines 64 levels of internal liquid
215 // Uses 3 textures, one for frames, second for faces,
216 // optional third is a 'special tile' for the liquid.
218 // Draw faces slightly rotated and only on neighboring nodes
220 // Enabled -> ndt_glasslike_framed, disabled -> ndt_glasslike
222 // Uses static meshes
224 // Combined plantlike-on-solid
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/*
260 Stand-alone definition of a TileSpec (basically a server-side TileSpec)
261*/
262
264{
265 std::string name = "";
266 bool backface_culling = true; // Takes effect only in special cases
268 bool tileable_vertical = true;
270 bool has_color = false;
272 video::SColor color = video::SColor(0xFFFFFFFF);
274 u8 scale = 0;
275
277
279 {
281 }
282
283 void serialize(std::ostream &os, u16 protocol_version) const;
284 void deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_version);
285};
286
287// Defines the number of special tiles per nodedef
288//
289// NOTE: When changing this value, the enum entries of OverrideTarget and
290// parser in TextureOverrideSource must be updated so that all special
291// tiles can be overridden.
292#define CF_SPECIAL_COUNT 6
293
295{
296 // PROTOCOL_VERSION >= 37. This is legacy and should not be increased anymore,
297 // write checks that depend directly on the protocol version instead.
298 static const u8 CONTENTFEATURES_VERSION = 13;
299
300 /*
301 Cached stuff
302 */
303#if CHECK_CLIENT_BUILD()
304 // 0 1 2 3 4 5
305 // up down right left back front
306 TileSpec tiles[6];
307 // Special tiles
308 TileSpec special_tiles[CF_SPECIAL_COUNT];
309 u8 solidness; // Used when choosing which face is drawn
310 u8 visual_solidness; // When solidness=0, this tells how it looks like
311 bool backface_culling;
312#endif
313
314 // Server-side cached callback existence for fast skipping
318
319 // "float" group
320 bool floats;
321
322 /*
323 Actual data
324 */
325
326 // --- GENERAL PROPERTIES ---
327
328 std::string name; // "" = undefined node
329 ItemGroupList groups; // Same as in itemdef
330 // Type of MapNode::param1
332 // Type of MapNode::param2
334
335 // --- VISUAL PROPERTIES ---
336
338 std::string mesh;
339#if CHECK_CLIENT_BUILD()
340 scene::IMesh *mesh_ptr[24];
341 video::SColor minimap_color;
342#endif
343 float visual_scale; // Misc. scale parameter
345 // These will be drawn over the base tiles.
349 // The color of the node.
350 video::SColor color;
351 std::string palette_name;
352 std::vector<video::SColor> *palette;
353 // Used for waving leaves/plants
355 // for NDT_CONNECTED pairing
357 std::vector<std::string> connects_to;
358 std::vector<content_t> connects_to_ids;
359 // Post effect color, drawn when the camera is inside the node.
360 video::SColor post_effect_color;
362 // Flowing liquid or leveled nodebox, value = default level
364 // Maximum value for leveled nodes
366
367 // --- LIGHTING-RELATED ---
368
371 // Amount of light the node emits
373
374 // --- MAP GENERATION ---
375
376 // True for all ground-like things like stone and mud, false for eg. trees
378
379 // --- INTERACTION PROPERTIES ---
380
381 // This is used for collision detection.
382 // Also for general solidness queries.
384 // Player can point to these, point through or it is blocking
386 // Player can dig these
388 // Player can climb these
390 // Player can build on these
392 // Player cannot build to these (placement prediction disabled)
395 // client dig prediction
397 // how slow players move through
399
400 // --- LIQUID PROPERTIES ---
401
402 // Whether the node is non-liquid, source liquid or flowing liquid
404 // If true, movement (e.g. of players) inside this node is liquid-like.
406 // If the content is liquid, this is the flowing version of the liquid.
409 // If the content is liquid, this is the source version of the liquid.
412 // Viscosity for fluid flow, ranging from 1 to 7, with
413 // 1 giving almost instantaneous propagation and 7 being
414 // the slowest possible
416 // Is liquid renewable (new liquid source will be created between 2 existing)
418 // Number of flowing liquids surrounding source
421 // Liquids flow into and replace node
423
424 // --- NODEBOXES ---
425
429
430 // --- SOUND PROPERTIES ---
431
435
436 // --- LEGACY ---
437
438 // Compatibility with old maps
439 // Set to true if paramtype used to be 'facedir_simple'
441 // Set to true if wall_mounted used to be set to true
443
444 /*
445 Methods
446 */
447
450 void reset();
451 void serialize(std::ostream &os, u16 protocol_version) const;
452 void deSerialize(std::istream &is, u16 protocol_version);
453
454 /*
455 Some handy methods
456 */
458 {
459 switch (drawtype) {
460 case NDT_NORMAL:
461 case NDT_LIQUID:
463 case NDT_NODEBOX:
464 case NDT_MESH:
466 break;
467 default:
469 break;
470 }
471 }
472
474 {
475 switch (drawtype) {
476 case NDT_TORCHLIKE:
477 case NDT_SIGNLIKE:
478 case NDT_FIRELIKE:
479 case NDT_RAILLIKE:
480 case NDT_PLANTLIKE:
482 case NDT_MESH:
483 return false;
484 default:
485 return true;
486 }
487 }
488
489 bool isLiquid() const{
490 return (liquid_type != LIQUID_NONE);
491 }
492
493 bool isLiquidRender() const {
495 }
496
503
512
513 int getGroup(const std::string &group) const
514 {
515 return itemgroup_get(groups, group);
516 }
517
518#if CHECK_CLIENT_BUILD()
519 void updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc,
520 scene::IMeshManipulator *meshmanip, Client *client, const TextureSettings &tsettings);
521#endif
522
523private:
524 void setAlphaFromLegacy(u8 legacy_alpha);
525
526 u8 getAlphaForLegacy() const;
527};
528
542public:
549
556 inline const ContentFeatures& get(content_t c) const {
557 return
558 (c < m_content_features.size() && !m_content_features[c].name.empty()) ?
560 }
561
568 inline const ContentFeatures& get(const MapNode &n) const {
569 return get(n.getContent());
570 }
571
573 // No bound check is necessary, since the array's length is CONTENT_MAX + 1.
575 }
576
578 return getLightingFlags(n.getContent());
579 }
580
587 const ContentFeatures& get(const std::string &name) const;
588
596 bool getId(const std::string &name, content_t &result) const;
597
603 content_t getId(const std::string &name) const;
604
613 bool getIds(const std::string &name, std::vector<content_t> &result) const;
614
620 inline core::aabbox3d<s16> getSelectionBoxIntUnion() const {
622 }
623
633 bool nodeboxConnects(MapNode from, MapNode to,
634 u8 connect_face) const;
635
641 void pendNodeResolve(NodeResolver *nr) const;
642
648
658 content_t set(const std::string &name, const ContentFeatures &def);
659
666 content_t allocateDummy(const std::string &name);
667
673 void removeNode(const std::string &name);
674
679 void updateAliases(IItemDefManager *idef);
680
687 void applyTextureOverrides(const std::vector<TextureOverride> &overrides);
688
698 void updateTextures(IGameDef *gamedef, void *progress_cbk_args);
699
704 void serialize(std::ostream &os, u16 protocol_version) const;
705
712 void deSerialize(std::istream &is, u16 protocol_version);
713
718 inline void setNodeRegistrationStatus(bool completed) {
720 }
721
728
734
740 void resolveCrossrefs();
741
742private:
747 void clear();
748
754
762 void addNameIdMapping(content_t i, const std::string &name);
763
771
777
779 std::vector<ContentFeatures> m_content_features;
780
783
789 std::unordered_map<std::string, content_t> m_name_id_mapping_with_aliases;
790
796 std::unordered_map<std::string, std::vector<content_t>> m_group_to_items;
797
805
808
814
820 core::aabbox3d<s16> m_selection_box_int_union;
821
826 mutable std::vector<NodeResolver *> m_pending_resolve_callbacks;
827
832};
833
835
836// NodeResolver: Queue for node names which are then translated
837// to content_t after the NodeDefManager was initialized
839public:
840 NodeResolver();
841 virtual ~NodeResolver();
842 // Callback which is run as soon NodeDefManager is ready
843 virtual void resolveNodeNames() = 0;
844
845 // required because this class is used as mixin for ObjDef
846 void cloneTo(NodeResolver *res) const;
847
848 bool getIdFromNrBacklog(content_t *result_out,
849 const std::string &node_alt, content_t c_fallback,
850 bool error_on_fallback = true);
851 bool getIdsFromNrBacklog(std::vector<content_t> *result_out,
852 bool all_required = false, content_t c_fallback = CONTENT_IGNORE);
853
854 inline bool isResolveDone() const { return m_resolve_done; }
855 void reset(bool resolve_done = false);
856
857 // Vector containing all node names in the resolve "queue"
858 std::vector<std::string> m_nodenames;
859 // Specifies the "set size" of node names which are to be processed
860 // this is used for getIdsFromNrBacklog
861 // TODO: replace or remove
862 std::vector<size_t> m_nnlistsizes;
863
864protected:
865 friend class NodeDefManager; // m_ndef
866
867 const NodeDefManager *m_ndef = nullptr;
868 // Index of the next "m_nodenames" entry to resolve
870
871private:
872#if BUILD_UNITTESTS
873 // Unittest requires access to m_resolve_done
874 friend class TestSchematic;
875#endif
876 void nodeResolveInternal();
877
878 // Index of the next "m_nnlistsizes" entry to process
880 bool m_resolve_done = false;
881};
Definition client.h:105
Definition gamedef.h:36
Definition itemdef.h:129
Definition shader.h:201
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:541
core::aabbox3d< s16 > getSelectionBoxIntUnion() const
Definition nodedef.h:620
~NodeDefManager()
Definition nodedef.cpp:1013
aabb3f m_selection_box_union
Definition nodedef.h:813
content_t allocateDummy(const std::string &name)
Definition nodedef.cpp:1365
void setNodeRegistrationStatus(bool completed)
Definition nodedef.h:718
core::aabbox3d< s16 > m_selection_box_int_union
Definition nodedef.h:820
void resolveCrossrefs()
Definition nodedef.cpp:1640
std::unordered_map< std::string, std::vector< content_t > > m_group_to_items
Definition nodedef.h:796
void eraseIdFromGroups(content_t id)
Definition nodedef.cpp:1301
void removeNode(const std::string &name)
Definition nodedef.cpp:1374
bool nodeboxConnects(MapNode from, MapNode to, u8 connect_face) const
Definition nodedef.cpp:1658
ContentLightingFlags getLightingFlags(const MapNode &n) const
Definition nodedef.h:577
std::vector< NodeResolver * > m_pending_resolve_callbacks
Definition nodedef.h:826
bool m_node_registration_complete
True if all nodes have been registered.
Definition nodedef.h:807
void pendNodeResolve(NodeResolver *nr) const
Definition nodedef.cpp:1589
content_t m_next_id
Definition nodedef.h:804
bool cancelNodeResolveCallback(NodeResolver *nr) const
Definition nodedef.cpp:1599
const ContentFeatures & get(content_t c) const
Definition nodedef.h:556
void resetNodeResolveState()
Definition nodedef.cpp:1627
void updateTextures(IGameDef *gamedef, void *progress_cbk_args)
Definition nodedef.cpp:1466
void applyTextureOverrides(const std::vector< TextureOverride > &overrides)
Definition nodedef.cpp:1405
content_t set(const std::string &name, const ContentFeatures &def)
Definition nodedef.cpp:1322
const ContentFeatures & get(const MapNode &n) const
Definition nodedef.h:568
void fixSelectionBoxIntUnion()
Definition nodedef.cpp:1284
std::unordered_map< std::string, content_t > m_name_id_mapping_with_aliases
Definition nodedef.h:789
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:1490
void deSerialize(std::istream &is, u16 protocol_version)
Definition nodedef.cpp:1519
bool getIds(const std::string &name, std::vector< content_t > &result) const
Definition nodedef.cpp:1120
void clear()
Definition nodedef.cpp:1026
void updateAliases(IItemDefManager *idef)
Definition nodedef.cpp:1390
void addNameIdMapping(content_t i, const std::string &name)
Definition nodedef.cpp:1576
NodeDefManager()
Definition nodedef.cpp:1007
ContentLightingFlags getLightingFlags(content_t c) const
Definition nodedef.h:572
NameIdMapping m_name_id_mapping
A mapping for fast conversion between names and IDs.
Definition nodedef.h:782
bool getId(const std::string &name, content_t &result) const
Definition nodedef.cpp:1101
std::vector< ContentFeatures > m_content_features
Features indexed by ID.
Definition nodedef.h:779
ContentLightingFlags m_content_lighting_flag_cache[CONTENT_MAX+1L]
Definition nodedef.h:831
content_t allocateId()
Definition nodedef.cpp:1153
void runNodeResolveCallbacks()
Definition nodedef.cpp:1616
Definition nodemetadata.h:24
Definition nodedef.h:838
const NodeDefManager * m_ndef
Definition nodedef.h:867
bool isResolveDone() const
Definition nodedef.h:854
bool m_resolve_done
Definition nodedef.h:880
void cloneTo(NodeResolver *res) const
Definition nodedef.cpp:1752
void nodeResolveInternal()
Definition nodedef.cpp:1764
std::vector< size_t > m_nnlistsizes
Definition nodedef.h:862
std::vector< std::string > m_nodenames
Definition nodedef.h:858
virtual void resolveNodeNames()=0
void reset(bool resolve_done=false)
Definition nodedef.cpp:1845
NodeResolver()
Definition nodedef.cpp:1739
u32 m_nodenames_idx
Definition nodedef.h:869
u32 m_nnlistsizes_idx
Definition nodedef.h:879
bool getIdsFromNrBacklog(std::vector< content_t > *result_out, bool all_required=false, content_t c_fallback=CONTENT_IGNORE)
Definition nodedef.cpp:1807
virtual ~NodeResolver()
Definition nodedef.cpp:1745
bool getIdFromNrBacklog(content_t *result_out, const std::string &node_alt, content_t c_fallback, bool error_on_fallback=true)
Definition nodedef.cpp:1777
Definition test_schematic.cpp:11
Definition nodedef.h:166
TextureSettings()=default
bool enable_mesh_cache
Definition nodedef.h:174
int node_texture_size
Definition nodedef.h:171
LeavesStyle leaves_style
Definition nodedef.h:168
bool enable_minimap
Definition nodedef.h:175
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:269
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: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:1583
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: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:292
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:35
@ CPT_LIGHT
Definition nodedef.h:37
@ ContentParamType_END
Definition nodedef.h:38
@ CPT_NONE
Definition nodedef.h:36
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:183
@ NDT_SIGNLIKE
Definition nodedef.h:201
@ NDT_FIRELIKE
Definition nodedef.h:219
@ NDT_FLOWINGLIQUID
Definition nodedef.h:191
@ NDT_RAILLIKE
Definition nodedef.h:210
@ NDT_NORMAL
Definition nodedef.h:185
@ NDT_TORCHLIKE
Definition nodedef.h:199
@ NDT_ALLFACES
Definition nodedef.h:195
@ NDT_NODEBOX
Definition nodedef.h:212
@ NDT_FENCELIKE
Definition nodedef.h:207
@ NDT_PLANTLIKE_ROOTED
Definition nodedef.h:225
@ NDT_GLASSLIKE
Definition nodedef.h:193
@ NDT_LIQUID
Definition nodedef.h:189
@ NodeDrawType_END
Definition nodedef.h:227
@ NDT_GLASSLIKE_FRAMED_OPTIONAL
Definition nodedef.h:221
@ NDT_AIRLIKE
Definition nodedef.h:187
@ NDT_MESH
Definition nodedef.h:223
@ NDT_GLASSLIKE_FRAMED
Definition nodedef.h:217
@ NDT_ALLFACES_OPTIONAL
Definition nodedef.h:197
@ NDT_PLANTLIKE
Definition nodedef.h:205
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: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:295
TileDef tiledef_special[CF_SPECIAL_COUNT]
Definition nodedef.h:347
bool light_propagates
Definition nodedef.h:369
void setDefaultAlphaMode()
Definition nodedef.h:457
ItemGroupList groups
Definition nodedef.h:329
ContentParamType param_type
Definition nodedef.h:331
u8 drowning
Definition nodedef.h:420
bool sameLiquidRender(const ContentFeatures &f) const
Definition nodedef.h:497
void reset()
Definition nodedef.cpp:331
std::string name
Definition nodedef.h:328
u8 light_source
Definition nodedef.h:372
bool climbable
Definition nodedef.h:389
TileDef tiledef[6]
Definition nodedef.h:344
bool has_on_destruct
Definition nodedef.h:316
std::string liquid_alternative_source
Definition nodedef.h:410
bool isLiquid() const
Definition nodedef.h:489
bool liquid_move_physics
Definition nodedef.h:405
video::SColor post_effect_color
Definition nodedef.h:360
SoundSpec sound_dug
Definition nodedef.h:434
ContentLightingFlags getLightingFlags() const
Definition nodedef.h:504
NodeBox node_box
Definition nodedef.h:426
bool legacy_wallmounted
Definition nodedef.h:442
u8 liquid_viscosity
Definition nodedef.h:415
video::SColor color
Definition nodedef.h:350
content_t liquid_alternative_source_id
Definition nodedef.h:411
bool buildable_to
Definition nodedef.h:391
ContentParamType2 param_type_2
Definition nodedef.h:333
bool legacy_facedir_simple
Definition nodedef.h:440
bool isLiquidRender() const
Definition nodedef.h:493
void deSerialize(std::istream &is, u16 protocol_version)
Definition nodedef.cpp:544
enum LiquidType liquid_type
Definition nodedef.h:403
bool needsBackfaceCulling() const
Definition nodedef.h:473
u8 leveled_max
Definition nodedef.h:365
float visual_scale
Definition nodedef.h:343
std::string palette_name
Definition nodedef.h:351
static const u8 CONTENTFEATURES_VERSION
Definition nodedef.h:298
bool is_ground_content
Definition nodedef.h:377
SoundSpec sound_dig
Definition nodedef.h:433
std::vector< std::string > connects_to
Definition nodedef.h:357
SoundSpec sound_footstep
Definition nodedef.h:432
bool floodable
Definition nodedef.h:422
std::vector< video::SColor > * palette
Definition nodedef.h:352
bool sunlight_propagates
Definition nodedef.h:370
bool post_effect_color_shaded
Definition nodedef.h:361
ContentFeatures()
Definition nodedef.cpp:314
bool walkable
Definition nodedef.h:383
std::string liquid_alternative_flowing
Definition nodedef.h:407
u32 damage_per_second
Definition nodedef.h:394
bool liquid_renewable
Definition nodedef.h:417
u8 getAlphaForLegacy() const
Definition nodedef.cpp:433
u8 move_resistance
Definition nodedef.h:398
NodeBox collision_box
Definition nodedef.h:428
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:440
bool floats
Definition nodedef.h:320
TileDef tiledef_overlay[6]
Definition nodedef.h:346
bool has_after_destruct
Definition nodedef.h:317
u8 leveled
Definition nodedef.h:363
AlphaMode alpha
Definition nodedef.h:348
u8 connect_sides
Definition nodedef.h:356
~ContentFeatures()
Definition nodedef.cpp:319
void setAlphaFromLegacy(u8 legacy_alpha)
Definition nodedef.cpp:417
u8 waving
Definition nodedef.h:354
bool has_on_construct
Definition nodedef.h:315
NodeBox selection_box
Definition nodedef.h:427
u8 liquid_range
Definition nodedef.h:419
bool diggable
Definition nodedef.h:387
std::string mesh
Definition nodedef.h:338
int getGroup(const std::string &group) const
Definition nodedef.h:513
PointabilityType pointable
Definition nodedef.h:385
bool rightclickable
Definition nodedef.h:393
content_t liquid_alternative_flowing_id
Definition nodedef.h:408
enum NodeDrawType drawtype
Definition nodedef.h:337
std::string node_dig_prediction
Definition nodedef.h:396
std::vector< content_t > connects_to_ids
Definition nodedef.h:358
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:48
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:108
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:35
Describes the sound information for playback.
Definition sound.h:20
Definition tileanimation.h:18
enum TileAnimationType type
Definition tileanimation.h:19
Definition nodedef.h:264
u8 scale
Definition nodedef.h:274
TileDef()
Definition nodedef.h:278
void serialize(std::ostream &os, u16 protocol_version) const
Definition nodedef.cpp:185
AlignStyle align_style
Definition nodedef.h:273
std::string name
Definition nodedef.h:265
video::SColor color
The color of the tile.
Definition nodedef.h:272
bool backface_culling
Definition nodedef.h:266
bool has_color
If true, the tile has its own color.
Definition nodedef.h:270
bool tileable_horizontal
Definition nodedef.h:267
bool tileable_vertical
Definition nodedef.h:268
void deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_version)
Definition nodedef.cpp:240
struct TileAnimationParams animation
Definition nodedef.h:276
Definition tile.h:140
@ TAT_NONE
Definition tileanimation.h:12