mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Node placement / mineral / serialization / iron freq / node_dig callback
- Node placement code moved to Lua - Mineral system removed (added default:stone_with_coal and default:stone_with_iron). - MapBlock and MapNode serialization updated. - Mapgen: Frequency of iron increased. - node_dig callback and related changes.
This commit is contained in:
parent
f22c73f501
commit
157a4cf18c
36 changed files with 1610 additions and 1454 deletions
11
src/game.cpp
11
src/game.cpp
|
@ -303,6 +303,8 @@ PointedThing getPointedThing(Client *client, v3f player_position,
|
|||
should_show_hilightbox = false;
|
||||
selected_object = NULL;
|
||||
|
||||
INodeDefManager *nodedef = client->getNodeDefManager();
|
||||
|
||||
// First try to find a pointed at active object
|
||||
if(look_for_object)
|
||||
{
|
||||
|
@ -378,7 +380,7 @@ PointedThing getPointedThing(Client *client, v3f player_position,
|
|||
v3s16(-1,0,0), // left
|
||||
};
|
||||
|
||||
const ContentFeatures &f = client->getNodeDefManager()->get(n);
|
||||
const ContentFeatures &f = nodedef->get(n);
|
||||
|
||||
if(f.selection_box.type == NODEBOX_FIXED)
|
||||
{
|
||||
|
@ -447,7 +449,7 @@ PointedThing getPointedThing(Client *client, v3f player_position,
|
|||
}
|
||||
else if(f.selection_box.type == NODEBOX_WALLMOUNTED)
|
||||
{
|
||||
v3s16 dir = unpackDir(n.param2);
|
||||
v3s16 dir = n.getWallMountedDir(nodedef);
|
||||
v3f dir_f = v3f(dir.X, dir.Y, dir.Z);
|
||||
dir_f *= BS/2 - BS/6 - BS/20;
|
||||
v3f cpf = npf + dir_f;
|
||||
|
@ -1827,11 +1829,10 @@ void the_game(
|
|||
MapNode n = client.getNode(nodepos);
|
||||
|
||||
// Get digging properties for material and tool
|
||||
content_t material = n.getContent();
|
||||
MaterialProperties mp = nodedef->get(n.getContent()).material;
|
||||
ToolDiggingProperties tp =
|
||||
playeritem.getToolDiggingProperties(itemdef);
|
||||
DiggingProperties prop =
|
||||
getDiggingProperties(material, &tp, nodedef);
|
||||
DiggingProperties prop = getDiggingProperties(&mp, &tp);
|
||||
|
||||
float dig_time_complete = 0.0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue