2013-07-14 11:30:03 +02:00
|
|
|
--Minetest 0.4.7 mod: concrete
|
2013-04-04 01:17:39 +02:00
|
|
|
--(c) 2013 by RealBadAngel <mk@realbadangel.pl>
|
|
|
|
|
2015-02-05 09:47:37 +01:00
|
|
|
local technic = rawget(_G, "technic") or {}
|
2013-07-17 21:34:35 +02:00
|
|
|
technic.concrete_posts = {}
|
|
|
|
|
2014-04-16 19:10:00 +02:00
|
|
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
2015-02-05 10:07:38 +01:00
|
|
|
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
|
2014-04-16 19:10:00 +02:00
|
|
|
|
2016-03-20 03:55:00 +01:00
|
|
|
for i = 0, 31 do
|
2017-03-28 21:04:28 +02:00
|
|
|
minetest.register_alias("technic:concrete_post" .. i,
|
|
|
|
"technic:concrete_post")
|
2016-03-20 03:55:00 +01:00
|
|
|
end
|
|
|
|
for i = 32, 63 do
|
2017-03-28 21:04:28 +02:00
|
|
|
minetest.register_alias("technic:concrete_post" .. i,
|
|
|
|
"technic:concrete_post_with_platform")
|
2016-03-20 03:55:00 +01:00
|
|
|
end
|
2013-07-17 21:34:35 +02:00
|
|
|
|
split default iron/steel into three metals
Override the default mod's iron/steel substance, replacing it with three
metals: wrought iron (pure iron), carbon steel (iron alloyed with a little
carbon), and cast iron (iron alloyed with lots of carbon). Wrought iron
is easiest to refine, then cast iron, and carbon steel the most difficult,
matching the historical progression. Recipes that used default steel are
changed to use one of the three, the choice of alloy for each application
being both somewhat realistic and also matching up with game progression.
The default:steel{_ingot,block} items are identified specifically with
wrought iron. This makes the default refining recipes work appropriately.
Iron-using recipes defined outside technic are thus necessarily
reinterpreted to use wrought iron, which is mostly appropriate.
Some objects are renamed accordingly.
Rather than use the default steel textures for wrought iron, with technic
providing textures for the other two, technic now provides textures for
all three metals. This avoids problems that would occur with texture
packs that provide default_steel_{ingot,block} textures that are not
intended to support this wrought-iron/carbon-steel/cast-iron distinction.
A texture pack can provide a distinct set of three textures specifically
for the situation where this distinction is required.
Incidentally make grinding and alloy cooking recipes work correctly when
ingredients are specified by alias.
2014-05-16 23:02:49 +02:00
|
|
|
local steel_ingot
|
|
|
|
if minetest.get_modpath("technic_worldgen") then
|
|
|
|
steel_ingot = "technic:carbon_steel_ingot"
|
|
|
|
else
|
|
|
|
steel_ingot = "default:steel_ingot"
|
|
|
|
end
|
|
|
|
|
2013-04-04 01:17:39 +02:00
|
|
|
minetest.register_craft({
|
2013-07-14 11:30:03 +02:00
|
|
|
output = 'technic:rebar 6',
|
2013-04-04 01:17:39 +02:00
|
|
|
recipe = {
|
2017-03-28 21:04:28 +02:00
|
|
|
{ '', '', steel_ingot },
|
|
|
|
{ '', steel_ingot, '' },
|
|
|
|
{ steel_ingot, '', '' },
|
2013-04-04 01:17:39 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2013-07-14 11:30:03 +02:00
|
|
|
output = 'technic:concrete 5',
|
2013-04-04 01:17:39 +02:00
|
|
|
recipe = {
|
2017-03-28 21:04:28 +02:00
|
|
|
{ 'default:stone', 'technic:rebar', 'default:stone' },
|
|
|
|
{ 'technic:rebar', 'default:stone', 'technic:rebar' },
|
|
|
|
{ 'default:stone', 'technic:rebar', 'default:stone' },
|
2013-04-04 01:17:39 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2013-07-14 11:30:03 +02:00
|
|
|
output = 'technic:concrete_post_platform 6',
|
2013-04-04 01:17:39 +02:00
|
|
|
recipe = {
|
2017-03-28 21:04:28 +02:00
|
|
|
{ 'technic:concrete', 'technic:concrete_post', 'technic:concrete' },
|
2013-04-04 01:17:39 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2016-03-20 03:55:00 +01:00
|
|
|
output = 'technic:concrete_post 12',
|
2013-04-04 01:17:39 +02:00
|
|
|
recipe = {
|
2017-03-28 21:04:28 +02:00
|
|
|
{ 'default:stone', 'technic:rebar', 'default:stone' },
|
|
|
|
{ 'default:stone', 'technic:rebar', 'default:stone' },
|
|
|
|
{ 'default:stone', 'technic:rebar', 'default:stone' },
|
2016-03-20 03:55:00 +01:00
|
|
|
}
|
2013-04-04 01:17:39 +02:00
|
|
|
})
|
|
|
|
|
2013-07-14 12:11:56 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = 'technic:blast_resistant_concrete 5',
|
|
|
|
recipe = {
|
2017-03-28 21:04:28 +02:00
|
|
|
{ 'technic:concrete', 'technic:composite_plate', 'technic:concrete' },
|
|
|
|
{ 'technic:composite_plate', 'technic:concrete', 'technic:composite_plate' },
|
|
|
|
{ 'technic:concrete', 'technic:composite_plate', 'technic:concrete' },
|
2013-07-14 12:11:56 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2013-04-04 01:17:39 +02:00
|
|
|
minetest.register_craftitem(":technic:rebar", {
|
2014-04-16 19:10:00 +02:00
|
|
|
description = S("Rebar"),
|
2013-04-04 01:17:39 +02:00
|
|
|
inventory_image = "technic_rebar.png",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node(":technic:concrete", {
|
2014-04-16 19:10:00 +02:00
|
|
|
description = S("Concrete Block"),
|
2017-03-28 21:04:28 +02:00
|
|
|
tiles = { "technic_concrete_block.png", },
|
|
|
|
groups = { cracky = 1, level = 2, concrete = 1 },
|
2013-04-04 01:17:39 +02:00
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
2013-07-14 12:11:56 +02:00
|
|
|
minetest.register_node(":technic:blast_resistant_concrete", {
|
2014-04-16 19:10:00 +02:00
|
|
|
description = S("Blast-resistant Concrete Block"),
|
2017-03-28 21:04:28 +02:00
|
|
|
tiles = { "technic_blast_resistant_concrete_block.png", },
|
|
|
|
groups = { cracky = 1, level = 3, concrete = 1 },
|
2013-07-14 12:11:56 +02:00
|
|
|
sounds = default.node_sound_stone_defaults(),
|
2016-03-20 05:08:50 +01:00
|
|
|
on_blast = function(pos, intensity)
|
2016-10-05 01:37:26 +02:00
|
|
|
if intensity > 9 then
|
2016-03-20 05:08:50 +01:00
|
|
|
minetest.remove_node(pos)
|
2017-03-28 21:04:28 +02:00
|
|
|
return { "technic:blast_resistant_concrete" }
|
2016-03-20 05:08:50 +01:00
|
|
|
end
|
|
|
|
end,
|
2013-07-14 12:11:56 +02:00
|
|
|
})
|
|
|
|
|
2016-03-20 03:55:00 +01:00
|
|
|
|
2017-03-28 21:04:28 +02:00
|
|
|
local box_platform = { -0.5, 0.3, -0.5, 0.5, 0.5, 0.5 }
|
|
|
|
local box_post = { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }
|
|
|
|
local box_front = { -0.1, -0.3, 0, 0.1, 0.3, -0.5 }
|
|
|
|
local box_back = { -0.1, -0.3, 0, 0.1, 0.3, 0.5 }
|
|
|
|
local box_left = { 0, -0.3, -0.1, -0.5, 0.3, 0.1 }
|
|
|
|
local box_right = { 0, -0.3, -0.1, 0.5, 0.3, 0.1 }
|
2016-03-20 03:55:00 +01:00
|
|
|
|
2013-04-04 01:17:39 +02:00
|
|
|
minetest.register_node(":technic:concrete_post_platform", {
|
2014-04-16 19:10:00 +02:00
|
|
|
description = S("Concrete Post Platform"),
|
2017-03-28 21:04:28 +02:00
|
|
|
tiles = { "technic_concrete_block.png", },
|
|
|
|
groups = { cracky = 1, level = 2 },
|
2013-04-04 01:17:39 +02:00
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
paramtype = "light",
|
2017-03-28 21:04:28 +02:00
|
|
|
drawtype = "nodebox",
|
2013-04-04 01:17:39 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2017-03-28 21:04:28 +02:00
|
|
|
fixed = { box_platform }
|
2013-07-17 21:34:35 +02:00
|
|
|
},
|
2017-03-28 21:04:28 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2013-07-17 21:34:35 +02:00
|
|
|
local node = minetest.get_node(pointed_thing.under)
|
2017-03-28 21:04:28 +02:00
|
|
|
if node.name ~= "technic:concrete_post" then
|
|
|
|
return minetest.item_place_node(itemstack, placer, pointed_thing)
|
2013-07-17 21:34:35 +02:00
|
|
|
end
|
2017-03-28 21:04:28 +02:00
|
|
|
minetest.set_node(pointed_thing.under, { name = "technic:concrete_post_with_platform" })
|
2013-07-17 21:34:35 +02:00
|
|
|
itemstack:take_item()
|
|
|
|
placer:set_wielded_item(itemstack)
|
|
|
|
return itemstack
|
2013-04-04 01:17:39 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2013-07-17 21:34:35 +02:00
|
|
|
for platform = 0, 1 do
|
2016-03-20 03:55:00 +01:00
|
|
|
local after_dig_node = nil
|
|
|
|
if platform == 1 then
|
|
|
|
after_dig_node = function(pos, old_node)
|
|
|
|
old_node.name = "technic:concrete_post"
|
|
|
|
minetest.set_node(pos, old_node)
|
2013-07-17 21:34:35 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-03-28 21:04:28 +02:00
|
|
|
minetest.register_node(":technic:concrete_post" .. (platform == 1 and "_with_platform" or ""), {
|
2014-04-16 19:10:00 +02:00
|
|
|
description = S("Concrete Post"),
|
2017-03-28 21:04:28 +02:00
|
|
|
tiles = { "technic_concrete_block.png" },
|
|
|
|
groups = { cracky = 1, level = 2, concrete_post = 1, not_in_creative_inventory = platform },
|
2013-07-17 21:34:35 +02:00
|
|
|
sounds = default.node_sound_stone_defaults(),
|
2016-03-20 03:55:00 +01:00
|
|
|
drop = (platform == 1 and "technic:concrete_post_platform" or
|
|
|
|
"technic:concrete_post"),
|
2013-07-17 21:34:35 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2016-03-20 03:55:00 +01:00
|
|
|
drawtype = "nodebox",
|
2017-03-28 21:04:28 +02:00
|
|
|
connects_to = { "group:concrete", "group:concrete_post" },
|
2013-07-17 21:34:35 +02:00
|
|
|
node_box = {
|
2016-03-20 03:55:00 +01:00
|
|
|
type = "connected",
|
2017-03-28 21:04:28 +02:00
|
|
|
fixed = { box_post, (platform == 1 and box_platform or nil) },
|
2016-03-20 03:55:00 +01:00
|
|
|
connect_front = box_front,
|
2017-03-28 21:04:28 +02:00
|
|
|
connect_back = box_back,
|
|
|
|
connect_left = box_left,
|
2016-03-20 03:55:00 +01:00
|
|
|
connect_right = box_right,
|
2013-07-17 21:34:35 +02:00
|
|
|
},
|
|
|
|
after_dig_node = after_dig_node,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|