change the code

This commit is contained in:
FossFanatic 2022-11-16 13:38:44 +00:00
parent b11d65cc82
commit 78d45d23c2

View File

@ -66,32 +66,19 @@ end
-- Cocoa definition -- Cocoa definition
-- 1st stage -- 1st stage
--[[ TODO: Use a mesh for cocoas for perfect texture compability. ]]
local crop_def = { local crop_def = {
description = S("Premature Cocoa Pod"), description = S("Premature Cocoa Pod"),
_doc_items_create_entry = true, _doc_items_create_entry = true,
_doc_items_longdesc = S("Cocoa pods grow on the side of jungle trees in 3 stages."), _doc_items_longdesc = S("Cocoa pods grow on the side of jungle trees in 3 stages."),
drawtype = "nodebox", drawtype = "mesh",
tiles = { mesh = "mcl_cocoas_cocoa_stage_0.obj",
"[combine:16x16:6,1=mcl_cocoas_cocoa_stage_0.png", "[combine:16x16:6,11=mcl_cocoas_cocoa_stage_0.png", tiles = {"mcl_cocoas_cocoa_stage_0.png"},
"mcl_cocoas_cocoa_stage_0.png", "mcl_cocoas_cocoa_stage_0.png^[transformFX",
"[combine:16x16:-5,0=mcl_cocoas_cocoa_stage_0.png", "[combine:16x16:-5,0=mcl_cocoas_cocoa_stage_0.png",
},
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
paramtype2 = "facedir", paramtype2 = "facedir",
walkable = true, walkable = true,
drop = "mcl_dye:brown", drop = "mcl_dye:brown",
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.0625, 0.1875, 0.125, 0.25, 0.4375}, -- Pod
-- FIXME: This has a thickness of 0. Is this OK in Minetest?
{0, 0.25, 0.25, 0, 0.5, 0.5}, -- Stem
},
},
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -119,18 +106,8 @@ minetest.register_node("mcl_cocoas:cocoa_1", table.copy(crop_def))
crop_def.description = S("Medium Cocoa Pod") crop_def.description = S("Medium Cocoa Pod")
crop_def._doc_items_create_entry = false crop_def._doc_items_create_entry = false
crop_def.groups.cocoa = 2 crop_def.groups.cocoa = 2
crop_def.tiles = { crop_def.mesh = "mcl_cocoas_cocoa_stage_1.obj"
"[combine:16x16:5,1=mcl_cocoas_cocoa_stage_1.png", "[combine:16x16:5,9=mcl_cocoas_cocoa_stage_1.png", crop_def.tiles = {"mcl_cocoas_cocoa_stage_1.png"}
"mcl_cocoas_cocoa_stage_1.png", "mcl_cocoas_cocoa_stage_1.png^[transformFX",
"[combine:16x16:-4,0=mcl_cocoas_cocoa_stage_1.png", "[combine:16x16:-4,0=mcl_cocoas_cocoa_stage_1.png",
}
crop_def.node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.1875, 0.0625, 0.1875, 0.25, 0.4375}, -- Pod
{0, 0.25, 0.25, 0, 0.5, 0.5}, -- Stem
},
}
crop_def.collision_box = { crop_def.collision_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -151,20 +128,8 @@ crop_def.description = S("Mature Cocoa Pod")
crop_def._doc_items_longdesc = S("A mature cocoa pod grew on a jungle tree to its full size and it is ready to be harvested for cocoa beans. It won't grow any further.") crop_def._doc_items_longdesc = S("A mature cocoa pod grew on a jungle tree to its full size and it is ready to be harvested for cocoa beans. It won't grow any further.")
crop_def._doc_items_create_entry = true crop_def._doc_items_create_entry = true
crop_def.groups.cocoa = 3 crop_def.groups.cocoa = 3
crop_def.tiles = { crop_def.mesh = "mcl_cocoas_cocoa_stage_2.obj"
-- The following 2 textures were derived from the original because the size of the top/bottom is slightly different :-( crop_def.tiles = {"mcl_cocoas_cocoa_stage_2.png"}
-- TODO: Find a way to *only* use the base texture
"mcl_cocoas_cocoa_top_stage_2.png", "mcl_cocoas_cocoa_top_stage_2.png^[transformFY",
"mcl_cocoas_cocoa_stage_2.png", "mcl_cocoas_cocoa_stage_2.png^[transformFX",
"[combine:16x16:-3,0=mcl_cocoas_cocoa_stage_2.png", "[combine:16x16:-3,0=mcl_cocoas_cocoa_stage_2.png",
}
crop_def.node_box = {
type = "fixed",
fixed = {
{-0.25, -0.3125, -0.0625, 0.25, 0.25, 0.4375}, -- Pod
{0, 0.25, 0.25, 0, 0.5, 0.5}, -- Stem
},
}
crop_def.collision_box = { crop_def.collision_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -197,4 +162,3 @@ minetest.register_abm({
if minetest.get_modpath("doc") then if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_cocoas:cocoa_1", "nodes", "mcl_cocoas:cocoa_2") doc.add_entry_alias("nodes", "mcl_cocoas:cocoa_1", "nodes", "mcl_cocoas:cocoa_2")
end end