mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-03-15 04:11:25 +00:00
Fixes
This commit is contained in:
parent
e4af546bdc
commit
712d1c7daa
2 changed files with 19 additions and 6 deletions
|
@ -200,7 +200,7 @@ minetest.register_on_mods_loaded(function()
|
|||
element_type = "label",
|
||||
center_text = true,
|
||||
font_size = 24,
|
||||
offset = {x = 0.5, y = 1.5},
|
||||
offset = {x = 1, y = 1.5},
|
||||
file = "animalia_libri_home.txt"
|
||||
},
|
||||
{
|
||||
|
@ -375,13 +375,13 @@ function libri.render_element(def, meta, playername)
|
|||
for line in file:lines() do
|
||||
i = i + 1
|
||||
local center_offset = 0
|
||||
local max_length = (def.max_line or 48)
|
||||
local max_length = 42
|
||||
local line_length = line:len()
|
||||
if line_length > max_length then line_length = max_length end
|
||||
local total_line_area = font_size * line_length
|
||||
local total_max_area = font_size * max_length
|
||||
if def.center_text
|
||||
and line_length < max_length then
|
||||
center_offset = ((total_max_area - total_line_area) / 100) * 0.25
|
||||
if def.center_text then
|
||||
center_offset = ((total_max_area - total_line_area) / 100) * 0.3
|
||||
end
|
||||
local line_unit = (max_length * 0.075)
|
||||
local align_x = (offset_x + line_unit - (line_unit * font_size_x)) + center_offset
|
||||
|
|
15
init.lua
15
init.lua
|
@ -97,4 +97,17 @@ minetest.register_on_mods_loaded(function()
|
|||
end
|
||||
end)
|
||||
|
||||
minetest.log("action", "[MOD] Animalia [0.3] loaded")
|
||||
local convert_mobs_redo = minetest.settings:get_bool("convert_redo_items", false)
|
||||
|
||||
if convert_mobs_redo then
|
||||
minetest.register_alias_force("mobs:leather", "animalia:leather")
|
||||
minetest.register_alias_force("mobs:meat_raw", "animalia:beef_raw")
|
||||
minetest.register_alias_force("mobs:meat", "animalia:beef_cooked")
|
||||
minetest.register_alias_force("mobs:lasso", "animalia:lasso")
|
||||
minetest.register_alias_force("mobs:net", "animalia:net")
|
||||
minetest.register_alias_force("mobs:shears", "animalia:shears")
|
||||
minetest.register_alias_force("mobs:saddles", "animalia:saddles")
|
||||
minetest.register_alias_force("mobs:nametag", "animalia:nametag")
|
||||
end
|
||||
|
||||
minetest.log("action", "[MOD] Animalia [0.4] loaded")
|
||||
|
|
Loading…
Add table
Reference in a new issue