1
0
Fork 0

Rename noordstar_dripstone mod to dripstone mod

main
Bram van den Heuvel 2024-09-04 14:26:55 +02:00
parent 2a6ffd9f92
commit ea84986206
18 changed files with 54 additions and 53 deletions

3
.gitignore vendored
View File

@ -40,4 +40,5 @@ luac.out
*.x86_64 *.x86_64
*.hex *.hex
# VSCode editor
.vscode

36
API.md
View File

@ -97,18 +97,18 @@ This mod uses **droplets** to build the dripstone. These are incredibly tiny
drops of liquid that flow down a dripstone. Currently, there are two drops of liquid that flow down a dripstone. Currently, there are two
types in use: `water` and `lava`. types in use: `water` and `lava`.
### noordstar_dripstone.register_droplet(droplet) ### dripstone.register_droplet(droplet)
Every droplet type is a unique string. Different droplets interact uniquely Every droplet type is a unique string. Different droplets interact uniquely
with different dripstones. with different dripstones.
```lua ```lua
noordstar_dripstone.register_droplet("magma") dripstone.register_droplet("magma")
noordstar_dripstone.register_droplet("mercury") dripstone.register_droplet("mercury")
noordstar_dripstone.register_droplet("mineral_water") dripstone.register_droplet("mineral_water")
``` ```
### noordstar_dripstone.add_droplet_source(droplet, nodename) ### dripstone.add_droplet_source(droplet, nodename)
In order to let droplets stream down dripstone nodes, you need to define which In order to let droplets stream down dripstone nodes, you need to define which
nodes a full dripstone block can absorb liquid from. Absorbing liquid does not nodes a full dripstone block can absorb liquid from. Absorbing liquid does not
@ -120,10 +120,10 @@ However, you don't need to do this! You could use any node, as long as it has a
name. name.
```lua ```lua
noordstar_dripstone.add_droplet_source("water", "mymod:swamp_water_source") dripstone.add_droplet_source("water", "mymod:swamp_water_source")
``` ```
### noordstar_dripstone.add_droplet_catcher(droplet, oldnodename, newnodename) ### dripstone.add_droplet_catcher(droplet, oldnodename, newnodename)
Similarly, on the other side of the dripstone, you can create a catcher that Similarly, on the other side of the dripstone, you can create a catcher that
can catch any of the liquid drops dripping down. You can use this to create can catch any of the liquid drops dripping down. You can use this to create
@ -131,12 +131,12 @@ orchids, or to create other interactions with nodes that might change from a
tiny bit of liquid. tiny bit of liquid.
```lua ```lua
noordstar_dripstone.add_droplet_catcher("water", "mymod:cauldron_empty", "mymod:water_cauldron") dripstone.add_droplet_catcher("water", "mymod:cauldron_empty", "mymod:water_cauldron")
noordstar_dripstone.add_droplet_catcher("water", "mymod:dirt", "mymod:farmland") dripstone.add_droplet_catcher("water", "mymod:dirt", "mymod:farmland")
noordstar_dripstone.add_droplet_catcher("lava", "mymod:precious_orchid", "mymod:dead_bush") dripstone.add_droplet_catcher("lava", "mymod:precious_orchid", "mymod:dead_bush")
``` ```
### noordstar_dripstone.register_dripstone(flavor, def) ### dripstone.register_dripstone(flavor, def)
You can define your own dripstone type. You need to pick a flavor (which you You can define your own dripstone type. You need to pick a flavor (which you
shouldn't namespace) and you need to offer a dripstone definition, which is shouldn't namespace) and you need to offer a dripstone definition, which is
@ -178,21 +178,21 @@ defined as follows:
For examples, refer to [this mod's init.lua file](init.lua). For examples, refer to [this mod's init.lua file](init.lua).
### noordstar_dripstone.size_to_name(flavor, size) ### dripstone.size_to_name(flavor, size)
Lastly, this function serves as a tool to help you find the node name of a Lastly, this function serves as a tool to help you find the node name of a
dripstone of a given flavor and size. Remember that dripstone size range from 1 dripstone of a given flavor and size. Remember that dripstone size range from 1
to 8. to 8.
```lua ```lua
noordstar_dripstone.size_to_name("dry", 1) dripstone.size_to_name("dry", 1)
-- Returns "noordstar_dripstone:dry_dripstone_spike" -- Returns "dripstone:dry_dripstone_spike"
noordstar_dripstone.size_to_name("lol", 3) dripstone.size_to_name("lol", 3)
-- Returns "noordstar_dripstone:small_lol_dripstone" -- Returns "dripstone:small_lol_dripstone"
noordstar_dripstone.size_to_name("cool", 8) dripstone.size_to_name("cool", 8)
-- Returns "noordstar_dripstone:cool_dripstone_block" -- Returns "dripstone:cool_dripstone_block"
``` ```
Note how the function even returns a string if the dripstone type hasn't been Note how the function even returns a string if the dripstone type hasn't been

View File

@ -2,7 +2,7 @@
This Minetest mod adds dripstone to Minetest. This Minetest mod adds dripstone to Minetest.
![Dripstone in various shapes and forms, absorbing water and lava](textures/noordstar_dripstone_preview.png) ![Dripstone in various shapes and forms, absorbing water and lava](textures/dripstone_preview.png)
You can read the [API manual](API.md) for an extensive explanation on how the You can read the [API manual](API.md) for an extensive explanation on how the
dripstone works in this mod. dripstone works in this mod.

12
api.lua
View File

@ -1,4 +1,4 @@
noordstar_dripstone = {} dripstone = {}
-- Internal values that cannot be changed by other mods (directly). -- Internal values that cannot be changed by other mods (directly).
local internal = { local internal = {
@ -53,12 +53,12 @@ local internal = {
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- Register a node that can catch a droplet from a dripstone stalactite. -- Register a node that can catch a droplet from a dripstone stalactite.
function noordstar_dripstone.add_droplet_catcher(droplet, oldnodename, newnodename) function dripstone.add_droplet_catcher(droplet, oldnodename, newnodename)
return internal.add_droplet_catcher(droplet, oldnodename, newnodename) return internal.add_droplet_catcher(droplet, oldnodename, newnodename)
end end
-- Register a new source node that can provide droplets to dripstone blocks. -- Register a new source node that can provide droplets to dripstone blocks.
function noordstar_dripstone.add_droplet_source(droplet, nodename) function dripstone.add_droplet_source(droplet, nodename)
return internal.add_droplet_source(droplet, nodename) return internal.add_droplet_source(droplet, nodename)
end end
@ -95,12 +95,12 @@ end
-- -- Speed of how often a droplet trickles down. -- -- Speed of how often a droplet trickles down.
-- trickle_speed = 5 -- trickle_speed = 5
-- } -- }
function noordstar_dripstone.register_dripstone(flavor, def) function dripstone.register_dripstone(flavor, def)
return internal.register_dripstone_flavor(flavor, def) return internal.register_dripstone_flavor(flavor, def)
end end
-- Register a new droplet type that can be absorbed and passed on by dripstone. -- Register a new droplet type that can be absorbed and passed on by dripstone.
function noordstar_dripstone.register_droplet(droplet) function dripstone.register_droplet(droplet)
if internal.cauldrons[droplet] == nil then if internal.cauldrons[droplet] == nil then
internal.cauldrons[droplet] = {} internal.cauldrons[droplet] = {}
end end
@ -113,7 +113,7 @@ function noordstar_dripstone.register_droplet(droplet)
end end
-- Get a dripstone's node name based on its flavor and size. -- Get a dripstone's node name based on its flavor and size.
function noordstar_dripstone.size_to_name(flavor, size) function dripstone.size_to_name(flavor, size)
return internal.size_to_name(flavor, size) return internal.size_to_name(flavor, size)
end end

View File

@ -15,73 +15,73 @@ if minetest.get_modpath("mcl_sounds") then
end end
-- Register droplet types -- Register droplet types
noordstar_dripstone.register_droplet("water") dripstone.register_droplet("water")
noordstar_dripstone.register_droplet("lava") dripstone.register_droplet("lava")
-- Register dripstone types -- Register dripstone types
noordstar_dripstone.register_dripstone("dry", { dripstone.register_dripstone("dry", {
sounds = dripstone_sounds, sounds = dripstone_sounds,
tiles = { tiles = {
"noordstar_dripstone_dripstone_top.png", "dripstone_dripstone_top.png",
"noordstar_dripstone_dripstone_top.png", "dripstone_dripstone_top.png",
"noordstar_dripstone_dripstone_side.png", "dripstone_dripstone_side.png",
}, },
on_droplet_receive = { on_droplet_receive = {
water = "watered", water = "watered",
lava = "molten", lava = "molten",
}, },
}) })
noordstar_dripstone.register_dripstone("watered", { dripstone.register_dripstone("watered", {
drop = noordstar_dripstone.size_to_name("dry", 1), drop = dripstone.size_to_name("dry", 1),
grow_to = "dry", grow_to = "dry",
on_droplet_receive = { on_droplet_receive = {
lava = "hardened", lava = "hardened",
}, },
sounds = dripstone_sounds, sounds = dripstone_sounds,
tiles = { tiles = {
"noordstar_dripstone_watered_dripstone_top.png", "dripstone_watered_dripstone_top.png",
"noordstar_dripstone_watered_dripstone_top.png", "dripstone_watered_dripstone_top.png",
"noordstar_dripstone_watered_dripstone_side.png", "dripstone_watered_dripstone_side.png",
}, },
trickle_down = "water", trickle_down = "water",
}) })
noordstar_dripstone.register_dripstone("molten", { dripstone.register_dripstone("molten", {
drop = noordstar_dripstone.size_to_name("dry", 1), drop = dripstone.size_to_name("dry", 1),
grow_to = "dry", grow_to = "dry",
on_droplet_receive = { on_droplet_receive = {
water = "hardened", water = "hardened",
}, },
sounds = dripstone_sounds, sounds = dripstone_sounds,
tiles = { tiles = {
"noordstar_dripstone_molten_dripstone_top.png", "dripstone_molten_dripstone_top.png",
"noordstar_dripstone_molten_dripstone_top.png", "dripstone_molten_dripstone_top.png",
"noordstar_dripstone_molten_dripstone_side.png", "dripstone_molten_dripstone_side.png",
}, },
trickle_down = "lava", trickle_down = "lava",
trickle_speed = 6, trickle_speed = 6,
}) })
noordstar_dripstone.register_dripstone("hardened", { dripstone.register_dripstone("hardened", {
sounds = dripstone_sounds, sounds = dripstone_sounds,
tiles = { tiles = {
"noordstar_dripstone_hardened_dripstone_top.png", "dripstone_hardened_dripstone_top.png",
"noordstar_dripstone_hardened_dripstone_top.png", "dripstone_hardened_dripstone_top.png",
"noordstar_dripstone_hardened_dripstone_side.png", "dripstone_hardened_dripstone_side.png",
} }
}) })
-- Register droplet sources above dripstone blocks -- Register droplet sources above dripstone blocks
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
noordstar_dripstone.add_droplet_source("water", "default:river_water_source") dripstone.add_droplet_source("water", "default:river_water_source")
noordstar_dripstone.add_droplet_source("water", "default:water_source") dripstone.add_droplet_source("water", "default:water_source")
noordstar_dripstone.add_droplet_source("lava", "default:lava_source") dripstone.add_droplet_source("lava", "default:lava_source")
end end
if minetest.get_modpath("mcl_core") then if minetest.get_modpath("mcl_core") then
noordstar_dripstone.add_droplet_source("water", "mcl_core:water_source") dripstone.add_droplet_source("water", "mcl_core:water_source")
noordstar_dripstone.add_droplet_source("lava", "mcl_core:lava_source") dripstone.add_droplet_source("lava", "mcl_core:lava_source")
end end
if minetest.get_modpath("mclx_core") then if minetest.get_modpath("mclx_core") then
noordstar_dripstone.add_droplet_source("water", "mclx_core:river_water_source") dripstone.add_droplet_source("water", "mclx_core:river_water_source")
end end

View File

@ -1,4 +1,4 @@
name=noordstar_dripstone name=dripstone
description=Add stalactites and stalagmites to your game. description=Add stalactites and stalagmites to your game.
author=Noordstar author=Noordstar
title=Noordstar Dripstone title=Noordstar Dripstone

View File

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

View File

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 332 B

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

View File

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 332 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

Before

Width:  |  Height:  |  Size: 177 B

After

Width:  |  Height:  |  Size: 177 B

View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB