mirror of
https://gitlab.com/lunovox/computing.git
synced 2025-03-15 06:31:22 +00:00
This commit is contained in:
parent
a874600de1
commit
1d1e2c274e
3 changed files with 44 additions and 24 deletions
10
api.lua
10
api.lua
|
@ -203,21 +203,21 @@ end
|
|||
|
||||
modComputing.getTextNowDate = function()
|
||||
local totalDays = core.get_day_count()
|
||||
local nowMount = (math.floor(totalDays/28)%4)+1
|
||||
local txtMounts3S = {
|
||||
local nowMonth = (math.floor(totalDays/28)%4)+1
|
||||
local txtMonths3S = {
|
||||
modComputing.translate("SPR"),
|
||||
modComputing.translate("SUM"),
|
||||
modComputing.translate("AUT"),
|
||||
modComputing.translate("WIN"),
|
||||
} --SPRING, SUMMER, AUTUMN, WINTER
|
||||
local nowDay = math.floor(totalDays%28)+1
|
||||
--local nowDate = ("%04d-%3s-%02d"):format((nowYear+1), txtMounts3S[nowMount], nowDay)
|
||||
--local nowDate = ("%04d-%3s-%02d"):format((nowYear+1), txtMonths3S[nowMonth], nowDay)
|
||||
local nowDate = modComputing.translate(
|
||||
"@1-@2",
|
||||
("%3s"):format(txtMounts3S[nowMount]),
|
||||
("%3s"):format(txtMonths3S[nowMonth]),
|
||||
("%02d"):format(nowDay)
|
||||
)
|
||||
--:format((nowYear+1), txtMounts3S[nowMount], nowDay)
|
||||
--:format((nowYear+1), txtMonths3S[nowMonth], nowDay)
|
||||
return nowDate
|
||||
end
|
||||
|
||||
|
|
|
@ -138,25 +138,37 @@ core.register_craftitem("computing:smartphone", {
|
|||
end,
|
||||
})
|
||||
|
||||
modComputing.is_allow_smartphone_recipe = function(player)
|
||||
if type(modComputing.strSmartphoneRecipe)~="boolean" then
|
||||
modComputing.strSmartphoneRecipe = core.settings:get(modComputing.modname..".smartphone_recipe")
|
||||
modComputing.strSmartphoneRecipe = type(modComputing.strSmartphoneRecipe)~="string" or (type(modComputing.strSmartphoneRecipe)=="string" and modComputing.strSmartphoneRecipe:lower() ~= "false")
|
||||
--core.settings:set_bool(modComputing.modname..".smartphone_recipe", modComputing.strSmartphoneRecipe)
|
||||
--core.settings:write()
|
||||
end
|
||||
return modComputing.strSmartphoneRecipe
|
||||
end
|
||||
|
||||
--[[ ]]
|
||||
if not minetest.get_modpath("components") then
|
||||
core.register_craft({
|
||||
output = 'computing:smartphone',
|
||||
recipe = {
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:book"},
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:mese_crystal"},
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"keys:skeleton_key"},
|
||||
}
|
||||
})
|
||||
else
|
||||
core.register_craft({
|
||||
output = 'computing:smartphone',
|
||||
recipe = {
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:speaker"},
|
||||
{"default:obsidian_glass" ,"components:touch_screen" ,"components:computer"},
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:power_cell"},
|
||||
}
|
||||
})
|
||||
if modComputing.is_allow_smartphone_recipe() then
|
||||
if not minetest.get_modpath("components") then
|
||||
core.register_craft({
|
||||
output = 'computing:smartphone',
|
||||
recipe = {
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:book"},
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:mese_crystal"},
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"keys:skeleton_key"},
|
||||
}
|
||||
})
|
||||
else
|
||||
core.register_craft({
|
||||
output = 'computing:smartphone',
|
||||
recipe = {
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:speaker"},
|
||||
{"default:obsidian_glass" ,"components:touch_screen" ,"components:computer"},
|
||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:power_cell"},
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
--[[ ]]
|
||||
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
# COMPUTING SETTINGS
|
||||
|
||||
# COMPUTING DEBUG:
|
||||
# Allows you to print the debug information of this mod on the screen.
|
||||
# Allows you to print the debug information
|
||||
# of this mod on the screen. Feature used
|
||||
# only by developers.
|
||||
# Default: false
|
||||
computing.debug (Show Computing Debug) bool false
|
||||
|
||||
# SMARTPHONE RECIPE:
|
||||
# Allows the smartphone to be crafted via
|
||||
# recipe by normal players.
|
||||
# Default: true
|
||||
computing.smartphone_recipe (Smatphone Recipe) bool true
|
||||
|
|
Loading…
Add table
Reference in a new issue