From 87449b5719e21411d04a17142b11efa25375e049 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 19 Dec 2019 17:42:19 +0100 Subject: [PATCH] Make ice texture opaque by default Because of glitchy translucency in Minetest --- mods/ITEMS/mcl_core/locale/mcl_core.de.tr | 4 ++-- mods/ITEMS/mcl_core/locale/template.txt | 4 ++-- mods/ITEMS/mcl_core/nodes_base.lua | 20 ++++++++++++++------ settingtypes.txt | 8 ++++++++ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/mods/ITEMS/mcl_core/locale/mcl_core.de.tr b/mods/ITEMS/mcl_core/locale/mcl_core.de.tr index cab01c2e..c0b9b738 100644 --- a/mods/ITEMS/mcl_core/locale/mcl_core.de.tr +++ b/mods/ITEMS/mcl_core/locale/mcl_core.de.tr @@ -101,7 +101,7 @@ Flint is a raw material.=Feuerstein ist ein Rohstoff. Flowing Lava=Fließende Lava Flowing Water=Fließendes Wasser Frosted Ice=Brüchiges Eis -Frosted ice is a short-lived solid translucent block. It melts into a water source within a few seconds.=Brüchiges Eis ist ein kurzlebiger durchscheinender Block. Er wird sich in einigen Sekunden zu einer Wasserquelle verwandeln. +Frosted ice is a short-lived solid block. It melts into a water source within a few seconds.=Brüchiges Eis ist ein kurzlebiger durchscheinender Block. Er wird sich in einigen Sekunden zu einer Wasserquelle verwandeln. Glass=Glas Gold Ingot=Goldbarren Gold Nugget=Goldklumpen @@ -117,7 +117,7 @@ Gravel=Kies Green Stained Glass=Grünes Buntglas Grey Stained Glass=Graues Buntglas Ice=Eis -Ice is a translucent solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source.=Eis ist ein durchscheinender fester Block, der oft in kalten Gebieten gefunden werden kann. Er schmilzt in der Nähe von Block-Lichtquellen bei einer Helligkeit von 12 oder höher. Wenn es schmilzt oder abgebaut wird, und darunter ein anderer Block war, wird er sich in eine Wasserquelle verwandeln. +Ice is a solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source.=Eis ist ein durchscheinender fester Block, der oft in kalten Gebieten gefunden werden kann. Er schmilzt in der Nähe von Block-Lichtquellen bei einer Helligkeit von 12 oder höher. Wenn es schmilzt oder abgebaut wird, und darunter ein anderer Block war, wird er sich in eine Wasserquelle verwandeln. In the End dimension, starting a fire on this block will create an eternal fire.=In der Ende-Dimension wird Feuer auf diesem Block ewig brennen. Iron Ingot=Eisenbarren Iron Nugget=Eisenklumpen diff --git a/mods/ITEMS/mcl_core/locale/template.txt b/mods/ITEMS/mcl_core/locale/template.txt index 5ad9a8d9..d97c6901 100644 --- a/mods/ITEMS/mcl_core/locale/template.txt +++ b/mods/ITEMS/mcl_core/locale/template.txt @@ -101,7 +101,7 @@ Flint is a raw material.= Flowing Lava= Flowing Water= Frosted Ice= -Frosted ice is a short-lived solid translucent block. It melts into a water source within a few seconds.= +Frosted ice is a short-lived solid block. It melts into a water source within a few seconds.= Glass= Gold Ingot= Gold Nugget= @@ -117,7 +117,7 @@ Gravel= Green Stained Glass= Grey Stained Glass= Ice= -Ice is a translucent solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source.= +Ice is a solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source.= In the End dimension, starting a fire on this block will create an eternal fire.= Iron Ingot= Iron Nugget= diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 790a2d98..155c6372 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -2,6 +2,14 @@ local S = minetest.get_translator("mcl_core") -- Simple solid cubic nodes, most of them are the ground materials and simple building blocks +local translucent_ice = minetest.settings:get_bool("mcl_translucent_ice", false) +local ice_drawtype +if translucent_ice then + ice_drawtype = "glasslike" +else + ice_drawtype = "normal" +end + 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."), @@ -752,12 +760,12 @@ minetest.register_node("mcl_core:obsidian", { minetest.register_node("mcl_core:ice", { description = S("Ice"), - _doc_items_longdesc = S("Ice is a translucent solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source."), - drawtype = "glasslike", + _doc_items_longdesc = S("Ice is a solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source."), + drawtype = ice_drawtype, tiles = {"default_ice.png"}, is_ground_content = true, paramtype = "light", - use_texture_alpha = true, + use_texture_alpha = translucent_ice, stack_max = 64, groups = {handy=1,pickaxey=1, slippery=3, building_block=1}, drop = "", @@ -811,17 +819,17 @@ for i=0,3 do local use_doc = i == 0 local longdesc if use_doc then - longdesc = S("Frosted ice is a short-lived solid translucent block. It melts into a water source within a few seconds.") + longdesc = S("Frosted ice is a short-lived solid block. It melts into a water source within a few seconds.") end minetest.register_node("mcl_core:frosted_ice_"..i, { description = S("Frosted Ice"), _doc_items_create_entry = use_doc, _doc_items_longdesc = longdesc, - drawtype = "glasslike", + drawtype = ice_drawtype, tiles = {"mcl_core_frosted_ice_"..i..".png"}, is_ground_content = false, paramtype = "light", - use_texture_alpha = true, + use_texture_alpha = translucent_ice, stack_max = 64, groups = {handy=1, frosted_ice=1, slippery=3, not_in_creative_inventory=1}, drop = "", diff --git a/settingtypes.txt b/settingtypes.txt index ac9ba89b..a71c9a5c 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -83,6 +83,14 @@ mobs_disable_blood (Disable mob damage particles) bool false flame_sound (Flame sound) bool true [Experimental] +# Whether ice is translucent. If disabled, ice is fully opaque. +# +# Note: As of Minetest version 5.1.0, translucent ice above oceans +# will look weird, there's a lot of flashing/blinking going on +# due to bugs in Minetest's implementation of translucency. +# See also: https://github.com/minetest/minetest/issues/95 +mcl_translucent_ice (Translucent ice) bool false + # Whether to generate fallen logs in some biomes. # They might not always look pretty and have strange overhangs. mcl_generate_fallen_logs (Generate fallen logs) bool false