improved texture naming options to eliminate duplicate textures
...removed duplicate texturesmaster
3
api.lua
|
@ -375,11 +375,12 @@ farming_super.register_plant = function(name, def)
|
|||
|
||||
local dropname = "p"..tierCount.."s"..tierStep.."t"..tier
|
||||
local drops = def_drops[dropname] or def.default_drop
|
||||
local tex = def.textures[dropname] or (mname.."_"..pname.."_"..tierCount.."_"..tierStep.."_"..tier..".png")
|
||||
|
||||
minetest.register_node(name, {
|
||||
drawtype = "plantlike",
|
||||
waving = false,
|
||||
tiles = {mname .. "_" .. pname .. "_"..step.."_"..tier..".png"},
|
||||
tiles = {tex},
|
||||
paramtype = "light",
|
||||
paramtype2 = def.paramtype2 or nil,
|
||||
place_param2 = def.place_param2 or nil,
|
||||
|
|
16
init.lua
|
@ -7,6 +7,7 @@ dofile(modpath.."/api.lua")
|
|||
|
||||
|
||||
-- todo: pests
|
||||
-- todo: nutrient depletion
|
||||
|
||||
|
||||
|
||||
|
@ -55,6 +56,21 @@ farming_super.register_plant("farming_super:corn", {
|
|||
p4s2t2 = corndrop, -- phase 4, step 2, tier 2
|
||||
p4s2t3 = corndrop,
|
||||
},
|
||||
textures = { -- overrides default texture naming, allowing reuse
|
||||
p2s1t2 = "farming_super_corn_1_2_1.png",
|
||||
|
||||
p3s1t1 = "farming_super_corn_2_1_1.png",
|
||||
p3s1t2 = "farming_super_corn_2_1_1.png",
|
||||
p3s1t3 = "farming_super_corn_1_2_1.png",
|
||||
|
||||
p4s1t1 = "farming_super_corn_2_1_1.png",
|
||||
p4s1t2 = "farming_super_corn_2_1_1.png",
|
||||
p4s1t3 = "farming_super_corn_2_1_1.png",
|
||||
p4s1t4 = "farming_super_corn_1_2_1.png",
|
||||
|
||||
p4s2t1 = "farming_super_corn_2_1_1.png",
|
||||
p4s2t3 = "farming_super_corn_4_2_2.png",
|
||||
},
|
||||
minlight = 13,
|
||||
maxlight = 15,
|
||||
fertility = {"grassland"},
|
||||
|
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 355 B |
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 355 B |