1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-29 21:30:26 +02:00
Commit Graph

28 Commits

Author SHA1 Message Date
1f4291ff09 Beds: allow digging stray top nodes (#3173)
This may occur by rotating the bottom bed node without
calling the 'on_rotate' callback for various reasons.
2025-01-13 12:10:03 +01:00
31133a371e Fix set_node(air) calls
In the fireflies case it can be replaced with remove_node.
In the beds case we fix the logic to do what it should. Coincidentally the end result was correct nonetheless.
2024-04-13 13:32:18 +02:00
43185f19e3 Bed bugfix: Remove "reverse" toggle in favor of swap_node/set_node combo (#2976) 2023-12-24 13:41:26 +01:00
9a9df3a42e Fix logic error in bed rotation 2023-05-20 12:17:43 +02:00
08b13c9efb Fix deprecated alpha / use_texture_alpha use 2021-02-07 11:48:05 +01:00
e6aec880de Use Minetest 5.3 'minetest.is_creative_enabled' API (#2795) 2020-12-13 18:59:19 +01:00
DS
226e2d4c12 Add missing not_in_creative_inventory group where appropriate (#2764) 2020-11-11 15:29:43 +00:00
DS
176ddba176 Reset spawn position on bed destruction 2020-01-26 18:59:44 +01:00
14cc07bfd3 Beds: Make on_rotate function check new param2 instead of rotation mode
The on_rotate function now checks the new param2 value to determine if a rotation is valid, rather than checking the rotation mode.
This is so screwdriver-like items with different rotation modes will not be able to rotate the bed into invalid orientations.
2019-02-08 01:53:55 +00:00
5692c15b4d Disallow digging a bed if in use
Use a new table beds.bed_position to check if a bed is in use.
2018-06-19 22:07:01 +01:00
a2d7678ffd Add nil checks for placer 2017-11-15 23:16:28 +00:00
67c01a44c2 Beds: Do not crash when placing in an unknown node 2017-08-10 10:08:24 +02:00
077316b4cd Use creative.is_enabled_for for creative mode if possible (#1558) 2017-03-29 21:02:26 +02:00
78c632ebd4 Allow interaction with nodes while wielding these items.
- beds
- boats
- carts
- key/skeleton key
- seeds

All these had on_place handlers that did not allow nodes with
an on_rightclick() handler to be used first (if not using
sneak). This code is taken from the torches mod and applied
everywhere.

This allows all these items to e.g. be inserted into the `frame`
mod's item frames.
2017-02-28 18:16:12 -08:00
57eb906047 Add support for custom bed sounds 2017-01-12 12:42:38 -08:00
58038a7941 Snappy group: Remove beds and cactus from group 2016-12-05 01:41:41 +00:00
09a229b412 Update 'nodeupdate()' to 'check_for_falling()' API 2016-11-22 05:55:36 +00:00
Tim
30b0a155fb Stop shadowing upvalues and definitions. 2016-07-15 21:58:49 +01:00
Tim
71c7e21669 Always return the leftover ItemStack for on_place and on_rightclick 2016-07-09 16:32:41 +01:00
874b1ae326 Beds: Check for buildable_to for bottom half
We properly checked top half already, just not the top half
target location.

Assure both checked positions are not unknown nodes.

Fixes #991
2016-04-04 05:39:06 +01:00
da0cc7f6f6 Beds: priv/griefing fixes.
- disallow placing beds in protected areas
- fix rotation of beds(broken after 41c2b2ae)
- allow using others' beds, but don't change spawn location

Fixes #953. #943 isn't something I think was ever implemented, and
this does a fair job of addressing the main concern (spawning in
others' houses)
2016-03-21 06:17:45 +00:00
41c2b2aeea Allow both sides of the bed to be digged up.
Tested with nodebreaker, fire.

If called from lua, minetest.remove_node() calls on_destruct() callbacks
before the map is actually updated. This means that we can't look at the
map data to determine if we're done cleaning up adjacent nodes, and we
have to stop recursing some other way.

There's no data we can pass around through functions that would survive
scope to a secondary on_destruct() callback, so we have to maintain
local state somewhere in the mod namespace.

In this case, we keep a bitflag. The bitflag is set to "true" by
default. On the first half removal, the flag is flipped and afterwards
we remove the other half node. When the on_destruct for the other half
is running, it's value is false and we flip it back to true without
removing the other half node.

This thus prevents recursing.

To facilitate easier finding of the bed partner, we tell our on_destruct
whether we're a top or bottom half node through a passed flag.

Now that the top is diggable, we just need to assure that it drops a
bottom bed part.
2016-03-18 02:35:07 +00:00
45bc0b245f Beds: Fix code style issues 2016-03-09 02:44:32 +00:00
4ef6810298 Beds: Re-add commas at list ends 2015-11-14 05:18:11 +00:00
Rui
1d8def5c06 Beds: Make non pointable by pointable definition 2015-11-14 04:49:22 +00:00
e15fde1624 Fix is_ground_content settings for nodes
Remove line if set to the default of 'true'
2015-06-18 02:25:02 +01:00
2824562dc9 Add screwdriver callbacks, and code them for doors and beds 2015-05-14 10:24:56 +02:00
edb02e9d33 Add beds 2015-02-24 20:59:04 +01:00