Compare commits

...

192 Commits

Author SHA1 Message Date
Lars
6dac4d264b Fix possible invalid object reference in TNT mod 2024-06-05 00:46:51 -04:00
a634fa5436 mod - firefly - fix wrong check for object on place 2024-04-26 17:28:29 -04:00
201cf5ffa3 mods doors - fix error on sounds that xpected table on new engines
* fix error `bad argument #5 to 'register_item_raw' (table expected, got string)`
2024-04-26 17:22:21 -04:00
f757878120 mod creative - fix check for newer lang on engine 2024-04-24 15:12:33 -04:00
cf9778abb3 mods weather: Fix error caused by missing biomes
* backported from 3425f97009
2024-04-24 13:51:20 -04:00
8c07924bf1 Fix Warning spam about use_texture_alpha
* Previously the alpha value in the nodedef indicated the transparency
  the water was actually rendered with. Now only the alpha in the texture
  is respected.
* Closes and fixes https://github.com/minetest/minetest_game/issues/2819
* Backported https://github.com/minetest/minetest_game/pull/2822
* this is the same as https://github.com/minetest/minetest_game/pull/2729
2024-04-23 18:04:16 -04:00
ab354d538d mods - hudbars - improve warning message definition about old api vs newer one of 3d_armor
* backport commit 94de1bf2bc75071526d1a68d29bc9c4ed9da5dd0 from upstream
2024-04-23 13:25:41 -04:00
c398a66406 remove paramtype2="glasslikeliquidlevel" from glass nodes
* backported https://github.com/minetest/minetest_game/pull/2963/files
* closes https://github.com/minetest/minetest_game/issues/2962
2024-04-18 16:57:49 -04:00
14e4c43a21 Beds: Replace hardcoded values of day interval with constants
* backported https://github.com/minetest/minetest_game/pull/2990
* backported commit 2e8ac46120
2024-04-18 16:42:14 -04:00
1f2b954d9e more player checks for nil on fireflies 2024-04-18 15:55:27 -04:00
45e4ebf607 Make bugs only pointable with Bug Net
* Add legacy compatibility making to work with older clients
* backported https://github.com/minetest/minetest_game/pull/3099
* backported commit ef788d0307
2024-04-18 15:44:04 -04:00
0ca6bc101a Fix some placer nil checks
* backported upstream commit 70cf7a26fd
2024-04-18 15:28:50 -04:00
8111e46f8d Fix flammable item entities crashing
* https://github.com/minetest/minetest_game/issues/2657
* https://github.com/minetest/minetest_game/pull/2659
* backported 33eb7cee2a
2024-04-18 13:40:29 -04:00
7f796449ee mods - default - backported Override builtin item entity the portable way
* closes https://codeberg.org/minenux/minetest-game-minetest/issues/16
2024-04-17 22:22:09 -04:00
17bf7edce8 mods - default - ingtegrated sunglasses with CC-BY-SA-NC over source code and art
* original author not found and minietest developers are so petty to respond
* closes https://codeberg.org/minenux/minetest-game-minetest/issues/14
2024-03-31 22:59:18 -04:00
08c2829858 stairs - fix multiengine protocol loading of sound table 2023-08-13 19:35:09 -04:00
62f9150940 player_Api - dinamically set the model player on client conection
* improves previous commit 13cd243a031ca6c52457032e0bffc8576b549b3a ,
  the problem is that both server and client must be equal protocol, so
  this ugly hack check if this was loaded into FinalMinetest or Multicraft
  to dinamically check client nature and re-registering the model when
  server and client do not have same player models due the colisionbox check
* NOTE: the check already need to check if the engine is old and the server not,
  so the conditional just try to do exact check agains TRUE boolean.
* Closed https://codeberg.org/minenux/minetest-game-minetest/issues/12
  fixed the problem of collisionbox for the lufix player in ugly way but
  much more effectivelly due can be mixed in FinalMinetest and Multicraft
2023-08-13 19:22:40 -04:00
13cd243a03 update player model remove vertial 1 node offset on newer engines only
* Player model: Remove vertical 1 node offset for new engines, but
  Required due to the settable player collision box engine feature
  change for MT/MTG v0.5.0 that breaks compatibility with old client
  so due that this commit will added backguard compatibility
* Autodetec minetest versoin engine and provide right model
  character, update player code to provide compatibility with player_api
2023-08-06 12:29:04 -04:00
6bcaca9091 mods hudbars+hbarmor+hbhunger - make check for max_hp witout segfault old engines
* optimize checks, only set once, upgrade upstream
* use right supported check for version string
* do not make redundant checks and set of hp_max
* property set log warning notification when parts of mod are not used
* autodetect armor mod and able to work without it
2023-07-26 01:23:32 -04:00
61d9e37c7f mods - hudbars+hbarmor+hunger - fusion into a simgle loading mod
* fix workaroun about ssettings not configurable
* do not hardcoded hp_max from other mods, unless configured here
* provide settings for hbhunger steps
* provide settings for auto hide or not hbarmor
* document those missing features
* mark mod with version 2.3.5.0 and using redo flag
* detection of original mods and bypass build-in own features
* optimize loading of hubar for armor, bad initialization
* real check player becouse of wrong implementation at engine
2023-07-24 15:31:12 -04:00
e3c6aba6c1 mod - hudbars - already set max hp at core 2023-07-19 01:46:04 -04:00
e9a6c74826 mods - hudbars : not hardcoded the hb.init_hudbar max values
* real fix for missing format_string_config.textdomain
  backpoted from c219b708f8
* fix the backguard compatibility for format_string_config.format_string
* add configuration settings for hp_max of player and breath_max
* do not hardcoded hp_max neither breath_max and honor customizations
* real fix of get_properties when join players
* set alternate honored max values before get_properties when join players
* increase default ticks of updates for hud bar, to avoid performance
  issues in low end devices
* optimize and fix texture image
2023-07-17 01:18:14 -04:00
mckayshirou
a3cc45174b fix creative mode mod backguard compatibility for all engines
* dont follow the creative upstream mod,
  its just wrapper around get_bool(creative) setting, so create a check privilegie
  function and provide backguard compatibility checks
* backported fix from c770d5cb43
  same backported from c770d5cb43
2023-07-13 22:35:30 -04:00
04e221c0a8 integrated nice hudbars into our default minetest game
* checkout facc2cffb8
* version 2.3.4 with many backported fixeds
2023-06-20 00:48:12 -04:00
09b16c7dcc sfinv - sfinv_home set better text for home button 2023-06-18 04:56:40 -04:00
04c077e570 fireflies - fix wrong conditional 2023-06-18 04:37:27 -04:00
f4577ce506 sfinv - minor details, depends, sync upstream 2023-06-18 03:30:04 -04:00
2a319087ce update readme mod list 2023-06-18 03:18:39 -04:00
06b782a287 Merge sync 'stable-5.2' to stay in sync with featured fireflies mod
* integrate creative new mod
* featured fireflies with ethereal support
2023-06-18 03:11:11 -04:00
fc4ab2538d fireflies - sync with oiginal and add support for ethereal
* sync with fireflies of upstream original mod and from minenux
* Add vessels group to firefly vessel
* Detect creative mode and creative privilegies, using creative mod
* Detect ethereal mod and provide more biomes of place
2023-06-18 03:10:19 -04:00
1c50f2a3cb fireflies - optimize textures 2023-06-18 02:38:21 -04:00
d5fb7ea978 creatuve - updated upgraded simplified and provide privilegie feature
* register privilegie of creative for older or newer engines
* enhanced the formspec of the creative player to 4 rows
* try to upgrade most close to track upstream original
* return back text button, remove extra media
  check https://notabug.org/TenPlus1/creative/issues/2
* update readme information to diference features
2023-06-16 00:39:07 -04:00
84b779f8df creatuve - updated upgraded simplified and provide privilegie feature
* register privilegie of creative for older or newer engines
* enhanced the formspec of the creative player to 4 rows
* try to upgrade most close to track upstream original
* return back text button, remove extra media
  check https://notabug.org/TenPlus1/creative/issues/2
* update readme information to diference features
2023-06-16 00:38:15 -04:00
f621a7660c sfinv - upgrade sfinv and integrated sfinv_home to sfinv 2023-06-12 00:32:04 -04:00
ae1ba2c463 sethome - update mod to upstream 2023-06-12 00:04:32 -04:00
b722a98fef toolranks - fix mt 5.X depends 2023-06-11 23:20:43 -04:00
7a7d33b3fa Fix many workbench and enchanting table bugs from MT-Eurythmia
* fix crash https://github.com/Mynetest/Mynetest-server/issues/105
* detect that hammer is present and detect if that mese list are mese
* backported https://github.com/MT-Eurythmia/xdecor/commit/59a65c60611ebe8ef3ced2e406968f049>
* backported https://github.com/MT-Eurythmia/xdecor/commit/28a24a805be109eb8ab32b8633b1dfef5>
2023-06-11 21:46:40 -04:00
7c7e763942 xdecor - crash avoiting: Added further sanity check and update formspecs
* update xdecir minenux up to 20230611
* backporting https://notabug.org/minenux/minetest-mod-xdecor/commit/3e0ca1304d454297739d6f8>
* backporting https://github.com/0siribix/xdecor/commit/c7e756afc7d246817209c415c6e9a9dda533>
* backporting https://github.com/0siribix/xdecor/commit/3823fce1e05a9472e7cf798c8346ba95ead1>
* backporting 9f4002b749
2023-06-11 19:57:46 -04:00
5452ce0dda mods - add tenplus1 toolranks with some backported changes features
* toolranks from minenux with spanish translation and featured description
* backguard compatibility
2023-06-11 14:52:42 -04:00
530947f110 creative - upgrade creative and featured lasted
* track changes from 5.X default games
* track changes fromo tenplus1 mod
2023-06-11 06:09:30 -04:00
b468d2395a farming - make apples 3d backporting the 3d_apples mod 2023-06-07 17:24:12 -04:00
a19a71adec xdecor - fix possible bad array on enchanting code, related to some bugs
* update mod to f6d0f0b2a5c1d435217bb3409a76da9eb36fe889 with node info
2023-06-07 16:34:53 -04:00
903ff2bcfb incorporate xdecor a more light respect homedecor 2023-06-06 15:13:25 -04:00
1468480663 update farming mod for mt game v5 2023-06-06 11:30:16 -04:00
mckayshirou
dd746f655e fix the game version supported, this is stable-5.2 2022-08-24 22:19:09 -04:00
Герхард PICCORO Lenz McKAY
ea03176fb9 remote sync 'stable-5.2', update LICENSE and fix boath conditional api detection
* set real author of this game set historycally
2022-08-24 22:15:49 -04:00
6cdadb4984 update information and references.. LICENSE and real author
* provide LICENSE clarification about real autor historicaly (blockmen)
2022-08-23 11:22:47 -04:00
76479e1eff update information and references.. use git.minetest.org as mirror 2022-08-23 11:10:29 -04:00
3f377ac386 v 20220728 - update boats mod, fix missing global minetest object access
* property detect the feature using the namespace global var
2022-07-26 16:30:03 -04:00
Герхард PICCORO Lenz McKAY
f3d73386a2 merge fix for misc error (fix misc error on boat contidional)
* recommit 58c2cb6d89bf5bfc3da8818842d081d847d92ecd after upgrade boats
* sync merge with 5.2 stable brach from codeberg repo
2022-07-26 15:31:47 -04:00
Герхард PICCORO Lenz McKAY
b8ae1c4ccd v 20220614 - update boats mod, fix player api detection
* property detect the player api respect engine game version
2022-06-14 23:54:17 -04:00
Герхард PICCORO Lenz McKAY
07a1de54a0 v 20220614 - update beds mod, minigame support and engine detection
* minigame support
* proper engine detection for respawn
* add red and white bed
2022-06-14 23:16:05 -04:00
58c2cb6d89 fix misc error on boat contidional 2022-04-14 20:42:56 -04:00
fcff52f049 Fix flammable item entities crashing
* backported from https://github.com/minetest/minetest_game/pull/2659
* fix to close https://codeberg.org/minenux/minetest-game-minetest/issues/11
2022-04-14 20:40:09 -04:00
dde9a5338e upgrade beds,boats,bucket,carts,creative,doors,farming,fire,stairs,tnt,wool
* beds 7b6fae96d5
* boats 3832de08f7
* bucket 1d9f32295a
* carts dcbca916cf
* creative ca09e77370
* doors a89ab0454d
* farming 00e4b3cb89
* fire 4e5f7ad553
* stairs c3a5af6c45
* tnt 8195861f90
* wool de642a08e8
2022-03-09 12:52:16 -04:00
239e7287c6 improve README and api documentation 2022-02-28 20:06:40 -04:00
e7b5ffbc47 docs - fix missing colon in sintax game_api 2022-02-28 19:22:08 -04:00
ee86fb1c41 * document, configure and improve the give_initial_stuff
* This mod provides some stuff per player at initial play when first join only
* set initial_stuff = default:wood 2,farming:bread 2,default:furnace 1,default:torch 5
* the initial_stuff is only configured per config files not at menu
* cherry-picked from 18aed0219b
2021-12-13 20:27:13 -06:00
ac2dd7e3e5 set art and game default, use minenux name and logo venenux 2021-11-30 22:50:51 -04:00
sfan5
eb64ff94f8 Use node particles for TNT explosions (#2695) 2021-11-23 23:21:04 -04:00
sofar
5979c4188d Fix builtin item metatable (#2328)
Co-authored-by: Alexander Weber <web.alexander@web.de>
2021-11-23 23:18:49 -04:00
11102e4e17 minetest 5 game with some backports from 5.3
* updated README for our fork minenux
* minetest 5 game with some backports from 5.3
* Fix boat floating in the air when water being drained away
  backported https://github.com/minetest/minetest_game/pull/2788
  fixed
* Do not crash when a skeleton key is used on an unknown node
  backported https://github.com/minetest/minetest_game/pull/2806
* default: Add missing nodes to list
  backported https://github.com/minetest/minetest_game/pull/2799
2021-11-23 23:08:23 -04:00
The most random of all meshes
27e70c9524 Fix boat floating in the air when water being drained away (#2788) 2021-11-23 23:01:13 -04:00
Montandalar
4e3afc0035 Do not crash when a skeleton key is used on an unknown node (#2806) 2021-11-23 23:00:21 -04:00
An0n3m0us
7e515b261d default: Add missing nodes to list (#2799) 2021-11-23 22:59:19 -04:00
sfan5
eb0b314fb3 Fix crash on TNT explosions if tnt is disabled 2021-11-23 22:51:37 -04:00
sfan5
8863527bb6 Fix respawn not working at all when suitable position was not found
The player should always be teleported away when they die and
we can still fall back to the engine spawning code.
2020-04-04 13:06:40 +02:00
sfan5
fbbc7fc996 player_api: Prevent knockback when player is set as attached
This is not directly related to player models but fits well
as a convenience feature in player_api.
2020-03-17 22:08:36 +01:00
TumeniNodes
b9dc758fef
xpanes: fix code style (#2618) 2020-03-15 15:12:21 +01:00
TumeniNodes
8b3b92dfdf
xpanes: remove unused textures (#2614) 2020-03-07 20:25:43 +01:00
sfan5
07a8067348
Fix TNT mod crash when entities disappear during explosion (#2616) 2020-03-06 21:51:19 +01:00
sfan5
3a863053c0
Dungeon loot: Warn on unknown registered loot items (#2613) 2020-03-06 21:51:07 +01:00
IFRFSX
91ac075cff
Update Chinese Translation, Add Traditional Chinese Translation (#2596) 2020-03-02 21:53:12 +01:00
SmallJoker
fe9cdba0ec
Creative: Skip redundant refreshes, fix reset button (#2611)
Skips redundant calls to creative.update_creative_inventory and fixes the 'Reset' button which double-refreshed the filter cache.
2020-03-02 21:41:42 +01:00
An0n3m0us
8d9aa07752
Sort loot registration into respective mods (#2602) 2020-02-23 14:41:13 +01:00
Andrey2470T
34b410319e
Increase speed of flowing water/river water animations
To visually match the 1 node per second spread of flowing water.
2020-02-14 00:01:15 +00:00
An0n3m0us
3ea648f5bf
Disallow screwdriver rotating torches, to avoid bad torch rotations 2020-02-11 03:58:41 +00:00
An0n3m0us
232cc2bd1c
Add log for seeds on place 2020-02-10 22:00:40 +01:00
Paramat
db632b67bf
Fix missing papyrus in savanna, add a dry dirt version
Papyrus was missing from the dry dirt 'savanna_shore' biome due to
only being placed on dirt. A mistake made when changing savanna
dirt to dry dirt.

Rename existing papyrus schematic to 'papyrus_on_dirt' and only
place in the 'rainforest_swamp' biome.
Add a new papyrus schematic 'papyrus_on_dry_dirt', placed in the
'savanna' biome.
2020-02-09 01:34:17 +00:00
Louis Royer
1420376e32
Fix french translation of snow block slab 2020-02-08 21:06:17 +00:00
Paramat
9bf64b61c2
Fix simple bed height, make player lay down just above it, not inside it 2020-02-08 03:11:44 +00:00
IFRFSX
f255e36d78
Add traditional Chinese translation (#2579) 2020-02-06 20:15:13 +01:00
sfan5
d3e26dba18 Convert minetest.sound_play uses to ephemeral 2020-02-05 22:24:23 +01:00
DS
176ddba176 Reset spawn position on bed destruction 2020-01-26 18:59:44 +01:00
IFRFSX
eac4795326 Update Chinese translation (#2563)
rail = 轨道 / 栏杆
grass = 草

and, mese color is yellow, so i translate it to "黄石"。(Chinese words without MESE)
2020-01-25 16:55:14 +01:00
Zaoqi
da39bae50e Add zh_CN translation 2020-01-22 19:09:38 +01:00
Konstantin Ilyashenko
7e9a54abaf Replace Russian translation of Pickaxe (#2556) 2020-01-09 19:09:06 +01:00
Lejo
beb0aefa2d Make can_interact_with_node() check for key group instead of default:key 2020-01-06 21:16:33 +00:00
Thomas--S
1940961d63 Move duplicate recipe from books to default.register_craft_metadata_copy()
This allows mods to easily implement the same behaviour, e.g. for letters.
2020-01-04 00:09:58 +00:00
An0n3m0us
6e32287a42 Move crafting, cooking and fuel recipes into corresponding files 2020-01-01 01:38:06 +00:00
Zaoqi
1082466796 Rename core to minetest (#2552) 2019-12-29 12:28:30 +01:00
An0n3m0us
258332578a Player model: Add bobbing to walk animation, more subtle standing animation 2019-12-23 02:14:25 +00:00
Paramat
150122bfe7
Remove Mapgen V7 floatland biome code
In preparation for a new Mapgen V7 floatland implementation.
2019-12-18 23:59:45 +00:00
Paramat
d04b709181
Add missing 'weather' mod documentation to minetest.conf.example 2019-12-18 22:32:09 +00:00
Paramat
c0335e24c9
Convert grass footstep sounds from stereo to mono 2019-12-18 22:31:29 +00:00
Maksim
f176ba4873 Make tool crafting recipes more compact, move to tools.lua 2019-12-16 00:29:33 +00:00
Paramat
5b21d1de34
README: Use correct link, make link clickable 2019-12-04 20:38:01 +00:00
Muhammad Nur Hidayat Yasuyoshi (MNH48)
710605687b Add Malay translation 2019-11-30 17:31:40 +01:00
Aresiel
10dce79451 Add Swedish translation 2019-11-30 17:31:29 +01:00
OgelGames
0f764bf447 Coral 'on place': Pass node to 'on rightclick', not node name 2019-11-28 02:01:19 +00:00
Kevin Nel
00a8bd521a Fix popping sound in default_grass_footstep (#2538) 2019-11-25 10:50:20 +01:00
Andrey2470T
2f6d0bf267 Add 4th item row to creative inventory. Align search, trash, page navigation 2019-11-23 21:35:02 +00:00
An0n3m0us
d9f8c6cc43 Escape translated text in 'beds' mod formspec 2019-11-22 21:47:47 +00:00
Paramat
5b1875ef41
Papyrus: Add to the rainforest swamp biome
Previously, papyrus was limited to the savanna biome.
Rainforest is a suitable habitat for papyrus.
Makes papyrus a little less difficult to find.
Move swamp jungletrees into a separate registration, to allow
applying distribution by perlin noise to keep these away from
papyrus areas.

Fix error: Remove non-functional 'rainforest swamp' from the
biome list for the jungle log decoration. It is not placed in
swamps due to the 'y max/min' and 'place on' parameters.
2019-11-15 19:47:14 +00:00
SmallJoker
5017f3b614 Weather: Replace deprecated get2d with get_2d 2019-11-13 19:59:58 +01:00
Andrey2470T
6fea665fcc Add Russian translation (#2525) 2019-10-24 21:54:20 +02:00
Bartosz
dd71dcbcf6 boats: Improve physics by implementing drag and friction forces
Implement drag force according to the equation:
drag_force = drag_coefficient * speed ^2
Also add a small constant force to implement friction force.
2019-10-24 03:47:28 +01:00
sfan5
f9a9e87af6
Improve creative inventory search (#2523) 2019-10-22 22:46:19 +02:00
Paramat
7caa5d36f2
Move hotbar code/textures, and damage sound, from player_api to default
These are unrelated to the Player API and player object.
All other GUI/HUD code and textures are in default.
All other engine hardcoded sounds are in default.
The player_api mod is highly likely to be used unchanged in new games,
so logical grouping of content will help the creation of new games.
2019-10-18 02:43:06 +01:00
Paramat
7c1fd9c24e
Add initial 'weather' mod to vary cloud density, thickness, velocity 2019-10-15 00:38:41 +01:00
luk3yx
ef7df329d2 Fix duplicate background in formspec prepend (#2524) 2019-10-14 22:53:57 +02:00
Lars Hofhansl
6042e963f7 Increase (ocean) water opacity to 191 2019-10-12 18:35:56 +02:00
Hamlet
93a49f082c Italian translation (#2491) 2019-10-12 14:30:37 +02:00
JDiaz
a00ff24df9 Spanish Translation (#2505) 2019-10-10 21:19:20 +02:00
DrHackberry
0f369b43fe French translation (#2514) 2019-10-10 21:18:25 +02:00
sfan5
f87c3d05ae player_api: Set correct visual size for legacy player model 2019-10-06 14:06:02 +02:00
SmallJoker
1c413ede9a Use background9 for backwards compatibility 2019-10-05 17:55:42 +02:00
Wuzzy
8c9821b227 Update translation templates and German (#2512) 2019-10-03 18:44:34 +02:00
SnicklePickles
ce1eaeebbe Grammar updates README.txt 2019-10-01 21:47:58 +02:00
TumeniNodes
f2a07b0a51 Xpanes: Add new steel bar door/trapdoor sounds
No longer use the unsuitable steel door/trapdoor sound.
2019-09-28 21:53:50 +01:00
Alex Yst
c800398593 Always disable leafdecay for player-placed leaves, even when 'sneaking'
Avoids player-placed leaves decaying when building while sneaking, which is common.
2019-09-28 21:10:26 +01:00
An0n3m0us
05375c0fd4 Fix glass panes sides (#2500) 2019-09-27 00:35:06 +02:00
TumeniNodes
23ceb30e88 Xpanes: Register steel bar door and steel bar trapdoor
Register using the 'doors' mod API.
2019-09-22 23:05:38 +01:00
Wuzzy
106c36da33 Add translation templates and German translation 2019-09-22 13:42:40 +02:00
Paramat
86a55d3584
Marram grass: Fix noise flags to make 2D noise 'eased' (#2493)
Increase noise resolution from 4 to 2 nodes for a higher quality
distribution.
Retune noise parameters to compensate for using eased noise.
2019-09-21 21:28:09 +01:00
An0n3m0us
b31795dd04 Vessels: Fix vessels shelf infotext 2019-09-21 11:45:03 +02:00
sfan5
3f7cd062c3
Fix trapdoor infotext to correctly describe the type of trapdoor 2019-09-20 20:56:20 +02:00
sfan5
09bed49b5a
Fix door infotext to correctly describe the type of door 2019-09-20 20:10:58 +02:00
leucome
00f9287075 Leafdecay: Use param2 ~= 1 instead of param2 == 0 2019-09-19 02:13:18 +01:00
An0n3m0us
cbb0529ace Set fuel percentage to decrease (#2481) 2019-09-19 00:36:50 +02:00
sfan5
b4c7522248
Fix more translation strings (#2487) 2019-09-18 20:38:27 +02:00
mbartlett21
c42a525ce8 Add option for non-jumpable fences and walls
Add an option, default disabled, to extend the collision boxes upwards.
2019-09-16 21:38:02 +01:00
An0n3m0us
1f7ea89cb6 Add missing infotext to nodes (#2477) 2019-09-14 20:30:26 +02:00
sfan5
888383a812 Fix water no longer waving
broken by bb9279ccb843937bc8001ce333e3ccb71b0dba2d
2019-09-14 14:30:44 +02:00
An0n3m0us
88114a74e9 Add vessels group to firefly vessel 2019-09-13 20:47:09 +02:00
sfan5
e4adb01fbf
Fix and improve translation strings (#2471) 2019-09-12 19:03:10 +02:00
Paramat
ea992bdace
Add initial environmental sounds mod with flowing water sounds
default:river_water_source can also create sound if desired as
rivers are considered to be flowing water.
A simple mod for now, with the intention to later use new engine
environmental sound features if/when they appear.
2019-09-12 00:46:40 +01:00
Yves Quemener
bb9279ccb8 Add support for MT 5 game translation (rebasing ) (#2466)
rebased #2368
2019-09-10 19:09:51 +02:00
mbartlett21
d99a176b69 Xpanes: Use 'swap node' instead of 'set node' 2019-09-06 21:39:23 +01:00
Panquesito7
7e16ec7a2f Convert README.txt to Markdown format 2019-09-05 22:39:24 +01:00
Paramat
e8097c9e87
Creative: Override the hand instead of re-registering
Allows the initial hand registration to alter the 'wield_scale' without
needing to also alter it in creative mod.
Also make default mod a dependency again, as the initial hand
registration is required.
2019-08-31 19:44:17 +01:00
Paramat
5c3e4b1d20
Spawn: Avoid spawning outside small worlds
Previously, the value of 'mapgen_limit' was not used to limit the
spawn position.
If a friendly-biome spawn point is not found within a small world,
spawn point falls back to the engine spawn point, which has a larger
chance of success.
2019-08-28 03:19:34 +01:00
TumeniNodes
553b0f9d72 Add new TNT sounds 2019-08-28 03:06:23 +01:00
Paul Ouellette
7269711911 Furnace: Improve fuel item replacement support
The output returned by `get_craft_result` has a replacements table that
contains any replacement items that could not be placed in the input
(due to the input stack having a count > 1). Put these replacements in
the dst list or drop them on the furnace.
2019-08-20 21:15:28 +02:00
coil
3a3f71aa50 Verify object is player before checking privs (#2448)
This prevents a crash when a 'nil' digger is passed by the engine to
minetest.node_dig.
2019-08-19 19:24:19 +02:00
Paramat
fac8f390b1
TNT: Remove unusable sounds, use temporary placeholders 2019-08-18 19:47:06 +01:00
Paramat
4eadf80634
Sfinv: Add and use a crafting arrow texture instead of using furnace arrow 2019-08-13 21:57:32 +01:00
Paul Ouellette
e5ebb36cd5 Furnace: Fix "output full" infotext 2019-08-11 16:28:02 +02:00
Paramat
2063fcd075
Make the creative mod hand dig 'dig_immediate' nodes fast
Engine change now makes this possible.
2019-08-03 20:51:58 +01:00
HybridDog
a2254bd0af Warn when a mod registers a stairs node with an existing name 2019-08-01 21:55:26 +02:00
TumeniNodes
7f830124f7 Various mods: Use " " instead of ' ' for item names 2019-08-01 02:40:39 +01:00
TumeniNodes
a5bde8e9ba Default: Use " " instead of ' ' for item names 2019-07-31 00:16:44 +01:00
Paramat
6716fc74ec
Add patches of bare 'dry dirt' to savanna
Tune noise to appear roughly where long dry grass is least dense and shortest.
2019-07-30 03:55:17 +01:00
TumeniNodes
c32b8adaa3 Add 'dry dirt' and 'dry dirt with dry grass' nodes for savanna biome 2019-07-26 17:50:44 +01:00
TumeniNodes
4282a93a02 Creative: Add 'default' as optional dependency
Fixes bugs caused by removing 'default' as a hard dependency.
2019-07-22 02:26:52 +01:00
Paramat
d16612c1cb
Add new, longer 'default_grass_side' texture
Update side texture to match the new top texture.
3/4 side coverage instead of 1/2,
2019-07-22 02:18:20 +01:00
Paramat
9fe877ef99
Creative: Remove unnecessary dependency on 'default' 2019-07-21 03:24:47 +01:00
sfan5
a81a7e0c78
Merge pull request #2322 from Calinou/travis-luacheck-color
Enable colored Luacheck output on Travis CI
2019-07-17 00:38:30 +02:00
sfan5
9b226c7045 Switch to mod.conf, delete deprecated depends.txt 2019-07-17 00:38:23 +02:00
sfan5
773011fd85 Fix potential crash when few loot items are registered 2019-07-16 23:29:29 +02:00
sfan5
c3403936d3 Fix luacheck warning 2019-07-16 23:17:14 +02:00
sfan5
b701e500aa Support for icesheet dungeons in dungeon_loot 2019-07-16 22:26:35 +02:00
sfan5
37710866f0 Switch dungeon type detection to biome name
see #2400, also removed a now unused alias
2019-07-16 22:26:35 +02:00
TumeniNodes
bfb84da39c Add new 'default_grass' texture 2019-07-15 17:43:05 +01:00
Paramat
3bca295da8
New lighter, greyer permafrost texture 2019-07-13 23:35:25 +01:00
acmgit
83fb6fe872 Remove stack_max from bucket:bucket_empty 2019-07-13 17:47:45 +01:00
SmallJoker
95aaec6670 Allow opening chests when wielding corals
Code simplification by combining the on_place functions.
2019-07-12 20:01:27 +01:00
bell07
5b1d5819e5 Unify hotbar formspec for sfinv and creative
sfinv: Add lists above the content to support listrings in content.
Reuse sfinv inventory lists for creative.
2019-07-10 21:55:35 +01:00
luk3yx
3d530e0c25 intersects_protection(): Fix compatibility code 2019-07-03 19:10:39 +02:00
Paramat
e7be81242b
Define dungeon nodes in biome definitions (#2400)
Icesheet ice dungeons now have ice stairs.
Remove some now-unnecessary sandstone mapgen aliases, one
remains as it is required by the dungeon loot mod.
Re-arrange mapgen aliases to separate those needed for mgv6.
2019-07-01 21:58:47 +01:00
rubenwardy
a6a719967a Use 9-slice background in formspec theme 2019-06-24 00:10:13 +01:00
t0ny2
54bb0afe7f Make waterlily wave when placed on waving water 2019-06-16 22:09:36 +01:00
SmallJoker
0f771a27c3 Allow overriding default.after_place_leaves and default.grow_sapling 2019-06-07 20:35:24 +01:00
Paramat
ca7c131133
Large cactus schematic: Don't force-place root node
This schematic is used for sapling-grown large cacti, so should not
destroy the sand node below, as sand nodes are in short supply in
some situations.
Like trees, only force-place the node that replaces the sapling.
2019-06-07 20:34:13 +01:00
acmgit
61bfac0fa2 Prevent potential crash caused by moss growth ABM 2019-06-02 18:50:20 +01:00
An0n3m0us
e19f42d648 Add groups for tools and mushrooms (#2378) 2019-06-01 21:10:30 +02:00
Zweihorn
76a08a7058 wool: use global 'dye.dyes' table 2019-05-26 20:21:31 +01:00
Paul Ouellette
80c10cee15 Capitalize author in game.conf to match ContentDB
The author is used to track packages for updating, so it should match.
2019-05-26 20:16:52 +01:00
Paramat
aee5ba64f9
Make cave liquids biome-determined
No longer use the hardcoded engine cave liquids.
Water only in '_ocean' biomes, water and lava in '_under' biomes.
2019-05-18 21:22:19 +01:00
Paramat
5c48c76aa2
Fix trapdoor side textures and orientations
Previously, opening a trapdoor caused the side textures to flip.

Fix the incorrect textures.
Also add a texture transform to a tile of the open trapdoor, such
that the closed trapdoor sides use the lower part of the texture
and the open trapdoor sides use the higher part.

Clean up some codestyle issues.
2019-05-03 23:49:07 +01:00
Paramat
f21bab2ff9
Split underground biome to correspond to surface biomes
In preparation for biome-defined: dungeon materials, cave liquids,
stone type, ores, decorations.
'_ocean' biomes now extend to y = -255 to be deeper than default
mgv5 oceans, and to create 'shallow underground biomes'.
Remove unnecessary biome lists for gravel and silver sand blob ores,
as those are already defined to only appear in default:stone.
2019-04-19 21:23:26 +01:00
HybridDog
0291c6b210 Moss growth ABM: Add inner and outer cobble stairs, simplify code 2019-04-06 21:35:48 +01:00
HybridDog
b20725026e flowers: Light check optimisation in mushroom spread 2019-03-31 22:20:28 +01:00
tenplus1
88d79881b8 Add food groups to blueberries (#2335) 2019-03-31 22:20:47 +02:00
HybridDog
efd090228d fire: Document flammable group, a little code cleanup 2019-03-30 20:33:08 +00:00
Paramat
dfe6fd6560
Restrict waving liquid shader to normal water 2019-03-27 02:17:32 +00:00
SmallJoker
dd3f3b2032 Use group:stick in recipes (fixes #2306) 2019-03-24 10:59:34 +01:00
Paramat
8b5e0a914b
Dungeon loot: Avoid empty 'if' branch to satisfy lua check 2019-03-23 23:16:41 +00:00
Paramat
e3cd961a15
Fix beds being undiggable after laying down 2019-03-23 23:12:44 +00:00
Niwla23
eaf6eac723 Mapping kit recipe: Use "group:stick" instead of "default:stick" 2019-03-18 22:20:24 +00:00
sfan5
02e2cab375 Dungeon loot: Don't crash on unknown items
fixes #2228
2019-03-17 13:59:10 +01:00
Hugo Locurcio
b38b5b2357
Enable colored Luacheck output on Travis CI
This also removes the deprecated `sudo: false` option, as Travis CI
is phasing out the container-based infrastructure.
2019-02-24 19:46:48 +01:00
1276 changed files with 33555 additions and 4775 deletions

View File

@ -3,7 +3,7 @@ allow_defined_top = true
read_globals = {
"DIR_DELIM",
"minetest", "core",
"minetest",
"dump",
"vector",
"VoxelManip", "VoxelArea",
@ -12,11 +12,16 @@ read_globals = {
"Settings",
"unpack",
-- Silence errors about custom table methods.
table = { fields = { "copy", "indexof" } }
table = { fields = { "copy", "indexof" } },
-- Silence warnings about accessing undefined fields of global 'math'
math = { fields = { "sign" } }
}
-- Overwrites minetest.handle_node_drops
files["mods/creative/init.lua"].globals = { "minetest" }
-- Overwrites minetest.calculate_knockback
files["mods/player_api/api.lua"].globals = { "minetest" }
-- Don't report on legacy definitions of globals.
files["mods/default/legacy.lua"].global = false

View File

@ -1,12 +1,11 @@
language: generic
sudo: false
addons:
apt:
packages:
- luarocks
before_install:
- luarocks install --local luacheck
script:
- $HOME/.luarocks/bin/luacheck --no-color ./mods
script:
- $HOME/.luarocks/bin/luacheck ./mods
notifications:
email: false

View File

@ -12,6 +12,7 @@ Copyright (C) 2015 paramat CC BY-SA 3.0
License of source code
----------------------
Copyright (C) 2010-2012 Blockmen
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
See README.txt in each mod directory for information about other authors.

63
README.md Normal file
View File

@ -0,0 +1,63 @@
Minetest5 Game
==============
The default game for the Minetest5 engine.
This is a fork from minetest default game, this
are made from minenux project https://codeberg.org/minenux
for minetest v5 and minetest v4 or 0.4.
Introduction
------------
This is the branch `stable-5.2` of minetest game for minetest5 a version
that is focused in v5 of minetest but mainly in 5.2 release. There's
also a minetest4 game version too in `stable-4.0` branch.
This are focused to provide minimal default game featured for minetest5
to be playable, with an [api](game_api.md) for more aditions (in the form of mods)
For further information, check the [Minetest Wiki](https://wiki.minetest.org/index.php?title=Games/Minetest_Game)
## Download
Can be obtained from https://codeberg.org/minenux/minetest-game-minetest/tags
those like 5.2.X by example https://codeberg.org/minenux/minetest-game-minetest/releases/tag/5.2.1
It will download a tar.gz file, uncompress the content and a directory will be created,
the name of the directory does not matter, the contents will be used later to install.
When stable releases are made, Minetest Game and the Minetest engine is packaged
and made available at https://codeberg.org/minenux/minetest-engine/archive/stable-5.2.tar.gz
or generally at https://codeberg.org/minenux/minetest-engine/releases/tag/5.2.1 by example.
This have a mirror at https://git.minetest.org/minenux/minetest-game-minetest/releases
## Installation
This game can be used in any version from 5.0 to 5.2, it may work with recents versions
After download, rename the directory decompressed to `minetest_game` and put to the "games" directory:
- GNU/Linux: If you use a system-wide installation place
it in ~/.minetest5/games/.
- Others: `minetest/games/` or `games` directory from the path were the binary are.
For further information or help, see: https://wiki.minetest.net/Installing_Mods
## Content
This sub game or game will contain a set of mods, that provide a behaviour of the game,
For more information check [mods/README.md](mods/README.md)
## Compatibility
This source code and files are focused in most newer minetest5 engine
from https://codeberg.org/minenux/minetest-engine/src/branch/stable-5.2
For minetest4 check https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0
## Licensing
See `LICENSE.txt` original autor fo first set of mods game was Blockmen

View File

@ -1,28 +0,0 @@
Minetest Game [minetest_game]
=============================
The main game for the Minetest engine
=====================================
To use this game with the Minetest engine, insert this repository as
/games/minetest_game
The Minetest engine can be found in:
https://github.com/minetest/minetest/
Compatibility
--------------
The Minetest Game github master HEAD is generally compatible with the github
master HEAD of the Minetest engine.
Additionally, when the Minetest engine is tagged to be a certain version (eg.
0.4.10), Minetest Game is tagged with the version too.
When stable releases are made, Minetest Game is packaged and made available in
http://minetest.net/downloads/
and in case the repository has grown too much, it may be reset. In that sense,
this is not a "real" git repository. (Package maintainers please note!)
Licensing
---------
See LICENSE.txt

View File

@ -1,3 +1,5 @@
name = Minetest Game
author = minetest
description = Bundled by default with Minetest, and aims to be lightweight, moddable, and fairly playable without mods.
title = Minetest5
name = Minetest5
author = Minetest
description = GAME set for MinenuX Bundled by default with Minetest5
min_minetest_version = 5.0

1188
game_api.md Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -38,9 +38,11 @@
#enable_lavacooling = true
# Whether the stuff in initial_stuff should be given to new players.
#give_initial_stuff = false
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,
default:torch 99,default:cobble 99
# its depends of the configured at the initital_stuff_mod
#give_initial_stuff = true
# What initial stuff will be given to player if initial stuff are set to true
#initial_stuff = default:wood,farming:bread,default:furnace,default:torch
# Whether the TNT mod should be enabled.
#enable_tnt = <true in singleplayer, false in multiplayer>
@ -60,7 +62,18 @@ default:torch 99,default:cobble 99
# Default value is true.
#enable_bed_night_skip = true
# If enabled, fences and walls cannot be jumped over.
#enable_fence_tall = false
# Whether the engine's spawn search, which does not check for a suitable
# starting biome, is used.
# Default value is false.
#engine_spawn = false
# Whether river water source nodes create flowing sounds.
# Helps rivers create more sound, especially on level sections.
#river_source_sounds = false
# Enable cloud variation by the 'weather' mod.
# Non-functional in V6 or Singlenode mapgens.
#enable_weather = true

61
mods/README.md Normal file
View File

@ -0,0 +1,61 @@
Default mods
------------
For information check [../README.md](../README.md)
## Content
| mod name | origin or work | version | info |
| ------------------ | --------------------------------------------------- | -------- | --- |
| api | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | [api](../game_api.md) |
| beds | https://codeberg.org/minenux/minetest-mod-beds | https://codeberg.org/minenux/minetest-mod-beds/commit/a1aac5940c88106b901c00409d7dac942720dd5b | [beds/README.md](beds/README.md) |
| boats | https://codeberg.org/minenux/minetest-mod-boats | https://codeberg.org/minenux/minetest-mod-boats/commit/e412ae84db3c443618b117fb35ae69e3c9bbae10 | [boats/README.md](boats/README.md) |
| bucket | https://codeberg.org/minenux/minetest-mod-bucket.git | https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5 | [bucket/README.md](bucket/README.md) |
| butterflies | https://codeberg.org/minenux/minetest-mod-bucket.git | https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5 | [bucket/README.md](bucket/README.md) |
| bones | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| binoculars | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| carts | https://codeberg.org/minenux/minetest-mod-carts | https://codeberg.org/minenux/minetest-mod-carts/commit/dcbca916cffdcec281f0129ef350db2686bda933 | [carts/README.md](carts/README.md) |
| creative | https://codeberg.org/minenux/minetest-mod-creative | https://codeberg.org/minenux/minetest-mod-creative/commit/ca09e773701f834fec7de18bf13598b3323778db | [creative/README.md](creative/README.md) |
| default | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| player_api | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| env_sounds | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| game_commands | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| spawn | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| doors | https://codeberg.org/minenux/minetest-mod-doors | https://codeberg.org/minenux/minetest-mod-doors/commit/a89ab0454deb4933b6e4971c57055c40b7938e5b | [doors/README.md](doors/README.md) |
| dungeon_loot | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| dye | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| farming | https://codeberg.org/minenux/minetest-mod-farming | https://codeberg.org/minenux/minetest-mod-farming/commit/08c3a9b37bab5d8a0f5971b168aef412db5fc424 | [farming/README.md](farming/README.md) |
| fire | https://codeberg.org/minenux/minetest-mod-fire | https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2 | [fire/README.md](fire/README.md) |
| fireflies | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/fc4ab2538d432a20978ee3bbd1b69a42446e9132 | [fireflies/README.md](fireflies/README.md) |
| flowers | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| hudbars | https://codeberg.org/minenux/minetest-mod-hudbars | https://codeberg.org/minenux/minetest-mod-hudbars/commit/e3db263828cb96f06d848e6dc80d90f21c7f92a0 | [hudbars/README.md](hudbars/README.md) |
| give_initial_stuff | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/ee86fb1c41e7d8d2a1d94764dd64808bc8ff5999 | [give_initial_stuff/README.md](give_initial_stuff/README.md) |
| killme | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| sfinv | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| stairs | https://codeberg.org/minenux/minetest-mod-stairs | https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110 | [stairs/README.md](stairs/README.md) |
| screwdriver | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| sethome | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/8e59006dc81ebe6785380158e57ba126cb3a4163 | |
| tnt | https://codeberg.org/minenux/minetest-mod-tnt | https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027 | [tnt/README.md](tnt/README.md) |
| toolranks | https://codeberg.org/minenux/minetest-mod-toolranks | https://codeberg.org/minenux/minetest-mod-toolranks/commit/5c9553e5ac6cc7ae375033b76ef7771a6935c771 | [toolranks/README.md](toolranks/README.md) |
| vessels | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| walls | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| weather | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| wool | https://codeberg.org/minenux/minetest-mod-wool | https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a | [wool/README.md](wool/README.md) |
| xpanes | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| xdecor | https://codeberg.org/minenux/minetest-game-xdecor | https://codeberg.org/minenux/minetest-game-xdecor/commit/cd0c35b8c58153f7c353b5dbfac35e524fa0ea18 | [xdecor/README.md](xdecor/README.md) |
The default mod was splitted now sethome and player_api are mods, binoculars from v5 are
just separate privilegies for zoom, butterflies and fireflies from v5 can be set
by dmobs or mobs_doomed mod, the spawn mod is just minimal spawn management
pooly provided and better managed by mods like rspawn and spawnrandom.
## Compatibility
This source code and files are focused in most newer minetest5 engine
from https://codeberg.org/minenux/minetest-engine/src/branch/stable-5.2
For minetest4 check https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0
## Licensing
See `LICENSE.txt`

33
mods/beds/Changelog.txt Normal file
View File

@ -0,0 +1,33 @@
NEXT
----
- add more beds as fuel, add mini-game respawn flag.
- add new white simple bed, change red bed recipes to use red wool, add my own screenshot
- older engine detection and intlib
1.0.1 beta
----------
- Add backwards compatibility with PilzAdam's beds mod
- Fix placement
- Fix small bugs
- Prevent possible crash
1.1
---
- Add fancy bed model (based on jp's model)
- Add API to register beds
- Allow players always to detach from bed (by donat-b)
- If more than 50% of players want sleep they can skip the night
- Don't show sleep dialog in singleplayer
1.1.1
-----
- Prevent possbile crash by trying to reposition leaving players
1.2
---
- Updated to use default bed functions
- Texture check to fix beds using old api
- 'bed_sleep_divide' setting added [1 for all, 2 for half, 3 for third]
- Add POVA support
- Add pink fancy bed and blue simple bed

104
mods/beds/README.md Normal file
View File

@ -0,0 +1,104 @@
minetest mod Beds
=========================
This mod improves beds which allows sleep, featured to (auto) skip the night.
Information
-----------
This mod is named `beds` to sleep, by rightclick the bed. It featured
in singleplayer mode that the night gets skipped immediately. If playing
in multiplayer you get shown how many other players are in bed too,
if all players are sleeping the night gets skipped.
![screenshot.jpg](screenshot.jpg)
Tech information
----------------
This mod sustitute default one, you must disable the default of minetest
game if present or override it.
#### Features
* Night Skypping:
This mod auto featured night skip in singleplayer, in multiplayer it skipped
if more than a set percentage (default 50%) of the players are lying
in bed and use this option. Check configuration section for more info.
* Controlled respawning:
If you have slept in bed (not just lying in it) your respawn point
is set to the beds location and you will respawn there after
death. Check configuration section for more info.
* More beds:
It features more beds, so along with the Red simple bed we now have White and
Blue, and the fance beds has the original Red and now Pink.
#### Dependencies
* default
* player_api (for newer engines)
Optional dependences:
* intllib (only for older engines)
* pova (optional)
The pova mod are not xplicit set as optional depends, due the circular depends bug,
its detected and used.
#### Configuration
| Configuration | type | default | place file | Notes about |
| --------------------- | ----- | ------- | ------------ | ----------------------------------------- |
| enable_bed_respawn | bool | true | minetest.conf | Enable respawn point set to last sleep bed |
| enable_bed_night_skip | bool | false | minetest.conf | You can disable the night skip feature |
| bed_sleep_divide | int | 2 | minetest.conf | Division of players needed to skip night |
#### Nodes
Crafting are same as original default mod, but colored uses a white plus the other color.
| Node name | Description name |
| ----------------------- | --------------------- |
| beds:bed | Simple bed |
| beds:bed_blue | Simple bed blue |
| beds:fancy_bed | Fancy shaped bed |
| beds:fancy_bed_pink | Fancy shaped bed pink |
#### Nodes and Aliasing
| mod name : node name | new mod name : new node |
| --------------------------- | ----------------------- |
| beds:bed_top_red | beds:bed_top |
| beds:bed_bottom_red | beds:bed_bottom |
#### Mini-Game Support
If enable_bed_respawn is set to true and a player dies when playing a mini-game then this
can interrupt the game, so a special beds.respawn[player_name] flag has been added which
is set to 'true' by default to always respawn player at their bed, but can be set to
'false' during a mini-game to stop this behaviour.
License
------
### Authors of source code
Originally by BlockMen (MIT)
Various Minetest developers and contributors (MIT)
### Authors of media (textures)
BlockMen (CC BY-SA 3.0)
All textures unless otherwise noted
JP (WTFPL)
All models unless otherwise noted
Check [license.txt](license.txt)

View File

@ -1,30 +0,0 @@
Minetest Game mod: beds
=======================
See license.txt for license information.
Authors of source code
----------------------
Originally by BlockMen (MIT)
Various Minetest developers and contributors (MIT)
Authors of media (textures)
---------------------------
BlockMen (CC BY-SA 3.0)
All textures unless otherwise noted
TumeniNodes (CC BY-SA 3.0)
beds_bed_under.png
This mod adds a bed to Minetest which allows to skip the night.
To sleep, rightclick the bed. If playing in singleplayer mode the night gets skipped
immediately. If playing multiplayer you get shown how many other players are in bed too,
if all players are sleeping the night gets skipped. The night skip can be forced if more
than 50% of the players are lying in bed and use this option.
Another feature is a controlled respawning. If you have slept in bed (not just lying in
it) your respawn point is set to the beds location and you will respawn there after
death.
You can disable the respawn at beds by setting "enable_bed_respawn = false" in
minetest.conf.
You can disable the night skip feature by setting "enable_bed_night_skip = false" in
minetest.conf or by using the /set command in-game.

View File

@ -1,61 +1,62 @@
local reverse = true
local function destruct_bed(pos, n)
local node = minetest.get_node(pos)
local other
if n == 2 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.subtract(pos, dir)
elseif n == 1 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.add(pos, dir)
end
if reverse then
reverse = not reverse
minetest.remove_node(other)
minetest.check_for_falling(other)
else
reverse = not reverse
end
end
function beds.register_bed(name, def)
minetest.register_node(name .. "_bottom", {
local new_tiles
local new_mesh = "beds_simple_bed.obj"
-- old api texture check
if def.tiles and def.tiles.bottom then
new_tiles = "beds_simple_bed.png" -- default
-- check for fancy bed
if def.nodebox and def.nodebox.bottom and #def.nodebox.bottom > 3 then
new_tiles = "beds_fancy_bed.png"
new_mesh = "beds_fancy_bed.obj"
end
end
-- register bed node
minetest.register_node(name, {
description = def.description,
inventory_image = def.inventory_image,
wield_image = def.wield_image,
drawtype = "nodebox",
tiles = def.tiles.bottom,
drawtype = "mesh",
mesh = def.mesh or new_mesh,
tiles = new_tiles or def.tiles,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
stack_max = 1,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
sounds = def.sounds or default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = def.nodebox.bottom,
groups = {
choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1,
fall_damage_add_percent = -40, bouncy = 85
},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = def.selectionbox,
fixed = def.selectionbox
},
collision_box = {
type = "fixed",
fixed = def.collisionbox
},
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local node = minetest.get_node(under)
local udef = minetest.registered_nodes[node.name]
if udef and udef.on_rightclick and
not (placer and placer:is_player() and
placer:get_player_control().sneak) then
if udef and udef.on_rightclick
and not (placer and placer:is_player()
and placer:get_player_control().sneak) then
return udef.on_rightclick(under, node, placer, itemstack,
pointed_thing) or itemstack
end
local pos
if udef and udef.buildable_to then
pos = under
else
@ -64,13 +65,16 @@ function beds.register_bed(name, def)
local player_name = placer and placer:get_player_name() or ""
if minetest.is_protected(pos, player_name) and
not minetest.check_player_privs(player_name, "protection_bypass") then
if minetest.is_protected(pos, player_name)
and not minetest.check_player_privs(player_name, "protection_bypass") then
minetest.record_protection_violation(pos, player_name)
return itemstack
end
local node_def = minetest.registered_nodes[minetest.get_node(pos).name]
if not node_def or not node_def.buildable_to then
return itemstack
end
@ -79,100 +83,46 @@ function beds.register_bed(name, def)
minetest.dir_to_facedir(placer:get_look_dir()) or 0
local botpos = vector.add(pos, minetest.facedir_to_dir(dir))
if minetest.is_protected(botpos, player_name) and
not minetest.check_player_privs(player_name, "protection_bypass") then
if minetest.is_protected(botpos, player_name)
and not minetest.check_player_privs(player_name, "protection_bypass") then
minetest.record_protection_violation(botpos, player_name)
return itemstack
end
local botdef = minetest.registered_nodes[minetest.get_node(botpos).name]
if not botdef or not botdef.buildable_to then
return itemstack
end
minetest.set_node(pos, {name = name .. "_bottom", param2 = dir})
minetest.set_node(botpos, {name = name .. "_top", param2 = dir})
minetest.set_node(pos, {name = name, param2 = dir})
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name)) then
if not beds.is_creative(player_name) then
itemstack:take_item()
end
return itemstack
end,
on_rightclick = function(pos, node, clicker)
beds.on_rightclick(pos, clicker)
end,
on_destruct = function(pos)
destruct_bed(pos, 1)
beds.remove_spawns_at(pos)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
beds.on_rightclick(pos, clicker)
return itemstack
end,
on_rotate = function(pos, node, user, _, new_param2)
local dir = minetest.facedir_to_dir(node.param2)
local p = vector.add(pos, dir)
local node2 = minetest.get_node_or_nil(p)
if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or
not node.param2 == node2.param2 then
return false
end
if minetest.is_protected(p, user:get_player_name()) then
minetest.record_protection_violation(p, user:get_player_name())
return false
end
if new_param2 % 32 > 3 then
return false
end
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
local node3 = minetest.get_node_or_nil(newp)
local node_def = node3 and minetest.registered_nodes[node3.name]
if not node_def or not node_def.buildable_to then
return false
end
if minetest.is_protected(newp, user:get_player_name()) then
minetest.record_protection_violation(newp, user:get_player_name())
return false
end
node.param2 = new_param2
-- do not remove_node here - it will trigger destroy_bed()
minetest.set_node(p, {name = "air"})
minetest.set_node(pos, node)
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
return true
end,
can_dig = function(pos, player)
return beds.can_dig(pos)
end,
end
})
minetest.register_node(name .. "_top", {
drawtype = "nodebox",
tiles = def.tiles.top,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
pointable = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
sounds = def.sounds or default.node_sound_wood_defaults(),
drop = name .. "_bottom",
node_box = {
type = "fixed",
fixed = def.nodebox.top,
},
on_destruct = function(pos)
destruct_bed(pos, 2)
end,
can_dig = function(pos, player)
local node = minetest.get_node(pos)
local dir = minetest.facedir_to_dir(node.param2)
local p = vector.add(pos, dir)
return beds.can_dig(p)
end,
})
minetest.register_alias(name, name .. "_bottom")
minetest.register_alias(name .. "_bottom", name)
minetest.register_alias(name .. "_top", "air")
-- register recipe
minetest.register_craft({
output = name,
recipe = def.recipe

View File

@ -1,87 +1,79 @@
local S = beds.get_translator
-- Fancy shaped bed
beds.register_bed("beds:fancy_bed", {
description = "Fancy Bed",
description = S("Red Fancy Bed"),
inventory_image = "beds_bed_fancy.png",
wield_image = "beds_bed_fancy.png",
tiles = {
bottom = {
"beds_bed_top1.png",
"beds_bed_under.png",
"beds_bed_side1.png",
"beds_bed_side1.png^[transformFX",
"beds_bed_foot.png",
"beds_bed_foot.png",
},
top = {
"beds_bed_top2.png",
"beds_bed_under.png",
"beds_bed_side2.png",
"beds_bed_side2.png^[transformFX",
"beds_bed_head.png",
"beds_bed_head.png",
}
},
nodebox = {
bottom = {
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
{0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
},
top = {
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
{0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
{-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
{-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5},
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
}
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
tiles = {"beds_fancy_bed.png", "default_wood.png"},
mesh = "beds_fancy_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
recipe = {
{"", "", "group:stick"},
{"wool:white", "wool:white", "wool:white"},
{"group:wood", "group:wood", "group:wood"},
},
{"wool:red", "wool:red", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
})
beds.register_bed("beds:fancy_bed_pink", {
description = S("Pink Fancy Bed"),
inventory_image = "beds_bed_fancy_pink.png",
wield_image = "beds_bed_fancy_pink.png",
tiles = {"beds_fancy_bed_pink.png", "default_wood.png"},
mesh = "beds_fancy_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
recipe = {
{"", "", "group:stick"},
{"wool:pink", "wool:pink", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
})
-- Simple shaped bed
beds.register_bed("beds:bed", {
description = "Simple Bed",
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
tiles = {
bottom = {
"beds_bed_top_bottom.png^[transformR90",
"beds_bed_under.png",
"beds_bed_side_bottom_r.png",
"beds_bed_side_bottom_r.png^[transformfx",
"beds_transparent.png",
"beds_bed_side_bottom.png"
},
top = {
"beds_bed_top_top.png^[transformR90",
"beds_bed_under.png",
"beds_bed_side_top_r.png",
"beds_bed_side_top_r.png^[transformfx",
"beds_bed_side_top.png",
"beds_transparent.png",
}
},
nodebox = {
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
},
beds.register_bed("beds:bed_white", {
description = S("White Simple Bed"),
inventory_image = "beds_bed_white.png",
wield_image = "beds_bed_white.png",
tiles = {"beds_simple_bed_white.png"},
mesh = "beds_simple_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"wool:white", "wool:white", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
},
}
})
beds.register_bed("beds:bed", {
description = S("Red Simple Bed"),
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
tiles = {"beds_simple_bed.png"},
mesh = "beds_simple_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"wool:red", "wool:red", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
})
beds.register_bed("beds:bed_blue", {
description = S("Blue Simple Bed"),
inventory_image = "beds_bed_blue.png",
wield_image = "beds_bed_blue.png",
tiles = {"beds_simple_bed_blue.png"},
mesh = "beds_simple_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"wool:blue", "wool:blue", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
})
-- Aliases for PilzAdam's beds mod
@ -93,12 +85,30 @@ minetest.register_alias("beds:bed_top_red", "beds:bed_top")
minetest.register_craft({
type = "fuel",
recipe = "beds:fancy_bed_bottom",
burntime = 13,
recipe = "beds:fancy_bed",
burntime = 13
})
minetest.register_craft({
type = "fuel",
recipe = "beds:bed_bottom",
burntime = 12,
recipe = "beds:fancy_bed_pink",
burntime = 13
})
minetest.register_craft({
type = "fuel",
recipe = "beds:bed",
burntime = 12
})
minetest.register_craft({
type = "fuel",
recipe = "beds:bed_blue",
burntime = 12
})
minetest.register_craft({
type = "fuel",
recipe = "beds:bed_white",
burntime = 12
})

View File

@ -1,2 +1,4 @@
default
wool
pova?
intllib?

View File

@ -0,0 +1 @@
beds which allows sleep, featured to (auto) skip the night.

View File

@ -1,6 +1,11 @@
local S = beds.get_translator
local is_50 = beds.is_50
local is_54 = beds.is_54
local is_pova = minetest.get_modpath("pova")
local pi = math.pi
local is_sp = minetest.is_singleplayer()
local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
if enable_respawn == nil then
enable_respawn = true
end
@ -8,10 +13,13 @@ end
-- Helper functions
local function get_look_yaw(pos)
local rotation = minetest.get_node(pos).param2
if rotation > 3 then
rotation = rotation % 4 -- Mask colorfacedir values
end
if rotation == 1 then
return pi / 2, rotation
elseif rotation == 3 then
@ -23,22 +31,31 @@ local function get_look_yaw(pos)
end
end
local function is_night_skip_enabled()
local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip")
if enable_night_skip == nil then
enable_night_skip = true
end
return enable_night_skip
end
local function check_in_beds(players)
local in_bed = beds.player
if not players then
players = minetest.get_connected_players()
end
for n, player in ipairs(players) do
local name = player:get_player_name()
if not in_bed[name] then
return false
end
@ -47,7 +64,9 @@ local function check_in_beds(players)
return #players > 0
end
local function lay_down(player, pos, bed_pos, state, skip)
local name = player:get_player_name()
local hud_flags = player:hud_get_flags()
@ -57,67 +76,156 @@ local function lay_down(player, pos, bed_pos, state, skip)
-- stand up
if state ~= nil and not state then
local p = beds.pos[name] or nil
beds.player[name] = nil
if not beds.player[name] then
return false -- player not in bed, do nothing
end
beds.bed_position[name] = nil
-- skip here to prevent sending player specific changes (used for leaving players)
if skip then
return
end
if p then
player:set_pos(p)
end
player:set_pos(beds.pos[name])
-- physics, eye_offset, etc
local physics_override = beds.player[name].physics_override
beds.player[name] = nil
if is_pova then
pova.del_override(name, "force")
pova.do_override(player)
else
player:set_physics_override({
speed = physics_override.speed,
jump = physics_override.jump,
gravity = physics_override.gravity
})
end
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
player:set_look_horizontal(math.random(1, 180) / 100)
default.player_attached[name] = false
player:set_physics_override(1, 1, 1)
hud_flags.wielditem = true
default.player_set_animation(player, "stand" , 30)
-- lay down
else
if beds.is_50 then
player_api.player_attached[name] = false
player_api.set_animation(player, "stand" , 30)
else
default.player_attached[name] = false
default.player_set_animation(player, "stand" , 30)
end
hud_flags.wielditem = true
else -- lay down
-- Check if bed is occupied
for _, other_pos in pairs(beds.bed_position) do
if vector.distance(bed_pos, other_pos) < 0.1 then
minetest.chat_send_player(name, S("This bed is already occupied!"))
return false
end
end
if beds.is_54 then
-- Check if player is moving
if vector.length(player:get_velocity()) > 0.001 then
minetest.chat_send_player(name,
S("You have to stop moving before going to bed!"))
return false
end
end
-- Check if player is attached to an object
if player:get_attach() then
return false
end
if beds.player[name] then
-- player already in bed, do nothing
return false
end
beds.pos[name] = pos
beds.bed_position[name] = bed_pos
beds.player[name] = 1
beds.player[name] = {physics_override = player:get_physics_override()}
-- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
local yaw, param2 = get_look_yaw(bed_pos)
player:set_look_horizontal(yaw)
local dir = minetest.facedir_to_dir(param2)
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
player:set_physics_override(0, 0, 0)
-- p.y is just above the nodebox height of the 'Simple Bed' (the highest bed),
-- to avoid sinking down through the bed.
local p = {
x = bed_pos.x + dir.x / 2,
y = bed_pos.y + 0.07,
z = bed_pos.z + dir.z / 2
}
if is_pova then
pova.add_override(name, "force", {speed = 0, jump = 0, gravity = 0})
pova.do_override(player)
else
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
end
player:set_pos(p)
default.player_attached[name] = true
if beds.is_50 then
player_api.player_attached[name] = true
player_api.set_animation(player, "lay" , 0)
else
default.player_attached[name] = true
default.player_set_animation(player, "lay" , 0)
end
hud_flags.wielditem = false
default.player_set_animation(player, "lay" , 0)
end
player:hud_set_flags(hud_flags)
end
local function get_player_in_bed_count()
local c = 0
for _, _ in pairs(beds.player) do
c = c + 1
end
return c
end
local function update_formspecs(finished)
local ges = #minetest.get_connected_players()
local form_n
local player_in_bed = get_player_in_bed_count()
local is_majority = (ges / 2) < player_in_bed
local form_n
local esc = minetest.formspec_escape
if finished then
form_n = beds.formspec .. "label[2.7,9; Good morning.]"
form_n = beds.formspec .. "label[2.7,9;" .. esc(S("Good morning.")) .. "]"
else
form_n = beds.formspec .. "label[2.2,9;" .. tostring(player_in_bed) ..
" of " .. tostring(ges) .. " players are in bed]"
form_n = beds.formspec .. "label[2.2,9;" ..
esc(S("@1 of @2 players are in bed", player_in_bed, ges)) .. "]"
if is_majority and is_night_skip_enabled() then
form_n = form_n .. "button_exit[2,6;4,0.75;force;Force night skip]"
form_n = form_n .. "button_exit[2,6;4,0.75;force;" ..
esc(S("Force night skip")) .. "]"
end
end
@ -126,36 +234,46 @@ local function update_formspecs(finished)
end
end
-- Public functions
function beds.kick_players()
for name, _ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
lay_down(player, nil, nil, false)
end
end
function beds.skip_night()
minetest.set_timeofday(0.23)
end
function beds.on_rightclick(pos, player)
local name = player:get_player_name()
local ppos = player:get_pos()
local tod = minetest.get_timeofday()
if tod > 0.2 and tod < 0.805 then
if tod > beds.day_interval.start and tod < beds.day_interval.finish then
if beds.player[name] then
lay_down(player, nil, nil, false)
end
minetest.chat_send_player(name, "You can only sleep at night.")
minetest.chat_send_player(name, S("You can only sleep at night."))
return
end
-- move to bed
if not beds.player[name] then
lay_down(player, ppos, pos)
beds.set_spawns() -- save respawn positions when entering bed
else
lay_down(player, nil, nil, false)
@ -167,10 +285,13 @@ function beds.on_rightclick(pos, player)
-- skip the night and let all players stand up
if check_in_beds() then
minetest.after(2, function()
if not is_sp then
update_formspecs(is_night_skip_enabled())
end
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
@ -179,37 +300,67 @@ function beds.on_rightclick(pos, player)
end
end
function beds.can_dig(bed_pos)
-- Check all players in bed which one is at the expected position
for _, player_bed_pos in pairs(beds.bed_position) do
if vector.equals(bed_pos, player_bed_pos) then
return false
end
end
return true
end
-- Callbacks
-- Only register respawn callback if respawn enabled
if enable_respawn then
-- set respawn flag to true by default
minetest.register_on_joinplayer(function(player)
if not player then return end
local name = player:get_player_name()
beds.respawn[name] = true
end)
-- respawn player at bed if enabled and valid position is found
minetest.register_on_respawnplayer(function(player)
if not player then return end
local name = player:get_player_name()
local pos = beds.spawn[name]
if pos then
-- check if respawn flag is true (for mini-game support, can be set to false)
if pos and beds.respawn[name] then
player:set_pos(pos)
return true
end
end)
end
minetest.register_on_leaveplayer(function(player)
if not player then return end
local name = player:get_player_name()
lay_down(player, nil, nil, false, true)
beds.player[name] = nil
if check_in_beds() then
minetest.after(2, function()
update_formspecs(is_night_skip_enabled())
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
@ -218,7 +369,28 @@ minetest.register_on_leaveplayer(function(player)
end
end)
minetest.register_on_dieplayer(function(player)
if not player then return end
local name = player:get_player_name()
local in_bed = beds.player
local pos = player:get_pos()
local yaw = get_look_yaw(pos)
if in_bed[name] then
lay_down(player, nil, pos, false)
player:set_look_horizontal(yaw)
player:set_pos(pos)
end
end)
local div = tonumber(minetest.settings:get("bed_sleep_divide")) or 2
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "beds_form" then
return
end
@ -234,7 +406,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
if fields.force then
local is_majority = (#minetest.get_connected_players() / 2) < last_player_in_bed
-- check if enough players are sleeping to skip night (was half)
local is_majority = (
#minetest.get_connected_players() / div) < last_player_in_bed
if is_majority and is_night_skip_enabled() then
update_formspecs(true)
beds.skip_night()

View File

@ -1,19 +1,69 @@
beds = {}
beds.player = {}
beds.bed_position = {}
beds.pos = {}
beds.spawn = {}
local is_50 = nil
local is_53 = minetest.has_feature("object_step_has_moveresult")
local is_54 = minetest.has_feature("direct_velocity_on_players")
beds.formspec = "size[8,11;true]" ..
"no_prepend[]" ..
"bgcolor[#080808BB;true]" ..
"button_exit[2,10;4,0.75;leave;Leave Bed]"
-- Load support for MT game translation.
local S
if minetest.get_translator ~= nil then
S = minetest.get_translator("beds") -- 5.x translation function
is_50 = true
else
if minetest.get_modpath("intllib") then
dofile(minetest.get_modpath("intllib") .. "/init.lua")
if intllib.make_gettext_pair then
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
else
gettext = intllib.Getter() -- old text file method
end
S = gettext
else -- boilerplate function for 0.4
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
end
beds = {
mod = "redo",
player = {},
bed_position = {},
pos = {},
spawn = {},
respawn = {},
get_translator = S,
formspec = "size[8,11;true]"
.. "no_prepend[]"
.. "bgcolor[#080808BB;true]"
.. "button_exit[2,10;4,0.75;leave;" .. minetest.formspec_escape(S("Leave Bed")) .. "]"
}
beds.is_50 = is_50
beds.is_53 = is_53
beds.is_54 = is_54
beds.day_interval = {
start = 0.2,
finish = 0.805,
}
local modpath = minetest.get_modpath("beds")
-- check for minetest 5.x/0.4 compatibility
function beds.is_creative(name)
if is_53 then
return minetest.is_creative_enabled(name)
else
return creative.is_enabled_for(name) or minetest.settings:get_bool("creative_mode")
end
end
-- Load files
dofile(modpath .. "/functions.lua")
dofile(modpath .. "/api.lua")
dofile(modpath .. "/beds.lua")
dofile(modpath .. "/spawns.lua")
print("[MOD] Beds loaded")

View File

@ -59,3 +59,7 @@ rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/
WTFPL license applies to bed .obj files by jp from mesh beds mod:
https://forum.minetest.net/viewtopic.php?t=11817

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Schickes Bett
Simple Bed=Schlichtes Bett
This bed is already occupied!=Dieses Bett ist bereits belegt!
You have to stop moving before going to bed!=Sie müssen stehen bleiben, bevor Sie zu Bett gehen können!
Good morning.=Guten Morgen.
@1 of @2 players are in bed=@1 von @2 Spielern sind im Bett
Force night skip=Überspringen der Nacht erzwingen
You can only sleep at night.=Sie können nur nachts schlafen.
Leave Bed=Bett verlassen

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Cama de lujo
Simple Bed=Cama sencilla
This bed is already occupied!=Esta cama esta ocupada
You have to stop moving before going to bed!=Deja de moverte o no podras acostarte
Good morning.=Buenos días.
@1 of @2 players are in bed=@1 de @2 jugadores están durmiendo
Force night skip=Forzar hacer de dia
You can only sleep at night.=Sólo puedes dormir por la noche.
Leave Bed=Levantarse

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Lit chic
Simple Bed=Lit simple
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Bonjour.
@1 of @2 players are in bed=@1 joueur(s) sur @2 sont au lit
Force night skip=Forcer le passage de la nuit
You can only sleep at night.=Vous ne pouvez dormir que la nuit.
Leave Bed=Se lever du lit

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Ranjang Mewah
Simple Bed=Ranjang Sederhana
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Selamat pagi.
@1 of @2 players are in bed=@1 dari @2 pemain sedang tidur
Force night skip=Paksa lewati malam
You can only sleep at night.=Anda hanya dapat tidur pada waktu malam.
Leave Bed=Tinggalkan Ranjang

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Letto decorato
Simple Bed=Letto semplice
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=
@1 of @2 players are in bed=
Force night skip=
You can only sleep at night.=
Leave Bed=Alzati dal letto

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=lo selja'i ckana
Simple Bed=lo sampu ckana
This bed is already occupied!=.i lo ti ckana cu canlu
You have to stop moving before going to bed!=lo nu do cando cu sarcu lo nu do sipna
Good morning.=.i .uise'inai cerni
@1 of @2 players are in bed=.i @1 cmima be lu'i @2 le pilno cu vreta lo ckana
Force night skip=bapli le nu co'u nicte
You can only sleep at night.=.i steci le ka nicte kei fa le ka do kakne le ka sipna ca pa ckaji be ce'u
Leave Bed=cliva lo ckana

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Katil Beragam
Simple Bed=Katil Biasa
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Selamat pagi.
@1 of @2 players are in bed=@1 daripada @2 pemain sedang tidur
Force night skip=Paksa langkau malam
You can only sleep at night.=Anda hanya boleh tidur pada waktu malam.
Leave Bed=Bangun

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Cama Bonita
Simple Bed=Cama Simples
This bed is already occupied!=Esta cama já está ocupada!
You have to stop moving before going to bed!=Você precisa parar de se mover antes de ir para cama!
Good morning.=Bom dia.
@1 of @2 players are in bed=@1 de @2 jogadores estão na cama
Force night skip=Forçar o amanhecer
You can only sleep at night.=Você só pode dormir à noite
Leave Bed=Sair da Cama

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Детализированная Кровать
Simple Bed=Обычная Кровать
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Доброе утро.
@1 of @2 players are in bed=@1 из @2 игроков в кровати
Force night skip=Пропустить ночь
You can only sleep at night.=Вы можете спать только ночью.
Leave Bed=Встать с кровати

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Fin säng
Simple Bed=Enkel Säng
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.= God morgon.
@1 of @2 players are in bed=@1 av @2 spelar försöker sover.
Force night skip=Tvinga över natten
You can only sleep at night.=Du kan bara sova på natten.
Leave Bed=Lämna Säng

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Pekná posteľ
Simple Bed=Jednoduchá posteľ
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Dobré ráno.
@1 of @2 players are in bed=@1 z @2 hráčov sú v posteli
Force night skip=Nútene preskočiť noc
You can only sleep at night.=Môžeš spať len v noci.
Leave Bed=Opusti posteľ

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=花式床
Simple Bed=简易床
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=早安!
@1 of @2 players are in bed=@2位玩家中的@1位在床上
Force night skip=强制跳过夜晚
You can only sleep at night.=你只能在晚上睡觉。
Leave Bed=离开床

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=花式床
Simple Bed=簡易床
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=早安!
@1 of @2 players are in bed=@2位玩家中的@1位在床上
Force night skip=強制跳過夜晚
You can only sleep at night.=你只能在晚上睡覺。
Leave Bed=離開床

View File

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=
Simple Bed=
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=
@1 of @2 players are in bed=
Force night skip=
You can only sleep at night.=
Leave Bed=

4
mods/beds/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = beds
description = beds which allows sleep, featured to (auto) skip the night.
depends = default, wool
optional_depends = player_api, pova, intllib

View File

@ -0,0 +1,160 @@
# Blender v2.69 (sub 0) OBJ File: ''
# www.blender.org
mtllib fancy_bed.mtl
o mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001
v 0.437500 -0.312500 -0.437501
v 0.437500 -0.062500 -0.437501
v 0.437500 -0.062500 1.437499
v 0.437500 -0.312500 1.437499
v -0.437500 -0.312500 -0.437501
v -0.437500 -0.312500 1.437499
v -0.437500 -0.062500 1.437499
v -0.437500 -0.062500 -0.437501
v 0.437500 -0.176793 -0.437501
v -0.437500 -0.176793 -0.437501
vt 0.000171 0.499972
vt 0.000161 0.000182
vt 0.999791 0.000253
vt 0.999873 0.500022
vt 0.749576 0.000208
vt 0.749876 0.499854
vt 0.999848 0.999750
vt 0.000152 0.999750
vt 0.749276 0.130648
vt 0.000112 0.130648
g mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001_none.001_fancy_bed.png.001
usemtl none.001_fancy_bed.png.001
s off
f 1/1 2/2 3/3 4/4
f 5/2 6/3 7/4 8/1
f 4/5 3/2 7/1 6/6
f 1/1 4/4 6/7 5/8
f 2/1 8/2 7/3 3/4
f 8/2 2/5 9/9 10/10
o wood_structure_Wood_structure_nodebox-4.001_none.002
v 0.374999 -0.375000 1.437499
v 0.374999 -0.125000 1.437499
v 0.374999 -0.125000 1.499999
v 0.374999 -0.375000 1.499999
v -0.374999 -0.375000 1.437499
v -0.374999 -0.375000 1.499999
v -0.374999 -0.125000 1.499999
v -0.374999 -0.125000 1.437499
v -0.375000 -0.500000 1.437499
v -0.375000 0.187500 1.437499
v -0.375000 0.187500 1.499999
v -0.375000 -0.500000 1.499999
v -0.500000 -0.500000 1.437499
v -0.500000 -0.500000 1.499999
v -0.500000 0.187500 1.499999
v -0.500000 0.187500 1.437499
v -0.437500 -0.375000 -0.437501
v -0.437500 -0.125000 -0.437501
v -0.437500 -0.125000 1.437498
v -0.437500 -0.375000 1.437498
v -0.500000 -0.375000 -0.437501
v -0.500000 -0.375000 1.437498
v -0.500000 -0.125000 1.437498
v -0.500000 -0.125000 -0.437501
v 0.375001 -0.000000 1.437499
v 0.375001 0.125000 1.437499
v 0.375001 0.125000 1.499999
v 0.375001 -0.000000 1.499999
v -0.375001 -0.000000 1.437499
v -0.375001 -0.000000 1.499999
v -0.375001 0.125000 1.499999
v -0.375001 0.125000 1.437499
v 0.500000 -0.500000 1.437499
v 0.500000 0.187500 1.437499
v 0.500000 0.187500 1.499999
v 0.500000 -0.500000 1.499999
v 0.375000 -0.500000 1.437499
v 0.375000 -0.500000 1.499999
v 0.375000 0.187500 1.499999
v 0.375000 0.187500 1.437499
v 0.500000 -0.375000 -0.437501
v 0.500000 -0.125000 -0.437501
v 0.500000 -0.125000 1.437499
v 0.500000 -0.375000 1.437499
v 0.437500 -0.375000 -0.437501
v 0.437500 -0.375000 1.437499
v 0.437500 -0.125000 1.437499
v 0.437500 -0.125000 -0.437501
v -0.375000 -0.500000 -0.500000
v -0.375000 -0.065000 -0.500000
v -0.375000 -0.065000 -0.437500
v -0.375000 -0.500000 -0.437500
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 -0.437500
v -0.500000 -0.065000 -0.437500
v -0.500000 -0.065000 -0.500000
v 0.375006 -0.375000 -0.500000
v 0.375006 -0.125000 -0.500000
v 0.375006 -0.125000 -0.437500
v 0.375006 -0.375000 -0.437500
v -0.375006 -0.375000 -0.500000
v -0.375006 -0.375000 -0.437500
v -0.375006 -0.125000 -0.437500
v -0.375006 -0.125000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.065000 -0.500000
v 0.500000 -0.065000 -0.437500
v 0.500000 -0.500000 -0.437500
v 0.375000 -0.500000 -0.500000
v 0.375000 -0.500000 -0.437500
v 0.375000 -0.065000 -0.437500
v 0.375000 -0.065000 -0.500000
vt 0.377610 0.378205
vt 0.622484 0.378175
vt 0.622515 0.623120
vt 0.377671 0.623151
g wood_structure_Wood_structure_nodebox-4.001_none.002_none.002
usemtl none.002
s off
f 59/11 60/12 61/13 62/14
f 63/14 64/11 65/12 66/13
f 59/11 63/14 66/13 60/12
f 62/14 61/13 65/12 64/11
f 59/11 62/14 64/13 63/12
f 60/12 66/11 65/14 61/13
f 67/11 71/12 74/13 68/14
f 70/14 69/11 73/12 72/13
f 67/11 70/12 72/13 71/14
f 68/11 74/12 73/13 69/14
f 75/11 76/12 77/13 78/14
f 79/14 80/11 81/12 82/13
f 75/14 79/11 82/12 76/13
f 78/11 77/12 81/13 80/14
f 75/11 78/12 80/13 79/14
f 76/11 82/12 81/13 77/14
g wood_structure_Wood_structure_nodebox-4.001_none.002_none.003
usemtl none.003
f 15/11 16/12 17/13 18/14
f 11/13 15/14 18/11 12/12
f 14/14 13/11 17/12 16/13
f 11/14 14/11 16/12 15/13
f 12/11 18/12 17/13 13/14
f 19/11 20/12 21/13 22/14
f 23/14 24/11 25/12 26/13
f 19/14 23/11 26/12 20/13
f 22/11 21/12 25/13 24/14
f 19/11 22/12 24/13 23/14
f 20/11 26/12 25/13 21/14
f 27/14 28/11 29/12 30/13
f 31/11 32/12 33/13 34/14
f 27/11 30/12 32/13 31/14
f 28/14 34/11 33/12 29/13
f 35/11 39/12 42/13 36/14
f 38/14 37/11 41/12 40/13
f 35/14 38/11 40/12 39/13
f 36/11 42/12 41/13 37/14
f 43/11 44/12 45/13 46/14
f 47/14 48/11 49/12 50/13
f 43/14 47/11 50/12 44/13
f 46/11 45/12 49/13 48/14
f 43/11 46/12 48/13 47/14
f 44/11 50/12 49/13 45/14
f 51/14 52/11 53/12 54/13
f 55/13 56/14 57/11 58/12
f 51/11 54/12 56/13 55/14
f 52/14 58/11 57/12 53/13

View File

@ -0,0 +1,32 @@
# Blender v2.69 (sub 0) OBJ File: ''
# www.blender.org
mtllib simple_bed.mtl
o Simple_Bed
v 0.500000 -0.500000 -0.500000
v 0.500000 0.060000 -0.500000
v 0.500000 0.060000 1.500000
v 0.500000 -0.500000 1.500000
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 1.500000
v -0.500000 0.060000 1.500000
v -0.500000 0.060000 -0.500000
vt 0.000112 0.780442
vt 0.000110 0.999969
vt 0.780324 0.999889
vt 0.780377 0.780471
vt 0.780636 0.390284
vt 0.999906 0.780382
vt 0.999906 0.390284
vt 0.780636 0.000047
vt 0.999906 0.000094
vt 0.390235 0.780320
vt 0.390235 0.000071
vt 0.000142 0.000142
usemtl none.002
s off
f 1/1 2/2 3/3 4/4
f 5/1 6/4 7/3 8/2
f 1/5 5/4 8/6 2/7
f 4/8 3/9 7/7 6/5
f 1/8 4/4 6/10 5/11
f 2/11 8/12 7/1 3/10

BIN
mods/beds/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

View File

@ -0,0 +1,5 @@
enable_bed_respawn (Enable bed respawn) bool true
enable_bed_night_skip (Enable night skip) bool true
bed_sleep_divide (Division of players needed to skip night) float 2

View File

@ -3,30 +3,44 @@ local org_file = world_path .. "/beds_spawns"
local file = world_path .. "/beds_spawns"
local bkwd = false
-- check for PA's beds mod spawns
local cf = io.open(world_path .. "/beds_player_spawns", "r")
if cf ~= nil then
io.close(cf)
file = world_path .. "/beds_player_spawns"
bkwd = true
end
function beds.read_spawns()
local spawns = beds.spawn
local input = io.open(file, "r")
if input and not bkwd then
repeat
local x = input:read("*n")
if x == nil then
break
end
local y = input:read("*n")
local z = input:read("*n")
local name = input:read("*l")
spawns[name:sub(2)] = {x = x, y = y, z = z}
until input:read(0) == nil
io.close(input)
elseif input and bkwd then
beds.spawn = minetest.deserialize(input:read("*all"))
input:close()
beds.save_spawns()
@ -35,29 +49,54 @@ function beds.read_spawns()
end
end
-- load player spawn positions
beds.read_spawns()
function beds.save_spawns()
if not beds.spawn then
return
end
local data = {}
local output = io.open(org_file, "w")
for k, v in pairs(beds.spawn) do
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, k))
end
output:write(table.concat(data))
io.close(output)
end
function beds.set_spawns()
for name,_ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
local p = player:get_pos()
-- but don't change spawn location if borrowing a bed
if not minetest.is_protected(p, name) then
beds.spawn[name] = p
end
end
beds.save_spawns()
end
function beds.remove_spawns_at(pos)
for name, p in pairs(beds.spawn) do
if vector.equals(vector.round(p), pos) then
beds.spawn[name] = nil
end
end
beds.save_spawns()
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

View File

@ -1,2 +0,0 @@
default
creative?

View File

@ -1,7 +1,12 @@
-- binoculars/init.lua
-- Mod global namespace
binoculars = {}
-- Load support for MT game translation.
local S = minetest.get_translator("binoculars")
-- Detect creative mod
local creative_mod = minetest.get_modpath("creative")
@ -54,7 +59,7 @@ minetest.after(4.7, cyclic_update)
-- Binoculars item
minetest.register_craftitem("binoculars:binoculars", {
description = "Binoculars\nUse with 'Zoom' key",
description = S("Binoculars") .. "\n" .. S("Use with 'Zoom' key"),
inventory_image = "binoculars_binoculars.png",
stack_max = 1,

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Fernglas
Use with 'Zoom' key=Mit „Zoom“-Taste benutzen

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Prismáticos
Use with 'Zoom' key=Usar con la tecla 'Zoom'

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Jumelles
Use with 'Zoom' key=Utiliser avec le bouton « Zoom »

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Binocolo
Use with 'Zoom' key=Usalo col tasto 'Ingrandimento'

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Binokular
Use with 'Zoom' key=Guna dengan kekunci 'Zum'

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Бинокль
Use with 'Zoom' key=Используется с привилегией 'Zoom'

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Kikare
Use with 'Zoom' key=Används med 'Zoom' knappen

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=望远镜
Use with 'Zoom' key=与“缩放”键一起使用

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=望遠鏡
Use with 'Zoom' key=與“縮放”鍵一起使用

View File

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=
Use with 'Zoom' key=

4
mods/binoculars/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = binoculars
description = Minetest Game mod: binoculars
depends = default
optional_depends = creative

77
mods/boats/README.md Normal file
View File

@ -0,0 +1,77 @@
minetest mod boats
==========================
Boats improved for better performance and more realistic..
Information
-----------
This mod is named `boats`, it features work from original mod,
code changed to make it turn **quicker, better performance agains lag**,
and if you hit the shore too hard the boat is destroyed and drops 3 wood
![screenshot.png](screenshot.png)
#### Additions by TenPlus1
changed by TenPlus1 to add some new features
- boat is destroyed when crashing at speed (drops 3 wood)
- boats drop after 10 seconds if no driver
- boats can be damaged by mobs attacking player
- Improve physics of boat by implementing drag force (thanks gnag65)
- nil player check functions by misterskullz
Technical informaton
--------------------
When crafted you can use by putting and right click on,
then control with your directional keys:
#### Dependencies
* default
* mesecons (optional)
#### Crafting
W = any thing from wood group
```
W W
WWW
```
#### nodes
| Name | node | notes |
| ------------ | --------------- | ----- |
| Boat | boats:boat | it destroyed when crash at speed |
#### Controls (by default if not changed)
| Default key assigned | Action |
| -------------------- | -------------------------------------- |
| Right mouse button | Enter or exit boat when pointing at boat. |
| Forward | Speed up. Slow down when moving backwards. |
| Forward + backward | Enable cruise mode: accelerate to maximum speed without needing to hold. |
| Backward | Slow down. Speed up when moving backwards. Disable cruise mode. |
| Left | Turn to the left. Turn to the right when moving backwards. |
| Right | Turn to the right. Turn to the left when moving backwards. |
Licence
------
**Source code**
Modifications by TenPlus1
Originally by PilzAdam (MIT)
Various Minetest developers and contributors (MIT)
**Media (textures and model)**
Textures: Zeg9 (CC BY-SA 3.0)
original Model thetoon and Zeg9 (CC BY-SA 3.0),
modified by PavelS(SokolovPavel) (CC BY-SA 3.0),
modified by sofar (CC BY-SA 3.0)
Check [lisence.txt](lisence.txt)

View File

@ -1,31 +0,0 @@
Minetest Game mod: boats
========================
See license.txt for license information.
Authors of source code
----------------------
Originally by PilzAdam (MIT)
Various Minetest developers and contributors (MIT)
Authors of media (textures and model)
-------------------------------------
Textures: Zeg9 (CC BY-SA 3.0)
Model: thetoon and Zeg9 (CC BY-SA 3.0),
modified by PavelS(SokolovPavel) (CC BY-SA 3.0),
modified by sofar (CC BY-SA 3.0)
Controls
--------
Right mouse button = Enter or exit boat when pointing at boat.
Forward = Speed up.
Slow down when moving backwards.
Forward + backward = Enable cruise mode: Boat will accelerate to maximum forward
speed and remain at that speed without needing to hold the
forward key.
Backward = Slow down.
Speed up when moving backwards.
Disable cruise mode.
Left = Turn to the left.
Turn to the right when moving backwards.
Right = Turn to the right.
Turn to the left when moving backwards.

View File

@ -1,2 +1,3 @@
default
player_api
player_api?
creative?

View File

@ -1,3 +1,33 @@
-- boats/init.lua
local is_pa = minetest.get_modpath("player_api")
-- translation support and 5.x version check
local S, is_50, is_53
if minetest.get_translator ~= nil then
S = minetest.get_translator("boats") -- 5.x translation function
else
if minetest.get_modpath("intllib") then
dofile(minetest.get_modpath("intllib") .. "/init.lua")
if intllib.make_gettext_pair then
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
else
gettext = intllib.Getter() -- old text file method
end
S = gettext
else -- boilerplate function
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
end
-- check for minetest 5.x compatibility
is_50 = minetest.has_feature("httpfetch_binary_data")
is_53 = minetest.has_feature("direct_velocity_on_players") or minetest.has_feature("is_creative_enabled") or false
--
-- Helper functions
--
@ -8,15 +38,6 @@ local function is_water(pos)
end
local function get_sign(i)
if i == 0 then
return 0
else
return i / math.abs(i)
end
end
local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v
@ -28,6 +49,21 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2)
end
local creative = minetest.settings:get_bool("creative_mode")
function is_creative_enabled(name)
if creative or minetest.check_player_privs(name, {creative = true}) then
if is_53 then
return minetest.is_creative_enabled(name)
else
return true
end
end
return false
end
--
-- Boat entity
--
@ -40,7 +76,7 @@ local boat = {
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "boats_boat.obj",
textures = {"default_wood.png"},
textures = {"default_wood.png"}
},
driver = nil,
@ -57,31 +93,35 @@ function boat.on_rightclick(self, clicker)
end
local name = clicker:get_player_name()
if self.driver and name == self.driver then
self.driver = nil
self.auto = false
-- Cleanup happens in boat.on_detach_child
clicker:set_detach()
player_api.player_attached[name] = false
player_api.set_animation(clicker, "stand" , 30)
if is_pa then
player_api.set_animation(clicker, "stand", 30)
else
default.player_set_animation(clicker, "stand", 30)
end
local pos = clicker:get_pos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
minetest.after(0.1, function()
clicker:set_pos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach()
end
self.driver = name
clicker:set_attach(self.object, "",
{x = 0.5, y = 1, z = -3}, {x = 0, y = 0, z = 0})
player_api.player_attached[name] = true
self.driver = name
if is_pa then
player_api.player_attached[name] = true
else
default.player_attached[name] = true
end
minetest.after(0.2, function()
player_api.set_animation(clicker, "sit" , 30)
if is_pa then
player_api.set_animation(clicker, "sit", 30)
else
default.player_set_animation(clicker, "sit", 30)
end
end)
clicker:set_look_horizontal(self.object:get_yaw())
end
@ -90,13 +130,20 @@ end
-- If driver leaves server while driving boat
function boat.on_detach_child(self, child)
self.driver = nil
self.auto = false
if child and child:get_player_name() == self.driver then
if is_pa then
player_api.player_attached[child:get_player_name()] = false
else
default.player_attached[child:get_player_name()] = false
end
self.driver = nil
self.auto = false
end
end
function boat.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1})
self.object:set_armor_groups({fleshy = 100})
if staticdata then
self.v = tonumber(staticdata)
end
@ -118,13 +165,16 @@ function boat.on_punch(self, puncher)
if self.driver and name == self.driver then
self.driver = nil
puncher:set_detach()
player_api.player_attached[name] = false
if is_pa then
player_api.player_attached[name] = false
else
default.player_attached[name] = false
end
end
if not self.driver then
self.removed = true
local inv = puncher:get_inventory()
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(name))
if not is_creative_enabled(name)
or not inv:contains_item("main", "boats:boat") then
local leftover = inv:add_item("main", "boats:boat")
-- if no room in inventory add a replacement boat to the world
@ -141,24 +191,35 @@ end
function boat.on_step(self, dtime)
self.v = get_v(self.object:get_velocity()) * get_sign(self.v)
-- after 10 seconds remove boat and drop as item if not boarded
self.count = (self.count or 0) + dtime
if self.count > 10 then
minetest.add_item(self.object:get_pos(), "boats:boat")
self.object:remove()
return
end
self.v = get_v(self.object:get_velocity()) * math.sign(self.v)
if self.driver then
self.count = 0 -- reset 10 second drop counter
local driver_objref = minetest.get_player_by_name(self.driver)
if driver_objref then
local ctrl = driver_objref:get_player_control()
if ctrl.up and ctrl.down then
if not self.auto then
self.auto = true
minetest.chat_send_player(self.driver, "[boats] Cruise on")
minetest.chat_send_player(self.driver, S("Boat cruise mode on"))
end
elseif ctrl.down then
self.v = self.v - dtime * 1.8
self.v = self.v - dtime * 2.0
if self.auto then
self.auto = false
minetest.chat_send_player(self.driver, "[boats] Cruise off")
minetest.chat_send_player(self.driver, S("Boat cruise mode off"))
end
elseif ctrl.up or self.auto then
self.v = self.v + dtime * 1.8
self.v = self.v + dtime * 2.0
end
if ctrl.left then
if self.v < -0.001 then
@ -173,22 +234,27 @@ function boat.on_step(self, dtime)
self.object:set_yaw(self.object:get_yaw() - dtime * 0.9)
end
end
else
-- If driver leaves server while driving 'driver' is present
-- but driver objectref is nil. Reset boat properties.
self.driver = nil
self.auto = false
end
end
local velo = self.object:get_velocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
if not self.driver and
self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:set_pos(self.object:get_pos())
return
end
local s = get_sign(self.v)
self.v = self.v - dtime * 0.6 * s
if s ~= get_sign(self.v) then
self.object:set_velocity({x = 0, y = 0, z = 0})
-- We need to preserve velocity sign to properly apply drag force
-- while moving backward
local drag = dtime * math.sign(self.v) * (0.01 + 0.0796 * self.v * self.v)
-- If drag is larger than velocity, then stop horizontal movement
if math.abs(self.v) <= math.abs(drag) then
self.v = 0
return
end
if math.abs(self.v) > 5 then
self.v = 5 * get_sign(self.v)
else
self.v = self.v - drag
end
local p = self.object:get_pos()
@ -235,6 +301,30 @@ function boat.on_step(self, dtime)
end
self.object:set_velocity(new_velo)
self.object:set_acceleration(new_acce)
-- if boat comes to sudden stop then destroy boat and drop 3x wood
if (self.v2 or 0) - self.v >= 3 then
if self.driver then
--print ("Crash! with driver", self.v2 - self.v)
local driver_objref = minetest.get_player_by_name(self.driver)
default.player_attached[self.driver] = false
driver_objref:set_detach()
if is_pa then
player_api.set_animation(driver_objref, "stand" , 30)
else
default.player_set_animation(driver_objref, "stand" , 30)
end
else
--print ("Crash! no driver")
end
minetest.add_item(self.object:get_pos(), "default:wood 3")
self.object:remove()
return
end
self.v2 = self.v
end
@ -242,7 +332,7 @@ minetest.register_entity("boats:boat", boat)
minetest.register_craftitem("boats:boat", {
description = "Boat",
description = S("Boat"),
inventory_image = "boats_inventory.png",
wield_image = "boats_wield.png",
wield_scale = {x = 2, y = 2, z = 1},
@ -273,8 +363,7 @@ minetest.register_craftitem("boats:boat", {
boat:set_yaw(placer:get_look_horizontal())
end
local player_name = placer and placer:get_player_name() or ""
if not (creative and creative.is_enabled_for and
creative.is_enabled_for(player_name)) then
if not is_creative_enabled(player_name) then
itemstack:take_item()
end
end
@ -297,3 +386,6 @@ minetest.register_craft({
recipe = "boats:boat",
burntime = 20,
})
print ("[MOD] Boats loaded")

View File

@ -33,6 +33,7 @@ Copyright (C) 2012-2016 Zeg9
Copyright (C) 2012-2016 thetoon
Copyright (C) 2012-2016 PavelS(SokolovPavel)
Copyright (C) 2016 sofar (sofar@foo-projects.org)
Copyright (C) 2019 Bartosz (gang65@poczta.onet.pl)
You are free to:
Share — copy and redistribute the material in any medium or format.

2
mods/boats/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = boats
depends = default, player_api, creative

BIN
mods/boats/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -1 +0,0 @@
default

View File

@ -1,6 +1,11 @@
-- bones/init.lua
-- Minetest 0.4 mod: bones
-- See README.txt for licensing and other information.
-- Load support for MT game translation.
local S = minetest.get_translator("bones")
bones = {}
local function is_owner(pos, name)
@ -24,7 +29,7 @@ local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or
local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4
minetest.register_node("bones:bones", {
description = "Bones",
description = S("Bones"),
tiles = {
"bones_top.png^[transform2",
"bones_bottom.png",
@ -116,7 +121,7 @@ minetest.register_node("bones:bones", {
local meta = minetest.get_meta(pos)
local time = meta:get_int("time") + elapsed
if time >= share_bones_time then
meta:set_string("infotext", meta:get_string("owner") .. "'s old bones")
meta:set_string("infotext", S("@1's old bones", meta:get_string("owner")))
meta:set_string("owner", "")
else
meta:set_int("time", time)
@ -194,7 +199,7 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. ".")
minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string))
end
return
end
@ -204,7 +209,7 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. ".")
minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string))
end
return
end
@ -230,8 +235,7 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". Inventory dropped")
if bones_position_message then
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string ..
", and dropped their inventory.")
minetest.chat_send_player(player_name, S("@1 died at @2, and dropped their inventory.", player_name, pos_string))
end
return
end
@ -242,8 +246,7 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". Bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string ..
", and bones were placed.")
minetest.chat_send_player(player_name, S("@1 died at @2, and bones were placed.", player_name, pos_string))
end
local meta = minetest.get_meta(pos)
@ -266,7 +269,7 @@ minetest.register_on_dieplayer(function(player)
meta:set_string("owner", player_name)
if share_bones_time ~= 0 then
meta:set_string("infotext", player_name .. "'s fresh bones")
meta:set_string("infotext", S("@1's fresh bones", player_name))
if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then
meta:set_int("time", 0)
@ -276,6 +279,6 @@ minetest.register_on_dieplayer(function(player)
minetest.get_node_timer(pos):start(10)
else
meta:set_string("infotext", player_name.."'s bones")
meta:set_string("infotext", S("@1's bones", player_name))
end
end)

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Knochen
@1's old bones=Alte Knochen von @1
@1 died at @2.=@1 starb bei @2.
@1 died at @2, and dropped their inventory.=@1 starb bei @2 und ließ das Inventar fallen.
@1 died at @2, and bones were placed.=@1 starb bei @2 und Knochen wurden platziert.
@1's fresh bones=Frische Knochen von @1
@1's bones=Knochen von @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Huesos
@1's old bones=Huesos antiguos de @1
@1 died at @2.=@1 murió en @2.
@1 died at @2, and dropped their inventory.=@1 murió en @2, y su inventario se desprendió.
@1 died at @2, and bones were placed.=@1 murió en @2, y sus huesos fueron depositados.
@1's fresh bones=Huesos recientes de @1
@1's bones=Huesos de @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Os
@1's old bones=Vieux os de @1
@1 died at @2.=@1 est mort à @2.
@1 died at @2, and dropped their inventory.=@1 est mort à @2 et a laissé tomber son inventaire.
@1 died at @2, and bones were placed.=@1 est mort à @2 et ses os ont été placés.
@1's fresh bones=Os frais de @1
@1's bones=Os de @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Ossa
@1's old bones=Ossa vecchie di @1
@1 died at @2.=@1 è morto alla posizione @2.
@1 died at @2, and dropped their inventory.=@1 è morto alla posizione @2, e ha lasciato a terra il contenuto del suo inventario.
@1 died at @2, and bones were placed.=@1 è morto alla posizione @2, e vi sono state posizionate delle ossa.
@1's fresh bones=Ossa fresche di @1
@1's bones=Ossa di @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Tulang
@1's old bones=Tulang lama @1
@1 died at @2.=@1 mati di @2.
@1 died at @2, and dropped their inventory.=@1 mati di @2, dan menjatuhkan inventorinya.
@1 died at @2, and bones were placed.=@1 mati di @2, dan tulang diletakkan.
@1's fresh bones=Tulang segar @1
@1's bones=Tulang @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Кости
@1's old bones=Старые кости @1
@1 died at @2.=@1 умер в @2.
@1 died at @2, and dropped their inventory.=@1 умер в @2 и потерял содержимое своего инвентаря.
@1 died at @2, and bones were placed.=@1 умер в @2, помещены кости.
@1's fresh bones=новые кости @1
@1's bones=кости @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Ben
@1's old bones=@1s Gamla ben
@1 died at @2.=@1 dog på @a.
@1 died at @2, and dropped their inventory.=@1 dog på @a, och tappade deras saker.
@1 died at @2, and bones were placed.=@1 dog på @2, och deras ben var placerade.
@1's fresh bones=@1s färska ben
@1's bones=@1s ben

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=骨骸
@1's old bones=@1的旧骨骸
@1 died at @2.=@1在@2死亡。
@1 died at @2, and dropped their inventory.=@1在@2死亡丢掉了物品栏。
@1 died at @2, and bones were placed.=@1在@2死亡骨骸被放置。
@1's fresh bones=@1的新鲜骨骸
@1's bones=@1的骨骸

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=骨骸
@1's old bones=@1的舊骨骸
@1 died at @2.=@1在@2死亡。
@1 died at @2, and dropped their inventory.=@1在@2死亡丟掉了物品欄。
@1 died at @2, and bones were placed.=@1在@2死亡骨骸被放置。
@1's fresh bones=@1的新鮮骨骸
@1's bones=@1的骨骸

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=
@1's old bones=
@1 died at @2.=
@1 died at @2, and dropped their inventory.=
@1 died at @2, and bones were placed.=
@1's fresh bones=
@1's bones=

3
mods/bones/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = bones
description = Minetest Game mod: bones
depends = default

56
mods/bucket/README.md Normal file
View File

@ -0,0 +1,56 @@
minetest mod Bucket
=========================
This mod is just bucket, but compatible with any engine
Information
-----------
This mod must be named `bucket` it permits to handle liquids
in a tool named bucket.
![screenshot.png](screenshot.png)
Tech information
----------------
This mod sustitute default one, you must disable the default of minetest
game if present or override it.
#### Dependencies
* default
Optional dependences:
* intllib
* dungeon_loot
#### Nodes
It does not provide any new node.
#### Items tools
| Node name | Description name |
| ----------------------- | --------------------- |
| bucket:bucket_empty | Empty Bucket |
| bucket:bucket_water | Water Bucket |
| bucket:bucket_river_water | River Water Bucket |
| bucket:bucket_lava | Lava Bucket |
License
-------
#### Authors of source code
Kahrl <kahrl@gmx.net> (LGPLv2.1+)
celeron55, Perttu Ahola <celeron55@gmail.com> (LGPLv2.1+)
Various Minetest developers and contributors (LGPLv2.1+)
#### Authors of media (textures)
ElementW (CC BY-SA 3.0)
Check [license.txt](license.txt)

Some files were not shown because too many files have changed in this diff Show More