From 230516086847e1ebee9c5568033e035517407e51 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 1 Jul 2023 11:55:46 +0200 Subject: [PATCH] Make covered permafrost nodes look better --- README.md | 3 +- handlers/glasscut.lua | 99 ++++++++++++++++-- textures/xdecor_permafrost_moss_cube.png | Bin 0 -> 337 bytes ...xdecor_permafrost_moss_outer_stairside.png | Bin 0 -> 337 bytes textures/xdecor_permafrost_moss_split.png | Bin 0 -> 337 bytes textures/xdecor_permafrost_moss_stairside.png | Bin 0 -> 356 bytes textures/xdecor_permafrost_stones_cube.png | Bin 0 -> 210 bytes ...ecor_permafrost_stones_outer_stairside.png | Bin 0 -> 210 bytes textures/xdecor_permafrost_stones_split.png | Bin 0 -> 210 bytes .../xdecor_permafrost_stones_stairside.png | Bin 0 -> 217 bytes 10 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 textures/xdecor_permafrost_moss_cube.png create mode 100644 textures/xdecor_permafrost_moss_outer_stairside.png create mode 100644 textures/xdecor_permafrost_moss_split.png create mode 100644 textures/xdecor_permafrost_moss_stairside.png create mode 100644 textures/xdecor_permafrost_stones_cube.png create mode 100644 textures/xdecor_permafrost_stones_outer_stairside.png create mode 100644 textures/xdecor_permafrost_stones_split.png create mode 100644 textures/xdecor_permafrost_stones_stairside.png diff --git a/README.md b/README.md index fdea6c7..15f176a 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,8 @@ Maintenance updates: * "Wooden Light Box 2" to "Wooden Rhombus Light Box" * Added fuel recipes for wooden-based things * Changed a few confusing recipes to make more sense -* Improved textures for cut glass, obsidian glass and woodframed glass +* Improved textures for cut glass, obsidian glass, woodframed glass, + permafrost with moss and permafrost with stones * Improved side texture of wood frame and rusty bar * Add honey and cushion block to creative inventory * Doors now count as nodes in creative inventory diff --git a/handlers/glasscut.lua b/handlers/glasscut.lua index 819b9be..f87aed6 100644 --- a/handlers/glasscut.lua +++ b/handlers/glasscut.lua @@ -8,7 +8,7 @@ -- cut nodes look horrible because there are no -- clear contours. -local template_suffixes = { +local template_suffixes_glass = { stair = { "_split.png", ".png", @@ -58,12 +58,70 @@ local template_suffixes = { }, } -local generate_tilenames = function(prefix, default_texture) +-- Template for "grass-covered" and similar nodes. +-- This is defined in a way so that the cut nodes +-- still have a natural-looking grass cover. +-- !TOP and !BOTTOM are special and will be +-- replaced via function argument. + +local template_suffixes_grasscover = { + stair = { + "!TOP", + "!BOTTOM", + "_stairside.png^[transformFX", + "_stairside.png", + ".png", + "_split.png", + }, + stair_inner = { + "!TOP", + "!BOTTOM", + "_stairside.png^[transformFX", + ".png", + ".png", + "_stairside.png", + }, + stair_outer = { + "!TOP", + "!BOTTOM", + "_outer_stairside.png", + "_stairside.png", + "_stairside.png^[transformR90", + "_outer_stairside.png", + }, + halfstair = { + "!TOP", + "!BOTTOM", + "_stairside.png^[transformFX", + "_stairside.png", + ".png", + "_cube.png", + }, + slab = { + "!TOP", + "!BOTTOM", + "_split.png", + }, + cube = { "!TOP", "!BOTTOM", "_cube.png" }, + thinstair = { "!TOP", "!BOTTOM", "_cube.png" }, + micropanel = { "!TOP", "!BOTTOM", "!TOP" }, + nanoslab = { "!TOP", "!BOTTOM", "!TOP" }, + microslab = { "!TOP", "!BOTTOM", "!TOP" }, + panel = { + "!TOP", + "!BOTTOM", + "_cube.png", + "_cube.png", + "_split.png", + }, +} + +local generate_tilenames_glass = function(prefix, default_texture) if not default_texture then default_texture = prefix end local cuts = {} - for t, tiles in pairs(template_suffixes) do + for t, tiles in pairs(template_suffixes_glass) do cuts[t] = {} for i=1, #tiles do if tiles[i] == ".png" then @@ -76,8 +134,37 @@ local generate_tilenames = function(prefix, default_texture) return cuts end +local generate_tilenames_grasscover = function(prefix, default_texture, base, top, bottom) + if not default_texture then + default_texture = prefix + end + local cuts = {} + for t, tiles in pairs(template_suffixes_grasscover) do + cuts[t] = {} + for i=1, #tiles do + if tiles[i] == "!TOP" then + cuts[t][i] = {name=top, align_style="world"} + elseif tiles[i] == "!BOTTOM" then + cuts[t][i] = {name=bottom, align_style="world"} + else + if tiles[i] == ".png" then + cuts[t][i] = default_texture .. tiles[i] + else + cuts[t][i] = prefix .. tiles[i] + end + if base then + cuts[t][i] = base .. "^" .. cuts[t][i] + end + end + end + end + return cuts +end + xdecor.glasscuts = { - ["xdecor:woodframed_glass"] = generate_tilenames("xdecor_woodframed_glass"), - ["default:glass"] = generate_tilenames("stairs_glass", "default_glass"), - ["default:obsidian_glass"] = generate_tilenames("stairs_obsidian_glass", "default_obsidian_glass"), + ["xdecor:woodframed_glass"] = generate_tilenames_glass("xdecor_woodframed_glass"), + ["default:glass"] = generate_tilenames_glass("stairs_glass", "default_glass"), + ["default:obsidian_glass"] = generate_tilenames_glass("stairs_obsidian_glass", "default_obsidian_glass"), + ["default:permafrost_with_moss"] = generate_tilenames_grasscover("xdecor_permafrost_moss", "default_moss_side", "default_permafrost.png", "default_moss.png", "default_permafrost.png"), + ["default:permafrost_with_stones"] = generate_tilenames_grasscover("xdecor_permafrost_stones", "default_stones_side", "default_permafrost.png", "default_permafrost.png^default_stones.png", "default_permafrost.png"), } diff --git a/textures/xdecor_permafrost_moss_cube.png b/textures/xdecor_permafrost_moss_cube.png new file mode 100644 index 0000000000000000000000000000000000000000..df7b0fd78c31f0c480054de696d36ec91c62f0d3 GIT binary patch literal 337 zcmV-X0j~auP)H+ZHud8jyht2lnII)AY{ zfU-M*vpj^iJ%+kIhr2$Czd(+`MwG-+m&R3_$XlJtU?m{q5&!@I0d!JMQvg8b*k%9# z0CGu0K~xyi&CX34f*=$|;qS3uFfkCj(p3Y|)U@`$yj(%!-pQFBq*)u+zIN5n%&L(I zEXU6?+-ojJ!$lC#zFXE&sZ6G3SRCQR?JJVWlYMF3d-B-jMaNnTz>)7CjDs+wuM(R; j)oshsUd{qP{K>}`u}~3bzd62;00000NkvXXu0mjfehY-j literal 0 HcmV?d00001 diff --git a/textures/xdecor_permafrost_moss_outer_stairside.png b/textures/xdecor_permafrost_moss_outer_stairside.png new file mode 100644 index 0000000000000000000000000000000000000000..bf4dd6a8d9c92c81c2cb4f67388fc85412269167 GIT binary patch literal 337 zcmV-X0j~auP)H+ZHud8jyht2lnII)AY{ zfU-M*vpj^iJ%+kIhr2$Czd(+`MwG-+m&R3_$XlJtU@hRFUjP6A0d!JMQvg8b*k%9# z0CGu0K~xyi&CX34f*=$|;qS3uFfkCj(p3Y|)U@`$yj(%!-pQFBq*)u+zIN5n%&L(I zEXU6?+-ojJ!$lC#zFXE&sZ6G3SRCQR?JJVWlYMF3d-B-jMaNnTz>)7CjDs+wuM(R; j)oshsUd{qP{K>}`u}~3bzd62;00000NkvXXu0mjf3?hby literal 0 HcmV?d00001 diff --git a/textures/xdecor_permafrost_moss_split.png b/textures/xdecor_permafrost_moss_split.png new file mode 100644 index 0000000000000000000000000000000000000000..29162605ac4ac2f0509bfae5acf4afb4602980c1 GIT binary patch literal 337 zcmV-X0j~auP)H+ZHud8jyht2lnII)AY{ zfU-M*vpj^iJ%+kIhr2$Czd(+`MwG-+m&R3_$XlJtV1`QmBLDyZ0d!JMQvg8b*k%9# z0CGu0K~xyi&CX34f*=$|;qS3uFfkCj(p3Y|)U@`$yj(%!-pQFBq*)u+zIN5n%&L(I zEXU6?+-ojJ!$lC#zFXE&sZ6G3SRCQR?JJVWlYMF3d-B-jMaNnTz>)7CjDs+wuM(R; j)oshsUd{qP{K>}`u}~3bzd62;00000NkvXXu0mjf-6DrC literal 0 HcmV?d00001 diff --git a/textures/xdecor_permafrost_moss_stairside.png b/textures/xdecor_permafrost_moss_stairside.png new file mode 100644 index 0000000000000000000000000000000000000000..3da13482da8874cc3af780e055f8208de41dbb5d GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbMfgaDrq*H8wA{g?C^0vViR<=qk$ z+>;f&GnIX^l>Kv60t-}w3e|#()k4eE!zwf)Yc!+kG-K+uVjH#NnzR$!b(1=Dle_d% zd-c;N7-UU0$ev=DGtDr6mT|!xQN7xtZoO6gM(c)6){UEO zTDIG^?Xqj%ZP&Hmq3@vElp}%DkA==Y5k2=*LU`oFe?Ye}mIV0)GdMiEkp|>6dAc}; zNL=nccUr7TLB!$W?rF9Mk2vtWT-BJ774`prxurl>Sas1d_D4&~ilbjGTJ08gkwazI z^}BK2XQ~@#svht)K5LuI+3RYa$;!S)-mlZ-*0UgccIMe8*%OMH7EH~|=de~1u@8=j z2#uNc=IKk12mB8YbIZs5_;Bd>@n0WP|NeN&8zswYqo;P*0_YkBPgg&ebxsLQ05_3_ A`v3p{ literal 0 HcmV?d00001 diff --git a/textures/xdecor_permafrost_stones_cube.png b/textures/xdecor_permafrost_stones_cube.png new file mode 100644 index 0000000000000000000000000000000000000000..0002ab4faa3c6dc4f3b3285056a60c6a94c9f80f GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}cz{ocE06|)*x1;FxcG#GgruaT zl%!-JNJ&XaO-;=NqRh;!tgKuRC@Lr@C;@@e^76`>nwq-0y88O&#>U3x<~AVc>h9|S zg5C*}CQW*K<-8EkT*i_hzhDN3XE)M-98FIb#}J9j$q5aNnSm1CE^ZPog~bLP9v_<{ mVr=dNXfpb#u}L*Ima;P>F*5#7{Smhnnwq-0y88O&#>U3x<~AVc>h9|S zg5C*}CQW*K<-8EkT*i_hzhDN3XE)M-98FIb#}J9j$q5aNnSm1CE^ZPog~bLP9v_<{ mVr=dNXfpb#u}L*Ima;P>F*5#7{Smhnnwq-0y88O&#>U3x<~AVc>h9|S zg5C*}CQW*K<-8EkT*i_hzhDN3XE)M-98FIb#}J9j$q5aNnSm1CE^ZPog~bLP9v_<{ mVr=dNXfpb#u}L*Ima;P>F*5#7{Smhnnwq-0y88O&#>U3x<~AVc>h9|S zg5C*}CQW*K<-8EkT*i_hzhDN3XE)M-90N}m#}J9j$q5aNnSm1CE^ZPog~bLP9v_<{ uVr=dNXfpb#u}LwvSTA6B$j7o^rZt1P8{_Pr`oirX7kaw-xvX