2019-03-05 19:20:38 -05:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-11-25 20:36:13 -05:00
|
|
|
local minetest, nodecore, pairs
|
|
|
|
= minetest, nodecore, pairs
|
2019-03-05 19:20:38 -05:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
2019-09-09 08:11:06 -04:00
|
|
|
local footsteps = {}
|
|
|
|
|
2019-11-25 20:36:13 -05:00
|
|
|
minetest.unregister_chatcommand("kill")
|
|
|
|
|
2019-03-05 19:20:38 -05:00
|
|
|
minetest.register_on_joinplayer(function(player)
|
2019-04-06 20:49:27 -04:00
|
|
|
local inv = player:get_inventory()
|
2019-04-10 08:33:34 -04:00
|
|
|
inv:set_size("main", 8)
|
|
|
|
inv:set_size("craft", 0)
|
|
|
|
inv:set_size("craftpreview", 0)
|
|
|
|
inv:set_size("craftresult", 0)
|
2019-03-07 10:08:22 -05:00
|
|
|
|
2019-03-10 15:47:22 -04:00
|
|
|
player:set_physics_override({speed = 1.25})
|
|
|
|
|
2019-03-07 10:08:22 -05:00
|
|
|
player:set_properties({
|
|
|
|
makes_footstep_sound = true,
|
2019-03-10 15:47:22 -04:00
|
|
|
|
2019-03-07 10:08:22 -05:00
|
|
|
-- Allow slight zoom for screenshots
|
|
|
|
zoom_fov = 60
|
|
|
|
})
|
2019-09-09 08:11:06 -04:00
|
|
|
footsteps[player:get_player_name()] = true
|
2019-03-05 19:20:38 -05:00
|
|
|
end)
|
2019-04-09 21:06:55 -04:00
|
|
|
|
|
|
|
minetest.register_allow_player_inventory_action(function(_, action)
|
|
|
|
return action == "move" and 0 or 1000000
|
|
|
|
end)
|
2019-08-27 07:33:38 -04:00
|
|
|
|
2019-11-25 20:36:13 -05:00
|
|
|
local function privdropinv(player)
|
2019-11-28 08:55:09 -05:00
|
|
|
if nodecore.interact(player) then return end
|
2019-11-25 20:36:13 -05:00
|
|
|
local pos = player:get_pos()
|
|
|
|
pos.y = pos.y + player:get_properties().eye_height
|
|
|
|
local inv = player:get_inventory()
|
|
|
|
for i, stack in pairs(inv:get_list("main")) do
|
|
|
|
if not stack:is_empty() then
|
2019-11-25 21:14:22 -05:00
|
|
|
local def = minetest.registered_items[stack:get_name()]
|
|
|
|
if def and not def.virtual_item then
|
|
|
|
nodecore.item_eject(pos, stack, 0.001)
|
|
|
|
inv:set_stack("main", i, "")
|
|
|
|
end
|
2019-11-25 20:36:13 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local function setfootsteps(player)
|
|
|
|
local value = not player:get_player_control().sneak
|
|
|
|
local pname = player:get_player_name()
|
|
|
|
if footsteps[pname] ~= value then
|
|
|
|
player:set_properties({
|
|
|
|
makes_footstep_sound = value
|
|
|
|
})
|
|
|
|
footsteps[pname] = value
|
|
|
|
end
|
|
|
|
end
|
2019-09-09 08:11:06 -04:00
|
|
|
|
|
|
|
minetest.register_globalstep(function()
|
|
|
|
for _, player in pairs(minetest.get_connected_players()) do
|
2019-11-25 20:36:13 -05:00
|
|
|
privdropinv(player)
|
|
|
|
setfootsteps(player)
|
2019-09-09 08:11:06 -04:00
|
|
|
end
|
|
|
|
end)
|