mirror of
https://notabug.org/TenPlus1/bonemeal.git
synced 2024-08-21 14:04:11 +02:00
code tidy
This commit is contained in:
parent
1935d348c1
commit
2fdc3f09b7
4
init.lua
4
init.lua
@ -6,11 +6,9 @@ local min, max, random = math.min, math.max, math.random
|
|||||||
|
|
||||||
|
|
||||||
-- translation support
|
-- translation support
|
||||||
local S
|
local S = function(s) return s end -- default boilerplate function
|
||||||
if minetest.get_translator ~= nil then
|
if minetest.get_translator ~= nil then
|
||||||
S = minetest.get_translator("bonemeal") -- 5.x translation function
|
S = minetest.get_translator("bonemeal") -- 5.x translation function
|
||||||
else -- boilerplate function
|
|
||||||
S = function(s) return s end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
11
mods.lua
11
mods.lua
@ -183,8 +183,7 @@ end
|
|||||||
|
|
||||||
if minetest.get_modpath("dye") then
|
if minetest.get_modpath("dye") then
|
||||||
|
|
||||||
local bonemeal_dyes = {
|
local bonemeal_dyes = {bonemeal = "white", fertiliser = "green", mulch = "brown"}
|
||||||
bonemeal = "white", fertiliser = "green", mulch = "brown"}
|
|
||||||
|
|
||||||
for mat, dye in pairs(bonemeal_dyes) do
|
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)
|
local function mush_fix(pos)
|
||||||
minetest.set_node(pos, {name = "air"})
|
minetest.set_node(pos, {name = "air"})
|
||||||
mapgen_helper.place_schematic(pos,
|
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
|
end
|
||||||
|
|
||||||
local function fern_fix(pos)
|
local function fern_fix(pos)
|
||||||
minetest.set_node(pos, {name = "air"})
|
minetest.set_node(pos, {name = "air"})
|
||||||
local rotations = {0, 90, 180, 270}
|
local rotations = {0, 90, 180, 270}
|
||||||
mapgen_helper.place_schematic(pos,
|
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
|
end
|
||||||
|
|
||||||
local function blood_fix(pos)
|
local function blood_fix(pos)
|
||||||
@ -262,9 +261,9 @@ if minetest.get_modpath("df_primordial_items") then
|
|||||||
|
|
||||||
bonemeal:add_sapling({
|
bonemeal:add_sapling({
|
||||||
{"df_primordial_items:jungle_mushroom_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: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:mush_sapling", mush_fix, "soil", true},
|
||||||
{"df_primordial_items:fern_sapling", fern_fix, "soil", true},
|
{"df_primordial_items:fern_sapling", fern_fix, "soil", true},
|
||||||
{"df_trees:blood_thorn", blood_fix, "sand", true}
|
{"df_trees:blood_thorn", blood_fix, "sand", true}
|
||||||
|
Loading…
Reference in New Issue
Block a user