Compare commits

...

5 Commits

Author SHA1 Message Date
Ekdohibs 9e46321223 Fix .luacheckrc (missing Settings class) 2017-04-11 16:28:26 +02:00
Alex Ford 8d43b984fc Screwdriver: Allow non-native rotations if supported by targeted node
This also allows custom actions (such as using the screwdriver as a wrench).
2017-04-11 03:58:13 +01:00
LNJ fe021281e6 Textures: Replace aspen leaves texture with BlockMen's 2017-04-11 03:57:44 +01:00
paramat 9e4f0d3689 Leafdecay: Do not restart aready running timers 2017-04-11 03:57:07 +01:00
paramat acfd58cdeb Carts: Make rail recipes more generous
As part of making vertical travel easier to reduce reliance on
sneak ladders.
Calculate using cubic pixels of steel.

A steelblock is 16^3 = 4096 cubic pixels steel.
6 ingots is 6/9 steelblocks.
A rail is a 2*2*16 pixel length of steel, 64 cubic pixels steel.
6 ingots produces 2*21 rails = 21 rail nodes.
Choose 18 for an even number that is a multiple of ingot number.

Replace the stick with 2 wood in the recipe to be closer to the amount
of wood that would be needed for 20*4 sleepers.

Replace 2 mese crystal fragments with 1 mese crystal to
compensate for the larger number of nodes returned. The result
is the recipe is much more generous with steel usage but slightly
less generous with mese usage, keeping power rail cost reasonably high.

Replace 2 coal lumps with 1 for a similar recipe to power rails.
2017-04-11 03:57:01 +01:00
6 changed files with 23 additions and 16 deletions

View File

@ -8,6 +8,7 @@ read_globals = {
"vector",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"Settings",
"unpack",
-- Silence "accessing undefined field copy of global table".
table = { fields = { "copy" } }

View File

@ -10,11 +10,11 @@ carts:register_rail("carts:rail", {
}, {})
minetest.register_craft({
output = "carts:rail 16",
output = "carts:rail 18",
recipe = {
{"default:steel_ingot", "group:wood", "default:steel_ingot"},
{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", "group:stick", "default:steel_ingot"},
{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", "group:wood", "default:steel_ingot"},
}
})
@ -31,11 +31,11 @@ carts:register_rail("carts:powerrail", {
}, {acceleration = 5})
minetest.register_craft({
output = "carts:powerrail 8",
output = "carts:powerrail 18",
recipe = {
{"default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot"},
{"default:steel_ingot", "group:stick", "default:steel_ingot"},
{"default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot"},
{"default:steel_ingot", "group:wood", "default:steel_ingot"},
{"default:steel_ingot", "default:mese_crystal", "default:steel_ingot"},
{"default:steel_ingot", "group:wood", "default:steel_ingot"},
}
})
@ -50,10 +50,10 @@ carts:register_rail("carts:brakerail", {
}, {acceleration = -3})
minetest.register_craft({
output = "carts:brakerail 8",
output = "carts:brakerail 18",
recipe = {
{"default:steel_ingot", "group:wood", "default:steel_ingot"},
{"default:steel_ingot", "default:coal_lump", "default:steel_ingot"},
{"default:steel_ingot", "group:stick", "default:steel_ingot"},
{"default:steel_ingot", "default:coal_lump", "default:steel_ingot"},
{"default:steel_ingot", "group:wood", "default:steel_ingot"},
}
})

View File

@ -126,6 +126,7 @@ brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
BlockMen (CC BY-SA 3.0):
default_aspen_leaves.png
default_wood.png
default_clay_brick.png
default_iron_ingot.png
@ -152,7 +153,6 @@ Wuzzy (CC BY-SA 3.0):
sofar (CC BY-SA 3.0):
default_book_written.png, based on default_book.png
default_aspen_sapling
default_aspen_leaves
default_aspen_tree
default_aspen_tree_top, derived from default_pine_tree_top (by paramat)
default_aspen_wood, derived from default_pine_wood (by paramat)

View File

@ -330,8 +330,9 @@ local function leafdecay_after_destruct(pos, oldnode, def)
for _, v in pairs(minetest.find_nodes_in_area(vector.subtract(pos, def.radius),
vector.add(pos, def.radius), def.leaves)) do
local node = minetest.get_node(v)
if node.param2 == 0 then
minetest.get_node_timer(v):start(math.random(20, 120) / 10)
local timer = minetest.get_node_timer(v)
if node.param2 == 0 and not timer:is_started() then
timer:start(math.random(20, 120) / 10)
end
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

After

Width:  |  Height:  |  Size: 873 B

View File

@ -98,12 +98,17 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses)
end
-- can we rotate this paramtype2?
local fn = screwdriver.rotate[ndef.paramtype2]
if not fn then
if not fn and not ndef.on_rotate then
return itemstack
end
local should_rotate = true
local new_param2 = fn(pos, node, mode)
local new_param2
if fn then
new_param2 = fn(pos, node, mode)
else
new_param2 = node.param2
end
-- Node provides a handler, so let the handler decide instead if the node can be rotated
if ndef.on_rotate then
@ -122,7 +127,7 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses)
return itemstack
end
if should_rotate then
if should_rotate and new_param2 ~= node.param2 then
node.param2 = new_param2
minetest.swap_node(pos, node)
minetest.check_for_falling(pos)