fixed exploit allowing players to get items
This commit is contained in:
parent
3a11ce6a91
commit
03ae3ea71f
@ -324,7 +324,7 @@ craft_guide.create_detached_inventory = function()
|
|||||||
return -1
|
return -1
|
||||||
end,
|
end,
|
||||||
allow_take = function(inv, listname, index, stack, player)
|
allow_take = function(inv, listname, index, stack, player)
|
||||||
return -1
|
return 0
|
||||||
end,
|
end,
|
||||||
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||||
end,
|
end,
|
||||||
@ -334,21 +334,10 @@ craft_guide.create_detached_inventory = function()
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
--[[
|
|
||||||
local craft_guide_list = {}
|
|
||||||
for name,def in pairs(minetest.registered_items) do
|
|
||||||
local craft_recipe = minetest.get_craft_recipe(name);
|
|
||||||
if craft_recipe.items ~= nil then
|
|
||||||
if (not def.groups.not_in_craft_guide or def.groups.not_in_craft_guide == 0)
|
|
||||||
--and (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
|
|
||||||
and def.description and def.description ~= "" then
|
|
||||||
table.insert(craft_guide_list, name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
]]--
|
|
||||||
local craft_guide_list = {}
|
local craft_guide_list = {}
|
||||||
for name,def in pairs(minetest.registered_items) do
|
for name,def in pairs(minetest.registered_items) do
|
||||||
|
-- local craft_recipe = minetest.get_craft_recipe(name);
|
||||||
|
-- if craft_recipe.items ~= nil then
|
||||||
local craft = craft_guide.crafts[name];
|
local craft = craft_guide.crafts[name];
|
||||||
if craft ~= nil then
|
if craft ~= nil then
|
||||||
if (not def.groups.not_in_craft_guide or def.groups.not_in_craft_guide == 0)
|
if (not def.groups.not_in_craft_guide or def.groups.not_in_craft_guide == 0)
|
||||||
|
0
depends.txt
Normal file
0
depends.txt
Normal file
@ -34,7 +34,6 @@ minetest.register_node("craft_guide:sign_wall", {
|
|||||||
if from_list == to_list then
|
if from_list == to_list then
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
--print("allow_metadata_inventory_move to list: "..to_list)
|
|
||||||
if to_list == "output" or to_list == "bookmark" then
|
if to_list == "output" or to_list == "bookmark" then
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
@ -47,16 +46,12 @@ minetest.register_node("craft_guide:sign_wall", {
|
|||||||
return 0
|
return 0
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
--print("allow_metadata_inventory_put to list: "..listname)
|
|
||||||
if listname == "bookmark" then
|
if listname == "bookmark" then
|
||||||
return 1
|
minetest.env:get_meta(pos):get_inventory():set_stack(listname,index,stack)
|
||||||
end
|
end
|
||||||
if listname == "output" then
|
if listname == "output" then
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if listname == "output" then
|
craft_guide.update_recipe(meta, player, stack)
|
||||||
craft_guide.update_recipe(meta, player, stack)
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
end,
|
end,
|
||||||
@ -103,7 +98,6 @@ minetest.register_node("craft_guide:lcd_pc", {
|
|||||||
if from_list == to_list then
|
if from_list == to_list then
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
--print("allow_metadata_inventory_move to list: "..to_list)
|
|
||||||
if to_list == "output" or to_list == "bookmark" then
|
if to_list == "output" or to_list == "bookmark" then
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
@ -116,7 +110,6 @@ minetest.register_node("craft_guide:lcd_pc", {
|
|||||||
return 0
|
return 0
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
--print("allow_metadata_inventory_put to list: "..listname)
|
|
||||||
if listname == "bookmark" then
|
if listname == "bookmark" then
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user