1
0
mirror of https://codeberg.org/minenux/minetest-mod-xdecor synced 2023-10-20 21:43:39 -07:00

Ench. Table : prevent moving stuff in slots to each other

This commit is contained in:
jp 2015-08-06 18:21:36 +02:00
parent ce22e630ee
commit 6a3a6e612d
2 changed files with 7 additions and 2 deletions

View File

@ -73,6 +73,10 @@ function enchanting.put(pos, listname, index, stack, player)
return count
end
function enchanting.move(pos, from_list, from_index, to_list, to_index, count, player)
return 0
end
xdecor.register("enchantment_table", {
description = "Enchantment Table",
tiles = {
@ -85,7 +89,8 @@ xdecor.register("enchantment_table", {
on_construct = enchanting.construct,
can_dig = enchanting.dig,
allow_metadata_inventory_put = enchanting.put,
on_receive_fields = enchanting.fields
on_receive_fields = enchanting.fields,
allow_metadata_inventory_move = enchanting.move
})
function enchanting.register_enchtools(init, m, def)

View File

@ -66,7 +66,7 @@ function xwall.update_one_node(pos, name, digged)
local newnode = xwall.get_candidate[id]
if newnode and newnode[1] then
local newname = string.sub(name, 1, string.len(name) -3)..newnode[1]
local newname = string.sub(name, 1, string.len(name)-3)..newnode[1]
if newname and minetest.registered_nodes[newname] then
minetest.swap_node(pos, {name=newname, param2=newnode[2]})
elseif newnode[1] == '_c0' and not minetest.registered_nodes[newname] then