wield_image = "",
wield_scale = {x=1,y=1,z=1},
stack_max = 99,
+ range = 4.0,
liquids_pointable = false,
tool_capabilities = {
full_punch_interval = 1.0,
//u32 t1 = device->getTimer()->getRealTime();
- f32 d = 4; // max. distance
+ f32 d = playeritem_def.range; // max. distance
+ f32 d_hand = itemdef->get("").range;
+ if(d < 0 && d_hand >= 0)
+ d = d_hand;
+ else if(d < 0)
+ d = 4.0;
core::line3d<f32> shootline(camera_position,
camera_position + camera_direction * BS * (d+1));
groups = def.groups;
node_placement_prediction = def.node_placement_prediction;
sound_place = def.sound_place;
+ range = def.range;
return *this;
}
}
groups.clear();
sound_place = SimpleSoundSpec();
+ range = -1;
node_placement_prediction = "";
}
//serializeSimpleSoundSpec(sound_place, os);
os<<serializeString(sound_place.name);
writeF1000(os, sound_place.gain);
+ writeF1000(os, range);
}
}
// If you add anything here, insert it primarily inside the try-catch
// block to not need to increase the version.
try{
-
+ range = readF1000(is);
}catch(SerializationError &e) {};
}
ToolCapabilities *tool_capabilities;
ItemGroupList groups;
SimpleSoundSpec sound_place;
+ f32 range;
// Client shall immediately place this node when player places the item.
// Server will update the precise end result a moment later.
}
lua_pop(L, 1);
+ def.range = getfloatfield_default(L, index, "range", def.range);
+
// Client shall immediately place this node when player places the item.
// Server will update the precise end result a moment later.
// "" = no prediction