[antum (mp)] Update to Git commit d989ed2:
https://github.com/AntumDeluge/mtmp-antum/tree/d989ed2master
parent
70ae3b92da
commit
ca9f1896ff
|
@ -19,7 +19,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
|||
* [privs][] ([CC0][lic.cc0])
|
||||
* [spectator_mode][] ([WTFPL][lic.spectator_mode]) -- version: [7d68bec Git][ver.spectator_mode] *2017-03-30*
|
||||
* [awards][] ([LGPL][lic.lgpl2.1]) -- version: [096fe16 Git][ver.awards] *2017-02-25* ([patched][patch.awards])
|
||||
* [antum][] ([MIT][lic.antum]) -- version: [703f700 Git][ver.antum] *2017-06-17*
|
||||
* [antum][] ([MIT][lic.antum]) -- version: [d989ed2 Git][ver.antum] *2017-06-20*
|
||||
* buildings/
|
||||
* [bridges][] ([GPL][lic.gpl3.0]) -- version: [5b5f475 Git][ver.bridges] *2015-08-23* ([patched][patch.bridges])
|
||||
* [christmas][] ([MIT][lic.christmas]) -- version [d3bd872 Git][ver.christmas] *2013-01-11* ([patched][patch.christmas])
|
||||
|
@ -406,7 +406,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
|||
[ver.airtanks]: https://github.com/minetest-mods/airtanks/tree/5787956
|
||||
[ver.animalmaterials]: https://github.com/sapier/animalmaterials/tree/aa4697c
|
||||
[ver.animals]: https://github.com/sapier/animals_modpack/tree/b9d0172
|
||||
[ver.antum]: https://github.com/AntumDeluge/mtmp-antum/tree/703f700
|
||||
[ver.antum]: https://github.com/AntumDeluge/mtmp-antum/tree/d989ed2
|
||||
[ver.areas]: https://github.com/ShadowNinja/areas/tree/289d0e6
|
||||
[ver.awards]: https://github.com/minetest-mods/awards/tree/096fe16
|
||||
[ver.away]: https://github.com/kahrl/minetest-mod-away/tree/4c1e5a9
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
## Antum API
|
||||
|
||||
|
||||
--
|
||||
|
||||
### Available functions
|
||||
|
||||
- antum.log(level, message)
|
||||
-
|
|
@ -61,9 +61,26 @@ function antum.getCurrentModPath()
|
|||
end
|
||||
|
||||
|
||||
-- Loads a mod sub-script
|
||||
function antum.loadScript(script_name)
|
||||
local script = antum.getCurrentModPath() .. '/' .. script_name .. '.lua'
|
||||
--[[
|
||||
Loads a mod sub-script.
|
||||
|
||||
@param script_name
|
||||
Name or base name of the script file
|
||||
@param lua_ext
|
||||
type: bool
|
||||
default: true
|
||||
description: If 'true', appends '.lua' extension to script filename
|
||||
]]--
|
||||
function antum.loadScript(script_name, lua_ext)
|
||||
-- Default 'true'
|
||||
if lua_ext == nil then
|
||||
lua_ext = true
|
||||
end
|
||||
|
||||
local script = antum.getCurrentModPath() .. '/' .. script_name
|
||||
if lua_ext then
|
||||
script = script .. '.lua'
|
||||
end
|
||||
|
||||
if antum.fileExists(script) then
|
||||
dofile(script)
|
||||
|
@ -155,3 +172,92 @@ function antum.dependsSatisfied(depends)
|
|||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
Retrieves an item from registered items using name string.
|
||||
|
||||
@param item_name
|
||||
Item name string to search for
|
||||
@return
|
||||
Item object with name matching 'item_name' parameter
|
||||
]]
|
||||
function antum.getItem(item_name)
|
||||
for index in pairs(minetest.registered_items) do
|
||||
if minetest.registered_items[index].name == item_name then
|
||||
return minetest.registered_items[index]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
Retrieves a list of items containing a string.
|
||||
|
||||
@param substring
|
||||
String to match within item names
|
||||
@param case_sensitive
|
||||
If 'true', 'substring' case must match that of item name
|
||||
@return
|
||||
List of item names matching 'substring'
|
||||
]]--
|
||||
function antum.getItemNames(substring, case_sensitive)
|
||||
antum.logAction('Checking registered items for "' .. substring .. '" in item name ...')
|
||||
|
||||
-- Convert to lowercase
|
||||
if not case_sensitive then
|
||||
substring = string.lower(substring)
|
||||
end
|
||||
|
||||
local item_names = {}
|
||||
|
||||
for index in pairs(minetest.registered_items) do
|
||||
local item_name = minetest.registered_items[index].name
|
||||
if not case_sensitive then
|
||||
item_name = string.lower(item_name)
|
||||
end
|
||||
|
||||
-- Check item name for substring
|
||||
if string.find(item_name, substring) then
|
||||
table.insert(item_names, item_name)
|
||||
end
|
||||
end
|
||||
|
||||
return item_names
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
Un-registers an item & converts its name to an alias.
|
||||
|
||||
@param item_name
|
||||
Name of the item to override
|
||||
@param alias_of
|
||||
Name of the item to be aliased
|
||||
]]
|
||||
function antum.convertItemToAlias(item_name, alias_of)
|
||||
antum.logAction('Overridding "' .. item_name .. '" with "' .. alias_of .. '"')
|
||||
minetest.unregister_item(item_name)
|
||||
minetest.register_alias(item_name, alias_of)
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
Changes object description.
|
||||
|
||||
@param item_name
|
||||
Name of item to be altered
|
||||
@param description
|
||||
New string description value
|
||||
]]
|
||||
function antum.overrideItemDescription(item_name, description)
|
||||
-- Original item definition
|
||||
local item = antum.getItem(item_name)
|
||||
-- Change description
|
||||
item.description = description
|
||||
|
||||
-- Unregister original item
|
||||
minetest.unregister_item(item.name)
|
||||
|
||||
minetest.register_craftitem(':' .. item.name, item)
|
||||
end
|
|
@ -3,3 +3,5 @@ craft_guide?
|
|||
farming?
|
||||
vessels?
|
||||
wool?
|
||||
mobs_animal?
|
||||
animalmaterials?
|
||||
|
|
|
@ -35,12 +35,16 @@ if minetest.settings:get_bool('log_mods') then
|
|||
end
|
||||
|
||||
|
||||
-- Load API functions first
|
||||
dofile(antum.modpath .. '/api.lua')
|
||||
|
||||
|
||||
-- Other scripts to load
|
||||
local scripts = {
|
||||
'functions',
|
||||
'items',
|
||||
'crafting',
|
||||
}
|
||||
|
||||
for I in pairs(scripts) do
|
||||
dofile(antum.modpath .. '/' .. scripts[I] .. '.lua')
|
||||
for index, script_name in pairs(scripts) do
|
||||
antum.loadScript(script_name)
|
||||
end
|
||||
|
|
|
@ -25,6 +25,26 @@
|
|||
--]]
|
||||
|
||||
|
||||
-- Feather
|
||||
|
||||
--[[
|
||||
The following mods have 'feather' items & should be added as soft dependencies to be overridden:
|
||||
- mobs_animal
|
||||
- animalmaterials
|
||||
]]
|
||||
|
||||
local feathers = antum.getItemNames('feather')
|
||||
for index, feather in ipairs(feathers) do
|
||||
antum.convertItemToAlias(feather, 'antum:feather')
|
||||
end
|
||||
|
||||
minetest.register_craftitem(':antum:feather', {
|
||||
description = 'Feather',
|
||||
inventory_image = 'antum_feather_white.png',
|
||||
})
|
||||
minetest.register_alias('antum:feather_white', 'antum:feather')
|
||||
|
||||
|
||||
local depends_satisfied = true
|
||||
|
||||
local depends = {
|
||||
|
@ -39,7 +59,7 @@ for I in pairs(depends) do
|
|||
end
|
||||
|
||||
|
||||
minetest.register_craftitem('antum:bottled_water', {
|
||||
minetest.register_craftitem(':antum:bottled_water', {
|
||||
description = 'A bottle of water',
|
||||
inventory_image = 'bottled_water.png',
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = antum
|
||||
name = antum_core
|
||||
author = AntumDeluge
|
||||
description = Customizations related to the Antum game.
|
||||
license = MIT
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 490 B |
|
@ -1,4 +1,4 @@
|
|||
3d_armor
|
||||
antum
|
||||
antum_core
|
||||
default
|
||||
unifieddyes
|
|
@ -1 +1 @@
|
|||
antum
|
||||
antum_core
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
antum
|
||||
antum_core
|
||||
default
|
||||
dye
|
||||
craft_guide?
|
||||
moreblocks?
|
||||
moreblocks?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
antum
|
||||
antum_core
|
||||
default
|
||||
animalmaterials?
|
||||
bags?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
antum
|
||||
antum_core
|
||||
spawneggs
|
||||
animal_chicken?
|
||||
chicken?
|
||||
|
@ -7,4 +7,4 @@ mobs?
|
|||
mobs_monster?
|
||||
oerrki?
|
||||
sheep?
|
||||
wool?
|
||||
wool?
|
||||
|
|
Loading…
Reference in New Issue