Compare commits
195 Commits
stable-5.2
...
master
Author | SHA1 | Date | |
---|---|---|---|
4be6c4d274 | |||
|
cd6ea53a52 | ||
|
16b6bdde0a | ||
|
996fea7cd0 | ||
|
9a9df3a42e | ||
|
1e237b8d18 | ||
|
833ed77620 | ||
|
4c6e19968a | ||
|
446e56a879 | ||
|
34c1d3242d | ||
|
f49707c973 | ||
|
8dee348d97 | ||
|
aeb27c4db6 | ||
|
6921c9bbd1 | ||
|
8d60e85dfc | ||
|
2c1d9e1330 | ||
|
ec2f57db0e | ||
|
fdcf458b56 | ||
|
97130f4c1c | ||
|
26b2da2c08 | ||
|
8eb4437ac8 | ||
|
792bc6f6e5 | ||
|
c4cf1a6004 | ||
|
99a7193095 | ||
|
2e8ac46120 | ||
|
508a9070a0 | ||
|
aff9c28eed | ||
|
e903b1f6d0 | ||
|
2bdc7c8c7d | ||
|
c744829ce5 | ||
|
06daee4c6d | ||
|
697b028e43 | ||
|
e229236bc2 | ||
|
350c52319e | ||
|
b64868ef92 | ||
|
79d38078a5 | ||
|
986b65775f | ||
|
d7dd15782c | ||
|
b4392aeb1f | ||
|
54dc58ef1f | ||
|
b57700a75b | ||
|
b0cf061360 | ||
|
33650c8c2e | ||
|
38307da22a | ||
|
0c2ee1e41d | ||
|
edd033b708 | ||
|
9528c0f8b9 | ||
|
638099c999 | ||
|
659895c3ed | ||
|
ce82241ab2 | ||
|
0110e01826 | ||
|
268a8844b6 | ||
|
f665382017 | ||
|
a6f3b89596 | ||
93724316d3 | |||
|
240f9a6a85 | ||
|
a840ac0a4d | ||
|
584a6a2102 | ||
|
e02e55fafd | ||
|
cc3e7be429 | ||
|
172b62f802 | ||
|
a5547a3a76 | ||
|
c8a1454e2b | ||
|
bcd1ee048e | ||
|
fff3b98ab0 | ||
|
40861c9e4f | ||
|
0c1252bcf5 | ||
|
760581b330 | ||
|
acc918436a | ||
|
6623dec567 | ||
|
75f9575557 | ||
|
78de12d6b4 | ||
|
d775a9bdae | ||
|
60389a1539 | ||
|
3aaabce7a4 | ||
|
ad183c48ee | ||
|
2361987421 | ||
|
575ecc3125 | ||
|
ac8ac98fe2 | ||
|
fe915a3c7f | ||
feec4659cb | |||
|
5875820542 | ||
|
31f7d57889 | ||
|
02ec133392 | ||
|
1309953da6 | ||
|
5273fcb3ad | ||
|
f2bc5e2c67 | ||
|
4b8b33587c | ||
|
953fcfe09e | ||
|
21e5f68292 | ||
|
92701885d0 | ||
|
c96cc55c40 | ||
|
70500943f3 | ||
|
ddebdeccb1 | ||
|
71ea0c65ea | ||
|
642fde44f1 | ||
|
1c78666c56 | ||
|
8158926862 | ||
|
4945f4bf9a | ||
|
79e63a8496 | ||
|
c6171a8f29 | ||
|
42baede13f | ||
|
0a90bd8a0e | ||
|
34bb232052 | ||
|
2c9733ac45 | ||
|
b6377a7c0e | ||
|
73ea8e2e91 | ||
|
46136bbf19 | ||
|
6bd059915c | ||
|
624dafc12b | ||
|
3d95fceee8 | ||
|
aa9cc39317 | ||
|
08b13c9efb | ||
|
c1b236b4e3 | ||
|
9d419bfac6 | ||
|
6a9cbcad82 | ||
|
ecfebe3c17 | ||
|
3fdd5cdb5f | ||
|
e1e793d4da | ||
|
b648af479f | ||
|
87f6b941c4 | ||
|
1ade8941b4 | ||
|
e6aec880de | ||
|
9c29019301 | ||
|
a1a50673c8 | ||
|
0232288d5e | ||
|
7ae983b669 | ||
|
29866dbcb3 | ||
|
2e7b509a94 | ||
|
226e2d4c12 | ||
|
0a950c9932 | ||
|
2953bf2bd6 | ||
|
331bbae058 | ||
|
720d4c8e3f | ||
|
6605724fe1 | ||
|
dd91a1bfe5 | ||
|
5348d6e5bc | ||
|
4c145bf9aa | ||
|
63cffc4bd1 | ||
|
1d3feba732 | ||
|
8d0fb34fb0 | ||
|
268f869e67 | ||
|
25bf3fdc9c | ||
|
befed5525a | ||
|
1da168b3c3 | ||
|
5d0e4aef45 | ||
|
686fdb5c06 | ||
|
0a96bac46d | ||
|
4858c2b3fb | ||
|
12f75ab803 | ||
|
e193f9fda3 | ||
|
8c01a5b288 | ||
|
7cac67f097 | ||
|
0648252056 | ||
|
8855490b7f | ||
|
3257780b32 | ||
|
b2d0f0ac8d | ||
|
e8a7e75319 | ||
|
d03d7e9bdc | ||
|
af045dcd8b | ||
|
6d2a897e1b | ||
|
b1ab8d5123 | ||
|
6e345cf136 | ||
|
e849d54572 | ||
|
0662f96284 | ||
|
84da00acd4 | ||
|
3452938c76 | ||
|
b787fcf7e4 | ||
|
e5a7af1c4a | ||
|
b3d91a487d | ||
|
16c950f688 | ||
|
e5b54c6ead | ||
|
3f42c6c243 | ||
|
ef45a8e148 | ||
|
d88e551071 | ||
|
190f7fdac9 | ||
|
33eb7cee2a | ||
|
189d2d9fb1 | ||
|
81c5b6b399 | ||
|
52c6921cb2 | ||
|
bd64188ee5 | ||
|
fb18a5b20d | ||
|
ea4ce80f7c | ||
|
36b2bcb5f3 | ||
|
695f98f213 | ||
|
545ec0741c | ||
|
c1f41720fc | ||
|
14a385d68c | ||
|
03c9aed221 | ||
|
720b24ed2d | ||
|
4243d28846 | ||
|
7d230fdbf8 | ||
|
7fc7fa4843 | ||
|
05fad37b3c | ||
|
0e0ea932ef |
16
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: build
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
luacheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Luarocks
|
||||
run: |
|
||||
sudo apt-get update -qyy
|
||||
sudo apt-get install luarocks -qyy
|
||||
- name: Install Luacheck
|
||||
run: luarocks install --local luacheck
|
||||
- name: Run Luacheck
|
||||
run: $HOME/.luarocks/bin/luacheck mods
|
11
.travis.yml
@ -1,11 +0,0 @@
|
||||
language: generic
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- luarocks
|
||||
before_install:
|
||||
- luarocks install --local luacheck
|
||||
script:
|
||||
- $HOME/.luarocks/bin/luacheck ./mods
|
||||
notifications:
|
||||
email: false
|
@ -12,7 +12,6 @@ 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.
|
||||
|
||||
|
64
README.md
@ -1,63 +1,33 @@
|
||||
Minetest5 Game
|
||||
==============
|
||||
# Minetest Game
|
||||
|
||||
The default game for the Minetest5 engine.
|
||||
The default game bundled in the Minetest 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.
|
||||
For further information, check [this forum topic](https://forum.minetest.net/viewtopic.php?f=15&t=9724).
|
||||
|
||||
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
|
||||
Also see the [Minetest Wiki](https://wiki.minetest.net/Subgames/Minetest_Game) for more information.
|
||||
|
||||
## Installation
|
||||
|
||||
This game can be used in any version from 5.0 to 5.2, it may work with recents versions
|
||||
- Unzip the archive, rename the folder to `minetest_game` and
|
||||
place it in .. `minetest/games/`
|
||||
|
||||
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 `~/.minetest/games/`.
|
||||
|
||||
- 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.
|
||||
The Minetest engine can be found at [GitHub](https://github.com/minetest/minetest).
|
||||
|
||||
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)
|
||||
For further information or help, see: [Installing Mods](https://wiki.minetest.net/Installing_Mods).
|
||||
|
||||
## 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
|
||||
The Minetest Game GitHub `master` `HEAD` is generally compatible with the GitHub
|
||||
`master` `HEAD` of the Minetest engine.
|
||||
|
||||
For minetest4 check https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0
|
||||
Additionally, when the Minetest engine is tagged to be a certain version (e.g.
|
||||
`0.4.10`), Minetest Game is tagged with the version, too.
|
||||
|
||||
When stable releases are made, Minetest Game and the Minetest engine is packaged
|
||||
and made available at [www.minetest.net](https://www.minetest.net/downloads/).
|
||||
|
||||
## Licensing
|
||||
|
||||
See `LICENSE.txt` original autor fo first set of mods game was Blockmen
|
||||
|
||||
See `LICENSE.txt`
|
||||
|
@ -1,5 +1,3 @@
|
||||
title = Minetest5
|
||||
name = Minetest5
|
||||
title = Minetest Game
|
||||
author = Minetest
|
||||
description = GAME set for MinenuX Bundled by default with Minetest5
|
||||
min_minetest_version = 5.0
|
||||
description = A basic exploration, mining, crafting, and building, sandbox game with no NPCs, monsters, or animals. Minetest Game is usually used with mods added, and many mods are available for this game. Reliably maintained by Minetest Engine core developers.
|
||||
|
1188
game_api.md
708
game_api.txt
BIN
menu/header.png
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 935 B |
BIN
menu/icon.png
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@ -1,5 +1,5 @@
|
||||
# This file contains settings of Minetest Game that can be changed in
|
||||
# minetest.conf.
|
||||
# This file contains settings of minetest4 Game that can be changed in
|
||||
# minetest4.conf.
|
||||
# By default, all the settings are commented and not functional.
|
||||
# Uncomment settings by removing the preceding #.
|
||||
|
||||
@ -38,11 +38,9 @@
|
||||
#enable_lavacooling = true
|
||||
|
||||
# Whether the stuff in initial_stuff should be given to new players.
|
||||
# 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
|
||||
#give_initial_stuff = false
|
||||
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,
|
||||
default:torch 99,default:cobble 99
|
||||
|
||||
# Whether the TNT mod should be enabled.
|
||||
#enable_tnt = <true in singleplayer, false in multiplayer>
|
||||
@ -74,6 +72,9 @@
|
||||
# Helps rivers create more sound, especially on level sections.
|
||||
#river_source_sounds = false
|
||||
|
||||
# Enable cloud variation by the 'weather' mod.
|
||||
# Enable cloud and shadow intensity variation by the 'weather' mod.
|
||||
# Non-functional in V6 or Singlenode mapgens.
|
||||
#enable_weather = true
|
||||
|
||||
# If enabled, non-player actions are logged
|
||||
#log_non_player_actions = false
|
||||
|
@ -1,61 +0,0 @@
|
||||
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`
|
@ -1,33 +0,0 @@
|
||||
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
|
@ -1,104 +0,0 @@
|
||||
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)
|
30
mods/beds/README.txt
Normal file
@ -0,0 +1,30 @@
|
||||
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 players to skip the night.
|
||||
To sleep, right click on 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 half 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.
|
@ -1,62 +1,64 @@
|
||||
|
||||
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)
|
||||
beds.remove_spawns_at(pos)
|
||||
beds.remove_spawns_at(other)
|
||||
else
|
||||
reverse = not reverse
|
||||
end
|
||||
end
|
||||
|
||||
function beds.register_bed(name, def)
|
||||
|
||||
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, {
|
||||
minetest.register_node(name .. "_bottom", {
|
||||
description = def.description,
|
||||
inventory_image = def.inventory_image,
|
||||
wield_image = def.wield_image,
|
||||
drawtype = "mesh",
|
||||
mesh = def.mesh or new_mesh,
|
||||
tiles = new_tiles or def.tiles,
|
||||
drawtype = "nodebox",
|
||||
tiles = def.tiles.bottom,
|
||||
use_texture_alpha = "clip",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
stack_max = 1,
|
||||
groups = {
|
||||
choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1,
|
||||
fall_damage_add_percent = -40, bouncy = 85
|
||||
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,
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = def.selectionbox
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = def.collisionbox
|
||||
fixed = def.selectionbox,
|
||||
},
|
||||
|
||||
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
|
||||
@ -65,16 +67,13 @@ 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
|
||||
@ -83,46 +82,101 @@ 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, param2 = dir})
|
||||
minetest.set_node(pos, {name = name .. "_bottom", param2 = dir})
|
||||
minetest.set_node(botpos, {name = name .. "_top", param2 = dir})
|
||||
|
||||
if not beds.is_creative(player_name) then
|
||||
if not minetest.is_creative_enabled(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)
|
||||
beds.remove_spawns_at(pos)
|
||||
destruct_bed(pos, 1)
|
||||
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 minetest.get_item_group(node2.name, "bed") ~= 2 or
|
||||
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_alias(name .. "_bottom", name)
|
||||
minetest.register_alias(name .. "_top", "air")
|
||||
minetest.register_node(name .. "_top", {
|
||||
drawtype = "nodebox",
|
||||
tiles = def.tiles.top,
|
||||
use_texture_alpha = "clip",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
pointable = false,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2,
|
||||
not_in_creative_inventory = 1},
|
||||
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")
|
||||
|
||||
-- register recipe
|
||||
minetest.register_craft({
|
||||
output = name,
|
||||
recipe = def.recipe
|
||||
|
@ -1,79 +1,92 @@
|
||||
-- beds/beds.lua
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = beds.get_translator
|
||||
|
||||
-- Fancy shaped bed
|
||||
|
||||
beds.register_bed("beds:fancy_bed", {
|
||||
description = S("Red Fancy Bed"),
|
||||
description = S("Fancy Bed"),
|
||||
inventory_image = "beds_bed_fancy.png",
|
||||
wield_image = "beds_bed_fancy.png",
|
||||
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},
|
||||
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},
|
||||
recipe = {
|
||||
{"", "", "group:stick"},
|
||||
{"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"}
|
||||
}
|
||||
{"wool:white", "wool:white", "wool:white"},
|
||||
{"group:wood", "group:wood", "group:wood"},
|
||||
},
|
||||
})
|
||||
|
||||
-- Simple shaped bed
|
||||
|
||||
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},
|
||||
beds.register_bed("beds:bed", {
|
||||
description = S("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.0625, 0.5},
|
||||
top = {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5},
|
||||
},
|
||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.0625, 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
|
||||
@ -85,30 +98,12 @@ minetest.register_alias("beds:bed_top_red", "beds:bed_top")
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "beds:fancy_bed",
|
||||
burntime = 13
|
||||
recipe = "beds:fancy_bed_bottom",
|
||||
burntime = 13,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
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
|
||||
recipe = "beds:bed_bottom",
|
||||
burntime = 12,
|
||||
})
|
||||
|
@ -1,4 +0,0 @@
|
||||
default
|
||||
wool
|
||||
pova?
|
||||
intllib?
|
@ -1 +0,0 @@
|
||||
beds which allows sleep, featured to (auto) skip the night.
|
@ -1,25 +1,20 @@
|
||||
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
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = beds.get_translator
|
||||
|
||||
-- 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
|
||||
@ -31,31 +26,22 @@ 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
|
||||
@ -64,9 +50,7 @@ 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()
|
||||
|
||||
@ -76,70 +60,47 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
||||
|
||||
-- stand up
|
||||
if state ~= nil and not state then
|
||||
|
||||
if not beds.player[name] then
|
||||
return false -- player not in bed, do nothing
|
||||
-- player not in bed, do nothing
|
||||
return false
|
||||
end
|
||||
|
||||
beds.bed_position[name] = nil
|
||||
|
||||
-- skip here to prevent sending player specific changes (used for leaving players)
|
||||
if skip then
|
||||
return
|
||||
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)
|
||||
|
||||
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
|
||||
player_api.set_animation(player, "stand" , 30)
|
||||
|
||||
else -- lay down
|
||||
-- lay down
|
||||
else
|
||||
|
||||
-- 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!"))
|
||||
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
|
||||
@ -155,15 +116,9 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
||||
beds.bed_position[name] = bed_pos
|
||||
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)
|
||||
|
||||
-- p.y is just above the nodebox height of the 'Simple Bed' (the highest bed),
|
||||
-- to avoid sinking down through the bed.
|
||||
local p = {
|
||||
@ -171,58 +126,36 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
||||
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)
|
||||
|
||||
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
|
||||
player_api.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 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;" .. esc(S("Good morning.")) .. "]"
|
||||
else
|
||||
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;" ..
|
||||
esc(S("Force night skip")) .. "]"
|
||||
@ -234,46 +167,36 @@ 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 > 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, 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)
|
||||
@ -285,13 +208,10 @@ 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()
|
||||
@ -300,67 +220,37 @@ 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]
|
||||
|
||||
-- check if respawn flag is true (for mini-game support, can be set to false)
|
||||
if pos and beds.respawn[name] then
|
||||
if pos 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()
|
||||
@ -369,11 +259,7 @@ 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()
|
||||
@ -386,11 +272,7 @@ minetest.register_on_dieplayer(function(player)
|
||||
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
|
||||
@ -406,11 +288,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
end
|
||||
|
||||
if fields.force then
|
||||
|
||||
-- check if enough players are sleeping to skip night (was half)
|
||||
local is_majority = (
|
||||
#minetest.get_connected_players() / div) < last_player_in_bed
|
||||
|
||||
local is_majority = (#minetest.get_connected_players() / 2) < last_player_in_bed
|
||||
if is_majority and is_night_skip_enabled() then
|
||||
update_formspecs(true)
|
||||
beds.skip_night()
|
||||
|
@ -1,47 +1,20 @@
|
||||
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/init.lua
|
||||
|
||||
-- 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
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("beds")
|
||||
local esc = minetest.formspec_escape
|
||||
|
||||
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 = {}
|
||||
beds.player = {}
|
||||
beds.bed_position = {}
|
||||
beds.pos = {}
|
||||
beds.spawn = {}
|
||||
beds.get_translator = S
|
||||
|
||||
beds.formspec = "size[8,11;true]" ..
|
||||
"no_prepend[]" ..
|
||||
"bgcolor[#080808BB;true]" ..
|
||||
"button_exit[2,10;4,0.75;leave;" .. esc(S("Leave Bed")) .. "]"
|
||||
|
||||
beds.day_interval = {
|
||||
start = 0.2,
|
||||
@ -50,20 +23,9 @@ beds.day_interval = {
|
||||
|
||||
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")
|
||||
|
@ -59,7 +59,3 @@ 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
|
||||
|
10
mods/beds/locale/beds.eo.tr
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=Luksa Lito
|
||||
Simple Bed=Simpla Lito
|
||||
This bed is already occupied!=Tiu lito jam estas okupata!
|
||||
You have to stop moving before going to bed!=Vi ĉesu moviĝi por enlitiĝi!
|
||||
Good morning.=Bonan matenon.
|
||||
@1 of @2 players are in bed=@1 el @2 ludantoj estas en lito
|
||||
Force night skip=Devigi noktan salton
|
||||
You can only sleep at night.=Vi povas dormi nur nokte.
|
||||
Leave Bed=Ellitiĝi
|
@ -1,8 +1,8 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=Lit chic
|
||||
Simple Bed=Lit simple
|
||||
This bed is already occupied!=
|
||||
You have to stop moving before going to bed!=
|
||||
This bed is already occupied!=Ce lit est déjà occupé !
|
||||
You have to stop moving before going to bed!=Vous devez arrêter de bouger avant de vous coucher !
|
||||
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
|
||||
|
@ -1,10 +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!=
|
||||
This bed is already occupied!=Ranjang telah terisi!
|
||||
You have to stop moving before going to bed!=Anda harus diam untuk tidur!
|
||||
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.
|
||||
You can only sleep at night.=Anda hanya bisa tidur pada waktu malam.
|
||||
Leave Bed=Tinggalkan Ranjang
|
||||
|
10
mods/beds/locale/beds.ja.tr
Normal 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=ベッドから出ます
|
10
mods/beds/locale/beds.pl.tr
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=Fantazyjne łóżko
|
||||
Simple Bed=Proste łóżko
|
||||
This bed is already occupied!=To łóżko jest już zajęte!
|
||||
You have to stop moving before going to bed!=Musisz się zatrzymać aby wejść do łóżka
|
||||
Good morning.=Dzień dobry.
|
||||
@1 of @2 players are in bed=@1 z @2 graczy śpią
|
||||
Force night skip=Wymuś pominięcie nocy
|
||||
You can only sleep at night.=Możesz spać tylko w nocy.
|
||||
Leave Bed=Opuść łóżko
|
@ -1,8 +1,8 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=Детализированная Кровать
|
||||
Simple Bed=Обычная Кровать
|
||||
This bed is already occupied!=
|
||||
You have to stop moving before going to 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=Пропустить ночь
|
||||
|
@ -1,10 +0,0 @@
|
||||
# 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
|
@ -1,8 +1,8 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=Pekná posteľ
|
||||
Simple Bed=Jednoduchá posteľ
|
||||
This bed is already occupied!=
|
||||
You have to stop moving before going to bed!=
|
||||
This bed is already occupied!=Táto posteľ je už obsadená
|
||||
You have to stop moving before going to bed!=Predtým ako si ľahneš do postele, sa musíš prestať pohybovať!
|
||||
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
|
||||
|
10
mods/beds/locale/beds.sv.tr
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=Fin säng
|
||||
Simple Bed=Enkel säng
|
||||
This bed is already occupied!=Den här sängen används redan!
|
||||
You have to stop moving before going to bed!=Du måste stanna innan du kan lägga dig!
|
||||
Good morning.=God morgon.
|
||||
@1 of @2 players are in bed=@1 av @2 spelare försöker sova.
|
||||
Force night skip=Tvinga att hoppa över natt
|
||||
You can only sleep at night.=Du kan bara sova på natten.
|
||||
Leave Bed=Lämna säng
|
10
mods/beds/locale/beds.uk.tr
Normal 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=Встати з ліжка
|
@ -1,8 +1,8 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=花式床
|
||||
Simple Bed=简易床
|
||||
This bed is already occupied!=
|
||||
You have to stop moving before going to 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=强制跳过夜晚
|
||||
|
@ -1,8 +1,8 @@
|
||||
# textdomain: beds
|
||||
Fancy Bed=花式床
|
||||
Simple Bed=簡易床
|
||||
This bed is already occupied!=
|
||||
You have to stop moving before going to 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=強制跳過夜晚
|
||||
|
@ -1,4 +1,3 @@
|
||||
name = beds
|
||||
description = beds which allows sleep, featured to (auto) skip the night.
|
||||
description = Minetest Game mod: beds
|
||||
depends = default, wool
|
||||
optional_depends = player_api, pova, intllib
|
||||
|
@ -1,160 +0,0 @@
|
||||
# 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
|
@ -1,32 +0,0 @@
|
||||
# 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
|
Before Width: | Height: | Size: 164 KiB |
@ -1,5 +0,0 @@
|
||||
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
|
@ -3,44 +3,30 @@ 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()
|
||||
@ -49,54 +35,38 @@ 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
|
||||
|
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 490 B |
Before Width: | Height: | Size: 413 B |
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 345 B |
BIN
mods/beds/textures/beds_bed_foot.png
Normal file
After Width: | Height: | Size: 340 B |
BIN
mods/beds/textures/beds_bed_head.png
Normal file
After Width: | Height: | Size: 343 B |
BIN
mods/beds/textures/beds_bed_side1.png
Normal file
After Width: | Height: | Size: 248 B |
BIN
mods/beds/textures/beds_bed_side2.png
Normal file
After Width: | Height: | Size: 265 B |
BIN
mods/beds/textures/beds_bed_side_bottom.png
Normal file
After Width: | Height: | Size: 431 B |
BIN
mods/beds/textures/beds_bed_side_bottom_r.png
Normal file
After Width: | Height: | Size: 427 B |
BIN
mods/beds/textures/beds_bed_side_top.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
mods/beds/textures/beds_bed_side_top_r.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
mods/beds/textures/beds_bed_top1.png
Normal file
After Width: | Height: | Size: 474 B |
BIN
mods/beds/textures/beds_bed_top2.png
Normal file
After Width: | Height: | Size: 547 B |
BIN
mods/beds/textures/beds_bed_top_bottom.png
Normal file
After Width: | Height: | Size: 425 B |
BIN
mods/beds/textures/beds_bed_top_top.png
Normal file
After Width: | Height: | Size: 490 B |
BIN
mods/beds/textures/beds_bed_under.png
Normal file
After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 424 B |
Before Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 632 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
BIN
mods/beds/textures/beds_transparent.png
Normal file
After Width: | Height: | Size: 83 B |
@ -1,37 +0,0 @@
|
||||
Minetest Game mod: binoculars
|
||||
=============================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
paramat (MIT)
|
||||
|
||||
Authors of media (textures)
|
||||
---------------------------
|
||||
paramat (CC BY-SA 3.0):
|
||||
binoculars_binoculars.png
|
||||
|
||||
Crafting
|
||||
--------
|
||||
binoculars:binoculars
|
||||
|
||||
default:obsidian_glass O
|
||||
default:bronze_ingot B
|
||||
|
||||
O_O
|
||||
BBB
|
||||
O_O
|
||||
|
||||
Usage
|
||||
-----
|
||||
In survival mode, use of zoom requires the binoculars item in your inventory,
|
||||
they will allow a 10 degree field of view.
|
||||
It can take up to 5 seconds for adding to or removal from inventory to have an
|
||||
effect, however to instantly allow the use of this zoom 'use' (leftclick) the
|
||||
item.
|
||||
|
||||
Zoom with a field of view of 15 degrees is automatically allowed in creative
|
||||
mode and for any player with the 'creative' privilege.
|
||||
|
||||
The 'binoculars.update_player_property()' function is global so can be
|
||||
redefined by a mod for alternative behaviour.
|
@ -8,25 +8,16 @@ binoculars = {}
|
||||
local S = minetest.get_translator("binoculars")
|
||||
|
||||
|
||||
-- Detect creative mod
|
||||
local creative_mod = minetest.get_modpath("creative")
|
||||
-- Cache creative mode setting as fallback if creative mod not present
|
||||
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
||||
|
||||
|
||||
-- Update player property
|
||||
-- Global to allow overriding
|
||||
|
||||
function binoculars.update_player_property(player)
|
||||
local creative_enabled =
|
||||
(creative_mod and creative.is_enabled_for(player:get_player_name())) or
|
||||
creative_mode_cache
|
||||
local new_zoom_fov = 0
|
||||
|
||||
if player:get_inventory():contains_item(
|
||||
"main", "binoculars:binoculars") then
|
||||
new_zoom_fov = 10
|
||||
elseif creative_enabled then
|
||||
elseif minetest.is_creative_enabled(player:get_player_name()) then
|
||||
new_zoom_fov = 15
|
||||
end
|
||||
|
||||
@ -62,6 +53,7 @@ minetest.register_craftitem("binoculars:binoculars", {
|
||||
description = S("Binoculars") .. "\n" .. S("Use with 'Zoom' key"),
|
||||
inventory_image = "binoculars_binoculars.png",
|
||||
stack_max = 1,
|
||||
groups = {tool = 1},
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
binoculars.update_player_property(user)
|
||||
|
@ -1,59 +0,0 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2017 paramat
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
Licenses of media (textures)
|
||||
----------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2017 paramat
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
||||
For more details:
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
3
mods/binoculars/locale/binoculars.eo.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Binoklo
|
||||
Use with 'Zoom' key=Uzi per 'Zomo' klavo
|
3
mods/binoculars/locale/binoculars.id.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Teropong
|
||||
Use with 'Zoom' key=Pakai dengan tombol 'Zum'
|
3
mods/binoculars/locale/binoculars.ja.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=双眼鏡
|
||||
Use with 'Zoom' key=ズームキーで使います
|
3
mods/binoculars/locale/binoculars.jbo.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=lo reldarvistci
|
||||
Use with 'Zoom' key=.i tu'a le jvinu banro batke cu tadji lo nu pilno
|
3
mods/binoculars/locale/binoculars.pl.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Lornetka
|
||||
Use with 'Zoom' key=Aby użyć naciśnij 'Zoom'
|
3
mods/binoculars/locale/binoculars.pt_BR.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Binóculos
|
||||
Use with 'Zoom' key=Use com a tecla de 'Zoom'
|
@ -1,3 +0,0 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Kikare
|
||||
Use with 'Zoom' key=Används med 'Zoom' knappen
|
3
mods/binoculars/locale/binoculars.sk.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Ďalekohľad
|
||||
Use with 'Zoom' key=Použi s klávesou "Priblíž"
|
3
mods/binoculars/locale/binoculars.sv.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Kikare
|
||||
Use with 'Zoom' key=Använd med 'Zoom'-knappen
|
3
mods/binoculars/locale/binoculars.uk.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: binoculars
|
||||
Binoculars=Бінокль
|
||||
Use with 'Zoom' key=Використовується з правами 'Zoom'
|
@ -1,4 +1,3 @@
|
||||
name = binoculars
|
||||
description = Minetest Game mod: binoculars
|
||||
depends = default
|
||||
optional_depends = creative
|
||||
|
Before Width: | Height: | Size: 219 B |
@ -1,77 +0,0 @@
|
||||
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)
|
31
mods/boats/README.txt
Normal file
@ -0,0 +1,31 @@
|
||||
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.
|
@ -1,3 +0,0 @@
|
||||
default
|
||||
player_api?
|
||||
creative?
|
@ -1,32 +1,7 @@
|
||||
-- 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
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("boats")
|
||||
|
||||
--
|
||||
-- Helper functions
|
||||
@ -49,21 +24,6 @@ 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
|
||||
--
|
||||
@ -76,7 +36,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,
|
||||
@ -95,11 +55,8 @@ function boat.on_rightclick(self, clicker)
|
||||
if self.driver and name == self.driver then
|
||||
-- Cleanup happens in boat.on_detach_child
|
||||
clicker:set_detach()
|
||||
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()
|
||||
@ -110,18 +67,10 @@ function boat.on_rightclick(self, clicker)
|
||||
{x = 0.5, y = 1, z = -3}, {x = 0, y = 0, z = 0})
|
||||
|
||||
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()
|
||||
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
|
||||
@ -131,11 +80,8 @@ end
|
||||
-- If driver leaves server while driving boat
|
||||
function boat.on_detach_child(self, child)
|
||||
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
|
||||
@ -143,7 +89,7 @@ end
|
||||
|
||||
|
||||
function boat.on_activate(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({fleshy = 100})
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
if staticdata then
|
||||
self.v = tonumber(staticdata)
|
||||
end
|
||||
@ -165,16 +111,12 @@ function boat.on_punch(self, puncher)
|
||||
if self.driver and name == self.driver then
|
||||
self.driver = nil
|
||||
puncher:set_detach()
|
||||
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 is_creative_enabled(name)
|
||||
if not minetest.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
|
||||
@ -191,19 +133,8 @@ end
|
||||
|
||||
|
||||
function boat.on_step(self, dtime)
|
||||
|
||||
-- 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()
|
||||
@ -234,11 +165,6 @@ 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()
|
||||
@ -301,30 +227,6 @@ 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
|
||||
|
||||
|
||||
@ -363,7 +265,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 is_creative_enabled(player_name) then
|
||||
if not minetest.is_creative_enabled(player_name) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
@ -386,6 +288,3 @@ minetest.register_craft({
|
||||
recipe = "boats:boat",
|
||||
burntime = 20,
|
||||
})
|
||||
|
||||
|
||||
print ("[MOD] Boats loaded")
|
||||
|
@ -33,7 +33,6 @@ 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.
|
||||
|
4
mods/boats/locale/boats.de.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Schneller Bootsmodus an
|
||||
Boat cruise mode off=Schneller Bootsmodus aus
|
||||
Boat=Boot
|
4
mods/boats/locale/boats.eo.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=La kroza maniero de la boato estas ŝaltita.
|
||||
Boat cruise mode off=La kroza maniero de la boato estas malŝaltita.
|
||||
Boat=Boato
|
4
mods/boats/locale/boats.es.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Modo crucero en bote activado
|
||||
Boat cruise mode off=Modo crucero en bote desactivado
|
||||
Boat=Bote
|
4
mods/boats/locale/boats.fr.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Bateau mode rapide activé
|
||||
Boat cruise mode off=Bateau mode rapide désactivé
|
||||
Boat=Bateau
|
4
mods/boats/locale/boats.id.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Mode perahu jelajah nyala
|
||||
Boat cruise mode off=Mode perahu jelajah mati
|
||||
Boat=Perahu
|
4
mods/boats/locale/boats.it.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Modalità movimento automatico barca attivata
|
||||
Boat cruise mode off=Modalità movimento automatico barca disattivata
|
||||
Boat=Barca
|
4
mods/boats/locale/boats.ja.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=クルージングモード・オン
|
||||
Boat cruise mode off=クルージングモード・オフ
|
||||
Boat=ボート
|
4
mods/boats/locale/boats.jbo.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=.i lo bloti cu zmiku le ka klama
|
||||
Boat cruise mode off=.i lo bloti cu macnu le ka klama
|
||||
Boat=lo bloti
|
4
mods/boats/locale/boats.ms.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Mod bot layar makan angin dibolehkan
|
||||
Boat cruise mode off=Mod bot layar makan angin dilumpuhkan
|
||||
Boat=Bot
|
4
mods/boats/locale/boats.pl.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Tryb rejsu łodką włączony
|
||||
Boat cruise mode off=Tryb rejsu łodką wyłączony
|
||||
Boat=Łódka
|
4
mods/boats/locale/boats.pt_BR.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Modo de cruseiro do barco ligado
|
||||
Boat cruise mode off=Modo de cruseiro do barco desligado
|
||||
Boat=Barco
|
4
mods/boats/locale/boats.ru.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Автоход лодки включен
|
||||
Boat cruise mode off=Автоход лодки выключен
|
||||
Boat=Лодка
|
4
mods/boats/locale/boats.sk.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Cestovný režim loďky je zapnutý
|
||||
Boat cruise mode off=Cestovný režim loďky je vypnutý
|
||||
Boat=Loďka
|
4
mods/boats/locale/boats.sv.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Båtkryssningsläge på
|
||||
Boat cruise mode off=Båtkryssningsläge av
|
||||
Boat=Båt
|
4
mods/boats/locale/boats.uk.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=Режим мандрування на човні увімкнено
|
||||
Boat cruise mode off=Режим мандрування на човні вимкнено
|
||||
Boat=Човен
|
4
mods/boats/locale/boats.zh_CN.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=巡航模式开启
|
||||
Boat cruise mode off=巡航模式关闭
|
||||
Boat=船
|
4
mods/boats/locale/boats.zh_TW.tr
Normal file
@ -0,0 +1,4 @@
|
||||
# textdomain: boats
|
||||
Boat cruise mode on=巡航模式開啟
|
||||
Boat cruise mode off=巡航模式關閉
|
||||
Boat=船
|