Skip to content

Commit

Permalink
Closes lord-server#980. Fix fences connection. Add hardwood fences
Browse files Browse the repository at this point in the history
  • Loading branch information
Doloment committed Feb 5, 2023
1 parent 4cf9e2d commit 509a1f7
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 129 deletions.
43 changes: 0 additions & 43 deletions mods/lord/lord_homedecor/building_blocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,6 @@ minetest.register_craft({
{"default:glass"},
}
})
minetest.register_craft({
output = 'lord_homedecor:hardwood 2',
recipe = {
{"default:wood", "default:junglewood"},
{"default:junglewood", "default:wood"},
}
})

minetest.register_craft({
output = 'lord_homedecor:hardwood 2',
recipe = {
{"default:junglewood", "default:wood"},
{"default:wood", "default:junglewood"},
}
})

-- если есть lottblocks
if minetest.get_modpath("lottblocks") then
Expand Down Expand Up @@ -268,13 +253,6 @@ minetest.register_node("lord_homedecor:gravel_spread", {
groups = {crumbly=2},
sounds = default.node_sound_gravel_defaults(),
})
minetest.register_node("lord_homedecor:hardwood", {
tiles = {"building_blocks_hardwood.png"},
is_ground_content = true,
description = SL("Hardwood"),
groups = {choppy=1,flammable=1},
sounds = default.node_sound_wood_defaults(),
})

-- Register scaffolding nodes and crafts
local texture_plank = "default_wood.png"
Expand Down Expand Up @@ -320,19 +298,6 @@ minetest.register_craft({
})


stairs.register_stair_and_slab(
"hardwood",
"lord_homedecor:hardwood",
{choppy=1,flammable=1},
{"building_blocks_hardwood.png"},
SL("Hardwood stair"),
SL("Hardwood slab"),
default.node_sound_wood_defaults(),
false,
SL("Inner Hardwood stair"),
SL("Outer Hardwood stair")
)

stairs.register_stair_and_slab(
"grate",
"lord_homedecor:grate",
Expand Down Expand Up @@ -372,14 +337,6 @@ stairs.register_stair_and_slab(
SL("Outer Roofing stair")
)


minetest.register_craft({
type = "fuel",
recipe = "lord_homedecor:hardwood",
burntime = 28,
})


minetest.register_craftitem("lord_homedecor:sticks", {
description = SL("Small bundle of sticks"),
image = "building_blocks_sticks.png",
Expand Down
5 changes: 0 additions & 5 deletions mods/lord/lord_homedecor/locale/lord_homedecor.ru.tr
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ Tarmac Spread=Асфальтовая дорожка
Chess board tiling=Черепица "Шахматная доска"
Brobble Spread=Дорожка из обожженной глины
Gravel Spread=Гравийная дорожка
Hardwood=Твердая древесина
Marble stair=Ступенька из темного мрамора
Marble slab=Плита из темного мрамора
Hardwood stair=Ступенька из твердой древесины
Inner Hardwood stair=Угловая ступенька из твердой древесины (Внутренний Угол)
Outer Hardwood stair=Угловая ступенька из твердой древесины (Внешний Угол)
Hardwood slab=Плита из твердой древесины
Fake Grass=Искусственная трава
Grass stair=Ступенька из искусственной травы
Inner Grass stair=Угловая ступенька из искусственной травы (Внутренний Угол)
Expand Down
4 changes: 2 additions & 2 deletions mods/lord/lord_homedecor/mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = lord_homedecor
depends = default, wool, bees, stairs, lottplants, lordlib
optional_depends = lottblocks, bucket
depends = default, wool, bees, stairs, lottplants, lordlib, lottblocks
optional_depends = bucket
16 changes: 16 additions & 0 deletions mods/lord/lottblocks/locale/lottblocks.ru.tr
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,19 @@ Mallorn Chair=Маллорновый стул
Mallorn Ladder=Маллорновая лестница
Mallorn Stick=Маллорновая палочка
Mallorn Stanchion=Маллорновые стойки

Hardwood=Твердая Древесина
Hardwood stair=Ступенька из твердой древесины
Inner Hardwood stair=Угловая ступенька из твердой древесины (Внутренний Угол)
Outer Hardwood stair=Угловая ступенька из твердой древесины (Внешний Угол)
Hardwood slab=Плита из двердой древесины
Hardwood Fence = Забор из Твердой Древесины
Hardwood Fence Rail = Реечный Забор из Твердой Древесины
Hardwood Door=Дверь из твердой древесины
Hardwood Door With Lock=Дверь с замком из твердой древесины
Hardwood Trapdoor=Люк из твердой древесины
Hardwood Table=Стол из твердой древесины
Hardwood Chair=Стул из твердой древесины
Hardwood Ladder=Лестница из твердой древесины
Hardwood Stick=Палочка из твердой древесины
Hardwood Stanchion=Стойки из твердой древесины
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
179 changes: 100 additions & 79 deletions mods/lord/lottblocks/wooden_stuff.lua
Original file line number Diff line number Diff line change
@@ -1,86 +1,51 @@
local S = minetest.get_translator("lottblocks")

--Твёрдая древесина. Вынесена из lord_homedecor из-за проблем с зависимостями
minetest.register_node(":lord_homedecor:hardwood", {
tiles = {"lottblocks_hardwood.png"},
is_ground_content = true,
description = S("Hardwood"),
groups = {choppy=1,flammable=1,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craft({
output = 'lord_homedecor:hardwood 2',
recipe = {
{"default:wood", "default:junglewood"},
{"default:junglewood", "default:wood"},
}
})
minetest.register_craft({
output = 'lord_homedecor:hardwood 2',
recipe = {
{"default:junglewood", "default:wood"},
{"default:wood", "default:junglewood"},
}
})
stairs.register_stair_and_slab(
"hardwood",
"lord_homedecor:hardwood",
{choppy=1,flammable=1},
{"lottblocks_hardwood.png"},
S("Hardwood stair"),
S("Hardwood slab"),
default.node_sound_wood_defaults(),
false,
S("Inner Hardwood stair"),
S("Outer Hardwood stair")
)
minetest.register_craft({
type = "fuel",
recipe = "lord_homedecor:hardwood",
burntime = 28,
})

function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
local node_groups = table.copy(minetest.registered_nodes[wood_name].groups)
node_groups["wood"] = nil
node_groups["wooden"] = 1

local groups_door = table.copy(node_groups)
groups_door.door = 1
if name ~= "wood" then -- to not overwrite registrations from minetest_game
local door_reg_name = "lottblocks:door_" .. name
local door_inv_texture = "lottblocks_door_" .. name .. ".png"
local door_uv_texture = "lottblocks_door_" .. name .. "_uv.png"
doors.register(door_reg_name, {
tiles = {{ name = door_uv_texture, backface_culling = true }},
description = S(description .. " Door"),
inventory_image = door_inv_texture,
sound_open = "doors_door_open",
sound_close = "doors_door_close",
groups = groups_door,
recipe = {
{ wood_name, wood_name },
{ wood_name, wood_name },
{ wood_name, wood_name },
},
})
doors.register(door_reg_name .. "_lock", {
tiles = {{ name = door_uv_texture, backface_culling = true }},
description = S(description .. " Door With Lock"),
inventory_image = door_inv_texture .. "^lord_doors_lock.png",
sound_open = "doors_door_open",
sound_close = "doors_door_close",
groups = groups_door,
recipe = {
{ door_reg_name, "default:steel_ingot", }
},
protected = true,
})

local hatch_reg_name = "lottblocks:hatch_" .. name
local hatch_inv_texture = "lottblocks_hatch_" .. name .. ".png"
node_groups.not_in_creative_inventory = 0
doors.register_trapdoor(hatch_reg_name, {
description = S(description .. " Trapdoor"),
inventory_image = hatch_inv_texture,
wield_image = hatch_inv_texture,
tile_front = hatch_inv_texture,
tile_side = "lottblocks_hatch_" .. name .. "_side.png",
groups = node_groups,
})
minetest.register_craft({
output = hatch_reg_name,
recipe = {
{ wood_name, wood_name },
{ wood_name, wood_name },
}
})

if name ~= "junglewood" then
default.register_fence("lottblocks:fence_" .. name, {
description = S(description .. " Fence"),
texture = "lottblocks_fence_"..name.."_wood.png",
inventory_image = "default_fence_overlay.png^lottplants_"..name.."wood.png^" ..
"default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^lottplants_"..name.."wood.png^" ..
"default_fence_overlay.png^[makealpha:255,126,126",
material = wood_name,
groups = node_groups,
sounds = default.node_sound_wood_defaults()
})
default.register_fence_rail("lottblocks:fence_rail_" .. name, {
description = S(description .. " Fence Rail"),
texture = "lottplants_"..name.."wood.png",
inventory_image = "default_fence_rail_overlay.png^lottplants_"..name.."wood.png^" ..
"default_fence_rail_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_rail_overlay.png^lottplants_"..name.."wood.png^" ..
"default_fence_rail_overlay.png^[makealpha:255,126,126",
material = wood_name,
groups = node_groups,
sounds = default.node_sound_wood_defaults()
})
end

if name ~= "wood" then -- for not to overwrite registrations from minetest_game
-- STICK | ПАЛОЧКА
local stick_reg_name = "lottblocks:stick_" .. name
minetest.register_craftitem(stick_reg_name, {
Expand Down Expand Up @@ -212,6 +177,58 @@ function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
{ stick_reg_name, '', stick_reg_name },
}
})

-- DOOR | ДВЕРЬ
local groups_door = table.copy(node_groups)
groups_door.door = 1
local door_reg_name = "lottblocks:door_" .. name
local door_inv_texture = "lottblocks_door_" .. name .. ".png"
local door_uv_texture = "lottblocks_door_" .. name .. "_uv.png"
doors.register(door_reg_name, {
tiles = {{ name = door_uv_texture, backface_culling = true }},
description = S(description .. " Door"),
inventory_image = door_inv_texture,
sound_open = "doors_door_open",
sound_close = "doors_door_close",
groups = groups_door,
recipe = {
{ wood_name, wood_name },
{ wood_name, wood_name },
{ wood_name, wood_name },
},
})
doors.register(door_reg_name .. "_lock", {
tiles = {{ name = door_uv_texture, backface_culling = true }},
description = S(description .. " Door With Lock"),
inventory_image = door_inv_texture .. "^lord_doors_lock.png",
sound_open = "doors_door_open",
sound_close = "doors_door_close",
groups = groups_door,
recipe = {
{ door_reg_name, "default:steel_ingot", }
},
protected = true,
})

-- HATCHES | ЛЮКИ
local hatch_reg_name = "lottblocks:hatch_" .. name
local hatch_inv_texture = "lottblocks_hatch_" .. name .. ".png"
node_groups.not_in_creative_inventory = 0
doors.register_trapdoor(hatch_reg_name, {
description = S(description .. " Trapdoor"),
inventory_image = hatch_inv_texture,
wield_image = hatch_inv_texture,
tile_front = hatch_inv_texture,
tile_side = "lottblocks_hatch_" .. name .. "_side.png",
groups = node_groups,
})
minetest.register_craft({
output = hatch_reg_name,
recipe = {
{ wood_name, wood_name },
{ wood_name, wood_name },
}
})
end

-- TABLE | СТОЛ
Expand All @@ -237,7 +254,8 @@ function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
{ -0.3, -0.2, 0.3, 0.3, -0.1, 0.4 },
},
},
groups = node_groups
groups = node_groups,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craft({
output = table_reg_name,
Expand All @@ -248,7 +266,7 @@ function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
}
})

-- CHAIR | КРЕСЛА
-- CHAIR | СТУЛ
local chair_reg_name = "lottblocks:" .. name .. "_chair"
minetest.register_node(chair_reg_name, {
description = S(description .. " Chair"),
Expand All @@ -272,7 +290,8 @@ function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
type = "fixed",
fixed = { -0.3, -0.5, -0.3, 0.3, 0.5, 0.3 },
},
groups = node_groups
groups = node_groups,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craft({
output = chair_reg_name,
Expand All @@ -290,6 +309,7 @@ function lottblocks.register_wooden_stuff(name, description, texture, wood_name)
{ 'group:stick', 'group:stick' },
}
})

end

lottblocks.register_wooden_stuff("wood", "Wooden", "default_wood.png", "default:wood")
Expand All @@ -299,6 +319,7 @@ lottblocks.register_wooden_stuff("birch", "Birch", "lottplants_birchwood.png", "
lottblocks.register_wooden_stuff("pine", "Pine", "lottplants_pinewood.png", "lottplants:pinewood")
lottblocks.register_wooden_stuff("lebethron", "Lebethron", "lottplants_lebethronwood.png", "lottplants:lebethronwood")
lottblocks.register_wooden_stuff("mallorn", "Mallorn", "lottplants_mallornwood.png", "lottplants:mallornwood")
lottblocks.register_wooden_stuff("hardwood", "Hardwood", "lottblocks_hardwood.png", "lord_homedecor:hardwood")

minetest.register_alias("lottblocks:fence_junglewood", "default:fence_junglewood")

Expand Down

0 comments on commit 509a1f7

Please sign in to comment.