downgrade to minetest 5.4
parent
0e8c42ccc7
commit
ce0811c0c3
|
@ -0,0 +1,2 @@
|
|||
## Generic ignorable patterns and files
|
||||
user.conf
|
8
api.lua
8
api.lua
|
@ -10,6 +10,10 @@ local function is_srt_empty(s)
|
|||
return s == nil or s == ''
|
||||
end
|
||||
|
||||
local function round(x)
|
||||
return x>=0 and math.floor(x+0.5) or math.ceil(x-0.5)
|
||||
end
|
||||
|
||||
local function boolean_to_string(var)
|
||||
if var or var == 1 or var == "true" then
|
||||
return "true"
|
||||
|
@ -377,7 +381,7 @@ local function compose_formspec(self, player, msg)
|
|||
scroll_container[0.5,1.25;3,3;scroll_buy;vertical;]
|
||||
]]..items_loot..[[
|
||||
scroll_container_end[]
|
||||
scrollbaroptions[min=0;max=]]..tostring(math.round(items_count))
|
||||
scrollbaroptions[min=0;max=]]..tostring(round(items_count))
|
||||
..[[;smallstep=]]..items_count_str..[[;largestep=]]..items_count_str..[[]
|
||||
style_type[scroll_buy;bgcolor=#446699]
|
||||
scrollbar[3.5,1.25;0.5,3;vertical;scroll_buy;0]
|
||||
|
@ -385,7 +389,7 @@ local function compose_formspec(self, player, msg)
|
|||
scroll_container[4.25,1.25;3,3;scroll_basket;vertical;]
|
||||
]]..items_basket..[[
|
||||
scroll_container_end[]
|
||||
scrollbaroptions[min=0;max=]]..tostring(math.round(items_count))
|
||||
scrollbaroptions[min=0;max=]]..tostring(round(items_count))
|
||||
..[[;smallstep=]]..items_count_str..[[;largestep=]]..items_count_str..[[]
|
||||
scrollbar[7.25,1.25;0.5,3;vertical;scroll_basket;0]
|
||||
button_exit[5.125,5;1,1;btn_buy;]]..S("Buy")..[[]
|
||||
|
|
2
init.lua
2
init.lua
|
@ -20,5 +20,5 @@ if eraz.settings.spawn then
|
|||
end
|
||||
local user_file = modpath .. "/user.lua"
|
||||
if eraz.file_exists(user_file) then
|
||||
assert(loadfile(user_file))()
|
||||
assert(loadfile(user_file))(S)
|
||||
end
|
||||
|
|
|
@ -26,3 +26,4 @@ A new merchant has just arrived at=Un nuevo comerciante acaba de llegar a
|
|||
bringing=trayendo
|
||||
unknown stuff=cosas desconocidas
|
||||
basic food=comida básica
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
local S = ...
|
||||
|
||||
local function round(x)
|
||||
return x>=0 and math.floor(x+0.5) or math.ceil(x-0.5)
|
||||
end
|
||||
|
||||
--SPAWN
|
||||
|
||||
eraz.spawn = function(spawn_pos, limit_max_mobs, abr, liquidflag)
|
||||
|
@ -14,7 +18,7 @@ eraz.spawn = function(spawn_pos, limit_max_mobs, abr, liquidflag)
|
|||
local loot_description = eraz.loots[ent_ref.loot].description or S("unknown stuff")
|
||||
if eraz.settings.spawn_announce then
|
||||
minetest.chat_send_all(S("A new merchant has just arrived at")
|
||||
.." ("..tostring(math.round(spawn_pos.x))..", "..tostring(math.round(spawn_pos.z))
|
||||
.." ("..tostring(round(spawn_pos.x))..", "..tostring(round(spawn_pos.z))
|
||||
.."),".." "..S("bringing").." "..loot_description
|
||||
)
|
||||
end
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
local S = ...
|
||||
|
||||
eraz.register_loot("minerals", {
|
||||
description = S("some minerals"),
|
||||
type = "fixed",
|
||||
items = {
|
||||
iron = {
|
||||
name = "default:iron_lump",
|
||||
price = 10,
|
||||
amount = 25,
|
||||
},
|
||||
copper = {
|
||||
name = "default:copper_lump",
|
||||
price = 5,
|
||||
amount = 25,
|
||||
},
|
||||
bauxite = {
|
||||
name = "aloz:bauxite_lump",
|
||||
price = 7,
|
||||
amount = 25,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
eraz.register_loot("fruits", {
|
||||
description = S("some fruits"),
|
||||
type = "fixed",
|
||||
items = {
|
||||
apple = {
|
||||
name = "default:apple",
|
||||
price = 3,
|
||||
amount = 6,
|
||||
},
|
||||
cherries = {
|
||||
name = "cherrytree:cherries",
|
||||
price = 5,
|
||||
amount = 10,
|
||||
},
|
||||
lemon = {
|
||||
name = "lemontree:lemon",
|
||||
price = 2,
|
||||
amount = 12,
|
||||
},
|
||||
clementine = {
|
||||
name = "clementinetree:clementine",
|
||||
price = 4,
|
||||
amount = 8,
|
||||
},
|
||||
blueberries = {
|
||||
name = "default:blueberries",
|
||||
price = 5,
|
||||
amount = 15,
|
||||
},
|
||||
pineapple = {
|
||||
name = "pineapple:pineapple",
|
||||
price = 6,
|
||||
amount = 4,
|
||||
},
|
||||
pomegranate = {
|
||||
name = "pomegranate:pomegranate",
|
||||
price = 3,
|
||||
amount = 7,
|
||||
},
|
||||
plum= {
|
||||
name = "plumtree:plum",
|
||||
price = 2,
|
||||
amount = 8,
|
||||
},
|
||||
cacao_beans = {
|
||||
name = "cacaotree:cacao_beans",
|
||||
price = 10,
|
||||
amount = 30,
|
||||
},
|
||||
barberries = {
|
||||
name = "swaz:barberries",
|
||||
price = 1,
|
||||
amount = 20,
|
||||
},
|
||||
redcurrants = {
|
||||
name = "redw:redcurrants",
|
||||
price = 1,
|
||||
amount = 15,
|
||||
},
|
||||
acorn = {
|
||||
name = "oak:acorn",
|
||||
price = 2,
|
||||
amount = 25,
|
||||
},
|
||||
chestnut = {
|
||||
name = "chestnuttree:fruit",
|
||||
price = 3,
|
||||
amount = 25,
|
||||
},
|
||||
persimmon = {
|
||||
name = "ebony:persimmon",
|
||||
price = 5,
|
||||
amount = 7,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue