Compare commits
90 Commits
Author | SHA1 | Date | |
---|---|---|---|
90aaa1fb62 | |||
6c70e0295a | |||
230747c748 | |||
86cff038a4 | |||
0823f16acb | |||
e1d17b1747 | |||
2817db19d4 | |||
716397819d | |||
67fa74ac01 | |||
d5cc51a396 | |||
cd604fa9c8 | |||
686c0d087c | |||
c27afe7ee8 | |||
9e23e9ecbf | |||
97db50a2fe | |||
a0ba7cf973 | |||
c1b1f2aa49 | |||
0beabfc755 | |||
5fa8852115 | |||
0eb46a01ff | |||
de8726a9f7 | |||
33ec25caed | |||
deb39ddcd4 | |||
2d1e7463d3 | |||
7505fbce51 | |||
9232734a48 | |||
1bf62bbad4 | |||
95cbfc50d8 | |||
61e60724f6 | |||
8c977451a8 | |||
73d078fd27 | |||
0636d574af | |||
c4f2bee9a6 | |||
4763fa635a | |||
3928eccf74 | |||
5311c6ec96 | |||
91937acf76 | |||
e7b4b2ba57 | |||
89fb5aed7f | |||
df54836ea0 | |||
f2a67871d2 | |||
c3eaa9cd64 | |||
d39044a2a7 | |||
8a6b2df6b1 | |||
bed848f68a | |||
24939c299b | |||
24d8d79ea1 | |||
cb4bfa51a1 | |||
7a01de2f36 | |||
c7a4a68d28 | |||
91da5d1308 | |||
39e4bf0346 | |||
dce87664d2 | |||
b97400d71d | |||
abaf4c5121 | |||
609646b9b5 | |||
04d40a5ce4 | |||
24781813fa | |||
0057a87b99 | |||
dfa0f096ce | |||
e9ad8d06c8 | |||
0495f9e209 | |||
2ff55cf6cc | |||
d0638d7284 | |||
6687b5504d | |||
c455ba9b68 | |||
165da9348a | |||
fb8144f703 | |||
df2fdba2b4 | |||
3a7cbfc531 | |||
2768d4974b | |||
d317d7b80b | |||
91ee23d61b | |||
df3a694099 | |||
d75b39683a | |||
68020d2e93 | |||
f1a447d1fe | |||
30d582296b | |||
36c17b04fe | |||
ff9e2a75ee | |||
5497db98de | |||
4a68126a2b | |||
5ce918059d | |||
e0fe1a08c5 | |||
25a6cd866b | |||
0ed7ccfc1f | |||
e5502c9415 | |||
e5e62f9085 | |||
a8a204ae39 | |||
a399f648e7 |
@ -6,7 +6,7 @@ To build the wholeness of the Minetest project, insert this repository as
|
|||||||
in the Minetest Engine.
|
in the Minetest Engine.
|
||||||
|
|
||||||
The Minetest Engine can be found in:
|
The Minetest Engine can be found in:
|
||||||
https://github.com/celeron55/minetest/
|
https://github.com/minetest/minetest/
|
||||||
|
|
||||||
Compatibility
|
Compatibility
|
||||||
--------------
|
--------------
|
||||||
@ -17,7 +17,7 @@ Additionally, when the minetest engine is tagged to be a certain version (eg.
|
|||||||
0.4.dev-20120326), minetest_game is tagged with the version too.
|
0.4.dev-20120326), minetest_game is tagged with the version too.
|
||||||
|
|
||||||
When stable releases are made, minetest_game is packaged and made available in
|
When stable releases are made, minetest_game is packaged and made available in
|
||||||
https://github.com/celeron55/minetest_game/downloads
|
http://minetest.net/download.php
|
||||||
and in case the repository has grown too much, it may be reset. In that sense,
|
and in case the repository has grown too much, it may be reset. In that sense,
|
||||||
this is not a "real" git repository. (Package maintainers please note!)
|
this is not a "real" git repository. (Package maintainers please note!)
|
||||||
|
|
||||||
|
@ -40,14 +40,21 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image)
|
|||||||
if pointed_thing.type ~= "node" then
|
if pointed_thing.type ~= "node" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Check if pointing to a liquid
|
-- Check if pointing to a buildable node
|
||||||
n = minetest.env:get_node(pointed_thing.under)
|
n = minetest.env:get_node(pointed_thing.under)
|
||||||
if bucket.liquids[n.name] == nil then
|
if minetest.registered_nodes[n.name].buildable_to then
|
||||||
-- Not a liquid
|
-- buildable; replace the node
|
||||||
minetest.env:add_node(pointed_thing.above, {name=source})
|
|
||||||
elseif n.name ~= source then
|
|
||||||
-- It's a liquid
|
|
||||||
minetest.env:add_node(pointed_thing.under, {name=source})
|
minetest.env:add_node(pointed_thing.under, {name=source})
|
||||||
|
else
|
||||||
|
-- not buildable to; place the liquid above
|
||||||
|
-- check if the node above can be replaced
|
||||||
|
n = minetest.env:get_node(pointed_thing.above)
|
||||||
|
if minetest.registered_nodes[n.name].buildable_to then
|
||||||
|
minetest.env:add_node(pointed_thing.above,{name=source})
|
||||||
|
else
|
||||||
|
-- do not remove the bucket with the liquid
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return {name="bucket:bucket_empty"}
|
return {name="bucket:bucket_empty"}
|
||||||
end
|
end
|
||||||
@ -56,7 +63,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image)
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem("bucket:bucket_empty", {
|
minetest.register_craftitem("bucket:bucket_empty", {
|
||||||
description = "Emtpy bucket",
|
description = "Empty Bucket",
|
||||||
inventory_image = "bucket.png",
|
inventory_image = "bucket.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
liquids_pointable = true,
|
liquids_pointable = true,
|
||||||
|
1
mods/creative/depends.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
default
|
@ -14,11 +14,7 @@ minetest.after(0, function()
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
allow_put = function(inv, listname, index, stack, player)
|
allow_put = function(inv, listname, index, stack, player)
|
||||||
if minetest.setting_getbool("creative_mode") then
|
return 0
|
||||||
return -1
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
allow_take = function(inv, listname, index, stack, player)
|
allow_take = function(inv, listname, index, stack, player)
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.setting_getbool("creative_mode") then
|
||||||
@ -48,21 +44,30 @@ minetest.after(0, function()
|
|||||||
table.sort(creative_list)
|
table.sort(creative_list)
|
||||||
inv:set_size("main", #creative_list)
|
inv:set_size("main", #creative_list)
|
||||||
for _,itemstring in ipairs(creative_list) do
|
for _,itemstring in ipairs(creative_list) do
|
||||||
local stack = ItemStack(itemstring)
|
inv:add_item("main", ItemStack(itemstring))
|
||||||
-- Make a stack of the right number of items
|
|
||||||
local stack2 = nil
|
|
||||||
if stack:get_stack_max() == 1 then
|
|
||||||
stack2 = ItemStack(stack:get_name())
|
|
||||||
else
|
|
||||||
-- Insert half full so that a taken stack can be put back
|
|
||||||
stack2 = ItemStack(stack:get_name().." "..(stack:get_stack_max()/2))
|
|
||||||
end
|
|
||||||
inv:add_item("main", stack2)
|
|
||||||
end
|
end
|
||||||
creative_inventory.creative_inventory_size = #creative_list
|
creative_inventory.creative_inventory_size = #creative_list
|
||||||
print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
|
print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Create the trash field
|
||||||
|
local trash = minetest.create_detached_inventory("creative_trash", {
|
||||||
|
-- Allow the stack to be placed and remove it in on_put()
|
||||||
|
-- This allows the creative inventory to restore the stack
|
||||||
|
allow_put = function(inv, listname, index, stack, player)
|
||||||
|
if minetest.setting_getbool("creative_mode") then
|
||||||
|
return stack:get_count()
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_put = function(inv, listname, index, stack, player)
|
||||||
|
inv:set_stack(listname, index, "")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
trash:set_size("main", 1)
|
||||||
|
|
||||||
|
|
||||||
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
|
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
|
||||||
pagenum = math.floor(pagenum)
|
pagenum = math.floor(pagenum)
|
||||||
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
|
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
|
||||||
@ -74,7 +79,9 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
|
|||||||
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
|
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
|
||||||
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
|
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
|
||||||
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
|
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
|
||||||
"button[2.7,6.5;1.6,1;creative_next;>>]")
|
"button[2.7,6.5;1.6,1;creative_next;>>]"..
|
||||||
|
"label[5,1.5;Trash:]"..
|
||||||
|
"list[detached:creative_trash;main;5,2;1,1;]")
|
||||||
end
|
end
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
-- If in creative mode, modify player's inventory forms
|
-- If in creative mode, modify player's inventory forms
|
||||||
@ -114,3 +121,42 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
creative_inventory.set_creative_formspec(player, start_i, start_i / (6*4) + 1)
|
creative_inventory.set_creative_formspec(player, start_i, start_i / (6*4) + 1)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
if minetest.setting_getbool("creative_mode") then
|
||||||
|
|
||||||
|
minetest.register_item(":", {
|
||||||
|
type = "none",
|
||||||
|
wield_image = "wieldhand.png",
|
||||||
|
wield_scale = {x=1,y=1,z=2.5},
|
||||||
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 0.5,
|
||||||
|
max_drop_level = 3,
|
||||||
|
groupcaps = {
|
||||||
|
crumbly = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
|
||||||
|
cracky = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
|
||||||
|
snappy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
|
||||||
|
choppy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
|
||||||
|
oddly_breakable_by_hand = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
|
||||||
|
function minetest.handle_node_drops(pos, drops, digger)
|
||||||
|
if not digger or not digger:is_player() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local inv = digger:get_inventory()
|
||||||
|
if inv then
|
||||||
|
for _,item in ipairs(drops) do
|
||||||
|
item = ItemStack(item):get_name()
|
||||||
|
if not inv:contains_item("main", item) then
|
||||||
|
inv:add_item("main", item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
@ -47,7 +47,6 @@ Cisoun's WTFPL texture pack:
|
|||||||
default_tool_mesepick.png
|
default_tool_mesepick.png
|
||||||
default_tool_steelpick.png
|
default_tool_steelpick.png
|
||||||
default_tool_steelshovel.png
|
default_tool_steelshovel.png
|
||||||
default_tool_steelsword.png
|
|
||||||
default_tool_stonepick.png
|
default_tool_stonepick.png
|
||||||
default_tool_stoneshovel.png
|
default_tool_stoneshovel.png
|
||||||
default_tool_woodpick.png
|
default_tool_woodpick.png
|
||||||
@ -68,3 +67,29 @@ VanessaE's animated torches (WTFPL):
|
|||||||
default_torch_on_floor_animated.png
|
default_torch_on_floor_animated.png
|
||||||
default_torch_on_floor.png
|
default_torch_on_floor.png
|
||||||
|
|
||||||
|
RealBadAngel's animated water (WTFPL):
|
||||||
|
default_water_source_animated.png
|
||||||
|
default_water_flowing_animated.png
|
||||||
|
|
||||||
|
VanessaE:
|
||||||
|
default_nc_back.png
|
||||||
|
default_nc_front.png
|
||||||
|
default_nc_rb.png
|
||||||
|
default_nc_side.png
|
||||||
|
|
||||||
|
Calinou's improved default textures (CC BY-SA):
|
||||||
|
default_brick.png
|
||||||
|
default_clay_brick.png
|
||||||
|
default_papyrus.png
|
||||||
|
default_tool_steelsword.png
|
||||||
|
|
||||||
|
MirceaKitsune (WTFPL):
|
||||||
|
character.x
|
||||||
|
|
||||||
|
Jordach (CC BY-SA 3.0):
|
||||||
|
character.png
|
||||||
|
|
||||||
|
Glass breaking sounds (CC BY 3.0):
|
||||||
|
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
|
||||||
|
2: http://www.freesound.org/people/Tomlija/sounds/97669/
|
||||||
|
3: http://www.freesound.org/people/lsprice/sounds/88808/
|
||||||
|
@ -12,6 +12,7 @@ LIGHT_MAX = 14
|
|||||||
default = {}
|
default = {}
|
||||||
|
|
||||||
-- Load other files
|
-- Load other files
|
||||||
|
dofile(minetest.get_modpath("default").."/player.lua")
|
||||||
dofile(minetest.get_modpath("default").."/mapgen.lua")
|
dofile(minetest.get_modpath("default").."/mapgen.lua")
|
||||||
dofile(minetest.get_modpath("default").."/leafdecay.lua")
|
dofile(minetest.get_modpath("default").."/leafdecay.lua")
|
||||||
|
|
||||||
@ -25,13 +26,13 @@ minetest.register_item(":", {
|
|||||||
wield_image = "wieldhand.png",
|
wield_image = "wieldhand.png",
|
||||||
wield_scale = {x=1,y=1,z=2.5},
|
wield_scale = {x=1,y=1,z=2.5},
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 0.9,
|
||||||
max_drop_level = 0,
|
max_drop_level = 0,
|
||||||
groupcaps = {
|
groupcaps = {
|
||||||
fleshy = {times={[2]=2.00, [3]=1.00}, uses=0, maxlevel=1},
|
fleshy = {times={[2]=0.75, [3]=0.6}, uses=0, maxlevel=1},
|
||||||
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
|
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
|
||||||
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
|
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
|
||||||
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3},
|
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -40,9 +41,11 @@ minetest.register_tool("default:pick_wood", {
|
|||||||
description = "Wooden Pickaxe",
|
description = "Wooden Pickaxe",
|
||||||
inventory_image = "default_tool_woodpick.png",
|
inventory_image = "default_tool_woodpick.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.2,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky={times={[2]=2.00, [3]=1.20}, uses=10, maxlevel=1}
|
cracky = {times={[2]=2.00, [3]=1.20}, uses=10, maxlevel=1},
|
||||||
|
fleshy = {times={[2]=0.95, [3]=0.6}, uses=15, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -50,9 +53,11 @@ minetest.register_tool("default:pick_stone", {
|
|||||||
description = "Stone Pickaxe",
|
description = "Stone Pickaxe",
|
||||||
inventory_image = "default_tool_stonepick.png",
|
inventory_image = "default_tool_stonepick.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.3,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky={times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1}
|
cracky = {times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1},
|
||||||
|
fleshy = {times={[2]=0.7, [3]=0.5}, uses=25, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -60,9 +65,11 @@ minetest.register_tool("default:pick_steel", {
|
|||||||
description = "Steel Pickaxe",
|
description = "Steel Pickaxe",
|
||||||
inventory_image = "default_tool_steelpick.png",
|
inventory_image = "default_tool_steelpick.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.0,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky={times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2}
|
cracky = {times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
|
||||||
|
fleshy = {times={[2]=0.6, [3]=0.35}, uses=35, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -70,42 +77,52 @@ minetest.register_tool("default:pick_mese", {
|
|||||||
description = "Mese Pickaxe",
|
description = "Mese Pickaxe",
|
||||||
inventory_image = "default_tool_mesepick.png",
|
inventory_image = "default_tool_mesepick.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 0.65,
|
||||||
max_drop_level=3,
|
max_drop_level=3,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
|
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
|
||||||
crumbly={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
|
crumbly = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
|
||||||
snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}
|
snappy = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
|
||||||
|
fleshy = {times={[2]=0.6, [3]=0.5}, uses=80, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
minetest.register_tool("default:shovel_wood", {
|
minetest.register_tool("default:shovel_wood", {
|
||||||
description = "Wooden Shovel",
|
description = "Wooden Shovel",
|
||||||
inventory_image = "default_tool_woodshovel.png",
|
inventory_image = "default_tool_woodshovel.png",
|
||||||
|
wield_image = "default_tool_woodshovel.png^[transformR90",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.2,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
crumbly={times={[1]=3.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1}
|
crumbly = {times={[1]=3.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1},
|
||||||
|
fleshy = {times={[2]=1.05, [3]=0.70}, uses=25, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
minetest.register_tool("default:shovel_stone", {
|
minetest.register_tool("default:shovel_stone", {
|
||||||
description = "Stone Shovel",
|
description = "Stone Shovel",
|
||||||
inventory_image = "default_tool_stoneshovel.png",
|
inventory_image = "default_tool_stoneshovel.png",
|
||||||
|
wield_image = "default_tool_stoneshovel.png^[transformR90",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.4,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
crumbly={times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1}
|
crumbly = {times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1},
|
||||||
|
fleshy = {times={[2]=0.75, [3]=0.50}, uses=40, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
minetest.register_tool("default:shovel_steel", {
|
minetest.register_tool("default:shovel_steel", {
|
||||||
description = "Steel Shovel",
|
description = "Steel Shovel",
|
||||||
inventory_image = "default_tool_steelshovel.png",
|
inventory_image = "default_tool_steelshovel.png",
|
||||||
|
wield_image = "default_tool_steelshovel.png^[transformR90",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.1,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
crumbly={times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=30, maxlevel=2}
|
crumbly = {times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=30, maxlevel=2},
|
||||||
|
fleshy = {times={[2]=0.45, [3]=0.30}, uses=50, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -113,10 +130,11 @@ minetest.register_tool("default:axe_wood", {
|
|||||||
description = "Wooden Axe",
|
description = "Wooden Axe",
|
||||||
inventory_image = "default_tool_woodaxe.png",
|
inventory_image = "default_tool_woodaxe.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.0,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
choppy={times={[2]=1.40, [3]=0.80}, uses=10, maxlevel=1},
|
choppy = {times={[2]=1.60, [3]=1.20}, uses=10, maxlevel=1},
|
||||||
fleshy={times={[2]=1.50, [3]=0.80}, uses=10, maxlevel=1}
|
fleshy = {times={[2]=0.70, [3]=0.50}, uses=5, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -124,10 +142,11 @@ minetest.register_tool("default:axe_stone", {
|
|||||||
description = "Stone Axe",
|
description = "Stone Axe",
|
||||||
inventory_image = "default_tool_stoneaxe.png",
|
inventory_image = "default_tool_stoneaxe.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 1.2,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
choppy={times={[1]=3.00, [2]=1.00, [3]=0.60}, uses=20, maxlevel=1},
|
choppy={times={[1]=3.00, [2]=1.40, [3]=1.00}, uses=20, maxlevel=1},
|
||||||
fleshy={times={[2]=1.30, [3]=0.70}, uses=20, maxlevel=1}
|
fleshy={times={[2]=0.60, [3]=0.40}, uses=15, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -135,10 +154,11 @@ minetest.register_tool("default:axe_steel", {
|
|||||||
description = "Steel Axe",
|
description = "Steel Axe",
|
||||||
inventory_image = "default_tool_steelaxe.png",
|
inventory_image = "default_tool_steelaxe.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 0.9,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
|
choppy={times={[1]=2.60, [2]=1.00, [3]=0.60}, uses=30, maxlevel=2},
|
||||||
fleshy={times={[2]=1.10, [3]=0.60}, uses=40, maxlevel=1}
|
fleshy={times={[2]=0.40, [3]=0.25}, uses=25, maxlevel=1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -146,12 +166,12 @@ minetest.register_tool("default:sword_wood", {
|
|||||||
description = "Wooden Sword",
|
description = "Wooden Sword",
|
||||||
inventory_image = "default_tool_woodsword.png",
|
inventory_image = "default_tool_woodsword.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 0.9,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
fleshy={times={[2]=1.10, [3]=0.60}, uses=10, maxlevel=1},
|
fleshy={times={[2]=1.10, [3]=0.60}, uses=10, maxlevel=1},
|
||||||
snappy={times={[2]=1.00, [3]=0.50}, uses=10, maxlevel=1},
|
snappy={times={[2]=0.9, [3]=0.45}, uses=10, maxlevel=1},
|
||||||
choppy={times={[3]=1.00}, uses=20, maxlevel=0}
|
choppy={times={[3]=0.90}, uses=20, maxlevel=0}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -159,12 +179,12 @@ minetest.register_tool("default:sword_stone", {
|
|||||||
description = "Stone Sword",
|
description = "Stone Sword",
|
||||||
inventory_image = "default_tool_stonesword.png",
|
inventory_image = "default_tool_stonesword.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.1,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
fleshy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
|
fleshy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
|
||||||
snappy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
|
snappy={times={[2]=0.75, [3]=0.35}, uses=20, maxlevel=1},
|
||||||
choppy={times={[3]=0.90}, uses=20, maxlevel=0}
|
choppy={times={[3]=0.70}, uses=20, maxlevel=0}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -172,12 +192,12 @@ minetest.register_tool("default:sword_steel", {
|
|||||||
description = "Steel Sword",
|
description = "Steel Sword",
|
||||||
inventory_image = "default_tool_steelsword.png",
|
inventory_image = "default_tool_steelsword.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 0.8,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
|
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
|
||||||
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
|
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
|
||||||
choppy={times={[3]=0.70}, uses=40, maxlevel=0}
|
choppy={times={[3]=0.65}, uses=40, maxlevel=0}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -196,7 +216,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:stick 4',
|
output = 'default:stick 4',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood'},
|
{'group:wood'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -211,8 +231,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:sign_wall',
|
output = 'default:sign_wall',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'', 'default:stick', ''},
|
{'', 'default:stick', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -228,7 +248,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:pick_wood',
|
output = 'default:pick_wood',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'', 'default:stick', ''},
|
{'', 'default:stick', ''},
|
||||||
{'', 'default:stick', ''},
|
{'', 'default:stick', ''},
|
||||||
}
|
}
|
||||||
@ -237,7 +257,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:pick_stone',
|
output = 'default:pick_stone',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
{'group:stone', 'group:stone', 'group:stone'},
|
||||||
{'', 'default:stick', ''},
|
{'', 'default:stick', ''},
|
||||||
{'', 'default:stick', ''},
|
{'', 'default:stick', ''},
|
||||||
}
|
}
|
||||||
@ -255,7 +275,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:pick_mese',
|
output = 'default:pick_mese',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:mese', 'default:mese', 'default:mese'},
|
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
|
||||||
{'', 'default:stick', ''},
|
{'', 'default:stick', ''},
|
||||||
{'', 'default:stick', ''},
|
{'', 'default:stick', ''},
|
||||||
}
|
}
|
||||||
@ -264,7 +284,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:shovel_wood',
|
output = 'default:shovel_wood',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood'},
|
{'group:wood'},
|
||||||
{'default:stick'},
|
{'default:stick'},
|
||||||
{'default:stick'},
|
{'default:stick'},
|
||||||
}
|
}
|
||||||
@ -273,7 +293,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:shovel_stone',
|
output = 'default:shovel_stone',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:cobble'},
|
{'group:stone'},
|
||||||
{'default:stick'},
|
{'default:stick'},
|
||||||
{'default:stick'},
|
{'default:stick'},
|
||||||
}
|
}
|
||||||
@ -291,8 +311,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:axe_wood',
|
output = 'default:axe_wood',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood'},
|
||||||
{'default:wood', 'default:stick'},
|
{'group:wood', 'default:stick'},
|
||||||
{'', 'default:stick'},
|
{'', 'default:stick'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -300,8 +320,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:axe_stone',
|
output = 'default:axe_stone',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:cobble', 'default:cobble'},
|
{'group:stone', 'group:stone'},
|
||||||
{'default:cobble', 'default:stick'},
|
{'group:stone', 'default:stick'},
|
||||||
{'', 'default:stick'},
|
{'', 'default:stick'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -318,8 +338,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:sword_wood',
|
output = 'default:sword_wood',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood'},
|
{'group:wood'},
|
||||||
{'default:wood'},
|
{'group:wood'},
|
||||||
{'default:stick'},
|
{'default:stick'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -327,8 +347,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:sword_stone',
|
output = 'default:sword_stone',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:cobble'},
|
{'group:stone'},
|
||||||
{'default:cobble'},
|
{'group:stone'},
|
||||||
{'default:stick'},
|
{'default:stick'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -354,27 +374,27 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:chest',
|
output = 'default:chest',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'default:wood', '', 'default:wood'},
|
{'group:wood', '', 'group:wood'},
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:chest_locked',
|
output = 'default:chest_locked',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'default:wood', 'default:steel_ingot', 'default:wood'},
|
{'group:wood', 'default:steel_ingot', 'group:wood'},
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:furnace',
|
output = 'default:furnace',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
{'group:stone', 'group:stone', 'group:stone'},
|
||||||
{'default:cobble', '', 'default:cobble'},
|
{'group:stone', '', 'group:stone'},
|
||||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
{'group:stone', 'group:stone', 'group:stone'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -387,11 +407,25 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:steel_ingot 9',
|
||||||
|
recipe = {
|
||||||
|
{'default:steelblock'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:sandstone',
|
output = 'default:sandstone',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:sand', 'default:sand'},
|
{'group:sand', 'group:sand'},
|
||||||
{'default:sand', 'default:sand'},
|
{'group:sand', 'group:sand'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:sand 4',
|
||||||
|
recipe = {
|
||||||
|
{'default:sandstone'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -411,6 +445,13 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:clay_brick 4',
|
||||||
|
recipe = {
|
||||||
|
{'default:brick'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:paper',
|
output = 'default:paper',
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -430,9 +471,9 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:bookshelf',
|
output = 'default:bookshelf',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'default:book', 'default:book', 'default:book'},
|
{'default:book', 'default:book', 'default:book'},
|
||||||
{'default:wood', 'default:wood', 'default:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -445,6 +486,29 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:mese',
|
||||||
|
recipe = {
|
||||||
|
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
|
||||||
|
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
|
||||||
|
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:mese_crystal 9',
|
||||||
|
recipe = {
|
||||||
|
{'default:mese'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:mese_crystal_fragment 9',
|
||||||
|
recipe = {
|
||||||
|
{'default:mese_crystal'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Crafting (tool repair)
|
-- Crafting (tool repair)
|
||||||
--
|
--
|
||||||
@ -460,13 +524,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = "default:glass",
|
output = "default:glass",
|
||||||
recipe = "default:sand",
|
recipe = "group:sand",
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "cooking",
|
|
||||||
output = "default:glass",
|
|
||||||
recipe = "default:desert_sand",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -493,13 +551,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "fuel",
|
type = "fuel",
|
||||||
recipe = "default:tree",
|
recipe = "group:tree",
|
||||||
burntime = 30,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "default:jungletree",
|
|
||||||
burntime = 30,
|
burntime = 30,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -547,16 +599,10 @@ minetest.register_craft({
|
|||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "fuel",
|
type = "fuel",
|
||||||
recipe = "default:wood",
|
recipe = "group:wood",
|
||||||
burntime = 7,
|
burntime = 7,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "default:mese",
|
|
||||||
burntime = 30,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "fuel",
|
type = "fuel",
|
||||||
recipe = "default:lava_source",
|
recipe = "default:lava_source",
|
||||||
@ -685,7 +731,7 @@ end
|
|||||||
function default.node_sound_glass_defaults(table)
|
function default.node_sound_glass_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="default_stone_footstep", gain=0.25}
|
{name="default_hard_footstep", gain=0.25}
|
||||||
table.dug = table.dug or
|
table.dug = table.dug or
|
||||||
{name="default_break_glass", gain=1.0}
|
{name="default_break_glass", gain=1.0}
|
||||||
default.node_sound_defaults(table)
|
default.node_sound_defaults(table)
|
||||||
@ -698,7 +744,7 @@ minetest.register_node("default:stone", {
|
|||||||
description = "Stone",
|
description = "Stone",
|
||||||
tiles = {"default_stone.png"},
|
tiles = {"default_stone.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3},
|
groups = {cracky=3, stone=1},
|
||||||
drop = 'default:cobble',
|
drop = 'default:cobble',
|
||||||
legacy_mineral = true,
|
legacy_mineral = true,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
@ -708,7 +754,7 @@ minetest.register_node("default:desert_stone", {
|
|||||||
description = "Desert Stone",
|
description = "Desert Stone",
|
||||||
tiles = {"default_desert_stone.png"},
|
tiles = {"default_desert_stone.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3},
|
groups = {cracky=3, stone=1},
|
||||||
drop = 'default:desert_stone',
|
drop = 'default:desert_stone',
|
||||||
legacy_mineral = true,
|
legacy_mineral = true,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
@ -732,6 +778,15 @@ minetest.register_node("default:stone_with_iron", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_node("default:stone_with_mese", {
|
||||||
|
description = "Mese Crystals in Stone",
|
||||||
|
tiles = {"default_stone.png^default_mineral_mese.png"},
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = {cracky=1},
|
||||||
|
drop = "default:mese_crystal",
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_node("default:dirt_with_grass", {
|
minetest.register_node("default:dirt_with_grass", {
|
||||||
description = "Dirt with Grass",
|
description = "Dirt with Grass",
|
||||||
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
|
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
|
||||||
@ -766,7 +821,7 @@ minetest.register_node("default:sand", {
|
|||||||
description = "Sand",
|
description = "Sand",
|
||||||
tiles = {"default_sand.png"},
|
tiles = {"default_sand.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {crumbly=3, falling_node=1},
|
groups = {crumbly=3, falling_node=1, sand=1},
|
||||||
sounds = default.node_sound_sand_defaults(),
|
sounds = default.node_sound_sand_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -774,7 +829,7 @@ minetest.register_node("default:desert_sand", {
|
|||||||
description = "Desert Sand",
|
description = "Desert Sand",
|
||||||
tiles = {"default_desert_sand.png"},
|
tiles = {"default_desert_sand.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {sand=1, crumbly=3, falling_node=1},
|
groups = {crumbly=3, falling_node=1, sand=1},
|
||||||
sounds = default.node_sound_sand_defaults(),
|
sounds = default.node_sound_sand_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -793,7 +848,6 @@ minetest.register_node("default:sandstone", {
|
|||||||
tiles = {"default_sandstone.png"},
|
tiles = {"default_sandstone.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {crumbly=2,cracky=2},
|
groups = {crumbly=2,cracky=2},
|
||||||
drop = 'default:sand',
|
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -813,7 +867,6 @@ minetest.register_node("default:brick", {
|
|||||||
tiles = {"default_brick.png"},
|
tiles = {"default_brick.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3},
|
groups = {cracky=3},
|
||||||
drop = 'default:clay_brick 4',
|
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -842,7 +895,7 @@ minetest.register_node("default:junglegrass", {
|
|||||||
wield_image = "default_junglegrass.png",
|
wield_image = "default_junglegrass.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {snappy=3,flammable=2},
|
groups = {snappy=3,flammable=2,attached_node=1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -888,6 +941,10 @@ minetest.register_node("default:papyrus", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||||
|
},
|
||||||
groups = {snappy=3,flammable=2},
|
groups = {snappy=3,flammable=2},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
@ -942,7 +999,7 @@ minetest.register_node("default:rail", {
|
|||||||
-- but how to specify the dimensions for curved and sideways rails?
|
-- but how to specify the dimensions for curved and sideways rails?
|
||||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||||
},
|
},
|
||||||
groups = {bendy=2,snappy=1,dig_immediate=2},
|
groups = {bendy=2,snappy=1,dig_immediate=2,attached_node=1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:ladder", {
|
minetest.register_node("default:ladder", {
|
||||||
@ -971,18 +1028,10 @@ minetest.register_node("default:wood", {
|
|||||||
description = "Wooden Planks",
|
description = "Wooden Planks",
|
||||||
tiles = {"default_wood.png"},
|
tiles = {"default_wood.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:mese", {
|
|
||||||
description = "Mese",
|
|
||||||
tiles = {"default_mese.png"},
|
|
||||||
is_ground_content = true,
|
|
||||||
groups = {cracky=1},
|
|
||||||
sounds = default.node_sound_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("default:cloud", {
|
minetest.register_node("default:cloud", {
|
||||||
description = "Cloud",
|
description = "Cloud",
|
||||||
tiles = {"default_cloud.png"},
|
tiles = {"default_cloud.png"},
|
||||||
@ -997,8 +1046,16 @@ minetest.register_node("default:water_flowing", {
|
|||||||
drawtype = "flowingliquid",
|
drawtype = "flowingliquid",
|
||||||
tiles = {"default_water.png"},
|
tiles = {"default_water.png"},
|
||||||
special_tiles = {
|
special_tiles = {
|
||||||
{name="default_water.png", backface_culling=false},
|
{
|
||||||
{name="default_water.png", backface_culling=true},
|
image="default_water_flowing_animated.png",
|
||||||
|
backface_culling=false,
|
||||||
|
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image="default_water_flowing_animated.png",
|
||||||
|
backface_culling=true,
|
||||||
|
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
alpha = WATER_ALPHA,
|
alpha = WATER_ALPHA,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
@ -1006,6 +1063,7 @@ minetest.register_node("default:water_flowing", {
|
|||||||
pointable = false,
|
pointable = false,
|
||||||
diggable = false,
|
diggable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
|
drop = "",
|
||||||
liquidtype = "flowing",
|
liquidtype = "flowing",
|
||||||
liquid_alternative_flowing = "default:water_flowing",
|
liquid_alternative_flowing = "default:water_flowing",
|
||||||
liquid_alternative_source = "default:water_source",
|
liquid_alternative_source = "default:water_source",
|
||||||
@ -1018,7 +1076,9 @@ minetest.register_node("default:water_source", {
|
|||||||
description = "Water Source",
|
description = "Water Source",
|
||||||
inventory_image = minetest.inventorycube("default_water.png"),
|
inventory_image = minetest.inventorycube("default_water.png"),
|
||||||
drawtype = "liquid",
|
drawtype = "liquid",
|
||||||
tiles = {"default_water.png"},
|
tiles = {
|
||||||
|
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
|
||||||
|
},
|
||||||
special_tiles = {
|
special_tiles = {
|
||||||
-- New-style water source material (mostly unused)
|
-- New-style water source material (mostly unused)
|
||||||
{name="default_water.png", backface_culling=false},
|
{name="default_water.png", backface_culling=false},
|
||||||
@ -1029,6 +1089,7 @@ minetest.register_node("default:water_source", {
|
|||||||
pointable = false,
|
pointable = false,
|
||||||
diggable = false,
|
diggable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
|
drop = "",
|
||||||
liquidtype = "source",
|
liquidtype = "source",
|
||||||
liquid_alternative_flowing = "default:water_flowing",
|
liquid_alternative_flowing = "default:water_flowing",
|
||||||
liquid_alternative_source = "default:water_source",
|
liquid_alternative_source = "default:water_source",
|
||||||
@ -1060,6 +1121,7 @@ minetest.register_node("default:lava_flowing", {
|
|||||||
pointable = false,
|
pointable = false,
|
||||||
diggable = false,
|
diggable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
|
drop = "",
|
||||||
liquidtype = "flowing",
|
liquidtype = "flowing",
|
||||||
liquid_alternative_flowing = "default:lava_flowing",
|
liquid_alternative_flowing = "default:lava_flowing",
|
||||||
liquid_alternative_source = "default:lava_source",
|
liquid_alternative_source = "default:lava_source",
|
||||||
@ -1086,6 +1148,7 @@ minetest.register_node("default:lava_source", {
|
|||||||
pointable = false,
|
pointable = false,
|
||||||
diggable = false,
|
diggable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
|
drop = "",
|
||||||
liquidtype = "source",
|
liquidtype = "source",
|
||||||
liquid_alternative_flowing = "default:lava_flowing",
|
liquid_alternative_flowing = "default:lava_flowing",
|
||||||
liquid_alternative_source = "default:lava_source",
|
liquid_alternative_source = "default:lava_source",
|
||||||
@ -1117,7 +1180,7 @@ minetest.register_node("default:torch", {
|
|||||||
wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
||||||
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
|
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
|
||||||
},
|
},
|
||||||
groups = {choppy=2,dig_immediate=3,flammable=1},
|
groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1},
|
||||||
legacy_wallmounted = true,
|
legacy_wallmounted = true,
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
})
|
})
|
||||||
@ -1138,13 +1201,13 @@ minetest.register_node("default:sign_wall", {
|
|||||||
--wall_bottom = <default>
|
--wall_bottom = <default>
|
||||||
--wall_side = <default>
|
--wall_side = <default>
|
||||||
},
|
},
|
||||||
groups = {choppy=2,dig_immediate=2},
|
groups = {choppy=2,dig_immediate=2,attached_node=1},
|
||||||
legacy_wallmounted = true,
|
legacy_wallmounted = true,
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
--local n = minetest.env:get_node(pos)
|
--local n = minetest.env:get_node(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec", "hack:sign_text_input")
|
meta:set_string("formspec", "field[text;;${text}]")
|
||||||
meta:set_string("infotext", "\"\"")
|
meta:set_string("infotext", "\"\"")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
@ -1218,10 +1281,6 @@ minetest.register_node("default:chest_locked", {
|
|||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec",
|
|
||||||
"size[8,9]"..
|
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
|
||||||
"list[current_player;main;0,5;8,4;]")
|
|
||||||
meta:set_string("infotext", "Locked Chest")
|
meta:set_string("infotext", "Locked Chest")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
@ -1277,6 +1336,16 @@ minetest.register_node("default:chest_locked", {
|
|||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
|
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
|
||||||
end,
|
end,
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
if has_locked_chest_privilege(meta, clicker) then
|
||||||
|
local pos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||||
|
minetest.show_formspec(clicker:get_player_name(), "default:chest_locked",
|
||||||
|
"size[8,9]"..
|
||||||
|
"list[nodemeta:".. pos .. ";main;0,0;8,4;]"..
|
||||||
|
"list[current_player;main;0,5;8,4;]")
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
default.furnace_inactive_formspec =
|
default.furnace_inactive_formspec =
|
||||||
@ -1470,7 +1539,7 @@ minetest.register_node("default:cobble", {
|
|||||||
description = "Cobblestone",
|
description = "Cobblestone",
|
||||||
tiles = {"default_cobble.png"},
|
tiles = {"default_cobble.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3},
|
groups = {cracky=3, stone=2},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1490,11 +1559,19 @@ minetest.register_node("default:steelblock", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_node("default:mese", {
|
||||||
|
description = "Mese Block",
|
||||||
|
tiles = {"default_mese_block.png"},
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = {cracky=1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
minetest.register_alias("default:mese_block", "default:mese")
|
||||||
|
|
||||||
minetest.register_node("default:nyancat", {
|
minetest.register_node("default:nyancat", {
|
||||||
description = "Nyan Cat",
|
description = "Nyan Cat",
|
||||||
tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png",
|
tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png",
|
||||||
"default_nc_side.png", "default_nc_back.png", "default_nc_front.png"},
|
"default_nc_side.png", "default_nc_back.png", "default_nc_front.png"},
|
||||||
inventory_image = "default_nc_front.png",
|
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {cracky=2},
|
groups = {cracky=2},
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
@ -1504,7 +1581,6 @@ minetest.register_node("default:nyancat", {
|
|||||||
minetest.register_node("default:nyancat_rainbow", {
|
minetest.register_node("default:nyancat_rainbow", {
|
||||||
description = "Nyan Cat Rainbow",
|
description = "Nyan Cat Rainbow",
|
||||||
tiles = {"default_nc_rb.png"},
|
tiles = {"default_nc_rb.png"},
|
||||||
inventory_image = "default_nc_rb.png",
|
|
||||||
groups = {cracky=2},
|
groups = {cracky=2},
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
})
|
})
|
||||||
@ -1518,7 +1594,11 @@ minetest.register_node("default:sapling", {
|
|||||||
wield_image = "default_sapling.png",
|
wield_image = "default_sapling.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {snappy=2,dig_immediate=3,flammable=2},
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
||||||
|
},
|
||||||
|
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1531,6 +1611,10 @@ minetest.register_node("default:apple", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
|
||||||
|
},
|
||||||
groups = {fleshy=3,dig_immediate=3,flammable=2},
|
groups = {fleshy=3,dig_immediate=3,flammable=2},
|
||||||
on_use = minetest.item_eat(4),
|
on_use = minetest.item_eat(4),
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
@ -1545,7 +1629,7 @@ minetest.register_node("default:dry_shrub", {
|
|||||||
wield_image = "default_dry_shrub.png",
|
wield_image = "default_dry_shrub.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {snappy=3,flammable=3},
|
groups = {snappy=3,flammable=3,attached_node=1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1582,6 +1666,11 @@ minetest.register_craftitem("default:iron_lump", {
|
|||||||
inventory_image = "default_iron_lump.png",
|
inventory_image = "default_iron_lump.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("default:mese_crystal", {
|
||||||
|
description = "Mese Crystal",
|
||||||
|
inventory_image = "default_mese_crystal.png",
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:clay_lump", {
|
minetest.register_craftitem("default:clay_lump", {
|
||||||
description = "Clay Lump",
|
description = "Clay Lump",
|
||||||
inventory_image = "default_clay_lump.png",
|
inventory_image = "default_clay_lump.png",
|
||||||
@ -1592,9 +1681,13 @@ minetest.register_craftitem("default:steel_ingot", {
|
|||||||
inventory_image = "default_steel_ingot.png",
|
inventory_image = "default_steel_ingot.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("default:mese_crystal_fragment", {
|
||||||
|
description = "Mese Crystal Fragment",
|
||||||
|
inventory_image = "default_mese_crystal_fragment.png",
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:clay_brick", {
|
minetest.register_craftitem("default:clay_brick", {
|
||||||
description = "Clay Brick",
|
description = "Clay Brick",
|
||||||
inventory_image = "default_steel_ingot.png",
|
|
||||||
inventory_image = "default_clay_brick.png",
|
inventory_image = "default_clay_brick.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1603,95 +1696,9 @@ minetest.register_craftitem("default:scorched_stuff", {
|
|||||||
inventory_image = "default_scorched_stuff.png",
|
inventory_image = "default_scorched_stuff.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
--
|
-- Support old code
|
||||||
-- Falling stuff
|
|
||||||
--
|
|
||||||
|
|
||||||
minetest.register_entity("default:falling_node", {
|
|
||||||
initial_properties = {
|
|
||||||
physical = true,
|
|
||||||
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
|
|
||||||
visual = "wielditem",
|
|
||||||
textures = {},
|
|
||||||
visual_size = {x=0.667, y=0.667},
|
|
||||||
},
|
|
||||||
|
|
||||||
nodename = "",
|
|
||||||
|
|
||||||
set_node = function(self, nodename)
|
|
||||||
self.nodename = nodename
|
|
||||||
local stack = ItemStack(nodename)
|
|
||||||
local itemtable = stack:to_table()
|
|
||||||
local itemname = nil
|
|
||||||
if itemtable then
|
|
||||||
itemname = stack:to_table().name
|
|
||||||
end
|
|
||||||
local item_texture = nil
|
|
||||||
local item_type = ""
|
|
||||||
if minetest.registered_items[itemname] then
|
|
||||||
item_texture = minetest.registered_items[itemname].inventory_image
|
|
||||||
item_type = minetest.registered_items[itemname].type
|
|
||||||
end
|
|
||||||
prop = {
|
|
||||||
is_visible = true,
|
|
||||||
textures = {nodename},
|
|
||||||
}
|
|
||||||
self.object:set_properties(prop)
|
|
||||||
end,
|
|
||||||
|
|
||||||
get_staticdata = function(self)
|
|
||||||
return self.nodename
|
|
||||||
end,
|
|
||||||
|
|
||||||
on_activate = function(self, staticdata)
|
|
||||||
self.nodename = staticdata
|
|
||||||
self.object:set_armor_groups({immortal=1})
|
|
||||||
--self.object:setacceleration({x=0, y=-10, z=0})
|
|
||||||
self:set_node(self.nodename)
|
|
||||||
end,
|
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
|
||||||
-- Set gravity
|
|
||||||
self.object:setacceleration({x=0, y=-10, z=0})
|
|
||||||
-- Turn to actual sand when collides to ground or just move
|
|
||||||
local pos = self.object:getpos()
|
|
||||||
local bcp = {x=pos.x, y=pos.y-0.7, z=pos.z} -- Position of bottom center point
|
|
||||||
local bcn = minetest.env:get_node(bcp)
|
|
||||||
-- Note: walkable is in the node definition, not in item groups
|
|
||||||
if minetest.registered_nodes[bcn.name] and
|
|
||||||
minetest.registered_nodes[bcn.name].walkable then
|
|
||||||
local np = {x=bcp.x, y=bcp.y+1, z=bcp.z}
|
|
||||||
-- Check what's here
|
|
||||||
local n2 = minetest.env:get_node(np)
|
|
||||||
-- If it's not air or liquid, remove node and replace it with
|
|
||||||
-- it's drops
|
|
||||||
if n2.name ~= "air" and (not minetest.registered_nodes[n2.name] or
|
|
||||||
minetest.registered_nodes[n2.name].liquidtype == "none") then
|
|
||||||
local drops = minetest.get_node_drops(n2.name, "")
|
|
||||||
minetest.env:remove_node(np)
|
|
||||||
-- Add dropped items
|
|
||||||
local _, dropped_item
|
|
||||||
for _, dropped_item in ipairs(drops) do
|
|
||||||
minetest.env:add_item(np, dropped_item)
|
|
||||||
end
|
|
||||||
-- Run script hook
|
|
||||||
local _, callback
|
|
||||||
for _, callback in ipairs(minetest.registered_on_dignodes) do
|
|
||||||
callback(np, n2, nil)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- Create node and remove entity
|
|
||||||
minetest.env:add_node(np, {name=self.nodename})
|
|
||||||
self.object:remove()
|
|
||||||
else
|
|
||||||
-- Do nothing
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
function default.spawn_falling_node(p, nodename)
|
function default.spawn_falling_node(p, nodename)
|
||||||
obj = minetest.env:add_entity(p, "default:falling_node")
|
spawn_falling_node(p, nodename)
|
||||||
obj:get_luaentity():set_node(nodename)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Horrible crap to support old code
|
-- Horrible crap to support old code
|
||||||
@ -1705,36 +1712,6 @@ function default.register_falling_node(nodename, texture)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
|
||||||
-- Some common functions
|
|
||||||
--
|
|
||||||
|
|
||||||
function nodeupdate_single(p)
|
|
||||||
n = minetest.env:get_node(p)
|
|
||||||
if minetest.get_node_group(n.name, "falling_node") ~= 0 then
|
|
||||||
p_bottom = {x=p.x, y=p.y-1, z=p.z}
|
|
||||||
n_bottom = minetest.env:get_node(p_bottom)
|
|
||||||
-- Note: walkable is in the node definition, not in item groups
|
|
||||||
if minetest.registered_nodes[n_bottom.name] and
|
|
||||||
not minetest.registered_nodes[n_bottom.name].walkable then
|
|
||||||
minetest.env:remove_node(p)
|
|
||||||
default.spawn_falling_node(p, n.name)
|
|
||||||
nodeupdate(p)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function nodeupdate(p)
|
|
||||||
for x = -1,1 do
|
|
||||||
for y = -1,1 do
|
|
||||||
for z = -1,1 do
|
|
||||||
p2 = {x=p.x+x, y=p.y+y, z=p.z+z}
|
|
||||||
nodeupdate_single(p2)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Global callbacks
|
-- Global callbacks
|
||||||
--
|
--
|
||||||
@ -1747,13 +1724,11 @@ minetest.register_globalstep(on_step)
|
|||||||
|
|
||||||
function on_placenode(p, node)
|
function on_placenode(p, node)
|
||||||
--print("on_placenode")
|
--print("on_placenode")
|
||||||
nodeupdate(p)
|
|
||||||
end
|
end
|
||||||
minetest.register_on_placenode(on_placenode)
|
minetest.register_on_placenode(on_placenode)
|
||||||
|
|
||||||
function on_dignode(p, node)
|
function on_dignode(p, node)
|
||||||
--print("on_dignode")
|
--print("on_dignode")
|
||||||
nodeupdate(p)
|
|
||||||
end
|
end
|
||||||
minetest.register_on_dignode(on_dignode)
|
minetest.register_on_dignode(on_dignode)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ minetest.register_abm({
|
|||||||
local n = minetest.env:get_node(trunkp)
|
local n = minetest.env:get_node(trunkp)
|
||||||
local reg = minetest.registered_nodes[n.name]
|
local reg = minetest.registered_nodes[n.name]
|
||||||
-- Assume ignore is a trunk, to make the thing work at the border of the active area
|
-- Assume ignore is a trunk, to make the thing work at the border of the active area
|
||||||
if n.name == "ignore" or (reg.groups.tree and reg.groups.tree ~= 0) then
|
if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then
|
||||||
--print("cached trunk still exists")
|
--print("cached trunk still exists")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -86,6 +86,7 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
-- Remove node
|
-- Remove node
|
||||||
minetest.env:remove_node(p0)
|
minetest.env:remove_node(p0)
|
||||||
|
nodeupdate(p0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
@ -29,7 +29,7 @@ minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
|
|||||||
-- Ore generation
|
-- Ore generation
|
||||||
--
|
--
|
||||||
|
|
||||||
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
|
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
|
||||||
if maxp.y < height_min or minp.y > height_max then
|
if maxp.y < height_min or minp.y > height_max then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -69,14 +69,26 @@ end
|
|||||||
function default.make_papyrus(pos, size)
|
function default.make_papyrus(pos, size)
|
||||||
for y=0,size-1 do
|
for y=0,size-1 do
|
||||||
local p = {x=pos.x, y=pos.y+y, z=pos.z}
|
local p = {x=pos.x, y=pos.y+y, z=pos.z}
|
||||||
minetest.env:set_node(p, {name="default:papyrus"})
|
local nn = minetest.env:get_node(p).name
|
||||||
|
if minetest.registered_nodes[nn] and
|
||||||
|
minetest.registered_nodes[nn].buildable_to then
|
||||||
|
minetest.env:set_node(p, {name="default:papyrus"})
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function default.make_cactus(pos, size)
|
function default.make_cactus(pos, size)
|
||||||
for y=0,size-1 do
|
for y=0,size-1 do
|
||||||
local p = {x=pos.x, y=pos.y+y, z=pos.z}
|
local p = {x=pos.x, y=pos.y+y, z=pos.z}
|
||||||
minetest.env:set_node(p, {name="default:cactus"})
|
local nn = minetest.env:get_node(p).name
|
||||||
|
if minetest.registered_nodes[nn] and
|
||||||
|
minetest.registered_nodes[nn].buildable_to then
|
||||||
|
minetest.env:set_node(p, {name="default:cactus"})
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -130,15 +142,17 @@ end
|
|||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, seed)
|
minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
-- Generate regular ores
|
-- Generate regular ores
|
||||||
generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8, 3, 8, -31000, 64)
|
default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8, 3, 8, -31000, 64)
|
||||||
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3, -15, 2)
|
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3, -15, 2)
|
||||||
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9, 3, 5, -63, -16)
|
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9, 3, 5, -63, -16)
|
||||||
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7, 3, 5, -31000, -64)
|
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7, 3, 5, -31000, -64)
|
||||||
generate_ore("default:mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3, -127, -64)
|
|
||||||
generate_ore("default:mese", "default:stone", minp, maxp, seed+5, 1/9/9/9, 3, 5, -31000,-128)
|
|
||||||
|
|
||||||
generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000, 0)
|
default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3, -127, -64)
|
||||||
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64)
|
default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+5, 1/9/9/9, 3, 5, -31000, -128)
|
||||||
|
default.generate_ore("default:mese", "default:stone", minp, maxp, seed+8, 1/16/16/16, 2, 3, -31000,-1024)
|
||||||
|
|
||||||
|
default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000, 0)
|
||||||
|
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64)
|
||||||
|
|
||||||
if maxp.y >= 2 and minp.y <= 0 then
|
if maxp.y >= 2 and minp.y <= 0 then
|
||||||
-- Generate clay
|
-- Generate clay
|
||||||
@ -234,7 +248,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Generate dry shrubs
|
-- Generate grass
|
||||||
local perlin1 = minetest.env:get_perlin(329, 3, 0.6, 100)
|
local perlin1 = minetest.env:get_perlin(329, 3, 0.6, 100)
|
||||||
-- Assume X and Z lengths are equal
|
-- Assume X and Z lengths are equal
|
||||||
local divlen = 16
|
local divlen = 16
|
||||||
@ -245,11 +259,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local z0 = minp.z + math.floor((divz+0)*divlen)
|
local z0 = minp.z + math.floor((divz+0)*divlen)
|
||||||
local x1 = minp.x + math.floor((divx+1)*divlen)
|
local x1 = minp.x + math.floor((divx+1)*divlen)
|
||||||
local z1 = minp.z + math.floor((divz+1)*divlen)
|
local z1 = minp.z + math.floor((divz+1)*divlen)
|
||||||
-- Determine cactus amount from perlin noise
|
-- Determine grass amount from perlin noise
|
||||||
local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
|
local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
|
||||||
-- Find random positions for cactus based on this random
|
-- Find random positions for grass based on this random
|
||||||
local pr = PseudoRandom(seed+1)
|
local pr = PseudoRandom(seed+1)
|
||||||
for i=0,cactus_amount do
|
for i=0,grass_amount do
|
||||||
local x = pr:next(x0, x1)
|
local x = pr:next(x0, x1)
|
||||||
local z = pr:next(z0, z1)
|
local z = pr:next(z0, z1)
|
||||||
-- Find ground level (0...15)
|
-- Find ground level (0...15)
|
||||||
@ -260,10 +274,25 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- If desert sand, make cactus
|
|
||||||
if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then
|
if ground_y then
|
||||||
minetest.env:set_node({x=x,y=ground_y+1,z=z}, {name="default:dry_shrub"})
|
local p = {x=x,y=ground_y+1,z=z}
|
||||||
|
local nn = minetest.env:get_node(p).name
|
||||||
|
-- Check if the node can be replaced
|
||||||
|
if minetest.registered_nodes[nn] and
|
||||||
|
minetest.registered_nodes[nn].buildable_to then
|
||||||
|
nn = minetest.env:get_node({x=x,y=ground_y,z=z}).name
|
||||||
|
-- If desert sand, make dry shrub
|
||||||
|
if nn == "default:desert_sand" then
|
||||||
|
minetest.env:set_node(p,{name="default:dry_shrub"})
|
||||||
|
|
||||||
|
-- If grass, make junglegrass
|
||||||
|
elseif nn == "default:dirt_with_grass" then
|
||||||
|
minetest.env:set_node(p,{name="default:junglegrass"})
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
BIN
mods/default/models/character.blend
Normal file
BIN
mods/default/models/character.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
6557
mods/default/models/character.x
Normal file
132
mods/default/player.lua
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
-- Minetest 0.4 mod: player
|
||||||
|
-- See README.txt for licensing and other information.
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Start of configuration area:
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Player animation speed
|
||||||
|
animation_speed = 30
|
||||||
|
|
||||||
|
-- Player animation blending
|
||||||
|
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
|
||||||
|
animation_blend = 0
|
||||||
|
|
||||||
|
-- Default player appearance
|
||||||
|
default_model = "character.x"
|
||||||
|
default_textures = {"character.png", }
|
||||||
|
|
||||||
|
-- Frame ranges for each player model
|
||||||
|
function player_get_animations(model)
|
||||||
|
if model == "character.x" then
|
||||||
|
return {
|
||||||
|
stand_START = 0,
|
||||||
|
stand_END = 79,
|
||||||
|
sit_START = 81,
|
||||||
|
sit_END = 160,
|
||||||
|
lay_START = 162,
|
||||||
|
lay_END = 166,
|
||||||
|
walk_START = 168,
|
||||||
|
walk_END = 187,
|
||||||
|
mine_START = 189,
|
||||||
|
mine_END = 198,
|
||||||
|
walk_mine_START = 200,
|
||||||
|
walk_mine_END = 219
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- End of configuration area.
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Player stats and animations
|
||||||
|
local player_model = {}
|
||||||
|
local player_anim = {}
|
||||||
|
local player_sneak = {}
|
||||||
|
local ANIM_STAND = 1
|
||||||
|
local ANIM_SIT = 2
|
||||||
|
local ANIM_LAY = 3
|
||||||
|
local ANIM_WALK = 4
|
||||||
|
local ANIM_WALK_MINE = 5
|
||||||
|
local ANIM_MINE = 6
|
||||||
|
|
||||||
|
-- Called when a player's appearance needs to be updated
|
||||||
|
function player_update_visuals(pl)
|
||||||
|
local name = pl:get_player_name()
|
||||||
|
|
||||||
|
player_model[name] = default_model
|
||||||
|
player_anim[name] = 0 -- Animation will be set further below immediately
|
||||||
|
player_sneak[name] = false
|
||||||
|
prop = {
|
||||||
|
mesh = default_model,
|
||||||
|
textures = default_textures,
|
||||||
|
visual = "mesh",
|
||||||
|
visual_size = {x=1, y=1},
|
||||||
|
}
|
||||||
|
pl:set_properties(prop)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Update appearance when the player joins
|
||||||
|
minetest.register_on_joinplayer(player_update_visuals)
|
||||||
|
|
||||||
|
-- Check each player and apply animations
|
||||||
|
function player_step(dtime)
|
||||||
|
for _, pl in pairs(minetest.get_connected_players()) do
|
||||||
|
local name = pl:get_player_name()
|
||||||
|
local anim = player_get_animations(player_model[name])
|
||||||
|
local controls = pl:get_player_control()
|
||||||
|
local walking = false
|
||||||
|
local animation_speed_mod = animation_speed
|
||||||
|
|
||||||
|
-- Determine if the player is walking
|
||||||
|
if controls.up or controls.down or controls.left or controls.right then
|
||||||
|
walking = true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Determine if the player is sneaking, and reduce animation speed if so
|
||||||
|
if controls.sneak and pl:get_hp() ~= 0 and (walking or controls.LMB) then
|
||||||
|
animation_speed_mod = animation_speed_mod / 2
|
||||||
|
-- Refresh player animation below if sneak state changed
|
||||||
|
if not player_sneak[name] then
|
||||||
|
player_anim[name] = 0
|
||||||
|
player_sneak[name] = true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- Refresh player animation below if sneak state changed
|
||||||
|
if player_sneak[name] then
|
||||||
|
player_anim[name] = 0
|
||||||
|
player_sneak[name] = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Apply animations based on what the player is doing
|
||||||
|
if pl:get_hp() == 0 then
|
||||||
|
if player_anim[name] ~= ANIM_LAY then
|
||||||
|
pl:set_animation({x=anim.lay_START, y=anim.lay_END}, animation_speed_mod, animation_blend)
|
||||||
|
player_anim[name] = ANIM_LAY
|
||||||
|
end
|
||||||
|
elseif walking and controls.LMB then
|
||||||
|
if player_anim[name] ~= ANIM_WALK_MINE then
|
||||||
|
pl:set_animation({x=anim.walk_mine_START, y=anim.walk_mine_END}, animation_speed_mod, animation_blend)
|
||||||
|
player_anim[name] = ANIM_WALK_MINE
|
||||||
|
end
|
||||||
|
elseif walking then
|
||||||
|
if player_anim[name] ~= ANIM_WALK then
|
||||||
|
pl:set_animation({x=anim.walk_START, y=anim.walk_END}, animation_speed_mod, animation_blend)
|
||||||
|
player_anim[name] = ANIM_WALK
|
||||||
|
end
|
||||||
|
elseif controls.LMB then
|
||||||
|
if player_anim[name] ~= ANIM_MINE then
|
||||||
|
pl:set_animation({x=anim.mine_START, y=anim.mine_END}, animation_speed_mod, animation_blend)
|
||||||
|
player_anim[name] = ANIM_MINE
|
||||||
|
end
|
||||||
|
elseif player_anim[name] ~= ANIM_STAND then
|
||||||
|
pl:set_animation({x=anim.stand_START, y=anim.stand_END}, animation_speed_mod, animation_blend)
|
||||||
|
player_anim[name] = ANIM_STAND
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
minetest.register_globalstep(player_step)
|
||||||
|
|
||||||
|
-- END
|
BIN
mods/default/sounds/default_break_glass.1.ogg
Normal file
BIN
mods/default/sounds/default_break_glass.2.ogg
Normal file
BIN
mods/default/sounds/default_break_glass.3.ogg
Normal file
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 626 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 339 B |
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 888 B After Width: | Height: | Size: 962 B |
Before Width: | Height: | Size: 925 B After Width: | Height: | Size: 567 B |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 237 B |
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 203 B |
BIN
mods/default/textures/default_mese_block.png
Normal file
After Width: | Height: | Size: 482 B |
BIN
mods/default/textures/default_mese_crystal.png
Normal file
After Width: | Height: | Size: 417 B |
BIN
mods/default/textures/default_mese_crystal_fragment.png
Normal file
After Width: | Height: | Size: 212 B |
BIN
mods/default/textures/default_mineral_mese.png
Normal file
After Width: | Height: | Size: 488 B |
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 317 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 664 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 352 B |
BIN
mods/default/textures/default_tool_steelsword.png
Executable file → Normal file
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 317 B |
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 710 B |
BIN
mods/default/textures/default_water_flowing_animated.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
mods/default/textures/default_water_source_animated.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
@ -1,43 +1,23 @@
|
|||||||
Minetest 0.4 mod: doors
|
Minetest 0.4 mod: doors
|
||||||
========================
|
=======================
|
||||||
|
|
||||||
License of source code:
|
License of source code:
|
||||||
-----------------------
|
-----------------------
|
||||||
Original license text:
|
Copyright (C) 2012 PilzAdam
|
||||||
-- (c) 2011 Fernando Zapata
|
|
||||||
-- Code licensed under GNU GPLv3
|
|
||||||
-- Content licensed under CC BY-SA 3.0
|
|
||||||
-- 2012-01-08 11:03:57
|
|
||||||
|
|
||||||
There has been unsuccesful attempts to contact the original author. Thus,
|
This program is free software. It comes without any warranty, to
|
||||||
based on the intentions of the author, it is assumed that this code is
|
the extent permitted by applicable law. You can redistribute it
|
||||||
distributable and modifiable under LGPLv2+later, under which Minetest is
|
and/or modify it under the terms of the Do What The Fuck You Want
|
||||||
distributed.
|
To Public License, Version 2, as published by Sam Hocevar. See
|
||||||
|
http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||||
Modifications:
|
|
||||||
Copyright (C) 2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2.1 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
http://www.gnu.org/licenses/lgpl-2.1.html
|
|
||||||
|
|
||||||
License of media (textures and sounds)
|
License of media (textures and sounds)
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
Textures created by Fernando Zapata (CC BY-SA 3.0):
|
||||||
http://creativecommons.org/licenses/by-sa/3.0/
|
door_wood.png
|
||||||
|
|
||||||
Authors of media files
|
|
||||||
-----------------------
|
|
||||||
Everything not listed in here:
|
|
||||||
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
||||||
|
|
||||||
From the original zlpdoors mod by Fernando Zapata:
|
|
||||||
door_wood_a.png
|
door_wood_a.png
|
||||||
door_wood_a_r.png
|
door_wood_a_r.png
|
||||||
door_wood_b.png
|
door_wood_b.png
|
||||||
door_wood_b_r.png
|
door_wood_b_r.png
|
||||||
door_wood.png
|
|
||||||
|
All other textures (created by PilzAdam): WTFPL
|
||||||
|
@ -1,205 +1,295 @@
|
|||||||
-- Minetest 0.4 mod: doors
|
doors = {}
|
||||||
-- See README.txt for licensing and other information.
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
local WALLMX = 3
|
-- Registers a door
|
||||||
local WALLMZ = 5
|
-- name: The name of the door
|
||||||
local WALLPX = 2
|
-- def: a table with the folowing fields:
|
||||||
local WALLPZ = 4
|
-- description
|
||||||
|
-- inventory_image
|
||||||
|
-- groups
|
||||||
|
-- tiles_bottom: the tiles of the bottom part of the door {front, side}
|
||||||
|
-- tiles_top: the tiles of the bottom part of the door {front, side}
|
||||||
|
-- If the following fields are not defined the default values are used
|
||||||
|
-- node_box_bottom
|
||||||
|
-- node_box_top
|
||||||
|
-- selection_box_bottom
|
||||||
|
-- selection_box_top
|
||||||
|
-- only_placer_can_open: if true only the player who placed the door can
|
||||||
|
-- open it
|
||||||
|
function doors:register_door(name, def)
|
||||||
|
def.groups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
|
local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}}
|
||||||
|
|
||||||
|
if not def.node_box_bottom then
|
||||||
|
def.node_box_bottom = box
|
||||||
|
end
|
||||||
|
if not def.node_box_top then
|
||||||
|
def.node_box_top = box
|
||||||
|
end
|
||||||
|
if not def.selection_box_bottom then
|
||||||
|
def.selection_box_bottom= box
|
||||||
|
end
|
||||||
|
if not def.selection_box_top then
|
||||||
|
def.selection_box_top = box
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_craftitem(name, {
|
||||||
|
description = def.description,
|
||||||
|
inventory_image = def.inventory_image,
|
||||||
|
|
||||||
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
if not pointed_thing.type == "node" then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local ptu = pointed_thing.under
|
||||||
|
local nu = minetest.env:get_node(ptu)
|
||||||
|
if minetest.registered_nodes[nu.name].on_rightclick then
|
||||||
|
return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack)
|
||||||
|
end
|
||||||
|
|
||||||
|
local pt = pointed_thing.above
|
||||||
|
local pt2 = {x=pt.x, y=pt.y, z=pt.z}
|
||||||
|
pt2.y = pt2.y+1
|
||||||
|
if
|
||||||
|
not minetest.registered_nodes[minetest.env:get_node(pt).name].buildable_to or
|
||||||
|
not minetest.registered_nodes[minetest.env:get_node(pt2).name].buildable_to or
|
||||||
|
not placer or
|
||||||
|
not placer:is_player()
|
||||||
|
then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local p2 = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
|
local pt3 = {x=pt.x, y=pt.y, z=pt.z}
|
||||||
|
if p2 == 0 then
|
||||||
|
pt3.x = pt3.x-1
|
||||||
|
elseif p2 == 1 then
|
||||||
|
pt3.z = pt3.z+1
|
||||||
|
elseif p2 == 2 then
|
||||||
|
pt3.x = pt3.x+1
|
||||||
|
elseif p2 == 3 then
|
||||||
|
pt3.z = pt3.z-1
|
||||||
|
end
|
||||||
|
if not string.find(minetest.env:get_node(pt3).name, name.."_b_") then
|
||||||
|
minetest.env:set_node(pt, {name=name.."_b_1", param2=p2})
|
||||||
|
minetest.env:set_node(pt2, {name=name.."_t_1", param2=p2})
|
||||||
|
else
|
||||||
|
minetest.env:set_node(pt, {name=name.."_b_2", param2=p2})
|
||||||
|
minetest.env:set_node(pt2, {name=name.."_t_2", param2=p2})
|
||||||
|
end
|
||||||
|
|
||||||
|
if def.only_placer_can_open then
|
||||||
|
local pn = placer:get_player_name()
|
||||||
|
local meta = minetest.env:get_meta(pt)
|
||||||
|
meta:set_string("doors_owner", pn)
|
||||||
|
meta:set_string("infotext", "Owned by "..pn)
|
||||||
|
meta = minetest.env:get_meta(pt2)
|
||||||
|
meta:set_string("doors_owner", pn)
|
||||||
|
meta:set_string("infotext", "Owned by "..pn)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local tt = def.tiles_top
|
||||||
|
local tb = def.tiles_bottom
|
||||||
|
|
||||||
|
local function after_dig_node(pos, name)
|
||||||
|
if minetest.env:get_node(pos).name == name then
|
||||||
|
minetest.env:remove_node(pos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
|
||||||
|
pos.y = pos.y+dir
|
||||||
|
if not minetest.env:get_node(pos).name == check_name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local p2 = minetest.env:get_node(pos).param2
|
||||||
|
p2 = params[p2+1]
|
||||||
|
|
||||||
|
local meta = minetest.env:get_meta(pos):to_table()
|
||||||
|
minetest.env:set_node(pos, {name=replace_dir, param2=p2})
|
||||||
|
minetest.env:get_meta(pos):from_table(meta)
|
||||||
|
|
||||||
|
pos.y = pos.y-dir
|
||||||
|
meta = minetest.env:get_meta(pos):to_table()
|
||||||
|
minetest.env:set_node(pos, {name=replace, param2=p2})
|
||||||
|
minetest.env:get_meta(pos):from_table(meta)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function check_player_priv(pos, player)
|
||||||
|
if not def.only_placer_can_open then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
local pn = player:get_player_name()
|
||||||
|
return meta:get_string("doors_owner") == pn
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node(name.."_b_1", {
|
||||||
|
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = name,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.node_box_bottom
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.selection_box_bottom
|
||||||
|
},
|
||||||
|
groups = def.groups,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
pos.y = pos.y+1
|
||||||
|
after_dig_node(pos, name.."_t_1")
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
|
if check_player_priv(pos, clicker) then
|
||||||
|
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
can_dig = check_player_priv,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(name.."_t_1", {
|
||||||
|
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = name,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.node_box_top
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.selection_box_top
|
||||||
|
},
|
||||||
|
groups = def.groups,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
pos.y = pos.y-1
|
||||||
|
after_dig_node(pos, name.."_b_1")
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
|
if check_player_priv(pos, clicker) then
|
||||||
|
on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
can_dig = check_player_priv,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(name.."_b_2", {
|
||||||
|
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = name,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.node_box_bottom
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.selection_box_bottom
|
||||||
|
},
|
||||||
|
groups = def.groups,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
pos.y = pos.y+1
|
||||||
|
after_dig_node(pos, name.."_t_2")
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
|
if check_player_priv(pos, clicker) then
|
||||||
|
on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
can_dig = check_player_priv,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(name.."_t_2", {
|
||||||
|
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = name,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.node_box_top
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = def.selection_box_top
|
||||||
|
},
|
||||||
|
groups = def.groups,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
pos.y = pos.y-1
|
||||||
|
after_dig_node(pos, name.."_b_2")
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
|
if check_player_priv(pos, clicker) then
|
||||||
|
on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
can_dig = check_player_priv,
|
||||||
|
})
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
doors:register_door("doors:door_wood", {
|
||||||
|
description = "Wooden Door",
|
||||||
minetest.register_alias('door', 'doors:door_wood')
|
inventory_image = "door_wood.png",
|
||||||
minetest.register_alias('door_wood', 'doors:door_wood')
|
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
|
||||||
|
tiles_bottom = {"door_wood_b.png", "door_brown.png"},
|
||||||
minetest.register_node( 'doors:door_wood', {
|
tiles_top = {"door_wood_a.png", "door_brown.png"},
|
||||||
description = 'Wooden Door',
|
|
||||||
drawtype = 'signlike',
|
|
||||||
tiles = { 'door_wood.png' },
|
|
||||||
inventory_image = 'door_wood.png',
|
|
||||||
wield_image = 'door_wood.png',
|
|
||||||
paramtype2 = 'wallmounted',
|
|
||||||
selection_box = { type = 'wallmounted' },
|
|
||||||
groups = { choppy=2, dig_immediate=2 },
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft( {
|
|
||||||
output = 'doors:door_wood',
|
|
||||||
recipe = {
|
|
||||||
{ 'default:wood', 'default:wood' },
|
|
||||||
{ 'default:wood', 'default:wood' },
|
|
||||||
{ 'default:wood', 'default:wood' },
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = 'fuel',
|
output = "doors:door_wood",
|
||||||
recipe = 'doors:door_wood',
|
recipe = {
|
||||||
burntime = 30,
|
{"group:wood", "group:wood"},
|
||||||
|
{"group:wood", "group:wood"},
|
||||||
|
{"group:wood", "group:wood"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node( 'doors:door_wood_a_c', {
|
doors:register_door("doors:door_steel", {
|
||||||
Description = 'Top Closed Door',
|
description = "Steel Door",
|
||||||
drawtype = 'signlike',
|
inventory_image = "door_steel.png",
|
||||||
tiles = { 'door_wood_a.png' },
|
groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1},
|
||||||
inventory_image = 'door_wood_a.png',
|
tiles_bottom = {"door_steel_b.png", "door_grey.png"},
|
||||||
paramtype = 'light',
|
tiles_top = {"door_steel_a.png", "door_grey.png"},
|
||||||
paramtype2 = 'wallmounted',
|
only_placer_can_open = true,
|
||||||
walkable = true,
|
|
||||||
selection_box = { type = "wallmounted", },
|
|
||||||
groups = { choppy=2, dig_immediate=2 },
|
|
||||||
legacy_wallmounted = true,
|
|
||||||
drop = 'doors:door_wood',
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node( 'doors:door_wood_b_c', {
|
minetest.register_craft({
|
||||||
Description = 'Bottom Closed Door',
|
output = "doors:door_steel",
|
||||||
drawtype = 'signlike',
|
recipe = {
|
||||||
tiles = { 'door_wood_b.png' },
|
{"default:steel_ingot", "default:steel_ingot"},
|
||||||
inventory_image = 'door_wood_b.png',
|
{"default:steel_ingot", "default:steel_ingot"},
|
||||||
paramtype = 'light',
|
{"default:steel_ingot", "default:steel_ingot"}
|
||||||
paramtype2 = 'wallmounted',
|
}
|
||||||
walkable = true,
|
|
||||||
selection_box = { type = "wallmounted", },
|
|
||||||
groups = { choppy=2, dig_immediate=2 },
|
|
||||||
legacy_wallmounted = true,
|
|
||||||
drop = 'doors:door_wood',
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node( 'doors:door_wood_a_o', {
|
minetest.register_alias("doors:door_wood_a_c", "doors:door_wood_t_1")
|
||||||
Description = 'Top Open Door',
|
minetest.register_alias("doors:door_wood_a_o", "doors:door_wood_t_1")
|
||||||
drawtype = 'signlike',
|
minetest.register_alias("doors:door_wood_b_c", "doors:door_wood_b_1")
|
||||||
tiles = { 'door_wood_a_r.png' },
|
minetest.register_alias("doors:door_wood_b_o", "doors:door_wood_b_1")
|
||||||
inventory_image = 'door_wood_a_r.png',
|
|
||||||
paramtype = 'light',
|
|
||||||
paramtype2 = 'wallmounted',
|
|
||||||
walkable = false,
|
|
||||||
selection_box = { type = "wallmounted", },
|
|
||||||
groups = { choppy=2, dig_immediate=2 },
|
|
||||||
legacy_wallmounted = true,
|
|
||||||
drop = 'doors:door_wood',
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node( 'doors:door_wood_b_o', {
|
|
||||||
Description = 'Bottom Open Door',
|
|
||||||
drawtype = 'signlike',
|
|
||||||
tiles = { 'door_wood_b_r.png' },
|
|
||||||
inventory_image = 'door_wood_b_r.png',
|
|
||||||
paramtype = 'light',
|
|
||||||
paramtype2 = 'wallmounted',
|
|
||||||
walkable = false,
|
|
||||||
selection_box = { type = "wallmounted", },
|
|
||||||
groups = { choppy=2, dig_immediate=2 },
|
|
||||||
legacy_wallmounted = true,
|
|
||||||
drop = 'doors:door_wood',
|
|
||||||
})
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
local round = function( n )
|
|
||||||
if n >= 0 then
|
|
||||||
return math.floor( n + 0.5 )
|
|
||||||
else
|
|
||||||
return math.ceil( n - 0.5 )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local on_door_placed = function( pos, node, placer )
|
|
||||||
if node.name ~= 'doors:door_wood' then return end
|
|
||||||
|
|
||||||
local upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
|
||||||
local apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
|
||||||
local und = minetest.env:get_node( upos )
|
|
||||||
local abv = minetest.env:get_node( apos )
|
|
||||||
|
|
||||||
local dir = placer:get_look_dir()
|
|
||||||
|
|
||||||
if round( dir.x ) == 1 then
|
|
||||||
newparam = WALLMX
|
|
||||||
elseif round( dir.x ) == -1 then
|
|
||||||
newparam = WALLPX
|
|
||||||
elseif round( dir.z ) == 1 then
|
|
||||||
newparam = WALLMZ
|
|
||||||
elseif round( dir.z ) == -1 then
|
|
||||||
newparam = WALLPZ
|
|
||||||
end
|
|
||||||
|
|
||||||
if und.name == 'air' then
|
|
||||||
minetest.env:add_node( pos, { name = 'doors:door_wood_a_c', param2 = newparam } )
|
|
||||||
minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } )
|
|
||||||
elseif abv.name == 'air' then
|
|
||||||
minetest.env:add_node( pos, { name = 'doors:door_wood_b_c', param2 = newparam } )
|
|
||||||
minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } )
|
|
||||||
else
|
|
||||||
minetest.env:remove_node( pos )
|
|
||||||
placer:get_inventory():add_item( "main", 'doors:door_wood' )
|
|
||||||
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local on_door_punched = function( pos, node, puncher )
|
|
||||||
if string.find( node.name, 'doors:door_wood' ) == nil then return end
|
|
||||||
|
|
||||||
local upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
|
||||||
local apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
|
||||||
|
|
||||||
if string.find( node.name, '_c', -2 ) ~= nil then
|
|
||||||
if node.param2 == WALLPX then
|
|
||||||
newparam = WALLMZ
|
|
||||||
elseif node.param2 == WALLMZ then
|
|
||||||
newparam = WALLMX
|
|
||||||
elseif node.param2 == WALLMX then
|
|
||||||
newparam = WALLPZ
|
|
||||||
elseif node.param2 == WALLPZ then
|
|
||||||
newparam = WALLPX
|
|
||||||
end
|
|
||||||
elseif string.find( node.name, '_o', -2 ) ~= nil then
|
|
||||||
if node.param2 == WALLMZ then
|
|
||||||
newparam = WALLPX
|
|
||||||
elseif node.param2 == WALLMX then
|
|
||||||
newparam = WALLMZ
|
|
||||||
elseif node.param2 == WALLPZ then
|
|
||||||
newparam = WALLMX
|
|
||||||
elseif node.param2 == WALLPX then
|
|
||||||
newparam = WALLPZ
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if ( node.name == 'doors:door_wood_a_c' ) then
|
|
||||||
minetest.env:add_node( pos, { name = 'doors:door_wood_a_o', param2 = newparam } )
|
|
||||||
minetest.env:add_node( upos, { name = 'doors:door_wood_b_o', param2 = newparam } )
|
|
||||||
|
|
||||||
elseif ( node.name == 'doors:door_wood_b_c' ) then
|
|
||||||
minetest.env:add_node( pos, { name = 'doors:door_wood_b_o', param2 = newparam } )
|
|
||||||
minetest.env:add_node( apos, { name = 'doors:door_wood_a_o', param2 = newparam } )
|
|
||||||
|
|
||||||
elseif ( node.name == 'doors:door_wood_a_o' ) then
|
|
||||||
minetest.env:add_node( pos, { name = 'doors:door_wood_a_c', param2 = newparam } )
|
|
||||||
minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } )
|
|
||||||
|
|
||||||
elseif ( node.name == 'doors:door_wood_b_o' ) then
|
|
||||||
minetest.env:add_node( pos, { name = 'doors:door_wood_b_c', param2 = newparam } )
|
|
||||||
minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } )
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local on_door_digged = function( pos, node, digger )
|
|
||||||
local upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
|
||||||
local apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
|
||||||
|
|
||||||
if ( node.name == 'doors:door_wood_a_c' ) or ( node.name == 'doors:door_wood_a_o' ) then
|
|
||||||
minetest.env:remove_node( upos )
|
|
||||||
elseif ( node.name == 'doors:door_wood_b_c' ) or ( node.name == 'doors:door_wood_b_o' ) then
|
|
||||||
minetest.env:remove_node( apos )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
minetest.register_on_placenode( on_door_placed )
|
|
||||||
minetest.register_on_punchnode( on_door_punched )
|
|
||||||
minetest.register_on_dignode( on_door_digged )
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
BIN
mods/doors/textures/door_brown.png
Normal file
After Width: | Height: | Size: 109 B |
BIN
mods/doors/textures/door_grey.png
Normal file
After Width: | Height: | Size: 109 B |
BIN
mods/doors/textures/door_steel.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
mods/doors/textures/door_steel_a.png
Normal file
After Width: | Height: | Size: 223 B |
BIN
mods/doors/textures/door_steel_b.png
Normal file
After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 216 B |
@ -28,3 +28,5 @@ fire_small.ogg sampled from:
|
|||||||
fire_large.ogg sampled from:
|
fire_large.ogg sampled from:
|
||||||
http://www.freesound.org/people/Dynamicell/sounds/17548/
|
http://www.freesound.org/people/Dynamicell/sounds/17548/
|
||||||
|
|
||||||
|
fire_basic_flame_animated.png:
|
||||||
|
Muadtralk
|
||||||
|
@ -2,15 +2,29 @@
|
|||||||
|
|
||||||
minetest.register_node("fire:basic_flame", {
|
minetest.register_node("fire:basic_flame", {
|
||||||
description = "Fire",
|
description = "Fire",
|
||||||
drawtype = "glasslike",
|
drawtype = "plantlike",
|
||||||
tiles = {"fire_basic_flame.png"},
|
tiles = {{
|
||||||
|
name="fire_basic_flame_animated.png",
|
||||||
|
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
|
||||||
|
}},
|
||||||
|
inventory_image = "fire_basic_flame.png",
|
||||||
light_source = 14,
|
light_source = 14,
|
||||||
groups = {igniter=2,dig_immediate=3},
|
groups = {igniter=2,dig_immediate=3},
|
||||||
drop = '',
|
drop = '',
|
||||||
walkable = false,
|
walkable = false,
|
||||||
|
buildable_to = true,
|
||||||
|
damage_per_second = 4,
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer)
|
||||||
|
fire.on_flame_add_at(pos)
|
||||||
|
end,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
fire.on_flame_remove_at(pos)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local fire = {}
|
fire = {}
|
||||||
fire.D = 6
|
fire.D = 6
|
||||||
-- key: position hash of low corner of area
|
-- key: position hash of low corner of area
|
||||||
-- value: {handle=sound handle, name=sound name}
|
-- value: {handle=sound handle, name=sound name}
|
||||||
@ -88,18 +102,6 @@ function fire.flame_should_extinguish(pos)
|
|||||||
return (#ps ~= 0)
|
return (#ps ~= 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_placenode(function(pos, newnode, placer)
|
|
||||||
if newnode.name == "fire:basic_flame" then
|
|
||||||
fire.on_flame_add_at(pos)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
minetest.register_on_dignode(function(pos, oldnode, digger)
|
|
||||||
if oldnode.name == "fire:basic_flame" then
|
|
||||||
fire.on_flame_remove_at(pos)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Ignite neighboring nodes
|
-- Ignite neighboring nodes
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"group:flammable"},
|
nodenames = {"group:flammable"},
|
||||||
@ -177,6 +179,7 @@ minetest.register_abm({
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.env:remove_node(p)
|
minetest.env:remove_node(p)
|
||||||
|
nodeupdate(p)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- remove flame
|
-- remove flame
|
||||||
|
BIN
mods/fire/textures/fire_basic_flame_animated.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
@ -4,8 +4,8 @@
|
|||||||
stairs = {}
|
stairs = {}
|
||||||
|
|
||||||
-- Node will be called stairs:stair_<subname>
|
-- Node will be called stairs:stair_<subname>
|
||||||
function stairs.register_stair(subname, recipeitem, groups, images, description)
|
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
|
||||||
minetest.register_node("stairs:stair_" .. subname, {
|
minetest.register_node(":stairs:stair_" .. subname, {
|
||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = images,
|
tiles = images,
|
||||||
@ -13,6 +13,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description)
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = groups,
|
groups = groups,
|
||||||
|
sounds = sounds,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -20,6 +21,57 @@ function stairs.register_stair(subname, recipeitem, groups, images, description)
|
|||||||
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||||
|
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
if pointed_thing.type ~= "node" then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local p0 = pointed_thing.under
|
||||||
|
local p1 = pointed_thing.above
|
||||||
|
if p0.y-1 == p1.y then
|
||||||
|
local fakestack = ItemStack("stairs:stair_" .. subname.."upside_down")
|
||||||
|
local ret = minetest.item_place(fakestack, placer, pointed_thing)
|
||||||
|
if ret:is_empty() then
|
||||||
|
itemstack:take_item()
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Otherwise place regularly
|
||||||
|
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":stairs:stair_" .. subname.."upside_down", {
|
||||||
|
drop = "stairs:stair_" .. subname,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = images,
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = groups,
|
||||||
|
sounds = sounds,
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, 0, -0.5, 0.5, 0.5, 0.5},
|
||||||
|
{-0.5, -0.5, 0, 0.5, 0, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, 0, -0.5, 0.5, 0.5, 0.5},
|
||||||
|
{-0.5, -0.5, 0, 0.5, 0, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -43,14 +95,15 @@ function stairs.register_stair(subname, recipeitem, groups, images, description)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Node will be called stairs:slab_<subname>
|
-- Node will be called stairs:slab_<subname>
|
||||||
function stairs.register_slab(subname, recipeitem, groups, images, description)
|
function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
|
||||||
minetest.register_node("stairs:slab_" .. subname, {
|
minetest.register_node(":stairs:slab_" .. subname, {
|
||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = images,
|
tiles = images,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = groups,
|
groups = groups,
|
||||||
|
sounds = sounds,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||||
@ -71,13 +124,10 @@ function stairs.register_slab(subname, recipeitem, groups, images, description)
|
|||||||
local p0 = pointed_thing.under
|
local p0 = pointed_thing.under
|
||||||
local p1 = pointed_thing.above
|
local p1 = pointed_thing.above
|
||||||
local n0 = minetest.env:get_node(p0)
|
local n0 = minetest.env:get_node(p0)
|
||||||
local n1 = minetest.env:get_node(p1)
|
if n0.name == "stairs:slab_" .. subname and
|
||||||
if n0.name == "stairs:slab_" .. subname then
|
p0.y+1 == p1.y then
|
||||||
slabpos = p0
|
slabpos = p0
|
||||||
slabnode = n0
|
slabnode = n0
|
||||||
elseif n1.name == "stairs:slab_" .. subname then
|
|
||||||
slabpos = p1
|
|
||||||
slabnode = n1
|
|
||||||
end
|
end
|
||||||
if slabpos then
|
if slabpos then
|
||||||
-- Remove the slab at slabpos
|
-- Remove the slab at slabpos
|
||||||
@ -96,10 +146,69 @@ function stairs.register_slab(subname, recipeitem, groups, images, description)
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Upside down slabs
|
||||||
|
if p0.y-1 == p1.y then
|
||||||
|
-- Turn into full block if pointing at a existing slab
|
||||||
|
if n0.name == "stairs:slab_" .. subname.."upside_down" then
|
||||||
|
-- Remove the slab at the position of the slab
|
||||||
|
minetest.env:remove_node(p0)
|
||||||
|
-- Make a fake stack of a single item and try to place it
|
||||||
|
local fakestack = ItemStack(recipeitem)
|
||||||
|
pointed_thing.above = p0
|
||||||
|
fakestack = minetest.item_place(fakestack, placer, pointed_thing)
|
||||||
|
-- If the item was taken from the fake stack, decrement original
|
||||||
|
if not fakestack or fakestack:is_empty() then
|
||||||
|
itemstack:take_item(1)
|
||||||
|
-- Else put old node back
|
||||||
|
else
|
||||||
|
minetest.env:set_node(p0, n0)
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Place upside down slab
|
||||||
|
local fakestack = ItemStack("stairs:slab_" .. subname.."upside_down")
|
||||||
|
local ret = minetest.item_place(fakestack, placer, pointed_thing)
|
||||||
|
if ret:is_empty() then
|
||||||
|
itemstack:take_item()
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- If pointing at the side of a upside down slab
|
||||||
|
if n0.name == "stairs:slab_" .. subname.."upside_down" and
|
||||||
|
p0.y+1 ~= p1.y then
|
||||||
|
-- Place upside down slab
|
||||||
|
local fakestack = ItemStack("stairs:slab_" .. subname.."upside_down")
|
||||||
|
local ret = minetest.item_place(fakestack, placer, pointed_thing)
|
||||||
|
if ret:is_empty() then
|
||||||
|
itemstack:take_item()
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Otherwise place regularly
|
-- Otherwise place regularly
|
||||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":stairs:slab_" .. subname.."upside_down", {
|
||||||
|
drop = "stairs:slab_"..subname,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = images,
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = groups,
|
||||||
|
sounds = sounds,
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'stairs:slab_' .. subname .. ' 3',
|
output = 'stairs:slab_' .. subname .. ' 3',
|
||||||
@ -110,37 +219,42 @@ function stairs.register_slab(subname, recipeitem, groups, images, description)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Nodes will be called stairs:{stair,slab}_<subname>
|
-- Nodes will be called stairs:{stair,slab}_<subname>
|
||||||
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
|
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
|
||||||
stairs.register_stair(subname, recipeitem, groups, images, desc_stair)
|
stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
|
||||||
stairs.register_slab(subname, recipeitem, groups, images, desc_slab)
|
stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
|
||||||
end
|
end
|
||||||
|
|
||||||
stairs.register_stair_and_slab("wood", "default:wood",
|
stairs.register_stair_and_slab("wood", "default:wood",
|
||||||
{snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
{snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
{"default_wood.png"},
|
{"default_wood.png"},
|
||||||
"Wooden stair",
|
"Wooden stair",
|
||||||
"Wooden slab")
|
"Wooden slab",
|
||||||
|
default.node_sound_wood_defaults())
|
||||||
|
|
||||||
stairs.register_stair_and_slab("stone", "default:stone",
|
stairs.register_stair_and_slab("stone", "default:stone",
|
||||||
{cracky=3},
|
{cracky=3},
|
||||||
{"default_stone.png"},
|
{"default_stone.png"},
|
||||||
"Stone stair",
|
"Stone stair",
|
||||||
"Stone slab")
|
"Stone slab",
|
||||||
|
default.node_sound_stone_defaults())
|
||||||
|
|
||||||
stairs.register_stair_and_slab("cobble", "default:cobble",
|
stairs.register_stair_and_slab("cobble", "default:cobble",
|
||||||
{cracky=3},
|
{cracky=3},
|
||||||
{"default_cobble.png"},
|
{"default_cobble.png"},
|
||||||
"Cobble stair",
|
"Cobble stair",
|
||||||
"Cobble slab")
|
"Cobble slab",
|
||||||
|
default.node_sound_stone_defaults())
|
||||||
|
|
||||||
stairs.register_stair_and_slab("brick", "default:brick",
|
stairs.register_stair_and_slab("brick", "default:brick",
|
||||||
{cracky=3},
|
{cracky=3},
|
||||||
{"default_brick.png"},
|
{"default_brick.png"},
|
||||||
"Brick stair",
|
"Brick stair",
|
||||||
"Brick slab")
|
"Brick slab",
|
||||||
|
default.node_sound_stone_defaults())
|
||||||
|
|
||||||
stairs.register_stair_and_slab("sandstone", "default:sandstone",
|
stairs.register_stair_and_slab("sandstone", "default:sandstone",
|
||||||
{crumbly=2,cracky=2},
|
{crumbly=2,cracky=2},
|
||||||
{"default_sandstone.png"},
|
{"default_sandstone.png"},
|
||||||
"Sandstone stair",
|
"Sandstone stair",
|
||||||
"Sandstone slab")
|
"Sandstone slab",
|
||||||
|
default.node_sound_stone_defaults())
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
minetest.register_craftitem("vessels:glass_bottle", {
|
minetest.register_craftitem("vessels:glass_bottle", {
|
||||||
description = "Glass Bottle (empty)",
|
description = "Glass Bottle (empty)",
|
||||||
inventory_image = "vessels_glass_bottle.png",
|
inventory_image = "vessels_glass_bottle_inv.png",
|
||||||
|
wield_image = "vessels_glass_bottle.png",
|
||||||
groups = {vessel=1},
|
groups = {vessel=1},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -18,7 +19,8 @@ minetest.register_craft( {
|
|||||||
|
|
||||||
minetest.register_craftitem("vessels:drinking_glass", {
|
minetest.register_craftitem("vessels:drinking_glass", {
|
||||||
description = "Drinking Glass (empty)",
|
description = "Drinking Glass (empty)",
|
||||||
inventory_image = "vessels_drinking_glass.png",
|
inventory_image = "vessels_drinking_glass_inv.png",
|
||||||
|
wield_image = "vessels_drinking_glass.png",
|
||||||
groups = {vessel=1},
|
groups = {vessel=1},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -33,7 +35,8 @@ minetest.register_craft( {
|
|||||||
|
|
||||||
minetest.register_craftitem("vessels:steel_bottle", {
|
minetest.register_craftitem("vessels:steel_bottle", {
|
||||||
description = "Heavy Steel Bottle (empty)",
|
description = "Heavy Steel Bottle (empty)",
|
||||||
inventory_image = "vessels_steel_bottle.png",
|
inventory_image = "vessels_steel_bottle_inv.png",
|
||||||
|
wield_image = "vessels_steel_bottle.png",
|
||||||
groups = {vessel=1},
|
groups = {vessel=1},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 253 B |
BIN
mods/vessels/textures/vessels_drinking_glass_inv.png
Normal file
After Width: | Height: | Size: 338 B |
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 242 B |
BIN
mods/vessels/textures/vessels_glass_bottle_inv.png
Normal file
After Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 345 B |
BIN
mods/vessels/textures/vessels_steel_bottle_inv.png
Normal file
After Width: | Height: | Size: 342 B |
@ -34,7 +34,7 @@ for _, row in ipairs(wool.dyes) do
|
|||||||
minetest.register_node("wool:"..name, {
|
minetest.register_node("wool:"..name, {
|
||||||
description = desc.." Wool",
|
description = desc.." Wool",
|
||||||
tiles = {"wool_"..name..".png"},
|
tiles = {"wool_"..name..".png"},
|
||||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1},
|
||||||
})
|
})
|
||||||
if craft_color_group then
|
if craft_color_group then
|
||||||
-- Crafting from dye and white wool
|
-- Crafting from dye and white wool
|
||||||
|