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
*.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
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
with different dripstones.
```lua
noordstar_dripstone.register_droplet("magma")
noordstar_dripstone.register_droplet("mercury")
noordstar_dripstone.register_droplet("mineral_water")
dripstone.register_droplet("magma")
dripstone.register_droplet("mercury")
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
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.
```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
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.
```lua
noordstar_dripstone.add_droplet_catcher("water", "mymod:cauldron_empty", "mymod:water_cauldron")
noordstar_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("water", "mymod:cauldron_empty", "mymod:water_cauldron")
dripstone.add_droplet_catcher("water", "mymod:dirt", "mymod:farmland")
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
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).
### 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
dripstone of a given flavor and size. Remember that dripstone size range from 1
to 8.
```lua
noordstar_dripstone.size_to_name("dry", 1)
-- Returns "noordstar_dripstone:dry_dripstone_spike"
dripstone.size_to_name("dry", 1)
-- Returns "dripstone:dry_dripstone_spike"
noordstar_dripstone.size_to_name("lol", 3)
-- Returns "noordstar_dripstone:small_lol_dripstone"
dripstone.size_to_name("lol", 3)
-- Returns "dripstone:small_lol_dripstone"
noordstar_dripstone.size_to_name("cool", 8)
-- Returns "noordstar_dripstone:cool_dripstone_block"
dripstone.size_to_name("cool", 8)
-- Returns "dripstone:cool_dripstone_block"
```
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.
![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
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).
local internal = {
@ -53,12 +53,12 @@ local internal = {
-------------------------------------------------------------------------------
-- 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)
end
-- 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)
end
@ -95,12 +95,12 @@ end
-- -- Speed of how often a droplet trickles down.
-- trickle_speed = 5
-- }
function noordstar_dripstone.register_dripstone(flavor, def)
function dripstone.register_dripstone(flavor, def)
return internal.register_dripstone_flavor(flavor, def)
end
-- 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
internal.cauldrons[droplet] = {}
end
@ -113,7 +113,7 @@ function noordstar_dripstone.register_droplet(droplet)
end
-- 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)
end

View File

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

View File

@ -1,4 +1,4 @@
name=noordstar_dripstone
name=dripstone
description=Add stalactites and stalagmites to your game.
author=Noordstar
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