Compare commits
632 Commits
Author | SHA1 | Date | |
---|---|---|---|
3c9d0893ee | |||
12b1541971 | |||
e5c5c2637e | |||
55a16cd2c6 | |||
3e5852993d | |||
4a5206e3a7 | |||
fed2151d70 | |||
58038a7941 | |||
0ff09e018d | |||
7998de671f | |||
fc791d80f0 | |||
e67a60376f | |||
ea9c4012d5 | |||
d7f176dfd8 | |||
c5f11d74d4 | |||
42afe679a7 | |||
0413cb67b8 | |||
f06f66ccc2 | |||
04f045158f | |||
4f32fd253c | |||
0196c4793a | |||
fa17fe31d6 | |||
788ae97ba1 | |||
1a6ad498d7 | |||
2effe40dc5 | |||
81f8c8aef8 | |||
9bbe7f99da | |||
d42ae715b8 | |||
e837621537 | |||
fd87b04f3c | |||
e4b1c93512 | |||
b0ae488277 | |||
0bd2efcfc1 | |||
09a229b412 | |||
208c9f4901 | |||
55ab3a117d | |||
ec95f47021 | |||
1e691c4429 | |||
75caa9167c | |||
47efa2f558 | |||
2c122052d4 | |||
c3f3406e8e | |||
68192a17e9 | |||
022d22ceca | |||
af3c91862c | |||
7fbf25d6ca | |||
f8bc1e1714 | |||
ddea6c431e | |||
614e9cfe8d | |||
6e00ddee2a | |||
3109f38b3c | |||
5868274b00 | |||
c824d69182 | |||
c7e2d59461 | |||
631f7f46c7 | |||
178db04526 | |||
23ba2d3a0c | |||
7fee589e03 | |||
5b2a896180 | |||
56d6eaed85 | |||
d92034e3f7 | |||
0acd9a2ccb | |||
02a82c9d7a | |||
89b9c3e69e | |||
048aaa2616 | |||
581c390591 | |||
138eb71db6 | |||
bca0142e7f | |||
41a3345718 | |||
3c9d71e6f7 | |||
fbac9be51c | |||
fa9a34554b | |||
f7325d26b6 | |||
9b62d8a504 | |||
bcb4426ec7 | |||
4ea74466e4 | |||
3d26b33e5b | |||
7b30c26a45 | |||
78311a27a1 | |||
6fdfd2554c | |||
53179b8d10 | |||
1906ab84f5 | |||
1799754a8f | |||
32f7051eb8 | |||
67fc2247fc | |||
c0de5646d2 | |||
5e4a6e8ac6 | |||
36a78c87d7 | |||
0ad3306c79 | |||
0f6e75bcb5 | |||
3e05870706 | |||
34c768d394 | |||
b848e35ca5 | |||
0cbb516ae2 | |||
54235f3276 | |||
992f295880 | |||
6171fb43f0 | |||
7d70d25eeb | |||
e9d26e2ee3 | |||
f844a4f379 | |||
1d6fbe04cd | |||
0664570d22 | |||
5e9e3f7e84 | |||
995256744a | |||
471d1cf159 | |||
3be2f12beb | |||
cabf80b743 | |||
088385493a | |||
1b745d401d | |||
2ecbc43a7a | |||
619ac52693 | |||
61a197ffd8 | |||
14b99a72a9 | |||
76211624ac | |||
b408e9cce6 | |||
20fa037313 | |||
60cf3f85b6 | |||
6c83ea0b48 | |||
265c40b558 | |||
00c2dde4ea | |||
4fba897a96 | |||
ea49eb3f3d | |||
0ac096991c | |||
2df7ce20dd | |||
db129f4ca0 | |||
72f4c6be48 | |||
79dbafc13b | |||
1a2eb89f17 | |||
f018e06d9b | |||
9862bbc8e5 | |||
3661cb61e3 | |||
0bd13d11cf | |||
d89bb69a22 | |||
9524ff67a3 | |||
30b0a155fb | |||
4473627de0 | |||
d7a7456007 | |||
b74954969c | |||
07141b4a2e | |||
fcceec0e8c | |||
f1f96dbe6b | |||
594365310d | |||
71c7e21669 | |||
e38099225c | |||
5644ab4bd3 | |||
fe450b4144 | |||
3d44804074 | |||
60f6564c75 | |||
f17d791173 | |||
497e6f6257 | |||
98551edd94 | |||
c5b0fe72ea | |||
d42f77cc5f | |||
d476d017a4 | |||
1886d293d7 | |||
21b457c9e1 | |||
80d49095f5 | |||
f4f9e58ef2 | |||
55fd286083 | |||
1231f72628 | |||
15b82f5b03 | |||
f796194c69 | |||
84e4ae1881 | |||
f15f35c604 | |||
be918d2d98 | |||
6bf552eb10 | |||
983af7b1c0 | |||
22dc7b2d9e | |||
cd5893db02 | |||
9d6df824d6 | |||
5809c28ae3 | |||
e77ef553ff | |||
1fafed3387 | |||
e0bec501f2 | |||
3e9afe097c | |||
5775c9147c | |||
ba1ae07b4a | |||
50eb079813 | |||
da0fe31443 | |||
2199be5108 | |||
b5ea7d17b2 | |||
dcf2465441 | |||
6386684f3e | |||
ba33639887 | |||
541b2d79c7 | |||
37347d40f4 | |||
d61803b65f | |||
e0cb3fce02 | |||
70ef7864c1 | |||
fc902a77de | |||
3e5f3f28d2 | |||
d8daee7e47 | |||
7681682d28 | |||
b9422ed44e | |||
b1e0864cf1 | |||
90f24e312d | |||
e7a55734d3 | |||
b36b154257 | |||
3976dc6a5b | |||
8ea031ef77 | |||
8c3f96d738 | |||
8d3d558e42 | |||
de3adb5859 | |||
acafe5ca86 | |||
12c763a6c7 | |||
098ea0d10a | |||
f14b411157 | |||
1a6298958e | |||
fafbe2c268 | |||
dc7cbdd5ab | |||
5cd4b5a231 | |||
f62afa02b7 | |||
7a892c70e6 | |||
682d79b82a | |||
8b384fb257 | |||
d6c33da355 | |||
386dcdef06 | |||
54b87e955d | |||
f32a3ff57c | |||
16fe1efcd8 | |||
fa43bd8a56 | |||
e426f64993 | |||
ab7b7c7504 | |||
80664f9f8a | |||
0ca43e42bc | |||
33aa5e77dc | |||
f8e273da15 | |||
9ece86cc7a | |||
7d93272caa | |||
64fe69f382 | |||
a2d4e57716 | |||
8114c3dbab | |||
e6cef57661 | |||
0736d30e33 | |||
da5f4a939e | |||
a84e2669c7 | |||
ccee025ce3 | |||
8c801529df | |||
3ddff2fbea | |||
eafd1ebc43 | |||
3623398b78 | |||
b25889e742 | |||
9f4dc1412b | |||
cfef21f4d9 | |||
8556dd30e2 | |||
8cd049c224 | |||
12d5ca2f48 | |||
3ecafbcfb4 | |||
082b36d3e7 | |||
7be008936e | |||
6e1a329763 | |||
47b197e4d5 | |||
be05441e77 | |||
aadac1223d | |||
9a6cb2d7c8 | |||
f4e77edcc6 | |||
e38f69d549 | |||
874b1ae326 | |||
1977ae19ae | |||
7bbbcbf7b0 | |||
4d7dbfc826 | |||
787ccb5747 | |||
12bcfeab4d | |||
14334a1d89 | |||
6749da1070 | |||
7a29d26e3e | |||
7cba7af894 | |||
a71948c007 | |||
c3d2bc383b | |||
7d55320d5c | |||
0d3bca790c | |||
ffba9d978e | |||
1a5f89e750 | |||
51891122f2 | |||
537f94c28e | |||
da0cc7f6f6 | |||
b57dd0f9b2 | |||
8fdcfea9f9 | |||
9de43cdf7d | |||
a2ecc51fbc | |||
d90a081722 | |||
70248505ae | |||
22e32a01ad | |||
c94349eaef | |||
41c2b2aeea | |||
cb57f70aab | |||
f18871d60c | |||
c17c317669 | |||
7c966db4bc | |||
e5304ce674 | |||
28884cc784 | |||
dfee51c21e | |||
20053d6b52 | |||
079b796031 | |||
9c887e0b32 | |||
2fb40be409 | |||
f8f7502e32 | |||
b998ab1b3a | |||
d979293f14 | |||
676822d286 | |||
a5ad30748d | |||
45bc0b245f | |||
aa676ab878 | |||
f80fafbcfb | |||
7f317871d4 | |||
68f5740dcc | |||
6c6cc2159a | |||
aa254e2835 | |||
29252c6fb2 | |||
ac843f8fe7 | |||
0410b5e0ca | |||
3a98245f62 | |||
00a0d9a5d4 | |||
5d28040915 | |||
62dbf29301 | |||
6493e5fefb | |||
42cc6d2c31 | |||
3a55e19055 | |||
ea2a7d3b1f | |||
2c355a8642 | |||
777088481b | |||
6b055ae18a | |||
4c9944b263 | |||
73d998ccdf | |||
3fcb7821d7 | |||
ed9fd475de | |||
2cc6640edf | |||
bbf17c9eca | |||
1ab0fc12a7 | |||
5569950b26 | |||
363b95c003 | |||
8422f2ef52 | |||
36d18cb161 | |||
b47a556472 | |||
7d2dfe4101 | |||
04f01bc57f | |||
7a3cff5529 | |||
8f095c62a8 | |||
f600a9f645 | |||
9e54b379c8 | |||
5994ac8dc5 | |||
c198d8c57e | |||
09dbaf7972 | |||
0add474af2 | |||
0ea23a50d3 | |||
2f39cad09b | |||
a4e144e4c8 | |||
f4512cb5b6 | |||
38a8351327 | |||
a5d40e13be | |||
4b8410a982 | |||
250be40ecd | |||
322967d2d1 | |||
f41314185e | |||
6d79d157c3 | |||
6267f26027 | |||
535e611eb1 | |||
223e924edf | |||
556f0d48e3 | |||
57939c6c3f | |||
9542d119f6 | |||
7488f483c7 | |||
b0ec8f1b5a | |||
c76a91943c | |||
0472e61a9d | |||
e9a7782c88 | |||
76471dd137 | |||
11115c7d15 | |||
481d1758ad | |||
32bdb9a393 | |||
82299b94dc | |||
b1e2ece638 | |||
eaed418b10 | |||
8704afe5b1 | |||
c3a1545ca1 | |||
a1b8b68e92 | |||
b57ecb94df | |||
c66a98bbed | |||
25e1f84733 | |||
b8333cf82a | |||
abf0ca9c7e | |||
135d80eb86 | |||
0d49978341 | |||
4ef6810298 | |||
1d8def5c06 | |||
e41a411f1c | |||
e67e28d226 | |||
3d6f1685ad | |||
592ca341ea | |||
a88576afd1 | |||
6f6d46ddfc | |||
7c0abe9366 | |||
321bd66721 | |||
2729777b94 | |||
f3dc78204c | |||
b292975fbc | |||
3fb6ee5bdf | |||
ef8b7e230d | |||
c15bd9d529 | |||
41c1e99b1f | |||
70e8924082 | |||
f4a412d9c1 | |||
8148bbf95e | |||
2119054a95 | |||
ac810dbf9d | |||
8e51f318b3 | |||
93a2c40ebc | |||
ff0973fa4f | |||
1f85f001f9 | |||
279b85fc45 | |||
24578ca968 | |||
d0fad4b004 | |||
4bb9652c0f | |||
b6c12010b1 | |||
f5c8f881d7 | |||
0004c5e637 | |||
1cc8300ba9 | |||
fd5721faa8 | |||
09d910efcb | |||
acb0cecb36 | |||
c2307b8816 | |||
73113f3443 | |||
4d9b595a69 | |||
908d8e5f90 | |||
a0d7644a86 | |||
2392842948 | |||
3740efb393 | |||
835ca02be5 | |||
99d0442cc9 | |||
b24049950e | |||
86dab909ed | |||
ffcb3d6356 | |||
c7b9e734ff | |||
450543f782 | |||
b7a1426b42 | |||
408ee69fb8 | |||
35de5241f4 | |||
be4dd6479d | |||
7066a6a0dd | |||
6194f9ffea | |||
47c7b0b187 | |||
0a3bf5b220 | |||
14ee61ab92 | |||
f7f178ce03 | |||
547a7b3304 | |||
8d1eef025d | |||
84de5f0f40 | |||
cbea61e8dd | |||
2885ae6018 | |||
cf781ee218 | |||
252dffce78 | |||
83c2a88c91 | |||
e7def5d4e6 | |||
ec68283812 | |||
bc4d0c1344 | |||
e2033025b0 | |||
da9789e3ce | |||
26866e4c21 | |||
0cf4fd4c18 | |||
2ddbf68e31 | |||
0c5f6dabc0 | |||
fdae2832bb | |||
6843ddb814 | |||
166b1c623a | |||
e8cafeb3e7 | |||
8a7af21e3a | |||
407b32e04c | |||
f3f8b22698 | |||
585b2bc22e | |||
0914e595c7 | |||
7361eb5e05 | |||
44ac020f28 | |||
e15fde1624 | |||
15ef8b0995 | |||
d8dd9332ed | |||
c4fb5bd385 | |||
f09ae11e89 | |||
8b4a92ef2d | |||
f92d49feff | |||
64fa8e6be5 | |||
0aebf864d1 | |||
016fa0da40 | |||
7786f7f8b1 | |||
6919d43d02 | |||
01ad09036b | |||
638add603f | |||
750f9575af | |||
40e2b945e3 | |||
03b51e8c8f | |||
a4d056e493 | |||
23a37e5e79 | |||
300b14078f | |||
eae3740d85 | |||
3669ca0a83 | |||
46c6154444 | |||
2824562dc9 | |||
852b337916 | |||
dd34dffa45 | |||
aaa6c260cd | |||
81259e9fcc | |||
4bd1094619 | |||
8bc8dd64c5 | |||
ab4485f824 | |||
fa1b4d0d44 | |||
055157d084 | |||
fe3c5a7090 | |||
d0070f2b1a | |||
c570f9f494 | |||
f8c8047a52 | |||
f49faadc19 | |||
fe7a982343 | |||
87468eb6fc | |||
4a7a51a46e | |||
9c15ebccab | |||
525f467057 | |||
820a97e397 | |||
3f2e35e827 | |||
ccb4b925ed | |||
21c874ab52 | |||
8a8712e4a3 | |||
9eb9502209 | |||
a192f9fc78 | |||
794a436d86 | |||
41837e6193 | |||
86e0e4b2bf | |||
2a6050e552 | |||
e604d8d7f3 | |||
5a2aab855f | |||
f86ac2fdff | |||
df35360372 | |||
3e912f7b85 | |||
ea7b04a712 | |||
edb02e9d33 | |||
3b526a7276 | |||
03c00a831d | |||
60520b8032 | |||
a9137e8c21 | |||
75ea7e3160 | |||
047ecea3a2 | |||
5518c277f3 | |||
4468015cbe | |||
0755a8fa05 | |||
5d8b2442ce | |||
6157982787 | |||
07dcae7258 | |||
d546a5a1fa | |||
3689bdad75 | |||
4ce47528e1 | |||
2edfb55c29 | |||
d1e715ebac | |||
c654c9fd11 | |||
2c0f716a13 | |||
64bf6c1b89 | |||
047bfb9ad1 | |||
cab01b6694 | |||
554d15fadb | |||
a9ac480dcd | |||
1237bc3a4b | |||
854415fd33 | |||
99cfe73bbf | |||
697b39d40d | |||
2b7ca68805 | |||
bd24c15db4 | |||
69614dc20d | |||
75dfcdb1e7 | |||
c332081e81 | |||
608e51f16d | |||
b0fb180e4d | |||
2ebd6b3839 | |||
5a06de184c | |||
957f94534b | |||
4ec4672f01 | |||
954d64afdc | |||
ef0eb4d435 | |||
11a7b88434 | |||
9ec33f34f1 | |||
2c2edfad04 | |||
22dd46dcc6 | |||
20f938e44a | |||
fd34872de8 | |||
31edc5a9ff | |||
19bdcb26f6 | |||
5b7db48372 | |||
128f0adb24 | |||
6fb072e5ff | |||
8007c142de | |||
e707ba3cf1 | |||
6680a51988 | |||
3bf3249d71 | |||
e71b71c1a9 | |||
a90338d40d | |||
929559fe85 | |||
c41762d211 | |||
f06d4b8547 | |||
dcce6e9795 | |||
d57cb0a110 | |||
ba8cbbcdbd | |||
56cc4191ca | |||
6532978a58 | |||
349a63ed14 | |||
7f44a49d99 | |||
5047540db2 | |||
9dfaab7f20 | |||
8fe62ea7f6 | |||
c4969665e7 | |||
9670c27161 | |||
c32957f942 | |||
c95cd8414b | |||
cc2573acdf | |||
44dc611088 | |||
49a8ddc822 | |||
11c04e984d | |||
ef1f66a64e | |||
a1aee9a68f | |||
5dbc738dbd | |||
5b5aa493b5 | |||
6967232619 | |||
263b6f2fdf | |||
0ca4520cc2 | |||
ea3fcdd077 | |||
820e48badc | |||
c39b9b29de | |||
a8ad9bfc9d | |||
d4c24a30e9 | |||
c8845e8d44 | |||
5175897cdc | |||
c521cb06bf | |||
3180bdfe6c | |||
c993e14084 | |||
955f3cf310 | |||
814c17631d | |||
ca7f6bb97a |
0
.gitignore
vendored
Executable file → Normal file
17
.luacheckrc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
unused_args = false
|
||||||
|
allow_defined_top = true
|
||||||
|
|
||||||
|
read_globals = {
|
||||||
|
"DIR_DELIM",
|
||||||
|
"minetest", "core",
|
||||||
|
"dump",
|
||||||
|
"vector",
|
||||||
|
"VoxelManip", "VoxelArea",
|
||||||
|
"PseudoRandom", "ItemStack",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Overwrites minetest.handle_node_drops
|
||||||
|
files["mods/creative/init.lua"].globals = { "minetest" }
|
||||||
|
|
||||||
|
-- Don't report on legacy definitions of globals.
|
||||||
|
files["mods/default/legacy.lua"].global = false
|
12
.travis.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
language: generic
|
||||||
|
sudo: false
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- luarocks
|
||||||
|
before_install:
|
||||||
|
- luarocks install --local luacheck
|
||||||
|
script:
|
||||||
|
- $HOME/.luarocks/bin/luacheck --no-color ./mods
|
||||||
|
notifications:
|
||||||
|
email: false
|
0
README.txt
Executable file → Normal file
2
game.conf
Executable file → Normal file
@ -1 +1 @@
|
|||||||
name = MinetestForFun Game
|
name = Minetest Game
|
||||||
|
186
game_api.txt
Executable file → Normal file
@ -70,7 +70,17 @@ Beds API
|
|||||||
Creative API
|
Creative API
|
||||||
------------
|
------------
|
||||||
|
|
||||||
A global string called `creative.formspec_add` was added which allows mods to add additional formspec elements onto the default creative inventory formspec to be drawn after each update.
|
Use `creative.register_tab(name, title, items)` to add a tab with filtered items.
|
||||||
|
For example,
|
||||||
|
|
||||||
|
creative.register_tab("tools", "Tools", minetest.registered_tools)
|
||||||
|
|
||||||
|
is used to show all tools. Name is used in the sfinv page name, title is the
|
||||||
|
human readable title.
|
||||||
|
|
||||||
|
The contents of `creative.formspec_add` is appended to every creative inventory
|
||||||
|
page. Mods can use it to add additional formspec elements onto the default
|
||||||
|
creative inventory formspec to be drawn after each update.
|
||||||
|
|
||||||
Doors API
|
Doors API
|
||||||
---------
|
---------
|
||||||
@ -391,6 +401,100 @@ set a players home position and teleport a player to home position.
|
|||||||
* return value: false if player cannot be sent home, otherwise true
|
* return value: false if player cannot be sent home, otherwise true
|
||||||
|
|
||||||
|
|
||||||
|
Sfinv API
|
||||||
|
---------
|
||||||
|
|
||||||
|
### sfinv Methods
|
||||||
|
|
||||||
|
* sfinv.set_player_inventory_formspec(player, context) - builds page formspec
|
||||||
|
and calls set_inventory_formspec().
|
||||||
|
If context is nil, it is either found or created.
|
||||||
|
* sfinv.get_formspec(player, context) - builds current page's formspec
|
||||||
|
* sfinv.get_nav_fs(player, context, nav, current_idx) - see above
|
||||||
|
* sfinv.get_homepage_name(player) - get the page name of the first page to show to a player
|
||||||
|
* sfinv.make_formspec(player, context, content, show_inv, size) - adds a theme to a formspec
|
||||||
|
* show_inv, defaults to false. Whether to show the player's main inventory
|
||||||
|
* size, defaults to `size[8,8.6]` if not specified
|
||||||
|
* sfinv.register_page(name, def) - register a page, see section below
|
||||||
|
* sfinv.override_page(name, def) - overrides fields of an page registered with register_page.
|
||||||
|
* Note: Page must already be defined, (opt)depend on the mod defining it.
|
||||||
|
|
||||||
|
### sfinv Members
|
||||||
|
|
||||||
|
* pages - table of pages[pagename] = def
|
||||||
|
* pages_unordered - array table of pages in order of addition (used to build navigation tabs).
|
||||||
|
* contexts - contexts[playername] = player_context
|
||||||
|
* enabled - set to false to disable. Good for inventory rehaul mods like unified inventory
|
||||||
|
|
||||||
|
### Context
|
||||||
|
|
||||||
|
A table with these keys:
|
||||||
|
|
||||||
|
* page - current page name
|
||||||
|
* nav - a list of page names
|
||||||
|
* nav_titles - a list of page titles
|
||||||
|
* nav_idx - current nav index (in nav and nav_titles)
|
||||||
|
* any thing you want to store
|
||||||
|
* sfinv will clear the stored data on log out / log in
|
||||||
|
|
||||||
|
### sfinv.register_page
|
||||||
|
|
||||||
|
sfinv.register_page(name, def)
|
||||||
|
|
||||||
|
def is a table containing:
|
||||||
|
|
||||||
|
* `title` - human readable page name (required)
|
||||||
|
* `get(self, player, context)` - returns a formspec string. See formspec variables. (required)
|
||||||
|
* `is_in_nav(self, player, context)` - return true to show in the navigation (the tab header, by default)
|
||||||
|
* `on_player_receive_fields(self, player, context, fields)` - on formspec submit.
|
||||||
|
* `on_enter(self, player, context)` - called when the player changes pages, usually using the tabs.
|
||||||
|
* `on_leave(self, player, context)` - when leaving this page to go to another, called before other's on_enter
|
||||||
|
|
||||||
|
### get formspec
|
||||||
|
|
||||||
|
Use sfinv.make_formspec to apply a layout:
|
||||||
|
|
||||||
|
return sfinv.make_formspec(player, context, [[
|
||||||
|
list[current_player;craft;1.75,0.5;3,3;]
|
||||||
|
list[current_player;craftpreview;5.75,1.5;1,1;]
|
||||||
|
image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]
|
||||||
|
listring[current_player;main]
|
||||||
|
listring[current_player;craft]
|
||||||
|
image[0,4.25;1,1;gui_hb_bg.png]
|
||||||
|
image[1,4.25;1,1;gui_hb_bg.png]
|
||||||
|
image[2,4.25;1,1;gui_hb_bg.png]
|
||||||
|
image[3,4.25;1,1;gui_hb_bg.png]
|
||||||
|
image[4,4.25;1,1;gui_hb_bg.png]
|
||||||
|
image[5,4.25;1,1;gui_hb_bg.png]
|
||||||
|
image[6,4.25;1,1;gui_hb_bg.png]
|
||||||
|
image[7,4.25;1,1;gui_hb_bg.png]
|
||||||
|
]], true)
|
||||||
|
|
||||||
|
See above (methods section) for more options.
|
||||||
|
|
||||||
|
### Customising themes
|
||||||
|
|
||||||
|
Simply override this function to change the navigation:
|
||||||
|
|
||||||
|
function sfinv.get_nav_fs(player, context, nav, current_idx)
|
||||||
|
return "navformspec"
|
||||||
|
end
|
||||||
|
|
||||||
|
And override this function to change the layout:
|
||||||
|
|
||||||
|
function sfinv.make_formspec(player, context, content, show_inv, size)
|
||||||
|
local tmp = {
|
||||||
|
size or "size[8,8.6]",
|
||||||
|
theme_main,
|
||||||
|
sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx),
|
||||||
|
content
|
||||||
|
}
|
||||||
|
if show_inv then
|
||||||
|
tmp[4] = theme_inv
|
||||||
|
end
|
||||||
|
return table.concat(tmp, "")
|
||||||
|
end
|
||||||
|
|
||||||
Stairs API
|
Stairs API
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -650,3 +754,83 @@ Trees
|
|||||||
|
|
||||||
* `default.grow_new_snowy_pine_tree(pos)`
|
* `default.grow_new_snowy_pine_tree(pos)`
|
||||||
* Grows a new design snowy pine tree at pos
|
* Grows a new design snowy pine tree at pos
|
||||||
|
|
||||||
|
Carts
|
||||||
|
-----
|
||||||
|
|
||||||
|
carts.register_rail(
|
||||||
|
"mycarts:myrail", -- Rail name
|
||||||
|
nodedef, -- standard nodedef
|
||||||
|
railparams -- rail parameter struct (optional)
|
||||||
|
)
|
||||||
|
|
||||||
|
railparams = {
|
||||||
|
on_step(obj, dtime), -- Event handler called when
|
||||||
|
-- cart is on rail
|
||||||
|
acceleration, -- integer acceleration factor (negative
|
||||||
|
-- values to brake)
|
||||||
|
}
|
||||||
|
|
||||||
|
The event handler is called after all default calculations
|
||||||
|
are made, so the custom on_step handler can override things
|
||||||
|
like speed, acceleration, player attachment. The handler will
|
||||||
|
likely be called many times per second, so the function needs
|
||||||
|
to make sure that the event is handled properly.
|
||||||
|
|
||||||
|
Key API
|
||||||
|
-------
|
||||||
|
|
||||||
|
The key API allows mods to add key functionality to nodes that have
|
||||||
|
ownership or specific permissions. Using the API will make it so
|
||||||
|
that a node owner can use skeleton keys on their nodes to create keys
|
||||||
|
for that node in that location, and give that key to other players,
|
||||||
|
allowing them some sort of access that they otherwise would not have
|
||||||
|
due to node protection.
|
||||||
|
|
||||||
|
To make your new nodes work with the key API, you need to register
|
||||||
|
two callback functions in each nodedef:
|
||||||
|
|
||||||
|
|
||||||
|
`on_key_use(pos, player)`
|
||||||
|
* Is called when a player right-clicks (uses) a normal key on your
|
||||||
|
* node.
|
||||||
|
* `pos` - position of the node
|
||||||
|
* `player` - PlayerRef
|
||||||
|
* return value: none, ignored
|
||||||
|
|
||||||
|
The `on_key_use` callback should validate that the player is wielding
|
||||||
|
a key item with the right key meta secret. If needed the code should
|
||||||
|
deny access to the node functionality.
|
||||||
|
|
||||||
|
If formspecs are used, the formspec callbacks should duplicate these
|
||||||
|
checks in the metadata callback functions.
|
||||||
|
|
||||||
|
|
||||||
|
`on_skeleton_key_use(pos, player, newsecret)`
|
||||||
|
|
||||||
|
* Is called when a player right-clicks (uses) a skeleton key on your
|
||||||
|
* node.
|
||||||
|
* `pos` - position of the node
|
||||||
|
* `player` - PlayerRef
|
||||||
|
* `newsecret` - a secret value(string)
|
||||||
|
* return values:
|
||||||
|
* `secret` - `nil` or the secret value that unlocks the door
|
||||||
|
* `name` - a string description of the node ("a locked chest")
|
||||||
|
* `owner` - name of the node owner
|
||||||
|
|
||||||
|
The `on_skeleton_key_use` function should validate that the player has
|
||||||
|
the right permissions to make a new key for the item. The newsecret
|
||||||
|
value is useful if the node has no secret value. The function should
|
||||||
|
store this secret value somewhere so that in the future it may compare
|
||||||
|
key secrets and match them to allow access. If a node already has a
|
||||||
|
secret value, the function should return that secret value instead
|
||||||
|
of the newsecret value. The secret value stored for the node should
|
||||||
|
not be overwritten, as this would invalidate existing keys.
|
||||||
|
|
||||||
|
Aside from the secret value, the function should retun a descriptive
|
||||||
|
name for the node and the owner name. The return values are all
|
||||||
|
encoded in the key that will be given to the player in replacement
|
||||||
|
for the wielded skeleton key.
|
||||||
|
|
||||||
|
if `nil` is returned, it is assumed that the wielder did not have
|
||||||
|
permissions to create a key for this node, and no key is created.
|
||||||
|
BIN
menu/header.png
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 1.9 KiB |
0
menu/icon.png
Executable file → Normal file
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
3
minetest.conf
Executable file → Normal file
@ -1,3 +0,0 @@
|
|||||||
# Enable jungles on new worlds, disable biome blend and mud flow (faster, looks better).
|
|
||||||
mgv6_spflags = jungles, nobiomeblend, nomudflow
|
|
||||||
disable_fire = true
|
|
||||||
|
3
minetest.conf.example
Executable file → Normal file
@ -24,6 +24,9 @@
|
|||||||
# 'permanent flame' nodes will remain with either setting.
|
# 'permanent flame' nodes will remain with either setting.
|
||||||
#enable_fire = true
|
#enable_fire = true
|
||||||
|
|
||||||
|
# Enable flame sound.
|
||||||
|
#flame_sound = true
|
||||||
|
|
||||||
# Whether the stuff in initial_stuff should be given to new players
|
# Whether the stuff in initial_stuff should be given to new players
|
||||||
#give_initial_stuff = false
|
#give_initial_stuff = false
|
||||||
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99
|
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
----------------------------------------
|
|
||||||
-- Server Misc Mod - pre-default init --
|
|
||||||
----------------------------------------
|
|
||||||
|
|
||||||
local cwd = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
|
|
||||||
-- Inventory refill function override
|
|
||||||
-- see https://github.com/MinetestForFun/server-minetestforfun/issues/462
|
|
||||||
dofile(cwd.."/inventory_rotate_node.lua")
|
|
@ -1,22 +0,0 @@
|
|||||||
--rewrite function minetest.rotate_node(itemstack, placer, pointed_thing) to refill inventory
|
|
||||||
local old_rotate_node = minetest.rotate_node
|
|
||||||
function minetest.rotate_node(itemstack, placer, pointed_thing)
|
|
||||||
local stack_name = itemstack:get_name()
|
|
||||||
local ret = old_rotate_node(itemstack, placer, pointed_thing)
|
|
||||||
if ret:get_count() == 0 and not minetest.setting_getbool("creative_mode") then
|
|
||||||
local index = placer:get_wield_index()
|
|
||||||
local inv = placer:get_inventory()
|
|
||||||
if inv:get_list("main") then
|
|
||||||
for i, stack in ipairs(inv:get_list("main")) do
|
|
||||||
if i ~= index and stack:get_name() == stack_name then
|
|
||||||
ret:add_item(stack)
|
|
||||||
stack:clear()
|
|
||||||
inv:set_stack("main", i, stack)
|
|
||||||
minetest.log("action", "Inventory Tweaks: refilled stack("..stack_name..") of " .. placer:get_player_name())
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return ret
|
|
||||||
end
|
|
44
mods/beds/README.txt
Executable file → Normal file
@ -1,30 +1,26 @@
|
|||||||
Minetest Game mod: beds
|
Minetest Game mod: beds
|
||||||
=======================
|
=======================
|
||||||
by BlockMen (c) 2014-2015
|
See license.txt for license information.
|
||||||
|
|
||||||
Version: 1.1.1
|
Authors of source code
|
||||||
|
----------------------
|
||||||
|
Originally by BlockMen (MIT)
|
||||||
|
Various Minetest developers and contributors (MIT)
|
||||||
|
|
||||||
About
|
Authors of media (textures)
|
||||||
~~~~~
|
---------------------------
|
||||||
This mod adds a bed to Minetest which allows to skip the night. To sleep rightclick the bed, if playing
|
BlockMen (CC BY-SA 3.0)
|
||||||
in singleplayer mode the night gets skipped imideatly. If playing on server you get shown how many other
|
|
||||||
players are in bed too. If all players are sleeping the night gets skipped aswell. Also the night skip can be forced
|
|
||||||
if more than 50% of the players are lying in bed and use this option.
|
|
||||||
|
|
||||||
Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point
|
This mod adds a bed to Minetest which allows to skip the night.
|
||||||
is set to the beds location and you will respawn there after death.
|
To sleep, rightclick the bed. If playing in singleplayer mode the night gets skipped
|
||||||
You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf
|
immediately. If playing multiplayer you get shown how many other players are in bed too,
|
||||||
You can also disable the night skip feature by setting "enable_bed_night_skip = false" in minetest.conf or by using
|
if all players are sleeping the night gets skipped. The night skip can be forced if more
|
||||||
the /set command ingame.
|
than 50% of the players are lying in bed and use this option.
|
||||||
|
|
||||||
|
Another feature is a controlled respawning. If you have slept in bed (not just lying in
|
||||||
License of source code, textures: WTFPL
|
it) your respawn point is set to the beds location and you will respawn there after
|
||||||
---------------------------------------
|
death.
|
||||||
(c) Copyright BlockMen (2014-2015)
|
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
|
||||||
This program is free software. It comes without any warranty, to
|
minetest.conf or by using the /set command in-game.
|
||||||
the extent permitted by applicable law. You can redistribute it
|
|
||||||
and/or modify it under the terms of the Do What The Fuck You Want
|
|
||||||
To Public License, Version 2, as published by Sam Hocevar. See
|
|
||||||
http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
||||||
|
119
mods/beds/api.lua
Executable file → Normal file
@ -1,3 +1,27 @@
|
|||||||
|
|
||||||
|
local reverse = true
|
||||||
|
|
||||||
|
local function destruct_bed(pos, n)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
local other
|
||||||
|
|
||||||
|
if n == 2 then
|
||||||
|
local dir = minetest.facedir_to_dir(node.param2)
|
||||||
|
other = vector.subtract(pos, dir)
|
||||||
|
elseif n == 1 then
|
||||||
|
local dir = minetest.facedir_to_dir(node.param2)
|
||||||
|
other = vector.add(pos, dir)
|
||||||
|
end
|
||||||
|
|
||||||
|
if reverse then
|
||||||
|
reverse = not reverse
|
||||||
|
minetest.remove_node(other)
|
||||||
|
minetest.check_for_falling(other)
|
||||||
|
else
|
||||||
|
reverse = not reverse
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function beds.register_bed(name, def)
|
function beds.register_bed(name, def)
|
||||||
minetest.register_node(name .. "_bottom", {
|
minetest.register_node(name .. "_bottom", {
|
||||||
description = def.description,
|
description = def.description,
|
||||||
@ -9,7 +33,7 @@ function beds.register_bed(name, def)
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -19,42 +43,59 @@ function beds.register_bed(name, def)
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = def.selectionbox,
|
fixed = def.selectionbox,
|
||||||
},
|
},
|
||||||
after_place_node = function(pos, placer, itemstack)
|
|
||||||
local n = minetest.get_node_or_nil(pos)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if not n or not n.param2 then
|
local under = pointed_thing.under
|
||||||
minetest.remove_node(pos)
|
local pos
|
||||||
return true
|
if minetest.registered_items[minetest.get_node(under).name].buildable_to then
|
||||||
|
pos = under
|
||||||
|
else
|
||||||
|
pos = pointed_thing.above
|
||||||
end
|
end
|
||||||
local dir = minetest.facedir_to_dir(n.param2)
|
|
||||||
local p = vector.add(pos, dir)
|
if minetest.is_protected(pos, placer:get_player_name()) and
|
||||||
local n2 = minetest.get_node_or_nil(p)
|
not minetest.check_player_privs(placer, "protection_bypass") then
|
||||||
local def = n2 and minetest.registered_items[n2.name]
|
minetest.record_protection_violation(pos, placer:get_player_name())
|
||||||
if not def or not def.buildable_to then
|
return itemstack
|
||||||
minetest.remove_node(pos)
|
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
minetest.set_node(p, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2})
|
|
||||||
return false
|
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
|
||||||
|
|
||||||
|
local dir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
|
local botpos = vector.add(pos, minetest.facedir_to_dir(dir))
|
||||||
|
|
||||||
|
if minetest.is_protected(botpos, placer:get_player_name()) and
|
||||||
|
not minetest.check_player_privs(placer, "protection_bypass") then
|
||||||
|
minetest.record_protection_violation(botpos, placer:get_player_name())
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local botdef = minetest.registered_nodes[minetest.get_node(botpos).name]
|
||||||
|
if not botdef or not botdef.buildable_to then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.set_node(pos, {name = name .. "_bottom", param2 = dir})
|
||||||
|
minetest.set_node(botpos, {name = name .. "_top", param2 = dir})
|
||||||
|
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_destruct = function(pos)
|
on_destruct = function(pos)
|
||||||
local n = minetest.get_node_or_nil(pos)
|
destruct_bed(pos, 1)
|
||||||
if not n then return end
|
|
||||||
local dir = minetest.facedir_to_dir(n.param2)
|
|
||||||
local p = vector.add(pos, dir)
|
|
||||||
local n2 = minetest.get_node(p)
|
|
||||||
if minetest.get_item_group(n2.name, "bed") == 2 and n.param2 == n2.param2 then
|
|
||||||
minetest.remove_node(p)
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|
||||||
local name = digger:get_player_name()
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
if not name or name == "" then return end
|
|
||||||
beds.spawn[name] = nil
|
|
||||||
beds.save_spawns()
|
|
||||||
end,
|
|
||||||
on_rightclick = function(pos, node, clicker)
|
|
||||||
beds.on_rightclick(pos, clicker)
|
beds.on_rightclick(pos, clicker)
|
||||||
|
return itemstack
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_rotate = function(pos, node, user, mode, new_param2)
|
on_rotate = function(pos, node, user, mode, new_param2)
|
||||||
local dir = minetest.facedir_to_dir(node.param2)
|
local dir = minetest.facedir_to_dir(node.param2)
|
||||||
local p = vector.add(pos, dir)
|
local p = vector.add(pos, dir)
|
||||||
@ -72,8 +113,8 @@ function beds.register_bed(name, def)
|
|||||||
end
|
end
|
||||||
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
|
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
|
||||||
local node3 = minetest.get_node_or_nil(newp)
|
local node3 = minetest.get_node_or_nil(newp)
|
||||||
local def = node3 and minetest.registered_nodes[node3.name]
|
local node_def = node3 and minetest.registered_nodes[node3.name]
|
||||||
if not def or not def.buildable_to then
|
if not node_def or not node_def.buildable_to then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if minetest.is_protected(newp, user:get_player_name()) then
|
if minetest.is_protected(newp, user:get_player_name()) then
|
||||||
@ -81,9 +122,10 @@ function beds.register_bed(name, def)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
node.param2 = new_param2
|
node.param2 = new_param2
|
||||||
minetest.swap_node(pos, node)
|
-- do not remove_node here - it will trigger destroy_bed()
|
||||||
minetest.remove_node(p)
|
minetest.set_node(p, {name = "air"})
|
||||||
minetest.set_node(newp, {name = node.name:gsub("%_bottom", "_top"), param2 = new_param2})
|
minetest.set_node(pos, node)
|
||||||
|
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
@ -95,17 +137,20 @@ function beds.register_bed(name, def)
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
pointable = false,
|
pointable = false,
|
||||||
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
drop = name .. "_bottom",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = def.nodebox.top,
|
fixed = def.nodebox.top,
|
||||||
},
|
},
|
||||||
|
on_destruct = function(pos)
|
||||||
|
destruct_bed(pos, 2)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias(name, name .. "_bottom")
|
minetest.register_alias(name, name .. "_bottom")
|
||||||
|
|
||||||
-- register recipe
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = name,
|
output = name,
|
||||||
recipe = def.recipe
|
recipe = def.recipe
|
||||||
|
144
mods/beds/beds.lua
Executable file → Normal file
@ -1,36 +1,37 @@
|
|||||||
for _, colour in pairs({"red", "white", "black", "blue", "green"}) do-- fancy shaped bed
|
-- Fancy shaped bed
|
||||||
beds.register_bed("beds:fancy_bed_" .. colour, {
|
|
||||||
description = "Fancy Bed (" .. colour .. ")",
|
beds.register_bed("beds:fancy_bed", {
|
||||||
inventory_image = "beds_bed_fancy_" .. colour .. ".png",
|
description = "Fancy Bed",
|
||||||
wield_image = "beds_bed_fancy_" .. colour .. ".png",
|
inventory_image = "beds_bed_fancy.png",
|
||||||
tiles = {
|
wield_image = "beds_bed_fancy.png",
|
||||||
bottom = {
|
tiles = {
|
||||||
"beds_bed_top1_" .. colour .. ".png",
|
bottom = {
|
||||||
|
"beds_bed_top1.png",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_side1_" .. colour .. ".png",
|
"beds_bed_side1.png",
|
||||||
"beds_bed_side1_" .. colour .. ".png^[transformFX",
|
"beds_bed_side1.png^[transformFX",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_foot_" .. colour .. ".png",
|
"beds_bed_foot.png",
|
||||||
},
|
},
|
||||||
top = {
|
top = {
|
||||||
"beds_bed_top2_" .. colour .. ".png",
|
"beds_bed_top2.png",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_side2_" .. colour .. ".png",
|
"beds_bed_side2.png",
|
||||||
"beds_bed_side2_" .. colour .. ".png^[transformFX",
|
"beds_bed_side2.png^[transformFX",
|
||||||
"beds_bed_head.png",
|
"beds_bed_head.png",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodebox = {
|
nodebox = {
|
||||||
bottom = {
|
bottom = {
|
||||||
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
|
{-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.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.5, -0.125, -0.4375},
|
||||||
{-0.5, -0.375, -0.5, -0.4375, -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.375, -0.5, 0.5, -0.125, 0.5},
|
||||||
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
|
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
|
||||||
},
|
},
|
||||||
top = {
|
top = {
|
||||||
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
|
{-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.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, 0.4375, 0.5, 0.125, 0.5},
|
||||||
@ -38,55 +39,66 @@ for _, colour in pairs({"red", "white", "black", "blue", "green"}) do-- fancy sh
|
|||||||
{-0.5, -0.375, -0.5, -0.4375, -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.375, -0.5, 0.5, -0.125, 0.5},
|
||||||
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
|
{-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},
|
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||||
recipe = {
|
recipe = {
|
||||||
{"", "", "group:stick"},
|
{"", "", "group:stick"},
|
||||||
{"wool:" .. colour, "wool:" .. colour, "wool:white"},
|
{"wool:red", "wool:red", "wool:white"},
|
||||||
{"group:wood", "group:wood", "group:wood"},
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- simple shaped bed
|
-- Simple shaped bed
|
||||||
beds.register_bed("beds:bed_" .. colour, {
|
|
||||||
description = "Simple Bed (" .. colour .. ")",
|
beds.register_bed("beds:bed", {
|
||||||
inventory_image = "beds_bed_" .. colour .. ".png",
|
description = "Simple Bed",
|
||||||
wield_image = "beds_bed_" .. colour .. ".png",
|
inventory_image = "beds_bed.png",
|
||||||
tiles = {
|
wield_image = "beds_bed.png",
|
||||||
bottom = {
|
tiles = {
|
||||||
"beds_bed_top_bottom_" .. colour .. ".png^[transformR90",
|
bottom = {
|
||||||
|
"beds_bed_top_bottom.png^[transformR90",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_side_bottom_r_" .. colour .. ".png",
|
"beds_bed_side_bottom_r.png",
|
||||||
"beds_bed_side_bottom_r_" .. colour .. ".png^[transformfx",
|
"beds_bed_side_bottom_r.png^[transformfx",
|
||||||
"beds_transparent.png",
|
"beds_transparent.png",
|
||||||
"beds_bed_side_bottom_" .. colour .. ".png"
|
"beds_bed_side_bottom.png"
|
||||||
},
|
},
|
||||||
top = {
|
top = {
|
||||||
"beds_bed_top_top_" .. colour .. ".png^[transformR90",
|
"beds_bed_top_top.png^[transformR90",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_side_top_r_" .. colour .. ".png",
|
"beds_bed_side_top_r.png",
|
||||||
"beds_bed_side_top_r_" .. colour .. ".png^[transformfx",
|
"beds_bed_side_top_r.png^[transformfx",
|
||||||
"beds_bed_side_top.png",
|
"beds_bed_side_top.png",
|
||||||
"beds_transparent.png",
|
"beds_transparent.png",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodebox = {
|
nodebox = {
|
||||||
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||||
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||||
},
|
},
|
||||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||||
recipe = {
|
recipe = {
|
||||||
{"wool:" .. colour, "wool:" .. colour, "wool:white"},
|
{"wool:red", "wool:red", "wool:white"},
|
||||||
{"group:wood", "group:wood", "group:wood"}
|
{"group:wood", "group:wood", "group:wood"}
|
||||||
},
|
},
|
||||||
|
})
|
||||||
|
|
||||||
})
|
-- Aliases for PilzAdam's beds mod
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_alias("beds:bed", "beds:bed_red")
|
minetest.register_alias("beds:bed_bottom_red", "beds:bed_bottom")
|
||||||
minetest.register_alias("beds:fancy_bed", "beds:fancy_bed_red")
|
minetest.register_alias("beds:bed_top_red", "beds:bed_top")
|
||||||
minetest.register_alias("beds:bed_bottom", "beds:bed_red_bottom")
|
|
||||||
minetest.register_alias("beds:bed_top", "beds:bed_red_top")
|
-- Fuel
|
||||||
minetest.register_alias("beds:fancy_bed_top", "beds:fancy_bed_red_top")
|
|
||||||
minetest.register_alias("beds:fancy_bed_bottom", "beds:fancy_bed_red_bottom")
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "beds:fancy_bed_bottom",
|
||||||
|
burntime = 13,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "beds:bed_bottom",
|
||||||
|
burntime = 12,
|
||||||
|
})
|
||||||
|
1
mods/beds/depends.txt
Executable file → Normal file
@ -1,3 +1,2 @@
|
|||||||
default
|
default
|
||||||
wool
|
wool
|
||||||
areas
|
|
||||||
|
101
mods/beds/functions.lua
Executable file → Normal file
@ -6,15 +6,14 @@ if enable_respawn == nil then
|
|||||||
enable_respawn = true
|
enable_respawn = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Helper functions
|
||||||
-- helper functions
|
|
||||||
|
|
||||||
local function get_look_yaw(pos)
|
local function get_look_yaw(pos)
|
||||||
local n = minetest.get_node(pos)
|
local n = minetest.get_node(pos)
|
||||||
if n.param2 == 1 then
|
if n.param2 == 1 then
|
||||||
return pi/2, n.param2
|
return pi / 2, n.param2
|
||||||
elseif n.param2 == 3 then
|
elseif n.param2 == 3 then
|
||||||
return -pi/2, n.param2
|
return -pi / 2, n.param2
|
||||||
elseif n.param2 == 0 then
|
elseif n.param2 == 0 then
|
||||||
return pi, n.param2
|
return pi, n.param2
|
||||||
else
|
else
|
||||||
@ -70,8 +69,8 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- physics, eye_offset, etc
|
-- physics, eye_offset, etc
|
||||||
player:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0})
|
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||||
player:set_look_yaw(math.random(1, 180)/100)
|
player:set_look_horizontal(math.random(1, 180) / 100)
|
||||||
default.player_attached[name] = false
|
default.player_attached[name] = false
|
||||||
player:set_physics_override(1, 1, 1)
|
player:set_physics_override(1, 1, 1)
|
||||||
hud_flags.wielditem = true
|
hud_flags.wielditem = true
|
||||||
@ -84,11 +83,11 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||||||
player_in_bed = player_in_bed + 1
|
player_in_bed = player_in_bed + 1
|
||||||
|
|
||||||
-- physics, eye_offset, etc
|
-- physics, eye_offset, etc
|
||||||
player:set_eye_offset({x=0,y=-13,z=0}, {x=0,y=0,z=0})
|
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
|
||||||
local yaw, param2 = get_look_yaw(bed_pos)
|
local yaw, param2 = get_look_yaw(bed_pos)
|
||||||
player:set_look_yaw(yaw)
|
player:set_look_horizontal(yaw)
|
||||||
local dir = minetest.facedir_to_dir(param2)
|
local dir = minetest.facedir_to_dir(param2)
|
||||||
local p = {x=bed_pos.x+dir.x/2,y=bed_pos.y,z=bed_pos.z+dir.z/2}
|
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
|
||||||
player:set_physics_override(0, 0, 0)
|
player:set_physics_override(0, 0, 0)
|
||||||
player:setpos(p)
|
player:setpos(p)
|
||||||
default.player_attached[name] = true
|
default.player_attached[name] = true
|
||||||
@ -101,18 +100,16 @@ end
|
|||||||
|
|
||||||
local function update_formspecs(finished)
|
local function update_formspecs(finished)
|
||||||
local ges = #minetest.get_connected_players()
|
local ges = #minetest.get_connected_players()
|
||||||
local form_n = ""
|
local form_n
|
||||||
local is_majority = (ges/2) < player_in_bed
|
local is_majority = (ges / 2) < player_in_bed
|
||||||
|
|
||||||
if finished then
|
if finished then
|
||||||
form_n = beds.formspec ..
|
form_n = beds.formspec .. "label[2.7,11; Good morning.]"
|
||||||
"label[2.7,11; Good morning.]"
|
|
||||||
else
|
else
|
||||||
form_n = beds.formspec ..
|
form_n = beds.formspec .. "label[2.2,11;" .. tostring(player_in_bed) ..
|
||||||
"label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]"
|
" of " .. tostring(ges) .. " players are in bed]"
|
||||||
if is_majority and is_night_skip_enabled() then
|
if is_majority and is_night_skip_enabled() then
|
||||||
form_n = form_n ..
|
form_n = form_n .. "button_exit[2,8;4,0.75;force;Force night skip]"
|
||||||
"button_exit[2,8;4,0.75;force;Force night skip]"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -122,10 +119,10 @@ local function update_formspecs(finished)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- public functions
|
-- Public functions
|
||||||
|
|
||||||
function beds.kick_players()
|
function beds.kick_players()
|
||||||
for name,_ in pairs(beds.player) do
|
for name, _ in pairs(beds.player) do
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
lay_down(player, nil, nil, false)
|
lay_down(player, nil, nil, false)
|
||||||
end
|
end
|
||||||
@ -133,7 +130,6 @@ end
|
|||||||
|
|
||||||
function beds.skip_night()
|
function beds.skip_night()
|
||||||
minetest.set_timeofday(0.23)
|
minetest.set_timeofday(0.23)
|
||||||
beds.set_spawns()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function beds.on_rightclick(pos, player)
|
function beds.on_rightclick(pos, player)
|
||||||
@ -152,6 +148,7 @@ function beds.on_rightclick(pos, player)
|
|||||||
-- move to bed
|
-- move to bed
|
||||||
if not beds.player[name] then
|
if not beds.player[name] then
|
||||||
lay_down(player, ppos, pos)
|
lay_down(player, ppos, pos)
|
||||||
|
beds.set_spawns() -- save respawn positions when entering bed
|
||||||
else
|
else
|
||||||
lay_down(player, nil, nil, false)
|
lay_down(player, nil, nil, false)
|
||||||
end
|
end
|
||||||
@ -175,68 +172,20 @@ function beds.on_rightclick(pos, player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- callbacks
|
-- Callbacks
|
||||||
--[[ --MFF (Crabman) It's useless to read each join player, read only once at load. function moved/called in spawn.lua
|
-- Only register respawn callback if respawn enabled
|
||||||
minetest.register_on_joinplayer(function(player)
|
if enable_respawn then
|
||||||
beds.read_spawns()
|
-- respawn player at bed if enabled and valid position is found
|
||||||
end)
|
minetest.register_on_respawnplayer(function(player)
|
||||||
--]]
|
local name = player:get_player_name()
|
||||||
|
local pos = beds.spawn[name]
|
||||||
|
|
||||||
local dead_players = {}
|
|
||||||
local have_areas_mod = false
|
|
||||||
if (minetest.get_modpath("areas") ~= nil) and areas.getSpawn then
|
|
||||||
have_areas_mod = true
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function teleport_player(player, clear)
|
|
||||||
local name = player:get_player_name()
|
|
||||||
if not name or name == "" then return false end
|
|
||||||
if have_areas_mod and dead_players[name] ~= nil then
|
|
||||||
local pos = areas:getSpawn(dead_players[name])
|
|
||||||
if clear then
|
|
||||||
dead_players[name] = nil
|
|
||||||
end
|
|
||||||
if pos then
|
if pos then
|
||||||
player:setpos(pos)
|
player:setpos(pos)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
if not enable_respawn then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local name = player:get_player_name()
|
|
||||||
local pos = beds.spawn[name] or nil
|
|
||||||
if pos then
|
|
||||||
player:setpos(pos)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
--if not areas or bed spawnpoint, tp to the spawn
|
|
||||||
local spawn = minetest.string_to_pos(minetest.setting_get("static_spawnpoint") or "0,0,0")
|
|
||||||
player:setpos(spawn)
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_dieplayer(function(player)
|
|
||||||
local name = player:get_player_name()
|
|
||||||
if not name or name == "" then return end
|
|
||||||
if have_areas_mod then
|
|
||||||
local pos = player:getpos()
|
|
||||||
if pos then
|
|
||||||
dead_players[name] = pos
|
|
||||||
end
|
|
||||||
end
|
|
||||||
minetest.after(0.20, teleport_player, player) -- tp after all others on_dieplayer callback otherwise their pos is wrong
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- respawn player at bed if enabled and valid position is found
|
|
||||||
minetest.register_on_respawnplayer(function(player)
|
|
||||||
return teleport_player(player, true)
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
lay_down(player, nil, nil, false, true)
|
lay_down(player, nil, nil, false, true)
|
||||||
|
17
mods/beds/init.lua
Executable file → Normal file
@ -3,14 +3,15 @@ beds.player = {}
|
|||||||
beds.pos = {}
|
beds.pos = {}
|
||||||
beds.spawn = {}
|
beds.spawn = {}
|
||||||
|
|
||||||
beds.formspec = "size[8,15;true]"..
|
beds.formspec = "size[8,15;true]" ..
|
||||||
"bgcolor[#080808BB; true]"..
|
"bgcolor[#080808BB; true]" ..
|
||||||
"button_exit[2,12;4,0.75;leave;Leave Bed]"
|
"button_exit[2,12;4,0.75;leave;Leave Bed]"
|
||||||
|
|
||||||
local modpath = minetest.get_modpath("beds")
|
local modpath = minetest.get_modpath("beds")
|
||||||
|
|
||||||
-- load files
|
-- Load files
|
||||||
dofile(modpath.."/functions.lua")
|
|
||||||
dofile(modpath.."/api.lua")
|
dofile(modpath .. "/functions.lua")
|
||||||
dofile(modpath.."/beds.lua")
|
dofile(modpath .. "/api.lua")
|
||||||
dofile(modpath.."/spawns.lua")
|
dofile(modpath .. "/beds.lua")
|
||||||
|
dofile(modpath .. "/spawns.lua")
|
||||||
|
60
mods/beds/license.txt
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
License of source code
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (C) 2014-2016 BlockMen
|
||||||
|
Copyright (C) 2014-2016 Various Minetest developers and contributors
|
||||||
|
|
||||||
|
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) 2014-2016 BlockMen
|
||||||
|
|
||||||
|
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/
|
@ -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
|
|
21
mods/beds/spawns.lua
Executable file → Normal file
@ -18,8 +18,8 @@ function beds.read_spawns()
|
|||||||
repeat
|
repeat
|
||||||
local x = input:read("*n")
|
local x = input:read("*n")
|
||||||
if x == nil then
|
if x == nil then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
local y = input:read("*n")
|
local y = input:read("*n")
|
||||||
local z = input:read("*n")
|
local z = input:read("*n")
|
||||||
local name = input:read("*l")
|
local name = input:read("*l")
|
||||||
@ -32,19 +32,21 @@ function beds.read_spawns()
|
|||||||
beds.save_spawns()
|
beds.save_spawns()
|
||||||
os.rename(file, file .. ".backup")
|
os.rename(file, file .. ".backup")
|
||||||
file = org_file
|
file = org_file
|
||||||
else
|
|
||||||
spawns = {}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
beds.read_spawns()
|
||||||
|
|
||||||
function beds.save_spawns()
|
function beds.save_spawns()
|
||||||
if not beds.spawn then
|
if not beds.spawn then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local data = {}
|
||||||
local output = io.open(org_file, "w")
|
local output = io.open(org_file, "w")
|
||||||
for i, v in pairs(beds.spawn) do
|
for k, v in pairs(beds.spawn) do
|
||||||
output:write(v.x.." "..v.y.." "..v.z.." "..i.."\n")
|
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, k))
|
||||||
end
|
end
|
||||||
|
output:write(table.concat(data))
|
||||||
io.close(output)
|
io.close(output)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -52,9 +54,10 @@ function beds.set_spawns()
|
|||||||
for name,_ in pairs(beds.player) do
|
for name,_ in pairs(beds.player) do
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
local p = player:getpos()
|
local p = player:getpos()
|
||||||
beds.spawn[name] = p
|
-- but don't change spawn location if borrowing a bed
|
||||||
|
if not minetest.is_protected(p, name) then
|
||||||
|
beds.spawn[name] = p
|
||||||
|
end
|
||||||
end
|
end
|
||||||
beds.save_spawns()
|
beds.save_spawns()
|
||||||
end
|
end
|
||||||
|
|
||||||
beds.read_spawns()
|
|
||||||
|
0
mods/beds/textures/beds_bed_red.png → mods/beds/textures/beds_bed.png
Executable file → Normal file
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 545 B |
0
mods/beds/textures/beds_bed_fancy_red.png → mods/beds/textures/beds_bed_fancy.png
Executable file → Normal file
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 432 B |
Before Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 521 B |
Before Width: | Height: | Size: 540 B |
0
mods/beds/textures/beds_bed_foot_red.png → mods/beds/textures/beds_bed_foot.png
Executable file → Normal file
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 390 B |
Before Width: | Height: | Size: 366 B |
Before Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 400 B |
Before Width: | Height: | Size: 408 B |
Before Width: | Height: | Size: 523 B |
BIN
mods/beds/textures/beds_bed_head.png
Executable file → Normal file
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 387 B |
BIN
mods/beds/textures/beds_bed_side1.png
Normal file
After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 295 B |
BIN
mods/beds/textures/beds_bed_side2.png
Normal file
After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 317 B |
Before Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 326 B |
BIN
mods/beds/textures/beds_bed_side_bottom.png
Normal file
After Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 427 B |
0
mods/beds/textures/beds_bed_side_bottom_r_red.png → mods/beds/textures/beds_bed_side_bottom_r.png
Executable file → Normal file
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 523 B |
Before Width: | Height: | Size: 439 B |
BIN
mods/beds/textures/beds_bed_side_top.png
Executable file → Normal file
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 611 B |
BIN
mods/beds/textures/beds_bed_side_top_r.png
Normal file
After Width: | Height: | Size: 596 B |
Before Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 560 B |
Before Width: | Height: | Size: 460 B |
BIN
mods/beds/textures/beds_bed_top1.png
Normal file
After Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 448 B |
Before Width: | Height: | Size: 548 B |
Before Width: | Height: | Size: 478 B |
0
mods/beds/textures/beds_bed_top2_red.png → mods/beds/textures/beds_bed_top2.png
Executable file → Normal file
Before Width: | Height: | Size: 616 B After Width: | Height: | Size: 616 B |
Before Width: | Height: | Size: 465 B |
Before Width: | Height: | Size: 609 B |
Before Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 573 B |
0
mods/beds/textures/beds_bed_top_bottom_red.png → mods/beds/textures/beds_bed_top_bottom.png
Executable file → Normal file
Before Width: | Height: | Size: 495 B After Width: | Height: | Size: 495 B |
Before Width: | Height: | Size: 126 B |
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 339 B |
0
mods/beds/textures/beds_bed_top_top_red.png → mods/beds/textures/beds_bed_top_top.png
Executable file → Normal file
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |
Before Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 568 B |
Before Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 525 B |
BIN
mods/beds/textures/beds_transparent.png
Executable file → Normal file
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 705 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 969 B |
Before Width: | Height: | Size: 552 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |