the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-
-==============================================================
\ No newline at end of file
return count
end
-function enchanting.move(_, _, _, _, _, _, _) return 0 end
-
xdecor.register("enchantment_table", {
description = "Enchantment Table",
tiles = {
on_construct = enchanting.construct,
on_receive_fields = enchanting.fields,
allow_metadata_inventory_put = enchanting.put,
- allow_metadata_inventory_move = enchanting.move
+ allow_metadata_inventory_move = function(_,_,_,_,_,_,_) return 0 end
})
function enchanting.register_enchtools(init, m, def)
allow_metadata_inventory_put = function(_, listname, _, stack, _)
if listname == "honey" then return 0 end
return stack:get_count()
- end,
+ end
})
minetest.register_abm({
return count
end
-function worktable.move(_, _, _, _, _, _, _) return 0 end
-
xdecor.register("worktable", {
description = "Work Table",
groups = {cracky=2, choppy=2},
on_construct = worktable.construct,
on_receive_fields = worktable.fields,
allow_metadata_inventory_put = worktable.put,
- allow_metadata_inventory_move = worktable.move
+ allow_metadata_inventory_move = function(_,_,_,_,_,_,_) return 0 end
})
local function description(m, w)
local node = minetest.get_node(vector.add(pos, dir))
local ndef = minetest.registered_nodes[node.name]
- if node and node.name and ndef then
- if ndef.drop == name or (ndef.groups and ndef.groups.xwall) then
- candidates[i] = node.name
- id = id + pow2[i]
- end
- if ndef.walkable ~= false and ndef.drawtype ~= "nodebox" then
- candidates[i] = 0
- id = id + pow2[i]
- end
+ if not node and not node.name and not ndef then break end
+ if ndef.drop == name or (ndef.groups and ndef.groups.xwall) then
+ candidates[i] = node.name
+ id = id + pow2[i]
end
end
minetest.swap_node(pos, {name=name, param2=0})
end
end
+
return candidates
end
local c = xwall.update_one_node(pos, name, has_been_digged)
for j = 1, #directions do
local dir2 = directions[j]
- if c[j] ~= 0 and c[j] ~= "ignore" then
- xwall.update_one_node(vector.add(pos, dir2), c[j], false)
- end
+ if c[j] == 0 and c[j] == "ignore" then break end
+ xwall.update_one_node(vector.add(pos, dir2), c[j], false)
end
end
def.drop = name.."_ln"
def.node_box = {type = "fixed", fixed = node_box_data[k]}
- if not def.tiles then
- def.tiles = def.textures
- end
+ if not def.tiles then def.tiles = def.textures end
if not def.groups then
def.groups = {xwall=1, cracky=3}
- else
- def.groups.xwall = 1
end
+ def.groups.xwall = 1
local newdef = clone_table(def)
if k == "ln" then
newdef.on_construct = function(pos)
return xwall.update(pos, name.."_ln", true, nil)
end
- else
- newdef.groups.not_in_creative_inventory = 1
end
+ newdef.groups.not_in_creative_inventory = 1
+
newdef.after_dig_node = function(pos, _, _, _)
return xwall.update(pos, name.."_ln", true, true)
end