38 Commits

Author SHA1 Message Date
MoNTE48
484a20083f Builtin: minor patches 2021-06-15 12:39:25 +02:00
MoNTE48
9bce637615 Builtin: update game 2020-10-02 18:46:39 +02:00
MoNTE48
c430f18ad4 Fixed a possible crash when checking 'attached_node2' 2020-04-26 19:19:15 +02:00
Maksim
c59b9009cd Builtin: minor cleanup 2020-04-16 21:00:57 +02:00
MoNTE48
e6274866a6 Drop falling node if placed in protected area 2020-02-27 22:37:30 +01:00
MoNTE48
eac50692d7 Builtin items: cleanup, optimize and backport MT5 changes 2020-02-04 20:02:25 +01:00
MoNTE48
6f42bcabc6 Add attached_node2 group for attached facedir nodebox 2019-10-22 14:39:07 +02:00
MoNTE48
32c44e00c4 Builtin: Clearing Functions and Variables 2019-10-16 20:08:12 +02:00
MoNTE48
51682a1e17 Add Item water flow (by TenPlus1), fix Statbars and backport Falling node sound from MT5.0 2019-07-09 13:54:16 +02:00
MoNTE48
118b648d37 Drop falling node in multiplayer, add falling for furniture 2019-06-30 21:50:51 +02:00
MoNTE48
94c855455f Drop falling node, drop 1 item by default, hud item name delay, fix translations 2019-06-29 09:59:31 +02:00
MoNTE48
26d603f2a9 Backport "slippery" feature from MT 5.0, replace builtin deprecated function calls, move eat sound in builtin 2019-06-03 15:46:14 +02:00
paramat
1cf56c6617 Falling.lua: Delete falling node entities on contact with 'ignore'
Prevents falling node entities entering the ignore at a world edge and
resting on unloaded nodes 16 nodes below, unreachable, undiggable and
still being processed by 'on step' because they don't revert to nodes.
2018-06-03 17:32:00 +02:00
Dániel Juhász
4836612b9f Automatic item and node colorization (#5640)
* Automatic item and node colorization

Now nodes with a palette yield colored item stacks, and colored items
place colored nodes by default. The client predicts the colorization.

* Backwards compatibility

* Use nil

* Style fixes

* Fix code style

* Document changes
2018-06-03 17:31:59 +02:00
Vladislav Tsendrovskii
10cb28e176 Save metainfo for falling nodes 2017-03-11 23:42:19 -08:00
zaoqi
776f037dc2 Add minetest.spawn_falling_node(pos) (#5339)
* Add minetest.spawn_falling_node(pos)

* lua_api.txt: Add minetest.spawn_falling_node(pos)

* Update minetest.spawn_falling_node(pos)
2017-03-04 18:36:37 +01:00
Dániel Juhász
6bad2c4aee Fixes for colorwallmounted and colorfacedir nodes
Correct node placement prediction for attached colorwallmounted nodes.
Correct placement direction for colorfacedir and colorwallmounted nodes.
Correct detatch mechanism for attached colorwallmounted nodes.
2017-02-18 22:47:24 +00:00
sfan5
2554664321 builtin/.../falling.lua: Avoid crash when hitting unknown nodes 2017-01-09 16:39:40 +01:00
paramat
4471a7f75a Builtin/../falling.lua: Avoid crash when object pos over limit
If the object pos is over limit, 'add entity' will not add an entity,
causing 'obj' to be nil.
2016-12-21 13:30:10 +00:00
est31
2ae22f0c62 Introduce builtin_shared and use it to fix #4778
Fixes #4778 which was about the error:

ServerError: Lua: Runtime error from mod '' in callback item_OnPlace():
/usr/local/share/minetest/builtin/game/item.lua:278: attempt to call global 'check_attached_node' (a nil value)

The issue was a regression of commit 649448a2a91fbf3e944b2f2e739f4e2292af1df0

"Rename nodeupdate and nodeupdate_single and make them part of the official API"
2016-11-16 18:51:36 +01:00
est31
e651d7a987 Rename nodeupdate and nodeupdate_single and make them part of the official API
Now, the renamed forms of nodeupdate and nodeupdate_single are part of the official API.

As nodeupdate has been used by Minetest Game and in mods despite of not
being part of the official API, we ease the transition by still supporting
it for the 0.4.15 release. After the release, the two functions can be removed.

The removal will not violate the stability promise, as that promise only
includes the official and documented API.

Also, make some formerly global functions local. They most likely haven't
been used by mods, therefore they won't get stubs with deprecation warnings,
hard erroring directly.
2016-11-14 13:08:22 +01:00
paramat
303a2ecc00 Builtin/../falling: Fix bugs caused by 'ignore' nodes
Original commit by t4im, rebased and developed by paramat.
Fix CONTENT_IGNORE being replaced by falling nodes or causing large
areas of sand to collapse into itself.
Format some conditional code for clarity.
Add and clarify some comments.
2016-11-07 21:55:17 +00:00
tenplus1
a3a7538a92 Builtin/../falling.lua: Code optimisation 2016-10-14 02:12:32 +01:00
paramat
93a19718c8 Builtin/falling: Add fallback vector in case of nil 'wallmounted to dir'
The fallback vector is in case 'wallmounted to dir' is nil due
to voxelmanip placing a wallmounted node without resetting a
pre-existing param2 value that is out-of-range for wallmounted.
The fallback vector corresponds to param2 = 0.
2016-10-03 01:56:08 +01:00
Wayward One
1e517d120c Add on_punchnode callback 2016-05-17 22:16:21 +10:00
Auke Kok
43673c52ad falling: walk 4 additional diagonally down directions.
This seems very little cost and matches the old behavior more
closely. This will cause some more falling nodes to get added
to falling clusters. With the efficiency of the algorithm, this
really doesn't do much damage.
2016-04-20 06:51:11 +01:00
Auke Kok
eb6aed6f3e Convert nodeupdate to non-recursive
This took me a while to figure out. We no longer visit all 9 block
around and with the touched node, but instead visit adjacent plus
self. We then walk -non- recursively through all neigbors and if
they cause a nodeupdate, we just keep walking until it ends. On
the way back we prune the tail.

I've tested this with 8000+ sand nodes. Video result is here:

  https://youtu.be/liKKgLefhFQ

Took ~ 10 seconds to process and return to normal.
2016-04-11 00:01:28 -04:00
tenplus1
a7311fa0e0 stop falling.lua error
2016-03-27 15:47:01: ERROR[Main]: ServerError: Lua: Runtime error from mod '*builtin*' in callback luaentity_Step(): Node name is not set or is not a string!
2016-03-27 15:47:01: ERROR[Main]: stack traceback:
2016-03-27 15:47:01: ERROR[Main]: 	[C]: in function 'add_node'
2016-03-27 15:47:01: ERROR[Main]: 	/usr/share/minetest/builtin/game/falling.lua:96: in function </usr/share/minetest/builtin/game/falling.lua:43>
2016-03-29 23:56:23 +02:00
Rui
5285fe8c03 Falling: Set acceleration on step again
Commit

65c09a96f41705bb8e75fc5ff4276342be91ed11 "Set acceleration only once in falling node"

has made the acceleration being set only once.
But this has introduced a regression.

Fix #3884.
2016-03-25 15:19:39 +01:00
paramat
cf1d3f14f6 Builtin/game/falling: Re-add comma removed by recent commit 2016-03-19 18:46:08 +00:00
Rui914
c65b5f3bea Set acceleration only once in falling node 2016-03-19 17:56:46 +00:00
Rui
c55c7875b4 Minor tweaks __builtin:falling_node 2015-09-01 19:14:08 +02:00
Craig Davison
f7c264cec7 Fix some undeclared global variables 2014-11-26 22:50:08 +10:00
SmallJoker
6ebda3c5be Use round if falling node is misplaced
Fixes: http://i.imgur.com/arAWw1i.png (middle-right)
2014-09-28 13:33:39 +02:00
Casimir
5d75406606 Remove buildable_to nodes without dropping item when replaced by a falling node 2014-08-22 11:14:15 +02:00
sfan5
7a25f6d825 Allow custom liquids to have drops 2014-06-08 23:25:13 +02:00
ShadowNinja
9718e20bfa Use "core" namespace internally 2014-05-08 13:02:04 -04:00
ShadowNinja
6001210df6 Organize builtin into subdirectories 2014-05-07 17:14:23 -04:00