@ -1,3 +1,4 @@
|
|||||||
default
|
default
|
||||||
metals
|
metals
|
||||||
instruments
|
instruments
|
||||||
|
hatches
|
||||||
|
@ -26,7 +26,7 @@ function realtest.register_anvil_recipe(RecipeDef)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Unshaped metals, buckets, double ingots, sheets, hammers and locks
|
--Unshaped metals, buckets, double ingots, sheets, hammers, locks and hatches
|
||||||
for i, metal in ipairs(metals.list) do
|
for i, metal in ipairs(metals.list) do
|
||||||
realtest.register_anvil_recipe({
|
realtest.register_anvil_recipe({
|
||||||
item1 = "metals:"..metal.."_unshaped",
|
item1 = "metals:"..metal.."_unshaped",
|
||||||
@ -77,6 +77,13 @@ for i, metal in ipairs(metals.list) do
|
|||||||
output = "metals:"..metal.."_lock",
|
output = "metals:"..metal.."_lock",
|
||||||
level = metals.levels[i]
|
level = metals.levels[i]
|
||||||
})
|
})
|
||||||
|
realtest.register_anvil_recipe({
|
||||||
|
item1 = "metals:"..metal.."_ingot",
|
||||||
|
item2 = "scribing_table:plan_hatch",
|
||||||
|
rmitem2 = false,
|
||||||
|
output = "hatches:"..metal.."_hatch_closed",
|
||||||
|
level = metals.levels[i]
|
||||||
|
})
|
||||||
realtest.register_anvil_recipe({
|
realtest.register_anvil_recipe({
|
||||||
item1 = "minerals:borax",
|
item1 = "minerals:borax",
|
||||||
output = "minerals:flux 8"
|
output = "minerals:flux 8"
|
||||||
|
4
mods/hatches/depends.txt
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
default
|
||||||
|
metals
|
||||||
|
trees
|
||||||
|
joiner_table
|
130
mods/hatches/init.lua
Executable file
@ -0,0 +1,130 @@
|
|||||||
|
hatches = {}
|
||||||
|
|
||||||
|
function hatches.register_hatch(name, desc, is_wooden)
|
||||||
|
|
||||||
|
local on_hatch_clicked = function(pos, node, puncher, itemstack)
|
||||||
|
if node.name == "hatches:"..name.."_hatch_opened_top" then
|
||||||
|
minetest.env:add_node(pos, {name = "hatches:"..name.."_hatch_closed", param2 = node.param2})
|
||||||
|
elseif (node.name == "hatches:"..name.."_hatch_opened_bottom") and
|
||||||
|
(minetest.env:get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air") then
|
||||||
|
minetest.env:add_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "hatches:"..name.."_hatch_closed", param2 = node.param2})
|
||||||
|
minetest.env:remove_node(pos)
|
||||||
|
elseif node.name == "hatches:"..name.."_hatch_closed" then
|
||||||
|
if (minetest.env:get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name == "air") and (puncher:getpos().y + 1 >= pos.y) then
|
||||||
|
minetest.env:add_node({x = pos.x, y = pos.y - 1, z = pos.z}, {name = "hatches:"..name.."_hatch_opened_bottom",
|
||||||
|
param2 = node.param2})
|
||||||
|
minetest.env:remove_node(pos)
|
||||||
|
else
|
||||||
|
minetest.env:add_node(pos, {name = "hatches:"..name.."_hatch_opened_top", param2 = node.param2})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("hatches:"..name.."_hatch_opened_top", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tile_images = {"hatches_"..name.."_hatch.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = true,
|
||||||
|
climbable = true,
|
||||||
|
groups = {choppy=2, dig_immediate=2},
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, -0.3, 0.3, -0.4},
|
||||||
|
{-0.5, 0.3, -0.5, 0.3, 0.5, -0.4},
|
||||||
|
{0.3, -0.3, -0.5, 0.5, 0.5, -0.4},
|
||||||
|
{0.5, -0.5, -0.5, -0.3, -0.3, -0.4},
|
||||||
|
{-0.075, -0.3, -0.5, 0.075, 0.3, -0.4},
|
||||||
|
{-0.3, -0.075, -0.5, -0.075, 0.075, -0.4},
|
||||||
|
{0.075, -0.075, -0.5, 0.3, 0.075, -0.4},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, -0.4},
|
||||||
|
},
|
||||||
|
drop = "hatches:"..name.."_hatch_closed",
|
||||||
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
|
on_hatch_clicked(pos, node, clicker, itemstack)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hatches:"..name.."_hatch_closed", {
|
||||||
|
description = desc.." Hatch",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tile_images = {"hatches_"..name.."_hatch.png"},
|
||||||
|
inventory_image = "hatches_"..name.."_hatch.png",
|
||||||
|
wield_image = "hatches_"..name.."_hatch.png",
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = {choppy=2, dig_immediate=2},
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.55, -0.5, -0.3, -0.45, 0.3},
|
||||||
|
{-0.5, -0.55, 0.3, 0.3, -0.45, 0.5},
|
||||||
|
{0.3, -0.55, -0.3, 0.5, -0.45, 0.5},
|
||||||
|
{0.5, -0.55, -0.5, -0.3, -0.45, -0.3},
|
||||||
|
{-0.075, -0.55, -0.3, 0.075, -0.45, 0.3},
|
||||||
|
{-0.3, -0.55, -0.075, -0.075, -0.45, 0.075},
|
||||||
|
{0.075, -0.55, -0.075, 0.3, -0.45, 0.075},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.55, -0.5, 0.5, -0.45, 0.5},
|
||||||
|
},
|
||||||
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
|
on_hatch_clicked(pos, node, clicker, itemstack)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hatches:"..name.."_hatch_opened_bottom", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tile_images = {"hatches_"..name.."_hatch.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = true,
|
||||||
|
climbable = true,
|
||||||
|
groups = {choppy=2, dig_immediate=2},
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, -0.3, 0.3, -0.4},
|
||||||
|
{-0.5, 0.3, -0.5, 0.3, 0.5, -0.4},
|
||||||
|
{0.3, -0.3, -0.5, 0.5, 0.5, -0.4},
|
||||||
|
{0.5, -0.5, -0.5, -0.3, -0.3, -0.4},
|
||||||
|
{-0.075, -0.3, -0.5, 0.075, 0.3, -0.4},
|
||||||
|
{-0.3, -0.075, -0.5, -0.075, 0.075, -0.4},
|
||||||
|
{0.075, -0.075, -0.5, 0.3, 0.075, -0.4},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, -0.4},
|
||||||
|
},
|
||||||
|
drop = "hatches:"..name.."_hatch_closed",
|
||||||
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
|
on_hatch_clicked(pos, node, clicker, itemstack)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
if is_wooden then
|
||||||
|
realtest.register_joiner_table_recipe({
|
||||||
|
item1 = "trees:"..name.."_planks",
|
||||||
|
output = "hatches:"..name.."_hatch_closed 2"
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
for i, metal_name in ipairs(metals.list) do
|
||||||
|
hatches.register_hatch(metal_name, metals.desc_list[i], false)
|
||||||
|
end
|
||||||
|
|
||||||
|
for i, tree_name in ipairs(realtest.registered_trees_list) do
|
||||||
|
local tree_desc = realtest.registered_trees[tree_name].description
|
||||||
|
hatches.register_hatch(tree_name:remove_modname_prefix(), tree_desc, true)
|
||||||
|
end
|
BIN
mods/hatches/textures/hatches_albata_hatch.png
Executable file
After Width: | Height: | Size: 603 B |
BIN
mods/hatches/textures/hatches_aluminium_hatch.png
Normal file
After Width: | Height: | Size: 453 B |
BIN
mods/hatches/textures/hatches_ash_hatch.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
mods/hatches/textures/hatches_aspen_hatch.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
mods/hatches/textures/hatches_birch_hatch.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
mods/hatches/textures/hatches_bismuth_bronze_hatch.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
mods/hatches/textures/hatches_bismuth_hatch.png
Normal file
After Width: | Height: | Size: 549 B |
BIN
mods/hatches/textures/hatches_black_bronze_hatch.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
mods/hatches/textures/hatches_black_steel_hatch.png
Normal file
After Width: | Height: | Size: 483 B |
BIN
mods/hatches/textures/hatches_brass_hatch.png
Normal file
After Width: | Height: | Size: 531 B |
BIN
mods/hatches/textures/hatches_bronze_hatch.png
Normal file
After Width: | Height: | Size: 528 B |
BIN
mods/hatches/textures/hatches_chestnut_hatch.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
mods/hatches/textures/hatches_copper_hatch.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
mods/hatches/textures/hatches_german_silver_hatch.png
Executable file
After Width: | Height: | Size: 603 B |
BIN
mods/hatches/textures/hatches_gold_hatch.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
mods/hatches/textures/hatches_lead_hatch.png
Normal file
After Width: | Height: | Size: 502 B |
BIN
mods/hatches/textures/hatches_maple_hatch.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
mods/hatches/textures/hatches_nickel_hatch.png
Normal file
After Width: | Height: | Size: 521 B |
BIN
mods/hatches/textures/hatches_pig_iron_hatch.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
mods/hatches/textures/hatches_pine_hatch.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
mods/hatches/textures/hatches_platinum_hatch.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
mods/hatches/textures/hatches_rose_gold_hatch.png
Normal file
After Width: | Height: | Size: 523 B |
BIN
mods/hatches/textures/hatches_sequoia_hatch.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
mods/hatches/textures/hatches_silver_hatch.png
Normal file
After Width: | Height: | Size: 508 B |
BIN
mods/hatches/textures/hatches_steel_hatch.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
mods/hatches/textures/hatches_sterling_silver_hatch.png
Normal file
After Width: | Height: | Size: 531 B |
BIN
mods/hatches/textures/hatches_tin_hatch.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
mods/hatches/textures/hatches_wrought_iron_hatch.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
mods/hatches/textures/hatches_zinc_hatch.png
Normal file
After Width: | Height: | Size: 480 B |
@ -117,6 +117,15 @@ realtest.register_instrument_plan("scribing_table:stonebricks", {
|
|||||||
1,1,1,1,1,}
|
1,1,1,1,1,}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
realtest.register_instrument_plan("scribing_table:plan_hatch", {
|
||||||
|
description = "Hatch Plan",
|
||||||
|
bitmap = {1,1,1,1,1,
|
||||||
|
1,0,1,0,1,
|
||||||
|
1,1,1,1,1,
|
||||||
|
1,0,1,0,1,
|
||||||
|
1,1,1,1,1,}
|
||||||
|
})
|
||||||
|
|
||||||
local function check_recipe(pos)
|
local function check_recipe(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|