Ench. Table : prevent moving stuff in slots to each other
This commit is contained in:
parent
ce22e630ee
commit
6a3a6e612d
@ -73,6 +73,10 @@ function enchanting.put(pos, listname, index, stack, player)
|
|||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function enchanting.move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
xdecor.register("enchantment_table", {
|
xdecor.register("enchantment_table", {
|
||||||
description = "Enchantment Table",
|
description = "Enchantment Table",
|
||||||
tiles = {
|
tiles = {
|
||||||
@ -85,7 +89,8 @@ xdecor.register("enchantment_table", {
|
|||||||
on_construct = enchanting.construct,
|
on_construct = enchanting.construct,
|
||||||
can_dig = enchanting.dig,
|
can_dig = enchanting.dig,
|
||||||
allow_metadata_inventory_put = enchanting.put,
|
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)
|
function enchanting.register_enchtools(init, m, def)
|
||||||
|
@ -66,7 +66,7 @@ function xwall.update_one_node(pos, name, digged)
|
|||||||
|
|
||||||
local newnode = xwall.get_candidate[id]
|
local newnode = xwall.get_candidate[id]
|
||||||
if newnode and newnode[1] then
|
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
|
if newname and minetest.registered_nodes[newname] then
|
||||||
minetest.swap_node(pos, {name=newname, param2=newnode[2]})
|
minetest.swap_node(pos, {name=newname, param2=newnode[2]})
|
||||||
elseif newnode[1] == '_c0' and not minetest.registered_nodes[newname] then
|
elseif newnode[1] == '_c0' and not minetest.registered_nodes[newname] then
|
||||||
|
Loading…
Reference in New Issue
Block a user