Skip to content

Commit

Permalink
add "filling" craft type for unified_inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Jan 22, 2022
1 parent a75119f commit 356ffc2
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ read_globals = {
"VoxelArea",

-- Deps
"default", "monitoring", "advtrains"
"default", "monitoring", "advtrains",
"unified_inventory",
}
16 changes: 14 additions & 2 deletions airbottle.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@



minetest.register_craftitem("vacuum:air_bottle", {
description = "Air Bottle",
inventory_image = vacuum.air_bottle_image
})

if minetest.get_modpath("unified_inventory") then
unified_inventory.register_craft_type("filling", {
description = "Filling",
icon = "vacuum_airpump_front.png",
width = 1,
height = 1,
})
unified_inventory.register_craft({
type = "filling",
output = "vacuum:air_bottle",
items = {"vessels:steel_bottle"},
width = 0,
})
end
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = vacuum
description = Adds vacuum with propagation, air bottles, and an airpump for pumping out vacuum
depends = default, vessels
optional_depends = doors, wool, mesecons, pipeworks, monitoring, mesecons_random, technic, spacesuit, digilines, advtrains
optional_depends = doors, wool, mesecons, pipeworks, monitoring, mesecons_random, technic, spacesuit, digilines, advtrains, unified_inventory
50 changes: 39 additions & 11 deletions spacesuit.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@

-- spacesuit repair recipes
local function repair_recipe(partname)
minetest.register_craft({
type = "shapeless",
output = partname,
recipe = {
"vacuum:air_bottle",
partname
},
replacements = {
{"vacuum:air_bottle", "vessels:steel_bottle"}
}
})
minetest.register_craft({
type = "shapeless",
output = partname,
recipe = {
"vacuum:air_bottle",
partname
},
replacements = {
{"vacuum:air_bottle", "vessels:steel_bottle"}
}
})
end

repair_recipe("spacesuit:helmet")
repair_recipe("spacesuit:chestplate")
repair_recipe("spacesuit:pants")
repair_recipe("spacesuit:boots")

if minetest.get_modpath("unified_inventory") then
unified_inventory.register_craft({
type = "filling",
output = "spacesuit:helmet 1 1",
items = {"spacesuit:helmet 1 60000"},
width = 0,
})
unified_inventory.register_craft({
type = "filling",
output = "spacesuit:chestplate 1 1",
items = {"spacesuit:chestplate 1 60000"},
width = 0,
})
unified_inventory.register_craft({
type = "filling",
output = "spacesuit:pants 1 1",
items = {"spacesuit:pants 1 60000"},
width = 0,
})
unified_inventory.register_craft({
type = "filling",
output = "spacesuit:boots 1 1",
items = {"spacesuit:boots 1 60000"},
width = 0,
})
end

0 comments on commit 356ffc2

Please sign in to comment.