Compare commits
1129 commits
stuck_arro
...
forkhausen
Author | SHA1 | Date | |
---|---|---|---|
6a56a2924f | |||
|
95b3b4a172 | ||
|
bfd2f0ebc7 | ||
|
d1d7c026e1 | ||
|
7cfef25dfe | ||
c6b85fdf93 | |||
|
547080bd98 | ||
|
a20637f68c | ||
|
1a0e979b0c | ||
|
b512e16a7b | ||
|
26b5b45595 | ||
0f7f969d86 | |||
14dbf91ada | |||
f1f1e29d71 | |||
|
b8bd154378 | ||
|
c156398fb5 | ||
|
728db50baf | ||
|
621946546b | ||
|
ffcad31871 | ||
|
bfb1e3e447 | ||
|
d13498e6f9 | ||
|
0c96e512d7 | ||
6f30b57cbe | |||
|
555d21263d | ||
|
5108f398bb | ||
|
2ec66fc61b | ||
|
6df30dc0dc | ||
|
c3578e283c | ||
|
58013872c2 | ||
|
aeb7a6cb8b | ||
|
131051b1df | ||
ad70a71f8c | |||
|
fb55d33bfe | ||
|
94c4256451 | ||
103122866e | |||
f1df128d0c | |||
96e858644b | |||
2407529a00 | |||
ab1dbd33d5 | |||
f13366c341 | |||
6ba0b77ec8 | |||
112896743e | |||
7b4bd642e6 | |||
3566ef37fa | |||
|
e058ee8487 | ||
|
c9a37d0dbc | ||
d32c427c39 | |||
|
8c20dfa5d2 | ||
|
2b4a4f8c60 | ||
|
b59f0d6c6e | ||
|
4957bd1118 | ||
e95d8ddf3a | |||
f388983b73 | |||
a4ee8dfdd5 | |||
effa27bec1 | |||
53cb7d4edb | |||
beace10136 | |||
e7503abf55 | |||
476b36de6d | |||
84202237f8 | |||
|
02b2ff7460 | ||
|
bc740efafe | ||
|
00acbf8a2a | ||
|
56d484f69b | ||
|
6a576c50a0 | ||
|
d4bc7a2f88 | ||
313fd79612 | |||
935129d997 | |||
baaf3e7a13 | |||
d0ac1d7377 | |||
f28dc7312b | |||
baa7a8c23c | |||
|
7fa8828bd5 | ||
|
026d406d4b | ||
|
679e2b1b70 | ||
|
772ea01aff | ||
|
2b5ddbd62d | ||
|
9ee0ef5a8d | ||
|
58458b2bca | ||
|
3087621b11 | ||
|
8dd1cf6719 | ||
|
ef20ac54c3 | ||
48e320d907 | |||
1cbebae5b8 | |||
a866070bb6 | |||
4343a5d084 | |||
008969949e | |||
|
eea07f0ce7 | ||
|
c81a18ac1a | ||
|
0929ce4f20 | ||
|
a10dff8421 | ||
|
a62a75c799 | ||
|
64c767ad8c | ||
|
b4ea2afe77 | ||
|
cdea2eeabf | ||
|
92ab90fd1b | ||
|
6315490b14 | ||
|
8d67824e42 | ||
|
fd05259202 | ||
|
ca7c8c23c7 | ||
|
77c95fe8c3 | ||
|
e268370452 | ||
|
6a77a54034 | ||
|
1d5c11f683 | ||
|
063595ac3c | ||
|
3803dba233 | ||
|
24ab3e8f84 | ||
|
7c56cf1a64 | ||
|
1db34821a0 | ||
|
081366855d | ||
|
ab56d592ae | ||
|
a2785041dd | ||
|
47cda09073 | ||
|
8e06e4e8b2 | ||
|
a33bd015f5 | ||
|
0c271a2af9 | ||
|
32ae6b3140 | ||
|
868fa04818 | ||
|
88927c8a6b | ||
|
5fe8717fca | ||
|
3bd1cded03 | ||
|
d9cff3ef82 | ||
|
20eba63b94 | ||
|
8664a5c484 | ||
|
71c9d20fff | ||
|
a1ea41e760 | ||
|
21d5b93baa | ||
|
31b367eb83 | ||
|
f27615d77e | ||
|
17f611567c | ||
|
c9cc3651df | ||
|
c5e4ec5e27 | ||
|
b2c75acd68 | ||
|
ace1c6dfec | ||
|
28b1d5e8e9 | ||
|
c9b464f329 | ||
|
b2c8d7cff0 | ||
|
d8cb7a7164 | ||
|
e81b5ef58a | ||
|
600eadedea | ||
|
02d7f20cc9 | ||
|
6ce3278dd4 | ||
|
97ab2e7b38 | ||
|
da1c3f635c | ||
|
e9f259881f | ||
|
ed63374480 | ||
|
73d93ae969 | ||
|
a98dafb171 | ||
|
baa02e19e1 | ||
|
2237cf66cb | ||
|
882937a1ab | ||
|
b56ead7a23 | ||
|
f5268ea598 | ||
|
24832c534f | ||
|
d5111dfb66 | ||
|
7243a25fe6 | ||
|
3cf32c38c5 | ||
|
59b6385d10 | ||
|
fb9d0f7a7c | ||
|
3772dd51cc | ||
|
2569eae5d8 | ||
|
73dc0a64b5 | ||
|
5a03ce6dac | ||
|
f0ba364120 | ||
|
28b2085492 | ||
|
6b529e1204 | ||
|
7ee2340f5c | ||
|
312b5aeb73 | ||
|
feba60cad8 | ||
|
03a5519d01 | ||
|
098bc3c7c7 | ||
|
9ef313d0a1 | ||
|
8adf6298a7 | ||
|
070e928bf0 | ||
|
5053dde5f0 | ||
|
0fbb252af6 | ||
|
242b880c4f | ||
|
9422989ac6 | ||
|
a845f0313d | ||
|
6761ebdae5 | ||
|
60effa71b4 | ||
|
1e5f3ee610 | ||
|
c6d6a2ce26 | ||
|
81fd3fad40 | ||
|
f85a6b5042 | ||
|
96b30b918c | ||
|
1ea2b09ecb | ||
|
3bcb868f8b | ||
|
03ad3cca29 | ||
|
0e867e5247 | ||
|
4deb6eec20 | ||
|
2554c6d597 | ||
|
cbda2ef326 | ||
|
714634f4a0 | ||
|
d3d227d46b | ||
|
4cb5b26fa9 | ||
|
efb97d59a5 | ||
|
98e87fd5db | ||
|
a375548992 | ||
|
f93d3a897e | ||
|
fbd5374085 | ||
|
4466383122 | ||
|
401382106f | ||
|
4ece91fde4 | ||
|
4926f8d443 | ||
|
6096b8dd9a | ||
|
589b750d0a | ||
|
e4fb7ae533 | ||
|
ba74546d48 | ||
|
71cee9920a | ||
|
604e1c4d19 | ||
|
3118673116 | ||
|
565806558c | ||
|
6426e55746 | ||
|
d88fa0c438 | ||
|
329452d5ce | ||
|
5729d70814 | ||
|
bfc5670f09 | ||
|
012dd0b86a | ||
|
7ba3616c77 | ||
|
460e7c0c67 | ||
|
364a4152ac | ||
|
89afec17b1 | ||
|
a52976a918 | ||
|
ab4e46f97b | ||
|
fb251db925 | ||
|
edab0be8f5 | ||
|
ef077fed72 | ||
|
f700463c4f | ||
|
ae7615c557 | ||
|
97d293f8b4 | ||
|
33acd2327f | ||
|
bef99ac211 | ||
|
e3b68c4364 | ||
|
2e6610da42 | ||
|
988ca6ffe7 | ||
|
dcc14d1f3f | ||
|
023f70ee1c | ||
|
81ca7469d7 | ||
|
004013c3a4 | ||
|
113a49da41 | ||
|
9499076ac8 | ||
|
641921f4c7 | ||
|
bcffcdf003 | ||
|
e6133ac670 | ||
|
1ab41a494b | ||
|
c6a8cbdb59 | ||
|
f4a06d6217 | ||
|
bed0849bb0 | ||
|
2ef5f0232d | ||
|
377bf31c5d | ||
|
3836f1b7e9 | ||
|
15481cb24d | ||
|
04c8a08cc4 | ||
|
9f344b4307 | ||
|
1d2da1f01a | ||
|
9dc9c12f29 | ||
|
74b79d130b | ||
|
d923f71c92 | ||
|
61e148ac2e | ||
|
834c8cbc3a | ||
|
fcf46b3423 | ||
|
c234b273ad | ||
|
be04de084b | ||
|
8be35bae53 | ||
|
bddb8f1136 | ||
|
d38e0a0b00 | ||
|
f7fb83891a | ||
|
9326a76973 | ||
|
fff1949804 | ||
|
3788b66b47 | ||
|
bc7b86b61a | ||
|
112574792d | ||
|
73e8ee8a68 | ||
|
3dcd986863 | ||
|
87ac0c952c | ||
|
e569885fab | ||
|
9b8d6c4cec | ||
|
82f851e20d | ||
|
0ae2c5b25f | ||
|
1210d8c9a7 | ||
|
7a870d0ead | ||
|
f2b7392a30 | ||
|
05152589fa | ||
|
01eb39b62f | ||
|
1fc2ba6879 | ||
|
90298821a3 | ||
|
8c0bea7dad | ||
|
b77307b7ac | ||
|
f691b31423 | ||
|
5d8c068749 | ||
|
625730e040 | ||
|
d29c4bb795 | ||
|
a03cc0604e | ||
|
bbc5f2a0d9 | ||
|
9fdbb35f24 | ||
|
87449b5719 | ||
|
ab038ddd60 | ||
|
305145ca1c | ||
|
b7406ed3d5 | ||
|
f74a502979 | ||
|
8b6dc30943 | ||
|
e0e73b8ee8 | ||
|
85c058125c | ||
|
286009cbd7 | ||
|
3658cfc0f1 | ||
|
ee5e50f139 | ||
|
d1f3856de8 | ||
|
2e9efe51e8 | ||
|
40e681a566 | ||
|
5c953b1dc0 | ||
|
b81396c03f | ||
|
40a55729ca | ||
|
09c1f44a65 | ||
|
5c70296e8f | ||
|
a714751f8b | ||
|
4dcbe75e84 | ||
|
cf1df56b79 | ||
|
8b3ecb9321 | ||
|
1e3cfb6040 | ||
|
e8614d7b27 | ||
|
b92aec71af | ||
|
c7aaf49e22 | ||
|
39670e1f79 | ||
|
59964279b7 | ||
|
82b9c7d474 | ||
|
085e6f306a | ||
|
bab4529e4d | ||
|
a5b4a261dc | ||
|
4cc51a55c2 | ||
|
29b20a51bc | ||
|
5b956c1c47 | ||
|
862e3141d9 | ||
|
92ef7c3b9a | ||
|
44c95084ab | ||
|
101c9b7322 | ||
|
f4888a42a9 | ||
|
7f70acc8a4 | ||
|
41d7e513e7 | ||
|
741b32e8d0 | ||
|
1971b3c5a8 | ||
|
aaedf6517a | ||
|
b9cc66d3db | ||
|
5f2cc506f0 | ||
|
affb984c56 | ||
|
b3829eaf9b | ||
|
c90f693c06 | ||
|
c149f5ca3c | ||
|
40453d597b | ||
|
3e3ed630e5 | ||
|
d4344bbaf8 | ||
|
01288eff62 | ||
|
9dfe584cd1 | ||
|
62096c723a | ||
|
6002cd0af5 | ||
|
9c55b6c9c9 | ||
|
325801efd7 | ||
|
8e224d0bd9 | ||
|
4a7bb86803 | ||
|
cfa77288c1 | ||
|
d21e959055 | ||
|
b5133c0c4a | ||
|
1a02ccd36f | ||
|
7df94278cf | ||
|
2393c68448 | ||
|
ec50b19fa0 | ||
|
5b4f33c8f1 | ||
|
506e039fc5 | ||
|
febcb96bb0 | ||
|
231493cb1b | ||
|
2e09febaae | ||
|
f91619cae1 | ||
|
753acdf272 | ||
|
57e14b8106 | ||
|
a177d3cbba | ||
|
0d3b8e11c3 | ||
|
2ff5bafd91 | ||
|
046f9ab223 | ||
|
e85c999e4c | ||
|
e09a72ed59 | ||
|
47f7b21190 | ||
|
f04170d66b | ||
|
28505885f2 | ||
|
a1ab325920 | ||
|
b71cf5e9c2 | ||
|
4e08e978f5 | ||
|
31fbe97e4e | ||
|
26ac17f1ad | ||
|
da47d7917c | ||
|
ad13c71bf1 | ||
|
33ef45245c | ||
|
2528463db6 | ||
|
643b1e7933 | ||
|
bbcab7275e | ||
|
d25922b325 | ||
|
f218180eaa | ||
|
d502ac3bec | ||
|
644187e204 | ||
|
5fd746710f | ||
|
eeac1435f9 | ||
|
3de818d2c2 | ||
|
5868790b4f | ||
|
1e354f63c0 | ||
|
1c7e350095 | ||
|
9e31c2b62b | ||
|
e2fb3a562d | ||
|
84ff24f8ed | ||
|
8a2e6d434d | ||
|
7471836c2d | ||
|
7175ffb975 | ||
|
89ba84a456 | ||
|
5f1973aecd | ||
|
05e6362303 | ||
|
f6f259dce0 | ||
|
fd089b2470 | ||
|
55171a12c6 | ||
|
219b2464a1 | ||
|
c9b642a706 | ||
|
7b24ede582 | ||
|
6d5bfacb8c | ||
|
c6903b48f1 | ||
|
0e733f1677 | ||
|
5ed278717f | ||
|
8b9ac5c6a6 | ||
|
d9424ad82e | ||
|
5bd19c03f6 | ||
|
3322366457 | ||
|
5198f5cdec | ||
|
da149d5a58 | ||
|
b3e1df7e9b | ||
|
4a7aaa9024 | ||
|
a9ed14c4af | ||
|
041839fd1a | ||
|
200cbf033a | ||
|
aae360db4c | ||
|
f9e46b914d | ||
|
b71c9204ec | ||
|
14d4bec8a9 | ||
|
40b5c5c2a5 | ||
|
d9d1e5c08c | ||
|
5ba4f1b899 | ||
|
21317aa7c7 | ||
|
dfe68e6820 | ||
|
67f33c9256 | ||
|
1aac4713a4 | ||
|
e64ef6e254 | ||
|
748b5d4a4b | ||
|
76ed6ff826 | ||
|
a8a875a7b4 | ||
|
31ae28e66e | ||
|
25e2bd106f | ||
|
2913acc6e9 | ||
|
30a954b874 | ||
|
e633f15eed | ||
|
df7acfc8ae | ||
|
b6c3cc0ed7 | ||
|
3cba55703a | ||
|
b3bbf38fd7 | ||
|
e88e95d564 | ||
|
44bd5dba6c | ||
|
9416305fa6 | ||
|
8618b42bc7 | ||
|
dae4dc6924 | ||
|
cf47e7de9e | ||
|
719242c840 | ||
|
2fecf0336c | ||
|
955638bccd | ||
|
915ac2da93 | ||
|
18069b069c | ||
|
5dd002b598 | ||
|
06be98a676 | ||
|
055d6ecc96 | ||
|
c7908cc020 | ||
|
276af8a1ea | ||
|
2423acb297 | ||
|
ed336829b4 | ||
|
aced401c6c | ||
|
2627742b36 | ||
|
995024b47b | ||
|
c7d111219d | ||
|
2478d8817e | ||
|
1cbee9de18 | ||
|
f67c302c3d | ||
|
02ed4b52c4 | ||
|
ce7015bb35 | ||
|
248a635749 | ||
|
a765d3dd4f | ||
|
d11b089bac | ||
|
58d9fb874d | ||
|
37af2dbba1 | ||
|
48b73f5f2e | ||
|
c50958a640 | ||
|
3da1c551a1 | ||
|
379dd847ee | ||
|
839d74329c | ||
|
1d5cdfe544 | ||
|
b1f201f538 | ||
|
d4facaf503 | ||
|
c623860af8 | ||
|
36adba2e0b | ||
|
6cd1fb1119 | ||
|
6e9d712c5e | ||
|
23630bbac0 | ||
|
8830edfdf9 | ||
|
80ee8172fe | ||
|
b0c457f2ec | ||
|
1ed1bdfadb | ||
|
6842c42625 | ||
|
ab81dfb4b4 | ||
|
fbba40fe5c | ||
|
a7ceb2462a | ||
|
219ec1ddcb | ||
|
2203d0df53 | ||
|
8533ff0b75 | ||
|
c6e671376d | ||
|
ba97dfd02f | ||
|
719f7b5b77 | ||
|
42a7baf4b4 | ||
|
6188d7b528 | ||
|
7e9a9821c9 | ||
|
5b6cb0a441 | ||
|
d0a6244be9 | ||
|
418368fbc5 | ||
|
967905264d | ||
|
c5db9987c3 | ||
|
435ae85d68 | ||
|
1b7c41fc81 | ||
|
2d34a2982a | ||
|
2f346cfc1d | ||
|
15880db548 | ||
|
5c1717971b | ||
|
2582350504 | ||
|
7604b77dd6 | ||
|
b404e8b5bd | ||
|
25048050a0 | ||
|
3a5df885e9 | ||
|
5caa4b3659 | ||
|
423d5f8ab8 | ||
|
8636b94c74 | ||
|
ea23f05c22 | ||
|
7df5ef097c | ||
|
a54abc7de9 | ||
|
1b24b02e31 | ||
|
833f58ff4e | ||
|
c78b1d1354 | ||
|
c49efcf9ad | ||
|
5647fbf6e0 | ||
|
1719c3e4e1 | ||
|
b80ece51cb | ||
|
65a61398b5 | ||
|
8019315eaa | ||
|
d12356794f | ||
|
262457f240 | ||
|
ae5f5fe3b7 | ||
|
78fc9565c0 | ||
|
579e526615 | ||
|
267cf5c4a6 | ||
|
52e1c9e274 | ||
|
70498cf529 | ||
|
40923f83fd | ||
|
da5b2443f2 | ||
|
aaf8801c06 | ||
|
8dd3c9224f | ||
|
b44f4f456d | ||
|
95d2465901 | ||
|
e2cc0e428d | ||
|
23ccd197ee | ||
|
d191c3ac48 | ||
|
6511394b69 | ||
|
78f4043fb9 | ||
|
2237aae6c3 | ||
|
c3968209f6 | ||
|
058f46043f | ||
|
49f447ba64 | ||
|
b0acd134ca | ||
|
6fbd47cde6 | ||
|
9cef74c03b | ||
|
9d7f4f6544 | ||
|
805fa76282 | ||
|
550fa39d86 | ||
|
522a2b9a73 | ||
|
7aaafdca03 | ||
|
8cfcbea9cb | ||
|
8ee1521f14 | ||
|
cf9e440019 | ||
|
d45d53e455 | ||
|
03db150175 | ||
|
af4aa6c2ec | ||
|
9385458632 | ||
|
c12a4b795e | ||
|
1c27cbe4f6 | ||
|
3f85e1c0da | ||
|
f5cd9e3b98 | ||
|
661e10e992 | ||
|
81ca79e85c | ||
|
77ab44217a | ||
|
86e5eb748f | ||
|
f5c1e19781 | ||
|
e764851775 | ||
|
53eabf3737 | ||
|
a5fb218afe | ||
|
93e34d1d03 | ||
|
62e1186827 | ||
|
a51bcff1b9 | ||
|
702755b99e | ||
|
daeb04485e | ||
|
0c8db3e556 | ||
|
41842c73c6 | ||
|
28c0c9d196 | ||
|
1740ccc2b2 | ||
|
2cde0476c7 | ||
|
e01ed8ab24 | ||
|
7be98bfce0 | ||
|
b72afa7e62 | ||
|
45d09754d0 | ||
|
293dd036f8 | ||
|
9405232fef | ||
|
3c8e2634c0 | ||
|
2f1c201076 | ||
|
63d630a208 | ||
|
7c9126ace5 | ||
|
9ef6176958 | ||
|
04c2da63ad | ||
|
5aeb4aea74 | ||
|
d7fc158073 | ||
|
2b586549cf | ||
|
550efda495 | ||
|
fb389df3a0 | ||
|
f7af5dfa07 | ||
|
008a1b1cac | ||
|
d25e9ec4cc | ||
|
e26f03f37e | ||
|
e77c5a3562 | ||
|
cdb6e3e3f5 | ||
|
82d56de18e | ||
|
e24a698bae | ||
|
9fc834c8db | ||
|
9ff95e7a08 | ||
|
ac7a16eb96 | ||
|
b551b144d4 | ||
|
4ede0a1227 | ||
|
e26a668b74 | ||
|
7935e64637 | ||
|
45a30867c3 | ||
|
2e092dc15f | ||
|
206293e3f9 | ||
|
12581e8441 | ||
|
c62658fd27 | ||
|
f1f6dc4c48 | ||
|
a16886bf17 | ||
|
ae513f7b53 | ||
|
0b9e25fd9a | ||
|
256dc9e1b5 | ||
|
053e10f223 | ||
|
2c599c4a0e | ||
|
cc9b78215a | ||
|
f713394f6d | ||
|
18adaef361 | ||
|
f59f4d4f7c | ||
|
c868b7a767 | ||
|
f48019a877 | ||
|
b4b5cb2879 | ||
|
2a9e30b900 | ||
|
f55dac38e2 | ||
|
a943428b11 | ||
|
aee7c4b4a2 | ||
|
c8f9c3e923 | ||
|
2892c45f52 | ||
|
3cdf570460 | ||
|
022f627fd0 | ||
|
29c12439c4 | ||
|
740e87cd81 | ||
|
ef0b941bce | ||
|
655a240107 | ||
|
05e8cc8a2c | ||
|
7a4aeb6625 | ||
|
895b9e7e3a | ||
|
e2fd769657 | ||
|
5dd650e921 | ||
|
eff91038e8 | ||
|
4f2baf8506 | ||
|
2f88b42210 | ||
|
b9377a0dbf | ||
|
6d6fc3f34c | ||
|
ad8403adbd | ||
|
e6e9d13701 | ||
|
225930a2c7 | ||
|
c6efa8a626 | ||
|
79a3eb23a7 | ||
|
a15c58a2dc | ||
|
10035a64af | ||
|
47ef78bf6a | ||
|
f3b4c56772 | ||
|
7899f6d432 | ||
|
a5b20b1bf0 | ||
|
8b44e6fb7a | ||
|
c98df597fc | ||
|
e37411dc13 | ||
|
6f9e178084 | ||
|
9434baf991 | ||
|
793357cdfe | ||
|
f373f3a4f1 | ||
|
a58b6fd3fb | ||
|
b8d3e7473b | ||
|
086b29f08c | ||
|
636ff60c68 | ||
|
049c632276 | ||
|
20576431e1 | ||
|
db8d7af245 | ||
|
9057743eb8 | ||
|
daed3059bf | ||
|
f40eeb4477 | ||
|
f7d9aea529 | ||
|
fed10e688e | ||
|
2e738a39a4 | ||
|
3cfdb85926 | ||
|
44fcf6eb34 | ||
|
f9b557c2ba | ||
|
47c817d75a | ||
|
a29626881f | ||
|
e4fbbeddb2 | ||
|
1df3d0e42b | ||
|
1cb142ec5f | ||
|
342202c979 | ||
|
0cc038c545 | ||
|
0d6610dcee | ||
|
d691490016 | ||
|
1217d9fa88 | ||
|
e0418553a6 | ||
|
3edf880301 | ||
|
a84f7935fa | ||
|
26c9150591 | ||
|
720bc6a56f | ||
|
dcba7e2325 | ||
|
66c6b373a5 | ||
|
7ca999626d | ||
|
5e5dcfaaa3 | ||
|
05e3a616b4 | ||
|
cfac33a94f | ||
|
581f0fa2dd | ||
|
0b9c0d177c | ||
|
3ca01c3149 | ||
|
ea0c2e9568 | ||
|
98b3003e07 | ||
|
c4558a31ab | ||
|
2b3922c972 | ||
|
4c8433b41c | ||
|
149d1450ef | ||
|
a9776814a6 | ||
|
4f8377b161 | ||
|
2f74aea6f5 | ||
|
b31a717410 | ||
|
08d3df10d4 | ||
|
a1c0a1f82f | ||
|
918c408e4d | ||
|
9e84763478 | ||
|
35bafb2aeb | ||
|
c84656f85a | ||
|
9a54383a23 | ||
|
62eaf60938 | ||
|
5601f8e0b7 | ||
|
b2c19d9ec6 | ||
|
788ecbf178 | ||
|
aae30bba39 | ||
|
e47bd634d4 | ||
|
2c5038ad05 | ||
|
a4d40560c3 | ||
|
62e3a8b9ff | ||
|
c19e3f455c | ||
|
94591c8b52 | ||
|
47389902bc | ||
|
d367a8dbad | ||
|
477aa07822 | ||
|
03c6beb971 | ||
|
ab91971398 | ||
|
dca095171c | ||
|
c6111039ab | ||
|
a711c7bdb7 | ||
|
19b1cf5986 | ||
|
1daf9b7a59 | ||
|
7851cee45e | ||
|
6497916ade | ||
|
1044e96909 | ||
|
1556e6cb3e | ||
|
6e8be2a2c3 | ||
|
2028ef40cb | ||
|
e614f9228a | ||
|
236ef99359 | ||
|
93c087997f | ||
|
31668cdde5 | ||
|
0085122028 | ||
|
99741f3d2a | ||
|
686b575f81 | ||
|
7678a1a95f | ||
|
8c672fa3b2 | ||
|
88872c8ce2 | ||
|
079b09c80f | ||
|
ec53db9352 | ||
|
0cc8962258 | ||
|
f18b1bd52a | ||
|
942b9468ff | ||
|
b481eadafd | ||
|
cb2978470c | ||
|
3b8fe6039e | ||
|
8982e368ec | ||
|
38f6804a79 | ||
|
c1bc7a8fae | ||
|
a1ce94eee5 | ||
|
e5c78973b0 | ||
|
e332c64d2a | ||
|
267a697fab | ||
|
eb7c8371ac | ||
|
198adcc740 | ||
|
37b9a8f6bf | ||
|
d0e3862356 | ||
|
46a6d9bb8e | ||
|
aa3739528b | ||
|
dee5f3bda6 | ||
|
0f134426e8 | ||
|
f985aab191 | ||
|
2d721a98cb | ||
|
2ffd16377b | ||
|
1cbbe8f4b1 | ||
|
49949e2f36 | ||
|
5a7952bf92 | ||
|
9e57828958 | ||
|
e28f213f9a | ||
|
e89a01630b | ||
|
d50ff26118 | ||
|
3ec7914962 | ||
|
3ba4aabbcf | ||
|
986871f2b5 | ||
|
5b0945b88c | ||
|
46c7413337 | ||
|
b729ffc604 | ||
|
9817b38904 | ||
|
a7d429a017 | ||
|
fb3db5077c | ||
|
79e5a6dfa3 | ||
|
c141f4ece5 | ||
|
9a3c6a3fd7 | ||
|
312b17a958 | ||
|
bcf7125f9d | ||
|
cb8e3fcf82 | ||
|
7d0c647e8b | ||
|
36060dfb6a | ||
|
729c176ff4 | ||
|
058cb2f1ee | ||
|
5897d07435 | ||
|
cfdcd63f3c | ||
|
77709c8076 | ||
|
d59d789c80 | ||
|
4bd9be22e0 | ||
|
93c86207d9 | ||
|
371bc0cb76 | ||
|
3976c7c4b9 | ||
|
069f3591e2 | ||
|
27fa2c2e66 | ||
|
66c99efb2f | ||
|
37b9b6fbfc | ||
|
d4fe313077 | ||
|
b6c21ee841 | ||
|
62159b0aa0 | ||
|
da625b569a | ||
|
9105f248b4 | ||
|
6ff637ec69 | ||
|
0876e76b40 | ||
|
9ed83bd196 | ||
|
d9b6bae320 | ||
|
0068508968 | ||
|
3563b5448c | ||
|
958989c80d | ||
|
ca484cfa1a | ||
|
1c35828fa2 | ||
|
cfd5615548 | ||
|
b7a2fba1ce | ||
|
64457b151c | ||
|
f63342ec72 | ||
|
7437d3945b | ||
|
6faac04f0d | ||
|
a11f6ffaac | ||
|
a285827980 | ||
|
4f2cd559da | ||
|
f23fa236dd | ||
|
6fbefaef09 | ||
|
a918696509 | ||
|
954125f6e2 | ||
|
0586c0ea18 | ||
|
29040f9352 | ||
|
e789801662 | ||
|
1f1361d179 | ||
|
e64518dd24 | ||
|
8ff69dda0c | ||
|
0a803400fe | ||
|
27823dbbb3 | ||
|
139b1000ff | ||
|
c9fb060ea0 | ||
|
e1e7d5215e | ||
|
626f7f6e97 | ||
|
a2b39ed943 | ||
|
7465d7a107 | ||
|
d34c48cb59 | ||
|
6748576f8e | ||
|
1966d18586 | ||
|
e42945a4e1 | ||
|
5a1cafa5dd | ||
|
b9c197565a | ||
|
b23b9a9395 | ||
|
c40cd5dbb7 | ||
|
3bcc2c2693 | ||
|
8f7303d540 | ||
|
2402507808 | ||
|
56ff8fbad5 | ||
|
68c373d2b8 | ||
|
907476fa86 | ||
|
fa3fd68c8c | ||
|
e1870c2808 | ||
|
037a8333a0 | ||
|
68eea10597 | ||
|
e38fadd863 | ||
|
502be105ac | ||
|
af3785021b | ||
|
2ff1372b1e | ||
|
367469cf90 | ||
|
6fdf57d44f | ||
|
ff9032754a | ||
|
c988665b5c | ||
|
5b6ae370e2 | ||
|
b60c762ac3 | ||
|
e4c5a78592 | ||
|
ec8d43b4a3 | ||
|
25b65e4b7d | ||
|
4703ca9ae6 | ||
|
b5f9a755b3 | ||
|
001b0cc49f | ||
|
e09955f0fb | ||
|
45ce08b147 | ||
|
2ff543a7bc | ||
|
b076bafaa7 | ||
|
e0fe5b2c66 | ||
|
a88429a78e | ||
|
22f0cf1866 | ||
|
d1fb01c2ff | ||
|
26838fb2d6 | ||
|
6dbbca4bec | ||
|
92dca4850a | ||
|
a3d798ca13 | ||
|
5d6d1cf790 | ||
|
fd33d9d2ec | ||
|
8b38a169e6 | ||
|
e422e47ada | ||
|
900625b17b | ||
|
7d66d5f2d3 | ||
|
26a5059cc0 | ||
|
077cd14f4f | ||
|
ad2fbb0008 | ||
|
67ebf3366f | ||
|
5d4b4b099c | ||
|
5e31db04d7 | ||
|
ce04c81482 | ||
|
675185ac02 | ||
|
f7227de6fa | ||
|
61c5c61e00 | ||
|
b2fa90cae7 | ||
|
a88f644001 | ||
|
94d4ad99f4 | ||
|
d34d368306 | ||
|
fe60b2c8bb | ||
|
c1614dabc5 | ||
|
f68e835087 | ||
|
801e6fb1c4 | ||
|
5c2dd37528 | ||
|
857dddab3b | ||
|
2bb8b2c4e2 | ||
|
a6bb31f2a6 | ||
|
45add3cedd | ||
|
fe0f4df958 | ||
|
e051eae5bc | ||
|
a804144ed4 | ||
|
9faa3099a4 | ||
|
aa3d3969aa | ||
|
dbed565197 | ||
|
51ff6b1725 | ||
|
ed52e49408 | ||
|
3e8ca5a1ca | ||
|
cca841e459 | ||
|
9f2460c263 | ||
|
ce7ac37e85 | ||
|
5faed5d7f0 | ||
|
4d4374730e | ||
|
3823a6ba11 | ||
|
8b95871682 | ||
|
1db3b079c6 | ||
|
2c55daa3e2 | ||
|
829ca1f1c1 | ||
|
f545af54c1 | ||
|
1c0e026259 | ||
|
3c4a1013b8 | ||
|
7a080ac308 | ||
|
1e72dd6b33 | ||
|
58df62ec8c | ||
|
1752e29f2d | ||
|
309dc40484 | ||
|
0e00c85f99 | ||
|
64fe90257d | ||
|
b504e8c317 | ||
|
6e32d23d56 | ||
|
a58a01040d | ||
|
9bfa116794 | ||
|
e9bcbe1ead | ||
|
cc1fe2f14f | ||
|
10e2c174d4 | ||
|
f1dc75f097 | ||
|
7109db24c2 | ||
|
a9cf744c0b | ||
|
e5c7e50202 | ||
|
883568add4 | ||
|
2dbda44a93 | ||
|
f022b747b0 | ||
|
2132cdacc5 | ||
|
201c2bf170 | ||
|
9c6f5b3573 | ||
|
1d04b52b5a | ||
|
34e92a361b | ||
|
dafba9a07c | ||
|
4be664ab49 | ||
|
9afe5da7b4 | ||
|
c55714ea0c | ||
|
2f0987b529 | ||
|
d5729b8a32 | ||
|
73dcf1e697 | ||
|
aeee941b2c | ||
|
e246b5d0bb | ||
|
97e550bb9f | ||
|
55beefa6c7 | ||
|
91b41885d5 | ||
|
4513c6c35d | ||
|
b73e05d64a | ||
|
eefd065726 | ||
|
293caa511f | ||
|
050987bead | ||
|
8b6f5d3dec | ||
|
c10f4311f7 | ||
|
895d06d28a | ||
|
5d92c04a36 | ||
|
328eb883ec | ||
|
6619cf159f | ||
|
635a9c45bd | ||
|
222f6880cb | ||
|
76c1c10a9b | ||
|
17b9bd27de | ||
|
b2d9c119ac | ||
|
940b3748fb | ||
|
806e392d31 | ||
|
d575cf07b7 | ||
|
69b3e19c1b | ||
|
d0cdb0f390 | ||
|
c1cc790d9d | ||
|
34292ece10 | ||
|
f3b0cf6f3e | ||
|
d3f5942d7d | ||
|
85975a2d26 | ||
|
644387c0ad | ||
|
cf8415f87a | ||
|
eb02e9f3e1 | ||
|
f8362e798f | ||
|
c4ced1fbdf | ||
|
187e6b7e58 | ||
|
fc94f50e6a | ||
|
6f24a44e53 | ||
|
48b7191af2 | ||
|
12b0954523 | ||
|
ab38d55646 | ||
|
b852e56df3 | ||
|
4db935e91e | ||
|
4733355851 | ||
|
c882f46eb6 | ||
|
d59717b5d8 | ||
|
b1122c5cda | ||
|
da39d76310 | ||
|
1082c995fe | ||
|
fceee430b3 | ||
|
7c434d85ed | ||
|
689aa84c28 | ||
|
b1154be71b | ||
|
dd380963ce | ||
|
a91e0cc537 | ||
|
51b6d07d0c | ||
|
88ca7c9a7e | ||
|
ad69aa20ce | ||
|
fcc53f4151 | ||
|
6894721e8d | ||
|
d5d65f4a84 | ||
|
b992100106 | ||
|
f62f627443 | ||
|
bf37c06de4 | ||
|
91fad8072d | ||
|
a62b5de79e | ||
|
acd58f6fe5 | ||
|
44dc8d10bb | ||
|
bae1fa072c | ||
|
e38f19b5f3 | ||
|
1ce9ab22bf | ||
|
a14ba4d9ff | ||
|
7f24912a35 | ||
|
8fd2097526 | ||
|
1a786bc64f | ||
|
35b1f72559 | ||
|
d8ff91e089 | ||
|
b0fa20df75 | ||
|
007b1c9b5d | ||
|
0ec411b868 | ||
|
c7949bf703 | ||
|
fab5d17a5d | ||
|
f0b732d7e0 | ||
|
294be0f302 | ||
|
7ca61b7185 | ||
|
1823aba35a | ||
|
1bef0775ce | ||
|
f6c5117bf7 | ||
|
e783ab17dc | ||
|
b61576e529 | ||
|
50eaaa15fa | ||
|
763d9458bf | ||
|
af8515b6e4 | ||
|
0d60b5218a | ||
|
76356ed1e5 | ||
|
fff3eb1ee7 | ||
|
5ca5811bc8 |
19
API.md
|
@ -21,6 +21,7 @@ All nodes can have these fields:
|
|||
|
||||
* `_mcl_hardness`: Hardness of the block, ranges from 0 to infinity (represented by -1). Determines digging times. Default: 0
|
||||
* `_mcl_blast_resistance`: How well this block blocks and resists explosions. Default: 0
|
||||
* `_mcl_falling_node_alternative`: If set to an itemstring, the node will turn into this node before it starts to fall.
|
||||
* `_mcl_after_falling(pos)`: Called after a falling node finished falling and turned into a node.
|
||||
|
||||
Use the `mcl_sounds` mod for the sounds.
|
||||
|
@ -31,18 +32,26 @@ A lot of things are possible by using one of the APIs in the mods. Note that not
|
|||
### Items
|
||||
* Doors: `ITEMS/mcl_doors`
|
||||
* Fences and fence gates: `ITEMS/mcl_fences`
|
||||
* Stairs and slabs: `ITEM/mcl_stairs`
|
||||
* Walls: `ITEMS/mcl_walls`
|
||||
* Beds: `ITEMS/mcl_beds`
|
||||
* Buckets: `ITEMS/mcl_buckets`
|
||||
* Dispenser support: `ITEMS/REDSTONE/mcl_dispensers`
|
||||
|
||||
## Mobs
|
||||
* Mobs: `ENTITIES/mods`
|
||||
* Mobs: `ENTITIES/mcl_mods`
|
||||
|
||||
MineClone 2 uses its own mobs framework, called “Mobs Redo: MineClone 2 Edition” or “MRM” for short.
|
||||
This is a fork of Mobs Redo [`mobs`] by TenPlus1.
|
||||
|
||||
MineClone 2 uses Mobs Redo [`mobs`] by TenPlus1, a very powerful mod for adding mods of various types.
|
||||
There are modificiations from the original mod for MineClone 2 compability. Some items have been removed or moved to other mods, but the API is identical.
|
||||
You can add your own mobs, spawn eggs and spawning rules with this mod.
|
||||
API documnetation is included in `ENTITIES/mobs/api.txt`.
|
||||
API documnetation is included in `ENTITIES/mcl_mobs/api.txt`.
|
||||
|
||||
This mod includes modificiations from the original Mobs Redo. Some items have been removed or moved to other mods.
|
||||
The API is mostly identical, but a few features have been added. Compability is not really a goal,
|
||||
but function and attribute names of Mobs Redo 1.41 are kept.
|
||||
If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in MineClone 2,
|
||||
chances are good that it works out of the box.
|
||||
|
||||
### Help
|
||||
* Item help texts: `HELP/doc/doc_items`
|
||||
|
@ -53,6 +62,7 @@ API documnetation is included in `ENTITIES/mobs/api.txt`.
|
|||
* Statbars: `HUD/hudbars`
|
||||
|
||||
### Utility APIs
|
||||
* Change player physics: `PLAYER/playerphysics`
|
||||
* Select random treasures: `CORE/mcl_loot`
|
||||
* Get flowing direction of liquids: `CORE/flowlib`
|
||||
* `on_walk_over` callback for nodes: `CORE/walkover`
|
||||
|
@ -62,7 +72,6 @@ API documnetation is included in `ENTITIES/mobs/api.txt`.
|
|||
The following APIs may be subject to change in future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk!
|
||||
|
||||
* Panes (like glass panes and iron bars): `ITEMS/xpanes`
|
||||
* Slabs and stairs: `ITEM/mcl_stairs` **and** `ITEMS/mcstair`
|
||||
* `_on_ignite` callback: `ITEMS/mcl_fire`
|
||||
* Farming: `ITEMS/mcl_farming`
|
||||
* Anything related to redstone: Don't touch (yet)
|
||||
|
|
|
@ -5,7 +5,7 @@ Wow, thank you! :-)
|
|||
But first, some things to note:
|
||||
|
||||
MineClone 2's development target is to make a free software clone of Minecraft,
|
||||
***version 1.11*** (later: 1.12), ***PC edition***.
|
||||
***version 1.11***, ***PC edition***.
|
||||
|
||||
MineClone 2 is maintained by one person. Namely, Wuzzy. You can find me,
|
||||
Wuzzy, in the Minetest forums (forums.minetest.net), in IRC in the #minetest
|
||||
|
@ -26,8 +26,8 @@ For small and medium changes:
|
|||
|
||||
* Fork the repository
|
||||
* Do your change in a new branch
|
||||
* Upload the repository somewhere where it can be accessed from the Internet
|
||||
* Ask me to pull in your changes (and briefly say what you're changed)
|
||||
* Upload the repository somewhere where it can be accessed from the Internet and
|
||||
notify me
|
||||
|
||||
For small changes, sending me a patch is also good.
|
||||
|
||||
|
@ -35,7 +35,7 @@ For big changes: Same as above, but consider notifying me first to avoid
|
|||
duplicate work and possible tears of rejection. ;-)
|
||||
|
||||
## Quality remarks
|
||||
Again: There is ***no*** guarantee I will accept anything from anything.
|
||||
Again: There is ***no*** guarantee I will accept anything from anybody.
|
||||
But I will gladly take in code from others when I feel it saves me work
|
||||
in the long run.
|
||||
|
||||
|
@ -64,10 +64,10 @@ Depending on what you add, the chances for inclusion vary:
|
|||
|
||||
## Coding style guide
|
||||
* Indentations should reflect the code flow
|
||||
* Use tabs, not spaces for indentation
|
||||
* Use tabs, not spaces for indentation (tab size = 8)
|
||||
* Never use `minetest.env`
|
||||
|
||||
## Reporting bugs
|
||||
Report all bugs and missing Minecraft features here:
|
||||
|
||||
<https://github.com/Wuzzy2/MineClone2-Bugs>
|
||||
<https://git.minetest.land/Wuzzy/MineClone2/issues>
|
||||
|
|
31
GROUPS.md
|
@ -36,7 +36,11 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
|
|||
* `dig_by_piston=1`: Blocks which will drop as an item when pushed by a piston. They also cannot be pulled by sticky pistons
|
||||
* `cultivatable=2`: Block will be turned into Farmland by using a hoe on it
|
||||
* `cultivatable=1`: Block will be turned into Dirt by using a hoe on it
|
||||
* `flammable`: Block helps spreading fire and gets destroyed by nearby fire (rating doesn't matter)
|
||||
* `flammable`: Block spreads fire
|
||||
* `flammable>0`: Gets destroyed by fire
|
||||
* `flammable=-1` Does not get destroyed by fire
|
||||
* `fire_encouragement`: How quickly this block catches fire
|
||||
* `fire_flammability`: How fast the block will burn away
|
||||
* `spreading_dirt_type=1`: A dirt-type block with a cover (e.g. grass) which may spread to neighbor dirt blocks
|
||||
* `dirtifies_below_solid=1`: This node turns into dirt immediately when a solid or dirtifier node is placed on top
|
||||
* `dirtifier=1`: This node turns nodes the above group into dirt when placed above
|
||||
|
@ -55,6 +59,17 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
|
|||
* `cauldron`: Cauldron. 1: Empty. 2-4: Water height
|
||||
* `anvil`: Anvil. 1: No damage. 2-3: Higher damage levels
|
||||
* `no_rename=1`: Item cannot be renamed by anvil
|
||||
* `comparator_signal=X`: If set, this node outputs a constant (!) comparator signal output of strength X.
|
||||
* `piston=X`: Piston (main body) (1 = normal, 2 = sticky)
|
||||
* `piston_pusher=X`: Piston pusher (1 = normal, 2 = sticky)
|
||||
* `hopper=X`: Hopper (1 = downwards, 2 = sideways)
|
||||
* `portal=1`: Portal (node that teleports players and things by standing inside)
|
||||
* `end_portal_frame=X`: End portal frame (1 = no eye, 2 = with eye)
|
||||
* `coral=X`: Coral (any type) (1 = alive, 2 = dead)
|
||||
* `coral_plant=X`: Coral in the "plant" shape (1 = alive, 2 = dead)
|
||||
* `coral_fan=X`: Coral fan (1 = alive, 2 = dead)
|
||||
* `coral_block=X`: Coral block (1 = alive, 2 = dead)
|
||||
* `coral_species=X`: Specifies the species of a coral; equal X means equal species
|
||||
|
||||
#### Footnotes
|
||||
|
||||
|
@ -65,8 +80,10 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
|
|||
### Groups (mostly) used for crafting recipes
|
||||
|
||||
* `sand=1`: Sand (any color)
|
||||
* `sandstone=1`: (Yellow) sandstone and related nodes (chiseled and the like) (only full blocks)
|
||||
* `redsandstone=1`: Red sandstone and related nodes (chiseled and the like) (only full blocks)
|
||||
* `sandstone=1`: Sandstone (any color) and related nodes (chiseled and the like) (only full blocks)
|
||||
* `normal_sandstone=1`: “Normal” (yellow) sandstone and related nodes (chiseled and the like) (only full blocks)
|
||||
* `red_sandstone=1`: Red sandstone and related nodes (chiseled and the like) (only full blocks)
|
||||
* `hardened_clay=1`: Terracotta (any color)
|
||||
* `quartz_block=1`: Quartz Block and variants (chiseled, pillar, etc.) (only full blocks)
|
||||
* `stonebrick=1`: Stone Bricks and related nodes (only full blocks)
|
||||
* `shulker_box=1`: Block is a shulker box
|
||||
|
@ -151,6 +168,7 @@ These groups are used mostly for informational purposes
|
|||
* `container=5`: Left part of a 2-part horizontal connected container. Both parts have a `"main"` inventory
|
||||
list. Both inventories are considered to belong together. This is used for large chests.
|
||||
* `container=6`: Same as above, but for the right part.
|
||||
* `container=7`: Has inventory list "`main`", no movement allowed
|
||||
* `container=1`: Other/unspecified container type
|
||||
* `spawn_egg=1`: Spawn egg
|
||||
|
||||
|
@ -164,6 +182,13 @@ These groups are used mostly for informational purposes
|
|||
* `plant=1`: Plant or part of a plant
|
||||
* `double_plant`: Part of a double-sized plant. 1 = lower part, 2 = upper part
|
||||
|
||||
* `pickaxe=1`: Pickaxe
|
||||
* `shovel=1`: Shovel
|
||||
* `axe=1`: Axe
|
||||
* `sword=1`: Sword
|
||||
* `hoe=1`: Hoe (farming tool)
|
||||
* `shears=1`: Shears
|
||||
|
||||
* `weapon=1`: Item is primarily (!) a weapon
|
||||
* `tool=1`: Item is primarily (!) a tool
|
||||
* `craftitem=1`: Item is primarily (!) used for crafting
|
||||
|
|
|
@ -8,8 +8,6 @@ For these features, no easy Lua workaround could be found.
|
|||
|
||||
### Lua API
|
||||
#### Tools/wielded item
|
||||
- Allow **much** faster liquid flowing ([#2810](https://github.com/minetest/minetest/issues/2810))
|
||||
|
||||
- “Lock” hotbar for a brief time after using an item, making it impossible to switch item or to attach/mine/build until the delay is over (For eating with delay)
|
||||
- Tool charging: Holding down the mouse and releasing it, applying a “power level” (For bow and arrows, more charge = higher arrow range) ([issue 5212](https://github.com/minetest/minetest/issues/5212))
|
||||
- [Dual Wielding](http://minecraft.gamepedia.com/Dual_wield)
|
||||
|
@ -21,7 +19,6 @@ For these features, no easy Lua workaround could be found.
|
|||
|
||||
## Interface
|
||||
- Inventory: Hold down right mouse button while holding an item stack to drop items into the slots as you move the mouse. Makes crafting MUCH faster
|
||||
- **Much** more informative item tooltips
|
||||
- Sneak+Leftclick on crafting output crafts as many items as possible and immediately puts it into the player inventory ([issue 5211](https://github.com/minetest/minetest/issues/5211))
|
||||
- Sneak+click on inventory slot should be able to put items into additional “fallback inventories” if the first inventory is full. Required for large chests
|
||||
- Sneak+click puts items in different inventories depending on the item type (maybe group-based)? Required for sneak-clicking to armor slots
|
||||
|
@ -39,8 +36,5 @@ For these features, a workaround (or hack ;-)) by using Lua is theoretically pos
|
|||
- Set damage frequency of `damage_per_second`. In Minecraft many things damage players every half-second rather than every second
|
||||
- Possible to damage players directly when they are with the head inside. This allows to add Minecraft-like suffocation
|
||||
|
||||
#### Crafting
|
||||
- Require tools to be intact in crafting
|
||||
|
||||
#### Nice-to-haye
|
||||
- Utility function to rotate pillar-like nodes, requiring only 3 possible orientations (X, Y, Z). Basically this is `minetest.rotate_node` but with less orientations; the purpur pillar would mess up if a mirrored rotation would be possible. This is already implemented in MCL2, See `mcl_util` for more infos
|
||||
|
|
72
README.md
|
@ -1,8 +1,21 @@
|
|||
# MineClone 2
|
||||
An unofficial Minecraft-like game for Minetest. Forked from MineClone by daredevils.
|
||||
Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB.
|
||||
# MineClone 2 (Forkhausen Edition)
|
||||
An unofficial Minecraft-like game for Minetest. Forked from MineClone2 developed by Wuzzy
|
||||
and contributors which is a fork of MineClone by davedevils. Not developed or endorsed by Mojang AB.
|
||||
|
||||
Version: 0.36.3
|
||||
Version: 0.65.2
|
||||
|
||||
## Differences to MineClone 2
|
||||
So far some minor fixes that I also sent upstream to Wuzzy for inclusion and some yet unmerged features from others:
|
||||
|
||||
* ~~Fix a crash when refueling powered minecarts [issue #683](https://git.minetest.land/Wuzzy/MineClone2/issues/683)~~
|
||||
* Pumpkins grow without a face and can be carved [issue #682](https://git.minetest.land/Wuzzy/MineClone2/issues/682)
|
||||
* Fix acceleration of powered minecarts and powered rails not summing up (by 2mac)
|
||||
[issue #658](https://git.minetest.land/Wuzzy/MineClone2/issues/658).
|
||||
* Mobs take damage from magma block if susceptible to fire damage (inspiraton from [minetest_npc](https://forum.minetest.net/viewtopic.php?p=371969#p371969))
|
||||
* ~~When mobs are trying to escape dangerous situations (e.g. standing on lava), make more efforts to check if destination is safe.~~
|
||||
* Carpets can be added to tamed Llamas. TODO: Replace textures because community-provided PixelPerfection textures of carpets are a bit **too** close to the original MC textures.
|
||||
* ~~Fix crash in new explosion API [issue #689](https://git.minetest.land/Wuzzy/MineClone2/issues/689)~~
|
||||
* Fix crash when igniting a creeper with flint and steel ([fix by nelkat](https://forum.minetest.net/viewtopic.php?p=372836#p372836))
|
||||
|
||||
### Gameplay
|
||||
You start in a randomly-generated world made entirely of cubes. You can explore
|
||||
|
@ -60,18 +73,27 @@ The following items are interesting for Creative Mode and for adventure
|
|||
map builders. They can not be obtained in-game or in the creative inventory.
|
||||
|
||||
* Barrier: `mcl_core:barrier`
|
||||
* Minecart with Command Block (does not work yet): `mcl_minecarts:command_block_minecart`
|
||||
|
||||
Use the `/giveme` chat command to obtain them. See the in-game help for
|
||||
an explanation.
|
||||
|
||||
#### Incomplete items
|
||||
These items do not work yet, but you can get them with `/giveme` for testing:
|
||||
|
||||
* Minecart with Chest: `mcl_minecarts:chest_minecart`
|
||||
* Minecart with Furnace: `mcl_minecarts:furnace_minecart`
|
||||
* Minecart with Hopper: `mcl_minecarts:hopper_minecart`
|
||||
* Minecart with Command Block: `mcl_minecarts:command_block_minecart`
|
||||
|
||||
## Installation
|
||||
This game requires [Minetest](http://minetest.net) 0.4.16 (or later) to run,
|
||||
so you need to install Minetest first. Only stable versions of Minetest are
|
||||
officially supported. There is no support whatsoever for running MineClone 2
|
||||
in development versions of Minetest.
|
||||
To install MineClone 2, move this directory into the “games” directory of
|
||||
your Minetest data directory. Consult the help of Minetest to learn more.
|
||||
This game requires [Minetest](http://minetest.net) to run (version 5.0.0 or
|
||||
later). So you need to install Minetest first. Only stable versions of Minetest
|
||||
are officially supported.
|
||||
There is no support for running MineClone 2 in development versions of Minetest.
|
||||
|
||||
To install MineClone 2 (if you haven't already), move this directory into the
|
||||
“games” directory of your Minetest data directory. Consult the help of
|
||||
Minetest to learn more.
|
||||
|
||||
## Project description
|
||||
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
|
||||
|
@ -130,7 +152,7 @@ The following main features are available:
|
|||
|
||||
The following features are incomplete:
|
||||
|
||||
* Generated structures
|
||||
* Generated structures (especially villages)
|
||||
* NPCs
|
||||
* Some monsters and animals
|
||||
* Redstone-related things
|
||||
|
@ -139,6 +161,7 @@ The following features are incomplete:
|
|||
* Experience
|
||||
* Status effects
|
||||
* Brewing, potions, tipped arrows
|
||||
* Special minecarts
|
||||
* A couple of non-trivial blocks and items
|
||||
|
||||
Bonus features (not found in Minecraft 1.11):
|
||||
|
@ -172,7 +195,7 @@ Technical differences from Minecraft:
|
|||
## Reporting bugs
|
||||
Please report all bugs and missing Minecraft features here:
|
||||
|
||||
<https://github.com/Wuzzy2/MineClone2-Bugs>
|
||||
<https://git.athemis.de/Athemis/MineClone2/issues>
|
||||
|
||||
## Other readme files
|
||||
|
||||
|
@ -186,17 +209,26 @@ There are so many people to list (sorry). Check out the respective mod directori
|
|||
|
||||
### Coding
|
||||
* [Wuzzy](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=3082): Main programmer of most mods
|
||||
* daredevils: Creator of MineClone on which MineClone 2 is based on
|
||||
* davedevils: Creator of MineClone on which MineClone 2 is based on
|
||||
* [ex-bart](https://github.com/ex-bart): Redstone comparators
|
||||
* [Rootyjr](https://github.com/Rootyjr): Fishing rod and bugfixes
|
||||
* [aligator](https://github.com/aligator): Improvement of doors
|
||||
* [ryvnf](https://github.com/ryvnf): Explosion mechanics
|
||||
* Lots of other people: TO BE WRITTEN (see mod directories for details)
|
||||
|
||||
### Textures
|
||||
### Graphics
|
||||
* [XSSheep](http://www.minecraftforum.net/members/XSSheep): Main author; creator of the Pixel Perfection resource pack of Minecraft 1.11
|
||||
* [Wuzzy](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=3082): Main menu imagery and various edits and additions of texture pack
|
||||
* [kingoscargames](https://github.com/kingoscargames): Various edits and additions of existing textures
|
||||
* [leorockway](https://github.com/leorockway): Some edits of mob textures
|
||||
* [xMrVizzy](https://minecraft.curseforge.com/members/xMrVizzy): Glazed terracotta (textures are subject to be replaced later)
|
||||
* Other authors: GUI images,
|
||||
* yutyo <tanakinci2002@gmail.com>: MineClone 2 logo
|
||||
* Other authors: GUI images
|
||||
|
||||
### Translations
|
||||
* Wuzzy: German
|
||||
* Rocher Laurent <rocherl@club-internet.fr>: French
|
||||
* wuniversales: Spanish
|
||||
|
||||
### Models
|
||||
* [22i](https://github.com/22i): Creator of all models
|
||||
|
@ -207,7 +239,7 @@ Various sources. See the respective mod directories for details.
|
|||
|
||||
### Special thanks
|
||||
|
||||
* daredevils for starting MineClone, the original version of this game
|
||||
* davedevils for starting MineClone, the original version of this game
|
||||
* celeron55 for creating Minetest
|
||||
* Minetest's modding community for providing a huge selection of mods, some of which ended up in MineClone 2
|
||||
* Jordach for the jukebox music compilation from Big Freaking Dig
|
||||
|
@ -230,13 +262,15 @@ Here's the detailed legalese for those who need it:
|
|||
### License of source code
|
||||
MineClone 2 is a clean-room implementation of Minecraft
|
||||
and licensed under the
|
||||
GNU LGPL v2.1 (Wuzzy, daredevils and countless others) (see `LICENSE.txt`).
|
||||
GNU LGPL v2.1 (Wuzzy, davedevils and countless others) (see `LICENSE.txt`).
|
||||
|
||||
MineClone 2 is a direct continuation of the discontinued MineClone
|
||||
project by daredevils which fell under the same license.
|
||||
project by davedevils which fell under the same license.
|
||||
|
||||
Mods credit:
|
||||
See `README.txt` or `README.md` in each mod directory for information about other authors.
|
||||
For mods that do not have such a file, the license is the source code license
|
||||
of MineClone 2 and the author is Wuzzy.
|
||||
|
||||
### License of media (textures and sounds)
|
||||
No non-free licenses are used anywhere.
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
name = MineClone 2
|
||||
description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more.
|
||||
|
|
BIN
menu/header.png
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 22 KiB |
BIN
menu/icon.png
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.9 KiB |
|
@ -1,7 +1,9 @@
|
|||
# This is a game specify minetest.conf file, do not edit
|
||||
# This is a game specific minetest.conf file, do not edit
|
||||
|
||||
# Basic game rules
|
||||
time_speed = 72
|
||||
|
||||
# Player physics
|
||||
movement_acceleration_default = 2.4
|
||||
movement_acceleration_air = 1.2
|
||||
#movement_acceleration_fast = 10
|
||||
|
@ -20,4 +22,12 @@ movement_liquid_sink = 23
|
|||
|
||||
movement_gravity = 10.4
|
||||
|
||||
# Mapgen stuff
|
||||
|
||||
# altitude_chill and altitude_dry doesn't go well together with MCL2 biomes
|
||||
# which already include "snowed" variants as you go higher.
|
||||
# humid_rivers would cause the MushroomIsland biome to appear frequently around rivers.
|
||||
mgvalleys_spflags = noaltitude_chill,noaltitude_dry,nohumid_rivers,vary_river_depth
|
||||
|
||||
# MCL2-specific stuff
|
||||
keepInventory = false
|
||||
|
|
10
mods/CORE/_mcl_autogroup/README.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
This mod automatically adds groups to items based on item metadata.
|
||||
|
||||
Specifically, this mod has 2 purposes:
|
||||
1) Automatically adding the group “solid” for blocks considered “solid” in Minecraft.
|
||||
2) Generating digging time group for all nodes based on node metadata (it's complicated)
|
||||
|
||||
See init.lua for more infos.
|
||||
|
||||
The leading underscore in the name “_mcl_autogroup” was added to force Minetest to load this mod as late as possible.
|
||||
As of 0.4.16, Minetest loads mods in reverse alphabetical order.
|
1
mods/CORE/_mcl_autogroup/description.txt
Normal file
|
@ -0,0 +1 @@
|
|||
MineClone 2 core mod which automatically adds groups to all items. Very important for digging times.
|
|
@ -1,11 +1,3 @@
|
|||
--[[ This mod automatically adds groups to items based on item metadata.
|
||||
|
||||
Specifically, this mod has 2 purposes:
|
||||
1) Automatically adding the group “solid” for blocks considered “solid” in Minecraft.
|
||||
2) Generating digging time group for all nodes based on node metadata (it's complicated)
|
||||
|
||||
]]
|
||||
|
||||
--[[ Mining times. Yeah, mining times … Alright, this is going to be FUN!
|
||||
|
||||
This mod does include a HACK to make 100% sure the digging times of all tools match Minecraft's perfectly.
|
1
mods/CORE/_mcl_autogroup/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = _mcl_autogroup
|
42
mods/CORE/biomeinfo/API.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
# Biome Info API
|
||||
This document explains the API of this mod.
|
||||
|
||||
## v6 mapgen functions
|
||||
These are functions for the v6 mapgen only.
|
||||
|
||||
Use these functions only in worlds in which the v6 mapgen is used.
|
||||
If you use these in any other mapgen, bad things might happen.
|
||||
|
||||
### `biomeinfo.get_v6_humidity(pos)`
|
||||
Get the biome humidity at pos (for v6 mapgen).
|
||||
|
||||
### `biomeinfo.get_v6_heat(pos)`
|
||||
Get the biome heat/temperature at pos (for v6 mapgen).
|
||||
|
||||
### `biomeinfo.get_v6_biome(pos)`
|
||||
Get the v6 biome at pos.
|
||||
Returns a string, which is the unique biome name.
|
||||
|
||||
Note: This function currently ignores the `biomeblend` v6 mapgen flag,
|
||||
it just pretends this setting is disabled.
|
||||
This is normally not a problem, but at areas where biomes blend,
|
||||
the result is not perfectly accurate and just an estimate.
|
||||
|
||||
### `biomeinfo.get_active_v6_biomes()`
|
||||
Returns a table containing the names of all v6 biomes that are actively
|
||||
used in the current world, e.g. those that have been activated
|
||||
by the use of the mapgen v6 flags (`mgv6_spflags`).
|
||||
|
||||
### `biomeinfo.all_v6_biomes`
|
||||
This is a table containing all v6 biomes (as strings), even those that
|
||||
might not be used in the current world.
|
||||
|
||||
### v6 biome names
|
||||
|
||||
These are the biome names used in this mod:
|
||||
|
||||
* Normal
|
||||
* Desert
|
||||
* Jungle
|
||||
* Tundra
|
||||
* Taiga
|
11
mods/CORE/biomeinfo/README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Biome Info API [`biomeinfo`]
|
||||
This is an API mod for mod developers to add a couple of missing
|
||||
biome-related functions.
|
||||
Currently, this mod only adds v6-related functions.
|
||||
Most importantly, you can get the heat, humidity and biome in the v6 mapgen.
|
||||
|
||||
See `API.md` for the API documentation.
|
||||
|
||||
Current version: 1.0.3 (this is a [SemVer](https://semver.org/))
|
||||
|
||||
License: MIT License
|
211
mods/CORE/biomeinfo/init.lua
Normal file
|
@ -0,0 +1,211 @@
|
|||
biomeinfo = {}
|
||||
|
||||
-- Copied from mapgen_v6.h
|
||||
local MGV6_FREQ_HOT = 0.4
|
||||
local MGV6_FREQ_SNOW = -0.4
|
||||
local MGV6_FREQ_TAIGA = 0.5
|
||||
local MGV6_FREQ_JUNGLE = 0.5
|
||||
|
||||
-- Biome types
|
||||
local BT_NORMAL = "Normal"
|
||||
local BT_TUNDRA = "Tundra"
|
||||
local BT_TAIGA = "Taiga"
|
||||
local BT_DESERT = "Desert"
|
||||
local BT_JUNGLE = "Jungle"
|
||||
|
||||
-- Get mapgen settings
|
||||
|
||||
local seed = tonumber(minetest.get_mapgen_setting("seed")) or 0
|
||||
|
||||
local mgv6_perlin_biome, mgv6_perlin_humidity, mgv6_np_biome
|
||||
|
||||
-- v6 default noiseparams are hardcoded here because Minetest doesn't give us those
|
||||
local mgv6_np_biome_default = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = { x = 500, y = 500, z = 500},
|
||||
seed = 9130,
|
||||
octaves = 3,
|
||||
persistence = 0.50,
|
||||
lacunarity = 2.0,
|
||||
flags = "eased",
|
||||
}
|
||||
local mgv6_np_humidity_default = {
|
||||
offset = 0.5,
|
||||
scale = 0.5,
|
||||
spread = { x = 500, y = 500, z = 500},
|
||||
seed = 72384,
|
||||
octaves = 3,
|
||||
persistence = 0.50,
|
||||
lacunarity = 2.0,
|
||||
flags = "eased",
|
||||
}
|
||||
|
||||
local v6_flags_str = minetest.get_mapgen_setting("mgv6_spflags")
|
||||
if v6_flags_str == nil then
|
||||
v6_flags_str = ""
|
||||
end
|
||||
local v6_flags = string.split(v6_flags_str)
|
||||
local v6_use_snow_biomes = true
|
||||
local v6_use_jungles = true
|
||||
-- TODO: Implement biome blend.
|
||||
-- Currently we pretend biome blend is disabled.
|
||||
-- This just makes the calculations inaccurate near biome boundaries,
|
||||
-- but should be fine otherwise.
|
||||
local v6_use_biome_blend = false
|
||||
for f=1, #v6_flags do
|
||||
local flag = v6_flags[f]:trim()
|
||||
if flag == "nosnowbiomes" then
|
||||
v6_use_snow_biomes = false
|
||||
end
|
||||
if flag == "snowbiomes" then
|
||||
v6_use_snow_biomes = true
|
||||
end
|
||||
if flag == "nojungles" then
|
||||
v6_use_jungles = false
|
||||
end
|
||||
if flag == "jungles" then
|
||||
v6_use_jungles = true
|
||||
end
|
||||
if flag == "nobiomeblend" then
|
||||
v6_use_biome_blend = false
|
||||
end
|
||||
-- TODO
|
||||
-- if flag == "biomeblend" then
|
||||
-- v6_use_biome_blend = true
|
||||
-- end
|
||||
end
|
||||
-- Force-enable jungles when snowbiomes flag is set
|
||||
if v6_use_snow_biomes then
|
||||
v6_use_jungles = true
|
||||
end
|
||||
local v6_freq_desert = tonumber(minetest.get_mapgen_setting("mgv6_freq_desert") or 0.45)
|
||||
|
||||
local NOISE_MAGIC_X = 1619
|
||||
local NOISE_MAGIC_Y = 31337
|
||||
local NOISE_MAGIC_Z = 52591
|
||||
local NOISE_MAGIC_SEED = 1013
|
||||
local noise2d = function(x, y, seed)
|
||||
-- TODO: implement noise2d function for biome blend
|
||||
return 0
|
||||
--[[
|
||||
local n = (NOISE_MAGIC_X * x + NOISE_MAGIC_Y * y
|
||||
+ NOISE_MAGIC_SEED * seed) & 0x7fffffff;
|
||||
n = (n >> 13) ^ n;
|
||||
n = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;
|
||||
return 1.0 - n / 0x40000000;
|
||||
]]
|
||||
end
|
||||
|
||||
biomeinfo.all_v6_biomes = {
|
||||
BT_NORMAL,
|
||||
BT_DESERT,
|
||||
BT_JUNGLE,
|
||||
BT_TUNDRA,
|
||||
BT_TAIGA
|
||||
}
|
||||
|
||||
local function init_perlins()
|
||||
if not mgv6_perlin_biome then
|
||||
mgv6_np_biome = minetest.get_mapgen_setting_noiseparams("mgv6_np_biome")
|
||||
if not mgv6_np_biome then
|
||||
mgv6_np_biome = mgv6_np_biome_default
|
||||
minetest.log("action", "[biomeinfo] Using hardcoded mgv6_np_biome default")
|
||||
end
|
||||
mgv6_perlin_biome = minetest.get_perlin(mgv6_np_biome)
|
||||
end
|
||||
if not mgv6_perlin_humidity then
|
||||
local np_humidity = minetest.get_mapgen_setting_noiseparams("mgv6_np_humidity")
|
||||
if not np_humidity then
|
||||
np_humidity = mgv6_np_humidity_default
|
||||
minetest.log("action", "[biomeinfo] Using hardcoded mgv6_np_humidity default")
|
||||
end
|
||||
mgv6_perlin_humidity = minetest.get_perlin(np_humidity)
|
||||
end
|
||||
end
|
||||
|
||||
function biomeinfo.get_active_v6_biomes()
|
||||
local biomes = { BT_NORMAL, BT_DESERT }
|
||||
if v6_use_jungles then
|
||||
table.insert(biomes, BT_JUNGLE)
|
||||
end
|
||||
if v6_use_snow_biomes then
|
||||
table.insert(biomes, BT_TUNDRA)
|
||||
table.insert(biomes, BT_TAIGA)
|
||||
end
|
||||
return biomes
|
||||
end
|
||||
|
||||
function biomeinfo.get_v6_heat(pos)
|
||||
init_perlins()
|
||||
if not mgv6_perlin_biome then
|
||||
return nil
|
||||
end
|
||||
local bpos = vector.floor(pos)
|
||||
-- The temperature noise needs a special offset (see calculateNoise in mapgen_v6.cpp)
|
||||
return mgv6_perlin_biome:get_2d({x=bpos.x + mgv6_np_biome.spread.x*0.6, y=bpos.z + mgv6_np_biome.spread.z*0.2})
|
||||
end
|
||||
|
||||
function biomeinfo.get_v6_humidity(pos)
|
||||
init_perlins()
|
||||
if not mgv6_perlin_humidity then
|
||||
return nil
|
||||
end
|
||||
local bpos = vector.floor(pos)
|
||||
return mgv6_perlin_humidity:get_2d({x=bpos.x, y=bpos.z})
|
||||
end
|
||||
|
||||
-- Returns the v6 biome at pos.
|
||||
-- Returns a string representing the biome name.
|
||||
function biomeinfo.get_v6_biome(pos)
|
||||
init_perlins()
|
||||
local bpos = vector.floor(pos)
|
||||
-- Based on the algorithm MapgenV6::getBiome in mapgen_v6.cpp
|
||||
|
||||
local pos2d = {x=bpos.x, y=bpos.z}
|
||||
if not mgv6_perlin_biome or not mgv6_perlin_humidity then
|
||||
return "???"
|
||||
end
|
||||
local d = biomeinfo.get_v6_heat(bpos)
|
||||
local h = biomeinfo.get_v6_humidity(bpos)
|
||||
|
||||
if (v6_use_snow_biomes) then
|
||||
local blend
|
||||
if v6_use_biome_blend then
|
||||
blend = noise2d(pos2d.x, pos2d.y, seed) / 40
|
||||
else
|
||||
blend = 0
|
||||
end
|
||||
|
||||
if (d > MGV6_FREQ_HOT + blend) then
|
||||
if (h > MGV6_FREQ_JUNGLE + blend) then
|
||||
return BT_JUNGLE
|
||||
end
|
||||
return BT_DESERT
|
||||
end
|
||||
if (d < MGV6_FREQ_SNOW + blend) then
|
||||
if (h > MGV6_FREQ_TAIGA + blend) then
|
||||
return BT_TAIGA
|
||||
end
|
||||
return BT_TUNDRA
|
||||
end
|
||||
return BT_NORMAL
|
||||
end
|
||||
|
||||
if (d > v6_freq_desert) then
|
||||
return BT_DESERT
|
||||
end
|
||||
|
||||
if ((v6_use_biome_blend) and (d > v6_freq_desert - 0.10) and
|
||||
((noise2d(pos2d.x, pos2d.y, seed) + 1.0) > (v6_freq_desert - d) * 20.0)) then
|
||||
return BT_DESERT
|
||||
end
|
||||
|
||||
if ((v6_use_jungles) and (h > 0.75)) then
|
||||
return BT_JUNGLE
|
||||
end
|
||||
|
||||
return BT_NORMAL
|
||||
end
|
||||
|
||||
|
2
mods/CORE/biomeinfo/mod.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = biomeinfo
|
||||
description = Simple API to get data about biomes.
|
|
@ -7,15 +7,17 @@ minetest.check_single_for_falling = function(pos)
|
|||
local node = minetest.get_node(pos)
|
||||
if minetest.get_item_group(node.name, "attached_node_facedir") ~= 0 then
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local cpos = vector.add(pos, dir)
|
||||
local cnode = minetest.get_node(cpos)
|
||||
if minetest.get_item_group(cnode.name, "solid") == 0 then
|
||||
minetest.remove_node(pos)
|
||||
local drops = minetest.get_node_drops(node.name, "")
|
||||
for dr=1, #drops do
|
||||
minetest.add_item(pos, drops[dr])
|
||||
if dir then
|
||||
local cpos = vector.add(pos, dir)
|
||||
local cnode = minetest.get_node(cpos)
|
||||
if minetest.get_item_group(cnode.name, "solid") == 0 then
|
||||
minetest.remove_node(pos)
|
||||
local drops = minetest.get_node_drops(node.name, "")
|
||||
for dr=1, #drops do
|
||||
minetest.add_item(pos, drops[dr])
|
||||
end
|
||||
ret = true
|
||||
end
|
||||
ret = true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
name = mcl_autogroup
|
383
mods/CORE/mcl_explosions/init.lua
Normal file
|
@ -0,0 +1,383 @@
|
|||
--[[
|
||||
Explosion API mod for Minetest (adapted to MineClone 2)
|
||||
|
||||
This mod is based on the Minetest explosion API mod, but has been changed
|
||||
to have the same explosion mechanics as Minecraft and work with MineClone.
|
||||
The computation-intensive parts of the mod has been optimized to allow for
|
||||
larger explosions and faster world updating.
|
||||
|
||||
This mod was created by Elias Astrom <ryvnf@riseup.net> and is released
|
||||
under the LGPLv2.1 license.
|
||||
--]]
|
||||
|
||||
mcl_explosions = {}
|
||||
|
||||
local creative_mode = minetest.settings:get_bool("creative_mode")
|
||||
local mod_death_messages = minetest.get_modpath("mcl_death_messages") ~= nil
|
||||
local mod_fire = minetest.get_modpath("mcl_fire") ~= nil
|
||||
local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire")
|
||||
|
||||
local S = minetest.get_translator("mcl_explosions")
|
||||
|
||||
-- Saved sphere explosion shapes for various radiuses
|
||||
local sphere_shapes = {}
|
||||
|
||||
-- Saved node definitions in table using cid-keys for faster look-up.
|
||||
local node_blastres = {}
|
||||
local node_on_blast = {}
|
||||
local node_walkable = {}
|
||||
|
||||
-- The step length for the rays (Minecraft uses 0.3)
|
||||
local STEP_LENGTH = 0.3
|
||||
|
||||
-- How many rays to compute entity exposure to explosion
|
||||
local N_EXPOSURE_RAYS = 16
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
-- Store blast resistance values by content ids to improve performance.
|
||||
for name, def in pairs(minetest.registered_nodes) do
|
||||
node_blastres[minetest.get_content_id(name)] = def._mcl_blast_resistance or 0
|
||||
node_on_blast[minetest.get_content_id(name)] = def.on_blast
|
||||
node_walkable[minetest.get_content_id(name)] = def.walkable
|
||||
end
|
||||
end)
|
||||
|
||||
-- Compute the rays which make up a sphere with radius. Returns a list of rays
|
||||
-- which can be used to trace explosions. This function is not efficient
|
||||
-- (especially for larger radiuses), so the generated rays for various radiuses
|
||||
-- should be cached and reused.
|
||||
--
|
||||
-- Should be possible to improve by using a midpoint circle algorithm multiple
|
||||
-- times to create the sphere, currently uses more of a brute-force approach.
|
||||
local function compute_sphere_rays(radius)
|
||||
local rays = {}
|
||||
local sphere = {}
|
||||
|
||||
for i=1, 2 do
|
||||
for y = -radius, radius do
|
||||
for z = -radius, radius do
|
||||
for x = -radius, 0, 1 do
|
||||
local d = x * x + y * y + z * z
|
||||
if d <= radius * radius then
|
||||
local pos = { x = x, y = y, z = z }
|
||||
sphere[minetest.hash_node_position(pos)] = pos
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for i=1,2 do
|
||||
for x = -radius, radius do
|
||||
for z = -radius, radius do
|
||||
for y = -radius, 0, 1 do
|
||||
local d = x * x + y * y + z * z
|
||||
if d <= radius * radius then
|
||||
local pos = { x = x, y = y, z = z }
|
||||
sphere[minetest.hash_node_position(pos)] = pos
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for i=1,2 do
|
||||
for x = -radius, radius do
|
||||
for y = -radius, radius do
|
||||
for z = -radius, 0, 1 do
|
||||
local d = x * x + y * y + z * z
|
||||
if d <= radius * radius then
|
||||
local pos = { x = x, y = y, z = z }
|
||||
sphere[minetest.hash_node_position(pos)] = pos
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, pos in pairs(sphere) do
|
||||
rays[#rays + 1] = vector.normalize(pos)
|
||||
end
|
||||
|
||||
return rays
|
||||
end
|
||||
|
||||
-- Add particles from explosion
|
||||
--
|
||||
-- Parameters:
|
||||
-- pos - The position of the explosion
|
||||
-- radius - The radius of the explosion
|
||||
local function add_particles(pos, radius)
|
||||
minetest.add_particlespawner({
|
||||
amount = 64,
|
||||
time = 0.125,
|
||||
minpos = pos,
|
||||
maxpos = pos,
|
||||
minvel = {x = -radius, y = -radius, z = -radius},
|
||||
maxvel = {x = radius, y = radius, z = radius},
|
||||
minacc = vector.new(),
|
||||
maxacc = vector.new(),
|
||||
minexptime = 0.5,
|
||||
maxexptime = 1.0,
|
||||
minsize = radius * 0.5,
|
||||
maxsize = radius * 1.0,
|
||||
texture = "tnt_smoke.png",
|
||||
})
|
||||
end
|
||||
|
||||
-- Traces the rays of an explosion, and updates the environment.
|
||||
--
|
||||
-- Parameters:
|
||||
-- pos - Where the rays in the explosion should start from
|
||||
-- strength - The strength of each ray
|
||||
-- raydirs - The directions for each ray
|
||||
-- radius - The maximum distance each ray will go
|
||||
-- drop_chance - The chance that destroyed nodes will drop their items
|
||||
-- fire - If true, 1/3 of destroyed nodes become fire
|
||||
-- puncher - object that punches other objects (optional)
|
||||
--
|
||||
-- Note that this function has been optimized, it contains code which has been
|
||||
-- inlined to avoid function calls and unnecessary table creation. This was
|
||||
-- measured to give a significant performance increase.
|
||||
local function trace_explode(pos, strength, raydirs, radius, drop_chance, fire, puncher)
|
||||
local vm = minetest.get_voxel_manip()
|
||||
|
||||
local emin, emax = vm:read_from_map(vector.subtract(pos, radius),
|
||||
vector.add(pos, radius))
|
||||
local emin_x = emin.x
|
||||
local emin_y = emin.y
|
||||
local emin_z = emin.z
|
||||
|
||||
local ystride = (emax.x - emin_x + 1)
|
||||
local zstride = ystride * (emax.y - emin_y + 1)
|
||||
local pos_x = pos.x
|
||||
local pos_y = pos.y
|
||||
local pos_z = pos.z
|
||||
|
||||
local area = VoxelArea:new {
|
||||
MinEdge = emin,
|
||||
MaxEdge = emax
|
||||
}
|
||||
local data = vm:get_data()
|
||||
local destroy = {}
|
||||
|
||||
-- Trace rays for environment destruction
|
||||
for i = 1, #raydirs do
|
||||
local rpos_x = pos.x
|
||||
local rpos_y = pos.y
|
||||
local rpos_z = pos.z
|
||||
local rdir_x = raydirs[i].x
|
||||
local rdir_y = raydirs[i].y
|
||||
local rdir_z = raydirs[i].z
|
||||
local rstr = (0.7 + math.random() * 0.6) * strength
|
||||
|
||||
for r = 0, math.ceil(radius * (1.0 / STEP_LENGTH)) do
|
||||
local npos_x = math.floor(rpos_x + 0.5)
|
||||
local npos_y = math.floor(rpos_y + 0.5)
|
||||
local npos_z = math.floor(rpos_z + 0.5)
|
||||
local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride +
|
||||
npos_x - emin_x + 1
|
||||
|
||||
local cid = data[idx]
|
||||
local br = node_blastres[cid]
|
||||
local hash = (npos_z + 32768) * 65536 * 65536 +
|
||||
(npos_y + 32768) * 65536 +
|
||||
npos_x + 32768
|
||||
|
||||
rpos_x = rpos_x + STEP_LENGTH * rdir_x
|
||||
rpos_y = rpos_y + STEP_LENGTH * rdir_y
|
||||
rpos_z = rpos_z + STEP_LENGTH * rdir_z
|
||||
|
||||
rstr = rstr - 0.75 * STEP_LENGTH - (br + 0.3) * STEP_LENGTH
|
||||
|
||||
if rstr <= 0 then
|
||||
break
|
||||
end
|
||||
|
||||
if cid ~= minetest.CONTENT_AIR then
|
||||
destroy[hash] = idx
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Entities in radius of explosion
|
||||
local punch_radius = 2 * strength
|
||||
local objs = minetest.get_objects_inside_radius(pos, punch_radius)
|
||||
|
||||
-- Trace rays for entity damage
|
||||
for _, obj in pairs(objs) do
|
||||
local ent = obj:get_luaentity()
|
||||
|
||||
-- Ignore items to lower lag
|
||||
if obj:is_player() or (ent and ent.name ~= '__builtin.item') then
|
||||
local opos = obj:get_pos()
|
||||
local collisionbox = nil
|
||||
|
||||
if obj:is_player() then
|
||||
collisionbox = { -0.3, 0.0, -0.3, 0.3, 1.77, 0.3 }
|
||||
elseif ent.name then
|
||||
local def = minetest.registered_entities[ent.name]
|
||||
collisionbox = def.collisionbox
|
||||
end
|
||||
|
||||
if collisionbox then
|
||||
-- Create rays from random points in the collision box
|
||||
local x1 = collisionbox[1] * 2
|
||||
local y1 = collisionbox[2] * 2
|
||||
local z1 = collisionbox[3] * 2
|
||||
local x2 = collisionbox[4] * 2
|
||||
local y2 = collisionbox[5] * 2
|
||||
local z2 = collisionbox[6] * 2
|
||||
local x_len = math.abs(x2 - x1)
|
||||
local y_len = math.abs(y2 - y1)
|
||||
local z_len = math.abs(z2 - z1)
|
||||
|
||||
-- Move object position to the center of its bounding box
|
||||
opos.x = opos.x + x1 + x2
|
||||
opos.y = opos.y + y1 + y2
|
||||
opos.z = opos.z + z1 + z2
|
||||
|
||||
-- Count number of rays from collision box which are unobstructed
|
||||
local count = N_EXPOSURE_RAYS
|
||||
|
||||
for i = 1, N_EXPOSURE_RAYS do
|
||||
local rpos_x = opos.x + math.random() * x_len - x_len / 2
|
||||
local rpos_y = opos.y + math.random() * y_len - y_len / 2
|
||||
local rpos_z = opos.z + math.random() * z_len - z_len / 2
|
||||
local rdir_x = pos.x - rpos_x
|
||||
local rdir_y = pos.y - rpos_y
|
||||
local rdir_z = pos.z - rpos_z
|
||||
local rdir_len = math.hypot(rdir_x, math.hypot(rdir_y, rdir_z))
|
||||
rdir_x = rdir_x / rdir_len
|
||||
rdir_y = rdir_y / rdir_len
|
||||
rdir_z = rdir_z / rdir_len
|
||||
|
||||
for i=0, rdir_len / STEP_LENGTH do
|
||||
rpos_x = rpos_x + rdir_x * STEP_LENGTH
|
||||
rpos_y = rpos_y + rdir_y * STEP_LENGTH
|
||||
rpos_z = rpos_z + rdir_z * STEP_LENGTH
|
||||
local npos_x = math.floor(rpos_x + 0.5)
|
||||
local npos_y = math.floor(rpos_y + 0.5)
|
||||
local npos_z = math.floor(rpos_z + 0.5)
|
||||
local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride +
|
||||
npos_x - emin_x + 1
|
||||
|
||||
|
||||
local cid = data[idx]
|
||||
local walkable = node_walkable[cid]
|
||||
|
||||
if walkable then
|
||||
count = count - 1
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Punch entity with damage depending on explosion exposure and
|
||||
-- distance to explosion
|
||||
local exposure = count / N_EXPOSURE_RAYS
|
||||
local punch_vec = vector.subtract(opos, pos)
|
||||
local punch_dir = vector.normalize(punch_vec)
|
||||
local impact = (1 - vector.length(punch_vec) / punch_radius) * exposure
|
||||
if impact < 0 then
|
||||
impact = 0
|
||||
end
|
||||
local damage = math.floor((impact * impact + impact) * 7 * strength + 1)
|
||||
if mod_death_messages and obj:is_player() then
|
||||
mcl_death_messages.player_damage(obj, S("@1 was caught in an explosion.", obj:get_player_name()))
|
||||
end
|
||||
local source = puncher
|
||||
if not source then
|
||||
source = obj
|
||||
end
|
||||
obj:punch(source, 10, { damage_groups = { full_punch_interval = 1,
|
||||
fleshy = damage, knockback = impact * 20.0 } }, punch_dir)
|
||||
|
||||
if obj:is_player() then
|
||||
obj:add_player_velocity(vector.multiply(punch_dir, impact * 20))
|
||||
elseif ent.tnt_knockback then
|
||||
obj:add_velocity(vector.multiply(punch_dir, impact * 20))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove destroyed blocks and drop items
|
||||
for hash, idx in pairs(destroy) do
|
||||
local do_drop = not creative_mode and math.random() <= drop_chance
|
||||
local on_blast = node_on_blast[data[idx]]
|
||||
local remove = true
|
||||
|
||||
if do_drop or on_blast ~= nil then
|
||||
local npos = minetest.get_position_from_hash(hash)
|
||||
if on_blast ~= nil then
|
||||
remove = on_blast(npos, 1.0)
|
||||
else
|
||||
local name = minetest.get_name_from_content_id(data[idx])
|
||||
local drop = minetest.get_node_drops(name, "")
|
||||
|
||||
for _, item in ipairs(drop) do
|
||||
if type(item) ~= "string" then
|
||||
item = item:get_name() .. item:get_count()
|
||||
end
|
||||
minetest.add_item(npos, item)
|
||||
end
|
||||
end
|
||||
end
|
||||
if remove then
|
||||
if mod_fire and fire and math.random(1, 3) == 1 then
|
||||
data[idx] = CONTENT_FIRE
|
||||
else
|
||||
data[idx] = minetest.CONTENT_AIR
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Log explosion
|
||||
minetest.log('action', 'Explosion at ' .. minetest.pos_to_string(pos) ..
|
||||
' with strength ' .. strength .. ' and radius ' .. radius)
|
||||
|
||||
-- Update environment
|
||||
vm:set_data(data)
|
||||
vm:write_to_map(data)
|
||||
vm:update_liquids()
|
||||
end
|
||||
|
||||
-- Create an explosion with strength at pos.
|
||||
--
|
||||
-- Parameters:
|
||||
-- pos - The position where the explosion originates from
|
||||
-- strength - The blast strength of the explosion (a TNT explosion uses 4)
|
||||
-- info - Table containing information about explosion.
|
||||
-- puncher - object that is reported as source of punches/damage (optional)
|
||||
--
|
||||
-- Values in info:
|
||||
-- drop_chance - If specified becomes the drop chance of all nodes in the
|
||||
-- explosion (defaults to 1.0 / strength)
|
||||
-- no_sound - If true then the explosion will not play a sound
|
||||
-- no_particle - If true then the explosion will not create particles
|
||||
-- fire - If true, 1/3 nodes become fire (default: false)
|
||||
function mcl_explosions.explode(pos, strength, info, puncher)
|
||||
-- The maximum blast radius (in the air)
|
||||
local radius = math.ceil(1.3 * strength / (0.3 * 0.75) * 0.3)
|
||||
|
||||
if not sphere_shapes[radius] then
|
||||
sphere_shapes[radius] = compute_sphere_rays(radius)
|
||||
end
|
||||
local shape = sphere_shapes[radius]
|
||||
|
||||
trace_explode(pos, strength, shape, radius, (info and info.drop_chance) or 1 / strength, info.fire == true, puncher)
|
||||
|
||||
if not (info and info.no_sound) then
|
||||
add_particles(pos, radius)
|
||||
end
|
||||
if not (info and info.no_particle) then
|
||||
minetest.sound_play("tnt_explode", {
|
||||
pos = pos, gain = 1.0,
|
||||
max_hear_distance = strength * 16
|
||||
}, true)
|
||||
end
|
||||
end
|
2
mods/CORE/mcl_explosions/locale/mcl_explosions.de.tr
Normal file
|
@ -0,0 +1,2 @@
|
|||
# textdomain:mcl_explosions
|
||||
@1 was caught in an explosion.=@1 wurde Opfer einer Explosion.
|
2
mods/CORE/mcl_explosions/locale/template.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
# textdomain:mcl_explosions
|
||||
@1 was caught in an explosion.=
|
3
mods/CORE/mcl_explosions/mod.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
name = mcl_explosions
|
||||
description = A common API to create explosions.
|
||||
optional_depends = mcl_fire
|
|
@ -1,17 +1,31 @@
|
|||
-- Some global variables (don't overwrite them!)
|
||||
mcl_vars = {}
|
||||
|
||||
--- GUI / inventory menu colors
|
||||
--- GUI / inventory menu settings
|
||||
mcl_vars.gui_slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]"
|
||||
mcl_vars.gui_bg = "bgcolor[#080808BB;true]"
|
||||
mcl_vars.gui_bg_img = ""
|
||||
-- nonbg is added as formspec prepend in mcl_formspec_prepend
|
||||
mcl_vars.gui_nonbg = mcl_vars.gui_slots ..
|
||||
"style_type[image_button;border=false;bgimg=mcl_inventory_button9.png;bgimg_pressed=mcl_inventory_button9_pressed.png;bgimg_middle=2,2]"..
|
||||
"style_type[button;border=false;bgimg=mcl_inventory_button9.png;bgimg_pressed=mcl_inventory_button9_pressed.png;bgimg_middle=2,2]"..
|
||||
"style_type[field;textcolor=#323232]"..
|
||||
"style_type[label;textcolor=#323232]"..
|
||||
"style_type[textarea;textcolor=#323232]"..
|
||||
"style_type[checkbox;textcolor=#323232]"
|
||||
|
||||
mcl_vars.inventory_header = mcl_vars.gui_slots .. mcl_vars.gui_bg
|
||||
-- Background stuff must be manually added by mods (no formspec prepend)
|
||||
mcl_vars.gui_bg_color = "bgcolor[#00000000]"
|
||||
mcl_vars.gui_bg_img = "background9[1,1;1,1;mcl_base_textures_background9.png;true;7]"
|
||||
|
||||
-- Legacy
|
||||
mcl_vars.inventory_header = ""
|
||||
|
||||
-- Mapgen variables
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
local minecraft_height_limit = 256
|
||||
if mg_name ~= "flat" then
|
||||
local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true"
|
||||
|
||||
if not superflat then
|
||||
-- Normal mode
|
||||
--[[ Realm stacking (h is for height)
|
||||
- Overworld (h>=256)
|
||||
- Void (h>=1000)
|
||||
|
@ -32,17 +46,13 @@ if mg_name ~= "flat" then
|
|||
mcl_vars.mg_bedrock_is_rough = true
|
||||
|
||||
else
|
||||
-- Classic superflat
|
||||
local ground = minetest.get_mapgen_setting("mgflat_ground_level")
|
||||
ground = tonumber(ground)
|
||||
if not ground then
|
||||
ground = 8
|
||||
end
|
||||
-- 1 perfectly flat bedrock layer
|
||||
if minetest.get_mapgen_setting("mcl_superflat_classic") == "false" then
|
||||
mcl_vars.mg_overworld_min = -30912
|
||||
else
|
||||
mcl_vars.mg_overworld_min = ground - 3
|
||||
end
|
||||
mcl_vars.mg_overworld_min = ground - 3
|
||||
mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit
|
||||
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
|
||||
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min
|
||||
|
@ -58,21 +68,31 @@ mcl_vars.mg_nether_min = -29067 -- Carefully chosen to be at a mapchunk border
|
|||
mcl_vars.mg_nether_max = mcl_vars.mg_nether_min + 128
|
||||
mcl_vars.mg_bedrock_nether_bottom_min = mcl_vars.mg_nether_min
|
||||
mcl_vars.mg_bedrock_nether_top_max = mcl_vars.mg_nether_max
|
||||
mcl_vars.mg_lava_nether_max = mcl_vars.mg_nether_min + 31
|
||||
if mg_name ~= "flat" then
|
||||
if not superflat then
|
||||
mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min + 4
|
||||
mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max - 4
|
||||
mcl_vars.mg_lava_nether_max = mcl_vars.mg_nether_min + 31
|
||||
else
|
||||
-- Thin bedrock in flat mapgen
|
||||
-- Thin bedrock in classic superflat mapgen
|
||||
mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min
|
||||
mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max
|
||||
mcl_vars.mg_lava_nether_max = mcl_vars.mg_nether_min + 2
|
||||
end
|
||||
if mg_name == "flat" then
|
||||
if superflat then
|
||||
mcl_vars.mg_flat_nether_floor = mcl_vars.mg_bedrock_nether_bottom_max + 4
|
||||
mcl_vars.mg_flat_nether_ceiling = mcl_vars.mg_bedrock_nether_bottom_max + 52
|
||||
else
|
||||
mcl_vars.mg_flat_nether_floor = mcl_vars.mg_lava_nether_max + 4
|
||||
mcl_vars.mg_flat_nether_ceiling = mcl_vars.mg_lava_nether_max + 52
|
||||
end
|
||||
end
|
||||
|
||||
-- The End (surface at ca. Y = -27000)
|
||||
mcl_vars.mg_end_min = -27073 -- Carefully chosen to be at a mapchunk border
|
||||
mcl_vars.mg_end_max_official = mcl_vars.mg_end_min + minecraft_height_limit
|
||||
mcl_vars.mg_end_max = mcl_vars.mg_overworld_min - 2000
|
||||
mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 80, z = 0 }
|
||||
mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 74, z = 0 }
|
||||
|
||||
-- Realm barrier used to safely separate the End from the void below the Overworld
|
||||
mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max
|
||||
|
|
|
@ -98,3 +98,54 @@ function mcl_loot.get_multi_loot(multi_loot_definitions, pr)
|
|||
end
|
||||
return items
|
||||
end
|
||||
|
||||
--[[
|
||||
Returns a table of length `max_slot` and all natural numbers between 1 and `max_slot`
|
||||
in a random order.
|
||||
]]
|
||||
local function get_random_slots(max_slot)
|
||||
local slots = {}
|
||||
for s=1, max_slot do
|
||||
slots[s] = s
|
||||
end
|
||||
local slots_out = {}
|
||||
while #slots > 0 do
|
||||
local r = math.random(1, #slots)
|
||||
table.insert(slots_out, slots[r])
|
||||
table.remove(slots, r)
|
||||
end
|
||||
return slots_out
|
||||
end
|
||||
|
||||
--[[
|
||||
Puts items in an inventory list into random slots.
|
||||
* inv: InvRef
|
||||
* listname: Inventory list name
|
||||
* items: table of items to add
|
||||
|
||||
Items will be added from start of the table to end.
|
||||
If the inventory already has occupied slots, or is
|
||||
too small, placement of some items might fail.
|
||||
]]
|
||||
function mcl_loot.fill_inventory(inv, listname, items)
|
||||
local size = inv:get_size(listname)
|
||||
local slots = get_random_slots(size)
|
||||
local leftovers = {}
|
||||
-- 1st pass: Add items into random slots
|
||||
for i=1, math.min(#items, size) do
|
||||
local item = items[i]
|
||||
local slot = slots[i]
|
||||
local old_item = inv:get_stack(listname, slot)
|
||||
local leftover = old_item:add_item(item)
|
||||
inv:set_stack(listname, slot, old_item)
|
||||
if not leftover:is_empty() then
|
||||
table.insert(leftovers, item)
|
||||
end
|
||||
end
|
||||
-- 2nd pass: If some items couldn't be added in first pass,
|
||||
-- try again in a non-random fashion
|
||||
for l=1, math.min(#leftovers, size) do
|
||||
inv:add_item(listname, leftovers[l])
|
||||
end
|
||||
-- If there are still items left, tough luck!
|
||||
end
|
||||
|
|
Before Width: | Height: | Size: 938 B After Width: | Height: | Size: 171 B |
|
@ -4,6 +4,9 @@ Licenses of sounds
|
|||
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
http://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
Creative Commons Attribution 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
|
@ -67,10 +70,13 @@ blukotek (CC0 1.0)
|
|||
https://www.freesound.org/people/blukotek/sounds/251660/
|
||||
default_dig_snappy.ogg
|
||||
|
||||
sonictechtonic (CC BY 3.0)
|
||||
https://www.freesound.org/people/sonictechtonic/sounds/241872/
|
||||
player_damage.ogg
|
||||
|
||||
Voxelands project <http://www.voxelands.com/> (CC BY-SA 3.0)
|
||||
mcl_sounds_place_node_water.ogg
|
||||
mcl_sounds_dug_water.ogg
|
||||
player_damage.ogg
|
||||
|
||||
(Note: Artists from the Voxelands project include: sdzen, darkrose, sapier,
|
||||
Tom Peter, Telaron, juskiddink)
|
||||
|
@ -83,5 +89,9 @@ Adam_N (CC0 1.0):
|
|||
player_falling_damage.ogg
|
||||
Source: <https://www.freesound.org/people/Adam_N/sounds/346692/>
|
||||
|
||||
Alecia Shepherd (CC BY-SA 4.0):
|
||||
mcl_sounds_cloth.ogg
|
||||
Source: SnowSong sound and music pack <https://opengameart.org/content/snowsong-sound-and-music-pack>
|
||||
|
||||
Unknown authors (WTFPL):
|
||||
pedology_snow_soft_footstep.*.ogg
|
||||
|
|
|
@ -97,6 +97,20 @@ function mcl_sounds.node_sound_wood_defaults(table)
|
|||
return table
|
||||
end
|
||||
|
||||
function mcl_sounds.node_sound_wool_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name="mcl_sounds_cloth", gain=0.5}
|
||||
table.dug = table.dug or
|
||||
{name="mcl_sounds_cloth", gain=1.0}
|
||||
table.dig = table.dig or
|
||||
{name="mcl_sounds_cloth", gain=0.9}
|
||||
table.place = table.dig or
|
||||
{name="mcl_sounds_cloth", gain=1.0}
|
||||
mcl_sounds.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
||||
function mcl_sounds.node_sound_leaves_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
|
@ -150,5 +164,5 @@ end
|
|||
-- Player death sound
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
-- TODO: Add separate death sound
|
||||
minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16})
|
||||
minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16}, true)
|
||||
end)
|
||||
|
|
BIN
mods/CORE/mcl_sounds/sounds/mcl_sounds_cloth.1.ogg
Normal file
BIN
mods/CORE/mcl_sounds/sounds/mcl_sounds_cloth.2.ogg
Normal file
BIN
mods/CORE/mcl_sounds/sounds/mcl_sounds_cloth.3.ogg
Normal file
BIN
mods/CORE/mcl_sounds/sounds/mcl_sounds_cloth.4.ogg
Normal file
|
@ -149,7 +149,7 @@ function mcl_util.get_eligible_transfer_item_slot(src_inventory, src_list, dst_i
|
|||
return nil
|
||||
end
|
||||
|
||||
-- Returns true if given itemstack is a shulker box
|
||||
-- Returns true if itemstack is a shulker box
|
||||
local is_not_shulker_box = function(itemstack)
|
||||
local g = minetest.get_item_group(itemstack:get_name(), "shulker_box")
|
||||
return g == 0 or g == nil
|
||||
|
@ -174,14 +174,15 @@ function mcl_util.move_item(source_inventory, source_list, source_stack_id, dest
|
|||
|
||||
if not source_inventory:is_empty(source_list) then
|
||||
local stack = source_inventory:get_stack(source_list, source_stack_id)
|
||||
local item = stack:get_name()
|
||||
if not stack:is_empty() then
|
||||
if not destination_inventory:room_for_item(destination_list, item) then
|
||||
local new_stack = ItemStack(stack)
|
||||
new_stack:set_count(1)
|
||||
if not destination_inventory:room_for_item(destination_list, new_stack) then
|
||||
return false
|
||||
end
|
||||
stack:take_item()
|
||||
source_inventory:set_stack(source_list, source_stack_id, stack)
|
||||
destination_inventory:add_item(destination_list, item)
|
||||
destination_inventory:add_item(destination_list, new_stack)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
@ -205,6 +206,11 @@ function mcl_util.move_item_container(source_pos, destination_pos, source_list,
|
|||
local dctype = minetest.get_item_group(dnode.name, "container")
|
||||
local sctype = minetest.get_item_group(snode.name, "container")
|
||||
|
||||
-- Container type 7 does not allow any movement
|
||||
if sctype == 7 then
|
||||
return false
|
||||
end
|
||||
|
||||
-- Normalize double container by forcing to always use the left segment first
|
||||
local normalize_double_container = function(pos, node, ctype)
|
||||
if ctype == 6 then
|
||||
|
@ -235,7 +241,7 @@ function mcl_util.move_item_container(source_pos, destination_pos, source_list,
|
|||
-- Default source lists
|
||||
if not source_list then
|
||||
-- Main inventory for most container types
|
||||
if sctype == 2 or sctype == 3 or sctype == 5 or sctype == 6 then
|
||||
if sctype == 2 or sctype == 3 or sctype == 5 or sctype == 6 or sctype == 7 then
|
||||
source_list = "main"
|
||||
-- Furnace: output
|
||||
elseif sctype == 4 then
|
||||
|
@ -281,13 +287,17 @@ function mcl_util.move_item_container(source_pos, destination_pos, source_list,
|
|||
return false
|
||||
end
|
||||
end
|
||||
-- Container type 7 does not allow any placement
|
||||
if dctype == 7 then
|
||||
return false
|
||||
end
|
||||
|
||||
-- If it's a container, put it into the container
|
||||
if dctype ~= 0 then
|
||||
-- Automatically select a destination list if omitted
|
||||
if not destination_list then
|
||||
-- Main inventory for most container types
|
||||
if dctype == 2 or dctype == 3 or dctype == 5 or dctype == 6 then
|
||||
if dctype == 2 or dctype == 3 or dctype == 5 or dctype == 6 or dctype == 7 then
|
||||
destination_list = "main"
|
||||
-- Furnace source slot
|
||||
elseif dctype == 4 then
|
||||
|
@ -375,7 +385,7 @@ function mcl_util.generate_on_place_plant_function(condition)
|
|||
|
||||
if success then
|
||||
if idef.sounds and idef.sounds.place then
|
||||
minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1})
|
||||
minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}, true)
|
||||
end
|
||||
end
|
||||
itemstack = new_itemstack
|
||||
|
|
2
mods/CORE/modpack.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = CORE
|
||||
description = Meta-modpack containing the core mods for MineClone 2 for core APIs, variables and definitions
|
|
@ -1,11 +1,11 @@
|
|||
WalkOver
|
||||
Walkover
|
||||
--------
|
||||
|
||||
Some mode developers have shown an interest in having an on_walk_over event. This is useful for pressure-plates and the like.
|
||||
Some mode developers have shown an interest in having an `on_walk_over` event. This is useful for pressure-plates and the like.
|
||||
|
||||
See this issue - https://github.com/minetest/minetest/issues/247
|
||||
|
||||
I have implemented a server_side version in lua using globalstep which people might find useful. Of course this would better implemented via a client-based "on walk over", but it is sufficient for my needs now.
|
||||
I have implemented a server-side version in Lua using globalstep which people might find useful. Of course this would better implemented via a client-based "on walk over", but it is sufficient for my needs now.
|
||||
|
||||
Example Usage
|
||||
-------------
|
||||
|
@ -19,3 +19,6 @@ Example Usage
|
|||
})
|
||||
|
||||
|
||||
Credits
|
||||
-------
|
||||
Mod created by lordfingle, licensed under Apache License 2.0.
|
||||
|
|
|
@ -4,7 +4,7 @@ minetest.register_globalstep(function(dtime)
|
|||
timer = timer + dtime;
|
||||
if timer >= 0.3 then
|
||||
for _,player in pairs(minetest.get_connected_players()) do
|
||||
local pp = player:getpos()
|
||||
local pp = player:get_pos()
|
||||
pp.y = math.ceil(pp.y)
|
||||
local loc = vector.add(pp, {x=0,y=-1,z=0})
|
||||
if loc ~= nil then
|
||||
|
|
|
@ -12,32 +12,34 @@ minetest.register_entity("drippingwater:drop_water", {
|
|||
hp_max = 1,
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
collisionbox = {-0.025,-0.05,-0.025,0.025,-0.01,0.025},
|
||||
pointable = false,
|
||||
visual = "cube",
|
||||
visual_size = {x=0.05, y=0.1},
|
||||
textures = {water_tex, water_tex, water_tex, water_tex, water_tex, water_tex},
|
||||
spritediv = {x=1, y=1},
|
||||
initial_sprite_basepos = {x=0, y=0},
|
||||
static_save = false,
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:setsprite({x=0,y=0}, 1, 1, true)
|
||||
self.object:set_sprite({x=0,y=0}, 1, 1, true)
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
local k = math.random(1,222)
|
||||
local ownpos = self.object:getpos()
|
||||
local ownpos = self.object:get_pos()
|
||||
|
||||
if k==1 then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
||||
self.object:remove()
|
||||
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
|
||||
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -50,33 +52,36 @@ minetest.register_entity("drippingwater:drop_lava", {
|
|||
hp_max = 1,
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
collisionbox = {-0.025,-0.05,-0.025,0.025,-0.01,0.025},
|
||||
glow = math.max(7, minetest.registered_nodes["mcl_core:lava_source"].light_source - 3),
|
||||
pointable = false,
|
||||
visual = "cube",
|
||||
visual_size = {x=0.05, y=0.1},
|
||||
textures = {lava_tex, lava_tex, lava_tex, lava_tex, lava_tex, lava_tex},
|
||||
spritediv = {x=1, y=1},
|
||||
initial_sprite_basepos = {x=0, y=0},
|
||||
static_save = false,
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:setsprite({x=0,y=0}, 1, 0, true)
|
||||
self.object:set_sprite({x=0,y=0}, 1, 0, true)
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
local k = math.random(1,222)
|
||||
local ownpos = self.object:getpos()
|
||||
local ownpos = self.object:get_pos()
|
||||
|
||||
if k==1 then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
||||
self.object:remove()
|
||||
minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
|
||||
minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -88,7 +93,7 @@ minetest.register_entity("drippingwater:drop_lava", {
|
|||
minetest.register_abm(
|
||||
{
|
||||
label = "Create water drops",
|
||||
nodenames = {"group:solid"},
|
||||
nodenames = {"group:opaque", "group:leaves"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 2,
|
||||
chance = 22,
|
||||
|
@ -106,7 +111,7 @@ minetest.register_abm(
|
|||
minetest.register_abm(
|
||||
{
|
||||
label = "Create lava drops",
|
||||
nodenames = {"group:solid"},
|
||||
nodenames = {"group:opaque"},
|
||||
neighbors = {"group:lava"},
|
||||
interval = 2,
|
||||
chance = 22,
|
||||
|
|
|
@ -10,8 +10,7 @@ License of boat model:
|
|||
GNU GPLv3 <https://www.gnu.org/licenses/gpl-3.0.html>
|
||||
|
||||
## Textures
|
||||
All textures are from the Faithful texture pack for Minecraft.
|
||||
See the main MineClone 2 license to learn more.
|
||||
See the main MineClone 2 README.md file to learn more.
|
||||
|
||||
## Code
|
||||
Code based on Minetest Game, licensed under the MIT License (MIT).
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
local S = minetest.get_translator("mcl_boats")
|
||||
--
|
||||
-- Helper functions
|
||||
--
|
||||
|
@ -33,6 +34,8 @@ local boat_visual_size = {x = 3, y = 3}
|
|||
local driver_visual_size = { x = 1/boat_visual_size.x, y = 1/boat_visual_size.y }
|
||||
local paddling_speed = 22
|
||||
local boat_y_offset = 0.35
|
||||
local boat_y_offset_ground = boat_y_offset + 0.6
|
||||
local boat_side_offset = 1.001
|
||||
|
||||
--
|
||||
-- Boat entity
|
||||
|
@ -67,9 +70,9 @@ function boat.on_rightclick(self, clicker)
|
|||
clicker:set_properties({visual_size = {x=1, y=1}})
|
||||
mcl_player.player_attached[name] = false
|
||||
mcl_player.player_set_animation(clicker, "stand" , 30)
|
||||
local pos = clicker:getpos()
|
||||
local pos = clicker:get_pos()
|
||||
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
||||
clicker:setpos(pos)
|
||||
clicker:set_pos(pos)
|
||||
elseif not self._driver then
|
||||
local attach = clicker:get_attach()
|
||||
if attach and attach:get_luaentity() then
|
||||
|
@ -82,15 +85,16 @@ function boat.on_rightclick(self, clicker)
|
|||
end
|
||||
self._driver = clicker
|
||||
clicker:set_attach(self.object, "",
|
||||
{x = 0, y = 3.75, z = -1}, {x = 0, y = 0, z = 0})
|
||||
{x = 0, y = 0.42, z = -1}, {x = 0, y = 0, z = 0})
|
||||
clicker:set_properties({ visual_size = driver_visual_size })
|
||||
mcl_player.player_attached[name] = true
|
||||
minetest.after(0.2, function(clicker)
|
||||
if clicker:is_player() then
|
||||
mcl_player.player_set_animation(clicker, "sit" , 30)
|
||||
minetest.after(0.2, function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
mcl_player.player_set_animation(player, "sit" , 30)
|
||||
end
|
||||
end, clicker)
|
||||
clicker:set_look_horizontal(self.object:getyaw())
|
||||
end, name)
|
||||
clicker:set_look_horizontal(self.object:get_yaw())
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -130,20 +134,41 @@ function boat.on_punch(self, puncher)
|
|||
self._removed = true
|
||||
-- Drop boat as item on the ground after punching
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
minetest.add_item(self.object:getpos(), self._itemstring)
|
||||
minetest.add_item(self.object:get_pos(), self._itemstring)
|
||||
else
|
||||
local inv = puncher:get_inventory()
|
||||
if not inv:contains_item("main", self._itemstring) then
|
||||
inv:add_item("main", self._itemstring)
|
||||
end
|
||||
end
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
|
||||
function boat.on_step(self, dtime)
|
||||
self._v = get_v(self.object:getvelocity()) * get_sign(self._v)
|
||||
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
|
||||
local on_water = true
|
||||
local in_water = false
|
||||
local v_factor = 1
|
||||
local v_slowdown = 0.02
|
||||
local p = self.object:get_pos()
|
||||
if (not is_water({x=p.x, y=p.y-boat_y_offset, z=p.z})) then
|
||||
on_water = false
|
||||
v_factor = 0.5
|
||||
v_slowdown = 0.04
|
||||
elseif (is_water({x=p.x, y=p.y-boat_y_offset+1, z=p.z})) then
|
||||
on_water = false
|
||||
in_water = true
|
||||
v_factor = 0.75
|
||||
v_slowdown = 0.05
|
||||
end
|
||||
|
||||
if self._driver then
|
||||
local ctrl = self._driver:get_player_control()
|
||||
local yaw = self.object:getyaw()
|
||||
local yaw = self.object:get_yaw()
|
||||
if ctrl.up then
|
||||
-- Forwards
|
||||
self._v = self._v + 0.1
|
||||
self._v = self._v + 0.1 * v_factor
|
||||
|
||||
-- Paddling animation
|
||||
if self._animation ~= 1 then
|
||||
|
@ -152,7 +177,7 @@ function boat.on_step(self, dtime)
|
|||
end
|
||||
elseif ctrl.down then
|
||||
-- Backwards
|
||||
self._v = self._v - 0.1
|
||||
self._v = self._v - 0.1 * v_factor
|
||||
|
||||
-- Paddling animation, reversed
|
||||
if self._animation ~= -1 then
|
||||
|
@ -168,15 +193,15 @@ function boat.on_step(self, dtime)
|
|||
end
|
||||
if ctrl.left then
|
||||
if self._v < 0 then
|
||||
self.object:setyaw(yaw - (1 + dtime) * 0.03)
|
||||
self.object:set_yaw(yaw - (1 + dtime) * 0.03 * v_factor)
|
||||
else
|
||||
self.object:setyaw(yaw + (1 + dtime) * 0.03)
|
||||
self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor)
|
||||
end
|
||||
elseif ctrl.right then
|
||||
if self._v < 0 then
|
||||
self.object:setyaw(yaw + (1 + dtime) * 0.03)
|
||||
self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor)
|
||||
else
|
||||
self.object:setyaw(yaw - (1 + dtime) * 0.03)
|
||||
self.object:set_yaw(yaw - (1 + dtime) * 0.03 * v_factor)
|
||||
end
|
||||
end
|
||||
else
|
||||
|
@ -186,73 +211,65 @@ function boat.on_step(self, dtime)
|
|||
self._animation = 0
|
||||
end
|
||||
end
|
||||
local velo = self.object:getvelocity()
|
||||
if self._v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
|
||||
self.object:setpos(self.object:getpos())
|
||||
return
|
||||
end
|
||||
local s = get_sign(self._v)
|
||||
self._v = self._v - 0.02 * s
|
||||
if s ~= get_sign(self._v) then
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self._v = 0
|
||||
return
|
||||
if not on_water and not in_water and math.abs(self._v) > 1.0 then
|
||||
v_slowdown = math.min(math.abs(self._v) - 1.0, v_slowdown * 5)
|
||||
elseif in_water and math.abs(self._v) > 1.5 then
|
||||
v_slowdown = math.min(math.abs(self._v) - 1.5, v_slowdown * 5)
|
||||
end
|
||||
if math.abs(self._v) > 5 then
|
||||
self._v = 5 * get_sign(self._v)
|
||||
self._v = self._v - v_slowdown * s
|
||||
if s ~= get_sign(self._v) then
|
||||
self._v = 0
|
||||
end
|
||||
|
||||
local p = self.object:getpos()
|
||||
p.y = p.y - boat_y_offset
|
||||
local new_velo
|
||||
local new_acce = {x = 0, y = 0, z = 0}
|
||||
if not is_water(p) then
|
||||
-- Not on water or inside water: Free fall
|
||||
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
|
||||
if (not nodedef) or nodedef.walkable then
|
||||
self._v = 0
|
||||
new_acce = {x = 0, y = 1, z = 0}
|
||||
else
|
||||
new_acce = {x = 0, y = -9.8, z = 0}
|
||||
end
|
||||
new_velo = get_velocity(self._v, self.object:getyaw(),
|
||||
self.object:getvelocity().y)
|
||||
self.object:setpos(self.object:getpos())
|
||||
new_acce = {x = 0, y = -9.8, z = 0}
|
||||
new_velo = get_velocity(self._v, self.object:get_yaw(),
|
||||
self.object:get_velocity().y)
|
||||
else
|
||||
p.y = p.y + 1
|
||||
if is_water(p) then
|
||||
local y = self.object:getvelocity().y
|
||||
if y >= 5 then
|
||||
y = 5
|
||||
elseif y < 0 then
|
||||
new_acce = {x = 0, y = 20, z = 0}
|
||||
else
|
||||
new_acce = {x = 0, y = 5, z = 0}
|
||||
-- Inside water: Slowly sink
|
||||
local y = self.object:get_velocity().y
|
||||
y = y - 0.01
|
||||
if y < -0.2 then
|
||||
y = -0.2
|
||||
end
|
||||
new_velo = get_velocity(self._v, self.object:getyaw(), y)
|
||||
self.object:setpos(self.object:getpos())
|
||||
else
|
||||
new_acce = {x = 0, y = 0, z = 0}
|
||||
if math.abs(self.object:getvelocity().y) < 1 then
|
||||
local pos = self.object:getpos()
|
||||
pos.y = math.floor(pos.y) + boat_y_offset
|
||||
self.object:setpos(pos)
|
||||
new_velo = get_velocity(self._v, self.object:getyaw(), 0)
|
||||
new_velo = get_velocity(self._v, self.object:get_yaw(), y)
|
||||
else
|
||||
-- On top of water
|
||||
new_acce = {x = 0, y = 0, z = 0}
|
||||
if math.abs(self.object:get_velocity().y) < 0 then
|
||||
new_velo = get_velocity(self._v, self.object:get_yaw(), 0)
|
||||
else
|
||||
new_velo = get_velocity(self._v, self.object:getyaw(),
|
||||
self.object:getvelocity().y)
|
||||
self.object:setpos(self.object:getpos())
|
||||
new_velo = get_velocity(self._v, self.object:get_yaw(),
|
||||
self.object:get_velocity().y)
|
||||
end
|
||||
end
|
||||
end
|
||||
self.object:setvelocity(new_velo)
|
||||
self.object:setacceleration(new_acce)
|
||||
|
||||
-- Terminal velocity: 8 m/s per axis of travel
|
||||
for _,axis in pairs({"z","y","x"}) do
|
||||
if math.abs(new_velo[axis]) > 8 then
|
||||
new_velo[axis] = 8 * get_sign(new_velo[axis])
|
||||
end
|
||||
end
|
||||
|
||||
self.object:set_velocity(new_velo)
|
||||
self.object:set_acceleration(new_acce)
|
||||
end
|
||||
|
||||
-- Register one entity for all boat types
|
||||
minetest.register_entity("mcl_boats:boat", boat)
|
||||
|
||||
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak" }
|
||||
local names = { "Oak Boat", "Spruce Boat", "Birch Boat", "Jungle Boat", "Acacia Boat", "Dark Oak Boat" }
|
||||
local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat") }
|
||||
local craftstuffs = {}
|
||||
if minetest.get_modpath("mcl_core") then
|
||||
craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood" }
|
||||
|
@ -262,18 +279,20 @@ local images = { "oak", "spruce", "birch", "jungle", "acacia", "dark_oak" }
|
|||
for b=1, #boat_ids do
|
||||
local itemstring = "mcl_boats:"..boat_ids[b]
|
||||
|
||||
local longdesc, usagehelp, help, helpname
|
||||
local longdesc, usagehelp, tt_help, help, helpname
|
||||
help = false
|
||||
-- Only create one help entry for all boats
|
||||
if b == 1 then
|
||||
help = true
|
||||
longdesc = "Boats are used to travel on the surface of water."
|
||||
usagehelp = "Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item."
|
||||
helpname = "Boat"
|
||||
longdesc = S("Boats are used to travel on the surface of water.")
|
||||
usagehelp = S("Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.")
|
||||
helpname = S("Boat")
|
||||
end
|
||||
tt_help = S("Water vehicle")
|
||||
|
||||
minetest.register_craftitem(itemstring, {
|
||||
description = names[b],
|
||||
_tt_help = tt_help,
|
||||
_doc_items_create_entry = help,
|
||||
_doc_items_entry_name = helpname,
|
||||
_doc_items_longdesc = longdesc,
|
||||
|
@ -284,7 +303,7 @@ for b=1, #boat_ids do
|
|||
stack_max = 1,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
|
@ -295,13 +314,20 @@ for b=1, #boat_ids do
|
|||
end
|
||||
end
|
||||
|
||||
if not is_water(pointed_thing.under) then
|
||||
return
|
||||
local pos = table.copy(pointed_thing.under)
|
||||
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
|
||||
|
||||
if math.abs(dir.x) > 0.9 or math.abs(dir.z) > 0.9 then
|
||||
pos = vector.add(pos, vector.multiply(dir, boat_side_offset))
|
||||
elseif is_water(pos) then
|
||||
pos = vector.add(pos, vector.multiply(dir, boat_y_offset))
|
||||
else
|
||||
pos = vector.add(pos, vector.multiply(dir, boat_y_offset_ground))
|
||||
end
|
||||
pointed_thing.under.y = pointed_thing.under.y + boat_y_offset
|
||||
local boat = minetest.add_entity(pointed_thing.under, "mcl_boats:boat")
|
||||
local boat = minetest.add_entity(pos, "mcl_boats:boat")
|
||||
boat:get_luaentity()._itemstring = itemstring
|
||||
boat:set_properties({textures = { "mcl_boats_texture_"..images[b].."_boat.png" }})
|
||||
boat:set_yaw(placer:get_look_horizontal())
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
|
|
11
mods/ENTITIES/mcl_boats/locale/mcl_boats.de.tr
Normal file
|
@ -0,0 +1,11 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=Akazienboot
|
||||
Birch Boat=Birkenboot
|
||||
Boat=Boot
|
||||
Boats are used to travel on the surface of water.=Boote werden benutzt, um sich auf der Wasseroberfläche zu bewegen.
|
||||
Dark Oak Boat=Schwarzeichenboot
|
||||
Jungle Boat=Dschungelboot
|
||||
Oak Boat=Eichenboot
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Rechtsklicken Sie auf eine Wasserquelle, um das Boot zu platzieren. Rechtsklicken Sie auf das Boot, um es zu betreten. Mit [Links] und [Rechts] lenken, mit [Vorwärts] und [Rückwärts] Geschwindigkeit regeln oder rückwärts fahren. Rechtsklicken Sie erneut auf das Boot, um es zu verlassen, schlagen Sie das Boot, um es als Gegenstand fallen zu lassen.
|
||||
Spruce Boat=Fichtenboot
|
||||
Water vehicle=Wasserfahrzeug
|
10
mods/ENTITIES/mcl_boats/locale/mcl_boats.es.tr
Normal file
|
@ -0,0 +1,10 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=Barca de acacia
|
||||
Birch Boat=Barca de abedul
|
||||
Boat=Barca
|
||||
Boats are used to travel on the surface of water.=Las barcas se utilizan para viajar en la superficie del agua.
|
||||
Dark Oak Boat=Barca de roble oscuro
|
||||
Jungle Boat=Barca de la selva
|
||||
Oak Boat=Barca de roble
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Haga clic derecho en una fuente de agua para colocar el barco. Haga clic derecho en el barco para entrar. Utilice [Izquierda] y [Derecha] para dirigir, [Adelante] para acelerar y [Atrás] para reducir la velocidad o retroceder. Haga clic derecho en el barco nuevamente para dejarlo, golpee el barco para que se caiga como un artículo.
|
||||
Spruce Boat=Barca de abeto
|
11
mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr
Normal file
|
@ -0,0 +1,11 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=Bateau en Acacia
|
||||
Birch Boat=Bateau en Bouleau
|
||||
Boat=Bateau
|
||||
Boats are used to travel on the surface of water.=Les bateaux sont utilisés pour voyager à la surface de l'eau.
|
||||
Dark Oak Boat=Bateau en Chêne Noir
|
||||
Jungle Boat=Bateau en Acajou
|
||||
Oak Boat=Bateau en Chêne
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Cliquez de nouveau avec le bouton droit sur le bateau pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet.
|
||||
Spruce Boat=Bateau en Sapin
|
||||
Water vehicle=Véhicule aquatique
|
11
mods/ENTITIES/mcl_boats/locale/template.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=
|
||||
Birch Boat=
|
||||
Boat=
|
||||
Boats are used to travel on the surface of water.=
|
||||
Dark Oak Boat=
|
||||
Jungle Boat=
|
||||
Oak Boat=
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=
|
||||
Spruce Boat=
|
||||
Water vehicle=
|
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 259 B |
|
@ -1,5 +1,5 @@
|
|||
local S = minetest.get_translator("mcl_falling_nodes")
|
||||
local dmes = minetest.get_modpath("mcl_death_messages") ~= nil
|
||||
local hung = minetest.get_modpath("mcl_hunger") ~= nil
|
||||
|
||||
local get_falling_depth = function(self)
|
||||
if not self._startpos then
|
||||
|
@ -49,18 +49,15 @@ local deal_falling_damage = function(self, dtime)
|
|||
-- TODO: Reduce damage if wearing a helmet
|
||||
local msg
|
||||
if minetest.get_item_group(self.node.name, "anvil") ~= 0 then
|
||||
msg = "%s was smashed by a falling anvil."
|
||||
msg = S("@1 was smashed by a falling anvil.", v:get_player_name())
|
||||
else
|
||||
msg = "%s was smashed by a falling block."
|
||||
msg = S("@1 was smashed by a falling block.", v:get_player_name())
|
||||
end
|
||||
if dmes then
|
||||
mcl_death_messages.player_damage(v, string.format(msg, v:get_player_name()))
|
||||
end
|
||||
if hung then
|
||||
mcl_hunger.exhaust(v:get_player_name(), mcl_hunger.EXHAUST_DAMAGE)
|
||||
mcl_death_messages.player_damage(v, msg)
|
||||
end
|
||||
end
|
||||
v:set_hp(hp)
|
||||
v:set_hp(hp, { type = "punch", from = "mod" })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -82,21 +79,30 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
meta = {},
|
||||
|
||||
set_node = function(self, node, meta)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
-- Change falling node if definition tells us to
|
||||
if def and def._mcl_falling_node_alternative then
|
||||
node.name = def._mcl_falling_node_alternative
|
||||
end
|
||||
local glow
|
||||
self.node = node
|
||||
self.meta = meta or {}
|
||||
self.object:set_properties({
|
||||
is_visible = true,
|
||||
textures = {node.name},
|
||||
})
|
||||
local def = core.registered_nodes[node.name]
|
||||
-- Set correct entity yaw
|
||||
if def and node.param2 ~= 0 then
|
||||
if (def.paramtype2 == "facedir" or def.paramtype2 == "colorfacedir") then
|
||||
self.object:set_yaw(core.dir_to_yaw(core.facedir_to_dir(node.param2)))
|
||||
self.object:set_yaw(minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2)))
|
||||
elseif (def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted") then
|
||||
self.object:set_yaw(core.dir_to_yaw(core.wallmounted_to_dir(node.param2)))
|
||||
self.object:set_yaw(minetest.dir_to_yaw(minetest.wallmounted_to_dir(node.param2)))
|
||||
end
|
||||
if def.light_source then
|
||||
glow = def.light_source
|
||||
end
|
||||
end
|
||||
self.object:set_properties({
|
||||
is_visible = true,
|
||||
textures = {node.name},
|
||||
glow = glow,
|
||||
})
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
|
@ -145,9 +151,9 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
|
||||
on_step = function(self, dtime)
|
||||
-- Set gravity
|
||||
local acceleration = self.object:getacceleration()
|
||||
local acceleration = self.object:get_acceleration()
|
||||
if not vector.equals(acceleration, {x = 0, y = -10, z = 0}) then
|
||||
self.object:setacceleration({x = 0, y = -10, z = 0})
|
||||
self.object:set_acceleration({x = 0, y = -10, z = 0})
|
||||
end
|
||||
-- Turn to actual node when colliding with ground, or continue to move
|
||||
local pos = self.object:get_pos()
|
||||
|
@ -204,15 +210,19 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
for _, callback in pairs(minetest.registered_on_dignodes) do
|
||||
callback(np, n2)
|
||||
end
|
||||
if minetest.registered_nodes[self.node.name] then
|
||||
local def = minetest.registered_nodes[self.node.name]
|
||||
if def then
|
||||
minetest.add_node(np, self.node)
|
||||
if minetest.registered_nodes[self.node.name]._mcl_after_falling then
|
||||
minetest.registered_nodes[self.node.name]._mcl_after_falling(np, get_falling_depth(self))
|
||||
if def._mcl_after_falling then
|
||||
def._mcl_after_falling(np, get_falling_depth(self))
|
||||
end
|
||||
if self.meta then
|
||||
local meta = minetest.get_meta(np)
|
||||
meta:from_table(self.meta)
|
||||
end
|
||||
if def.sounds and def.sounds.place and def.sounds.place.name then
|
||||
minetest.sound_play(def.sounds.place, {pos = np}, true)
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Drop the *falling node* as an item if the destination node is NOT buildable to
|
||||
|
@ -226,7 +236,7 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
minetest.check_for_falling(np)
|
||||
return
|
||||
end
|
||||
local vel = self.object:getvelocity()
|
||||
local vel = self.object:get_velocity()
|
||||
-- Fix position if entity does not move
|
||||
if vector.equals(vel, {x = 0, y = 0, z = 0}) then
|
||||
local npos = vector.round(self.object:get_pos())
|
||||
|
@ -242,8 +252,14 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
local npos3 = table.copy(npos)
|
||||
npos3.y = npos3.y - 1
|
||||
minetest.add_node(npos3, self.node)
|
||||
if minetest.registered_nodes[self.node.name]._mcl_after_falling then
|
||||
minetest.registered_nodes[self.node.name]._mcl_after_falling(npos3, get_falling_depth(self))
|
||||
local def = minetest.registered_nodes[self.node.name]
|
||||
if def then
|
||||
if def._mcl_after_falling then
|
||||
def._mcl_after_falling(npos3, get_falling_depth(self))
|
||||
end
|
||||
if def.sounds and def.sounds.place and def.sounds.place.name then
|
||||
minetest.sound_play(def.sounds.place, {pos = np}, true)
|
||||
end
|
||||
end
|
||||
deal_falling_damage(self, dtime)
|
||||
self.object:remove()
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 wurde von einem fallenden Amboss zerschmettert.
|
||||
@1 was smashed by a falling block.=@1 wurde von einem fallenden Block zerschmettert.
|
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 fue aplastado por la caída de un yunque.
|
||||
@1 was smashed by a falling block.=@1 fue aplastado por la caída de un bloque.
|
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 a été écrasé par une enclume qui tombait.
|
||||
@1 was smashed by a falling block.=@1 a été écrasé par un bloc qui tombait.
|
3
mods/ENTITIES/mcl_falling_nodes/locale/template.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=
|
||||
@1 was smashed by a falling block.=
|
|
@ -55,19 +55,19 @@ end
|
|||
minetest.register_globalstep(function(dtime)
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then
|
||||
local pos = player:getpos()
|
||||
local pos = player:get_pos()
|
||||
local inv = player:get_inventory()
|
||||
local checkpos = {x=pos.x,y=pos.y + item_drop_settings.player_collect_height,z=pos.z}
|
||||
|
||||
--magnet and collection
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius(checkpos, item_drop_settings.radius_magnet)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then
|
||||
object:get_luaentity()._magnet_timer = object:get_luaentity()._magnet_timer + dtime
|
||||
local collected = false
|
||||
if object:get_luaentity()._magnet_timer >= 0 and object:get_luaentity()._magnet_timer < item_drop_settings.magnet_time and inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
|
||||
-- Collection
|
||||
if vector.distance(checkpos, object:getpos()) <= item_drop_settings.radius_collect and not object:get_luaentity()._removed then
|
||||
if vector.distance(checkpos, object:get_pos()) <= item_drop_settings.radius_collect and not object:get_luaentity()._removed then
|
||||
-- Ignore if itemstring is not set yet
|
||||
if object:get_luaentity().itemstring ~= "" then
|
||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||
|
@ -75,7 +75,7 @@ minetest.register_globalstep(function(dtime)
|
|||
pos = pos,
|
||||
max_hear_distance = 16,
|
||||
gain = 1.0,
|
||||
})
|
||||
}, true)
|
||||
check_pickup_achievements(object, player)
|
||||
|
||||
|
||||
|
@ -95,17 +95,17 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Move object to player
|
||||
disable_physics(object, object:get_luaentity())
|
||||
|
||||
local opos = object:getpos()
|
||||
local opos = object:get_pos()
|
||||
local vec = vector.subtract(checkpos, opos)
|
||||
vec = vector.add(opos, vector.divide(vec, 2))
|
||||
object:moveto(vec)
|
||||
object:move_to(vec)
|
||||
|
||||
|
||||
--fix eternally falling items
|
||||
minetest.after(0, function(object)
|
||||
local lua = object:get_luaentity()
|
||||
if lua then
|
||||
object:setacceleration({x=0, y=0, z=0})
|
||||
object:set_acceleration({x=0, y=0, z=0})
|
||||
end
|
||||
end, object)
|
||||
|
||||
|
@ -115,7 +115,8 @@ minetest.register_globalstep(function(dtime)
|
|||
if object:get_luaentity().init ~= true then
|
||||
object:get_luaentity().init = true
|
||||
minetest.after(1, function(args)
|
||||
local player = args[1]
|
||||
local playername = args[1]
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
local object = args[2]
|
||||
local lua = object:get_luaentity()
|
||||
if player == nil or not player:is_player() or object == nil or lua == nil or lua.itemstring == nil then
|
||||
|
@ -128,7 +129,7 @@ minetest.register_globalstep(function(dtime)
|
|||
pos = pos,
|
||||
max_hear_distance = 16,
|
||||
gain = 1.0,
|
||||
})
|
||||
}, true)
|
||||
end
|
||||
check_pickup_achievements(object, player)
|
||||
object:get_luaentity()._removed = true
|
||||
|
@ -136,7 +137,7 @@ minetest.register_globalstep(function(dtime)
|
|||
else
|
||||
enable_physics(object, object:get_luaentity())
|
||||
end
|
||||
end, {player, object})
|
||||
end, {player:get_player_name(), object})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -211,7 +212,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
-- This means there is no digger. This is a special case which allows this function to be called
|
||||
-- by hand. Creative Mode is intentionally ignored in this case.
|
||||
|
||||
local doTileDrops = minetest.settings:get_bool("mcl_doTileDrops") or true
|
||||
local doTileDrops = minetest.settings:get_bool("mcl_doTileDrops", true)
|
||||
if (digger ~= nil and minetest.settings:get_bool("creative_mode")) or doTileDrops == false then
|
||||
return
|
||||
end
|
||||
|
@ -244,16 +245,22 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
end
|
||||
|
||||
for _,item in ipairs(drops) do
|
||||
local count, name
|
||||
local count
|
||||
if type(item) == "string" then
|
||||
count = 1
|
||||
name = item
|
||||
count = ItemStack(item):get_count()
|
||||
else
|
||||
count = item:get_count()
|
||||
name = item:get_name()
|
||||
end
|
||||
local drop_item = ItemStack(item)
|
||||
drop_item:set_count(1)
|
||||
for i=1,count do
|
||||
local obj = core.add_item(pos, name)
|
||||
local dpos = table.copy(pos)
|
||||
-- Apply offset for plantlike_rooted nodes because of their special shape
|
||||
if nodedef and nodedef.drawtype == "plantlike_rooted" and nodedef.walkable then
|
||||
dpos.y = dpos.y + 1
|
||||
end
|
||||
-- Spawn item and apply random speed
|
||||
local obj = minetest.add_item(dpos, drop_item)
|
||||
if obj ~= nil then
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
|
@ -263,7 +270,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
if math.random(1,2) == 1 then
|
||||
z = -z
|
||||
end
|
||||
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
|
||||
obj:set_velocity({x=1/x, y=obj:get_velocity().y, z=1/z})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -279,12 +286,12 @@ function minetest.item_drop(itemstack, dropper, pos)
|
|||
cs = 1
|
||||
end
|
||||
local item = itemstack:take_item(cs)
|
||||
local obj = core.add_item(p, item)
|
||||
local obj = minetest.add_item(p, item)
|
||||
if obj then
|
||||
v.x = v.x*4
|
||||
v.y = v.y*4 + 2
|
||||
v.z = v.z*4
|
||||
obj:setvelocity(v)
|
||||
obj:set_velocity(v)
|
||||
-- Force collection delay
|
||||
obj:get_luaentity()._insta_collect = false
|
||||
return itemstack
|
||||
|
@ -294,17 +301,18 @@ end
|
|||
|
||||
--modify builtin:item
|
||||
|
||||
local time_to_live = tonumber(core.setting_get("item_entity_ttl"))
|
||||
local time_to_live = tonumber(minetest.settings:get("item_entity_ttl"))
|
||||
if not time_to_live then
|
||||
time_to_live = 300
|
||||
end
|
||||
|
||||
core.register_entity(":__builtin:item", {
|
||||
minetest.register_entity(":__builtin:item", {
|
||||
initial_properties = {
|
||||
hp_max = 1,
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||
pointable = false,
|
||||
visual = "wielditem",
|
||||
visual_size = {x = 0.4, y = 0.4},
|
||||
textures = {""},
|
||||
|
@ -342,8 +350,6 @@ core.register_entity(":__builtin:item", {
|
|||
count = max_count
|
||||
self.itemstring = stack:get_name().." "..max_count
|
||||
end
|
||||
local s = 0.2 + 0.1 * (count / max_count)
|
||||
local c = s
|
||||
local itemtable = stack:to_table()
|
||||
local itemname = nil
|
||||
local description = ""
|
||||
|
@ -352,11 +358,18 @@ core.register_entity(":__builtin:item", {
|
|||
end
|
||||
local item_texture = nil
|
||||
local item_type = ""
|
||||
if core.registered_items[itemname] then
|
||||
item_texture = core.registered_items[itemname].inventory_image
|
||||
item_type = core.registered_items[itemname].type
|
||||
description = core.registered_items[itemname].description
|
||||
local glow
|
||||
local def = minetest.registered_items[itemname]
|
||||
if def then
|
||||
item_texture = def.inventory_image
|
||||
item_type = def.type
|
||||
description = def.description
|
||||
glow = def.light_source
|
||||
end
|
||||
local s = 0.2 + 0.1 * (count / max_count)
|
||||
local wield_scale = (def and def.wield_scale and def.wield_scale.x) or 1
|
||||
local c = s
|
||||
s = s / wield_scale
|
||||
local prop = {
|
||||
is_visible = true,
|
||||
visual = "wielditem",
|
||||
|
@ -365,6 +378,7 @@ core.register_entity(":__builtin:item", {
|
|||
collisionbox = {-c, -c, -c, c, c, c},
|
||||
automatic_rotate = math.pi * 0.5,
|
||||
infotext = description,
|
||||
glow = glow,
|
||||
}
|
||||
self.object:set_properties(prop)
|
||||
if item_drop_settings.random_item_velocity == true then
|
||||
|
@ -372,7 +386,7 @@ core.register_entity(":__builtin:item", {
|
|||
if not self or not self.object or not self.object:get_luaentity() then
|
||||
return
|
||||
end
|
||||
local vel = self.object:getvelocity()
|
||||
local vel = self.object:get_velocity()
|
||||
if vel and vel.x == 0 and vel.z == 0 then
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
|
@ -383,7 +397,7 @@ core.register_entity(":__builtin:item", {
|
|||
z = -z
|
||||
end
|
||||
local y = math.random(2,4)
|
||||
self.object:setvelocity({x=1/x, y=y, z=1/z})
|
||||
self.object:set_velocity({x=1/x, y=y, z=1/z})
|
||||
end
|
||||
end, self)
|
||||
end
|
||||
|
@ -391,7 +405,7 @@ core.register_entity(":__builtin:item", {
|
|||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return core.serialize({
|
||||
return minetest.serialize({
|
||||
itemstring = self.itemstring,
|
||||
always_collect = self.always_collect,
|
||||
age = self.age,
|
||||
|
@ -403,7 +417,7 @@ core.register_entity(":__builtin:item", {
|
|||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
if string.sub(staticdata, 1, string.len("return")) == "return" then
|
||||
local data = core.deserialize(staticdata)
|
||||
local data = minetest.deserialize(staticdata)
|
||||
if data and type(data) == "table" then
|
||||
self.itemstring = data.itemstring
|
||||
self.always_collect = data.always_collect
|
||||
|
@ -443,8 +457,8 @@ core.register_entity(":__builtin:item", {
|
|||
self._forcetimer = 0
|
||||
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
self.object:setvelocity({x = 0, y = 2, z = 0})
|
||||
self.object:setacceleration({x = 0, y = -get_gravity(), z = 0})
|
||||
self.object:set_velocity({x = 0, y = 2, z = 0})
|
||||
self.object:set_acceleration({x = 0, y = -get_gravity(), z = 0})
|
||||
self:set_item(self.itemstring)
|
||||
end,
|
||||
|
||||
|
@ -502,13 +516,13 @@ core.register_entity(":__builtin:item", {
|
|||
-- Delete corrupted item entities. The itemstring MUST be non-empty on its first step,
|
||||
-- otherwise there might have some data corruption.
|
||||
if self.itemstring == "" then
|
||||
minetest.log("warning", "Item entity with empty itemstring found at "..minetest.pos_to_string(self.object:getpos()).. "! Deleting it now.")
|
||||
minetest.log("warning", "Item entity with empty itemstring found at "..minetest.pos_to_string(self.object:get_pos()).. "! Deleting it now.")
|
||||
self._removed = true
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
local p = self.object:getpos()
|
||||
local node = core.get_node_or_nil(p)
|
||||
local p = self.object:get_pos()
|
||||
local node = minetest.get_node_or_nil(p)
|
||||
local in_unloaded = (node == nil)
|
||||
|
||||
-- If no collector was found for a long enough time, declare the magnet as disabled
|
||||
|
@ -523,13 +537,15 @@ core.register_entity(":__builtin:item", {
|
|||
return
|
||||
end
|
||||
|
||||
-- Destroy item in lava or special nodes
|
||||
-- Destroy item in lava, fire or special nodes
|
||||
local nn = node.name
|
||||
local def = minetest.registered_nodes[nn]
|
||||
if (def and def.groups and (def.groups.lava or def.groups.destroys_items == 1)) then
|
||||
-- Special effect for lava
|
||||
if def.groups.lava then
|
||||
minetest.sound_play("builtin_item_lava", {pos = self.object:getpos(), gain = 0.5})
|
||||
local lg = minetest.get_item_group(nn, "lava")
|
||||
local fg = minetest.get_item_group(nn, "fire")
|
||||
local dg = minetest.get_item_group(nn, "destroys_items")
|
||||
if (def and (lg ~= 0 or fg ~= 0 or dg == 1)) then
|
||||
if dg ~= 2 then
|
||||
minetest.sound_play("builtin_item_lava", {pos = self.object:get_pos(), gain = 0.5}, true)
|
||||
end
|
||||
self._removed = true
|
||||
self.object:remove()
|
||||
|
@ -539,8 +555,8 @@ core.register_entity(":__builtin:item", {
|
|||
-- Push item out when stuck inside solid opaque node
|
||||
if def and def.walkable and def.groups and def.groups.opaque == 1 then
|
||||
local shootdir
|
||||
local cx = p.x % 1
|
||||
local cz = p.z % 1
|
||||
local cx = (p.x % 1) - 0.5
|
||||
local cz = (p.z % 1) - 0.5
|
||||
local order = {}
|
||||
|
||||
-- First prepare the order in which the 4 sides are to be checked.
|
||||
|
@ -548,7 +564,7 @@ core.register_entity(":__builtin:item", {
|
|||
-- 2nd: other direction
|
||||
-- 3rd and 4th: other axis
|
||||
local cxcz = function(o, cw, one, zero)
|
||||
if cw > 0 then
|
||||
if cw < 0 then
|
||||
table.insert(o, { [one]=1, y=0, [zero]=0 })
|
||||
table.insert(o, { [one]=-1, y=0, [zero]=0 })
|
||||
else
|
||||
|
@ -557,7 +573,7 @@ core.register_entity(":__builtin:item", {
|
|||
end
|
||||
return o
|
||||
end
|
||||
if math.abs(cx) > math.abs(cz) then
|
||||
if math.abs(cx) < math.abs(cz) then
|
||||
order = cxcz(order, cx, "x", "z")
|
||||
order = cxcz(order, cz, "z", "x")
|
||||
else
|
||||
|
@ -586,8 +602,8 @@ core.register_entity(":__builtin:item", {
|
|||
|
||||
-- Set new item moving speed accordingly
|
||||
local newv = vector.multiply(shootdir, 3)
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
self.object:setvelocity(newv)
|
||||
self.object:set_acceleration({x = 0, y = 0, z = 0})
|
||||
self.object:set_velocity(newv)
|
||||
|
||||
disable_physics(self.object, self, false, false)
|
||||
|
||||
|
@ -640,8 +656,8 @@ core.register_entity(":__builtin:item", {
|
|||
local f = 1.39
|
||||
-- Set new item moving speed into the direciton of the liquid
|
||||
local newv = vector.multiply(vec, f)
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
self.object:setvelocity({x = newv.x, y = -0.22, z = newv.z})
|
||||
self.object:set_acceleration({x = 0, y = 0, z = 0})
|
||||
self.object:set_velocity({x = newv.x, y = -0.22, z = newv.z})
|
||||
|
||||
self.physical_state = true
|
||||
self._flowing = true
|
||||
|
@ -659,13 +675,13 @@ core.register_entity(":__builtin:item", {
|
|||
|
||||
-- If node is not registered or node is walkably solid and resting on nodebox
|
||||
local nn = minetest.get_node({x=p.x, y=p.y-0.5, z=p.z}).name
|
||||
local v = self.object:getvelocity()
|
||||
local v = self.object:get_velocity()
|
||||
|
||||
if not core.registered_nodes[nn] or core.registered_nodes[nn].walkable and v.y == 0 then
|
||||
if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then
|
||||
if self.physical_state then
|
||||
local own_stack = ItemStack(self.object:get_luaentity().itemstring)
|
||||
-- Merge with close entities of the same item
|
||||
for _, object in ipairs(core.get_objects_inside_radius(p, 0.8)) do
|
||||
for _, object in ipairs(minetest.get_objects_inside_radius(p, 0.8)) do
|
||||
local obj = object:get_luaentity()
|
||||
if obj and obj.name == "__builtin:item"
|
||||
and obj.physical_state == false then
|
||||
|
@ -685,7 +701,3 @@ core.register_entity(":__builtin:item", {
|
|||
|
||||
-- Note: on_punch intentionally left out. The player should *not* be able to collect items by punching
|
||||
})
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "mcl_item_entity loaded")
|
||||
end
|
||||
|
|
|
@ -3,26 +3,19 @@ mcl_minecarts
|
|||
Based on the mod "boost_carts" by Krock.
|
||||
Target: Run smoothly and do not use too much CPU.
|
||||
|
||||
TODO:
|
||||
- Minecraft-like physics
|
||||
- Add activator rail
|
||||
- Add more rail textures
|
||||
- Add loaded minecarts
|
||||
|
||||
License of source code:
|
||||
-----------------------
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2012-2016 PilzAdam
|
||||
Copyright (C) 2014-2016 SmallJoker
|
||||
Copyright (C) 2012-2016 Various Minetest developers and contributors
|
||||
|
||||
Authors/licenses of media files:
|
||||
-----------------------
|
||||
|
||||
Minecart model:
|
||||
22i (GPLv3)
|
||||
|
||||
Wuzzy (based on Pixel Perfection 1.11, MIT License):
|
||||
carts_rail_crossing_pwr.png
|
||||
carts_rail_curved_pwr.png
|
||||
carts_rail_t_junction_pwr.png
|
||||
|
||||
Other texture files (CC BY-SA 3.0:
|
||||
Texture files (CC BY-SA 3.0):
|
||||
XSSheep
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
mcl_explosions
|
||||
mcl_core
|
||||
mcl_sounds
|
||||
mcl_player
|
||||
|
|
|
@ -1,14 +1,57 @@
|
|||
local S = minetest.get_translator("mcl_minecarts")
|
||||
|
||||
mcl_minecarts = {}
|
||||
mcl_minecarts.modpath = minetest.get_modpath("mcl_minecarts")
|
||||
mcl_minecarts.speed_max = 10
|
||||
mcl_minecarts.check_float_time = 15
|
||||
|
||||
dofile(mcl_minecarts.modpath.."/functions.lua")
|
||||
dofile(mcl_minecarts.modpath.."/rails.lua")
|
||||
|
||||
local function detach_driver(self)
|
||||
if not self._driver then
|
||||
return
|
||||
end
|
||||
mcl_player.player_attached[self._driver] = nil
|
||||
local player = minetest.get_player_by_name(self._driver)
|
||||
self._driver = nil
|
||||
self._start_pos = nil
|
||||
if player then
|
||||
player:set_detach()
|
||||
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
||||
mcl_player.player_set_animation(player, "stand" , 30)
|
||||
end
|
||||
end
|
||||
|
||||
local function activate_tnt_minecart(self, timer)
|
||||
if self._boomtimer then
|
||||
return
|
||||
end
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
if timer then
|
||||
self._boomtimer = timer
|
||||
else
|
||||
self._boomtimer = tnt.BOOMTIMER
|
||||
end
|
||||
self.object:set_properties({textures = {
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_minecarts_minecart.png",
|
||||
}})
|
||||
self._blinktimer = tnt.BLINKTIMER
|
||||
minetest.sound_play("tnt_ignite", {pos = self.object:get_pos(), gain = 1.0, max_hear_distance = 15}, true)
|
||||
end
|
||||
|
||||
local activate_normal_minecart = detach_driver
|
||||
|
||||
-- Table for item-to-entity mapping. Keys: itemstring, Values: Corresponding entity ID
|
||||
local entity_mapping = {}
|
||||
|
||||
local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||
local function register_entity(entity_id, mesh, textures, drop, on_rightclick, on_activate_by_rail)
|
||||
local cart = {
|
||||
physical = false,
|
||||
collisionbox = {-10/16., -0.5, -10/16, 10/16, 0.25, 10/16},
|
||||
|
@ -23,6 +66,11 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
_punched = false, -- used to re-send _velocity and position
|
||||
_velocity = {x=0, y=0, z=0}, -- only used on punch
|
||||
_start_pos = nil, -- Used to calculate distance for “On A Rail” achievement
|
||||
_last_float_check = nil, -- timestamp of last time the cart was checked to be still on a rail
|
||||
_fueltime = nil, -- how many seconds worth of fuel is left. Only used by minecart with furnace
|
||||
_boomtimer = nil, -- how many seconds are left before exploding
|
||||
_blinktimer = nil, -- how many seconds are left before TNT blinking
|
||||
_blink = false, -- is TNT blink texture active?
|
||||
_old_dir = {x=0, y=0, z=0},
|
||||
_old_pos = nil,
|
||||
_old_vel = {x=0, y=0, z=0},
|
||||
|
@ -31,11 +79,25 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
}
|
||||
|
||||
function cart:on_activate(staticdata, dtime_s)
|
||||
-- Initialize
|
||||
local data = minetest.deserialize(staticdata)
|
||||
if type(data) == "table" then
|
||||
self._railtype = data._railtype
|
||||
end
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
|
||||
-- Activate cart if on activator rail
|
||||
if self.on_activate_by_rail then
|
||||
local pos = self.object:get_pos()
|
||||
local node = minetest.get_node(vector.floor(pos))
|
||||
if node.name == "mcl_minecarts:activator_rail_on" then
|
||||
self:on_activate_by_rail()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function cart:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
if not self._railtype then
|
||||
local node = minetest.get_node(vector.floor(pos)).name
|
||||
self._railtype = minetest.get_item_group(node, "connect_to_raillike")
|
||||
|
@ -52,16 +114,13 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
return
|
||||
end
|
||||
|
||||
if puncher:get_player_control().sneak then
|
||||
-- Punch+sneak: Pick up minecart (unless TNT was ignited)
|
||||
if puncher:get_player_control().sneak and not self._boomtimer then
|
||||
if self._driver then
|
||||
if self._old_pos then
|
||||
self.object:setpos(self._old_pos)
|
||||
end
|
||||
mcl_player.player_attached[self._driver] = nil
|
||||
local player = minetest.get_player_by_name(self._driver)
|
||||
if player then
|
||||
player:set_detach()
|
||||
self.object:set_pos(self._old_pos)
|
||||
end
|
||||
detach_driver(self)
|
||||
end
|
||||
|
||||
-- Disable detector rail
|
||||
|
@ -76,7 +135,14 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
-- Drop items and remove cart entity
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
for d=1, #drop do
|
||||
minetest.add_item(self.object:getpos(), drop[d])
|
||||
minetest.add_item(self.object:get_pos(), drop[d])
|
||||
end
|
||||
elseif puncher and puncher:is_player() then
|
||||
local inv = puncher:get_inventory()
|
||||
for d=1, #drop do
|
||||
if not inv:contains_item("main", drop[d]) then
|
||||
inv:add_item("main", drop[d])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -84,7 +150,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
return
|
||||
end
|
||||
|
||||
local vel = self.object:getvelocity()
|
||||
local vel = self.object:get_velocity()
|
||||
if puncher:get_player_name() == self._driver then
|
||||
if math.abs(vel.x + vel.z) > 7 then
|
||||
return
|
||||
|
@ -106,33 +172,150 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
self._punched = true
|
||||
end
|
||||
|
||||
cart.on_activate_by_rail = on_activate_by_rail
|
||||
|
||||
function cart:on_step(dtime)
|
||||
local vel = self.object:getvelocity()
|
||||
local vel = self.object:get_velocity()
|
||||
local update = {}
|
||||
if self._last_float_check == nil then
|
||||
self._last_float_check = 0
|
||||
else
|
||||
self._last_float_check = self._last_float_check + dtime
|
||||
end
|
||||
local pos, rou_pos, node
|
||||
-- Drop minecart if it isn't on a rail anymore
|
||||
if self._last_float_check >= mcl_minecarts.check_float_time then
|
||||
pos = self.object:get_pos()
|
||||
rou_pos = vector.round(pos)
|
||||
node = minetest.get_node(rou_pos)
|
||||
local g = minetest.get_item_group(node.name, "connect_to_raillike")
|
||||
if g ~= self._railtype and self._railtype ~= nil then
|
||||
-- Detach driver
|
||||
if self._driver then
|
||||
if self._old_pos then
|
||||
self.object:set_pos(self._old_pos)
|
||||
end
|
||||
mcl_player.player_attached[self._driver] = nil
|
||||
local player = minetest.get_player_by_name(self._driver)
|
||||
if player then
|
||||
player:set_detach()
|
||||
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
||||
end
|
||||
end
|
||||
|
||||
-- Explode if already ignited
|
||||
if self._boomtimer then
|
||||
self.object:remove()
|
||||
mcl_explosions.explode(pos, 4, { drop_chance = 1.0 })
|
||||
return
|
||||
end
|
||||
|
||||
-- Drop items and remove cart entity
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
for d=1, #drop do
|
||||
minetest.add_item(self.object:get_pos(), drop[d])
|
||||
end
|
||||
end
|
||||
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
self._last_float_check = 0
|
||||
end
|
||||
|
||||
-- Update furnace stuff
|
||||
if self._fueltime and self._fueltime > 0 then
|
||||
self._fueltime = self._fueltime - dtime
|
||||
if self._fueltime <= 0 then
|
||||
self.object:set_properties({textures =
|
||||
{
|
||||
"default_furnace_top.png",
|
||||
"default_furnace_top.png",
|
||||
"default_furnace_front.png",
|
||||
"default_furnace_side.png",
|
||||
"default_furnace_side.png",
|
||||
"default_furnace_side.png",
|
||||
"mcl_minecarts_minecart.png",
|
||||
}})
|
||||
self._fueltime = 0
|
||||
end
|
||||
end
|
||||
local has_fuel = self._fueltime and self._fueltime > 0
|
||||
|
||||
-- Update TNT stuff
|
||||
if self._boomtimer then
|
||||
-- Explode
|
||||
self._boomtimer = self._boomtimer - dtime
|
||||
local pos = self.object:get_pos()
|
||||
if self._boomtimer <= 0 then
|
||||
self.object:remove()
|
||||
mcl_explosions.explode(pos, 4, { drop_chance = 1.0 })
|
||||
return
|
||||
else
|
||||
tnt.smoke_step(pos)
|
||||
end
|
||||
end
|
||||
if self._blinktimer then
|
||||
self._blinktimer = self._blinktimer - dtime
|
||||
if self._blinktimer <= 0 then
|
||||
self._blink = not self._blink
|
||||
if self._blink then
|
||||
self.object:set_properties({textures =
|
||||
{
|
||||
"default_tnt_top.png",
|
||||
"default_tnt_bottom.png",
|
||||
"default_tnt_side.png",
|
||||
"default_tnt_side.png",
|
||||
"default_tnt_side.png",
|
||||
"default_tnt_side.png",
|
||||
"mcl_minecarts_minecart.png",
|
||||
}})
|
||||
else
|
||||
self.object:set_properties({textures =
|
||||
{
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_tnt_blink.png",
|
||||
"mcl_minecarts_minecart.png",
|
||||
}})
|
||||
end
|
||||
self._blinktimer = tnt.BLINKTIMER
|
||||
end
|
||||
end
|
||||
|
||||
if self._punched then
|
||||
vel = vector.add(vel, self._velocity)
|
||||
self.object:setvelocity(vel)
|
||||
self.object:set_velocity(vel)
|
||||
self._old_dir.y = 0
|
||||
elseif vector.equals(vel, {x=0, y=0, z=0}) then
|
||||
elseif vector.equals(vel, {x=0, y=0, z=0}) and (not has_fuel) then
|
||||
return
|
||||
end
|
||||
|
||||
local dir, last_switch = nil, nil
|
||||
local pos = self.object:getpos()
|
||||
if not pos then
|
||||
pos = self.object:get_pos()
|
||||
end
|
||||
if self._old_pos and not self._punched then
|
||||
local flo_pos = vector.floor(pos)
|
||||
local flo_old = vector.floor(self._old_pos)
|
||||
if vector.equals(flo_pos, flo_old) then
|
||||
if vector.equals(flo_pos, flo_old) and (not has_fuel) then
|
||||
return
|
||||
-- Prevent querying the same node over and over again
|
||||
end
|
||||
|
||||
-- Update detector rails
|
||||
local rou_pos = vector.round(pos)
|
||||
if not rou_pos then
|
||||
rou_pos = vector.round(pos)
|
||||
end
|
||||
local rou_old = vector.round(self._old_pos)
|
||||
local node = minetest.get_node(rou_pos)
|
||||
if not node then
|
||||
node = minetest.get_node(rou_pos)
|
||||
end
|
||||
local node_old = minetest.get_node(rou_old)
|
||||
|
||||
-- Update detector rails
|
||||
if node.name == "mcl_minecarts:detector_rail" then
|
||||
local newnode = {name="mcl_minecarts:detector_rail_on", param2 = node.param2}
|
||||
minetest.swap_node(rou_pos, newnode)
|
||||
|
@ -143,6 +326,10 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
minetest.swap_node(rou_old, newnode)
|
||||
mesecon.receptor_off(rou_old)
|
||||
end
|
||||
-- Activate minecart if on activator rail
|
||||
if node_old.name == "mcl_minecarts:activator_rail_on" and self.on_activate_by_rail then
|
||||
self:on_activate_by_rail()
|
||||
end
|
||||
end
|
||||
|
||||
local ctrl, player = nil, nil
|
||||
|
@ -158,8 +345,8 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
(self._old_vel.x * vel.x < 0 or self._old_vel.z * vel.z < 0) then
|
||||
self._old_vel = {x = 0, y = 0, z = 0}
|
||||
self._old_pos = pos
|
||||
self.object:setvelocity(vector.new())
|
||||
self.object:setacceleration(vector.new())
|
||||
self.object:set_velocity(vector.new())
|
||||
self.object:set_acceleration(vector.new())
|
||||
return
|
||||
end
|
||||
self._old_vel = vector.new(vel)
|
||||
|
@ -196,7 +383,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
end
|
||||
|
||||
local new_acc = {x=0, y=0, z=0}
|
||||
if vector.equals(dir, {x=0, y=0, z=0}) then
|
||||
if vector.equals(dir, {x=0, y=0, z=0}) and not has_fuel then
|
||||
vel = {x=0, y=0, z=0}
|
||||
update.vel = true
|
||||
else
|
||||
|
@ -222,18 +409,23 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
|
||||
-- Slow down or speed up
|
||||
local acc = dir.y * -1.8
|
||||
|
||||
local friction = 0.4
|
||||
local speed_mod = minetest.registered_nodes[minetest.get_node(pos).name]._rail_acceleration
|
||||
|
||||
acc = acc - friction
|
||||
|
||||
if has_fuel then
|
||||
acc = acc + 0.6
|
||||
end
|
||||
|
||||
if speed_mod and speed_mod ~= 0 then
|
||||
acc = acc + speed_mod
|
||||
else
|
||||
acc = acc - 0.4
|
||||
acc = acc + speed_mod + friction
|
||||
end
|
||||
|
||||
new_acc = vector.multiply(dir, acc)
|
||||
end
|
||||
|
||||
self.object:setacceleration(new_acc)
|
||||
self.object:set_acceleration(new_acc)
|
||||
self._old_pos = vector.new(pos)
|
||||
self._old_dir = vector.new(dir)
|
||||
self._old_switch = last_switch
|
||||
|
@ -262,7 +454,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
elseif dir.z < 0 then
|
||||
yaw = 1
|
||||
end
|
||||
self.object:setyaw(yaw * math.pi)
|
||||
self.object:set_yaw(yaw * math.pi)
|
||||
end
|
||||
|
||||
if self._punched then
|
||||
|
@ -282,15 +474,15 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
|||
end
|
||||
self.object:set_animation(anim, 1, 0)
|
||||
|
||||
self.object:setvelocity(vel)
|
||||
self.object:set_velocity(vel)
|
||||
if update.pos then
|
||||
self.object:setpos(pos)
|
||||
self.object:set_pos(pos)
|
||||
end
|
||||
update = nil
|
||||
end
|
||||
|
||||
function cart:get_staticdata()
|
||||
return ""
|
||||
return minetest.serialize({_railtype = self._railtype})
|
||||
end
|
||||
|
||||
minetest.register_entity(entity_id, cart)
|
||||
|
@ -323,8 +515,12 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing)
|
|||
local entity_id = entity_mapping[itemstack:get_name()]
|
||||
local cart = minetest.add_entity(railpos, entity_id)
|
||||
local railtype = minetest.get_item_group(node.name, "connect_to_raillike")
|
||||
local le = cart:get_luaentity()
|
||||
if le ~= nil then
|
||||
le._railtype = railtype
|
||||
end
|
||||
local cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype)
|
||||
cart:setyaw(minetest.dir_to_yaw(cart_dir))
|
||||
cart:set_yaw(minetest.dir_to_yaw(cart_dir))
|
||||
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
|
@ -333,7 +529,7 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing)
|
|||
end
|
||||
|
||||
|
||||
local register_craftitem = function(itemstring, entity_id, description, longdesc, usagehelp, icon, creative)
|
||||
local register_craftitem = function(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative)
|
||||
entity_mapping[itemstring] = entity_id
|
||||
|
||||
local groups = { minecart = 1, transport = 1 }
|
||||
|
@ -373,6 +569,7 @@ local register_craftitem = function(itemstring, entity_id, description, longdesc
|
|||
groups = groups,
|
||||
}
|
||||
def.description = description
|
||||
def._tt_help = tt_help
|
||||
def._doc_items_longdesc = longdesc
|
||||
def._doc_items_usagehelp = usagehelp
|
||||
def.inventory_image = icon
|
||||
|
@ -395,9 +592,9 @@ Register a minecart
|
|||
* on_activate_by_rail: Called when above activator rail
|
||||
* creative: If false, don't show in Creative Inventory
|
||||
]]
|
||||
local function register_minecart(itemstring, entity_id, description, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, on_activate_by_rail, creative)
|
||||
register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||
register_craftitem(itemstring, entity_id, description, longdesc, usagehelp, icon, creative)
|
||||
local function register_minecart(itemstring, entity_id, description, tt_help, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, on_activate_by_rail, creative)
|
||||
register_entity(entity_id, mesh, textures, drop, on_rightclick, on_activate_by_rail)
|
||||
register_craftitem(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative)
|
||||
if minetest.get_modpath("doc_identifier") ~= nil then
|
||||
doc.sub.identifier.register_object(entity_id, "craftitems", itemstring)
|
||||
end
|
||||
|
@ -407,39 +604,48 @@ end
|
|||
register_minecart(
|
||||
"mcl_minecarts:minecart",
|
||||
"mcl_minecarts:minecart",
|
||||
"Minecart",
|
||||
"Minecarts can be used for a quick transportion on rails." .. "\n" ..
|
||||
"Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.",
|
||||
"You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving." .. "\n" ..
|
||||
"To obtain the minecart, punch it while holding down the sneak key.",
|
||||
S("Minecart"),
|
||||
S("Vehicle for fast travel on rails"),
|
||||
S("Minecarts can be used for a quick transportion on rails.") .. "\n" ..
|
||||
S("Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type."),
|
||||
S("You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.") .. "\n" ..
|
||||
S("To obtain the minecart, punch it while holding down the sneak key.") .. "\n" ..
|
||||
S("If it moves over a powered activator rail, you'll get ejected."),
|
||||
"mcl_minecarts_minecart.b3d",
|
||||
{"mcl_minecarts_minecart.png"},
|
||||
"mcl_minecarts_minecart_normal.png",
|
||||
{"mcl_minecarts:minecart"},
|
||||
function(self, clicker)
|
||||
local name = clicker:get_player_name()
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
local player_name = clicker:get_player_name()
|
||||
if self._driver and player_name == self._driver then
|
||||
self._driver = nil
|
||||
self._start_pos = nil
|
||||
clicker:set_detach()
|
||||
detach_driver(self)
|
||||
elseif not self._driver then
|
||||
self._driver = player_name
|
||||
self._start_pos = self.object:getpos()
|
||||
self._start_pos = self.object:get_pos()
|
||||
mcl_player.player_attached[player_name] = true
|
||||
clicker:set_attach(self.object, "", {x=0, y=3, z=0}, {x=0, y=0, z=0})
|
||||
clicker:set_attach(self.object, "", {x=0, y=-1.75, z=-2}, {x=0, y=0, z=0})
|
||||
mcl_player.player_attached[name] = true
|
||||
minetest.after(0.2, function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
mcl_player.player_set_animation(player, "sit" , 30)
|
||||
player:set_eye_offset({x=0, y=-5.5, z=0},{x=0, y=-4, z=0})
|
||||
end
|
||||
end, name)
|
||||
end
|
||||
end
|
||||
end, activate_normal_minecart
|
||||
)
|
||||
|
||||
-- Minecart with Chest
|
||||
register_minecart(
|
||||
"mcl_minecarts:chest_minecart",
|
||||
"mcl_minecarts:chest_minecart",
|
||||
"Minecart with Chest",
|
||||
nil, nil,
|
||||
S("Minecart with Chest"),
|
||||
nil, nil, nil,
|
||||
"mcl_minecarts_minecart_chest.b3d",
|
||||
{ "mcl_chests_normal.png", "mcl_minecarts_minecart.png" },
|
||||
"mcl_minecarts_minecart_chest.png",
|
||||
|
@ -450,8 +656,12 @@ register_minecart(
|
|||
register_minecart(
|
||||
"mcl_minecarts:furnace_minecart",
|
||||
"mcl_minecarts:furnace_minecart",
|
||||
"Minecart with Furnace",
|
||||
nil, nil,
|
||||
S("Minecart with Furnace"),
|
||||
nil,
|
||||
S("A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel."),
|
||||
S("Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.") .. "\n" ..
|
||||
S("To obtain the minecart and furnace, punch them while holding down the sneak key."),
|
||||
|
||||
"mcl_minecarts_minecart_block.b3d",
|
||||
{
|
||||
"default_furnace_top.png",
|
||||
|
@ -478,13 +688,20 @@ register_minecart(
|
|||
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
held:take_item()
|
||||
local index = clicker:get_wielded_index()
|
||||
local index = clicker:get_wield_index()
|
||||
local inv = clicker:get_inventory()
|
||||
inv:set_stack("main", index, held)
|
||||
end
|
||||
|
||||
-- DEBUG
|
||||
minetest.chat_send_player(clicker:get_player_name(), "Fuel: " .. tostring(self._fueltime))
|
||||
self.object:set_properties({textures =
|
||||
{
|
||||
"default_furnace_top.png",
|
||||
"default_furnace_top.png",
|
||||
"default_furnace_front_active.png",
|
||||
"default_furnace_side.png",
|
||||
"default_furnace_side.png",
|
||||
"default_furnace_side.png",
|
||||
"mcl_minecarts_minecart.png",
|
||||
}})
|
||||
end
|
||||
end, nil, false
|
||||
)
|
||||
|
@ -493,8 +710,8 @@ register_minecart(
|
|||
register_minecart(
|
||||
"mcl_minecarts:command_block_minecart",
|
||||
"mcl_minecarts:command_block_minecart",
|
||||
"Minecart with Command Block",
|
||||
nil, nil,
|
||||
S("Minecart with Command Block"),
|
||||
nil, nil, nil,
|
||||
"mcl_minecarts_minecart_block.b3d",
|
||||
{
|
||||
"jeija_commandblock_off.png^[verticalframe:2:0",
|
||||
|
@ -514,8 +731,8 @@ register_minecart(
|
|||
register_minecart(
|
||||
"mcl_minecarts:hopper_minecart",
|
||||
"mcl_minecarts:hopper_minecart",
|
||||
"Minecart with Hopper",
|
||||
nil, nil,
|
||||
S("Minecart with Hopper"),
|
||||
nil, nil, nil,
|
||||
"mcl_minecarts_minecart_hopper.b3d",
|
||||
{
|
||||
"mcl_hoppers_hopper_inside.png",
|
||||
|
@ -532,8 +749,11 @@ register_minecart(
|
|||
register_minecart(
|
||||
"mcl_minecarts:tnt_minecart",
|
||||
"mcl_minecarts:tnt_minecart",
|
||||
"Minecart with TNT",
|
||||
nil, nil,
|
||||
S("Minecart with TNT"),
|
||||
S("Vehicle for fast travel on rails").."\n"..S("Can be ignited by tools or powered activator rail"),
|
||||
S("A minecart with TNT is an explosive vehicle that travels on rail."),
|
||||
S("Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.") .. "\n" ..
|
||||
S("To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited."),
|
||||
"mcl_minecarts_minecart_block.b3d",
|
||||
{
|
||||
"default_tnt_top.png",
|
||||
|
@ -546,8 +766,25 @@ register_minecart(
|
|||
},
|
||||
"mcl_minecarts_minecart_tnt.png",
|
||||
{"mcl_minecarts:minecart", "mcl_tnt:tnt"},
|
||||
nil, nil, false
|
||||
)
|
||||
-- Ingite
|
||||
function(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
if self._boomtimer then
|
||||
return
|
||||
end
|
||||
local held = clicker:get_wielded_item()
|
||||
if held:get_name() == "mcl_fire:flint_and_steel" then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
held:add_wear(65535/65) -- 65 uses
|
||||
local index = clicker:get_wield_index()
|
||||
local inv = clicker:get_inventory()
|
||||
inv:set_stack("main", index, held)
|
||||
end
|
||||
activate_tnt_minecart(self)
|
||||
end
|
||||
end, activate_tnt_minecart)
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -558,8 +795,25 @@ minetest.register_craft({
|
|||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_minecarts:tnt_minecart",
|
||||
recipe = {
|
||||
{"mcl_tnt:tnt"},
|
||||
{"mcl_minecarts:minecart"},
|
||||
},
|
||||
})
|
||||
|
||||
-- TODO: Re-enable crafting of special minecarts when they have been implemented
|
||||
if false then
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_minecarts:furnace_minecart",
|
||||
recipe = {
|
||||
{"mcl_furnaces:furnace"},
|
||||
{"mcl_minecarts:minecart"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_minecarts:hopper_minecart",
|
||||
recipe = {
|
||||
|
@ -576,19 +830,4 @@ minetest.register_craft({
|
|||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_minecarts:tnt_minecart",
|
||||
recipe = {
|
||||
{"mcl_tnt:tnt"},
|
||||
{"mcl_minecarts:minecart"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_minecarts:furnace_minecart",
|
||||
recipe = {
|
||||
{"mcl_furnaces:furnace"},
|
||||
{"mcl_minecarts:minecart"},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
|
35
mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.de.tr
Normal file
|
@ -0,0 +1,35 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=Lore
|
||||
Minecarts can be used for a quick transportion on rails.=Loren können für eine schnelle Fahrt auf Schienen benutzt werden.
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Loren fahren nur auf Schienen und bleiben immer auf der Strecke. An einer Einmündung ohne einem Weg nach vorne fahren sie nach links. Die Geschwindigkeit hängt vom Schienentyp ab.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Sie können die Lore auf Schienen platzieren. Rechtsklicken, um einzusteigen.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=Um die Lore aufzusammeln, schlagen Sie sie, während Sie die Schleichen-Taste gedrückt halten.
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=Eine Lore mit TNT ist ein explosives Fahrzeug, das auf Schienen fährt.
|
||||
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Auf Schienen platzieren. Zuschlagen zum Bewegen. Das TNT wird mit einem Feuerzeug angezündet, oder, wenn die Lore sich auf einer bestromten Aktivierungsschiene befindet.
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Um die Lore und das TNT zu erhalten, schlagen Sie sie, während Sie die Schleichtaste drücken. Das ist nicht möglich, wenn das TNT bereits gezündet wurde.
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Eine Lore mit Ofen ist ein Fahrzeug, das auf Rädern fährt. Sie kann mit Brennstoff angetrieben werden.
|
||||
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Auf Schienen platzieren. Wird Kohle eingefügt, wird der Ofen für eine lange Zeit brennen und die Lore wird fähig sein, sich selbst anzutreiben. Zuschlagen, um die Bewegung einzuläuten.
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=Um die Lore und den Ofen zu erhalten, schlagen Sie zu, während Sie die Schleichtaste drücken.
|
||||
Minecart with Chest=Lore mit Truhe
|
||||
Minecart with Furnace=Lore mit Ofen
|
||||
Minecart with Command Block=Lore mit Befehlsblock
|
||||
Minecart with Hopper=Lore mit Trichter
|
||||
Minecart with TNT=Lore mit TNT
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Bauen Sie sie auf den Boden, um Ihr Schienennetzwerk zu errichten, die Schienen werden sich automatisch verbinden und sich nach Bedarf in Kurven, Einmündungen, Kreuzungen und Steigungen verwandeln.
|
||||
Rail=Schiene
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Normale Schienen werden Loren aufgrund von Reibung leicht verlangsamen.
|
||||
Powered Rail=Antriebsschiene
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Antriebsschienen können Loren beschleunigen und abbremsen.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Ohne Redstone-Energie wird die Schiene Loren abbremsen. Mit Redstone-Energie wird sie sie beschleunigen.
|
||||
Activator Rail=Aktivierungsschiene
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Aktivierungsschienen werden benutzt, um besondere Loren zu aktivieren.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Wenn diese Schiene mit Redstone-Energie versorgt wird, werden alle Loren, die sie passieren, aktiviert.
|
||||
Detector Rail=Sensorschiene
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Eine Sensorschiene kann eine Lore erkennen und versorgt Redstone-Mechanismen.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Um eine Lore zu erkennen und die Redstone-Energie zu aktivieren, verbinden Sie die Schiene mit Redstonestaub oder Redstone-Mechanismen und schicken Sie eine beliebige Lore über die Schiene.
|
||||
Track for minecarts=Strecke für Loren
|
||||
Speed up when powered, slow down when not powered=Beschleunigt, wenn bestromt, sonst verlangsamt es
|
||||
Activates minecarts when powered=Aktiviert Loren, wenn bestromt
|
||||
Emits redstone power when a minecart is detected=Gibt ein Redstonesignal aus, wenn eine Lore erfasst wird
|
||||
Vehicle for fast travel on rails=Fahrzeug zum schnellen Transport auf Schienen
|
||||
Can be ignited by tools or powered activator rail=Kann mit Werkzeugen oder bestromten Aktivierungsschienen angezündet werden
|
23
mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.es.tr
Normal file
|
@ -0,0 +1,23 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=Vagoneta
|
||||
Minecarts can be used for a quick transportion on rails.=Las vagonetas se pueden usar para transportarse rápido en los rieles.
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Las vagonetas solo viajan en rieles y siempre siguen las pistas. En un cruce en T sin camino recto, giran a la izquierda. La velocidad se ve afectada por el tipo de riel.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Puedes colocar el vagoneta en los rieles. Haga clic derecho para insertarlo. Golpea para que se mueva.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=Para obtener el vagoneta, golpéalo mientras mantienes presionada la tecla.
|
||||
Minecart with Chest=Vagoneta con cofre
|
||||
Minecart with Furnace=Vagoneta con horno
|
||||
Minecart with Command Block=Vagoneta con bloque de comandos
|
||||
Minecart with Hopper=Vagoneta con tolva
|
||||
Minecart with TNT=Vagoneta con dinamita
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Colóquelos en el suelo para construir su ferrocarril, los rieles se conectarán automáticamente entre sí y se convertirán en curvas, uniones en T, cruces y pendientes según sea necesario.
|
||||
Rail=Raíl
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Los rieles normales ralentizan ligeramente las vagonetas debido a la fricción.
|
||||
Powered Rail=Raíl propulsor
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Los railes propulsores pueden acelerar y frenar las vagonetas.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Sin energía de redstone, el riel frenará las vagonetas. Para hacer que este riel acelere las vagonetas, aliméntalo con redstone.
|
||||
Activator Rail=Raíl activador
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Los railes activador se utilizan para activar una vagoneta especial.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Para hacer que este riel active las vagonetas, enciéndelo con energía de redstone y envía una vagoneta sobre este pedazo de riel.
|
||||
Detector Rail=Raíl detector
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Un raíl detector puede detectar una vagoneta sobre él y alimenta los mecanismos de redstone.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Para detectar una vagoneta y proporcionar energía de redstone, conéctelo a los senderos de redstone o mecanismos de redstone y envíe cualquier vagoneta sobre el riel.
|
35
mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr
Normal file
|
@ -0,0 +1,35 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=Wagonnet
|
||||
Minecarts can be used for a quick transportion on rails.=Les wagonnets peuvent être utilisés pour un transport rapide sur rails.
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Les wagonnets roulent uniquement sur des rails et suivent toujours les pistes. À un carrefour en T sans voie directe, ils tournent à gauche. La vitesse dépend du type de rail.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Vous pouvez placer le wagonnet sur des rails. Faites un clic droit dessus pour entrer dedans. Frappez-le pour le faire bouger.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=Pour obtenir la wagonnet, frappez-le tout en maintenant la touche furtive enfoncée.
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=Un wagonnet avec de la TNT est un véhicule explosif qui se déplace sur rail.
|
||||
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Placez-le sur des rails. Frappez-le pour le déplacer. Le TNT est allumé avec un briquet ou lorsque le minecart est sur un rail d'activation alimenté.
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Pour obtenir la wagonnet et la TNT, frappez-les tout en maintenant la touche furtive enfoncée. Vous ne pouvez pas faire cela si le TNT a été allumé.
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Une wagonnet avec un four est un véhicule qui se déplace sur rails. Il peut se propulser avec du carburant.
|
||||
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Placez-le sur des rails. Si vous lui donnez du charbon, le four commencera à brûler pendant longtemps et le wagonnet pourra se déplacer. Frappez-le pour le faire bouger.
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=Pour obtenir le wagonnet et le four, frappez-les tout en maintenant la touche furtive enfoncée.
|
||||
Minecart with Chest=Wagonnet avec Coffre
|
||||
Minecart with Furnace=Wagonnet avec Four
|
||||
Minecart with Command Block=Wagonnet avec Bloc de Commande
|
||||
Minecart with Hopper=Wagonnet avec Entonoir
|
||||
Minecart with TNT=Wagonnet avec TNT
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Placez-les sur le sol pour construire votre chemin de fer, les rails se connecteront automatiquement les uns aux autres et se transformeront en courbes, en jonctions en T, en traversées et en pentes au besoin.
|
||||
Rail=Rail
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Les rails ralentissent légèrement les wagonnets en raison de la friction.
|
||||
Powered Rail=Rail allimenté
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Les rails motorisés sont capables d'accélérer et de freiner les wagonnets.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Sans énergie de redstone, le rail freinera les wagonnets. Pour que ce rail accélère les minecarts, alimentez-le avec une source d'énergie redstone.
|
||||
Activator Rail=Rail d'activation
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Des rails activateurs sont utilisés pour activer des wagonnets spéciaux.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Pour activer ce rail, activez les wagonnets, alimentez-le avec de l'énergie redstone et envoyez un wagonnet sur ce morceau de rail.
|
||||
Detector Rail=Rail de détection
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Un rail de détection est capable de détecter un wagonnet au-dessus et alimente les mécanismes de redstone.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Pour détecter un wagonnet et fournir une alimentation redstone, connectez-le aux câble redstone ou aux mécanismes redstone et envoyez n'importe quel wagonnet sur le rail.
|
||||
Track for minecarts=Piste pour wagonnets
|
||||
Speed up when powered, slow down when not powered=Accélérez lorsqu'il est alimenté, ralentissez lorsqu'il n'est pas alimenté
|
||||
Activates minecarts when powered=Active les wagonnets lorsqu'il est alimenté
|
||||
Emits redstone power when a minecart is detected=Émet de l'énergie redstone lorsqu'un wagonnet est détecté
|
||||
Vehicle for fast travel on rails=Véhicule pour voyager rapidement sur rails
|
||||
Can be ignited by tools or powered activator rail=Peut être allumé par des outils ou un rail d'activation motorisé
|
35
mods/ENTITIES/mcl_minecarts/locale/template.txt
Normal file
|
@ -0,0 +1,35 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=
|
||||
Minecarts can be used for a quick transportion on rails.=
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=
|
||||
To obtain the minecart, punch it while holding down the sneak key.=
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=
|
||||
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=
|
||||
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=
|
||||
Minecart with Chest=
|
||||
Minecart with Furnace=
|
||||
Minecart with Command Block=
|
||||
Minecart with Hopper=
|
||||
Minecart with TNT=
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=
|
||||
Rail=
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=
|
||||
Powered Rail=
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=
|
||||
Activator Rail=
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=
|
||||
Detector Rail=
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=
|
||||
Track for minecarts=
|
||||
Speed up when powered, slow down when not powered=
|
||||
Activates minecarts when powered=
|
||||
Emits redstone power when a minecart is detected=
|
||||
Vehicle for fast travel on rails=
|
||||
Can be ignited by tools or powered activator rail=
|
|
@ -1,6 +1,8 @@
|
|||
local S = minetest.get_translator("mcl_minecarts")
|
||||
|
||||
-- Template rail function
|
||||
local register_rail = function(itemstring, tiles, def_extras, creative)
|
||||
local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=1,dig_by_water=1,destroy_by_lava_flow=1, transport=1}
|
||||
local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=minetest.raillike_group("rail"),dig_by_water=1,destroy_by_lava_flow=1, transport=1}
|
||||
if creative == false then
|
||||
groups.not_in_creative_inventory = 1
|
||||
end
|
||||
|
@ -21,6 +23,20 @@ local register_rail = function(itemstring, tiles, def_extras, creative)
|
|||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 3.5,
|
||||
_mcl_hardness = 0.7,
|
||||
after_destruct = function(pos)
|
||||
-- Scan for minecarts in this pos and force them to execute their "floating" check.
|
||||
-- Normally, this will make them drop.
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for o=1, #objs do
|
||||
local le = objs[o]:get_luaentity()
|
||||
if le then
|
||||
-- All entities in this mod are minecarts, so this works
|
||||
if string.sub(le.name, 1, 14) == "mcl_minecarts:" then
|
||||
le._last_float_check = mcl_minecarts.check_float_time
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
if def_extras then
|
||||
for k,v in pairs(def_extras) do
|
||||
|
@ -50,25 +66,27 @@ local rail_rules_long =
|
|||
|
||||
local rail_rules_short = mesecon.rules.pplate
|
||||
|
||||
local railuse = "Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed."
|
||||
local railuse = S("Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.")
|
||||
|
||||
-- Normal rail
|
||||
register_rail("mcl_minecarts:rail",
|
||||
{"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
|
||||
{
|
||||
description = "Rail",
|
||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.",
|
||||
description = S("Rail"),
|
||||
_tt_help = S("Track for minecarts"),
|
||||
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction."),
|
||||
_doc_items_usagehelp = railuse,
|
||||
}
|
||||
)
|
||||
|
||||
-- Powered rail (off = brake mode)
|
||||
register_rail("mcl_minecarts:golden_rail",
|
||||
{"carts_rail_pwr.png", "carts_rail_curved_pwr.png", "carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png"},
|
||||
{"mcl_minecarts_rail_golden.png", "mcl_minecarts_rail_golden_curved.png", "mcl_minecarts_rail_golden_t_junction.png", "mcl_minecarts_rail_golden_crossing.png"},
|
||||
{
|
||||
description = "Powered Rail",
|
||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.",
|
||||
_doc_items_usagehelp = railuse .. "\n" .. "Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.",
|
||||
description = S("Powered Rail"),
|
||||
_tt_help = S("Track for minecarts").."\n"..S("Speed up when powered, slow down when not powered"),
|
||||
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts."),
|
||||
_doc_items_usagehelp = railuse .. "\n" .. S("Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power."),
|
||||
_rail_acceleration = -3,
|
||||
mesecons = {
|
||||
conductor = {
|
||||
|
@ -104,21 +122,20 @@ register_rail("mcl_minecarts:golden_rail_on",
|
|||
register_rail("mcl_minecarts:activator_rail",
|
||||
{"mcl_minecarts_rail_activator.png", "mcl_minecarts_rail_activator_curved.png", "mcl_minecarts_rail_activator_t_junction.png", "mcl_minecarts_rail_activator_crossing.png"},
|
||||
{
|
||||
description = "Activator Rail",
|
||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.",
|
||||
_doc_items_usagehelp = railuse .. "\n" .. "To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.",
|
||||
description = S("Activator Rail"),
|
||||
_tt_help = S("Track for minecarts").."\n"..S("Activates minecarts when powered"),
|
||||
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts."),
|
||||
_doc_items_usagehelp = railuse .. "\n" .. S("To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail."),
|
||||
mesecons = {
|
||||
conductor = {
|
||||
state = mesecon.state.off,
|
||||
offstate = "mcl_minecarts:activator_rail",
|
||||
onstate = "mcl_minecarts:activator_rail_on",
|
||||
rules = rail_rules_long,
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Hidden from creative because no cart is using this rail so far.
|
||||
-- TODO: Remove this when the activator rail has become useful.
|
||||
false
|
||||
}
|
||||
)
|
||||
|
||||
-- Activator rail (on)
|
||||
|
@ -133,6 +150,20 @@ register_rail("mcl_minecarts:activator_rail_on",
|
|||
onstate = "mcl_minecarts:activator_rail_on",
|
||||
rules = rail_rules_long,
|
||||
},
|
||||
effector = {
|
||||
-- Activate minecarts
|
||||
action_on = function(pos, node)
|
||||
local pos2 = { x = pos.x, y =pos.y + 1, z = pos.z }
|
||||
local objs = minetest.get_objects_inside_radius(pos2, 1)
|
||||
for _, o in pairs(objs) do
|
||||
local l = o:get_luaentity()
|
||||
if l and string.sub(l.name, 1, 14) == "mcl_minecarts:" and l.on_activate_by_rail then
|
||||
l:on_activate_by_rail()
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
},
|
||||
drop = "mcl_minecarts:activator_rail",
|
||||
},
|
||||
|
@ -143,9 +174,10 @@ register_rail("mcl_minecarts:activator_rail_on",
|
|||
register_rail("mcl_minecarts:detector_rail",
|
||||
{"mcl_minecarts_rail_detector.png", "mcl_minecarts_rail_detector_curved.png", "mcl_minecarts_rail_detector_t_junction.png", "mcl_minecarts_rail_detector_crossing.png"},
|
||||
{
|
||||
description = "Detector Rail",
|
||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.",
|
||||
_doc_items_usagehelp = railuse .. "\n" .. "To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.",
|
||||
description = S("Detector Rail"),
|
||||
_tt_help = S("Track for minecarts").."\n"..S("Emits redstone power when a minecart is detected"),
|
||||
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms."),
|
||||
_doc_items_usagehelp = railuse .. "\n" .. S("To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail."),
|
||||
mesecons = {
|
||||
receptor = {
|
||||
state = mesecon.state.off,
|
||||
|
@ -191,9 +223,6 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
-- Activator rail crafting is disabled until it becomes useful.
|
||||
-- TODO: Enable crafting as needed.
|
||||
if false then
|
||||
minetest.register_craft({
|
||||
output = "mcl_minecarts:activator_rail 6",
|
||||
recipe = {
|
||||
|
@ -202,7 +231,6 @@ minetest.register_craft({
|
|||
{"mcl_core:iron_ingot", "mcl_core:stick", "mcl_core:iron_ingot"},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_minecarts:detector_rail 6",
|
||||
|
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 270 B |
Before Width: | Height: | Size: 259 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 256 B After Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
|
@ -1,8 +1,9 @@
|
|||
|
||||
Mobs Redo API
|
||||
=============
|
||||
Mobs Redo: MineClone 2 Edition
|
||||
API documentation
|
||||
==============================
|
||||
|
||||
Welcome to the world of mobs in minetest and hopefully an easy guide to defining
|
||||
Welcome to the world of mobs in Minetest and hopefully an easy guide to defining
|
||||
your own mobs and having them appear in your worlds.
|
||||
|
||||
|
||||
|
@ -27,10 +28,19 @@ functions needed for the mob to work properly which contains the following:
|
|||
"monster" attacks player or npc on sight.
|
||||
"npc" walk around and will defend themselves if hit first, they
|
||||
kill monsters.
|
||||
'hp_min' has the minimum health value the mob can spawn with.
|
||||
'hp_max' has the maximum health value the mob can spawn with.
|
||||
'armor' holds strength of mob, 100 is normal, lower is more powerful
|
||||
and needs more hits and better weapons to kill.
|
||||
'hp_min' the minimum health value the mob can spawn with.
|
||||
'hp_max' the maximum health value the mob can spawn with.
|
||||
'breath_max' The maximum breath value the mob can spawn with and can have.
|
||||
If -1 (default), mob does not take drowning damage.
|
||||
'breathes_in_water' If true, mob loses breath when not in water. Otherwise,
|
||||
mob loses breath when inside a node with `drowning` attribute
|
||||
set (default: false).
|
||||
'armor' entity armor groups (see lua_api.txt). If table, a list of
|
||||
armor groups like for entities. If number, set value of
|
||||
'fleshy' armor group only.
|
||||
Note: The 'immortal=1' armor group will automatically be added
|
||||
since this mod handles health and damage manually.
|
||||
Default: 100 (mob will take full dmg from 'fleshy' hits)
|
||||
'passive' when true allows animals to defend themselves when hit,
|
||||
otherwise they amble onwards.
|
||||
'walk_velocity' is the speed that your mob can walk around.
|
||||
|
@ -40,14 +50,14 @@ functions needed for the mob to work properly which contains the following:
|
|||
'jump' when true allows your mob to jump updwards.
|
||||
'jump_height' holds the height your mob can jump, 0 to disable jumping.
|
||||
'stepheight' height of a block that your mob can easily walk up onto,
|
||||
defaults to 1.1.
|
||||
defaults to 0.6.
|
||||
'fly' when true allows your mob to fly around instead of walking.
|
||||
'fly_in' holds the node name that the mob flies (or swims) around
|
||||
in e.g. "air" or "default:water_source".
|
||||
'fly_in' holds the node name or a table of node names in which the
|
||||
mob flies (or swims) around in. The special name
|
||||
'__airlike' stands for all nodes with 'walkable=false'
|
||||
that are not liquids
|
||||
'runaway' if true causes animals to turn and run away when hit.
|
||||
'view_range' how many nodes in distance the mob can see a player.
|
||||
'reach' how many nodes in distance a mob can attack a player while
|
||||
standing.
|
||||
'damage' how many health points the mob does to a player or another
|
||||
mob when melee attacking.
|
||||
'knock_back' when true has mobs falling backwards when hit, the greater
|
||||
|
@ -57,12 +67,14 @@ functions needed for the mob to work properly which contains the following:
|
|||
'fall_speed' has the maximum speed the mob can fall at, default is -10.
|
||||
'fall_damage' when true causes falling to inflict damage.
|
||||
'water_damage' holds the damage per second infliced to mobs when standing in
|
||||
water.
|
||||
water (default: 0).
|
||||
'lava_damage' holds the damage per second inflicted to mobs when standing
|
||||
in lava or fire.
|
||||
in lava (default: 8).
|
||||
'fire_damage' holds the damage per second inflicted to mobs when standing
|
||||
in fire (default: 1).
|
||||
'light_damage' holds the damage per second inflicted to mobs when it's too
|
||||
bright (above 13 light).
|
||||
'suffocation' when true causes mobs to suffocate inside solid blocks.
|
||||
'suffocation' when true causes mobs to suffocate inside solid blocks (2 damage per second).
|
||||
'floats' when set to 1 mob will float in water, 0 has them sink.
|
||||
'follow' mobs follow player when holding any of the items which appear
|
||||
on this table, the same items can be fed to a mob to tame or
|
||||
|
@ -79,6 +91,8 @@ functions needed for the mob to work properly which contains the following:
|
|||
punches when nearby.
|
||||
'group_attack' when true has same mob type grouping together to attack
|
||||
offender.
|
||||
[MCL2 extension:] When a table, this is a list of
|
||||
mob types that will get alerted as well (besides same mob type)
|
||||
'attack_type' tells the api what a mob does when attacking the player
|
||||
or another mob:
|
||||
'dogfight' is a melee attack when player is within mob reach.
|
||||
|
@ -115,10 +129,6 @@ functions needed for the mob to work properly which contains the following:
|
|||
e.g. {"player", "mobs_animal:chicken"}.
|
||||
'runaway_from' contains a table with mob names to run away from, add
|
||||
"player" to list to runaway from player also.
|
||||
'blood_amount' contains the number of blood droplets to appear when
|
||||
mob is hit.
|
||||
'blood_texture' has the texture name to use for droplets e.g.
|
||||
"mobs_blood.png", or table {"blood1.png", "blood2.png"}
|
||||
'pathfinding' set to 1 for mobs to use pathfinder feature to locate
|
||||
player, set to 2 so they can build/break also (only
|
||||
works with dogfight attack and when 'mobs_griefing'
|
||||
|
@ -132,16 +142,21 @@ functions needed for the mob to work properly which contains the following:
|
|||
'makes_footstep_sound' when true you can hear mobs walking.
|
||||
'sounds' this is a table with sounds of the mob
|
||||
'distance' maximum distance sounds can be heard, default is 10.
|
||||
'random' random sound that plays during gameplay.
|
||||
'war_cry' what you hear when mob starts to attack player.
|
||||
'base_pitch' base pitch to use adult mobs, default is 1.0 (MCL2 extension)
|
||||
'random' played randomly from time to time.
|
||||
also played for overfeeding animal.
|
||||
'war_cry' what you hear when mob starts to attack player. (currently disabled)
|
||||
'attack' what you hear when being attacked.
|
||||
'shoot_attack' sound played when mob shoots.
|
||||
'damage' sound heard when mob is hurt.
|
||||
'death' played when mob is killed.
|
||||
'jump' played when mob jumps.
|
||||
'jump' played when mob jumps. There's a built-in cooloff timer to avoid sound spam
|
||||
'fuse' sound played when mob explode timer starts.
|
||||
'explode' sound played when mob explodes.
|
||||
|
||||
Note: For all sounds except fuse and explode, the pitch is slightly randomized from the base pitch
|
||||
The pitch of children is 50% higher.
|
||||
|
||||
'drops' table of items that are dropped when mob is killed, fields are:
|
||||
'name' name of item to drop.
|
||||
'chance' chance of drop, 1 for always, 2 for 1-in-2 chance etc.
|
||||
|
@ -156,7 +171,9 @@ functions needed for the mob to work properly which contains the following:
|
|||
'mesh' uses separate object file to define mob.
|
||||
'visual_size' has the size of the mob, defaults to {x = 1, y = 1}
|
||||
'collisionbox' has the box in which mob can be interacted with the
|
||||
world e.g. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
world e.g. {-0.5, -0.5, -0.5, 0.5, 0.8, 0.5}.
|
||||
NOTE: Due to a workaround, the upper Y coordinate will be forced
|
||||
to a minimum value of 0.79.
|
||||
'selectionbox' has the box in which player can interact with mob
|
||||
'textures' holds a table list of textures to be used for mob, or you
|
||||
could use multiple lists inside another table for random
|
||||
|
@ -207,6 +224,25 @@ functions needed for the mob to work properly which contains the following:
|
|||
older mobs.
|
||||
|
||||
|
||||
MineClone 2 extensions:
|
||||
|
||||
'spawn_class' Classification of mod for the spawning algorithm:
|
||||
"hostile", "passive", "ambient" or "water"
|
||||
'ignores_nametag' if true, mob cannot be named by nametag
|
||||
'rain_damage' damage per second if mob is standing in rain (default: 0)
|
||||
'sunlight_damage' holds the damage per second inflicted to mobs when they
|
||||
are in direct sunlight
|
||||
'spawn_small_alternative': name of a smaller mob to use as replacement if
|
||||
spawning fails due to space requirements
|
||||
'glow' same as in entity definition
|
||||
'child' if true, spawn mob as child
|
||||
'shoot_arrow(self, pos, dir)' function that is called when mob wants to shoot an arrow.
|
||||
You can spawn your own arrow here. pos is mob position,
|
||||
dir is mob's aiming direction
|
||||
'sounds_child' same as sounds, but for childs. If not defined, childs will use same
|
||||
sound as adults but with higher pitch
|
||||
|
||||
|
||||
Node Replacement
|
||||
----------------
|
||||
|
||||
|
@ -225,8 +261,9 @@ eating.
|
|||
'replace_rate' how random should the replace rate be (typically 10)
|
||||
'replace_offset' +/- value to check specific node to replace
|
||||
|
||||
'on_replace(self, pos, oldnode, newnode)' is called when mob is about to
|
||||
replace a node.
|
||||
'on_replace(self, pos, oldnode, newnode)'
|
||||
is called when mob is about to replace a node. Also called
|
||||
when not actually replacing due to mobs_griefing setting being false.
|
||||
'self' ObjectRef of mob
|
||||
'pos' Position of node to replace
|
||||
'oldnode' Current node
|
||||
|
@ -280,12 +317,18 @@ for each mob.
|
|||
|
||||
'self.health' contains current health of mob (cannot exceed
|
||||
self.hp_max)
|
||||
'self.breath' contains current breath of mob, if mob takes drowning
|
||||
damage at all (cannot exceed self.breath_max). Breath
|
||||
decreases by 1 each second while in a node with drowning
|
||||
damage and increases by 1 each second otherwise.
|
||||
'self.texture_list' contains list of all mob textures
|
||||
'self.child_texture' contains mob child texture when growing up
|
||||
'self.base_texture' contains current skin texture which was randomly
|
||||
selected from textures list
|
||||
'self.gotten' this is used for obtaining milk from cow and wool from
|
||||
sheep
|
||||
'self.gotten' this is used to track whether some special item has been
|
||||
gotten from the mob, for example, wool from sheep.
|
||||
Initialized as false, and the mob must set this value
|
||||
manually.
|
||||
'self.horny' when animal fed enough it is set to true and animal can
|
||||
breed with same animal
|
||||
'self.hornytimer' background timer that controls breeding functions and
|
||||
|
@ -357,6 +400,16 @@ true the mob will not spawn.
|
|||
'name' is the name of the animal/monster
|
||||
|
||||
|
||||
MineClone 2 extensions
|
||||
----------------------
|
||||
|
||||
mobs:spawn_child(pos, mob_type)
|
||||
|
||||
This function spawns a mob as a child. The parameter mob_type is the
|
||||
entitystring of the new mob.
|
||||
This function returns the mob on success and nil otherwise.
|
||||
|
||||
|
||||
Making Arrows
|
||||
-------------
|
||||
|
||||
|
@ -376,7 +429,10 @@ This function registers a arrow for mobs with the attack type shoot.
|
|||
(self, player)
|
||||
'hit_mob' a function that is called when the arrow hits a mob;
|
||||
this function should hurt the mob, the parameters are
|
||||
(self, player)
|
||||
(self, mob)
|
||||
'hit_object' a function that is called when the arrow hits an object
|
||||
that is neither a player nor a mob. this function should
|
||||
hurt the object, the parameters are (self, object)
|
||||
'hit_node' a function that is called when the arrow hits a node, the
|
||||
parameters are (self, pos, node)
|
||||
'tail' when set to 1 adds a trail or tail to mob arrows
|
||||
|
@ -410,8 +466,6 @@ This function registers a spawn egg which can be used by admin to properly spawn
|
|||
Explosion Function
|
||||
------------------
|
||||
|
||||
mobs:explosion(pos, radius) -- DEPRECATED!!! use mobs:boom() instead
|
||||
|
||||
mobs:boom(self, pos, radius)
|
||||
'self' mob entity
|
||||
'pos' centre position of explosion
|
||||
|
@ -422,27 +476,20 @@ and damages any entity caught inside the blast radius. Protection will limit
|
|||
node destruction but not entity damage.
|
||||
|
||||
|
||||
Capturing Mobs
|
||||
--------------
|
||||
mobs:capture_mob
|
||||
----------------
|
||||
|
||||
mobs:capture_mob(self, clicker, chance_hand, chance_net, chance_lasso,
|
||||
force_take, replacewith)
|
||||
mobs:capture_mob(...)
|
||||
|
||||
This function is generally called inside the on_rightclick section of the mob
|
||||
api code, it provides a chance of capturing the mob by hand, using the net or
|
||||
lasso items, and can also have the player take the mob by force if tamed and
|
||||
replace with another item entirely.
|
||||
Does nothing and returns false.
|
||||
|
||||
'self' mob information
|
||||
'clicker' player information
|
||||
'chance_hand' chance of capturing mob by hand (1 to 100) 0 to disable
|
||||
'chance_net' chance of capturing mob using net (1 to 100) 0 to disable
|
||||
'chance_lasso' chance of capturing mob using magic lasso (1 to 100) 0 to
|
||||
disable
|
||||
'force_take' take mob by force, even if tamed (true or false)
|
||||
'replacewith' once captured replace mob with this item instead (overrides
|
||||
new mob eggs with saved information)
|
||||
This function is provided for compability with Mobs Redo for an attempt to
|
||||
capture a mob.
|
||||
Mobs cannot be captured in MineClone 2.
|
||||
|
||||
In Mobs Redo, this is generally called inside the on_rightclick section of the mob
|
||||
api code, it provides a chance of capturing the mob. See Mobs Redo documentation
|
||||
of parameters.
|
||||
|
||||
Feeding and Taming/Breeding
|
||||
---------------------------
|
||||
|
@ -561,19 +608,13 @@ External Settings for "minetest.conf"
|
|||
'enable_damage' if true monsters will attack players (default is true)
|
||||
'only_peaceful_mobs' if true only animals will spawn in game (default is
|
||||
false)
|
||||
'mobs_disable_blood' if false blood effects appear when mob is hit (default
|
||||
'mobs_disable_blood' if false, damage effects appear when mob is hit (default
|
||||
is false)
|
||||
'mobs_spawn_protected' if set to false then mobs will not spawn in protected
|
||||
areas (default is true)
|
||||
'remove_far_mobs' if true then mobs that are outside players visual
|
||||
range will be removed (default is false)
|
||||
'mobname' can change specific mob chance rate (0 to disable) and
|
||||
spawn number e.g. mobs_animal:cow = 1000,5
|
||||
'mob_difficulty' sets difficulty level (health and hit damage
|
||||
multiplied by this number), defaults to 1.0.
|
||||
'mob_show_health' if false then punching mob will not show health status
|
||||
(true by default)
|
||||
'mob_chance_multiplier' multiplies chance of all mobs spawning and can be set
|
||||
'mob_spawn_chance' multiplies chance of all mobs spawning and can be set
|
||||
to 0.5 to have mobs spawn more or 2.0 to spawn less.
|
||||
e.g. 1 in 7000 * 0.5 = 1 in 3500 so better odds of
|
||||
spawning.
|
||||
|
@ -700,7 +741,7 @@ mobs:register_mob("mob_horse:horse", {
|
|||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
minetest.add_item(clicker.get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
-- attach player to horse
|
16
mods/ENTITIES/mcl_mobs/crafts.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
local S = minetest.get_translator("mcl_mobs")
|
||||
|
||||
-- name tag
|
||||
minetest.register_craftitem("mcl_mobs:nametag", {
|
||||
description = S("Name Tag"),
|
||||
_tt_help = S("Give names to mobs").."\n"..S("Set name at anvil"),
|
||||
_doc_items_longdesc = S("A name tag is an item to name a mob."),
|
||||
_doc_items_usagehelp = S("Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag."),
|
||||
inventory_image = "mobs_nametag.png",
|
||||
wield_image = "mobs_nametag.png",
|
||||
stack_max = 64,
|
||||
groups = { tool=1 },
|
||||
})
|
||||
|
||||
minetest.register_alias("mobs:nametag", "mcl_mobs:nametag")
|
1
mods/ENTITIES/mcl_mobs/description.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Adds a mob API for mods to add animals or monsters, etc.
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
local path = minetest.get_modpath("mobs")
|
||||
local path = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
-- Mob API
|
||||
dofile(path .. "/api.lua")
|
||||
|
@ -9,5 +9,3 @@ dofile(path .. "/mount.lua")
|
|||
|
||||
-- Mob Items
|
||||
dofile(path .. "/crafts.lua")
|
||||
|
||||
minetest.log("action", "[MOD] Mobs Redo loaded")
|
11
mods/ENTITIES/mcl_mobs/locale/mcl_mobs.de.tr
Normal file
|
@ -0,0 +1,11 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=Friedlicher Modus aktiv! Es werden keine Monster auftauchen.
|
||||
This allows you to place a single mob.=Damit kann man einen Mob platzieren.
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Platzieren Sie dies einfach dort, wo der Mob auftauchen soll. Tiere werden zahm erscheinen, außer, wenn Sie beim Platzieren die Schlichtaste drücken. Platzieren Sie dies auf einem Mobspawner, um den Mob im Mobspawner zu wechseln.
|
||||
You need the “maphack” privilege to change the mob spawner.=Sie brauchen das „maphack“-Privileg, um den Mobspawner ändern zu können.
|
||||
Name Tag=Namensschild
|
||||
A name tag is an item to name a mob.=Ein Namensschild ist ein Gegenstand, um einen Mob zu benennen.
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Bevor Sie ein Namensschild benutzen können, müssen Sie ihn an einem Amboss benennen. Dann können können Sie das Namensschild benutztn, um einen Mob zu benennen. Das wird das Namensschild verbrauchen.
|
||||
Only peaceful mobs allowed!=Nur friedliche Mobs erlaubt!
|
||||
Give names to mobs=Benennt Mobs
|
||||
Set name at anvil=Namen am Amboss setzen
|
9
mods/ENTITIES/mcl_mobs/locale/mcl_mobs.es.tr
Normal file
|
@ -0,0 +1,9 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=¡Modo pacífico activo! No aparecerán monstruos.
|
||||
This allows you to place a single mob.=Esto le permite colocar un solo animal.
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Simplemente colóquelo donde desea que aparezcan los animales. Los animales aparecerán domesticados, a menos que mantenga presionada la tecla de sigilo mientras coloca. Si coloca esto en un engendrador de animales, cambia el animal que genera.
|
||||
You need the “maphack” privilege to change the mob spawner.=Necesita el privilegio "maphack" para cambiar el generador de animales.
|
||||
Name Tag=Etiqueta
|
||||
A name tag is an item to name a mob.=Una etiqueta es un elemento para nombrar una animal.
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Antes de usar la etiqueta, debe establecer un nombre en un yunque. Luego puede usar la etiqueta para nombrar un animal. Esto usa la etiqueta.
|
||||
Only peaceful mobs allowed!=¡Solo se permiten animales pacíficos!
|
11
mods/ENTITIES/mcl_mobs/locale/mcl_mobs.fr.tr
Normal file
|
@ -0,0 +1,11 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=Mode paisible actif! Aucun monstre n'apparaîtra.
|
||||
This allows you to place a single mob.=Cela vous permet de placer un seul mob.
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Placez-le là où vous voulez que le mob apparaisse. Les animaux apparaîtront apprivoisés, sauf si vous maintenez la touche furtive enfoncée pendant le placement. Si vous le placez sur un générateur de mob, vous changez le mob qu'il génère.
|
||||
You need the “maphack” privilege to change the mob spawner.=Vous avez besoin du privilège "maphack" pour changer le générateur de mob.
|
||||
Name Tag=Étiquette de nom
|
||||
A name tag is an item to name a mob.=Une étiquette de nom est un élément pour nommer un mob.
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Avant d'utiliser l'étiquette de nom, vous devez définir un nom sur une enclume. Ensuite, vous pouvez utiliser l'étiquette de nom pour nommer un mob. Cela utilise l'étiquette de nom.
|
||||
Only peaceful mobs allowed!=Seuls les mobs pacifiques sont autorisées!
|
||||
Give names to mobs=Donne des noms aux mobs
|
||||
Set name at anvil=Définir le nom sur l'enclume
|
11
mods/ENTITIES/mcl_mobs/locale/template.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=
|
||||
This allows you to place a single mob.=
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=
|
||||
You need the “maphack” privilege to change the mob spawner.=
|
||||
Name Tag=
|
||||
A name tag is an item to name a mob.=
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=
|
||||
Only peaceful mobs allowed!=
|
||||
Give names to mobs=
|
||||
Set name at anvil=
|
8
mods/ENTITIES/mcl_mobs/lucky_block.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
if minetest.get_modpath("lucky_block") then
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"dro", {"mcl_mobs:nametag"}, 1},
|
||||
{"lig"},
|
||||
})
|
||||
end
|
2
mods/ENTITIES/mcl_mobs/mod.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = mcl_mobs
|
||||
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor
|
|
@ -121,7 +121,7 @@ end)
|
|||
|
||||
function mobs.attach(entity, player)
|
||||
|
||||
local attach_at, eye_offset = {}, {}
|
||||
local attach_at, eye_offset
|
||||
|
||||
entity.player_rotation = entity.player_rotation or {x = 0, y = 0, z = 0}
|
||||
entity.driver_attach_at = entity.driver_attach_at or {x = 0, y = 0, z = 0}
|
||||
|
@ -151,11 +151,13 @@ function mobs.attach(entity, player)
|
|||
}
|
||||
})
|
||||
|
||||
minetest.after(0.2, function()
|
||||
mcl_player.player_set_animation(player, "sit" , 30)
|
||||
end)
|
||||
minetest.after(0.2, function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
mcl_player.player_set_animation(player, "sit" , 30)
|
||||
end
|
||||
end, player:get_player_name())
|
||||
|
||||
--player:set_look_yaw(entity.object:get_yaw() - rot_view)
|
||||
player:set_look_horizontal(entity.object:get_yaw() - rot_view)
|
||||
end
|
||||
|
||||
|
@ -170,30 +172,31 @@ function mobs.detach(player, offset)
|
|||
|
||||
pos = {x = pos.x + offset.x, y = pos.y + 0.2 + offset.y, z = pos.z + offset.z}
|
||||
|
||||
minetest.after(0.1, function()
|
||||
player:setpos(pos)
|
||||
end)
|
||||
minetest.after(0.1, function(name, pos)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
player:set_pos(pos)
|
||||
end
|
||||
end, player:get_player_name(), pos)
|
||||
end
|
||||
|
||||
|
||||
function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||
|
||||
local rot_steer, rot_view = math.pi/2, 0
|
||||
local rot_view = 0
|
||||
|
||||
if entity.player_rotation.y == 90 then
|
||||
rot_steer, rot_view = 0, math.pi/2
|
||||
rot_view = math.pi/2
|
||||
end
|
||||
|
||||
local acce_y = 0
|
||||
local velo = entity.object:getvelocity()
|
||||
local velo = entity.object:get_velocity()
|
||||
|
||||
entity.v = get_v(velo) * get_sign(entity.v)
|
||||
|
||||
-- process controls
|
||||
if entity.driver then
|
||||
|
||||
--print ("---velo", get_v(velo))
|
||||
|
||||
local ctrl = entity.driver:get_player_control()
|
||||
|
||||
-- move forwards
|
||||
|
@ -212,7 +215,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
end
|
||||
|
||||
-- fix mob rotation
|
||||
entity.object:setyaw(entity.driver:get_look_horizontal() - entity.rotate)
|
||||
entity.object:set_yaw(entity.driver:get_look_horizontal() - entity.rotate)
|
||||
|
||||
if can_fly then
|
||||
|
||||
|
@ -259,7 +262,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- set moving animation
|
||||
if moving_anim then
|
||||
mobs:set_animation(entity, moving_anim)
|
||||
|
@ -272,7 +275,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
|
||||
if s ~= get_sign(entity.v) then
|
||||
|
||||
entity.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
entity.object:set_velocity({x = 0, y = 0, z = 0})
|
||||
entity.v = 0
|
||||
return
|
||||
end
|
||||
|
@ -290,7 +293,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
|
||||
-- Set position, velocity and acceleration
|
||||
local p = entity.object:get_pos()
|
||||
local new_velo = {x = 0, y = 0, z = 0}
|
||||
local new_velo
|
||||
local new_acce = {x = 0, y = -9.8, z = 0}
|
||||
|
||||
p.y = p.y - 0.5
|
||||
|
@ -315,7 +318,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
minetest.sound_play("default_punch", {
|
||||
object = entity.object,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
}, true)
|
||||
|
||||
entity.object:punch(entity.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
|
@ -345,7 +348,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
if math.abs(velo.y) < 1 then
|
||||
local pos = entity.object:get_pos()
|
||||
pos.y = math.floor(pos.y) + 0.5
|
||||
entity.object:setpos(pos)
|
||||
entity.object:set_pos(pos)
|
||||
velo.y = 0
|
||||
end
|
||||
end
|
||||
|
@ -357,8 +360,8 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
new_velo = get_velocity(v, entity.object:get_yaw() - rot_view, velo.y)
|
||||
new_acce.y = new_acce.y + acce_y
|
||||
|
||||
entity.object:setvelocity(new_velo)
|
||||
entity.object:setacceleration(new_acce)
|
||||
entity.object:set_velocity(new_velo)
|
||||
entity.object:set_acceleration(new_acce)
|
||||
|
||||
-- CRASH!
|
||||
if enable_crash then
|
||||
|
@ -367,8 +370,6 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
|
||||
if intensity >= crash_threshold then
|
||||
|
||||
--print("----------- crash", intensity)
|
||||
|
||||
entity.object:punch(entity.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = intensity}
|
||||
|
@ -386,34 +387,29 @@ end
|
|||
function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
|
||||
|
||||
local ctrl = entity.driver:get_player_control()
|
||||
local velo = entity.object:getvelocity()
|
||||
local velo = entity.object:get_velocity()
|
||||
local dir = entity.driver:get_look_dir()
|
||||
local yaw = entity.driver:get_look_horizontal() + 1.57 -- offset fix between old and new commands
|
||||
local rot_steer, rot_view = math.pi / 2, 0
|
||||
|
||||
if entity.player_rotation.y == 90 then
|
||||
rot_steer, rot_view = 0, math.pi / 2
|
||||
end
|
||||
|
||||
if ctrl.up then
|
||||
entity.object:setvelocity({
|
||||
entity.object:set_velocity({
|
||||
x = dir.x * speed,
|
||||
y = dir.y * speed + 2,
|
||||
z = dir.z * speed
|
||||
})
|
||||
|
||||
elseif ctrl.down then
|
||||
entity.object:setvelocity({
|
||||
entity.object:set_velocity({
|
||||
x = -dir.x * speed,
|
||||
y = dir.y * speed + 2,
|
||||
z = -dir.z * speed
|
||||
})
|
||||
|
||||
elseif not ctrl.down or ctrl.up or ctrl.jump then
|
||||
entity.object:setvelocity({x = 0, y = -2, z = 0})
|
||||
entity.object:set_velocity({x = 0, y = -2, z = 0})
|
||||
end
|
||||
|
||||
entity.object:setyaw(yaw + math.pi + math.pi / 2 - entity.rotate)
|
||||
entity.object:set_yaw(yaw + math.pi + math.pi / 2 - entity.rotate)
|
||||
|
||||
-- firing arrows
|
||||
if ctrl.LMB and ctrl.sneak and shoots then
|
||||
|
@ -430,8 +426,8 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
|
|||
ent.owner_id = tostring(entity.object) -- so arrows dont hurt entity you are riding
|
||||
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
|
||||
local yaw = entity.driver:get_look_horizontal()
|
||||
obj:setyaw(yaw + math.pi / 2)
|
||||
obj:setvelocity(vec)
|
||||
obj:set_yaw(yaw + math.pi / 2)
|
||||
obj:set_velocity(vec)
|
||||
else
|
||||
obj:remove()
|
||||
end
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
MOBS REDO for MINETEST
|
||||
Mobs Redo: MineClone 2 Edition
|
||||
|
||||
Based on Mobs Redo from TenPlus1
|
||||
Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint.
|
||||
|
||||
|
||||
|
@ -10,18 +11,15 @@ This mod contains the API only for adding your own mobs into the world, so pleas
|
|||
https://forum.minetest.net/viewtopic.php?f=11&t=9917
|
||||
|
||||
|
||||
Crafts:
|
||||
Items:
|
||||
|
||||
- Nametag (paper, black dye, string) can be used right-click on a tamed mob to give them a name.
|
||||
- Nets can be used to right-click tamed mobs to pick them up and place inside inventory as a spawn egg.
|
||||
- Magic Lasso is similar to nets but with a better chance of picking up larger mobs.
|
||||
- Shears are used to right-click sheep and return 1-3 wool.
|
||||
- Protection Rune lets you protect tamed mobs from harm by other players
|
||||
- Nametag (paper, black dye, string) can be used right-click on a tamed mob to give them a name.
|
||||
|
||||
Lucky Blocks: 9
|
||||
Lucky Block items: 1
|
||||
|
||||
|
||||
Changelog:
|
||||
Changelog from original Mobs Redo mod:
|
||||
- 1.41- Mob pathfinding has been updated thanks to Elkien3
|
||||
- 1.40- Updated to use newer functions, requires Minetest 0.4.16+ to work.
|
||||
- 1.39- Added 'on_breed', 'on_grown' and 'do_punch' custom functions per mob
|
||||
- 1.38- Better entity checking, nametag setting and on_spawn function added to mob registry, tweaked light damage
|
BIN
mods/ENTITIES/mcl_mobs/textures/mobs_blood.png
Normal file
After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
276
mods/ENTITIES/mcl_paintings/init.lua
Normal file
|
@ -0,0 +1,276 @@
|
|||
mcl_paintings = {}
|
||||
|
||||
dofile(minetest.get_modpath(minetest.get_current_modname()).."/paintings.lua")
|
||||
|
||||
local S = minetest.get_translator("mcl_paintings")
|
||||
|
||||
local wood = "[combine:16x16:-192,0=mcl_paintings_paintings.png"
|
||||
|
||||
-- Check if there's a painting for provided painting size.
|
||||
-- If yes, returns the arguments.
|
||||
-- If not, returns the next smaller available painting.
|
||||
local shrink_painting = function(x, y)
|
||||
if x > 4 or y > 4 then
|
||||
return nil
|
||||
end
|
||||
local xstart = x
|
||||
local painting
|
||||
while not painting do
|
||||
painting = mcl_paintings.paintings[y] and mcl_paintings.paintings[y][x]
|
||||
if type(painting) == "table" then
|
||||
break
|
||||
elseif type(painting) == "number" then
|
||||
x = painting
|
||||
painting = nil
|
||||
else
|
||||
x = xstart
|
||||
y = y - 1
|
||||
end
|
||||
if y < 1 then
|
||||
return nil
|
||||
end
|
||||
end
|
||||
if type(painting) == "table" then
|
||||
return x, y
|
||||
end
|
||||
end
|
||||
|
||||
local get_painting = function(x, y, motive)
|
||||
local painting = mcl_paintings.paintings[y] and mcl_paintings.paintings[y][x] and mcl_paintings.paintings[y][x][motive]
|
||||
if not painting then
|
||||
return nil
|
||||
end
|
||||
local px, py = -painting.cx, -painting.cy
|
||||
local sx, sy = 16*x, 16*y
|
||||
return "[combine:"..sx.."x"..sy..":"..px..","..py.."=mcl_paintings_paintings.png"
|
||||
end
|
||||
|
||||
local get_random_painting = function(x, y)
|
||||
if not mcl_paintings.paintings[y] or not mcl_paintings.paintings[y][x] then
|
||||
return nil
|
||||
end
|
||||
local max = #mcl_paintings.paintings[y][x]
|
||||
if max < 1 then
|
||||
return nil
|
||||
end
|
||||
local r = math.random(1, max)
|
||||
return get_painting(x, y, r), r
|
||||
end
|
||||
|
||||
local size_to_minmax = function(size)
|
||||
local min, max
|
||||
if size == 2 then
|
||||
min = -0.5
|
||||
max = 1.5
|
||||
elseif size == 3 then
|
||||
min = -1.5
|
||||
max = 1.5
|
||||
elseif size == 4 then
|
||||
min = -1.5
|
||||
max = 2.5
|
||||
else
|
||||
min = -0.5
|
||||
max = 0.5
|
||||
end
|
||||
return min, max
|
||||
end
|
||||
|
||||
local size_to_minmax_entity = function(size)
|
||||
return -size/2, size/2
|
||||
end
|
||||
|
||||
local set_entity = function(object)
|
||||
local ent = object:get_luaentity()
|
||||
local wallm = ent._facing
|
||||
local xsize = ent._xsize
|
||||
local ysize = ent._ysize
|
||||
local exmin, exmax = size_to_minmax_entity(xsize)
|
||||
local eymin, eymax = size_to_minmax_entity(ysize)
|
||||
local visual_size = { x=xsize-0.0001, y=ysize-0.0001, z=1/32 }
|
||||
if not ent._xsize or not ent._ysize or not ent._motive then
|
||||
minetest.log("error", "[mcl_paintings] Painting loaded with missing painting values!")
|
||||
return
|
||||
end
|
||||
local painting = get_painting(xsize, ysize, ent._motive)
|
||||
if not painting then
|
||||
minetest.log("error", "[mcl_paintings] No painting found for size "
|
||||
..xsize..","..ysize..", motive number "..ent._motive.."!")
|
||||
return
|
||||
end
|
||||
if wallm == 4 or wallm == 5 then
|
||||
object:set_properties({
|
||||
selectionbox = { exmin, eymin, -1/64, exmax, eymax, 1/64 },
|
||||
visual_size = visual_size,
|
||||
textures = { wood, wood, wood, wood, painting, wood },
|
||||
})
|
||||
else
|
||||
object:set_properties({
|
||||
selectionbox = { -1/64, eymin, exmin, 1/64, eymax, exmax },
|
||||
visual_size = visual_size,
|
||||
textures = { wood, wood, wood, wood, painting, wood },
|
||||
})
|
||||
end
|
||||
local dir = minetest.wallmounted_to_dir(wallm)
|
||||
if not dir then
|
||||
return
|
||||
end
|
||||
object:set_yaw(minetest.dir_to_yaw(dir))
|
||||
end
|
||||
|
||||
minetest.register_entity("mcl_paintings:painting", {
|
||||
visual = "cube",
|
||||
visual_size = { x=0.999, y=0.999, z=1/32 },
|
||||
selectionbox = { -1/64, -0.5, -0.5, 1/64, 0.5, 0.5 },
|
||||
physical = false,
|
||||
collide_with_objects = false,
|
||||
textures = { wood, wood, wood, wood, wood, wood },
|
||||
hp_max = 1,
|
||||
|
||||
_motive = 0,
|
||||
_pos = nil,
|
||||
_facing = 2,
|
||||
_xsize = 1,
|
||||
_ysize = 1,
|
||||
on_activate = function(self, staticdata)
|
||||
if staticdata and staticdata ~= "" then
|
||||
local data = minetest.deserialize(staticdata)
|
||||
if data then
|
||||
self._facing = data._facing
|
||||
self._pos = data._pos
|
||||
self._motive = data._motive
|
||||
self._xsize = data._xsize
|
||||
self._ysize = data._ysize
|
||||
end
|
||||
end
|
||||
set_entity(self.object)
|
||||
end,
|
||||
get_staticdata = function(self)
|
||||
local data = {
|
||||
_facing = self._facing,
|
||||
_pos = self._pos,
|
||||
_motive = self._motive,
|
||||
_xsize = self._xsize,
|
||||
_ysize = self._ysize,
|
||||
}
|
||||
return minetest.serialize(data)
|
||||
end,
|
||||
on_death = function(self, killer)
|
||||
-- Drop as item on death
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
local pos = self._pos
|
||||
if not pos then
|
||||
pos = self.object:get_pos()
|
||||
end
|
||||
minetest.add_item(pos, "mcl_paintings:painting")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_paintings:painting", {
|
||||
description = S("Painting"),
|
||||
inventory_image = "mcl_paintings_painting.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
|
||||
dir = vector.normalize(dir)
|
||||
if dir.y ~= 0 then
|
||||
-- Ceiling/floor paintings are not supported
|
||||
return itemstack
|
||||
end
|
||||
local wallm = minetest.dir_to_wallmounted(dir)
|
||||
if wallm then
|
||||
local ppos = pointed_thing.above
|
||||
local xmax
|
||||
local ymax = 4
|
||||
local xmaxes = {}
|
||||
local ymaxed = false
|
||||
local negative = dir.x < 0 or dir.z > 0
|
||||
-- Check maximum possible painting size
|
||||
local t
|
||||
for y=0,3 do
|
||||
for x=0,3 do
|
||||
local k = x
|
||||
if negative then
|
||||
k = -k
|
||||
end
|
||||
if dir.z ~= 0 then
|
||||
t = {x=k,y=y,z=0}
|
||||
else
|
||||
t = {x=0,y=y,z=k}
|
||||
end
|
||||
local unode = minetest.get_node(vector.add(pointed_thing.under, t))
|
||||
local anode = minetest.get_node(vector.add(ppos, t))
|
||||
local udef = minetest.registered_nodes[unode.name]
|
||||
local adef = minetest.registered_nodes[anode.name]
|
||||
if (not (udef and udef.walkable)) or (not adef or adef.walkable) then
|
||||
xmaxes[y+1] = x
|
||||
if x == 0 and not ymaxed then
|
||||
ymax = y
|
||||
ymaxed = true
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
if not xmaxes[y] then
|
||||
xmaxes[y] = 4
|
||||
end
|
||||
end
|
||||
xmax = math.max(unpack(xmaxes))
|
||||
|
||||
local xsize, ysize = xmax, ymax
|
||||
xsize, ysize = shrink_painting(xsize, ysize)
|
||||
if not xsize then
|
||||
return itemstack
|
||||
end
|
||||
local _, exmax = size_to_minmax_entity(xsize)
|
||||
local _, eymax = size_to_minmax_entity(ysize)
|
||||
local pposa = vector.subtract(ppos, vector.multiply(dir, 0.5-2/64))
|
||||
local pexmax
|
||||
local peymax = eymax - 0.5
|
||||
if negative then
|
||||
pexmax = -exmax + 0.5
|
||||
else
|
||||
pexmax = exmax - 0.5
|
||||
end
|
||||
if dir.z ~= 0 then
|
||||
pposa = vector.add(pposa, {x=pexmax, y=peymax, z=0})
|
||||
else
|
||||
pposa = vector.add(pposa, {x=0, y=peymax, z=pexmax})
|
||||
end
|
||||
local painting, pid = get_random_painting(xsize, ysize)
|
||||
if not painting then
|
||||
minetest.log("error", "[mcl_paintings] No painting found for size "..xsize..","..ysize.."!")
|
||||
return itemstack
|
||||
end
|
||||
local staticdata = {
|
||||
_facing = wallm,
|
||||
_pos = ppos,
|
||||
_motive = pid,
|
||||
_xsize = xsize,
|
||||
_ysize = ysize,
|
||||
}
|
||||
local obj = minetest.add_entity(pposa, "mcl_paintings:painting", minetest.serialize(staticdata))
|
||||
if not obj then
|
||||
return itemstack
|
||||
end
|
||||
else
|
||||
return itemstack
|
||||
end
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_paintings:painting",
|
||||
recipe = {
|
||||
{ "mcl_core:stick", "mcl_core:stick", "mcl_core:stick" },
|
||||
{ "mcl_core:stick", "group:wool", "mcl_core:stick" },
|
||||
{ "mcl_core:stick", "mcl_core:stick", "mcl_core:stick" },
|
||||
}
|
||||
})
|
||||
|
2
mods/ENTITIES/mcl_paintings/locale/mcl_paintings.de.tr
Normal file
|
@ -0,0 +1,2 @@
|
|||
# textdomain:mcl_paintings
|
||||
Painting=Gemälde
|
2
mods/ENTITIES/mcl_paintings/locale/template.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
# textdomain:mcl_paintings
|
||||
Painting=
|
1
mods/ENTITIES/mcl_paintings/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = mcl_paintings
|
55
mods/ENTITIES/mcl_paintings/paintings.lua
Normal file
|
@ -0,0 +1,55 @@
|
|||
local TS = 16 -- texture size
|
||||
|
||||
mcl_paintings.paintings = {
|
||||
[1] = {
|
||||
[1] = {
|
||||
{ cx = 0, cy = 0 },
|
||||
{ cx = TS, cy = 0 },
|
||||
{ cx = 2*TS, cy = 0 },
|
||||
{ cx = 3*TS, cy = 0 },
|
||||
{ cx = 4*TS, cy = 0 },
|
||||
{ cx = 5*TS, cy = 0 },
|
||||
{ cx = 6*TS, cy = 0 },
|
||||
},
|
||||
[2] = {
|
||||
{ cx = 0, cy = 2*TS },
|
||||
{ cx = 2*TS, cy = 2*TS },
|
||||
{ cx = 4*TS, cy = 2*TS },
|
||||
{ cx = 6*TS, cy = 2*TS },
|
||||
{ cx = 8*TS, cy = 2*TS },
|
||||
},
|
||||
[3] = 2,
|
||||
[4] = 2,
|
||||
},
|
||||
[2] = {
|
||||
[1] = {
|
||||
{ cx = 0, cy = 4*TS },
|
||||
{ cx = TS, cy = 4*TS },
|
||||
},
|
||||
[2] = {
|
||||
{ cx = 0, cy = 8*TS },
|
||||
{ cx = 2*TS, cy = 8*TS },
|
||||
{ cx = 4*TS, cy = 8*TS },
|
||||
{ cx = 6*TS, cy = 8*TS },
|
||||
{ cx = 8*TS, cy = 8*TS },
|
||||
{ cx = 10*TS, cy = 8*TS },
|
||||
},
|
||||
[3] = 2,
|
||||
[4] = {
|
||||
{ cx = 0, cy = 6*TS },
|
||||
},
|
||||
},
|
||||
[3] = {
|
||||
[4] = {
|
||||
{ cx = 12*TS, cy = 4*TS },
|
||||
{ cx = 12*TS, cy = 7*TS },
|
||||
},
|
||||
},
|
||||
[4] = {
|
||||
[4] = {
|
||||
{ cx = 0, cy = 12*TS },
|
||||
{ cx = 4*TS, cy = 12*TS },
|
||||
{ cx = 8*TS, cy = 12*TS },
|
||||
},
|
||||
},
|
||||
}
|
BIN
mods/ENTITIES/mcl_paintings/textures/mcl_paintings_painting.png
Normal file
After Width: | Height: | Size: 229 B |
BIN
mods/ENTITIES/mcl_paintings/textures/mcl_paintings_paintings.png
Normal file
After Width: | Height: | Size: 46 KiB |
|
@ -1,14 +0,0 @@
|
|||
|
||||
local S = mobs.intllib
|
||||
|
||||
-- name tag
|
||||
minetest.register_craftitem("mobs:nametag", {
|
||||
description = S("Name Tag"),
|
||||
_doc_items_longdesc = S("A name tag is an item to name an animal."),
|
||||
_doc_items_usagehelp = S("Before you use the name tag, you need to set a name at an anvil. Now you can use the name tag to name an animal with a rightclick. This uses up the name tag."),
|
||||
inventory_image = "mobs_nametag.png",
|
||||
wield_image = "mobs_nametag.png",
|
||||
stack_max = 64,
|
||||
groups = { tool=1 },
|
||||
})
|
||||
|