mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-11 12:30:25 +01:00
Merge branch 'master' of git://github.com/celeron55/minetest_game
This commit is contained in:
commit
433730d2a0
|
@ -26,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}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -41,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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -51,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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -61,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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -71,12 +77,13 @@ 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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -85,9 +92,11 @@ minetest.register_tool("default:shovel_wood", {
|
||||||
inventory_image = "default_tool_woodshovel.png",
|
inventory_image = "default_tool_woodshovel.png",
|
||||||
wield_image = "default_tool_woodshovel.png^[transformR90",
|
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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -96,9 +105,11 @@ minetest.register_tool("default:shovel_stone", {
|
||||||
inventory_image = "default_tool_stoneshovel.png",
|
inventory_image = "default_tool_stoneshovel.png",
|
||||||
wield_image = "default_tool_stoneshovel.png^[transformR90",
|
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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -107,9 +118,11 @@ minetest.register_tool("default:shovel_steel", {
|
||||||
inventory_image = "default_tool_steelshovel.png",
|
inventory_image = "default_tool_steelshovel.png",
|
||||||
wield_image = "default_tool_steelshovel.png^[transformR90",
|
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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -117,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.40, [3]=0.80}, 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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -128,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.00, [3]=0.60}, 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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -139,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]=3.00, [2]=1.60, [3]=1.00}, 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}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -150,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}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -163,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}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -176,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}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -21,6 +21,43 @@ 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},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
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},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -95,11 +132,70 @@ 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',
|
||||||
recipe = {
|
recipe = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user