[antum_overrides] Override craft recipes for 'bags', 'carts', &
'invisibility'.
This commit is contained in:
parent
966872be74
commit
df0686f6e7
@ -59,17 +59,21 @@ end
|
|||||||
local craftdir = antum.overrides.modpath .. '/crafting'
|
local craftdir = antum.overrides.modpath .. '/crafting'
|
||||||
|
|
||||||
local modoverrides = {
|
local modoverrides = {
|
||||||
|
'bags',
|
||||||
|
'carts',
|
||||||
'coloredwood',
|
'coloredwood',
|
||||||
'craftguide',
|
'craftguide',
|
||||||
'dye',
|
'dye',
|
||||||
'farming',
|
'farming',
|
||||||
'helicopter',
|
'helicopter',
|
||||||
'temp-removals',
|
'invisibility',
|
||||||
|
-- 'temp-removals',
|
||||||
}
|
}
|
||||||
|
|
||||||
for I in pairs(modoverrides) do
|
for I in pairs(modoverrides) do
|
||||||
local modname = modoverrides[I]
|
local modname = modoverrides[I]
|
||||||
if minetest.get_modpath(modname) then
|
if minetest.get_modpath(modname) then
|
||||||
|
antum.log_action(antum.overrides.modname, 'DEBUG: found mod \"' .. modname .. '\"')
|
||||||
dofile(craftdir .. '/' .. modname .. '.lua')
|
dofile(craftdir .. '/' .. modname .. '.lua')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
86
mods/antum/overrides/crafting/bags.lua
Normal file
86
mods/antum/overrides/crafting/bags.lua
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
--[[ LICENSE HEADER
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright © 2016 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 bags = {}
|
||||||
|
bags.depends = {
|
||||||
|
'animalmaterials',
|
||||||
|
}
|
||||||
|
bags.satisfied = true
|
||||||
|
|
||||||
|
for I in pairs(bags.depends) do
|
||||||
|
if not minetest.get_modpath(bags.depends[I]) then
|
||||||
|
bags.satisfied = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if bags.satisfied then
|
||||||
|
minetest.clear_craft({
|
||||||
|
recipe = {
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
{"default:wood", "default:wood", "default:wood"},
|
||||||
|
{"default:wood", "default:wood", "default:wood"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
minetest.clear_craft({
|
||||||
|
recipe = {
|
||||||
|
{"bags:small", "bags:small"},
|
||||||
|
{"bags:small", "bags:small"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
minetest.clear_craft({
|
||||||
|
recipe = {
|
||||||
|
{"bags:medium", "bags:medium"},
|
||||||
|
{"bags:medium", "bags:medium"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'bags:small',
|
||||||
|
recipe = {
|
||||||
|
{'', 'group:stick', '',},
|
||||||
|
{'animalmaterials:coat_cattle', 'animalmaterials:coat_cattle', 'animalmaterials:coat_cattle',},
|
||||||
|
{'animalmaterials:coat_cattle', 'animalmaterials:coat_cattle', 'animalmaterials:coat_cattle',},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'bags:medium',
|
||||||
|
recipe = {
|
||||||
|
{'bags:small', 'bags:small',},
|
||||||
|
{'bags:small', 'bags:small',},
|
||||||
|
{'bags:small', 'bags:small',},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'bags:large',
|
||||||
|
recipe = {
|
||||||
|
{'bags:medium', 'bags:medium',},
|
||||||
|
{'bags:medium', 'bags:medium',},
|
||||||
|
{'bags:medium', 'bags:medium',},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
47
mods/antum/overrides/crafting/carts.lua
Normal file
47
mods/antum/overrides/crafting/carts.lua
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
--[[ LICENSE HEADER
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright © 2016 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 = {
|
||||||
|
'default',
|
||||||
|
}
|
||||||
|
|
||||||
|
for I in pairs(depends) do
|
||||||
|
if not minetest.get_modpath(depends[I]) then
|
||||||
|
depends_satisfied = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if depends_satisfied then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'carts:powerrail',
|
||||||
|
type = 'shapeless',
|
||||||
|
recipe = {
|
||||||
|
'default:rail', 'default:mese_crystal_fragment',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
130
mods/antum/overrides/crafting/invisibility.lua
Normal file
130
mods/antum/overrides/crafting/invisibility.lua
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
--[[ LICENSE HEADER
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright © 2016 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
|
||||||
|
|
||||||
|
if depends_satisfied then
|
||||||
|
-- Override vessels:glass_bottle
|
||||||
|
--[[
|
||||||
|
minetest.override_item('vessesl:glass_bottle', {
|
||||||
|
description = 'Glass Bottle (empty)',
|
||||||
|
drawtype = 'plantlike',
|
||||||
|
tiles = {'vessels_glass_bottle.png'},
|
||||||
|
inventory_image = 'vessels_glass_bottle_inv.png',
|
||||||
|
wield_image = 'vessels_glass_bottle.png',
|
||||||
|
paramtype = 'light',
|
||||||
|
is_ground_content = false,
|
||||||
|
walkable = false,
|
||||||
|
selection_box = {
|
||||||
|
type = 'fixed',
|
||||||
|
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
|
||||||
|
},
|
||||||
|
groups = {vessel=1,dig_immediate=3,attached_node=1},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
-- Must be pointing to node
|
||||||
|
if pointed_thing.type ~= 'node' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- Check if pointing to a liquid source
|
||||||
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
|
local liquiddef = bucket.liquids[node.name]
|
||||||
|
local item_count = user:get_wielded_item():get_count()
|
||||||
|
|
||||||
|
if liquiddef ~= nil
|
||||||
|
and liquiddef.itemname ~= nil
|
||||||
|
and node.name == liquiddef.source then
|
||||||
|
if check_protection(pointed_thing.under,
|
||||||
|
user:get_player_name(),
|
||||||
|
'take '.. node.name) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- default set to return filled bottle
|
||||||
|
local giving_back = liquiddef.itemname
|
||||||
|
|
||||||
|
-- check if holding more than 1 empty bucket
|
||||||
|
if item_count > 1 then
|
||||||
|
|
||||||
|
-- if space in inventory add filled bucked, otherwise drop as item
|
||||||
|
local inv = user:get_inventory()
|
||||||
|
if inv:room_for_item('main', {name=liquiddef.itemname}) then
|
||||||
|
inv:add_item('main', liquiddef.itemname)
|
||||||
|
else
|
||||||
|
local pos = user:getpos()
|
||||||
|
pos.y = math.floor(pos.y + 0.5)
|
||||||
|
core.add_item(pos, liquiddef.itemname)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- set to return empty buckets minus 1
|
||||||
|
giving_back = 'vessels:glass_bottle '..tostring(item_count-1)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.add_node(pointed_thing.under, {name='air'})
|
||||||
|
|
||||||
|
return ItemStack(giving_back)
|
||||||
|
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',
|
||||||
|
type = 'shapeless',
|
||||||
|
recipe = {
|
||||||
|
'antum:bottled_water', 'default:mese_crystal_fragment',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
@ -1,19 +1,22 @@
|
|||||||
craft_guide?
|
|
||||||
craftguide?
|
|
||||||
antum
|
antum
|
||||||
default
|
default
|
||||||
animalmaterials?
|
animalmaterials?
|
||||||
|
bags?
|
||||||
|
carts?
|
||||||
coloredwood?
|
coloredwood?
|
||||||
dye?
|
dye?
|
||||||
ethereal?
|
ethereal?
|
||||||
farming?
|
farming?
|
||||||
flowers?
|
flowers?
|
||||||
helicopter?
|
helicopter?
|
||||||
homedecor?
|
invisibility?
|
||||||
kpgmobs?
|
kpgmobs?
|
||||||
moreblocks?
|
moreblocks?
|
||||||
simple_protection?
|
simple_protection?
|
||||||
stairsplus?
|
stairsplus?
|
||||||
unifieddyes?
|
unifieddyes?
|
||||||
|
vessels?
|
||||||
walking_light?
|
walking_light?
|
||||||
wool?
|
wool?
|
||||||
|
craftguide?
|
||||||
|
craft_guide?
|
||||||
|
@ -33,7 +33,7 @@ antum.overrides.modname = minetest.get_current_modname()
|
|||||||
antum.overrides.modpath = minetest.get_modpath(antum.overrides.modname)
|
antum.overrides.modpath = minetest.get_modpath(antum.overrides.modname)
|
||||||
|
|
||||||
local scripts = {
|
local scripts = {
|
||||||
'crafting', 'items', 'entities', 'misc', 'nodes',
|
'items', 'entities', 'misc', 'nodes', 'crafting',
|
||||||
}
|
}
|
||||||
|
|
||||||
for I in pairs(scripts) do
|
for I in pairs(scripts) do
|
||||||
|
BIN
mods/antum/overrides/textures/bottled_water.png
Normal file
BIN
mods/antum/overrides/textures/bottled_water.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 265 B |
Loading…
x
Reference in New Issue
Block a user