Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions license.txt → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# MIT License

Textures:
## Textures
rs_water.png
Based on default_water.png by Cisoun from minetest_game (CC BY-SA 3.0).

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

Expand Down Expand Up @@ -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.
THE SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion depends.txt

This file was deleted.

1 change: 0 additions & 1 deletion description.txt

This file was deleted.

86 changes: 64 additions & 22 deletions init.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 = {
Expand All @@ -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,
Expand All @@ -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},
Expand All @@ -90,7 +94,7 @@ for i in ipairs(source_list) do
},
},
},
alpha = 160,
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
Expand All @@ -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
8 changes: 7 additions & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
name = rainbow_source
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
1 change: 1 addition & 0 deletions settingtypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable_colored_bucket_crafts (Craft colored water buckets.) bool false