diff --git a/README.md b/README.md index bf1270f..c149532 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,10 @@ Some major changes were done to make the mod easier to maintain: ## Changes: '!' is for bugs in 2012 version that are fixed (as opposed to features that were changed/added) in this fork -* (2017-03-11) added better placeholder textures for gems where prerendered block is not finished yet +* (2017-03-13) textures improved: opal mineral overlay, alexandrite classic block +* (2017-03-13) default block style changed to classic +* (2017-03-13) now uses settings from server's minetest.conf: birthstones_texture_style (can be realistic or classic) +* (2017-03-11) added better classic textures for gems where realistic block is not finished yet * (2017-03-11) added new texture for emerald: mineral, item * (2017-03-10) changed sun square emission from 10 to 100 * (2017-03-10) new textures for "white diamond": mineral, item [blend file: octagon beveled all but top and bottom by .12 offset]; for topaz: mineral diff --git a/etc/birthstones blocks.xcf b/etc/birthstones blocks.xcf index 4f1f21e..b1c5223 100644 Binary files a/etc/birthstones blocks.xcf and b/etc/birthstones blocks.xcf differ diff --git a/etc/birthstones_emerald_block_top.xcf b/etc/birthstones_emerald_block_top.xcf new file mode 100644 index 0000000..05a50c8 Binary files /dev/null and b/etc/birthstones_emerald_block_top.xcf differ diff --git a/etc/birthstones_mineral_opal.xcf b/etc/birthstones_mineral_opal.xcf new file mode 100644 index 0000000..b7c2692 Binary files /dev/null and b/etc/birthstones_mineral_opal.xcf differ diff --git a/etc/hd/1.textures - Shortcut.lnk b/etc/hd/1.textures - Shortcut.lnk new file mode 100644 index 0000000..037d8aa Binary files /dev/null and b/etc/hd/1.textures - Shortcut.lnk differ diff --git a/etc/hd/birthstones_emerald_block_east.png b/etc/hd/birthstones_emerald_block_east.png new file mode 100644 index 0000000..81d3a16 Binary files /dev/null and b/etc/hd/birthstones_emerald_block_east.png differ diff --git a/etc/hd/birthstones_emerald_block_north.png b/etc/hd/birthstones_emerald_block_north.png index 7a75367..01d64c5 100644 Binary files a/etc/hd/birthstones_emerald_block_north.png and b/etc/hd/birthstones_emerald_block_north.png differ diff --git a/etc/hd/birthstones_emerald_block_top.png b/etc/hd/birthstones_emerald_block_top.png new file mode 100644 index 0000000..ab3c837 Binary files /dev/null and b/etc/hd/birthstones_emerald_block_top.png differ diff --git a/etc/hd/birthstones_emerald_block_west.png b/etc/hd/birthstones_emerald_block_west.png new file mode 100644 index 0000000..07c61f4 Binary files /dev/null and b/etc/hd/birthstones_emerald_block_west.png differ diff --git a/etc/hd/textures - Shortcut (2).lnk b/etc/hd/textures - Shortcut (2).lnk deleted file mode 100644 index e2757d6..0000000 Binary files a/etc/hd/textures - Shortcut (2).lnk and /dev/null differ diff --git a/nodes.lua b/nodes.lua index 412f846..d0132d4 100644 --- a/nodes.lua +++ b/nodes.lua @@ -1,4 +1,34 @@ -- START RAW MATERIALS + +local texture_style = minetest.setting_get("birthstones_texture_style") or "classic" +-- can also be "realistic" if all block textures are implemented + +function file_exists(name) + local f=io.open(name,"r") + if f~=nil then + io.close(f) + return true + else return false + end +end + +local function get_block_tiles(name) + local this_texture_style = texture_style + local path = nil + if this_texture_style == "realistic" then + -- if file_exists("birthstones_" .. name .. "_block_top.png") then + path = { "birthstones_" .. name .. "_block_top.png", "birthstones_" .. name .. "_block_top.png", "birthstones_" .. name .. "_block_east.png", "birthstones_" .. name .. "_block_east.png", "birthstones_" .. name .. "_block_north.png", "birthstones_" .. name .. "_block_north.png" } + -- else + -- this_texture_style = "classic" + -- end + end + -- intentionally don't use else since fallback to classic may have been performed above: + if this_texture_style == "classic" then + path = { "birthstones_" .. name .. "_block.png" } + end + return path +end + minetest.register_node( "birthstones:stone_with_alexandrite", { description = "Stone with Alexandrite", tiles = { "default_stone.png^birthstones_mineral_alexandrite.png" }, @@ -104,70 +134,70 @@ minetest.register_node( "birthstones:stone_with_zircon", { minetest.register_node( "birthstones:alexandriteblock", { description = "Alexandrite Block", - tiles = { "birthstones_alexandrite_block_top.png", "birthstones_alexandrite_block_top.png", "birthstones_alexandrite_block_east.png", "birthstones_alexandrite_block_east.png", "birthstones_alexandrite_block_north.png", "birthstones_alexandrite_block_north.png" }, + tiles = get_block_tiles("alexandrite"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:amethystblock", { description = "Amethyst Block", - tiles = { "birthstones_amethyst_block_top.png", "birthstones_amethyst_block_top.png", "birthstones_amethyst_block_east.png", "birthstones_amethyst_block_east.png", "birthstones_amethyst_block_north.png", "birthstones_amethyst_block_north.png" }, + tiles = get_block_tiles("amethyst"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:aquamarineblock", { description = "Aquamarine Block", - tiles = { "birthstones_aquamarine_block_top.png", "birthstones_aquamarine_block_top.png", "birthstones_aquamarine_block_east.png", "birthstones_aquamarine_block_east.png", "birthstones_aquamarine_block_north.png", "birthstones_aquamarine_block_north.png" }, + tiles = get_block_tiles("aquamarine"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:diamondblock", { description = "White Diamond Block", - tiles = { "birthstones_diamond_block_top.png", "birthstones_diamond_block_top.png", "birthstones_diamond_block_east.png", "birthstones_diamond_block_east.png", "birthstones_diamond_block_north.png", "birthstones_diamond_block_north.png" }, + tiles = get_block_tiles("diamond"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:emeraldblock", { description = "Emerald Block", - tiles = { "birthstones_emerald_block.png" }, + tiles = get_block_tiles("emerald"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:garnetblock", { description = "Garnet Block", - tiles = { "birthstones_garnet_block.png" }, + tiles = get_block_tiles("garnet"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:opalblock", { description = "Opal Block", - tiles = { "birthstones_opal_block.png" }, + tiles = get_block_tiles("opal"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:peridotblock", { description = "Peridot Block", - tiles = { "birthstones_peridot_block.png" }, + tiles = get_block_tiles("peridot"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:rubyblock", { description = "Ruby Block", - tiles = { "birthstones_ruby_block.png" }, + tiles = get_block_tiles("ruby"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:sapphireblock", { description = "Sapphire Block", - tiles = { "birthstones_sapphire_block.png" }, + tiles = get_block_tiles("sapphire"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), @@ -175,14 +205,14 @@ minetest.register_node( "birthstones:sapphireblock", { -- tiles: +Y, -Y, +X, -X, +Z, -Z. In English: top, bottom, right, left, back, front. - http://dev.minetest.net/minetest.register_node minetest.register_node( "birthstones:topazblock", { description = "Topaz Block", - tiles = { "birthstones_topaz_block_top.png", "birthstones_topaz_block_top.png", "birthstones_topaz_block_east.png", "birthstones_topaz_block_east.png", "birthstones_topaz_block_north.png", "birthstones_topaz_block_north.png" }, + tiles = get_block_tiles("topaz"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node( "birthstones:zirconblock", { description = "Zircon Block", - tiles = { "birthstones_zircon_block.png" }, + tiles = get_block_tiles("zircon"), is_ground_content = true, groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), diff --git a/textures/birthstones_alexandrite_block.png b/textures/birthstones_alexandrite_block.png index 3dad68d..e362b66 100644 Binary files a/textures/birthstones_alexandrite_block.png and b/textures/birthstones_alexandrite_block.png differ diff --git a/textures/birthstones_emerald_block_east.png b/textures/birthstones_emerald_block_east.png new file mode 100644 index 0000000..e49dfa4 Binary files /dev/null and b/textures/birthstones_emerald_block_east.png differ diff --git a/textures/birthstones_emerald_block_north.png b/textures/birthstones_emerald_block_north.png new file mode 100644 index 0000000..381f498 Binary files /dev/null and b/textures/birthstones_emerald_block_north.png differ diff --git a/textures/birthstones_emerald_block_top.png b/textures/birthstones_emerald_block_top.png new file mode 100644 index 0000000..781c359 Binary files /dev/null and b/textures/birthstones_emerald_block_top.png differ diff --git a/textures/birthstones_garnet_block.png b/textures/birthstones_garnet_block.png index fb78c3d..fa472f3 100644 Binary files a/textures/birthstones_garnet_block.png and b/textures/birthstones_garnet_block.png differ diff --git a/textures/birthstones_mineral_opal.png b/textures/birthstones_mineral_opal.png index 6db641d..f5ab437 100644 Binary files a/textures/birthstones_mineral_opal.png and b/textures/birthstones_mineral_opal.png differ