Merge branch 'master' of https://github.com/kaadmy/pixture
This commit is contained in:
commit
9fdadc13e6
@ -661,8 +661,8 @@ minetest.register_ore(
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 6,
|
||||
clust_size = 4,
|
||||
height_min = -31000,
|
||||
height_max = 32,
|
||||
y_min = -31000,
|
||||
y_max = 32,
|
||||
})
|
||||
|
||||
minetest.register_ore(
|
||||
@ -673,8 +673,8 @@ minetest.register_ore(
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_num_ores = 8,
|
||||
clust_size = 6,
|
||||
height_min = -31000,
|
||||
height_max = -32,
|
||||
y_min = -31000,
|
||||
y_max = -32,
|
||||
})
|
||||
|
||||
minetest.register_ore(
|
||||
@ -685,8 +685,8 @@ minetest.register_ore(
|
||||
clust_scarcity = 9*9*9,
|
||||
clust_num_ores = 20,
|
||||
clust_size = 10,
|
||||
height_min = -31000,
|
||||
height_max = -64,
|
||||
y_min = -31000,
|
||||
y_max = -64,
|
||||
})
|
||||
|
||||
-- Iron
|
||||
@ -699,8 +699,8 @@ minetest.register_ore(
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_num_ores = 6,
|
||||
clust_size = 4,
|
||||
height_min = -31000,
|
||||
height_max = 0,
|
||||
y_min = -31000,
|
||||
y_max = 0,
|
||||
})
|
||||
|
||||
minetest.register_ore(
|
||||
@ -711,8 +711,8 @@ minetest.register_ore(
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_num_ores = 20,
|
||||
clust_size = 10,
|
||||
height_min = -31000,
|
||||
height_max = -32,
|
||||
y_min = -31000,
|
||||
y_max = -32,
|
||||
})
|
||||
|
||||
-- Steel blocks
|
||||
@ -725,8 +725,8 @@ minetest.register_ore(
|
||||
clust_scarcity = 12*12*12,
|
||||
clust_num_ores = 10,
|
||||
clust_size = 10,
|
||||
height_min = -31000,
|
||||
height_max = -128,
|
||||
y_min = -31000,
|
||||
y_max = -128,
|
||||
})
|
||||
|
||||
-- Water
|
||||
@ -740,8 +740,8 @@ minetest.register_ore( -- Springs
|
||||
clust_scarcity = 18*18*18,
|
||||
clust_num_ores = 1,
|
||||
clust_size = 1,
|
||||
height_min = 20,
|
||||
height_max = 31000,
|
||||
y_min = 20,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
minetest.register_ore( -- Pools
|
||||
@ -766,8 +766,8 @@ minetest.register_ore( -- Swamp
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 10,
|
||||
clust_size = 4,
|
||||
height_min = -31000,
|
||||
height_max = 31000,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
minetest.register_ore( -- Marsh
|
||||
@ -779,8 +779,8 @@ minetest.register_ore( -- Marsh
|
||||
clust_scarcity = 6*6*6,
|
||||
clust_num_ores = 10,
|
||||
clust_size = 6,
|
||||
height_min = -31000,
|
||||
height_max = 31000,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
default.log("mapgen", "loaded")
|
||||
default.log("mapgen", "loaded")
|
||||
|
@ -285,6 +285,6 @@ minetest.register_ore(
|
||||
clust_scarcity = 12*12*12,
|
||||
clust_num_ores = 10,
|
||||
clust_size = 10,
|
||||
height_min = -256,
|
||||
height_max = -32,
|
||||
})
|
||||
y_min = -256,
|
||||
y_max = -32,
|
||||
})
|
||||
|
@ -15,60 +15,46 @@ minetest.register_globalstep(
|
||||
local pos = player:getpos()
|
||||
local inv = player:get_inventory()
|
||||
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 0.5)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and valid(object) then
|
||||
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||
if object:get_luaentity().itemstring ~= "" then
|
||||
minetest.sound_play("item_drop_pickup", {pos = pos, gain = 0.1, max_hear_distance = 8})
|
||||
end
|
||||
object:get_luaentity().itemstring = ""
|
||||
object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1.25)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and valid(object) then
|
||||
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
local pos1 = pos
|
||||
pos1.y = pos1.y+0.2
|
||||
local pos2 = object:getpos()
|
||||
local vec = vector.normalize({x=pos1.x-pos2.x, y=pos1.y-pos2.y, z=pos1.z-pos2.z})
|
||||
vec.x = vec.x*3
|
||||
vec.y = vec.y*3
|
||||
vec.z = vec.z*3
|
||||
object:setvelocity(vec)
|
||||
object:get_luaentity().physical_state = false
|
||||
object:get_luaentity().object:set_properties(
|
||||
{
|
||||
physical = false
|
||||
})
|
||||
|
||||
minetest.after(
|
||||
1,
|
||||
function(args)
|
||||
local vec = {x=pos1.x-pos2.x, y=pos1.y-pos2.y, z=pos1.z-pos2.z}
|
||||
local len = vector.length(vec)
|
||||
if len > 0.5 then
|
||||
vec = vector.divide(vec, len) -- it's a normalize but we have len yet (vector.normalize(vec))
|
||||
vec.x = vec.x*3
|
||||
vec.y = vec.y*3
|
||||
vec.z = vec.z*3
|
||||
object:setvelocity(vec)
|
||||
object:get_luaentity().physical_state = false
|
||||
object:get_luaentity().object:set_properties(
|
||||
{
|
||||
physical = false
|
||||
})
|
||||
else
|
||||
local lua = object:get_luaentity()
|
||||
if object == nil or lua == nil or lua.itemstring == nil then
|
||||
return
|
||||
end
|
||||
if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||
if object:get_luaentity().itemstring ~= "" then
|
||||
if inv:room_for_item("main", ItemStack(lua.itemstring)) then
|
||||
inv:add_item("main", ItemStack(lua.itemstring))
|
||||
if lua.itemstring ~= "" then
|
||||
minetest.sound_play("item_drop_pickup", {pos = pos, gain = 0.3, max_hear_distance = 16})
|
||||
end
|
||||
object:get_luaentity().itemstring = ""
|
||||
lua.itemstring = ""
|
||||
object:remove()
|
||||
else
|
||||
object:setvelocity({x = 0, y = 0, z = 0})
|
||||
object:get_luaentity().physical_state = true
|
||||
object:get_luaentity().object:set_properties(
|
||||
lua.physical_state = true
|
||||
lua.object:set_properties(
|
||||
{
|
||||
physical = true
|
||||
})
|
||||
end
|
||||
end, {player, object})
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -110,4 +96,4 @@ function minetest.handle_node_drops(pos, drops, digger)
|
||||
end
|
||||
end
|
||||
|
||||
default.log("mod:item_drop", "loaded")
|
||||
default.log("mod:item_drop", "loaded")
|
||||
|
@ -212,10 +212,10 @@ minetest.register_ore(
|
||||
clust_scarcity = 11*11*11,
|
||||
clust_num_ores = 3,
|
||||
clust_size = 6,
|
||||
height_min = 0,
|
||||
height_max = 31000,
|
||||
y_min = 0,
|
||||
y_max = 31000,
|
||||
})
|
||||
|
||||
dofile(minetest.get_modpath("jewels").."/jewels.lua")
|
||||
|
||||
default.log("mod:jewels", "loaded")
|
||||
default.log("mod:jewels", "loaded")
|
||||
|
Loading…
Reference in New Issue
Block a user