1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-10-15 08:35:35 +02:00

Make posters dyeable (#20)

* set signs param2 to colorfacedir

- make signs use a color palette and hardware coloring
- add poster coloring crafting recipes and optional depend on dye

* use xcompat

* optipng textures

* make recipe shapeless

* fix spaces/tab mix

* remove xcompat check
This commit is contained in:
whosit
2025-03-31 16:27:16 +03:00
committed by GitHub
parent 0f6624f5a5
commit 0ec62a1732
5 changed files with 21 additions and 1 deletions

View File

@@ -48,6 +48,24 @@ minetest.register_craft({
} }
}) })
local dyes = {
mat.dye_white,
mat.dye_grey,
mat.dye_orange,
mat.dye_brown,
mat.dye_dark_grey,
mat.dye_yellow,
mat.dye_green,
mat.dye_red,
}
for i, dye in ipairs(dyes) do
minetest.register_craft({
type = "shapeless",
output = minetest.itemstring_with_palette("signs:paper_poster", (i-1) * 32),
recipe = {"signs:paper_poster", dye},
})
end
minetest.register_craft({ minetest.register_craft({
output = 'signs:label_small', output = 'signs:label_small',
recipe = { recipe = {

View File

@@ -215,6 +215,8 @@ local models = {
"signs_poster_sides.png", "signs_poster.png" }, "signs_poster_sides.png", "signs_poster.png" },
inventory_image = "signs_poster_inventory.png", inventory_image = "signs_poster_inventory.png",
use_texture_alpha = "clip", use_texture_alpha = "clip",
paramtype2 = "colorfacedir",
palette = "signs_poster_palette.png",
groups= { dig_immediate = 2 }, groups= { dig_immediate = 2 },
_mcl_hardness = 0.8, _mcl_hardness = 0.8,
_mcl_blast_resistance = 1, _mcl_blast_resistance = 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

View File

@@ -104,7 +104,7 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing)
local ndir, test local ndir, test
if ndef and ndef.paramtype2 == "facedir" then if ndef and (ndef.paramtype2 == "facedir" or ndef.paramtype2 == "colorfacedir") then
-- Wall pointed -- Wall pointed
ndir = minetest.dir_to_facedir(bdir, true) ndir = minetest.dir_to_facedir(bdir, true)