From a2e06543a17965435d85e35100166391f89c2e30 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 18 Feb 2017 18:19:43 +0100 Subject: [PATCH] Texturize cocoas and set cocoa boxes --- mods/ITEMS/mcl_cocoas/init.lua | 85 ++++++++++++++++-- .../textures/mcl_cocoas_cocoa_top_stage_2.png | Bin 0 -> 592 bytes 2 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 mods/ITEMS/mcl_cocoas/textures/mcl_cocoas_cocoa_top_stage_2.png diff --git a/mods/ITEMS/mcl_cocoas/init.lua b/mods/ITEMS/mcl_cocoas/init.lua index 15b8ce818a..be14c64e37 100644 --- a/mods/ITEMS/mcl_cocoas/init.lua +++ b/mods/ITEMS/mcl_cocoas/init.lua @@ -46,15 +46,36 @@ end -- Cocoa definition local crop_def = { - drawtype = "plantlike", - tiles = {"mcl_cocoas_cocoa_stage_0.png"}, + description = "Cocoa (Stage 0)", + drawtype = "nodebox", + tiles = { + "[combine:32x32:12,2=mcl_cocoas_cocoa_stage_0.png", "[combine:32x32:12,22=mcl_cocoas_cocoa_stage_0.png", + "mcl_cocoas_cocoa_stage_0.png", "mcl_cocoas_cocoa_stage_0.png^[transformFX", + "[combine:32x32:-10,0=mcl_cocoas_cocoa_stage_0.png", "[combine:32x32:-10,0=mcl_cocoas_cocoa_stage_0.png", + }, paramtype = "light", paramtype2 = "facedir", walkable = true, 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 = { + type = "fixed", + fixed = { + {-0.125, -0.0625, 0.1875, 0.125, 0.25, 0.4375}, -- Pod + }, + }, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + fixed = { + {-0.125, -0.0625, 0.1875, 0.125, 0.5, 0.5}, -- Pod + }, }, groups = { choppy=3, not_in_creative_inventory=1, dig_by_water = 1, @@ -65,12 +86,62 @@ local crop_def = { -- stage 1 minetest.register_node("mcl_cocoas:cocoa_1", table.copy(crop_def)) --- stage2 -crop_def.tiles = {"mcl_cocoas_cocoa_stage_1.png"} +crop_def.description = "Cocoa (Stage 1)" +crop_def.tiles = { + "[combine:32x32:10,2=mcl_cocoas_cocoa_stage_1.png", "[combine:32x32:10,18=mcl_cocoas_cocoa_stage_1.png", + "mcl_cocoas_cocoa_stage_1.png", "mcl_cocoas_cocoa_stage_1.png^[transformFX", + "[combine:32x32:-8,0=mcl_cocoas_cocoa_stage_1.png", "[combine:32x32:-8,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 = { + type = "fixed", + fixed = { + {-0.1875, -0.1875, 0.0625, 0.1875, 0.25, 0.4375}, -- Pod + }, +} +crop_def.selection_box = { + type = "fixed", + fixed = { + {-0.1875, -0.1875, 0.0625, 0.1875, 0.5, 0.5}, + }, +} + minetest.register_node("mcl_cocoas:cocoa_2", table.copy(crop_def)) --- stage 3 (final) -crop_def.tiles = {"mcl_cocoas_cocoa_stage_2.png"} +-- stage 2 (final) +crop_def.description = "Cocoa (Stage 2)" +crop_def.tiles = { + -- The following 2 textures were derived from the original because the size of the top/bottom is slightly different :-( + -- 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:32x32:-6,0=mcl_cocoas_cocoa_stage_2.png", "[combine:32x32:-6,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 = { + type = "fixed", + fixed = { + {-0.25, -0.3125, -0.0625, 0.25, 0.25, 0.4375}, -- Pod + }, +} +crop_def.selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.3125, -0.0625, 0.25, 0.5, 0.5}, + }, +} crop_def.drop = "mcl_dye:brown 3", minetest.register_node("mcl_cocoas:cocoa_3", table.copy(crop_def)) diff --git a/mods/ITEMS/mcl_cocoas/textures/mcl_cocoas_cocoa_top_stage_2.png b/mods/ITEMS/mcl_cocoas/textures/mcl_cocoas_cocoa_top_stage_2.png new file mode 100644 index 0000000000000000000000000000000000000000..b64aad1d481c8b2429600eb935c2b075f0930caf GIT binary patch literal 592 zcmV-W0Px%3Q0skR9M69mETK~Q5eU)-QMNaJ98vmWT@|Yjk#qj6#FqXMx;~>k?2B9WSf>w zhC@NO<;8>`mtH6s{Q+IYnuEeYc+pK;dE;NuKl1II2hPbC!7g^L#`}fO_4jkmd3a7s zi=F>u;<5wNh7<9ChQ)ptk-O(6vco#DG1N*d1zkka)bO&)iI~rUh6Q-}X4Gq;IM#-8 zqKo)4bCuYRUc}po$HH{CvvC1_a$dR@^GUwW_Yn2908v}Mj>C8-_Q!My7l`+2Y6V0w z=lhb0^6MZzCwoaiNC*)wkP5k)KwxFagW`A_eyjv6<%gL8oP12+_s(-EQO}q}HE|6) zY$o_%HY|`I(NUi3A%S}KCULsF_U;+MC4>OyV5U=zz?)Go2^?=ms92P9{*=~;U+*Uf zEsBOj06(}eDY6Nl-Hwn=7=Wi3=(qR%f&A~zt)kQyXllQq1bDH41o{;Sq}etrjOtdRIzGI(g3`Q!5?eYYw*9uA z`q;v1mvDh8Q^98x>u_Mo@5F4M_K#bPI~tZBc(DG^i!58aIX0{tgRPQuz@_FpwqwVR e9XocKK7RpimLq?R0L6s>00002od@K literal 0 HcmV?d00001