From 758271a0698892edfeeebd07fd03aae2fab12526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Sat, 27 Apr 2024 18:40:40 +0700 Subject: [PATCH] Make more blocks have world-aligned textures --- mods/CORE/mcl_util/init.lua | 20 ++++++++++++++ mods/ITEMS/mcl_core/nodes_base.lua | 26 ++++++------------ settingtypes.txt | 10 +++---- textures/default_brick_world.png | Bin 0 -> 860 bytes textures/default_dirt_world.png | Bin 0 -> 754 bytes textures/default_leaves_world.png | Bin 0 -> 417 bytes textures/default_stone_brick_world.png | Bin 0 -> 874 bytes textures/default_stone_world.png | Bin 0 -> 1259 bytes textures/mcl_core_andesite_world.png | Bin 0 -> 425 bytes textures/mcl_core_diorite_world.png | Bin 0 -> 351 bytes textures/mcl_core_granite_world.png | Bin 0 -> 464 bytes ...png => mcl_core_grass_block_top_world.png} | Bin 12 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 textures/default_brick_world.png create mode 100644 textures/default_dirt_world.png create mode 100644 textures/default_leaves_world.png create mode 100644 textures/default_stone_brick_world.png create mode 100644 textures/default_stone_world.png create mode 100644 textures/mcl_core_andesite_world.png create mode 100644 textures/mcl_core_diorite_world.png create mode 100644 textures/mcl_core_granite_world.png rename textures/{mcl_core_grass_block_top_sheet.png => mcl_core_grass_block_top_world.png} (100%) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 477d05b4e..07091be66 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1099,3 +1099,23 @@ function mcl_util.is_it_christmas() return false end end + +-- Get tile (texture) for a block that supports world-alignment +local world_aligned = minetest.settings:get_bool("mcl_world_aligned_textures", false) +function mcl_util.get_texture(name, scale) + local nscale + if scale == nil then + nscale = 5 + else + nscale = scale + end + if world_aligned then + return { + name = name.."_world.png", + align_style = "world", + scale = nscale + } + else + return name..".png" + end +end diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 8ef247e15..16aac5964 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -12,17 +12,7 @@ else ice_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false end -local world_aligned_grass = minetest.settings:get_bool("mcl_world_aligned_grass_texture", false) -local grass_block_top_texture -if world_aligned_grass then - grass_block_top_texture = { - name = "mcl_core_grass_block_top_sheet.png", - align_style = "world", - scale = 5 - } -else - grass_block_top_texture = "mcl_core_grass_block_top.png" -end +local get_texture = mcl_util.get_texture mcl_core.fortune_drop_ore = { discrete_uniform_distribution = true, @@ -36,7 +26,7 @@ minetest.register_node("mcl_core:stone", { description = S("Stone"), _doc_items_longdesc = S("One of the most common blocks in the world, almost the entire underground consists of stone. It sometimes contains ores. Stone may be created when water meets lava."), _doc_items_hidden = false, - tiles = {"default_stone.png"}, + tiles = {get_texture("default_stone")}, is_ground_content = true, stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, @@ -246,7 +236,7 @@ minetest.register_node("mcl_core:stone_with_diamond", { minetest.register_node("mcl_core:stonebrick", { description = S("Stone Bricks"), _doc_items_longdesc = doc.sub.items.temp.build, - tiles = {"default_stone_brick.png"}, + tiles = {get_texture("default_stone_brick")}, stack_max = 64, groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), @@ -306,7 +296,7 @@ minetest.register_node("mcl_core:stone_smooth", { minetest.register_node("mcl_core:granite", { description = S("Granite"), _doc_items_longdesc = S("Granite is an igneous rock."), - tiles = {"mcl_core_granite.png"}, + tiles = {get_texture("mcl_core_granite", 3)}, is_ground_content = true, stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, @@ -330,7 +320,7 @@ minetest.register_node("mcl_core:granite_smooth", { minetest.register_node("mcl_core:andesite", { description = S("Andesite"), _doc_items_longdesc = S("Andesite is an igneous rock."), - tiles = {"mcl_core_andesite.png"}, + tiles = {get_texture("mcl_core_andesite", 3)}, is_ground_content = true, stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, @@ -354,7 +344,7 @@ minetest.register_node("mcl_core:andesite_smooth", { minetest.register_node("mcl_core:diorite", { description = S("Diorite"), _doc_items_longdesc = S("Diorite is an igneous rock."), - tiles = {"mcl_core_diorite.png"}, + tiles = {get_texture("mcl_core_diorite", 3)}, is_ground_content = true, stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, @@ -382,7 +372,7 @@ minetest.register_node("mcl_core:dirt_with_grass", { _doc_items_hidden = false, paramtype2 = "color", tiles = { - grass_block_top_texture, + get_texture("mcl_core_grass_block_top"), { name="default_dirt.png", color="white" }, { name="default_dirt.png^mcl_dirt_grass_shadow.png", color="white" } }, @@ -732,7 +722,7 @@ minetest.register_node("mcl_core:brick_block", { -- Original name: “Bricks” description = S("Brick Block"), _doc_items_longdesc = S("Brick blocks are a good building material for building solid houses and can take quite a punch."), - tiles = {"default_brick.png"}, + tiles = {get_texture("default_brick")}, is_ground_content = false, stack_max = 64, groups = {pickaxey=1, building_block=1, material_stone=1}, diff --git a/settingtypes.txt b/settingtypes.txt index 9f9fba99f..e2ed76f01 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -256,12 +256,12 @@ mcl_buckets_use_select_box (Buckets use select box) bool false # See also: https://github.com/minetest/minetest/issues/95 mcl_translucent_ice (Translucent ice) bool false -# Whether the top texture of grass blocks should be world-aligned. If enabled, -# grass top texture will be a sheet of 5x5 tiles with pre-defined "random" -# displacement and rotation, spanning across 5 blocks. +# Whether the textures should be world-aligned for variations. If enabled, +# some textures will be using sheets of 5x5 varied tiles with pre-defined +# "random" displacement and rotation, spanning across 5 blocks. # -# This might put some load on the GPU by making it work with a bigger texture. -mcl_world_aligned_grass_texture (World-aligned grass texture) bool false +# This might put some load on the GPU by making it work with bigger textures. +mcl_world_aligned_textures (World-aligned textures) bool false # Whether to generate fallen logs in some biomes. # They might not always look pretty and have strange overhangs. diff --git a/textures/default_brick_world.png b/textures/default_brick_world.png new file mode 100644 index 0000000000000000000000000000000000000000..427975048562bc4129dc8a943689386b96e4718f GIT binary patch literal 860 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r63?ysp-_HY5x&b~RuDNE01#b3LLH70bruBX< zt@)|#QO*Ky#cBRu7Yea5FfhIHba4#v=)601W4Dx} z$T53?olzbSvbtBdCJJof%28Ot(RNZxER#=!CtOCy=x7-G%C{mc*3MiHwYqh;*?-{o zDBcjurTxEc_VVA~4n-gLy=C(G?Dx3OGk$)wU9vLoc;`kx_0@AXh8_1zxin?!?+wv+ z{kAQ8Te7Lz=&eWj;}a#i+TR(kI{JQ{a{1ZW9m_*vw{9piyS_-i?(97C{+s$?iO%~H ztgPRh-6HG%*yQE;yA~H6cE4`8vXw1lx!sqq4}T{_ZT_Xz+xB_Z*0l$>%)KXliNBrQ zx%AcI%N$IXSMKzj@~VEd=GCa|rFTmFnip(bX7%;qu@h$f=cTVbzRP>;ROu1V{(BcT zMO7WHnzNxu_T;wb%NA_6%1pV_Qd)I*a?xGi4Q0(cH%9bIZ(bZ{x?cIrCW9r);Xo%H zxMA_nX7=0Pr?0LOzwF~_>$zs$+wb|FEB#9^=-2PO_y3*$H2-H>H_IMZ``Z7_{Ptnq zlwTq3nT~%sr1F1lKfCewty!C8)qlk*|M2jtU8Q`x<>tri;-%SQc}8LDnky&&@wDTX zQ>~wLzG=HqeUrZjUu{iOWisFSkDf8;v{TWG$HJ4G<>yb3`Sru4)0rR4VEKGZ#>;M| zw?Y1yg-<5$gmFOz9eQ;&udvbiTgR8XSs+@E{rL8?-ZIbRLS@8$&Tu(AvHx(g?e`69 zAKp3saO1q{71z!~L{>c7aN@WYUw6%#M;}b(wJmf$ZR|R%B;R@XZl2|*rz+I~?d7MB zo|r!QjiXH8Y;)y!zfJC09u$f{=`CC<+hW*!f&b3&qQ z?EiNjw=WKOmwV3tgv^xc*`I}t*q`2e_UF(3iYb;F-_4$@r|_NHd-f;i%;uu};<|sP a{rb)(U2nF15Pu2GE)1ToelF{r5}E)!i?jm( literal 0 HcmV?d00001 diff --git a/textures/default_dirt_world.png b/textures/default_dirt_world.png new file mode 100644 index 0000000000000000000000000000000000000000..a03037be359950ebb7b78ee99b65d1de1bd7f324 GIT binary patch literal 754 zcmVaA{q4UQ&c>T#1BtnSO6Yx?ynu00NRpL_t(Y$DNit#++- zZpGi){rNTIbI7nl9!+D4Kq!V;AY^G8R|pw+y5@(TRt3Hsmz)PewNGtptPJeDx%O89yf>f6MS-vYmuj6x_WwQG82gm~*IhYVF3e<|x~ppYpK1E2Z~?VHZ{ z@C~l!G|*2Z87HT0(F%3CULedtotzvw=gXK;D63T2T}p3+x>*^rP`Q7rI6o14*L%qMi4FfY{Y31Y8oB8w zsCS&7px$wQV)1VAaLZ3b-Yp((_=%N=jGtI}$oL8BA?GL79&Y=IyLWn@px$wQf_lgK z3F;l^C&Z)u7<+eS`f=rBw$qb{JREv(_Av5vAYu=z$iv9ffrvdUV-FKgZ=;W+carJH z*hjJS;6^`AK6<7X332!ELVA%9vu|?`&K^?Y?%~vfi-#$fetc*8@$Mt-MZO k-EHu_nC><>|LAW213cF$DT_Le(f|Me07*qoM6N<$g8uG-D*ylh literal 0 HcmV?d00001 diff --git a/textures/default_leaves_world.png b/textures/default_leaves_world.png new file mode 100644 index 0000000000000000000000000000000000000000..597b7093ab1f6e198599628aaa8a85315568d13b GIT binary patch literal 417 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDB3?!H8JlO)IgaUj*T!C~#bZ}{IQcGplw63!C zi+i3m#7O}~8B2ovf*Bm1-ADtnZ9QEaLoEDLFYcYxY{29Ckh?>UvvDxMOZ ztsghRLo>wH__TxPDy4mvN?gB{rexk!PmEXS|7>`tDAci7D`WmX0kwUBUHc|%kx}5> z_u|sZhNW6bGxUy>21-2sUASviv)wOV&sj%hz8K!sZ2dO->cKj$DNAbOuO6JYgWKJX zt@J|s2Z>)jfwEr$A8F`b?zeiOe15l0`_!wB@)J~2W6rwDYczV<@IU)dxyAp1)9;0R z-*S1hU+BGBz&~ljr=YOX3&&5LopY=xjJ-Bz2fyb1Gmi2H+U))p|FGH9Tv@^X`2*jx zhq7l5ThC}OH{gGtAb0PejTU?E(*iH3xwmymTZ56}Pr0|!Y&K~zY`h1Nk*+b|f0;g6gk z$_ZkJ1H_h{VOe6CJtijW01os3;B`CG4&Aq%=C+kA`D`kHliG^ri(H{11k7D0;h3V<(=0W%Q`DpKzjH7*vIN23a)N$9D=~wks z>84qKUlb~;W2~ZGnu{{+x-fk?mX+>G_4iqN8I>vIbtUUXDP6Cc=0UgE_Gh_WMWsZ3 zyN%;nsq))uRV++5&HX`lm-gqZ$fHsrzZPOXE3^E|U8aAbyHPUHRYg|B=6ru_mSqM3 z^SKbCc0akIsq6LW=gT+Kx8pILQJG6TgsZll*DagJ~`A7P8*VYFS8g(9- zKiWmlspvd1f3%C9Q_*>3{%99Hr=s)7{LwCcbc&Hb+Qq@C-A|1C(JuB*`~Aeo-)A0~ zKROS)X^IJdbRKro6chgFJnW_^Cj8NP*iBPR_@nc%o2HoXN9SQTO)=q*&ckk+BIJ+n zCY-;(dz{SZUe3>WboU7P zbGvEp5%TAD)7~TG&+VqYN64SsO?!`!KewCq9wC2jH|;$_{@iZb`}6-ldLAeJai<9R z<4zIs$DJbNk2^)kA9sq7KkgJEf86QW_w;c74;P)%ZUr%GMF0Q*07*qoM6N<$f`5a^ ACjbBd literal 0 HcmV?d00001 diff --git a/textures/default_stone_world.png b/textures/default_stone_world.png new file mode 100644 index 0000000000000000000000000000000000000000..96b3ee23a040a3bdd8072b21caba335c8881e0fa GIT binary patch literal 1259 zcmYjReNfVO9ENG8HO;rHX{D7G=i2ZzUkVizXy8&b^|XsPZJIAr=Ud`v3Y1i8rqa)5 znZdkVtn=+E(u5K>Gdo%c3Oe6SAw)-(CZ)qeBW4+CJ z8wdol4#lFQj2O9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B050`2f@aX`jvQ`*+nQPLFr3-N@XVRj!$b7M-|LT#Y_^|l zQTpJ;T=Do_qTXUm{?pdvJw6#??7U~Hozaow!jt#)9+|mCI?wBv6!RG;BX@9#eR(9lvwZZe39u{p=LA1JyT tA_=4lDt!3bk3T8+w!YGqpBuF#a6&u$+M&)BpTh`Hc(Wj`}@{J;`ysyR##V zG1BwqDz)A1_fyX&1+Fl9;k#aMQ_$DU1B)zT%0jmkbu$Y}emU6`^5u1`#@4H9mD@Ga z1GlF=4Rm{+<}M#smh!Rw+p1d&zFWUKJp1sWkjiT;Tb55aq}L%UmiKhsiLTiPRacs% zOe~4>xc%Djt&O(bg4B=G?rxrcYx(hm(R(i>y)k&tbl0(@@twl1giDFnSpU@DWZl*L zg6ZG>Hz3@!@$eq*AOAOjaS8iHu>54c&3X_1p9W(I>oc<76=l9F&Uu%->|T4xo%VqD y&a1vF&V7@-?p}MyduOY6&MSaiuq=@Ki{0QwWxUS{<)gqTV(@hJb6Mw<&;$S@7u$gV literal 0 HcmV?d00001 diff --git a/textures/mcl_core_grass_block_top_sheet.png b/textures/mcl_core_grass_block_top_world.png similarity index 100% rename from textures/mcl_core_grass_block_top_sheet.png rename to textures/mcl_core_grass_block_top_world.png