diff --git a/license.txt b/LICENSE.md similarity index 96% rename from license.txt rename to LICENSE.md index 15e0356..bba6d99 100644 --- a/license.txt +++ b/LICENSE.md @@ -1,5 +1,6 @@ +# MIT License -Textures: +## Textures rs_water.png Based on default_water.png by Cisoun from minetest_game (CC BY-SA 3.0). @@ -7,7 +8,7 @@ rs_water_flowing_animated.png and rs_water_source_animated.png Based on textures by RealBadAngel from minetest_game (CC BY-SA 3.0). -Code: +## Code License: MIT (https://opensource.org/licenses/MIT) By Shara RedCat @@ -36,4 +37,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d85d4e --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Adds coloured water. This Fork of Rainbow Source by Shara is compatible with Luanti versions after 5.4.0. I also added buckets for each water color. Unfortunately, I'm bad at making textures, so for now bucket_compat from fluid_lib by IcyDiamond is required for most buckets. Bucket crafting recipes are a Setting that is disabled by default. All content contained in this mod is under the MIT License. diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 331d858..0000000 --- a/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/description.txt b/description.txt deleted file mode 100644 index b29356e..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds coloured water. \ No newline at end of file diff --git a/init.lua b/init.lua index 2bc83d0..458306a 100644 --- a/init.lua +++ b/init.lua @@ -1,15 +1,15 @@ - +--Water definitions local source_list = { - {"black", "Darkened", "292421", 40, 36, 33}, + {"black", "Darkened", "292421", 40, 36, 33}, {"blue", "Blue", "0000FF", 0, 0, 255}, - {"cyan", "Cyan", "00FFFF", 0, 255, 255}, - {"green", "Green", "00FF00", 0, 255, 0}, - {"magenta", "Magenta", "FF00FF", 255, 0, 255}, - {"orange", "Orange", "FF6103", 255, 97, 3}, - {"purple", "Purple", "800080", 128, 0, 128}, - {"red", "Red", "FF0000", 255, 0, 0}, - {"yellow", "Yellow", "FFFF00", 255, 255, 0}, - {"frosted", "Frosted", "FFFFFF", 255, 255, 255} + {"cyan", "Cyan", "00FFFF", 0, 255, 255}, + {"green", "Green", "00FF00", 0, 255, 0}, + {"magenta", "Magenta", "FF00FF", 255, 0, 255}, + {"orange", "Orange", "FF6103", 255, 97, 3}, + {"purple", "Purple", "800080", 128, 0, 128, "violet"}, + {"red", "Red", "FF0000", 255, 0, 0}, + {"yellow", "Yellow", "FFFF00", 255, 255, 0}, + {"frosted", "Frosted", "FFFFFF", 255, 255, 255, "white"} } for i in ipairs(source_list) do @@ -18,9 +18,11 @@ for i in ipairs(source_list) do local colour = source_list[i][3] local red = source_list[i][4] local green = source_list[i][5] - local blue = source_list[i][6] + local blue = source_list[i][6] + local dye = source_list[i][7] or name - minetest.register_node("rainbow_source:"..name.."_water_source", { + --Register water source nodes + core.register_node("rainbow_source:"..name.."_water_source", { description = description.." Water Source", drawtype = "liquid", tiles = { @@ -46,7 +48,7 @@ for i in ipairs(source_list) do backface_culling = false, }, }, - alpha = 160, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -60,11 +62,13 @@ for i in ipairs(source_list) do liquid_alternative_source = "rainbow_source:"..name.."_water_source", liquid_viscosity = 1, post_effect_color = {a = 50, r = red, g = green, b = blue}, - groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1}, + groups = {water = 3, liquid = 3, puts_out_fire = 1, + cools_lava = 1}, sounds = default.node_sound_water_defaults(), }) - minetest.register_node("rainbow_source:"..name.."_water_flowing", { + --Register flowing water nodes + core.register_node("rainbow_source:"..name.."_water_flowing", { description = description.." Flowing Water", drawtype = "flowingliquid", tiles = {"rs_water.png^[colorize:#"..colour}, @@ -90,7 +94,7 @@ for i in ipairs(source_list) do }, }, }, - alpha = 160, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, @@ -110,11 +114,49 @@ for i in ipairs(source_list) do sounds = default.node_sound_water_defaults(), }) + --[[------------------------------------- + --Buckets (new feature by DustyDave961)-- + ---------------------------------------]] - - - - - - + --Register buckets with fluid_lib function + if core.get_modpath("bucket_compat") then + fluid_lib.register_liquid( + "rainbow_source:"..name.."_water_source", + "rainbow_source:"..name.."_water_flowing", + "rainbow_source:bucket_"..name.."_water", + "#"..colour, + description.." Water Bucket", + {tool = 1, water_bucket = 1} + ) + + --Register crafting recipes if dye is present and crafting setting is enabled + if core.get_modpath("dye") and core.settings:get_bool("enable_colored_bucket_crafts") then + core.register_craft({ + output = "rainbow_source:bucket_"..name.."_water", + recipe = { + {"dye:"..dye}, + {"group:water_bucket"} + } + }) + end + --Add buckets even without bucket_compat + elseif core.get_modpath("bucket") then + bucket.register_liquid( + "rainbow_source:blue_water_source", + "rainbow_source:blue_water_flowing", + "rainbow_source:bucket_blue_water", + "bucket_water.png", + "Blue Water Bucket", + {tool = 1, water_bucket = 1} + ) + + bucket.register_liquid( + "rainbow_source:orange_water_source", + "rainbow_source:orange_water_flowing", + "rainbow_source:bucket_orange_water", + "bucket_lava.png", + "Orange Water Bucket", + {tool = 1, water_bucket = 1} + ) + end end diff --git a/mod.conf b/mod.conf index 9cf9080..f107a39 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,7 @@ -name = rainbow_source \ No newline at end of file +name = rainbow_source +title = Rainbow Source Redo +description = Fork of Rainbow Source by Shara. Adds coloured water and buckets. +depends = default +optional_depends = bucket_compat, dye, bucket +min_minetest_version = 5.4 +supported_games = minetest_game diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..31a797f --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1 @@ +enable_colored_bucket_crafts (Craft colored water buckets.) bool false \ No newline at end of file