Compare commits
10 Commits
b0e3682870
...
5d78183cf2
Author | SHA1 | Date | |
---|---|---|---|
|
5d78183cf2 | ||
|
83d55f241a | ||
|
79547ede26 | ||
|
e23201a251 | ||
|
aee9b46d42 | ||
|
55cc1b04b1 | ||
|
f1fdabe0b0 | ||
|
1f9875fced | ||
|
5264626c79 | ||
|
9389bf37e7 |
10
.github/workflows/luacheck.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
name: luacheck
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
luacheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- name: Luacheck
|
||||
uses: lunarmodules/luacheck@master
|
25
.luacheckrc
@ -1,20 +1,15 @@
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
max_line_length = 140
|
||||
|
||||
read_globals = {
|
||||
"doors",
|
||||
"DIR_DELIM",
|
||||
"minetest", "core",
|
||||
"dump",
|
||||
"vector", "nodeupdate",
|
||||
"VoxelManip", "VoxelArea",
|
||||
"PseudoRandom", "ItemStack",
|
||||
"intllib",
|
||||
table = {fields = {"copy"}},
|
||||
|
||||
"minetest",
|
||||
"core",
|
||||
"vector",
|
||||
"default",
|
||||
"armor",
|
||||
"doors",
|
||||
"screwdriver",
|
||||
"stairs",
|
||||
"stairsplus",
|
||||
}
|
||||
|
||||
globals = {
|
||||
core = { fields = { "do_item_eat" }},
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image
|
||||
}
|
||||
|
||||
local function add_door(desc, img)
|
||||
doors.register("my_castle_doors:"..img.."_locked", {
|
||||
doors.register_door("my_castle_doors:"..img.."_locked", {
|
||||
description = desc.." Locked",
|
||||
inventory_image = "mydoors_"..img.."_inv.png",
|
||||
groups = {choppy=2,cracky=2,door=1},
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2.6 KiB |
@ -15,7 +15,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image
|
||||
}
|
||||
|
||||
local function add_door(desc, img)
|
||||
mydoors.register_door("my_castle_doors:"..img, {
|
||||
doors.register_door("my_castle_doors:"..img, {
|
||||
description = desc,
|
||||
inventory_image = "mydoors_"..img.."_inv.png",
|
||||
groups = {choppy=2,cracky=2,door=1},
|
||||
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.2 KiB |
@ -4,7 +4,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image
|
||||
}
|
||||
|
||||
local function add_door(desc, img)
|
||||
mydoors.register_door("my_cottage_doors:"..img, {
|
||||
doors.register_door("my_cottage_doors:"..img, {
|
||||
description = desc,
|
||||
inventory_image = "mycdoors_"..img.."_inv.png",
|
||||
groups = {choppy=2,cracky=2,door=1},
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 855 B |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 881 B |
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 712 B |
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 753 B After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 748 B After Width: | Height: | Size: 523 B |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 348 B |
@ -7,7 +7,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image
|
||||
}
|
||||
|
||||
local function add_door(num, desc, img, itm)
|
||||
mydoors.register_door("my_default_doors:door"..num, {
|
||||
doors.register_door("my_default_doors:door"..num, {
|
||||
description = desc,
|
||||
inventory_image = "mydoors_"..img.."_inv.png",
|
||||
groups = {choppy=2,cracky=2,door=1},
|
||||
|
@ -1,3 +0,0 @@
|
||||
default
|
||||
stairs?
|
||||
moreblocks?
|
@ -1 +0,0 @@
|
||||
Wood that is used to make doors.
|
@ -7,7 +7,7 @@ local door_wood = { -- color, desc, image
|
||||
{"yellow", "Clear Stained", "yellow"},
|
||||
{"black", "Black", "black"},
|
||||
}
|
||||
local function my_door_wood_block_stairs(nodename, def)
|
||||
local function my_door_wood_block_stairs(nodename, def)
|
||||
local mod = string.match(nodename, "(.+):")
|
||||
local name = string.match(nodename, ":(.+)")
|
||||
minetest.register_node(nodename, def)
|
||||
@ -23,22 +23,21 @@ local function my_door_wood_block_stairs(nodename, def)
|
||||
sounds = def.sounds,
|
||||
}
|
||||
)
|
||||
elseif minetest.get_modpath("stairs") then
|
||||
elseif minetest.get_modpath("stairs") then
|
||||
stairs.register_stair_and_slab(name,nodename,
|
||||
def.groups,
|
||||
def.tiles,
|
||||
("%s Stair"):format(def.description),
|
||||
("%s Slab"):format(def.description),
|
||||
def.sounds
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
local function add_door(color, desc, img)
|
||||
my_door_wood_block_stairs("my_door_wood:wood_"..color, {
|
||||
description = desc.." Wood",
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
tiles = {"mydoors_"..img.."_wood.png"},
|
||||
paramtype = "light",
|
||||
groups = {cracky = 2, choppy = 2, wood = 1},
|
||||
@ -59,27 +58,3 @@ end
|
||||
for _,door in ipairs(door_wood) do
|
||||
add_door(unpack(door))
|
||||
end
|
||||
|
||||
mydoors = {}
|
||||
|
||||
local mesecons = {effector = {
|
||||
action_on = function(pos)
|
||||
local door = doors.get(pos)
|
||||
if door then
|
||||
door:open()
|
||||
end
|
||||
end,
|
||||
action_off = function(pos)
|
||||
local door = doors.get(pos)
|
||||
if door then
|
||||
door:close()
|
||||
end
|
||||
end,
|
||||
rules = minetest.global_exists("mesecon") and mesecon.rules.pplate or nil
|
||||
}}
|
||||
|
||||
-- Helper function for mesecons support
|
||||
function mydoors.register_door(name, def)
|
||||
def.mesecons = mesecons
|
||||
doors.register(name, def)
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = my_door_wood
|
||||
description = Doors made from default ores. Copper, bronze, gold, diamond and mese.
|
||||
description = Wood that is used to make doors.
|
||||
depends = default
|
||||
optional_depends = stairs, moreblocks, mesecons
|
||||
optional_depends = stairs, moreblocks
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 927 B |
Before Width: | Height: | Size: 905 B After Width: | Height: | Size: 846 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.4 KiB |
@ -10,7 +10,7 @@ local fdoor_list = { --Number , Description , Inven Image , Image
|
||||
}
|
||||
|
||||
local function add_door(desc, img)
|
||||
mydoors.register_door("my_fancy_doors:"..img, {
|
||||
doors.register_door("my_fancy_doors:"..img, {
|
||||
description = desc,
|
||||
inventory_image = "myfdoors_"..img.."_inv.png",
|
||||
groups = {choppy=2,cracky=2,door=1},
|
||||
|
@ -1,3 +1,4 @@
|
||||
local rotate_disallow = rawget(_G, "screwdriver") and screwdriver.disallow or nil
|
||||
local doorcolors = {"white","red","black"}
|
||||
|
||||
local function add_door(col)
|
||||
@ -36,11 +37,11 @@ local function add_door(col)
|
||||
{-0.625, 1.4375,-0.5625, 0.625, 1.625, 0.5625}, --top
|
||||
}
|
||||
},
|
||||
|
||||
on_rotate = rotate_disallow,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos1 = pointed_thing.above
|
||||
local pos2 = vector.add(pos1, {x=0,y=1,z=0})
|
||||
|
||||
|
||||
if not placer or not placer:is_player() then
|
||||
return
|
||||
end
|
||||
@ -112,6 +113,7 @@ local function add_door(col)
|
||||
{-0.5, -0.5, -0.5, -0.5, -0.5, -0.5},
|
||||
}
|
||||
},
|
||||
on_rotate = rotate_disallow,
|
||||
})
|
||||
minetest.register_node("my_future_doors:door1c_"..col, {
|
||||
tiles = {
|
||||
@ -146,6 +148,7 @@ local function add_door(col)
|
||||
}
|
||||
},
|
||||
drop = "my_future_doors:door1a_"..col,
|
||||
on_rotate = rotate_disallow,
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
local node = minetest.get_node(pos)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
@ -194,6 +197,7 @@ local function add_door(col)
|
||||
{-0.5, -0.5, -0.5, -0.5, -0.5, -0.5},
|
||||
}
|
||||
},
|
||||
on_rotate = rotate_disallow,
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "my_future_doors:door1a_"..col.." 1",
|
||||
|
@ -1,3 +1,4 @@
|
||||
name = my_future_doors
|
||||
description = Futuristic style doors.
|
||||
depends = my_door_wood
|
||||
depends = my_door_wood
|
||||
optional_depends = screwdriver
|
||||
|
@ -1,3 +1,5 @@
|
||||
local rotate_disallow = rawget(_G, "screwdriver") and screwdriver.disallow or nil
|
||||
|
||||
local doors = {
|
||||
{"my_future_doors:door2a","my_future_doors:door2b","my_future_doors:door2c","my_future_doors:door2d","2","Steel",
|
||||
{{"default:steel_ingot", "default:steelblock", ""},
|
||||
@ -33,7 +35,7 @@ local function add_door(doora, doorb, doorc, doord, num, des, recipe)
|
||||
local function onplace(itemstack, placer, pointed_thing)
|
||||
local pos1 = pointed_thing.above
|
||||
local pos2 = vector.add(pos1, {x=0,y=1,z=0})
|
||||
|
||||
|
||||
if not placer or not placer:is_player() then
|
||||
return
|
||||
end
|
||||
@ -147,6 +149,7 @@ local function add_door(doora, doorb, doorc, doord, num, des, recipe)
|
||||
{-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625}
|
||||
}
|
||||
},
|
||||
on_rotate = rotate_disallow,
|
||||
|
||||
on_place = onplace,
|
||||
|
||||
@ -179,6 +182,7 @@ local function add_door(doora, doorb, doorc, doord, num, des, recipe)
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
on_rotate = rotate_disallow,
|
||||
})
|
||||
minetest.register_node(doorc, {
|
||||
tiles = {
|
||||
@ -209,6 +213,7 @@ local function add_door(doora, doorb, doorc, doord, num, des, recipe)
|
||||
after_place_node = afterplace,
|
||||
after_destruct = afterdestruct,
|
||||
on_timer = ontimer,
|
||||
on_rotate = rotate_disallow,
|
||||
})
|
||||
minetest.register_node(doord, {
|
||||
tiles = {
|
||||
@ -235,6 +240,7 @@ local function add_door(doora, doorb, doorc, doord, num, des, recipe)
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
on_rotate = rotate_disallow,
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "my_future_doors:door"..num.."a 2",
|
||||
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 117 B |
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 98 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 90 B |
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 941 B |
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 853 B |
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 1002 B After Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 360 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 711 B |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 849 B |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 839 B |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 4.3 KiB |
@ -1 +0,0 @@
|
||||
A garage door.
|
@ -1,3 +1,5 @@
|
||||
local rotate_disallow = rawget(_G, "screwdriver") and screwdriver.disallow or nil
|
||||
|
||||
local function buildable_to(pos)
|
||||
local node = minetest.get_node(pos).name
|
||||
if minetest.registered_nodes[node] then -- The checked node is maybe an unknown node
|
||||
@ -6,6 +8,17 @@ local function buildable_to(pos)
|
||||
return false
|
||||
end
|
||||
|
||||
local nodebox_closed = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, -0.5, -0.125, 1.5, 0.5, -0.0625},
|
||||
{-1.5, -0.5, -0.1875, 1.5, -0.3125, -0.0625},
|
||||
{-1.5, -0.25, -0.1875, 1.5, -0.0624999, -0.0625},
|
||||
{-1.5, 0, -0.1875, 1.5, 0.1875, -0.0625},
|
||||
{-1.5, 0.25, -0.1875, 1.5, 0.4375, -0.0625},
|
||||
}
|
||||
}
|
||||
|
||||
minetest.register_node("my_garage_door:garage_door", {
|
||||
description = "Garage Door",
|
||||
tiles = {
|
||||
@ -15,26 +28,18 @@ minetest.register_node("my_garage_door:garage_door", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, -0.5, -0.125, 1.5, 0.5, -0.0625},
|
||||
{-1.5, -0.5, -0.1875, 1.5, -0.3125, -0.0625},
|
||||
{-1.5, -0.25, -0.1875, 1.5, -0.0624999, -0.0625},
|
||||
{-1.5, 0, -0.1875, 1.5, 0.1875, -0.0625},
|
||||
{-1.5, 0.25, -0.1875, 1.5, 0.4375, -0.0625},
|
||||
}
|
||||
},
|
||||
node_box = table.copy(nodebox_closed),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, -0.5, -0.1875, 1.5, 1.5, -0.0625},
|
||||
}
|
||||
},
|
||||
on_rotate = rotate_disallow,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos1 = pointed_thing.above
|
||||
local pos2 = vector.add(pos1, {x=0,y=1,z=0})
|
||||
|
||||
|
||||
if not placer or not placer:is_player() then
|
||||
return
|
||||
end
|
||||
@ -75,12 +80,12 @@ minetest.register_node("my_garage_door:garage_door", {
|
||||
|
||||
local t1 = vector.add(above, dir)
|
||||
local t2 = vector.add(t1, dir)
|
||||
|
||||
|
||||
if not player or not player:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
if buildable_to(t1) or
|
||||
if not buildable_to(t1) or
|
||||
not buildable_to(t2) then
|
||||
minetest.chat_send_player(player:get_player_name(), "Not enough room to open")
|
||||
return
|
||||
@ -113,18 +118,22 @@ minetest.register_node("my_garage_door:garage_door_top", {
|
||||
diggable = false,
|
||||
pointable = false,
|
||||
groups = {cracky=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, -0.5, -0.125, 1.5, 0.5, -0.0625},
|
||||
{-1.5, -0.5, -0.1875, 1.5, -0.3125, -0.0625},
|
||||
{-1.5, -0.25, -0.1875, 1.5, -0.0624999, -0.0625},
|
||||
{-1.5, 0, -0.1875, 1.5, 0.1875, -0.0625},
|
||||
{-1.5, 0.25, -0.1875, 1.5, 0.4375, -0.0625},
|
||||
}
|
||||
},
|
||||
node_box = table.copy(nodebox_closed),
|
||||
selection_box = {type = "fixed",fixed = {{0, 0, 0, 0, 0, 0},}},
|
||||
on_rotate = rotate_disallow,
|
||||
})
|
||||
|
||||
local nodebox_open = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, 0.4375, -0.5, 1.5, 0.375, 0.5},
|
||||
{-1.5, 0.375, 0.3125, 1.5, 0.5, 0.5},
|
||||
{-1.5, 0.375, 0.0625, 1.5, 0.5, 0.25},
|
||||
{-1.5, 0.375, -0.1875, 1.5, 0.5, 0},
|
||||
{-1.5, 0.375, -0.4375, 1.5, 0.5, -0.25},
|
||||
}
|
||||
}
|
||||
|
||||
minetest.register_node("my_garage_door:garage_door_open", {
|
||||
tiles = {
|
||||
"default_snow.png"
|
||||
@ -135,25 +144,16 @@ minetest.register_node("my_garage_door:garage_door_open", {
|
||||
drop = "my_garage_door:garage_door",
|
||||
diggable = false,
|
||||
groups = {cracky=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, 0.4375, -0.5, 1.5, 0.375, 0.5},
|
||||
{-1.5, 0.375, 0.3125, 1.5, 0.5, 0.5},
|
||||
{-1.5, 0.375, 0.0625, 1.5, 0.5, 0.25},
|
||||
{-1.5, 0.375, -0.1875, 1.5, 0.5, 0},
|
||||
{-1.5, 0.375, -0.4375, 1.5, 0.5, -0.25},
|
||||
}
|
||||
},
|
||||
node_box = table.copy(nodebox_open),
|
||||
selection_box = {type = "fixed",fixed = {{-1.5, 0.375, -0.5, 1.5, 0.5, 1.5},}},
|
||||
|
||||
on_rotate = rotate_disallow,
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local p2 = node.param2
|
||||
local dir = minetest.facedir_to_dir((p2+2)%4)
|
||||
|
||||
local t1 = vector.add(pos, dir)
|
||||
local t2 = vector.subtract(t1, {x=0,y=1,z=0})
|
||||
|
||||
|
||||
if not player or not player:is_player() then
|
||||
return
|
||||
end
|
||||
@ -193,16 +193,19 @@ minetest.register_node("my_garage_door:garage_door_open2", {
|
||||
diggable = false,
|
||||
pointable = false,
|
||||
groups = {cracky=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, 0.4375, -0.5, 1.5, 0.375, 0.5},
|
||||
{-1.5, 0.375, 0.3125, 1.5, 0.5, 0.5},
|
||||
{-1.5, 0.375, 0.0625, 1.5, 0.5, 0.25},
|
||||
{-1.5, 0.375, -0.1875, 1.5, 0.5, 0},
|
||||
{-1.5, 0.375, -0.4375, 1.5, 0.5, -0.25},
|
||||
}
|
||||
},
|
||||
node_box = table.copy(nodebox_open),
|
||||
selection_box = {type = "fixed",fixed = {{0, 0, 0, 0, 0, 0},}},
|
||||
|
||||
on_rotate = rotate_disallow,
|
||||
})
|
||||
|
||||
-- craft
|
||||
if minetest.get_modpath("basic_materials") then
|
||||
minetest.register_craft({
|
||||
output = "my_garage_door:garage_door",
|
||||
recipe = {
|
||||
{"basic_materials:steel_bar", "", "basic_materials:steel_bar"},
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet"},
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet"}
|
||||
}
|
||||
})
|
||||
end
|
@ -1,2 +1,3 @@
|
||||
name = my_garage_door
|
||||
description = A garage door.
|
||||
description = A garage door.
|
||||
optional_depends = basic_materials, screwdriver
|
||||
|
@ -11,11 +11,11 @@ local hdoor_list = { --Number , Description , default image
|
||||
}
|
||||
|
||||
local function add_door(img, desc)
|
||||
-- Cannot add locked doors because the tooltip defies the purpose of being a hidden door
|
||||
doors.register_door("my_hidden_doors:hidden_door"..img, {
|
||||
description = desc.." Locked",
|
||||
description = desc,
|
||||
inventory_image = "mydoors_"..img.."_inv.png",
|
||||
groups = {choppy=2,cracky=2,door=1},
|
||||
only_placer_can_open = false,
|
||||
tiles = {{ name = "mydoors_"..img..".png", backface_culling = true }},
|
||||
protected = false,
|
||||
})
|
||||
@ -27,7 +27,7 @@ for _,hdoor in ipairs(hdoor_list) do
|
||||
end
|
||||
|
||||
doors.register_door("my_hidden_doors:hidden_door_grey", {
|
||||
description = "Grey Door Locked",
|
||||
description = "Grey Door",
|
||||
inventory_image = "mydoors_grey_inv.png",
|
||||
groups = {choppy=2,cracky=2,door=1},
|
||||
tiles = {{ name = "mydoors_grey.png", backface_culling = true }},
|
||||
|
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 654 B |
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 767 B |
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 646 B |
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 538 B |