diff --git a/license.txt b/LICENSE.md similarity index 77% rename from license.txt rename to LICENSE.md index 15e0356..f9b4a30 100644 --- a/license.txt +++ b/LICENSE.md @@ -1,13 +1,15 @@ +# MIT License -Textures: -rs_water.png -Based on default_water.png by Cisoun from minetest_game (CC BY-SA 3.0). +## Textures +bucket_mask.png +Taken from fluid_lib by IcyDiamond (MIT). Altered by a-tour-ist aka tour to match water textures -rs_water_flowing_animated.png and rs_water_source_animated.png -Based on textures by RealBadAngel from minetest_game (CC BY-SA 3.0). +rs_bucket.png +Taken from Minetest Game bucket mod. Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2015-2016 ElementW -Code: +## Code License: MIT (https://opensource.org/licenses/MIT) By Shara RedCat @@ -19,6 +21,7 @@ By Shara RedCat The MIT License (MIT) Copyright (c) 2017 Shara RedCat +Copyright (c) 2026 DustyDave961 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -36,4 +39,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..ea78c18 --- /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. I'm bad at making textures, so they're generated the same way as bucket_compat from fluid_lib by IcyDiamond. I borrowed bucket_mask.png for that. 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..61b678e 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,14 +18,16 @@ 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 = { { - name = "rs_water_source_animated.png^[colorize:#"..colour..":70", + name = "default_water_source_animated.png^[hsl:0:-100:0^[colorize:#"..colour..":70", animation = { type = "vertical_frames", aspect_w = 16, @@ -36,7 +38,7 @@ for i in ipairs(source_list) do }, special_tiles = { { - name = "rs_water_source_animated.png^[colorize:#"..colour..":70", + name = "default_water_source_animated.png^[hsl:0:-100:0^[colorize:#"..colour..":70", animation = { type = "vertical_frames", aspect_w = 16, @@ -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,17 +62,19 @@ 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}, + tiles = {"default_water.png^[hsl:0:-100:0^[colorize:#"..colour..":70"}, special_tiles = { { - name = "rs_water_flowing_animated.png^[colorize:#"..colour..":70", + name = "default_water_flowing_animated.png^[hsl:0:-100:0^[colorize:#"..colour..":70", backface_culling = false, animation = { type = "vertical_frames", @@ -80,7 +84,7 @@ for i in ipairs(source_list) do }, }, { - name = "rs_water_flowing_animated.png^[colorize:#"..colour..":70", + name = "default_water_flowing_animated.png^[hsl:0:-100:0^[colorize:#"..colour..":70", backface_culling = true, animation = { type = "vertical_frames", @@ -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,43 @@ 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} + ) + + --Add buckets even without bucket_compat + elseif core.get_modpath("bucket") then + bucket.register_liquid( + "rainbow_source:"..name.."_water_source", + "rainbow_source:"..name.."_water_flowing", + "rainbow_source:bucket_"..name.."_water", + "rs_bucket.png^(bucket_mask.png^[colorize:#"..colour..":70)", + description.." Water Bucket", + {tool = 1, water_bucket = 1} + ) + end + + --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 + if core.get_modpath("bucket") or core.get_modpath("bucket_compat") then + core.register_craft({ + output = "rainbow_source:bucket_"..name.."_water", + recipe = { + {"dye:"..dye}, + {"group:water_bucket"} + } + }) + end + 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..a619258 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1 @@ +enable_colored_bucket_crafts (Add crafting recipes for colored water buckets. Recipes are disabled by default.) bool false diff --git a/textures/bucket_mask.png b/textures/bucket_mask.png new file mode 100644 index 0000000..ddf87d9 Binary files /dev/null and b/textures/bucket_mask.png differ diff --git a/textures/rs_bucket.png b/textures/rs_bucket.png new file mode 100644 index 0000000..17b0c49 Binary files /dev/null and b/textures/rs_bucket.png differ diff --git a/textures/rs_water.png b/textures/rs_water.png deleted file mode 100644 index bf6bbb4..0000000 Binary files a/textures/rs_water.png and /dev/null differ diff --git a/textures/rs_water_flowing_animated.png b/textures/rs_water_flowing_animated.png deleted file mode 100644 index b4599a9..0000000 Binary files a/textures/rs_water_flowing_animated.png and /dev/null differ diff --git a/textures/rs_water_source_animated.png b/textures/rs_water_source_animated.png deleted file mode 100644 index 0d704e6..0000000 Binary files a/textures/rs_water_source_animated.png and /dev/null differ