[antum] Modpack: Update to Git commit 4477d40:

https://github.com/AntumDeluge/mtmp-antum/tree/4477d40
This commit is contained in:
AntumDeluge 2017-05-03 20:07:21 -07:00
parent ee0d9aaef6
commit ce43be5a70
23 changed files with 75 additions and 68 deletions

View File

@ -144,7 +144,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* mob_shark ([CC BY-SA][lic.amp_shark])
* mob_slime ([CC0 / CC BY / CC BY-SA / CC0][lic.amp_slime])
* mob_warthog ([CC BY / CC BY-SA][lic.amp_warthog])
* [antum][] ([MIT][lic.antum]) -- version: [2f1e895 Git][ver.antum]
* [antum][] ([MIT][lic.antum]) -- version: [4477d40 Git][ver.antum]
* mp_antum/
* antum
* craft
@ -343,7 +343,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.3d_armor]: https://github.com/stujones11/minetest-3d_armor/tree/456c84e
[ver.adv_spawning]: https://github.com/sapier/adv_spawning/tree/ec41aa9
[ver.antum]: https://github.com/AntumDeluge/mtmp-antum/tree/2f1e895
[ver.antum]: https://github.com/AntumDeluge/mtmp-antum/tree/4477d40
[ver.areas]: https://github.com/ShadowNinja/areas/tree/67507c7
[ver.awards]: https://github.com/minetest-mods/awards/tree/92c43d1
[ver.bedrock2]: http://repo.or.cz/minetest_bedrock2.git/tree/0378b61

View File

@ -26,25 +26,28 @@
-- Displays a message in the log
function antum.log(level, mod, message)
minetest.log(level, '[' .. mod .. '] ' .. message)
function antum.log(level, message)
minetest.log(level, '[' .. minetest.get_current_modname() .. '] ' .. message)
end
function antum.log_action(mod, message)
antum.log('action', mod, message)
function antum.logAction(message)
antum.log('action', message)
end
function antum.log_warn(mod, message)
antum.log('warning', mod, message)
function antum.logWarn(message)
antum.log('warning', message)
end
function antum.logError(message)
antum.log('error', message)
end
-- Checks if a file exists
function antum.file_exists(file_path)
function antum.fileExists(file_path)
local fexists = io.open(file_path, 'r')
if fexists == nil then
minetest.log('error', '[' .. antum.modname .. '] Could not load script: ' .. file_path)
return false
end
@ -52,18 +55,34 @@ function antum.file_exists(file_path)
end
-- Retrieves path for currently loaded mod
function antum.getCurrentModPath()
return minetest.get_modpath(minetest.get_current_modname())
end
-- Loads a mod sub-script
function antum.load_script(mod_path, script_name)
local script = mod_path .. '/' .. script_name .. '.lua'
function antum.loadScript(script_name)
local script = antum.getCurrentModPath() .. '/' .. script_name .. '.lua'
if antum.file_exists(script) then
if antum.fileExists(script) then
dofile(script)
else
antum.logError('Could not load, script does not exists: ' .. script)
end
end
-- Loads multiple mod sub-scripts
function antum.loadScripts(script_list)
for I in pairs(script_list) do
antum.loadScript(script_list[I])
end
end
-- Registers a craft & displays a log message
function antum.register_craft(craft)
antum.log_action(minetest.get_current_modname(), 'Registering craft recipe for "' .. craft.output .. '"')
function antum.registerCraft(craft)
antum.logAction('Registering craft recipe for "' .. craft.output .. '"')
minetest.register_craft(craft)
end

View File

@ -46,7 +46,7 @@ minetest.register_craftitem('antum:bottled_water', {
if depends_satisfied then
antum.register_craft({
antum.registerCraft({
output = 'antum:bottled_water',
type = 'shapeless',
recipe = {
@ -57,5 +57,5 @@ if depends_satisfied then
},
})
else
antum.log_warn(antum.modname, 'Not registering craft for "' .. antum.modname .. ':bottled_water", dependency not satisfied')
antum.logWarn(antum.modname, 'Not registering craft for "' .. antum.modname .. ':bottled_water", dependency not satisfied')
end

View File

@ -26,7 +26,7 @@
-- Nyan cat blocks
antum.register_craft({
antum.registerCraft({
output = "default:nyancat_rainbow",
recipe = {
{'', 'dye:red', '',},
@ -37,7 +37,7 @@ antum.register_craft({
-- Walking light items
antum.register_craft({
antum.registerCraft({
output = 'walking_light:helmet_gold',
recipe = {
{'default:torch'},

View File

@ -38,5 +38,5 @@ local scripts = {
}
for I in pairs(scripts) do
antum.load_script(antum.craft.modpath, scripts[I])
antum.loadScript(scripts[I])
end

View File

@ -30,13 +30,8 @@ antum.entities.modname = minetest.get_current_modname()
antum.entities.modpath = minetest.get_modpath(antum.entities.modname)
local function logAction(message)
minetest.log('action', '[' .. antum.entities.modname .. '] ' .. message)
end
-- Loading entity definitions
logAction('Loading entity definitions ...')
antum.logAction('Loading entity definitions ...')
antum.def = {}
local defs = {
@ -44,16 +39,16 @@ local defs = {
}
for I in pairs(defs) do
dofile(antum.entities.modpath .. '/definitions/' .. defs[I] .. '.lua')
antum.loadScript('definitions/' .. defs[I])
end
-- Loading entity types
logAction('Loading entity types ...')
antum.logAction('Loading entity types ...')
local types = {
'hostile', 'peaceful', 'npc',
}
for I in pairs(types) do
dofile(antum.entities.modpath .. '/types/' .. types[I] .. '.lua')
antum.loadScript('types/' .. types[I])
end

View File

@ -28,7 +28,7 @@
for I in pairs(antum.glass.colors) do
local color = antum.glass.colors[I]
antum.register_craft({
antum.registerCraft({
output = 'glass:' .. color,
type = 'shapeless',
recipe = {'default:glass', 'dye:' .. color},

View File

@ -32,5 +32,7 @@ antum.glass.modpath = minetest.get_modpath(antum.glass.modname)
antum.glass.colors = {'blue', 'green', 'red', 'violet'}
dofile(antum.glass.modpath .. '/nodes.lua')
dofile(antum.glass.modpath .. '/crafting.lua')
antum.loadScripts({
'nodes',
'crafting',
})

View File

@ -30,9 +30,7 @@ local function registerGroupAliases(group)
local source = group[I][1]
local alias = group[I][2]
-- DEBUG
antum.log_action(antum.glass.modname,
'Registering alias: ' .. alias .. ' -> ' .. source
)
antum.logAction('Registering alias: ' .. alias .. ' -> ' .. source)
minetest.register_alias(alias, source)
end
end

View File

@ -26,7 +26,7 @@
antum.clearCraftOutput = function(o)
antum.log_action(antum.overrides.modname, 'Clearing craft by output: ' .. o)
antum.logAction('Clearing craft by output: ' .. o)
minetest.clear_craft({
output = o
})
@ -50,14 +50,12 @@ antum.clearCraftRecipe = function(r)
end
antum.log_action(antum.overrides.modname, ' Clearing craft by recipe: ' .. recipe_string)
antum.logAction(' Clearing craft by recipe: ' .. recipe_string)
minetest.clear_craft({
recipe = {r}
})
end
local craftdir = antum.overrides.modpath .. '/crafting'
local modoverrides = {
'bags',
'carts',
@ -73,7 +71,7 @@ local modoverrides = {
for I in pairs(modoverrides) do
local modname = modoverrides[I]
if minetest.get_modpath(modname) then
antum.log_action(antum.overrides.modname, 'DEBUG: found mod \"' .. modname .. '\"')
dofile(craftdir .. '/' .. modname .. '.lua')
antum.logAction('DEBUG: found mod \"' .. modname .. '\"')
antum.loadScript('crafting/' .. modname)
end
end

View File

@ -59,7 +59,7 @@ if bags.satisfied then
},
})
antum.register_craft({
antum.registerCraft({
output = 'bags:small',
recipe = {
{'', 'group:stick', '',},
@ -67,7 +67,7 @@ if bags.satisfied then
{'group:fur', 'group:fur', 'group:fur',},
}
})
antum.register_craft({
antum.registerCraft({
output = 'bags:medium',
recipe = {
{'bags:small', 'bags:small',},
@ -75,7 +75,7 @@ if bags.satisfied then
{'bags:small', 'bags:small',},
}
})
antum.register_craft({
antum.registerCraft({
output = 'bags:large',
recipe = {
{'bags:medium', 'bags:medium',},

View File

@ -37,7 +37,7 @@ for I in pairs(depends) do
end
if depends_satisfied then
antum.register_craft({
antum.registerCraft({
output = 'carts:powerrail',
type = 'shapeless',
recipe = {

View File

@ -32,7 +32,7 @@ local registerCWoodCraft = function(color)
return
end
antum.register_craft({
antum.registerCraft({
type = 'shapeless',
output = 'coloredwood:wood_' .. color,
recipe = {

View File

@ -44,7 +44,7 @@ if depends.satisfied then
--minetest.register_alias("craftguide", "xdecor:crafting_guide") -- Alias already taken by "craft_guide:sign_wall"
if minetest.get_modpath(depends.craft_guide) then
antum.register_craft({
antum.registerCraft({
type = "shapeless",
output = "craftguide:craftguide",
recipe = {

View File

@ -38,7 +38,7 @@ end
if cotton.dependencies.satisfied then
-- Craft cotton from white wool
antum.register_craft({
antum.registerCraft({
output = "farming:cotton 4",
type = "shapeless",
recipe = {"wool:white"},

View File

@ -27,7 +27,7 @@
antum.clearCraftOutput("helicopter:cabin")
antum.register_craft({
antum.registerCraft({
output = 'helicopter:cabin',
recipe = {
{'', 'group:wood', ''},

View File

@ -106,7 +106,7 @@ if depends_satisfied then
})--]]
antum.register_craft({
antum.registerCraft({
output = 'invisibility:potion',
type = 'shapeless',
recipe = {

View File

@ -32,10 +32,11 @@ antum.overrides = {}
antum.overrides.modname = minetest.get_current_modname()
antum.overrides.modpath = minetest.get_modpath(antum.overrides.modname)
local scripts = {
'items', 'entities', 'misc', 'nodes', 'crafting',
}
for I in pairs(scripts) do
dofile(antum.overrides.modpath .. '/' .. scripts[I] .. '.lua')
end
--local scripts = {
antum.loadScripts({
'items',
'entities',
'misc',
'nodes',
'crafting',
})

View File

@ -25,8 +25,6 @@
--]]
local itemsdir = antum.overrides.modpath .. '/items'
local modoverrides = {
'animalmaterials',
'cooking',
@ -38,6 +36,6 @@ local modoverrides = {
for I in pairs(modoverrides) do
local modname = modoverrides[I]
if minetest.get_modpath(modname) then
dofile(itemsdir .. '/' .. modname .. '.lua')
antum.loadScript('items/' .. modname)
end
end

View File

@ -25,8 +25,6 @@
--]]
local miscdir = antum.overrides.modpath .. "/misc"
local modoverrides = {
"walking_light",
}
@ -34,6 +32,6 @@ local modoverrides = {
for I in pairs(modoverrides) do
local modname = modoverrides[I]
if minetest.get_modpath(modname) then
dofile(miscdir .. "/" .. modname .. ".lua")
antum.loadScript('misc/' .. modname)
end
end

View File

@ -25,8 +25,6 @@
--]]
local nodedir = antum.overrides.modpath .. '/nodes'
local modoverrides = {
'ethereal',
}
@ -34,6 +32,6 @@ local modoverrides = {
for I in pairs(modoverrides) do
local modname = modoverrides[I]
if minetest.get_modpath(modname) then
dofile(nodedir .. '/' .. modname .. '.lua')
antum.loadScript('nodes/' .. modname)
end
end

View File

@ -57,7 +57,7 @@ antum.spawneggs.addEgg = function(name, spawn, ingredients)
antum.spawneggs.addEggRecipe(name, spawn, ingredients)
-- DEBUG
antum.log_action(antum.spawneggs.modname, 'Registered spawnegg for ' .. spawn)
antum.logAction('Registered spawnegg for ' .. spawn)
end

View File

@ -30,4 +30,4 @@ antum.spawneggs = {}
antum.spawneggs.modname = minetest.get_current_modname()
antum.spawneggs.modpath = minetest.get_modpath(antum.spawneggs.modname)
dofile(antum.spawneggs.modpath .. '/eggs.lua')
antum.loadScript('eggs')