Commit graph

137 commits

Author SHA1 Message Date
trans_soup
d0a481334a refactor stoneworking recipe code. 2023-10-17 15:05:40 +02:00
trans_soup
d197e1f1e3 move item_matches into api.
move function `item_matches` from `bg_crafting` into `bg_api`, since
it'll be useful in many other places.
2023-10-17 15:02:39 +02:00
trans_soup
7df5d33d02 refactor: extract repeated code into api function.
move function `starts_with`, which was declared twice in separate files,
to the api, and make those files use that function instead.
2023-10-17 14:58:15 +02:00
trans_soup
c31d6cf5d0 improve pummeling.
pummeling definition tables now has lists of item id:s and groups, the
same way e.g. ABM:s do, that determine what items are involved in a
recipe.

update existing (in-use) pummel recipes to make use of this.
2023-10-17 14:53:08 +02:00
trans_soup
45f59f5e03 minor refactor of recipe code.
just separated different recipe types into different files.
2023-10-17 14:28:08 +02:00
trans_soup
5305cc526d minor fix & refactors of recipe code. 2023-10-17 14:23:44 +02:00
trans_soup
17636dbf87 improve leaves decomposition.
leaves will now decompose faster depending on their surroundings.
touching dirty nodes or other decomposing leaves will make them decay
quicker.
2023-10-17 13:41:30 +02:00
trans_soup
cca53e76b3 add flood fill utility to api.
add api function for walking through the nodes surrounding a given
position.
2023-10-17 13:40:04 +02:00
trans_soup
6e205f15b7 slightly change readme. 2023-10-17 12:01:37 +02:00
trans_soup
31b2242c38 make leaves fall down when unsupported.
also refactor leaves registration code.
2023-10-17 11:25:13 +02:00
trans_soup
d884e75a24 fix: account for moved api function.
change something that should've been changed before, when the api
function in question was moved.
2023-10-17 11:24:18 +02:00
trans_soup
19d63efcf5 refactor log registration.
rename log and sapling textures to be more clear. rewrite node
registration code to account for this, and to be overall cleaner.
2023-10-17 11:23:32 +02:00
trans_soup
5a3d81787c add several utility functions related to tables.
create api functions `any`, `every`, and `underride`.

`any` and `every` checks if a condition is true for any and every item
in a table, respectively.
`underride` returns a table that defaults to a provided table, for
items that aren't specified in the other provided table.
2023-10-17 11:19:55 +02:00
trans_soup
33fbd7c35e move get_neighbors from util_node to util_vector. 2023-10-17 11:19:03 +02:00
trans_soup
d753612f0b separate falling node and loose node handling. 2023-10-17 11:18:14 +02:00
trans_soup
548d33d146 fix minor error. 2023-10-17 10:33:48 +02:00
trans_soup
18117daade make living logs have same texture as dead logs. 2023-10-17 10:30:12 +02:00
trans_soup
aaeef448f0 make decomposing leaves sometimes not create dirt.
add a 1/2 chance for decomposing leaves to disappear instead of becoming
dirt.
2023-10-17 10:27:41 +02:00
trans_soup
5d98c3dadc add growing_leaves node.
create node representing growing leaves, and use it where previously
living leaves was used. this allows for a distinction between leaves
that will try to create more leaves, leaves that can provide nutrients
to other leaves, and leaves that are dead, whereas previously the first
2 of those couldn't be distinguished.
2023-10-17 10:26:15 +02:00
trans_soup
0ff0c9274f tweak leaves spread chance. 2023-10-17 10:19:27 +02:00
trans_soup
790e00ef5c rework sapling growth.
saplings now grow straight up and attempt to grow leaves on their sides.
2023-10-17 10:17:13 +02:00
trans_soup
5879ecbd67 add get_sides_of utility to api. 2023-10-17 10:16:12 +02:00
trans_soup
1ef3759ae6 tweak to leaves decomposition.
leaves will now start decomposing if they're touching either a dirty
node, or already decomposing leaves.
2023-10-17 10:15:13 +02:00
trans_soup
8dccef9389 refactor: fix modname being hard-coded into string. 2023-10-17 09:48:48 +02:00
trans_soup
20b2dfa0c7 refactor: remove unused locals. 2023-10-17 09:47:24 +02:00
trans_soup
8ff3df7f7f remove old sapling texture. 2023-10-17 09:46:14 +02:00
trans_soup
d28bfbdaf3 add root_alive node. 2023-10-17 09:45:49 +02:00
trans_soup
a3012de73f refactor: clean up leaves registration. 2023-10-17 09:44:42 +02:00
trans_soup
c41d161802 make saplings look identical to living logs. 2023-10-17 09:43:25 +02:00
trans_soup
098e07a1e6 tweak running. 2023-10-16 21:59:12 +02:00
trans_soup
812e0a7e3b tweak leaves decomposition time. 2023-10-16 21:48:53 +02:00
trans_soup
06149b463f update readme. 2023-10-16 21:46:18 +02:00
trans_soup
2439b1264f make all leaf variants use air_flowable group. 2023-10-16 21:42:25 +02:00
trans_soup
9a3afd6d5a add support for group air_flowable.
replace the placeholder api functionality for checking whether air flows
through a node, with something that relies on a dedicated group (instead
of a hard-coded list in the api code).
2023-10-16 21:40:57 +02:00
trans_soup
6ac310f674 integrate bg_grass into bg_terrain. 2023-10-16 21:40:29 +02:00
trans_soup
dcb0eb257e update decomposition to use increasing ABM:s. 2023-10-16 21:30:57 +02:00
trans_soup
453add021d implement increasing ABM:s.
create public api function that registers "increasing ABM:s"; these
abstract over using numerical values associated with individual nodes in
ABM:s, allowing for straightforward creation of processes that occur
over time.
2023-10-16 21:27:59 +02:00
trans_soup
d04e92a15c add decomposition of leaves into dirt.
make leaves decompose over time into dirt when near dirty nodes. also
remove placeholder pummel recipe that turns leaves into dirt.
2023-10-16 20:41:09 +02:00
trans_soup
06110f157b refactor leaves node registrations. 2023-10-16 20:32:52 +02:00
trans_soup
5bc048eb12 separate leaf growth from other tree growth. 2023-10-16 19:18:29 +02:00
trans_soup
6478e66ef7 add get_neighbors function to api. 2023-10-16 19:17:52 +02:00
trans_soup
da9fb8970d change stone texture to custom texture.
(which accidentally looks very similar to minecraft clay.)
2023-10-16 18:31:56 +02:00
trans_soup
809d394e9a remove unused textures. 2023-10-16 18:31:47 +02:00
trans_soup
b6699fcc68 add loose versions of some terrain nodes.
add loose versions of dirt, grass, and cobblestone nodes.
2023-10-16 10:50:25 +02:00
trans_soup
263e98d526 add basic api support for loose nodes.
expose an api function to register "loose" versions of existing nodes,
and implement some behaviour for such nodes; they will fall down if
there is air below them, and will eventually become their non-loose
counterparts if there is not air below them.
2023-10-16 10:46:32 +02:00
trans_soup
20b29c833f complete cleanup after rename.
clean up things that were broken after renaming `bg_core` to
`bg_terrain`.

also clean up after global rename that added `bg_` prefix to every mod
name.
2023-10-16 10:14:34 +02:00
trans_soup
07987229b5 update the readme. 2023-10-16 08:59:41 +02:00
trans_soup
7755583fa4 rename mods and add hacky cleanup thing.
rename mods; add `bg_` prefix.

add hacky cleanup ABM (couldn't get LBM:s to work), that converts old
nodes into new ones according to this rename.

the cleanup doesn't do anything for items, though.
2023-10-15 18:22:13 +02:00
trans_soup
7f3535ca27 make util_stringify more robust. 2023-10-15 17:46:08 +02:00
trans_soup
d1a8ad952b fix random tick crash possibility. 2023-10-15 17:38:11 +02:00