Move 'bottled_water' item from 'overrides' to 'antum' mod
This commit is contained in:
parent
2f27d7dd84
commit
0374670579
3
antum/depends.txt
Normal file
3
antum/depends.txt
Normal file
@ -0,0 +1,3 @@
|
||||
bucket?
|
||||
craft_guide?
|
||||
vessels?
|
@ -30,4 +30,11 @@ antum.modname = minetest.get_current_modname()
|
||||
antum.modpath = minetest.get_modpath(antum.modname)
|
||||
|
||||
|
||||
dofile(antum.modpath .. '/' .. 'functions.lua')
|
||||
local scripts = {
|
||||
'functions',
|
||||
'items',
|
||||
}
|
||||
|
||||
for I in pairs(scripts) do
|
||||
dofile(antum.modpath .. '/' .. scripts[I] .. '.lua')
|
||||
end
|
||||
|
63
antum/items.lua
Normal file
63
antum/items.lua
Normal file
@ -0,0 +1,63 @@
|
||||
--[[ LICENSE HEADER
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright © 2017 Jordan Irwin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--]]
|
||||
|
||||
|
||||
local depends_satisfied = true
|
||||
|
||||
local depends = {
|
||||
'bucket',
|
||||
'vessels',
|
||||
}
|
||||
|
||||
for I in pairs(depends) do
|
||||
if not minetest.get_modpath(depends[I]) then
|
||||
depends_satisfied = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
minetest.register_craftitem('antum:bottled_water', {
|
||||
description = 'A bottle of water',
|
||||
inventory_image = 'bottled_water.png',
|
||||
})
|
||||
|
||||
|
||||
if depends_satisfied then
|
||||
antum.log_action(antum.modname, 'Registering craft "' .. antum.modname .. ':bottled_water"')
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'antum:bottled_water',
|
||||
type = 'shapeless',
|
||||
recipe = {
|
||||
'bucket:bucket_water', 'vessels:glass_bottle',
|
||||
},
|
||||
replacements = {
|
||||
{'bucket:bucket_water', 'bucket:bucket_empty'},
|
||||
},
|
||||
})
|
||||
else
|
||||
antum.log_warn(antum.modname, 'Not registering craft for "' .. antum.modname .. ':bottled_water", dependency not satisfied')
|
||||
end
|
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
@ -28,7 +28,9 @@
|
||||
local depends_satisfied = true
|
||||
|
||||
local depends = {
|
||||
'antum',
|
||||
'bucket',
|
||||
'default',
|
||||
'vessels',
|
||||
}
|
||||
|
||||
@ -41,7 +43,7 @@ end
|
||||
if depends_satisfied then
|
||||
-- Override vessels:glass_bottle
|
||||
--[[
|
||||
minetest.override_item('vessesl:glass_bottle', {
|
||||
minetest.override_item('vessels:glass_bottle', {
|
||||
description = 'Glass Bottle (empty)',
|
||||
drawtype = 'plantlike',
|
||||
tiles = {'vessels_glass_bottle.png'},
|
||||
@ -102,23 +104,7 @@ if depends_satisfied then
|
||||
end
|
||||
end,
|
||||
})--]]
|
||||
|
||||
|
||||
minetest.register_craftitem(':antum:bottled_water', {
|
||||
description = 'A bottle of water',
|
||||
inventory_image = 'bottled_water.png',
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'antum:bottled_water',
|
||||
type = 'shapeless',
|
||||
recipe = {
|
||||
'bucket:bucket_water', 'vessels:glass_bottle',
|
||||
},
|
||||
replacements = {
|
||||
{"bucket:bucket_water", "bucket:bucket_empty"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'invisibility:potion',
|
||||
@ -127,4 +113,4 @@ if depends_satisfied then
|
||||
'antum:bottled_water', 'default:mese_crystal_fragment',
|
||||
},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user