code tidy

This commit is contained in:
tenplus1 2023-03-10 14:46:38 +00:00
parent 1935d348c1
commit 2fdc3f09b7
2 changed files with 6 additions and 9 deletions

View File

@ -6,11 +6,9 @@ local min, max, random = math.min, math.max, math.random
-- translation support
local S
local S = function(s) return s end -- default boilerplate function
if minetest.get_translator ~= nil then
S = minetest.get_translator("bonemeal") -- 5.x translation function
else -- boilerplate function
S = function(s) return s end
end

View File

@ -183,8 +183,7 @@ end
if minetest.get_modpath("dye") then
local bonemeal_dyes = {
bonemeal = "white", fertiliser = "green", mulch = "brown"}
local bonemeal_dyes = {bonemeal = "white", fertiliser = "green", mulch = "brown"}
for mat, dye in pairs(bonemeal_dyes) do
@ -246,14 +245,14 @@ if minetest.get_modpath("df_primordial_items") then
local function mush_fix(pos)
minetest.set_node(pos, {name = "air"})
mapgen_helper.place_schematic(pos,
df_primordial_items.get_primordial_mushroom(), (math.random(1,4)-1)*90)
df_primordial_items.get_primordial_mushroom(), (math.random(4) - 1) * 90)
end
local function fern_fix(pos)
minetest.set_node(pos, {name = "air"})
local rotations = {0, 90, 180, 270}
mapgen_helper.place_schematic(pos,
df_primordial_items.get_fern_schematic(), rotations[math.random(1,#rotations)])
df_primordial_items.get_fern_schematic(), rotations[math.random(#rotations)])
end
local function blood_fix(pos)
@ -262,9 +261,9 @@ if minetest.get_modpath("df_primordial_items") then
bonemeal:add_sapling({
{"df_primordial_items:jungle_mushroom_sapling",
df_primordial_items.spawn_jungle_mushroom, "soil", true},
df_primordial_items.spawn_jungle_mushroom, "soil", true},
{"df_primordial_items:jungletree_sapling",
df_primordial_items.spawn_jungle_tree, "soil", true},
df_primordial_items.spawn_jungle_tree, "soil", true},
{"df_primordial_items:mush_sapling", mush_fix, "soil", true},
{"df_primordial_items:fern_sapling", fern_fix, "soil", true},
{"df_trees:blood_thorn", blood_fix, "sand", true}