Minetest  5.4.0
nodedef.h
Go to the documentation of this file.
1 /*
2 Minetest
3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14 
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #pragma once
21 
22 #include "irrlichttypes_bloated.h"
23 #include <string>
24 #include <iostream>
25 #include <map>
26 #include "mapnode.h"
27 #include "nameidmapping.h"
28 #ifndef SERVER
29 #include "client/tile.h"
30 #include <IMeshManipulator.h>
31 class Client;
32 #endif
33 #include "itemgroup.h"
34 #include "sound.h" // SimpleSoundSpec
35 #include "constants.h" // BS
36 #include "texture_override.h" // TextureOverride
37 #include "tileanimation.h"
38 
39 // PROTOCOL_VERSION >= 37
40 static const u8 CONTENTFEATURES_VERSION = 13;
41 
42 class IItemDefManager;
43 class ITextureSource;
44 class IShaderSource;
45 class IGameDef;
46 class NodeResolver;
47 
49 {
52 };
53 
55 {
57  // Need 8-bit param2
59  // Flowing liquid properties
61  // Direction for chests and furnaces and such
63  // Direction for signs, torches and such
65  // Block level like FLOWINGLIQUID
67  // 2D rotation for things like plants
69  // Mesh options for plants
71  // Index for palette
73  // 3 bits of palette index, then facedir
75  // 5 bits of palette index, then wallmounted
77  // Glasslike framed drawtype internal liquid level, param2 values 0 to 63
79 };
80 
82 {
86 };
87 
89 {
90  NODEBOX_REGULAR, // Regular block; allows buildable_to
91  NODEBOX_FIXED, // Static separately defined box(es)
92  NODEBOX_WALLMOUNTED, // Box for wall mounted nodes; (top, bottom, side)
93  NODEBOX_LEVELED, // Same as fixed, but with dynamic height from param2. for snow, ...
94  NODEBOX_CONNECTED, // optionally draws nodeboxes if a neighbor node attaches
95 };
96 
97 struct NodeBox
98 {
99  enum NodeBoxType type;
100  // NODEBOX_REGULAR (no parameters)
101  // NODEBOX_FIXED
102  std::vector<aabb3f> fixed;
103  // NODEBOX_WALLMOUNTED
106  aabb3f wall_side; // being at the -X side
107  // NODEBOX_CONNECTED
108  std::vector<aabb3f> connect_top;
109  std::vector<aabb3f> connect_bottom;
110  std::vector<aabb3f> connect_front;
111  std::vector<aabb3f> connect_left;
112  std::vector<aabb3f> connect_back;
113  std::vector<aabb3f> connect_right;
114  std::vector<aabb3f> disconnected_top;
115  std::vector<aabb3f> disconnected_bottom;
116  std::vector<aabb3f> disconnected_front;
117  std::vector<aabb3f> disconnected_left;
118  std::vector<aabb3f> disconnected_back;
119  std::vector<aabb3f> disconnected_right;
120  std::vector<aabb3f> disconnected;
121  std::vector<aabb3f> disconnected_sides;
122 
124  { reset(); }
125 
126  void reset();
127  void serialize(std::ostream &os, u16 protocol_version) const;
128  void deSerialize(std::istream &is);
129 };
130 
131 struct MapNode;
132 class NodeMetadata;
133 
138 };
139 
140 enum AutoScale : u8 {
144 };
145 
146 enum WorldAlignMode : u8 {
151 };
152 
154 public:
163 
164  TextureSettings() = default;
165 
166  void readSettings();
167 };
168 
170 {
171  // A basic solid block
173  // Nothing is drawn
175  // Do not draw face towards same kind of flowing/source liquid
177  // A very special kind of thing
179  // Glass-like, don't draw faces towards other glass
181  // Leaves-like, draw all faces no matter what
183  // Enabled -> ndt_allfaces, disabled -> ndt_normal
185  // Single plane perpendicular to a surface
187  // Single plane parallel to a surface
189  // 2 vertical planes in a 'X' shape diagonal to XZ axes.
190  // paramtype2 = "meshoptions" allows various forms, sizes and
191  // vertical and horizontal random offsets.
193  // Fenceposts that connect to neighbouring fenceposts with horizontal bars
195  // Selects appropriate junction texture to connect like rails to
196  // neighbouring raillikes.
198  // Custom Lua-definable structure of multiple cuboids
200  // Glass-like, draw connected frames and all visible faces.
201  // param2 > 0 defines 64 levels of internal liquid
202  // Uses 3 textures, one for frames, second for faces,
203  // optional third is a 'special tile' for the liquid.
205  // Draw faces slightly rotated and only on neighbouring nodes
207  // Enabled -> ndt_glasslike_framed, disabled -> ndt_glasslike
209  // Uses static meshes
211  // Combined plantlike-on-solid
213 };
214 
215 // Mesh options for NDT_PLANTLIKE with CPT2_MESHOPTIONS
216 static const u8 MO_MASK_STYLE = 0x07;
217 static const u8 MO_BIT_RANDOM_OFFSET = 0x08;
218 static const u8 MO_BIT_SCALE_SQRT2 = 0x10;
219 static const u8 MO_BIT_RANDOM_OFFSET_Y = 0x20;
226 };
227 
228 enum AlignStyle : u8 {
232 };
233 
234 enum AlphaMode : u8 {
238  ALPHAMODE_LEGACY_COMPAT, /* means either opaque or clip */
239 };
240 
241 
242 /*
243  Stand-alone definition of a TileSpec (basically a server-side TileSpec)
244 */
245 
246 struct TileDef
247 {
248  std::string name = "";
249  bool backface_culling = true; // Takes effect only in special cases
250  bool tileable_horizontal = true;
251  bool tileable_vertical = true;
253  bool has_color = false;
255  video::SColor color = video::SColor(0xFFFFFFFF);
257  u8 scale = 0;
258 
260 
262  {
264  }
265 
266  void serialize(std::ostream &os, u16 protocol_version) const;
267  void deSerialize(std::istream &is, u8 contentfeatures_version,
268  NodeDrawType drawtype);
269 };
270 
271 // Defines the number of special tiles per nodedef
272 //
273 // NOTE: When changing this value, the enum entries of OverrideTarget and
274 // parser in TextureOverrideSource must be updated so that all special
275 // tiles can be overridden.
276 #define CF_SPECIAL_COUNT 6
277 
279 {
280  /*
281  Cached stuff
282  */
283 #ifndef SERVER
284  // 0 1 2 3 4 5
285  // up down right left back front
287  // Special tiles
288  // - Currently used for flowing liquids
290  u8 solidness; // Used when choosing which face is drawn
291  u8 visual_solidness; // When solidness=0, this tells how it looks like
293 #endif
294 
295  // Server-side cached callback existence for fast skipping
299 
300  /*
301  Actual data
302  */
303 
304  // --- GENERAL PROPERTIES ---
305 
306  std::string name; // "" = undefined node
307  ItemGroupList groups; // Same as in itemdef
308  // Type of MapNode::param1
310  // Type of MapNode::param2
312 
313  // --- VISUAL PROPERTIES ---
314 
315  enum NodeDrawType drawtype;
316  std::string mesh;
317 #ifndef SERVER
318  scene::IMesh *mesh_ptr[24];
319  video::SColor minimap_color;
320 #endif
321  float visual_scale; // Misc. scale parameter
323  // These will be drawn over the base tiles.
325  TileDef tiledef_special[CF_SPECIAL_COUNT]; // eg. flowing liquid
327  // The color of the node.
328  video::SColor color;
329  std::string palette_name;
330  std::vector<video::SColor> *palette;
331  // Used for waving leaves/plants
332  u8 waving;
333  // for NDT_CONNECTED pairing
335  std::vector<std::string> connects_to;
336  std::vector<content_t> connects_to_ids;
337  // Post effect color, drawn when the camera is inside the node.
338  video::SColor post_effect_color;
339  // Flowing liquid or leveled nodebox, value = default level
341  // Maximum value for leveled nodes
343 
344  // --- LIGHTING-RELATED ---
345 
348  // Amount of light the node emits
350 
351  // --- MAP GENERATION ---
352 
353  // True for all ground-like things like stone and mud, false for eg. trees
355 
356  // --- INTERACTION PROPERTIES ---
357 
358  // This is used for collision detection.
359  // Also for general solidness queries.
360  bool walkable;
361  // Player can point to these
362  bool pointable;
363  // Player can dig these
364  bool diggable;
365  // Player can climb these
366  bool climbable;
367  // Player can build on these
369  // Player cannot build to these (placement prediction disabled)
372  // client dig prediction
373  std::string node_dig_prediction;
374 
375  // --- LIQUID PROPERTIES ---
376 
377  // Whether the node is non-liquid, source liquid or flowing liquid
378  enum LiquidType liquid_type;
379  // If the content is liquid, this is the flowing version of the liquid.
382  // If the content is liquid, this is the source version of the liquid.
385  // Viscosity for fluid flow, ranging from 1 to 7, with
386  // 1 giving almost instantaneous propagation and 7 being
387  // the slowest possible
389  // Is liquid renewable (new liquid source will be created between 2 existing)
391  // Number of flowing liquids surrounding source
394  // Liquids flow into and replace node
395  bool floodable;
396 
397  // --- NODEBOXES ---
398 
402 
403  // --- SOUND PROPERTIES ---
404 
408 
409  // --- LEGACY ---
410 
411  // Compatibility with old maps
412  // Set to true if paramtype used to be 'facedir_simple'
414  // Set to true if wall_mounted used to be set to true
416 
417  /*
418  Methods
419  */
420 
421  ContentFeatures();
423  void reset();
424  void serialize(std::ostream &os, u16 protocol_version) const;
425  void deSerialize(std::istream &is);
426 
427  /*
428  Some handy methods
429  */
431  {
432  switch (drawtype) {
433  case NDT_NORMAL:
434  case NDT_LIQUID:
435  case NDT_FLOWINGLIQUID:
437  break;
438  case NDT_NODEBOX:
439  case NDT_MESH:
440  alpha = ALPHAMODE_LEGACY_COMPAT; // this should eventually be OPAQUE
441  break;
442  default:
444  break;
445  }
446  }
447 
448  bool needsBackfaceCulling() const
449  {
450  switch (drawtype) {
451  case NDT_TORCHLIKE:
452  case NDT_SIGNLIKE:
453  case NDT_FIRELIKE:
454  case NDT_RAILLIKE:
455  case NDT_PLANTLIKE:
457  case NDT_MESH:
458  return false;
459  default:
460  return true;
461  }
462  }
463 
464  bool isLiquid() const{
465  return (liquid_type != LIQUID_NONE);
466  }
467  bool sameLiquid(const ContentFeatures &f) const{
468  if(!isLiquid() || !f.isLiquid()) return false;
470  }
471 
472  int getGroup(const std::string &group) const
473  {
474  return itemgroup_get(groups, group);
475  }
476 
477 #ifndef SERVER
478  void updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc,
479  scene::IMeshManipulator *meshmanip, Client *client, const TextureSettings &tsettings);
480 #endif
481 
482 private:
483 #ifndef SERVER
484  /*
485  * Checks if any tile texture has any transparent pixels.
486  * Prints a warning and returns true if that is the case, false otherwise.
487  * This is supposed to be used for use_texture_alpha backwards compatibility.
488  */
489  bool textureAlphaCheck(ITextureSource *tsrc, const TileDef *tiles,
490  int length);
491 #endif
492 
493  void setAlphaFromLegacy(u8 legacy_alpha);
494 
495  u8 getAlphaForLegacy() const;
496 };
497 
511 public:
516  NodeDefManager();
517  ~NodeDefManager();
518 
525  inline const ContentFeatures& get(content_t c) const {
526  return
527  c < m_content_features.size() ?
529  }
530 
537  inline const ContentFeatures& get(const MapNode &n) const {
538  return get(n.getContent());
539  }
540 
547  const ContentFeatures& get(const std::string &name) const;
548 
556  bool getId(const std::string &name, content_t &result) const;
557 
563  content_t getId(const std::string &name) const;
564 
573  bool getIds(const std::string &name, std::vector<content_t> &result) const;
574 
580  inline core::aabbox3d<s16> getSelectionBoxIntUnion() const {
582  }
583 
593  bool nodeboxConnects(MapNode from, MapNode to,
594  u8 connect_face) const;
595 
601  void pendNodeResolve(NodeResolver *nr) const;
602 
607  bool cancelNodeResolveCallback(NodeResolver *nr) const;
608 
618  content_t set(const std::string &name, const ContentFeatures &def);
619 
626  content_t allocateDummy(const std::string &name);
627 
633  void removeNode(const std::string &name);
634 
639  void updateAliases(IItemDefManager *idef);
640 
647  void applyTextureOverrides(const std::vector<TextureOverride> &overrides);
648 
658  void updateTextures(IGameDef *gamedef,
659  void (*progress_cbk)(void *progress_args, u32 progress, u32 max_progress),
660  void *progress_cbk_args);
661 
666  void serialize(std::ostream &os, u16 protocol_version) const;
667 
673  void deSerialize(std::istream &is);
674 
679  inline void setNodeRegistrationStatus(bool completed) {
680  m_node_registration_complete = completed;
681  }
682 
689 
694  void resetNodeResolveState();
695 
701  void resolveCrossrefs();
702 
703 private:
708  void clear();
709 
715 
723  void addNameIdMapping(content_t i, std::string name);
724 
731  void eraseIdFromGroups(content_t id);
732 
738 
740  std::vector<ContentFeatures> m_content_features;
741 
744 
750  std::unordered_map<std::string, content_t> m_name_id_mapping_with_aliases;
751 
757  std::unordered_map<std::string, std::vector<content_t>> m_group_to_items;
758 
766 
769 
775 
781  core::aabbox3d<s16> m_selection_box_int_union;
782 
787  mutable std::vector<NodeResolver *> m_pending_resolve_callbacks;
788 };
789 
791 
793 public:
794  NodeResolver();
795  virtual ~NodeResolver();
796  virtual void resolveNodeNames() = 0;
797 
798  // required because this class is used as mixin for ObjDef
799  void cloneTo(NodeResolver *res) const;
800 
801  bool getIdFromNrBacklog(content_t *result_out,
802  const std::string &node_alt, content_t c_fallback,
803  bool error_on_fallback = true);
804  bool getIdsFromNrBacklog(std::vector<content_t> *result_out,
805  bool all_required = false, content_t c_fallback = CONTENT_IGNORE);
806 
807  void nodeResolveInternal();
808 
811  std::vector<std::string> m_nodenames;
812  std::vector<size_t> m_nnlistsizes;
813  const NodeDefManager *m_ndef = nullptr;
814  bool m_resolve_done = false;
815 };
Definition: client.h:109
Definition: gamedef.h:49
Definition: itemdef.h:105
Definition: shader.h:126
Definition: tile.h:86
Definition: nameidmapping.h:32
This class is for getting the actual properties of nodes from their content ID.
Definition: nodedef.h:510
const ContentFeatures & get(content_t c) const
Definition: nodedef.h:525
~NodeDefManager()
Definition: nodedef.cpp:1002
void updateTextures(IGameDef *gamedef, void(*progress_cbk)(void *progress_args, u32 progress, u32 max_progress), void *progress_cbk_args)
Definition: nodedef.cpp:1437
aabb3f m_selection_box_union
Definition: nodedef.h:774
content_t allocateDummy(const std::string &name)
Definition: nodedef.cpp:1344
void setNodeRegistrationStatus(bool completed)
Definition: nodedef.h:679
core::aabbox3d< s16 > m_selection_box_int_union
Definition: nodedef.h:781
void resolveCrossrefs()
Definition: nodedef.cpp:1610
std::unordered_map< std::string, std::vector< content_t > > m_group_to_items
Definition: nodedef.h:757
void eraseIdFromGroups(content_t id)
Definition: nodedef.cpp:1282
void removeNode(const std::string &name)
Definition: nodedef.cpp:1353
bool nodeboxConnects(MapNode from, MapNode to, u8 connect_face) const
Definition: nodedef.cpp:1628
std::vector< NodeResolver * > m_pending_resolve_callbacks
Definition: nodedef.h:787
core::aabbox3d< s16 > getSelectionBoxIntUnion() const
Definition: nodedef.h:580
bool m_node_registration_complete
True if all nodes have been registered.
Definition: nodedef.h:768
void pendNodeResolve(NodeResolver *nr) const
Definition: nodedef.cpp:1559
content_t m_next_id
Definition: nodedef.h:765
bool cancelNodeResolveCallback(NodeResolver *nr) const
Definition: nodedef.cpp:1569
void resetNodeResolveState()
Definition: nodedef.cpp:1597
const ContentFeatures & get(const MapNode &n) const
Definition: nodedef.h:537
void deSerialize(std::istream &is)
Definition: nodedef.cpp:1492
void applyTextureOverrides(const std::vector< TextureOverride > &overrides)
Definition: nodedef.cpp:1384
content_t set(const std::string &name, const ContentFeatures &def)
Definition: nodedef.cpp:1303
void fixSelectionBoxIntUnion()
Definition: nodedef.cpp:1265
std::unordered_map< std::string, content_t > m_name_id_mapping_with_aliases
Definition: nodedef.h:750
void serialize(std::ostream &os, u16 protocol_version) const
Definition: nodedef.cpp:1463
bool getIds(const std::string &name, std::vector< content_t > &result) const
Definition: nodedef.cpp:1103
void clear()
Definition: nodedef.cpp:1015
void updateAliases(IItemDefManager *idef)
Definition: nodedef.cpp:1369
NodeDefManager()
Definition: nodedef.cpp:996
void addNameIdMapping(content_t i, std::string name)
Definition: nodedef.cpp:1546
NameIdMapping m_name_id_mapping
A mapping for fast conversion between names and IDs.
Definition: nodedef.h:743
bool getId(const std::string &name, content_t &result) const
Definition: nodedef.cpp:1084
std::vector< ContentFeatures > m_content_features
Features indexed by ID.
Definition: nodedef.h:740
content_t allocateId()
Definition: nodedef.cpp:1137
void runNodeResolveCallbacks()
Definition: nodedef.cpp:1586
Definition: nodemetadata.h:38
Definition: nodedef.h:792
const NodeDefManager * m_ndef
Definition: nodedef.h:813
bool m_resolve_done
Definition: nodedef.h:814
void cloneTo(NodeResolver *res) const
Definition: nodedef.cpp:1690
void nodeResolveInternal()
Definition: nodedef.cpp:1702
std::vector< size_t > m_nnlistsizes
Definition: nodedef.h:812
std::vector< std::string > m_nodenames
Definition: nodedef.h:811
virtual void resolveNodeNames()=0
NodeResolver()
Definition: nodedef.cpp:1676
u32 m_nodenames_idx
Definition: nodedef.h:809
u32 m_nnlistsizes_idx
Definition: nodedef.h:810
bool getIdsFromNrBacklog(std::vector< content_t > *result_out, bool all_required=false, content_t c_fallback=CONTENT_IGNORE)
Definition: nodedef.cpp:1745
virtual ~NodeResolver()
Definition: nodedef.cpp:1683
bool getIdFromNrBacklog(content_t *result_out, const std::string &node_alt, content_t c_fallback, bool error_on_fallback=true)
Definition: nodedef.cpp:1715
Definition: nodedef.h:153
TextureSettings()=default
bool enable_mesh_cache
Definition: nodedef.h:161
int node_texture_size
Definition: nodedef.h:158
LeavesStyle leaves_style
Definition: nodedef.h:155
bool opaque_water
Definition: nodedef.h:159
bool enable_minimap
Definition: nodedef.h:162
AutoScale autoscale_mode
Definition: nodedef.h:157
WorldAlignMode world_aligned_mode
Definition: nodedef.h:156
void readSettings()
Definition: nodedef.cpp:265
bool connected_glass
Definition: nodedef.h:160
core::aabbox3d< f32 > aabb3f
Definition: irr_aabb3d.h:26
std::unordered_map< std::string, int > ItemGroupList
Definition: itemgroup.h:25
static int itemgroup_get(const ItemGroupList &groups, const std::string &name)
Definition: itemgroup.h:27
#define CONTENT_IGNORE
Definition: mapnode.h:71
#define CONTENT_UNKNOWN
Definition: mapnode.h:53
u16 content_t
Definition: mapnode.h:28
Definition: activeobjectmgr.cpp:25
ContentParamType2
Definition: nodedef.h:55
@ CPT2_DEGROTATE
Definition: nodedef.h:68
@ CPT2_FULL
Definition: nodedef.h:58
@ CPT2_WALLMOUNTED
Definition: nodedef.h:64
@ CPT2_MESHOPTIONS
Definition: nodedef.h:70
@ CPT2_FACEDIR
Definition: nodedef.h:62
@ CPT2_COLOR
Definition: nodedef.h:72
@ CPT2_COLORED_WALLMOUNTED
Definition: nodedef.h:76
@ CPT2_GLASSLIKE_LIQUID_LEVEL
Definition: nodedef.h:78
@ CPT2_NONE
Definition: nodedef.h:56
@ CPT2_FLOWINGLIQUID
Definition: nodedef.h:60
@ CPT2_COLORED_FACEDIR
Definition: nodedef.h:74
@ CPT2_LEVELED
Definition: nodedef.h:66
NodeBoxType
Definition: nodedef.h:89
@ NODEBOX_CONNECTED
Definition: nodedef.h:94
@ NODEBOX_REGULAR
Definition: nodedef.h:90
@ NODEBOX_FIXED
Definition: nodedef.h:91
@ NODEBOX_WALLMOUNTED
Definition: nodedef.h:92
@ NODEBOX_LEVELED
Definition: nodedef.h:93
PlantlikeStyle
Definition: nodedef.h:220
@ PLANT_STYLE_STAR
Definition: nodedef.h:223
@ PLANT_STYLE_CROSS
Definition: nodedef.h:221
@ PLANT_STYLE_CROSS2
Definition: nodedef.h:222
@ PLANT_STYLE_HASH2
Definition: nodedef.h:225
@ PLANT_STYLE_HASH
Definition: nodedef.h:224
AutoScale
Definition: nodedef.h:140
@ AUTOSCALE_DISABLE
Definition: nodedef.h:141
@ AUTOSCALE_FORCE
Definition: nodedef.h:143
@ AUTOSCALE_ENABLE
Definition: nodedef.h:142
LeavesStyle
Definition: nodedef.h:134
@ LEAVES_SIMPLE
Definition: nodedef.h:136
@ LEAVES_FANCY
Definition: nodedef.h:135
@ LEAVES_OPAQUE
Definition: nodedef.h:137
static const u8 CONTENTFEATURES_VERSION
Definition: nodedef.h:40
static const u8 MO_BIT_RANDOM_OFFSET_Y
Definition: nodedef.h:219
LiquidType
Definition: nodedef.h:82
@ LIQUID_FLOWING
Definition: nodedef.h:84
@ LIQUID_NONE
Definition: nodedef.h:83
@ LIQUID_SOURCE
Definition: nodedef.h:85
#define CF_SPECIAL_COUNT
Definition: nodedef.h:276
static const u8 MO_BIT_RANDOM_OFFSET
Definition: nodedef.h:217
NodeDefManager * createNodeDefManager()
Definition: nodedef.cpp:1553
static const u8 MO_MASK_STYLE
Definition: nodedef.h:216
AlphaMode
Definition: nodedef.h:234
@ ALPHAMODE_LEGACY_COMPAT
Definition: nodedef.h:238
@ ALPHAMODE_CLIP
Definition: nodedef.h:236
@ ALPHAMODE_OPAQUE
Definition: nodedef.h:237
@ ALPHAMODE_BLEND
Definition: nodedef.h:235
static const u8 MO_BIT_SCALE_SQRT2
Definition: nodedef.h:218
ContentParamType
Definition: nodedef.h:49
@ CPT_LIGHT
Definition: nodedef.h:51
@ CPT_NONE
Definition: nodedef.h:50
WorldAlignMode
Definition: nodedef.h:146
@ WORLDALIGN_FORCE_NODEBOX
Definition: nodedef.h:150
@ WORLDALIGN_DISABLE
Definition: nodedef.h:147
@ WORLDALIGN_ENABLE
Definition: nodedef.h:148
@ WORLDALIGN_FORCE
Definition: nodedef.h:149
AlignStyle
Definition: nodedef.h:228
@ ALIGN_STYLE_USER_DEFINED
Definition: nodedef.h:231
@ ALIGN_STYLE_NODE
Definition: nodedef.h:229
@ ALIGN_STYLE_WORLD
Definition: nodedef.h:230
NodeDrawType
Definition: nodedef.h:170
@ NDT_SIGNLIKE
Definition: nodedef.h:188
@ NDT_FIRELIKE
Definition: nodedef.h:206
@ NDT_FLOWINGLIQUID
Definition: nodedef.h:178
@ NDT_RAILLIKE
Definition: nodedef.h:197
@ NDT_NORMAL
Definition: nodedef.h:172
@ NDT_TORCHLIKE
Definition: nodedef.h:186
@ NDT_ALLFACES
Definition: nodedef.h:182
@ NDT_NODEBOX
Definition: nodedef.h:199
@ NDT_FENCELIKE
Definition: nodedef.h:194
@ NDT_PLANTLIKE_ROOTED
Definition: nodedef.h:212
@ NDT_GLASSLIKE
Definition: nodedef.h:180
@ NDT_LIQUID
Definition: nodedef.h:176
@ NDT_GLASSLIKE_FRAMED_OPTIONAL
Definition: nodedef.h:208
@ NDT_AIRLIKE
Definition: nodedef.h:174
@ NDT_MESH
Definition: nodedef.h:210
@ NDT_GLASSLIKE_FRAMED
Definition: nodedef.h:204
@ NDT_ALLFACES_OPTIONAL
Definition: nodedef.h:184
@ NDT_PLANTLIKE
Definition: nodedef.h:192
Definition: nodedef.h:279
TileDef tiledef_special[CF_SPECIAL_COUNT]
Definition: nodedef.h:325
bool light_propagates
Definition: nodedef.h:346
void setDefaultAlphaMode()
Definition: nodedef.h:430
ItemGroupList groups
Definition: nodedef.h:307
ContentParamType param_type
Definition: nodedef.h:309
bool sameLiquid(const ContentFeatures &f) const
Definition: nodedef.h:467
u8 drowning
Definition: nodedef.h:393
void reset()
Definition: nodedef.cpp:327
std::string name
Definition: nodedef.h:306
u8 light_source
Definition: nodedef.h:349
video::SColor minimap_color
Definition: nodedef.h:319
bool climbable
Definition: nodedef.h:366
TileDef tiledef[6]
Definition: nodedef.h:322
bool pointable
Definition: nodedef.h:362
bool has_on_destruct
Definition: nodedef.h:297
std::string liquid_alternative_source
Definition: nodedef.h:383
bool isLiquid() const
Definition: nodedef.h:464
video::SColor post_effect_color
Definition: nodedef.h:338
NodeBox node_box
Definition: nodedef.h:399
bool legacy_wallmounted
Definition: nodedef.h:415
u8 liquid_viscosity
Definition: nodedef.h:388
video::SColor color
Definition: nodedef.h:328
content_t liquid_alternative_source_id
Definition: nodedef.h:384
bool buildable_to
Definition: nodedef.h:368
ContentParamType2 param_type_2
Definition: nodedef.h:311
bool legacy_facedir_simple
Definition: nodedef.h:413
enum LiquidType liquid_type
Definition: nodedef.h:378
bool needsBackfaceCulling() const
Definition: nodedef.h:448
u8 leveled_max
Definition: nodedef.h:342
float visual_scale
Definition: nodedef.h:321
std::string palette_name
Definition: nodedef.h:329
bool is_ground_content
Definition: nodedef.h:354
std::vector< std::string > connects_to
Definition: nodedef.h:335
SimpleSoundSpec sound_dug
Definition: nodedef.h:407
u8 solidness
Definition: nodedef.h:290
bool floodable
Definition: nodedef.h:395
std::vector< video::SColor > * palette
Definition: nodedef.h:330
bool sunlight_propagates
Definition: nodedef.h:347
ContentFeatures()
Definition: nodedef.cpp:310
bool walkable
Definition: nodedef.h:360
std::string liquid_alternative_flowing
Definition: nodedef.h:380
u32 damage_per_second
Definition: nodedef.h:371
TileSpec tiles[6]
Definition: nodedef.h:286
bool liquid_renewable
Definition: nodedef.h:390
u8 visual_solidness
Definition: nodedef.h:291
void deSerialize(std::istream &is)
Definition: nodedef.cpp:520
SimpleSoundSpec sound_dig
Definition: nodedef.h:406
TileSpec special_tiles[CF_SPECIAL_COUNT]
Definition: nodedef.h:289
u8 getAlphaForLegacy() const
Definition: nodedef.cpp:426
NodeBox collision_box
Definition: nodedef.h:401
void serialize(std::ostream &os, u16 protocol_version) const
Definition: nodedef.cpp:433
SimpleSoundSpec sound_footstep
Definition: nodedef.h:405
TileDef tiledef_overlay[6]
Definition: nodedef.h:324
bool textureAlphaCheck(ITextureSource *tsrc, const TileDef *tiles, int length)
Definition: nodedef.cpp:707
bool backface_culling
Definition: nodedef.h:292
bool has_after_destruct
Definition: nodedef.h:298
u8 leveled
Definition: nodedef.h:340
AlphaMode alpha
Definition: nodedef.h:326
u8 connect_sides
Definition: nodedef.h:334
~ContentFeatures()
Definition: nodedef.cpp:315
void setAlphaFromLegacy(u8 legacy_alpha)
Definition: nodedef.cpp:408
u8 waving
Definition: nodedef.h:332
bool has_on_construct
Definition: nodedef.h:296
NodeBox selection_box
Definition: nodedef.h:400
scene::IMesh * mesh_ptr[24]
Definition: nodedef.h:318
u8 liquid_range
Definition: nodedef.h:392
bool diggable
Definition: nodedef.h:364
std::string mesh
Definition: nodedef.h:316
int getGroup(const std::string &group) const
Definition: nodedef.h:472
bool rightclickable
Definition: nodedef.h:370
content_t liquid_alternative_flowing_id
Definition: nodedef.h:381
enum NodeDrawType drawtype
Definition: nodedef.h:315
std::string node_dig_prediction
Definition: nodedef.h:373
std::vector< content_t > connects_to_ids
Definition: nodedef.h:336
void updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc, scene::IMeshManipulator *meshmanip, Client *client, const TextureSettings &tsettings)
Definition: nodedef.cpp:771
Definition: mapnode.h:118
content_t getContent() const noexcept
Definition: mapnode.h:156
Definition: nodedef.h:98
std::vector< aabb3f > disconnected_left
Definition: nodedef.h:117
void serialize(std::ostream &os, u16 protocol_version) const
Definition: nodedef.cpp:74
std::vector< aabb3f > disconnected_sides
Definition: nodedef.h:121
std::vector< aabb3f > disconnected
Definition: nodedef.h:120
std::vector< aabb3f > disconnected_back
Definition: nodedef.h:118
std::vector< aabb3f > connect_back
Definition: nodedef.h:112
std::vector< aabb3f > connect_bottom
Definition: nodedef.h:109
NodeBox()
Definition: nodedef.h:123
std::vector< aabb3f > disconnected_bottom
Definition: nodedef.h:115
std::vector< aabb3f > disconnected_right
Definition: nodedef.h:119
std::vector< aabb3f > connect_top
Definition: nodedef.h:108
std::vector< aabb3f > connect_right
Definition: nodedef.h:113
void deSerialize(std::istream &is)
Definition: nodedef.cpp:133
std::vector< aabb3f > disconnected_top
Definition: nodedef.h:114
std::vector< aabb3f > fixed
Definition: nodedef.h:102
aabb3f wall_top
Definition: nodedef.h:104
enum NodeBoxType type
Definition: nodedef.h:99
std::vector< aabb3f > connect_front
Definition: nodedef.h:110
aabb3f wall_side
Definition: nodedef.h:106
aabb3f wall_bottom
Definition: nodedef.h:105
std::vector< aabb3f > connect_left
Definition: nodedef.h:111
void reset()
Definition: nodedef.cpp:48
std::vector< aabb3f > disconnected_front
Definition: nodedef.h:116
Definition: sound.h:28
Definition: tileanimation.h:33
enum TileAnimationType type
Definition: tileanimation.h:34
Definition: nodedef.h:247
u8 scale
Definition: nodedef.h:257
TileDef()
Definition: nodedef.h:261
void serialize(std::ostream &os, u16 protocol_version) const
Definition: nodedef.cpp:204
void deSerialize(std::istream &is, u8 contentfeatures_version, NodeDrawType drawtype)
Definition: nodedef.cpp:238
AlignStyle align_style
Definition: nodedef.h:256
std::string name
Definition: nodedef.h:248
video::SColor color
The color of the tile.
Definition: nodedef.h:255
bool backface_culling
Definition: nodedef.h:249
bool has_color
If true, the tile has its own color.
Definition: nodedef.h:253
bool tileable_horizontal
Definition: nodedef.h:250
bool tileable_vertical
Definition: nodedef.h:251
struct TileAnimationParams animation
Definition: nodedef.h:259
Definition: tile.h:301
@ TAT_NONE
Definition: tileanimation.h:27