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 15b8ce81..be14c64e 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 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}jKx9jP7LeL$-HD>VB+$0 zaSVw#{C4Vn@5zA@$M@d7_w<@|u}W;piuYB$J5#kqejA#)EeYY7_`=C2W%e|`HfP7} zPmi`JOpnu$_{$i3bXM~r$BK)-(Up(mFW7&2JBR(;N%4bvW$TXpZax3?d-1u-3P11e zx&KohZDPLMCj7CX?P#6&#NE%;HXXLwXn4g-hc(va(v=UJPIt~Y-`K`l@iXm8_Ckwm zZAFW^e;5@{z0ntUWSt@71DKUSahDY&t#laVq?`ewZdI{zP*z?sM^BtJYiXI?}6EY`kXTPZYv_D z6#tuYtt0-uI)|R)_KDn+9qMi@c3UusYp&pm+@t42HPruRu@niKb6)uRJYV?!r9>f% zvj?37uDaS6PI-BFc}rvKZgG(_2Wri``uD6@+pcnTO5#L;r&BGRgCzF1+;n8EZr~RZ zzfpUs@6_tN&Iu3x#F%mh?z6txcqmy-AkU1EQQYFxoeBO*EEO9YSbm9eEV*f>-SaAJ zk(J$^9Zi?^Gzvvqsc!qbZQidNhq9&@G-?JPOc!}wkZ|h#k(~M8`lEZSrKZVOZ1{Jf zTPJ$ArP&(k=CzYb4lI3Uy)F58pR9G+EW3Kf+-b`7Jq$-%85kHCJYD@<);T3K0RScl B5&8fC literal 0 HcmV?d00001