30 #include <IMeshManipulator.h>
127 void serialize(std::ostream &os, u16 protocol_version)
const;
255 video::SColor
color = video::SColor(0xFFFFFFFF);
266 void serialize(std::ostream &os, u16 protocol_version)
const;
267 void deSerialize(std::istream &is, u8 contentfeatures_version,
276 #define CF_SPECIAL_COUNT 6
424 void serialize(std::ostream &os, u16 protocol_version)
const;
573 bool getIds(
const std::string &name, std::vector<content_t> &result)
const;
594 u8 connect_face)
const;
659 void (*progress_cbk)(
void *progress_args, u32 progress, u32 max_progress),
660 void *progress_cbk_args);
666 void serialize(std::ostream &os, u16 protocol_version)
const;
802 const std::string &node_alt,
content_t c_fallback,
803 bool error_on_fallback =
true);
Definition: itemdef.h:105
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: 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
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: 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
@ TAT_NONE
Definition: tileanimation.h:27