Skip to content

Commit

Permalink
Wooden: refactoring lottplants: rename "wild" file and restruct src…
Browse files Browse the repository at this point in the history
… files. Relates to #1238
  • Loading branch information
alek13 committed Feb 27, 2024
1 parent 635d097 commit 8218f99
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
16 changes: 12 additions & 4 deletions mods/lord/Blocks/lottplants/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
local mod_path = minetest.get_modpath(minetest.get_current_modname())
local old_require = require
require = function(name) return dofile(mod_path .. "/src/" .. name:gsub("%.", "/") .. ".lua") end


local S = minetest.get_translator("lottplants")

dofile(minetest.get_modpath("lottplants").."/nodes.lua")
dofile(minetest.get_modpath("lottplants").."/wild_food.lua")
dofile(minetest.get_modpath("lottplants").."/flowers.lua")
require("nodes")
require("wild_crops")
require("flowers")

-- ===== GROWING TIME =====
-- 67 11
Expand Down Expand Up @@ -66,7 +71,7 @@ WHICHA = 11
YAVINT = 67
YAVCHA = 11

dofile(minetest.get_modpath("lottplants").."/functions.lua")
require("functions")

minetest.register_node("lottplants:brambles_of_mordor", {
description = S("Brambles Of Mordor"),
Expand Down Expand Up @@ -161,3 +166,6 @@ minetest.register_craftitem("lottplants:honey", {
inventory_image = "lottplants_honey.png",
on_use = minetest.item_eat(1),
})


require = old_require
10 changes: 0 additions & 10 deletions mods/lord/Blocks/lottplants/license.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ default.register_leafdecay({
})

--- @type lottplants.Planks_API
_G.planks = dofile(minetest.get_modpath(minetest.get_current_modname()) .. '/planks.lua')
_G.planks = require('planks')

--Lorien grass

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 8218f99

Please sign in to comment.