mirror of
https://gitlab.com/lunovox/computing.git
synced 2025-03-21 17:11:25 +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()
|
modComputing.getTextNowDate = function()
|
||||||
local totalDays = core.get_day_count()
|
local totalDays = core.get_day_count()
|
||||||
local nowMount = (math.floor(totalDays/28)%4)+1
|
local nowMonth = (math.floor(totalDays/28)%4)+1
|
||||||
local txtMounts3S = {
|
local txtMonths3S = {
|
||||||
modComputing.translate("SPR"),
|
modComputing.translate("SPR"),
|
||||||
modComputing.translate("SUM"),
|
modComputing.translate("SUM"),
|
||||||
modComputing.translate("AUT"),
|
modComputing.translate("AUT"),
|
||||||
modComputing.translate("WIN"),
|
modComputing.translate("WIN"),
|
||||||
} --SPRING, SUMMER, AUTUMN, WINTER
|
} --SPRING, SUMMER, AUTUMN, WINTER
|
||||||
local nowDay = math.floor(totalDays%28)+1
|
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(
|
local nowDate = modComputing.translate(
|
||||||
"@1-@2",
|
"@1-@2",
|
||||||
("%3s"):format(txtMounts3S[nowMount]),
|
("%3s"):format(txtMonths3S[nowMonth]),
|
||||||
("%02d"):format(nowDay)
|
("%02d"):format(nowDay)
|
||||||
)
|
)
|
||||||
--:format((nowYear+1), txtMounts3S[nowMount], nowDay)
|
--:format((nowYear+1), txtMonths3S[nowMonth], nowDay)
|
||||||
return nowDate
|
return nowDate
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -138,25 +138,37 @@ core.register_craftitem("computing:smartphone", {
|
||||||
end,
|
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
|
if modComputing.is_allow_smartphone_recipe() then
|
||||||
core.register_craft({
|
if not minetest.get_modpath("components") then
|
||||||
output = 'computing:smartphone',
|
core.register_craft({
|
||||||
recipe = {
|
output = 'computing:smartphone',
|
||||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:book"},
|
recipe = {
|
||||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:mese_crystal"},
|
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:book"},
|
||||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"keys:skeleton_key"},
|
{"default:obsidian_glass" ,"default:obsidian_glass" ,"default:mese_crystal"},
|
||||||
}
|
{"default:obsidian_glass" ,"default:obsidian_glass" ,"keys:skeleton_key"},
|
||||||
})
|
}
|
||||||
else
|
})
|
||||||
core.register_craft({
|
else
|
||||||
output = 'computing:smartphone',
|
core.register_craft({
|
||||||
recipe = {
|
output = 'computing:smartphone',
|
||||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:speaker"},
|
recipe = {
|
||||||
{"default:obsidian_glass" ,"components:touch_screen" ,"components:computer"},
|
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:speaker"},
|
||||||
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:power_cell"},
|
{"default:obsidian_glass" ,"components:touch_screen" ,"components:computer"},
|
||||||
}
|
{"default:obsidian_glass" ,"default:obsidian_glass" ,"components:power_cell"},
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--[[ ]]
|
--[[ ]]
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
# COMPUTING SETTINGS
|
# COMPUTING SETTINGS
|
||||||
|
|
||||||
# COMPUTING DEBUG:
|
# 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
|
# Default: false
|
||||||
computing.debug (Show Computing Debug) bool 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