2017-02-03 08:22:31 +01:00
|
|
|
-- internationalization boilerplate
|
2020-02-20 05:57:13 +01:00
|
|
|
local S = ropes.S
|
2017-02-03 08:22:31 +01:00
|
|
|
|
2017-02-10 05:29:42 +01:00
|
|
|
local function rope_box_tiles(count, tint)
|
2017-02-09 08:34:17 +01:00
|
|
|
return {
|
2017-02-10 05:29:42 +01:00
|
|
|
string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
|
|
|
|
string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
|
|
|
|
string.format("ropes_ropebox_side.png^[colorize:%s^ropes_ropebox_side.png", tint),
|
|
|
|
string.format("ropes_ropebox_side.png^[colorize:%s^ropes_ropebox_side.png", tint),
|
|
|
|
string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
|
|
|
|
string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
|
2017-02-09 08:34:17 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
local rope_box_data = {
|
|
|
|
{
|
|
|
|
node={
|
|
|
|
{-0.125, -0.125, -0.25, 0.125, 0.125, 0.25}, -- pulley
|
|
|
|
{-0.125, -0.25, -0.125, 0.125, 0.25, 0.125}, -- pulley
|
|
|
|
{-0.125, -0.1875, -0.1875, 0.125, 0.1875, 0.1875}, -- pulley_core
|
|
|
|
{-0.1875, -0.5, -0.125, -0.125, 0.125, 0.125}, -- support
|
|
|
|
{0.125, -0.5, -0.125, 0.1875, 0.125, 0.125}, -- support
|
2016-06-08 03:53:41 +02:00
|
|
|
},
|
2017-02-09 08:34:17 +01:00
|
|
|
--selection = {-0.1875, -0.5, -0.25, 0.1875, 0.25, 0.25}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 1,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
{
|
2017-02-09 08:34:17 +01:00
|
|
|
node={
|
|
|
|
{-0.1875, -0.125, -0.25, 0.1875, 0.125, 0.25}, -- pulley
|
|
|
|
{-0.1875, -0.25, -0.125, 0.1875, 0.25, 0.125}, -- pulley
|
|
|
|
{-0.1875, -0.1875, -0.1875, 0.1875, 0.1875, 0.1875}, -- pulley_core
|
|
|
|
{-0.25, -0.5, -0.125, -0.1875, 0.125, 0.125}, -- support
|
|
|
|
{0.1875, -0.5, -0.125, 0.25, 0.125, 0.125}, -- support
|
|
|
|
},
|
|
|
|
--selection = {-0.1875, -0.5, -0.25, 0.1875, 0.25, 0.25}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 2,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
{
|
2017-02-09 08:34:17 +01:00
|
|
|
node={
|
|
|
|
{-0.25, -0.125, -0.25, 0.25, 0.125, 0.25}, -- pulley
|
|
|
|
{-0.25, -0.25, -0.125, 0.25, 0.25, 0.125}, -- pulley
|
|
|
|
{-0.25, -0.1875, -0.1875, 0.25, 0.1875, 0.1875}, -- pulley_core
|
|
|
|
{-0.3125, -0.5, -0.125, -0.25, 0.125, 0.125}, -- support
|
|
|
|
{0.25, -0.5, -0.125, 0.3125, 0.125, 0.125}, -- support
|
|
|
|
},
|
|
|
|
--selection = {-0.3125, -0.5, -0.25, 0.3125, 0.25, 0.25}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 3,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
{
|
2017-02-09 08:34:17 +01:00
|
|
|
node={
|
|
|
|
{-0.3125, -0.125, -0.25, 0.3125, 0.125, 0.25}, -- pulley
|
|
|
|
{-0.3125, -0.25, -0.125, 0.3125, 0.25, 0.125}, -- pulley
|
|
|
|
{-0.3125, -0.1875, -0.1875, 0.3125, 0.1875, 0.1875}, -- pulley_core
|
|
|
|
{-0.375, -0.5, -0.125, -0.3125, 0.125, 0.125}, -- support
|
|
|
|
{0.3125, -0.5, -0.125, 0.375, 0.125, 0.125}, -- support
|
|
|
|
},
|
|
|
|
--selection = {-0.375, -0.5, -0.25, 0.375, 0.25, 0.25}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 4,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
{
|
2017-02-09 08:34:17 +01:00
|
|
|
node={
|
|
|
|
{-0.375, -0.125, -0.25, 0.375, 0.125, 0.25}, -- pulley
|
|
|
|
{-0.375, -0.25, -0.125, 0.375, 0.25, 0.125}, -- pulley
|
|
|
|
{-0.375, -0.1875, -0.1875, 0.375, 0.1875, 0.1875}, -- pulley_core
|
|
|
|
{-0.4375, -0.5, -0.125, -0.375, 0.125, 0.125}, -- support
|
|
|
|
{0.375, -0.5, -0.125, 0.4375, 0.125, 0.125}, -- support
|
|
|
|
},
|
|
|
|
--selection = {-0.4375, -0.5, -0.25, 0.4375, 0.25, 0.25}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 5,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
node={
|
|
|
|
{-0.1875, -0.1875, -0.3125, 0.1875, 0.1875, 0.3125}, -- pulley
|
|
|
|
{-0.1875, -0.3125, -0.1875, 0.1875, 0.3125, 0.1875}, -- pulley
|
|
|
|
{-0.1875, -0.25, -0.25, 0.1875, 0.25, 0.25}, -- pulley_core
|
|
|
|
{-0.25, -0.5, -0.125, -0.1875, 0.125, 0.125}, -- support
|
|
|
|
{0.1875, -0.5, -0.125, 0.25, 0.125, 0.125}, -- support
|
|
|
|
},
|
|
|
|
--selection = {-0.1875, -0.5, -0.3125, 0.1875, 0.3125, 0.3125}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 2,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
{
|
2017-02-09 08:34:17 +01:00
|
|
|
node={
|
|
|
|
{-0.25, -0.1875, -0.3125, 0.25, 0.1875, 0.3125}, -- pulley
|
|
|
|
{-0.25, -0.3125, -0.1875, 0.25, 0.3125, 0.1875}, -- pulley
|
|
|
|
{-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, -- pulley_core
|
|
|
|
{-0.3125, -0.5, -0.125, -0.25, 0.125, 0.125}, -- support
|
|
|
|
{0.25, -0.5, -0.125, 0.3125, 0.125, 0.125}, -- support
|
|
|
|
},
|
|
|
|
--selection = {-0.3125, -0.5, -0.3125, 0.3125, 0.3125, 0.3125}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 3,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
{
|
2017-02-09 08:34:17 +01:00
|
|
|
node={
|
|
|
|
{-0.3125, -0.1875, -0.3125, 0.3125, 0.1875, 0.3125}, -- pulley
|
|
|
|
{-0.3125, -0.3125, -0.1875, 0.3125, 0.3125, 0.1875}, -- pulley
|
|
|
|
{-0.3125, -0.25, -0.25, 0.3125, 0.25, 0.25}, -- pulley_core
|
|
|
|
{-0.375, -0.5, -0.125, -0.3125, 0.125, 0.125}, -- support
|
|
|
|
{0.3125, -0.5, -0.125, 0.375, 0.125, 0.125}, -- support
|
|
|
|
},
|
|
|
|
--selection = {-0.375, -0.5, -0.3125, 0.375, 0.3125, 0.3125}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 4,
|
2017-02-09 08:34:17 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
{
|
2017-02-09 08:34:17 +01:00
|
|
|
node={
|
|
|
|
{-0.375, -0.1875, -0.3125, 0.375, 0.1875, 0.3125}, -- pulley
|
|
|
|
{-0.375, -0.3125, -0.1875, 0.375, 0.3125, 0.1875}, -- pulley
|
|
|
|
{-0.375, -0.25, -0.25, 0.375, 0.25, 0.25}, -- pulley_core
|
|
|
|
{-0.4375, -0.5, -0.125, -0.375, 0.125, 0.125}, -- support
|
|
|
|
{0.375, -0.5, -0.125, 0.4375, 0.125, 0.125}, -- support
|
2016-06-08 03:53:41 +02:00
|
|
|
},
|
2017-02-09 08:34:17 +01:00
|
|
|
--selection_bottom = {-0.4375, -0.5, -0.3125, 0.4375, 0.3125, 0.3125}, -- selection
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = 5,
|
2017-02-09 08:34:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-10 05:29:42 +01:00
|
|
|
local function register_rope_block(multiple, max_multiple, name_prefix, node_prefix, tint, flammable)
|
|
|
|
local node_name = string.format("ropes:%s%irope_block", node_prefix, multiple)
|
2017-02-09 08:34:17 +01:00
|
|
|
local rope_block_def = {
|
2017-02-10 05:29:42 +01:00
|
|
|
description = S("@1 Ropebox @2m", name_prefix, ropes.ropeLength*multiple),
|
2017-02-09 08:34:17 +01:00
|
|
|
_doc_items_create_entry = false,
|
|
|
|
drawtype="nodebox",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
2017-02-10 05:29:42 +01:00
|
|
|
tiles = rope_box_tiles(rope_box_data[multiple].tiles, tint),
|
2021-03-13 10:22:06 +01:00
|
|
|
use_texture_alpha = "clip",
|
2024-03-01 15:14:31 +01:00
|
|
|
is_ground_content = false,
|
2017-02-09 08:34:17 +01:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = rope_box_data[multiple].node
|
|
|
|
},
|
|
|
|
selection_box = {type="regular"},
|
|
|
|
collision_box = {type="regular"},
|
2020-04-07 00:43:38 +02:00
|
|
|
groups = {attached_node = 1, choppy=2, oddly_breakable_by_hand=1, rope_block = 1},
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-04-30 19:54:39 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
if pointed_thing.type == "node" then
|
|
|
|
local target_node = minetest.get_node(pointed_thing.under)
|
|
|
|
local target_def = minetest.registered_nodes[target_node.name]
|
|
|
|
if target_def.walkable == false then
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return minetest.item_place(itemstack, placer, pointed_thing)
|
|
|
|
end,
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
after_place_node = function(pos, placer)
|
|
|
|
local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
|
|
|
|
local placer_name = placer:get_player_name()
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
if minetest.is_protected(pos_below, placer_name) and not minetest.check_player_privs(placer, "protection_bypass") then
|
|
|
|
return
|
|
|
|
end
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
local node_below = minetest.get_node(pos_below)
|
2019-06-30 03:51:01 +02:00
|
|
|
if ropes.can_place_rope_in_node(node_below.name) then
|
2017-02-09 08:34:17 +01:00
|
|
|
minetest.add_node(pos_below, {name="ropes:rope_bottom"})
|
|
|
|
local meta = minetest.get_meta(pos_below)
|
|
|
|
meta:set_int("length_remaining", ropes.ropeLength*multiple)
|
|
|
|
meta:set_string("placer", placer:get_player_name())
|
|
|
|
end
|
|
|
|
end,
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
after_destruct = function(pos)
|
|
|
|
local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
|
|
|
|
ropes.destroy_rope(pos_below, {'ropes:rope', 'ropes:rope_bottom'})
|
2016-06-08 03:53:41 +02:00
|
|
|
end
|
2024-03-01 15:14:31 +01:00
|
|
|
}
|
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
-- If this number is higher than permitted, we still want to register the block (in case
|
|
|
|
-- some were already placed in-world) but we want to hide it from creative inventory
|
|
|
|
-- and if someone digs it we want to disintegrate it into its component parts to prevent
|
|
|
|
-- reuse.
|
2017-02-10 05:29:42 +01:00
|
|
|
if multiple > max_multiple then
|
2017-02-09 08:34:17 +01:00
|
|
|
rope_block_def.groups.not_in_creative_inventory = 1
|
2017-02-10 05:29:42 +01:00
|
|
|
rope_block_def.drop = string.format("ropes:%s1rope_block %i", node_prefix, multiple)
|
2016-06-08 03:53:41 +02:00
|
|
|
end
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-10 05:29:42 +01:00
|
|
|
if flammable then
|
|
|
|
rope_block_def.groups.flammable = flammable
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-10 05:29:42 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = node_name,
|
|
|
|
burntime = ropes.rope_burn_time * multiple + ropes.wood_burn_time,
|
|
|
|
})
|
|
|
|
end
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-10 05:29:42 +01:00
|
|
|
minetest.register_node(node_name, rope_block_def)
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-01 03:53:16 +01:00
|
|
|
if (multiple ~= 1) then
|
2017-02-09 08:34:17 +01:00
|
|
|
-- Only register a recipe to craft this if it's within the permitted multiple range
|
2017-02-10 05:29:42 +01:00
|
|
|
if multiple <= max_multiple then
|
|
|
|
for i = 1, multiple-1 do
|
|
|
|
local rec = {string.format("ropes:%s%irope_block", node_prefix, i)}
|
|
|
|
for n = 1, multiple-i do
|
|
|
|
table.insert(rec, "ropes:ropesegment")
|
|
|
|
end
|
|
|
|
minetest.register_craft({
|
|
|
|
output = node_name,
|
|
|
|
type = "shapeless",
|
|
|
|
recipe = rec
|
|
|
|
})
|
2017-02-09 08:34:17 +01:00
|
|
|
end
|
|
|
|
end
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
-- Always allow players to disintegrate this into component parts, in case
|
|
|
|
-- there were some in inventory and the setting was changed.
|
2016-06-08 03:53:41 +02:00
|
|
|
minetest.register_craft({
|
2017-02-10 05:29:42 +01:00
|
|
|
output = "ropes:ropesegment",
|
|
|
|
type = "shapeless",
|
2016-06-08 03:53:41 +02:00
|
|
|
recipe = {
|
2017-02-10 05:29:42 +01:00
|
|
|
node_name
|
|
|
|
},
|
|
|
|
replacements = {
|
|
|
|
{node_name, string.format('ropes:%s%irope_block', node_prefix, multiple-1)},
|
|
|
|
},
|
2016-06-08 03:53:41 +02:00
|
|
|
})
|
|
|
|
end
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-01-30 19:30:53 +01:00
|
|
|
if minetest.get_modpath("doc") then
|
2017-02-10 05:29:42 +01:00
|
|
|
doc.add_entry_alias("nodes", "ropes:rope", "nodes", node_name)
|
2017-01-30 19:30:53 +01:00
|
|
|
end
|
2016-06-08 03:53:41 +02:00
|
|
|
end
|
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
local rope_def = {
|
2017-02-03 08:22:31 +01:00
|
|
|
description = S("Rope"),
|
2017-02-01 03:53:16 +01:00
|
|
|
_doc_items_longdesc = ropes.doc.ropebox_longdesc,
|
|
|
|
_doc_items_usagehelp = ropes.doc.ropebox_usage,
|
2017-01-30 09:56:44 +01:00
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = "light",
|
|
|
|
drop = "",
|
2017-02-09 09:13:43 +01:00
|
|
|
tiles = { "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_5.png", "ropes_5.png" },
|
2021-03-13 10:22:06 +01:00
|
|
|
use_texture_alpha = "clip",
|
2024-03-01 15:14:31 +01:00
|
|
|
is_ground_content = false,
|
2017-01-30 09:56:44 +01:00
|
|
|
groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
|
2017-02-18 07:40:42 +01:00
|
|
|
sounds = {
|
2017-03-28 11:19:00 +02:00
|
|
|
footstep = {name = "ropes_creak", gain = 0.8, max_hear_distance = 6},
|
2017-02-18 07:40:42 +01:00
|
|
|
dig = "__group",
|
|
|
|
dug = "__group",
|
|
|
|
},
|
2017-02-09 08:34:17 +01:00
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "connected",
|
|
|
|
fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
|
|
|
|
connect_top = {-1/16, 1/2, -1/16, 1/16, 3/4, 1/16}
|
|
|
|
},
|
|
|
|
connects_to = {"group:rope_block"},
|
|
|
|
connect_sides = {"top"},
|
2017-01-30 09:56:44 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2017-02-09 08:34:17 +01:00
|
|
|
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
|
2017-01-30 09:56:44 +01:00
|
|
|
},
|
|
|
|
after_destruct = function(pos)
|
2017-02-01 03:53:16 +01:00
|
|
|
ropes.hanging_after_destruct(pos, "ropes:rope_top", "ropes:rope", "ropes:rope_bottom")
|
2017-01-30 09:56:44 +01:00
|
|
|
end,
|
2017-02-09 08:34:17 +01:00
|
|
|
}
|
2016-06-08 03:53:41 +02:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
local rope_extension_timer = ropes.make_rope_on_timer("ropes:rope")
|
|
|
|
|
|
|
|
local rope_bottom_def = {
|
2017-02-03 08:22:31 +01:00
|
|
|
description = S("Rope"),
|
2017-01-30 19:30:53 +01:00
|
|
|
_doc_items_create_entry = false,
|
2017-01-30 09:56:44 +01:00
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = "light",
|
|
|
|
drop = "",
|
2017-02-09 09:13:43 +01:00
|
|
|
tiles = { "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_5.png", "ropes_5.png" },
|
2021-03-13 10:22:06 +01:00
|
|
|
use_texture_alpha = "clip",
|
2024-03-01 15:14:31 +01:00
|
|
|
is_ground_content = false,
|
2017-02-09 08:34:17 +01:00
|
|
|
drawtype = "nodebox",
|
2017-01-30 09:56:44 +01:00
|
|
|
groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
|
2017-02-18 07:40:42 +01:00
|
|
|
sounds = {
|
2017-03-28 11:19:00 +02:00
|
|
|
footstep = {name = "ropes_creak", gain = 0.8, max_hear_distance = 6},
|
2017-02-18 07:40:42 +01:00
|
|
|
dig = "__group",
|
|
|
|
dug = "__group",
|
|
|
|
},
|
2017-02-09 08:34:17 +01:00
|
|
|
node_box = {
|
|
|
|
type = "connected",
|
|
|
|
fixed = {
|
|
|
|
{-1/16, -3/8, -1/16, 1/16, 1/2, 1/16},
|
|
|
|
{-2/16, -5/16, -2/16, 2/16, -1/16, 2/16},
|
|
|
|
},
|
|
|
|
connect_top = {-1/16, 1/2, -1/16, 1/16, 3/4, 1/16}
|
|
|
|
},
|
|
|
|
connects_to = {"group:rope_block"},
|
|
|
|
connect_sides = {"top"},
|
2017-01-30 09:56:44 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2017-02-09 08:34:17 +01:00
|
|
|
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
|
2017-01-30 09:56:44 +01:00
|
|
|
},
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-01-30 09:56:44 +01:00
|
|
|
on_construct = function( pos )
|
|
|
|
local timer = minetest.get_node_timer( pos )
|
|
|
|
timer:start( 1 )
|
|
|
|
end,
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
on_timer = rope_extension_timer,
|
2024-03-01 15:14:31 +01:00
|
|
|
|
2017-01-30 09:56:44 +01:00
|
|
|
after_destruct = function(pos)
|
2017-02-01 03:53:16 +01:00
|
|
|
ropes.hanging_after_destruct(pos, "ropes:rope_top", "ropes:rope", "ropes:rope_bottom")
|
2017-01-30 09:56:44 +01:00
|
|
|
end,
|
2017-02-09 08:34:17 +01:00
|
|
|
}
|
2016-06-08 03:53:41 +02:00
|
|
|
|
2017-02-09 08:34:17 +01:00
|
|
|
minetest.register_node("ropes:rope", rope_def)
|
2017-02-10 05:29:42 +01:00
|
|
|
minetest.register_node("ropes:rope_bottom", rope_bottom_def)
|
|
|
|
|
|
|
|
if ropes.woodRopeBoxMaxMultiple > 0 or ropes.create_all_definitions then
|
|
|
|
if ropes.woodRopeBoxMaxMultiple > 0 then
|
|
|
|
minetest.register_craft({
|
2017-02-11 08:37:10 +01:00
|
|
|
output = "ropes:wood1rope_block",
|
2017-02-10 05:29:42 +01:00
|
|
|
recipe = {
|
|
|
|
{'group:wood'},
|
|
|
|
{'group:vines'}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
for i = 1,9 do
|
|
|
|
if ropes.woodRopeBoxMaxMultiple >= i or ropes.create_all_definitions then
|
|
|
|
register_rope_block(i, ropes.woodRopeBoxMaxMultiple, S("Wood"), "wood", "#86683a", 2)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if ropes.copperRopeBoxMaxMultiple > 0 or ropes.create_all_definitions then
|
|
|
|
if ropes.copperRopeBoxMaxMultiple > 0 then
|
|
|
|
minetest.register_craft({
|
2017-02-11 08:37:10 +01:00
|
|
|
output = "ropes:copper1rope_block",
|
2017-02-10 05:29:42 +01:00
|
|
|
recipe = {
|
|
|
|
{'default:copper_ingot'},
|
|
|
|
{'group:vines'}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
for i = 1,9 do
|
|
|
|
if ropes.copperRopeBoxMaxMultiple >= i or ropes.create_all_definitions then
|
|
|
|
register_rope_block(i, ropes.copperRopeBoxMaxMultiple, S("Copper"), "copper", "#c88648")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if ropes.steelRopeBoxMaxMultiple > 0 or ropes.create_all_definitions then
|
|
|
|
if ropes.steelRopeBoxMaxMultiple > 0 then
|
|
|
|
minetest.register_craft({
|
2017-02-11 08:37:10 +01:00
|
|
|
output = "ropes:steel1rope_block",
|
2017-02-10 05:29:42 +01:00
|
|
|
recipe = {
|
|
|
|
{'default:steel_ingot'},
|
|
|
|
{'group:vines'}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
for i = 1,9 do
|
|
|
|
if ropes.steelRopeBoxMaxMultiple >= i or ropes.create_all_definitions then
|
|
|
|
register_rope_block(i, ropes.steelRopeBoxMaxMultiple, S("Steel"), "steel", "#ffffff")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|