Compare commits
56 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
@ -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,
|
||||||
|
@ -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
|
||||||
@ -54,8 +50,7 @@ minetest.after(0, function()
|
|||||||
if stack:get_stack_max() == 1 then
|
if stack:get_stack_max() == 1 then
|
||||||
stack2 = ItemStack(stack:get_name())
|
stack2 = ItemStack(stack:get_name())
|
||||||
else
|
else
|
||||||
-- Insert half full so that a taken stack can be put back
|
stack2 = ItemStack(stack:get_name().." "..stack:get_stack_max())
|
||||||
stack2 = ItemStack(stack:get_name().." "..(stack:get_stack_max()/2))
|
|
||||||
end
|
end
|
||||||
inv:add_item("main", stack2)
|
inv:add_item("main", stack2)
|
||||||
end
|
end
|
||||||
@ -63,6 +58,24 @@ minetest.after(0, function()
|
|||||||
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 +87,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
|
||||||
|
@ -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")
|
||||||
|
|
||||||
@ -82,6 +83,7 @@ minetest.register_tool("default:pick_mese", {
|
|||||||
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 = {
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
@ -92,6 +94,7 @@ minetest.register_tool("default:shovel_wood", {
|
|||||||
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 = {
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
@ -102,6 +105,7 @@ minetest.register_tool("default:shovel_stone", {
|
|||||||
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 = {
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
@ -196,7 +200,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 +215,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 +232,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 +241,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', ''},
|
||||||
}
|
}
|
||||||
@ -264,7 +268,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 +277,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 +295,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 +304,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 +322,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 +331,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 +358,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 +391,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 +429,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 +455,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'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -460,13 +485,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 +512,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,7 +560,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "fuel",
|
type = "fuel",
|
||||||
recipe = "default:wood",
|
recipe = "group:wood",
|
||||||
burntime = 7,
|
burntime = 7,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -698,7 +711,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 +721,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(),
|
||||||
@ -766,7 +779,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 +787,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 = {sand=1, crumbly=3, falling_node=1, sand=1},
|
||||||
sounds = default.node_sound_sand_defaults(),
|
sounds = default.node_sound_sand_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -793,7 +806,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 +825,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 +853,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 +899,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 +957,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,7 +986,7 @@ 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(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -997,8 +1012,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",
|
||||||
@ -1018,7 +1041,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},
|
||||||
@ -1117,7 +1142,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 +1163,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)
|
||||||
@ -1470,7 +1495,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(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1494,7 +1519,6 @@ 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 +1528,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 +1541,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 +1558,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 +1576,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",
|
||||||
@ -1603,95 +1634,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 +1650,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 +1662,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
|
||||||
|
@ -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
|
||||||
|
|
||||||
@ -245,11 +257,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 dry shrubs amount from perlin noise
|
||||||
local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
|
local shrub_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
|
||||||
-- Find random positions for cactus based on this random
|
-- Find random positions for dry shrubs based on this random
|
||||||
local pr = PseudoRandom(seed+1)
|
local pr = PseudoRandom(seed+1)
|
||||||
for i=0,cactus_amount do
|
for i=0,shrub_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,9 +272,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- If desert sand, make cactus
|
-- If desert sand, make dry shrub
|
||||||
if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then
|
if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" 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
|
||||||
|
if minetest.registered_nodes[nn] and
|
||||||
|
minetest.registered_nodes[nn].buildable_to then
|
||||||
|
minetest.env:set_node(p, {name="default:dry_shrub"})
|
||||||
|
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: 2.0 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: 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 |
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,286 @@
|
|||||||
-- 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 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
|
||||||
|
|
||||||
|
itemstack:take_item()
|
||||||
|
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_punch(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_punch = function(pos, node, puncher)
|
||||||
|
if check_player_priv(pos, puncher) then
|
||||||
|
on_punch(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_punch = function(pos, node, puncher)
|
||||||
|
if check_player_priv(pos, puncher) then
|
||||||
|
on_punch(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_punch = function(pos, node, puncher)
|
||||||
|
if check_player_priv(pos, puncher) then
|
||||||
|
on_punch(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_punch = function(pos, node, puncher)
|
||||||
|
if check_player_priv(pos, puncher) then
|
||||||
|
on_punch(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,
|
{"default:wood", "default:wood"},
|
||||||
|
{"default:wood", "default:wood"},
|
||||||
|
{"default:wood", "default: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,28 @@
|
|||||||
|
|
||||||
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,
|
||||||
|
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 +101,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"},
|
||||||
|
BIN
mods/fire/textures/fire_basic_flame_animated.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
@ -71,13 +71,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
|
||||||
|
@ -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 |