// make that happen
const ItemDefinition &def =
playeritem.getDefinition(itemdef);
- if(def.node_placement_prediction != "")
+ if(def.node_placement_prediction != ""
+ && !nodedef->get(map.getNode(nodepos)).rightclickable)
do{ // breakable
verbosestream<<"Node placement prediction for "
<<playeritem.name<<" is "
wield_scale = v3f(1.0, 1.0, 1.0);
stack_max = 99;
usable = false;
+ rightclickable = false;
liquids_pointable = false;
if(tool_capabilities)
{
*/
s16 stack_max;
bool usable;
+ // If true, don't use node placement prediction
+ bool rightclickable;
bool liquids_pointable;
// May be NULL. If non-NULL, deleted by destructor
ToolCapabilities *tool_capabilities;
diggable = true;
climbable = false;
buildable_to = false;
+ rightclickable = true;
liquid_type = LIQUID_NONE;
liquid_alternative_flowing = "";
liquid_alternative_source = "";
serializeSimpleSoundSpec(sound_dug, os);
// Stuff below should be moved to correct place in a version that otherwise changes
// the protocol version
+ writeU8(os, rightclickable);
}
void ContentFeatures::deSerialize(std::istream &is)
try{
// Stuff below should be moved to correct place in a version that
// otherwise changes the protocol version
+ rightclickable = readU8(is);
}catch(SerializationError &e) {};
}
bool climbable;
// Player can build on these
bool buildable_to;
+ // Player cannot build to these (placement prediction disabled)
+ bool rightclickable;
// Whether the node is non-liquid, source liquid or flowing liquid
enum LiquidType liquid_type;
// If the content is liquid, this is the flowing version of the liquid.
def.usable = lua_isfunction(L, -1);
lua_pop(L, 1);
+ lua_getfield(L, index, "on_rightclick");
+ def.rightclickable = lua_isfunction(L, -1);
+ lua_pop(L, 1);
+
getboolfield(L, index, "liquids_pointable", def.liquids_pointable);
warn_if_field_exists(L, index, "tool_digging_properties",
// Default to having client-side placement prediction for nodes
// ("" in item definition sets it off)
if(def.node_placement_prediction == "__default"){
- if(def.type == ITEM_NODE)
+ if(def.type == ITEM_NODE && !def.rightclickable)
def.node_placement_prediction = name;
else
def.node_placement_prediction = "";