forked from VoxeLibre/VoxeLibre
Compare commits
323 Commits
api-cauldr
...
master
Author | SHA1 | Date |
---|---|---|
AFCMS | b0cf07a020 | |
AFCMS | e36a8c5acf | |
AFCMS | b2af00db22 | |
AFCMS | e8134345d4 | |
AFCMS | e0c7e938de | |
AFCMS | 47fff66a41 | |
ztianyang | ac8383dd4b | |
NO11 | c6003398b5 | |
Lizzy Fleckenstein | 27e4bd6d09 | |
Nils Dagsson Moskopp | 256de2bc36 | |
sfan5 | 693a5317ef | |
Nils Dagsson Moskopp | 95c4d6472b | |
Wuzzy | 1c192f4fbb | |
NO11 | 1a5339e907 | |
NO11 | aa930dc2b8 | |
NO11 | 79463738f6 | |
NO11 | 79d8593d34 | |
NO11 | dc8436fdf9 | |
NO11 | f41cea71fd | |
NO11 | 5fedd914fb | |
Elias Fleckenstein | a8d09338a9 | |
NO11 | 872e3e74d3 | |
NO11 | bf62eb33fa | |
NO11 | 0da7b3fbda | |
Elias Fleckenstein | 3669321828 | |
NO11 | ca086109bf | |
NO11 | 6c6d40eb9d | |
NO11 | f0af15fcd8 | |
AFCMS | af8e88f44c | |
AFCMS | 2d1a43396f | |
AFCMS | df4b8e64cc | |
AFCMS | 40898d3e9d | |
AFCMS | 58a292a4f3 | |
AFCMS | fe62189019 | |
NO11 | 4802b610c3 | |
NO11 | cb55c36863 | |
NO11 | f8dcf05670 | |
NO11 | 7e0bb036f4 | |
NO11 | 664c238137 | |
Elias Fleckenstein | efab5a1cf5 | |
NO11 | d76a7daf2d | |
Emily | 5bb57a81ad | |
Emily | df0c1f1dd1 | |
NO11 | 5c563d6ffd | |
NO11 | 4aabd7d9e7 | |
Elias Fleckenstein | 88f253bf66 | |
NO11 | 289ba826ba | |
NO11 | 4846076c8f | |
NO11 | 5c5c405ccf | |
NO11 | 65d33b935a | |
NO11 | c05e57efb1 | |
NO11 | e44e9eaf62 | |
NO11 | 09a68443cd | |
NO11 | 75b425ffd7 | |
NO11 | 0a9ea7e46a | |
NO11 | a44d9643ae | |
AFCMS | a47630035d | |
AFCMS | 667ef5cad5 | |
AFCMS | fef23d0b6f | |
NO11 | a0d52010bf | |
AFCMS | 44063bca93 | |
AFCMS | e58bb6d859 | |
NO11 | 31d3ea8a87 | |
AFCMS | 13536baed8 | |
AFCMS | 6069bb4a38 | |
AFCMS | c31c852a6e | |
AFCMS | b5f7ae5458 | |
AFCMS | 9254bab971 | |
AFCMS | 999b82c94a | |
NO11 | a83dd8548f | |
Tianyang Zhang | 559cf85c94 | |
NO11 | 96e8e6a86f | |
NO11 | 801d9a2571 | |
NO11 | f2a4d6bd56 | |
NO11 | 48166625d4 | |
NO11 | a2e0cf83bc | |
AFCMS | b364faa7c7 | |
Tianyang Zhang | 60fcafeee4 | |
SmallJoker | 9d9e213012 | |
AFCMS | 49bde37a5e | |
AFCMS | dc17cc91a3 | |
AFCMS | 873a1e73dc | |
AFCMS | 8fff20eec9 | |
AFCMS | ec6086d8e6 | |
AFCMS | 6d7aafe0d4 | |
AFCMS | 91adfcbb1d | |
AFCMS | 8958aa7b12 | |
AFCMS | cf5703d528 | |
AFCMS | 88e59d3592 | |
AFCMS | cd08df175c | |
AFCMS | ca277b6769 | |
AFCMS | b0127fc1c3 | |
AFCMS | d26b1b1402 | |
NO11 | 549bdeb6e9 | |
epCode | 960b653979 | |
NO11 | f894153b8a | |
NO11 | 848f1489e8 | |
NO11 | a0d3f51745 | |
NO11 | 46d48ccf2f | |
NO11 | f46c4ebad7 | |
NO11 | b7e6db537b | |
NO11 | 357474e32f | |
NO11 | b6eb0ab66c | |
1F616EMO | d2f7d31360 | |
AFCMS | 8e931e92f5 | |
AFCMS | cbfec5c5c8 | |
Lizzy Fleckenstein | 6e1758400e | |
cora | c558e30ea5 | |
Lizzy Fleckenstein | fb01e61946 | |
Lizzy Fleckenstein | 8445a9ddec | |
cora | 3b2a25a6cb | |
Lizzy Fleckenstein | 8f584be235 | |
Elias Fleckenstein | 94cbb2b802 | |
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. | 2f22ce79cc | |
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. | ae2c5ede30 | |
Elias Fleckenstein | f4a30959ce | |
Lizzy Fleckenstein | b22e4ae99d | |
Elias Fleckenstein | 27f4c210c7 | |
NO11 | 091622f855 | |
NO11 | 5cc4fe955f | |
NO11 | 4afdea56db | |
Nils Dagsson Moskopp | 0a474ee578 | |
NO11 | d45e1c07bd | |
NO11 | 21992dc265 | |
AFCMS | a9ceeabc4b | |
AFCMS | 16d79c38ce | |
kay27 | 7ff476b9b9 | |
kay27 | c6b662ce7a | |
kay27 | 586c18b00f | |
AFCMS | 61b0220951 | |
AFCMS | ef1c06e3d1 | |
AFCMS | a9ae6aa9c8 | |
NO11 | b03cd1fc8e | |
NO11 | cf3a2a42bf | |
NO11 | ff8176e252 | |
NO11 | a62d3ff2ee | |
Elias Fleckenstein | 8bae5dd874 | |
NO11 | 2361c1c797 | |
NO11 | 3b3922b2d6 | |
NO11 | 4987636913 | |
NO11 | c542ff998e | |
NO11 | f28a5b90fc | |
AFCMS | 7a130ff2b9 | |
pitchum | 73927cb0cb | |
AFCMS | 2624343c30 | |
AFCMS | 30e2e0d70a | |
Elias Fleckenstein | eea9fb7670 | |
Elias Fleckenstein | 64d3a28578 | |
basxto | 822071c66b | |
NO11 | eafb1a2797 | |
AFCMS | 40f4287ff2 | |
AFCMS | f70dbb8cfa | |
AFCMS | e11dc4b58e | |
AFCMS | e81da3c4ff | |
AFCMS | a896d7f5e4 | |
NO11 | 3577585d74 | |
NO11 | c350b5158b | |
Elias Fleckenstein | 4324e97db0 | |
Elias Fleckenstein | 7ae4fb6ae7 | |
AFCMS | 2603c4768b | |
AFCMS | c642f9e2f7 | |
Elias Fleckenstein | 580f6f9629 | |
1F616EMO | 2fac67898e | |
NO11 | 28bfb3f141 | |
NO11 | f3322fd7cb | |
AFCMS | 881f0b0a71 | |
Elias Fleckenstein | e5bdf230d5 | |
Elias Fleckenstein | 0c21a51c45 | |
FinishedFragment | 9706c56964 | |
Elias Fleckenstein | 7ae777a01d | |
FinishedFragment | d391d50eb8 | |
NO11 | 92c25ef691 | |
NO11 | 7464b8ff48 | |
AFCMS | a21b14e707 | |
NO11 | dfd9737d18 | |
Marcin Serwin | 198d3bff53 | |
Marcin Serwin | 522553fcd0 | |
Marcin Serwin | 753a8ce488 | |
Marcin Serwin | f9dbfd8eb5 | |
Marcin Serwin | 0132d0569f | |
Marcin Serwin | a0d3e92b70 | |
marcin-serwin | cbe8583cef | |
Marcin Serwin | 6715aecd63 | |
Marcin Serwin | b06bc276dc | |
AFCMS | b9fd1ac227 | |
AFCMS | 7e64470f70 | |
Marcin Serwin | 06984fa486 | |
Marcin Serwin | 4bd49f7eb0 | |
Marcin Serwin | a4fc38ffcc | |
AFCMS | c8102838cb | |
AFCMS | 6b53dda79b | |
AFCMS | 640b0dc485 | |
Marcin Serwin | 7804de4230 | |
Marcin Serwin | 22bda9c770 | |
Marcin Serwin | 21bdf914bf | |
AFCMS | 95627f4304 | |
AFCMS | cd33d406b2 | |
NO11 | ec542a142a | |
NO11 | 91ae3208bd | |
NO11 | 0d619ec6a8 | |
Marcin Serwin | 8ad953ab17 | |
Marcin Serwin | 362965f8fb | |
Marcin Serwin | 1de0009cc6 | |
Marcin Serwin | 7da32dcc36 | |
Marcin Serwin | 1929df492b | |
Marcin Serwin | 69f85a1aa6 | |
Marcin Serwin | c260ef8c6e | |
AFCMS | 5f82e76862 | |
AFCMS | 3bedc81068 | |
AFCMS | b8782d0af1 | |
AFCMS | f1c6c3b285 | |
AFCMS | f8ee9c79c2 | |
AFCMS | 00063cde73 | |
AFCMS | 0119793d7a | |
Marcin Serwin | 425c7505ec | |
Marcin Serwin | 1ad1bbef13 | |
Marcin Serwin | 5ef0c5bcb7 | |
Marcin Serwin | 4a396fde2c | |
Marcin Serwin | a4c21de153 | |
Marcin Serwin | a27833a0e1 | |
Marcin Serwin | d83c29f0c4 | |
Marcin Serwin | 2873c7f7ce | |
Marcin Serwin | e797a4ec9b | |
Marcin Serwin | 37b1191c0a | |
Marcin Serwin | dcceafad41 | |
Marcin Serwin | f421e07d1c | |
NO11 | 0ea72ed1f1 | |
NO11 | 47b6a8d7f8 | |
NO11 | aeb8fa5b88 | |
NO11 | ba38f787e2 | |
NO11 | 8b11e2fec8 | |
NO11 | 9b9ec13967 | |
NO11 | d5a2e5e514 | |
NO11 | dddaed42b6 | |
NO11 | 973a8201ad | |
AFCMS | 91ac70cf28 | |
AFCMS | 17202115fa | |
AFCMS | 5d65c8a3aa | |
AFCMS | e9f38c6b90 | |
talamh | 2c434495c1 | |
talamh | e6b61a1551 | |
talamh | f1229c5401 | |
Marcin Serwin | e19d39f065 | |
Marcin Serwin | 397a05b651 | |
Marcin Serwin | 5b3a156c09 | |
Marcin Serwin | 604af04849 | |
Marcin Serwin | 0e8c002665 | |
Marcin Serwin | 77597f9bac | |
Marcin Serwin | 65846cb6d8 | |
Marcin Serwin | 97e50714fe | |
Marcin Serwin | 9666076cb4 | |
Marcin Serwin | 7f1cb7fc54 | |
Marcin Serwin | 87b5a7b7ad | |
Marcin Serwin | d74e1fd162 | |
Marcin Serwin | 0e52e09cc8 | |
Marcin Serwin | ffd28c259d | |
Marcin Serwin | eeaf4e09c6 | |
Marcin Serwin | 29001086c3 | |
Marcin Serwin | 1f07f5ba17 | |
Marcin Serwin | 095128b6b3 | |
Marcin Serwin | bcf5eef010 | |
Marcin Serwin | 3917bb51a2 | |
Marcin Serwin | dd0e381e39 | |
Marcin Serwin | 4975a516f5 | |
Marcin Serwin | c0ce511ad0 | |
Marcin Serwin | b93d3cf93c | |
Marcin Serwin | a038908acd | |
Marcin Serwin | a613da65c5 | |
Marcin Serwin | 18903d5a09 | |
Marcin Serwin | c6a07b8007 | |
Marcin Serwin | 67780f2159 | |
Marcin Serwin | 7e9eb927f1 | |
Marcin Serwin | ae7ea8edef | |
Marcin Serwin | 0cf58ce98d | |
Marcin Serwin | 0ebf6b8f92 | |
Marcin Serwin | 0a8b6a63cb | |
Marcin Serwin | 2a06be02b3 | |
Marcin Serwin | c6de8c0669 | |
Marcin Serwin | 3a88ff7cb3 | |
Marcin Serwin | 0de2d3d707 | |
Marcin Serwin | 8934c65564 | |
Marcin Serwin | 51711385a1 | |
Marcin Serwin | 9472f86025 | |
Marcin Serwin | 6fb94fb411 | |
Marcin Serwin | 883bd0f437 | |
Marcin Serwin | 42d2dfed19 | |
Marcin Serwin | 33f22f4eed | |
Marcin Serwin | cec4011de2 | |
Marcin Serwin | 38d788998d | |
Marcin Serwin | 9e41d5874a | |
Marcin Serwin | 1be74d21d3 | |
Marcin Serwin | 32e33d3b21 | |
Marcin Serwin | 7d674e6e72 | |
Marcin Serwin | ec2e5f7430 | |
Marcin Serwin | 7a4d009648 | |
Marcin Serwin | 8f9f4f6093 | |
Marcin Serwin | 38741754e0 | |
Marcin Serwin | f1ce4f0df6 | |
Marcin Serwin | a598d94afd | |
Marcin Serwin | d553aa5e8c | |
Marcin Serwin | 23e52975fd | |
Marcin Serwin | baed298ce6 | |
Marcin Serwin | 6c5c4b0080 | |
Marcin Serwin | b14b08dc30 | |
Marcin Serwin | 2b6f31fe3b | |
Marcin Serwin | 321caa0632 | |
Marcin Serwin | 6f3bd95106 | |
Marcin Serwin | a3b46be64a | |
Marcin Serwin | 8e4ba0d3e1 | |
Marcin Serwin | a7c8bfc0d7 | |
Marcin Serwin | 504a0e5d2c | |
Marcin Serwin | 99c20421f4 | |
Marcin Serwin | cd8e695ca5 | |
Marcin Serwin | 2bf2766688 | |
Marcin Serwin | 7b4eb28160 | |
Marcin Serwin | 2221f89696 | |
Marcin Serwin | 50b209a945 | |
Marcin Serwin | 034a29edc0 | |
Marcin Serwin | 958fee0a73 | |
Marcin Serwin | d50e63d935 | |
Marcin Serwin | 1fd869b5fb | |
Marcin Serwin | 9f7f1f2c89 | |
Marcin Serwin | ee28bda893 |
|
@ -0,0 +1,2 @@
|
|||
# Text Editor TMP Files
|
||||
*.swp
|
|
@ -52,17 +52,17 @@ Each mod must provide `mod.conf`.
|
|||
Each mod which add API functions should store functions inside a global table named like the mod.
|
||||
Public functions should not use self references but rather just access the table directly.
|
||||
Functions should be defined in this way:
|
||||
```
|
||||
```lua
|
||||
function mcl_xyz.stuff(param) end
|
||||
```
|
||||
Insteed of this way:
|
||||
```
|
||||
```lua
|
||||
mcl_xyz.stuff = function(param) end
|
||||
```
|
||||
Indentation must be unified, more likely with tabs.
|
||||
|
||||
Time sensitive mods should make a local copy of most used API functions to improve performances.
|
||||
```
|
||||
```lua
|
||||
local vector = vector
|
||||
local get_node = minetest.get_node
|
||||
```
|
||||
|
|
|
@ -149,7 +149,7 @@ These groups are used mostly for informational purposes
|
|||
* `trapdoor=2`: Open trapdoor
|
||||
* `glass=1`: Glass (full cubes only)
|
||||
* `rail=1`: Rail
|
||||
* `music_record`: Music Disc (rating is track ID)
|
||||
* `music_record`: Item is Music Disc
|
||||
* `tnt=1`: Block is TNT
|
||||
* `boat=1`: Boat
|
||||
* `minecart=1`: Minecart
|
||||
|
|
19
README.md
19
README.md
|
@ -1,5 +1,3 @@
|
|||
# (Currently in feature freeze)
|
||||
|
||||
# MineClone 2
|
||||
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
|
||||
Developed by many people. Not developed or endorsed by Mojang AB.
|
||||
|
@ -77,15 +75,16 @@ 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.
|
||||
|
||||
## Reporting bugs
|
||||
Please report all bugs and missing Minecraft features here:
|
||||
## Useful links
|
||||
The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there.
|
||||
|
||||
<https://git.minetest.land/MineClone2/MineClone2/issues>
|
||||
|
||||
## Chating with the community
|
||||
Join our discord server at:
|
||||
|
||||
<https://discord.gg/84GKcxczG3>
|
||||
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
|
||||
* Discord: <https://discord.gg/xE4z8EEpDC>
|
||||
* YouTube <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
|
||||
* IRC: <https://web.libera.chat/#mineclone2>
|
||||
* Matrix: <https://app.element.io/#/room/#mc2:matrix.org>
|
||||
* Reddit: <https://www.reddit.com/r/MineClone2/>
|
||||
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
|
||||
## Project description
|
||||
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
|
||||
|
|
|
@ -83,7 +83,7 @@ local function get_hardness_values_for_groups()
|
|||
|
||||
for _, ndef in pairs(minetest.registered_nodes) do
|
||||
for g, _ in pairs(mcl_autogroup.registered_diggroups) do
|
||||
if ndef.groups[g] ~= nil then
|
||||
if ndef.groups[g] then
|
||||
maps[g][ndef._mcl_hardness or 0] = true
|
||||
end
|
||||
end
|
||||
|
@ -207,6 +207,10 @@ end
|
|||
function mcl_autogroup.can_harvest(nodename, toolname)
|
||||
local ndef = minetest.registered_nodes[nodename]
|
||||
|
||||
if not ndef then
|
||||
return false
|
||||
end
|
||||
|
||||
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
local get_connected_players = minetest.get_connected_players
|
||||
local clock = os.clock
|
||||
|
||||
local pairs = pairs
|
||||
|
||||
controls = {}
|
||||
controls.players = {}
|
||||
|
||||
|
@ -20,15 +22,15 @@ function controls.register_on_hold(func)
|
|||
end
|
||||
|
||||
local known_controls = {
|
||||
jump=true,
|
||||
right=true,
|
||||
left=true,
|
||||
LMB=true,
|
||||
RMB=true,
|
||||
sneak=true,
|
||||
aux1=true,
|
||||
down=true,
|
||||
up=true,
|
||||
jump = true,
|
||||
right = true,
|
||||
left = true,
|
||||
LMB = true,
|
||||
RMB = true,
|
||||
sneak = true,
|
||||
aux1 = true,
|
||||
down = true,
|
||||
up = true,
|
||||
}
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
|
@ -49,27 +51,27 @@ minetest.register_globalstep(function(dtime)
|
|||
local player_name = player:get_player_name()
|
||||
local player_controls = player:get_player_control()
|
||||
if controls.players[player_name] then
|
||||
for cname, cbool in pairs(player_controls) do
|
||||
if known_controls[cname] == true then
|
||||
--Press a key
|
||||
if cbool==true and controls.players[player_name][cname][1]==false then
|
||||
for _, func in pairs(controls.registered_on_press) do
|
||||
func(player, cname)
|
||||
for cname, cbool in pairs(player_controls) do
|
||||
if known_controls[cname] == true then
|
||||
--Press a key
|
||||
if cbool == true and controls.players[player_name][cname][1] == false then
|
||||
for _, func in pairs(controls.registered_on_press) do
|
||||
func(player, cname)
|
||||
end
|
||||
controls.players[player_name][cname] = {true, clock()}
|
||||
elseif cbool == true and controls.players[player_name][cname][1] == true then
|
||||
for _, func in pairs(controls.registered_on_hold) do
|
||||
func(player, cname, clock()-controls.players[player_name][cname][2])
|
||||
end
|
||||
--Release a key
|
||||
elseif cbool == false and controls.players[player_name][cname][1] == true then
|
||||
for _, func in pairs(controls.registered_on_release) do
|
||||
func(player, cname, clock()-controls.players[player_name][cname][2])
|
||||
end
|
||||
controls.players[player_name][cname] = {false}
|
||||
end
|
||||
end
|
||||
controls.players[player_name][cname] = {true, clock()}
|
||||
elseif cbool==true and controls.players[player_name][cname][1]==true then
|
||||
for _, func in pairs(controls.registered_on_hold) do
|
||||
func(player, cname, clock()-controls.players[player_name][cname][2])
|
||||
end
|
||||
--Release a key
|
||||
elseif cbool==false and controls.players[player_name][cname][1]==true then
|
||||
for _, func in pairs(controls.registered_on_release) do
|
||||
func(player, cname, clock()-controls.players[player_name][cname][2])
|
||||
end
|
||||
controls.players[player_name][cname] = {false}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -12,9 +12,13 @@ under the LGPLv2.1 license.
|
|||
|
||||
mcl_explosions = {}
|
||||
|
||||
local mod_fire = minetest.get_modpath("mcl_fire") ~= nil
|
||||
local mod_fire = minetest.get_modpath("mcl_fire")
|
||||
--local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire")
|
||||
|
||||
local math = math
|
||||
local vector = vector
|
||||
local table = table
|
||||
|
||||
local hash_node_position = minetest.hash_node_position
|
||||
local get_objects_inside_radius = minetest.get_objects_inside_radius
|
||||
local get_position_from_hash = minetest.get_position_from_hash
|
||||
|
@ -24,6 +28,7 @@ local get_voxel_manip = minetest.get_voxel_manip
|
|||
local bulk_set_node = minetest.bulk_set_node
|
||||
local check_for_falling = minetest.check_for_falling
|
||||
local add_item = minetest.add_item
|
||||
local pos_to_string = minetest.pos_to_string
|
||||
|
||||
-- Saved sphere explosion shapes for various radiuses
|
||||
local sphere_shapes = {}
|
||||
|
@ -240,7 +245,7 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc
|
|||
local ent = obj:get_luaentity()
|
||||
|
||||
-- Ignore items to lower lag
|
||||
if (obj:is_player() or (ent and ent.name ~= '__builtin.item')) and obj:get_hp() > 0 then
|
||||
if (obj:is_player() or (ent and ent.name ~= "__builtin.item")) and obj:get_hp() > 0 then
|
||||
local opos = obj:get_pos()
|
||||
local collisionbox = nil
|
||||
|
||||
|
@ -356,9 +361,9 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc
|
|||
local on_blast = node_on_blast[data[idx]]
|
||||
local remove = true
|
||||
|
||||
if do_drop or on_blast ~= nil then
|
||||
if do_drop or on_blast then
|
||||
local npos = get_position_from_hash(hash)
|
||||
if on_blast ~= nil then
|
||||
if on_blast then
|
||||
on_blast(npos, 1.0, do_drop)
|
||||
remove = false
|
||||
else
|
||||
|
@ -400,8 +405,7 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc
|
|||
end
|
||||
|
||||
-- Log explosion
|
||||
minetest.log('action', 'Explosion at ' .. minetest.pos_to_string(pos) ..
|
||||
' with strength ' .. strength .. ' and radius ' .. radius)
|
||||
minetest.log("action", "Explosion at "..pos_to_string(pos).." with strength "..strength.." and radius "..radius)
|
||||
end
|
||||
|
||||
-- Create an explosion with strength at pos.
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain:mcl_explosions
|
||||
@1 was caught in an explosion.=@1 została wysadzona.
|
|
@ -32,9 +32,9 @@ local singlenode = mg_name == "singlenode"
|
|||
|
||||
-- Calculate mapgen_edge_min/mapgen_edge_max
|
||||
mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5)
|
||||
mcl_vars.MAP_BLOCKSIZE = math.max(1, core.MAP_BLOCKSIZE or 16)
|
||||
mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16)
|
||||
mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000)
|
||||
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, core.MAX_MAP_GENERATION_LIMIT or 31000)
|
||||
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, minetest.MAX_MAP_GENERATION_LIMIT or 31000)
|
||||
local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2)
|
||||
mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
|
||||
mcl_vars.chunk_size_in_nodes = mcl_vars.chunksize * mcl_vars.MAP_BLOCKSIZE
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
|
@ -1,5 +1,7 @@
|
|||
mcl_worlds = {}
|
||||
|
||||
local get_connected_players = minetest.get_connected_players
|
||||
|
||||
-- For a given position, returns a 2-tuple:
|
||||
-- 1st return value: true if pos is in void
|
||||
-- 2nd return value: true if it is in the deadly part of the void
|
||||
|
@ -44,12 +46,16 @@ function mcl_worlds.y_to_layer(y)
|
|||
end
|
||||
end
|
||||
|
||||
local y_to_layer = mcl_worlds.y_to_layer
|
||||
|
||||
-- Takes a pos and returns the dimension it belongs to (same as above)
|
||||
function mcl_worlds.pos_to_dimension(pos)
|
||||
local _, dim = mcl_worlds.y_to_layer(pos.y)
|
||||
local _, dim = y_to_layer(pos.y)
|
||||
return dim
|
||||
end
|
||||
|
||||
local pos_to_dimension = mcl_worlds.pos_to_dimension
|
||||
|
||||
-- Takes a Minecraft layer and a “dimension” name
|
||||
-- and returns the corresponding Y coordinate for
|
||||
-- MineClone 2.
|
||||
|
@ -119,6 +125,8 @@ function mcl_worlds.dimension_change(player, dimension)
|
|||
last_dimension[playername] = dimension
|
||||
end
|
||||
|
||||
local dimension_change = mcl_worlds.dimension_change
|
||||
|
||||
----------------------- INTERNAL STUFF ----------------------
|
||||
|
||||
-- Update the dimension callbacks every DIM_UPDATE seconds
|
||||
|
@ -126,19 +134,19 @@ local DIM_UPDATE = 1
|
|||
local dimtimer = 0
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
last_dimension[player:get_player_name()] = mcl_worlds.pos_to_dimension(player:get_pos())
|
||||
last_dimension[player:get_player_name()] = pos_to_dimension(player:get_pos())
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
-- regular updates based on iterval
|
||||
dimtimer = dimtimer + dtime;
|
||||
if dimtimer >= DIM_UPDATE then
|
||||
local players = minetest.get_connected_players()
|
||||
for p=1, #players do
|
||||
local dim = mcl_worlds.pos_to_dimension(players[p]:get_pos())
|
||||
local players = get_connected_players()
|
||||
for p = 1, #players do
|
||||
local dim = pos_to_dimension(players[p]:get_pos())
|
||||
local name = players[p]:get_player_name()
|
||||
if dim ~= last_dimension[name] then
|
||||
mcl_worlds.dimension_change(players[p], dim)
|
||||
dimension_change(players[p], dim)
|
||||
end
|
||||
end
|
||||
dimtimer = 0
|
||||
|
|
|
@ -4,6 +4,7 @@ local get_connected_players = minetest.get_connected_players
|
|||
local get_node = minetest.get_node
|
||||
local vector_add = vector.add
|
||||
local ceil = math.ceil
|
||||
local pairs = pairs
|
||||
|
||||
walkover = {}
|
||||
walkover.registered_globals = {}
|
||||
|
@ -34,9 +35,9 @@ minetest.register_globalstep(function(dtime)
|
|||
local pp = player:get_pos()
|
||||
pp.y = ceil(pp.y)
|
||||
local loc = vector_add(pp, {x=0,y=-1,z=0})
|
||||
if loc ~= nil then
|
||||
if loc then
|
||||
local nodeiamon = get_node(loc)
|
||||
if nodeiamon ~= nil then
|
||||
if nodeiamon then
|
||||
if on_walk[nodeiamon.name] then
|
||||
on_walk[nodeiamon.name](loc, nodeiamon, player)
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local S = minetest.get_translator("mcl_boats")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local boat_visual_size = {x = 1, y = 1, z = 1}
|
||||
local paddling_speed = 22
|
||||
|
@ -84,7 +84,7 @@ local function attach_object(self, obj)
|
|||
end
|
||||
end, name)
|
||||
obj:set_look_horizontal(yaw)
|
||||
mcl_tmp_message.message(obj, S("Sneak to dismount"))
|
||||
mcl_title.set(obj, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60})
|
||||
else
|
||||
obj:get_luaentity()._old_visual_size = visual_size
|
||||
end
|
||||
|
@ -470,6 +470,6 @@ minetest.register_craft({
|
|||
burntime = 20,
|
||||
})
|
||||
|
||||
if minetest.get_modpath("doc_identifier") ~= nil then
|
||||
if minetest.get_modpath("doc_identifier") then
|
||||
doc.sub.identifier.register_object("mcl_boats:boat", "craftitems", "mcl_boats:boat")
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=Les bateaux sont utilisés pou
|
|||
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.
|
||||
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. Use [Sneak] to leave the boat, 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. Utilisez [Sneak] pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet.
|
||||
Spruce Boat=Bateau en Sapin
|
||||
Water vehicle=Véhicule aquatique
|
||||
Water vehicle=Véhicule aquatique
|
||||
Sneak to dismount=
|
|
@ -0,0 +1,12 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=Akacjowa łódź
|
||||
Birch Boat=Brzozowa łódź
|
||||
Boat=Łódź
|
||||
Boats are used to travel on the surface of water.=Łodzie są wykorzystywane do podróżowania po powierzchni wody.
|
||||
Dark Oak Boat=Ciemno-dębowa łódź
|
||||
Jungle Boat=Tropikalna łódź
|
||||
Oak Boat=Dębowa łódź
|
||||
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. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Kliknij prawym przyciskiem myszy na źródło wody by postawić łódź. Kliknij prawym przyciskiem myszy by w nią wsiąść. Użyj przycisków [Lewy] oraz [Prawy] by sterować, [Naprzód] by przyspieszyć i [W tył] by zwolnić lub się cofać. Kliknij [Skradanie] by z niej wyjść, uderz ją by wziąć ją jako przedmiot.
|
||||
Spruce Boat=Świerkowa łódź
|
||||
Water vehicle=Pojazd wodny
|
||||
Sneak to dismount=Skradaj się by opuścić łódź
|
|
@ -1,7 +1,7 @@
|
|||
name = mcl_boats
|
||||
author = PilzAdam
|
||||
description = Adds drivable boats.
|
||||
depends = mcl_player, flowlib
|
||||
depends = mcl_player, flowlib, mcl_title
|
||||
optional_depends = mcl_core, doc_identifier
|
||||
|
||||
|
||||
|
|
|
@ -67,14 +67,9 @@ function mcl_burning.set_on_fire(obj, burn_time)
|
|||
end
|
||||
|
||||
if not storage.burn_time or burn_time >= storage.burn_time then
|
||||
if obj:is_player() and not storage.fire_hud_id then
|
||||
storage.fire_hud_id = obj:hud_add({
|
||||
hud_elem_type = "image",
|
||||
position = {x = 0.5, y = 0.5},
|
||||
scale = {x = -100, y = -100},
|
||||
text = "mcl_burning_entity_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. 1,
|
||||
z_index = 1000,
|
||||
})
|
||||
if obj:is_player() then
|
||||
mcl_burning.channels[obj]:send_all(tostring(mcl_burning.animation_frames))
|
||||
mcl_burning.channels[obj]:send_all("start")
|
||||
end
|
||||
storage.burn_time = burn_time
|
||||
storage.fire_damage_timer = 0
|
||||
|
@ -95,7 +90,6 @@ function mcl_burning.set_on_fire(obj, burn_time)
|
|||
fire_entity:set_properties({visual_size = size})
|
||||
fire_entity:set_attach(obj, "", offset, {x = 0, y = 0, z = 0})
|
||||
local fire_luaentity = fire_entity:get_luaentity()
|
||||
fire_luaentity:update_frame(obj, storage)
|
||||
|
||||
for _, other in pairs(minetest.get_objects_inside_radius(fire_entity:get_pos(), 0)) do
|
||||
local other_luaentity = other:get_luaentity()
|
||||
|
@ -111,9 +105,7 @@ function mcl_burning.extinguish(obj)
|
|||
if mcl_burning.is_burning(obj) then
|
||||
local storage = mcl_burning.get_storage(obj)
|
||||
if obj:is_player() then
|
||||
if storage.fire_hud_id then
|
||||
obj:hud_remove(storage.fire_hud_id)
|
||||
end
|
||||
mcl_burning.channels[obj]:send_all("stop")
|
||||
mcl_burning.storage[obj] = {}
|
||||
else
|
||||
storage.burn_time = nil
|
||||
|
@ -143,4 +135,4 @@ function mcl_burning.tick(obj, dtime, storage)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
local pairs = pairs
|
||||
|
||||
local get_connected_players = minetest.get_connected_players
|
||||
local get_item_group = minetest.get_item_group
|
||||
|
||||
mcl_burning = {
|
||||
storage = {},
|
||||
channels = {},
|
||||
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8
|
||||
}
|
||||
|
||||
dofile(modpath .. "/api.lua")
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
for _, player in pairs(get_connected_players()) do
|
||||
local storage = mcl_burning.storage[player]
|
||||
if not mcl_burning.tick(player, dtime, storage) and not mcl_burning.is_affected_by_rain(player) then
|
||||
local nodes = mcl_burning.get_touching_nodes(player, {"group:puts_out_fire", "group:set_on_fire"}, storage)
|
||||
|
@ -16,12 +22,12 @@ minetest.register_globalstep(function(dtime)
|
|||
|
||||
for _, pos in pairs(nodes) do
|
||||
local node = minetest.get_node(pos)
|
||||
if minetest.get_item_group(node.name, "puts_out_fire") > 0 then
|
||||
if get_item_group(node.name, "puts_out_fire") > 0 then
|
||||
burn_time = 0
|
||||
break
|
||||
end
|
||||
|
||||
local value = minetest.get_item_group(node.name, "set_on_fire")
|
||||
local value = get_item_group(node.name, "set_on_fire")
|
||||
if value > burn_time then
|
||||
burn_time = value
|
||||
end
|
||||
|
@ -49,12 +55,11 @@ minetest.register_on_joinplayer(function(player)
|
|||
end
|
||||
|
||||
mcl_burning.storage[player] = storage
|
||||
mcl_burning.channels[player] = minetest.mod_channel_join("mcl_burning:" .. player:get_player_name())
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local storage = mcl_burning.storage[player]
|
||||
storage.fire_hud_id = nil
|
||||
player:get_meta():set_string("mcl_burning:data", minetest.serialize(storage))
|
||||
player:get_meta():set_string("mcl_burning:data", minetest.serialize(mcl_burning.storage[player]))
|
||||
mcl_burning.storage[player] = nil
|
||||
end)
|
||||
|
||||
|
@ -63,27 +68,28 @@ minetest.register_entity("mcl_burning:fire", {
|
|||
initial_properties = {
|
||||
physical = false,
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
visual = "cube",
|
||||
visual = "upright_sprite",
|
||||
textures = {
|
||||
name = "mcl_burning_entity_flame_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 1.0,
|
||||
},
|
||||
},
|
||||
spritediv = {x = 1, y = mcl_burning.animation_frames},
|
||||
pointable = false,
|
||||
glow = -1,
|
||||
backface_culling = false,
|
||||
},
|
||||
animation_frame = 0,
|
||||
animation_timer = 0,
|
||||
on_step = function(self, dtime)
|
||||
local parent, storage = self:sanity_check()
|
||||
|
||||
if parent then
|
||||
self.animation_timer = self.animation_timer + dtime
|
||||
if self.animation_timer >= 0.1 then
|
||||
self.animation_timer = 0
|
||||
self.animation_frame = self.animation_frame + 1
|
||||
if self.animation_frame > mcl_burning.animation_frames - 1 then
|
||||
self.animation_frame = 0
|
||||
end
|
||||
self:update_frame(parent, storage)
|
||||
end
|
||||
else
|
||||
on_activate = function(self)
|
||||
self.object:set_sprite({x = 0, y = 0}, mcl_burning.animation_frames, 1.0 / mcl_burning.animation_frames)
|
||||
end,
|
||||
on_step = function(self)
|
||||
if not self:sanity_check() then
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
|
@ -91,23 +97,15 @@ minetest.register_entity("mcl_burning:fire", {
|
|||
local parent = self.object:get_attach()
|
||||
|
||||
if not parent then
|
||||
return
|
||||
return false
|
||||
end
|
||||
|
||||
local storage = mcl_burning.get_storage(parent)
|
||||
|
||||
if not storage or not storage.burn_time then
|
||||
return
|
||||
return false
|
||||
end
|
||||
|
||||
return parent, storage
|
||||
end,
|
||||
update_frame = function(self, parent, storage)
|
||||
local frame_overlay = "^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. self.animation_frame
|
||||
local fire_texture = "mcl_burning_entity_flame_animated.png" .. frame_overlay
|
||||
self.object:set_properties({textures = {"blank.png", "blank.png", fire_texture, fire_texture, fire_texture, fire_texture}})
|
||||
if parent:is_player() then
|
||||
parent:hud_change(storage.fire_hud_id, "text", "mcl_burning_hud_flame_animated.png" .. frame_overlay)
|
||||
end
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -19,7 +19,10 @@ local function deal_falling_damage(self, dtime)
|
|||
end
|
||||
self._hit = self._hit or {}
|
||||
for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||
if mcl_util.get_hp(obj) > 0 and not self._hit[obj] then
|
||||
local entity = obj:get_luaentity()
|
||||
if entity and entity.name == "__builtin:item" then
|
||||
obj:remove()
|
||||
elseif mcl_util.get_hp(obj) > 0 and not self._hit[obj] then
|
||||
self._hit[obj] = true
|
||||
local way = self._startpos.y - pos.y
|
||||
local damage = (way - 1) * 2
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 została zmiażdżona przez spadające kowadło.
|
||||
@1 was smashed by a falling block.=@1 została zmiażdżona przez spadający blok.
|
|
@ -1,5 +1,5 @@
|
|||
--these are lua locals, used for higher performance
|
||||
local minetest, math, vector, ipairs = minetest, math, vector, ipairs
|
||||
local minetest, math, vector, ipairs, pairs = minetest, math, vector, ipairs, pairs
|
||||
|
||||
--this is used for the player pool in the sound buffer
|
||||
local pool = {}
|
||||
|
@ -233,7 +233,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
local dug_node = minetest.get_node(pos)
|
||||
local tooldef
|
||||
local tool
|
||||
if digger ~= nil then
|
||||
if digger then
|
||||
tool = digger:get_wielded_item()
|
||||
tooldef = minetest.registered_tools[tool:get_name()]
|
||||
|
||||
|
@ -314,7 +314,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
end
|
||||
-- Spawn item and apply random speed
|
||||
local obj = minetest.add_item(dpos, drop_item)
|
||||
if obj ~= nil then
|
||||
if obj then
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
x = -x
|
||||
|
@ -363,6 +363,17 @@ if not time_to_live then
|
|||
time_to_live = 300
|
||||
end
|
||||
|
||||
local function cxcz(o, cw, one, zero)
|
||||
if cw < 0 then
|
||||
table.insert(o, { [one]=1, y=0, [zero]=0 })
|
||||
table.insert(o, { [one]=-1, y=0, [zero]=0 })
|
||||
else
|
||||
table.insert(o, { [one]=-1, y=0, [zero]=0 })
|
||||
table.insert(o, { [one]=1, y=0, [zero]=0 })
|
||||
end
|
||||
return o
|
||||
end
|
||||
|
||||
minetest.register_entity(":__builtin:item", {
|
||||
initial_properties = {
|
||||
hp_max = 1,
|
||||
|
@ -383,7 +394,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
-- The itemstring MUST be set immediately to a non-empty string after creating the entity.
|
||||
-- The hand is NOT permitted as dropped item. ;-)
|
||||
-- Item entities will be deleted if they still have an empty itemstring on their first on_step tick.
|
||||
itemstring = '',
|
||||
itemstring = "",
|
||||
|
||||
-- If true, item will fall
|
||||
physical_state = true,
|
||||
|
@ -469,7 +480,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return minetest.serialize({
|
||||
local data = minetest.serialize({
|
||||
itemstring = self.itemstring,
|
||||
always_collect = self.always_collect,
|
||||
age = self.age,
|
||||
|
@ -477,6 +488,39 @@ minetest.register_entity(":__builtin:item", {
|
|||
_flowing = self._flowing,
|
||||
_removed = self._removed,
|
||||
})
|
||||
-- sfan5 guessed that the biggest serializable item
|
||||
-- entity would have a size of 65530 bytes. This has
|
||||
-- been experimentally verified to be still too large.
|
||||
--
|
||||
-- anon5 has calculated that the biggest serializable
|
||||
-- item entity has a size of exactly 65487 bytes:
|
||||
--
|
||||
-- 1. serializeString16 can handle max. 65535 bytes.
|
||||
-- 2. The following engine metadata is always saved:
|
||||
-- • 1 byte (version)
|
||||
-- • 2 byte (length prefix)
|
||||
-- • 14 byte “__builtin:item”
|
||||
-- • 4 byte (length prefix)
|
||||
-- • 2 byte (health)
|
||||
-- • 3 × 4 byte = 12 byte (position)
|
||||
-- • 4 byte (yaw)
|
||||
-- • 1 byte (version 2)
|
||||
-- • 2 × 4 byte = 8 byte (pitch and roll)
|
||||
-- 3. This leaves 65487 bytes for the serialization.
|
||||
if #data > 65487 then -- would crash the engine
|
||||
local stack = ItemStack(self.itemstring)
|
||||
stack:get_meta():from_table(nil)
|
||||
self.itemstring = stack:to_string()
|
||||
minetest.log(
|
||||
"warning",
|
||||
"Overlong item entity metadata removed: “" ..
|
||||
self.itemstring ..
|
||||
"” had serialized length of " ..
|
||||
#data
|
||||
)
|
||||
return self:get_staticdata()
|
||||
end
|
||||
return data
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
|
@ -564,7 +608,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
return true
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
on_step = function(self, dtime, moveresult)
|
||||
if self._removed then
|
||||
self.object:set_properties({
|
||||
physical = false
|
||||
|
@ -574,7 +618,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
return
|
||||
end
|
||||
self.age = self.age + dtime
|
||||
if self._collector_timer ~= nil then
|
||||
if self._collector_timer then
|
||||
self._collector_timer = self._collector_timer + dtime
|
||||
end
|
||||
if time_to_live > 0 and self.age > time_to_live then
|
||||
|
@ -631,6 +675,18 @@ minetest.register_entity(":__builtin:item", {
|
|||
end
|
||||
end
|
||||
|
||||
-- Destroy item when it collides with a cactus
|
||||
if moveresult and moveresult.collides then
|
||||
for _, collision in pairs(moveresult.collisions) do
|
||||
local pos = collision.node_pos
|
||||
if collision.type == "node" and minetest.get_node(pos).name == "mcl_core:cactus" then
|
||||
self._removed = true
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 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
|
||||
|
@ -642,16 +698,6 @@ minetest.register_entity(":__builtin:item", {
|
|||
-- 1st: closest
|
||||
-- 2nd: other direction
|
||||
-- 3rd and 4th: other axis
|
||||
local cxcz = function(o, cw, one, zero)
|
||||
if cw < 0 then
|
||||
table.insert(o, { [one]=1, y=0, [zero]=0 })
|
||||
table.insert(o, { [one]=-1, y=0, [zero]=0 })
|
||||
else
|
||||
table.insert(o, { [one]=-1, y=0, [zero]=0 })
|
||||
table.insert(o, { [one]=1, y=0, [zero]=0 })
|
||||
end
|
||||
return o
|
||||
end
|
||||
if math.abs(cx) < math.abs(cz) then
|
||||
order = cxcz(order, cx, "x", "z")
|
||||
order = cxcz(order, cz, "z", "x")
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
local S = minetest.get_translator("mcl_minecarts")
|
||||
local modname = minetest.get_current_modname()
|
||||
local S = minetest.get_translator(modname)
|
||||
|
||||
local has_mcl_wip = minetest.get_modpath("mcl_wip")
|
||||
|
||||
mcl_minecarts = {}
|
||||
mcl_minecarts.modpath = minetest.get_modpath("mcl_minecarts")
|
||||
mcl_minecarts.modpath = minetest.get_modpath(modname)
|
||||
mcl_minecarts.speed_max = 10
|
||||
mcl_minecarts.check_float_time = 15
|
||||
|
||||
|
@ -204,7 +205,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
|
|||
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
|
||||
if g ~= self._railtype and self._railtype then
|
||||
-- Detach driver
|
||||
if player then
|
||||
if self._old_pos then
|
||||
|
@ -523,7 +524,7 @@ function mcl_minecarts.place_minecart(itemstack, pointed_thing, placer)
|
|||
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
|
||||
if le then
|
||||
le._railtype = railtype
|
||||
end
|
||||
local cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype)
|
||||
|
@ -606,7 +607,7 @@ Register a minecart
|
|||
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
|
||||
if minetest.get_modpath("doc_identifier") then
|
||||
doc.sub.identifier.register_object(entity_id, "craftitems", itemstring)
|
||||
end
|
||||
end
|
||||
|
@ -645,7 +646,7 @@ register_minecart(
|
|||
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})
|
||||
mcl_tmp_message.message(clicker, S("Sneak to dismount"))
|
||||
mcl_title.set(clicker, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60})
|
||||
end
|
||||
end, name)
|
||||
end
|
||||
|
|
|
@ -33,3 +33,4 @@ 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é
|
||||
Sneak to dismount=
|
|
@ -0,0 +1,36 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=Wagonik
|
||||
Minecarts can be used for a quick transportion on rails.=Wagoniki mogą być użyte do szybkiego transportu po torach.
|
||||
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.=Wagoniki mogą jeździć tylko po torach i zawsze podążają za wytyczoną ścieżką. W przypadku skrzyżowań typu T, gdzie nie ma prostej ścieżki, skręcają w lew. Ich szybkość zależy od typu torów.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Możesz postawić wagonik na torach. Kliknij prawym przyciskiem myszy aby do niego wejść. Uderz go by zaczął się poruszać.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=Aby odzyskać wagonik uderz go podczas skradania.
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=Wagonik z TNT jest wybuchowym pojazdem podróżującym po torach.
|
||||
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.=Postaw go na torach. Uderz by zaczął się poruszać. TNT zapala się krzesiwem lub gdy wagonik jest na zasilonych torach aktywacyjnych.
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Aby odzyskać wagonik z TNT uderz go podczas skradania. Nie możesz tego zrobić gdy TNT jest zapalone.
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Wagonik z piecem jest pojazdem podróżującym na torach. Napędza on samego siebie za pomocą paliwa.
|
||||
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.=Postaw go na torach. Jeśli dasz mu nieco węgla piec zacznie palić przez długi czas, a wagonik będzie się sam poruszał. Uderz go by zaczął się poruszać.
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=Aby odzyskać wagonik z piecem uderz go podczas skradania.
|
||||
Minecart with Chest=Wagonik ze skrzynią
|
||||
Minecart with Furnace=Wagonik z piecem
|
||||
Minecart with Command Block=Wagonik z blokiem poleceń
|
||||
Minecart with Hopper=Wagonik z lejem
|
||||
Minecart with TNT=Wagonik z 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.=Postaw je na ziemi by zbudować ścieżkę z torów. Tory automatycznie połączą się ze sobą i zamienią się w zakręty, skrzyżowania typu T, skrzyżowania i równie w zależności od potrzeb.
|
||||
Rail=Tor
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Zwyczajne tory nieco spowalniają wagoniki ze względu na tarcie.
|
||||
Powered Rail=Zasilane tory
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Zasilane tory mogą przyspieszać lub spowalniać wagoniki.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Bez zasilania czerwienitem tory będą spowalniać wagoniki. Aby sprawić by je przyspieszały zasil je czerwienitem.
|
||||
Activator Rail=Tory aktywacyjne
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Tory aktywacyjne są wykorzystywane do aktywacji specjalnych wagoników.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Aby ten tor aktywował wagonik, zasil go czerwienitem i spraw by wagonik po nim przejechał.
|
||||
Detector Rail=Tory z czujnikiem
|
||||
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.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Tory z czujnikiem są w stanie wykryć kiedy wagonik po nich przejeżdża i wysłać sygnał do czerwienitowych mechanizmów.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Aby wykryć wagonik i dostarczyć zasilanie czerwienitem podłącz go czerwienitem to mechanizmu i spraw by wagonik po nim przejechał.
|
||||
Track for minecarts=Tor dla wagoników
|
||||
Speed up when powered, slow down when not powered=Przyspiesza gdy zasilane, spowalnia gdy nie
|
||||
Activates minecarts when powered=Aktywuje wagoniki gdy zasilane
|
||||
Emits redstone power when a minecart is detected=Emituje zasilanie czerwienitem gdy wagonik jest wykryty
|
||||
Vehicle for fast travel on rails=Pojazd do szybkiej podróży na torach
|
||||
Can be ignited by tools or powered activator rail=Może być zapalony przez narzędzia, lub zasilane tor aktywacyjne
|
||||
Sneak to dismount=Zacznij się skradać by zejść
|
|
@ -1,6 +1,6 @@
|
|||
name = mcl_minecarts
|
||||
author = Krock
|
||||
description = Minecarts are vehicles to move players quickly on rails.
|
||||
depends = mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons
|
||||
depends = mcl_title, mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons
|
||||
optional_depends = doc_identifier, mcl_wip
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local S = minetest.get_translator("mcl_minecarts")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
-- Template rail function
|
||||
local function register_rail(itemstring, tiles, def_extras, creative)
|
||||
|
@ -206,11 +206,11 @@ register_rail("mcl_minecarts:detector_rail_on",
|
|||
|
||||
-- Crafting
|
||||
minetest.register_craft({
|
||||
output = 'mcl_minecarts:rail 16',
|
||||
output = "mcl_minecarts:rail 16",
|
||||
recipe = {
|
||||
{'mcl_core:iron_ingot', '', 'mcl_core:iron_ingot'},
|
||||
{'mcl_core:iron_ingot', 'mcl_core:stick', 'mcl_core:iron_ingot'},
|
||||
{'mcl_core:iron_ingot', '', 'mcl_core:iron_ingot'},
|
||||
{"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"},
|
||||
{"mcl_core:iron_ingot", "mcl_core:stick", "mcl_core:iron_ingot"},
|
||||
{"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ local mod_mobspawners = minetest_get_modpath("mcl_mobspawners")
|
|||
--local height_switcher = false
|
||||
|
||||
-- Get translator
|
||||
local S = minetest.get_translator("mcl_mobs")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
-- CMI support check
|
||||
--local use_cmi = minetest.global_exists("cmi")
|
||||
|
@ -129,6 +129,7 @@ end
|
|||
local api_path = minetest.get_modpath(minetest.get_current_modname()).."/api/mob_functions/"
|
||||
|
||||
--ignite all parts of the api
|
||||
dofile(api_path .. "flow_lib.lua")
|
||||
dofile(api_path .. "ai.lua")
|
||||
dofile(api_path .. "animation.lua")
|
||||
dofile(api_path .. "collision.lua")
|
||||
|
@ -429,7 +430,7 @@ function mobs:register_mob(name, def)
|
|||
--harmed_by_heal = def.harmed_by_heal,
|
||||
})
|
||||
|
||||
if minetest_get_modpath("doc_identifier") ~= nil then
|
||||
if minetest_get_modpath("doc_identifier") then
|
||||
doc.sub.identifier.register_object(name, "basics", "mobs")
|
||||
end
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ local minetest_get_item_group = minetest.get_item_group
|
|||
local minetest_get_node = minetest.get_node
|
||||
local minetest_line_of_sight = minetest.line_of_sight
|
||||
local minetest_get_node_light = minetest.get_node_light
|
||||
local minetest_registered_nodes = minetest.registered_nodes
|
||||
local flow = mobs.get_flowing_dir
|
||||
|
||||
local DOUBLE_PI = math.pi * 2
|
||||
local THIRTY_SECONDTH_PI = DOUBLE_PI * 0.03125
|
||||
|
@ -521,8 +523,8 @@ ______ _
|
|||
| _| | | | | |
|
||||
| | | | |_| |
|
||||
\_| |_|\__, |
|
||||
__/ |
|
||||
|___/
|
||||
__/ |
|
||||
|___/
|
||||
]]--
|
||||
|
||||
-- state switching logic (stand, walk, run, attacks)
|
||||
|
@ -675,12 +677,12 @@ end
|
|||
--[[
|
||||
___
|
||||
|_ |
|
||||
| |_ _ _ __ ___ _ __
|
||||
| | | | | '_ ` _ \| '_ \
|
||||
| |_ _ _ __ ___ _ __
|
||||
| | | | | '_ ` _ \| '_ \
|
||||
/\__/ / |_| | | | | | | |_) |
|
||||
\____/ \__,_|_| |_| |_| .__/
|
||||
| |
|
||||
|_|
|
||||
| |
|
||||
|_|
|
||||
]]--
|
||||
|
||||
|
||||
|
@ -787,8 +789,8 @@ ___ ___ _ _ _
|
|||
| |\/| |/ _` | | '_ \ | | / _ \ / _` | |/ __|
|
||||
| | | | (_| | | | | | | |___| (_) | (_| | | (__
|
||||
\_| |_/\__,_|_|_| |_| \_____/\___/ \__, |_|\___|
|
||||
__/ |
|
||||
|___/
|
||||
__/ |
|
||||
|___/
|
||||
]]--
|
||||
|
||||
--the main loop
|
||||
|
@ -990,7 +992,7 @@ function mobs.mob_step(self, dtime)
|
|||
if self.memory <= 0 then
|
||||
|
||||
--reset states when coming out of hostile state
|
||||
if self.attacking ~= nil then
|
||||
if self.attacking then
|
||||
self.state_timer = -1
|
||||
end
|
||||
|
||||
|
@ -1011,6 +1013,19 @@ function mobs.mob_step(self, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
--mobs flow from Crafter
|
||||
local pos = self.object:get_pos()
|
||||
if pos then
|
||||
local flow_dir = flow(pos)
|
||||
if flow_dir then
|
||||
flow_dir = vector.multiply(flow_dir,10)
|
||||
local vel = self.object:get_velocity()
|
||||
local acceleration = vector.new(flow_dir.x-vel.x,flow_dir.y-vel.y,flow_dir.z-vel.z)
|
||||
acceleration = vector.multiply(acceleration, 0.01)
|
||||
self.object:add_velocity(acceleration)
|
||||
end
|
||||
end
|
||||
|
||||
--mob is stunned after being hit
|
||||
if self.pause_timer > 0 then
|
||||
self.pause_timer = self.pause_timer - dtime
|
||||
|
|
|
@ -41,7 +41,7 @@ mobs.explode_attack_walk = function(self,dtime)
|
|||
--make mob walk up to player within 2 nodes distance then start exploding
|
||||
if distance_from_attacking >= self.reach and
|
||||
--don't allow explosion to cancel unless out of the reach boundary
|
||||
not (self.explosion_animation ~= nil and self.explosion_animation > 0 and distance_from_attacking <= self.defuse_reach) then
|
||||
not (self.explosion_animation and self.explosion_animation > 0 and distance_from_attacking <= self.defuse_reach) then
|
||||
|
||||
mobs.set_velocity(self, self.run_velocity)
|
||||
mobs.set_mob_animation(self,"run")
|
||||
|
@ -85,9 +85,8 @@ end
|
|||
|
||||
--this is a small helper function to make working with explosion animations easier
|
||||
mobs.reverse_explosion_animation = function(self,dtime)
|
||||
|
||||
--if explosion animation was greater than 0 then reverse it
|
||||
if self.explosion_animation ~= nil and self.explosion_animation > 0 then
|
||||
if self.explosion_animation and self.explosion_animation > 0 then
|
||||
self.explosion_animation = self.explosion_animation - dtime
|
||||
if self.explosion_animation < 0 then
|
||||
self.explosion_animation = 0
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
--this is from https://github.com/HybridDog/builtin_item/blob/e6dfd9dce86503b3cbd1474257eca5f6f6ca71c2/init.lua#L50
|
||||
local
|
||||
minetest,vector,math,pairs,minetest_get_node,vector_subtract,minetest_registered_nodes
|
||||
=
|
||||
minetest,vector,math,pairs,minetest.get_node,vector.subtract,minetest.registered_nodes
|
||||
|
||||
local tab
|
||||
local n
|
||||
local function get_nodes(pos)
|
||||
tab,n = {},1
|
||||
for i = -1,1,2 do
|
||||
for _,p in pairs({
|
||||
{x=pos.x+i, y=pos.y, z=pos.z},
|
||||
{x=pos.x, y=pos.y, z=pos.z+i}
|
||||
}) do
|
||||
tab[n] = {p, minetest_get_node(p)}
|
||||
n = n+1
|
||||
end
|
||||
end
|
||||
return tab
|
||||
end
|
||||
|
||||
|
||||
local data
|
||||
local param2
|
||||
local nd
|
||||
local par2
|
||||
local name
|
||||
local tmp
|
||||
local c_node
|
||||
function mobs.get_flowing_dir(pos)
|
||||
c_node = minetest_get_node(pos).name
|
||||
if c_node ~= "mcl_core:water_flowing" and c_node ~= "mcl_core:water" then
|
||||
return nil
|
||||
end
|
||||
data = get_nodes(pos)
|
||||
param2 = minetest_get_node(pos).param2
|
||||
if param2 > 7 then
|
||||
return nil
|
||||
end
|
||||
if c_node == "mcl_core:water" then
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
if name == "mcl_core:water_flowing" and par2 == 7 then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
if name == "mcl_core:water_flowing" and par2 < param2 then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
if name == "mcl_core:water_flowing" and par2 >= 11 then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
tmp = minetest_registered_nodes[name]
|
||||
if tmp and not tmp.walkable and name ~= "mcl_core:water_flowing" and name ~= "mcl_core:water" then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
|
@ -32,12 +32,15 @@ end
|
|||
mobs.float = function(self)
|
||||
|
||||
local acceleration = self.object:get_acceleration()
|
||||
if acceleration and acceleration.y ~= 0 then
|
||||
self.object:set_acceleration(vector.new(0,0,0))
|
||||
else
|
||||
|
||||
if not acceleration then
|
||||
return
|
||||
end
|
||||
|
||||
if acceleration.y ~= 0 then
|
||||
self.object:set_acceleration({x=0, y=0, z=0})
|
||||
end
|
||||
|
||||
local current_velocity = self.object:get_velocity()
|
||||
|
||||
local goal_velocity = {
|
||||
|
@ -46,7 +49,7 @@ mobs.float = function(self)
|
|||
z = 0,
|
||||
}
|
||||
|
||||
local new_velocity_addition = vector.subtract(goal_velocity,current_velocity)
|
||||
local new_velocity_addition = vector.subtract(goal_velocity, current_velocity)
|
||||
|
||||
new_velocity_addition.x = 0
|
||||
new_velocity_addition.z = 0
|
||||
|
|
|
@ -36,9 +36,8 @@ mobs.shoot_projectile_handling = function(arrow_item, pos, dir, yaw, shooter, po
|
|||
le._collectable = collectable
|
||||
|
||||
--play custom shoot sound
|
||||
if shooter ~= nil and shooter.shoot_sound then
|
||||
if shooter and shooter.shoot_sound then
|
||||
minetest.sound_play(shooter.shoot_sound, {pos=pos, max_hear_distance=16}, true)
|
||||
end
|
||||
|
||||
return obj
|
||||
end
|
|
@ -5,6 +5,7 @@ local get_node_light = minetest.get_node_light
|
|||
local find_nodes_in_area_under_air = minetest.find_nodes_in_area_under_air
|
||||
local get_biome_name = minetest.get_biome_name
|
||||
local get_objects_inside_radius = minetest.get_objects_inside_radius
|
||||
local get_connected_players = minetest.get_connected_players
|
||||
|
||||
|
||||
local math_random = math.random
|
||||
|
@ -18,6 +19,7 @@ local vector_floor = vector.floor
|
|||
local table_copy = table.copy
|
||||
local table_remove = table.remove
|
||||
|
||||
local pairs = pairs
|
||||
|
||||
-- range for mob count
|
||||
local aoc_range = 48
|
||||
|
@ -279,7 +281,7 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh
|
|||
end
|
||||
|
||||
-- if toggle set to nil then ignore day/night check
|
||||
if day_toggle ~= nil then
|
||||
if day_toggle then
|
||||
|
||||
local tod = (minetest.get_timeofday() or 0) * 24000
|
||||
|
||||
|
@ -369,7 +371,7 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh
|
|||
if minetest.registered_nodes[node_ok(pos2).name].walkable == true then
|
||||
-- inside block
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, too little space!")
|
||||
if ent.spawn_small_alternative ~= nil and (not minetest.registered_nodes[node_ok(pos).name].walkable) then
|
||||
if ent.spawn_small_alternative and (not minetest.registered_nodes[node_ok(pos).name].walkable) then
|
||||
minetest.log("info", "Trying to spawn smaller alternative mob: "..ent.spawn_small_alternative)
|
||||
spawn_action(orig_pos, node, active_object_count, active_object_count_wider, ent.spawn_small_alternative)
|
||||
end
|
||||
|
@ -540,7 +542,7 @@ if mobs_spawn then
|
|||
timer = timer + dtime
|
||||
if timer >= 10 then
|
||||
timer = 0
|
||||
for _,player in pairs(minetest.get_connected_players()) do
|
||||
for _,player in pairs(get_connected_players()) do
|
||||
-- after this line each "break" means "continue"
|
||||
local do_mob_spawning = true
|
||||
repeat
|
||||
|
@ -548,15 +550,15 @@ if mobs_spawn then
|
|||
--they happen in a single server step
|
||||
|
||||
local player_pos = player:get_pos()
|
||||
local _,dimension = mcl_worlds.y_to_layer(player_pos.y)
|
||||
local dimension = mcl_worlds.pos_to_dimension(player_pos)
|
||||
|
||||
if dimension == "void" or dimension == "default" then
|
||||
break -- ignore void and unloaded area
|
||||
end
|
||||
|
||||
local min,max = decypher_limits(player_pos.y)
|
||||
local min, max = decypher_limits(player_pos.y)
|
||||
|
||||
for i = 1,math_random(1,4) do
|
||||
for i = 1, math_random(1,4) do
|
||||
-- after this line each "break" means "continue"
|
||||
local do_mob_algorithm = true
|
||||
repeat
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
local S = minetest.get_translator("mcl_mobs")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
-- name tag
|
||||
minetest.register_craftitem("mcl_mobs:nametag", {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=Tryb pokojowy aktywowany! Potwory nie będą się pojawiać.
|
||||
This allows you to place a single mob.=To pozwala na przywołanie jednego moba.
|
||||
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.=Postaw to w miejscu w którym chcesz aby pojawił się mob. Zwierzęta pojawią się jako oswojone chyba, że będziesz się skradał podczas stawiania. Jeśli postawisz to na spawnerze to zmienisz którego moba przywołuje.
|
||||
You need the “maphack” privilege to change the mob spawner.=Potrzebujesz przywileju "maphack", aby zmienić spawner.
|
||||
Name Tag=Znacznik
|
||||
A name tag is an item to name a mob.=Znacznik jest przedmiotem pozwalającym nazwać moba.
|
||||
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.=Zanim użyjesz znacznika musisz wybrać imię przy kowadle. Następnie możesz użyć znacznika by nazwać moba. To zużywa znacznik.
|
||||
Only peaceful mobs allowed!=Tylko pokojowe moby są dozwolone!
|
||||
Give names to mobs=Nazwij moby
|
||||
Set name at anvil=Wybierz imię przy kowadle
|
|
@ -1,8 +1,9 @@
|
|||
mcl_paintings = {}
|
||||
|
||||
dofile(minetest.get_modpath(minetest.get_current_modname()).."/paintings.lua")
|
||||
local modname = minetest.get_current_modname()
|
||||
dofile(minetest.get_modpath(modname).."/paintings.lua")
|
||||
|
||||
local S = minetest.get_translator("mcl_paintings")
|
||||
local S = minetest.get_translator(modname)
|
||||
|
||||
local math = math
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain:mcl_paintings
|
||||
Painting=Obraz
|
|
@ -8,7 +8,7 @@
|
|||
-- NOTE: Most strings intentionally not marked for translation, other mods already have these items.
|
||||
-- TODO: Remove this file eventually, most items are already outsourced in other mods.
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local c = mobs_mc.is_item_variable_overridden
|
||||
|
||||
|
@ -234,8 +234,8 @@ end
|
|||
if c("ender_eye") and c("blaze_powder") and c("blaze_rod") then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'mobs_mc:ender_eye',
|
||||
recipe = { 'mobs_mc:blaze_powder', 'mobs_mc:blaze_rod'},
|
||||
output = "mobs_mc:ender_eye",
|
||||
recipe = { "mobs_mc:blaze_powder", "mobs_mc:blaze_rod"},
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-- NOTE: Strings intentionally not marked for translation, other mods already have these items.
|
||||
-- TODO: Remove this file eventually, all items here are already outsourced in other mods.
|
||||
|
||||
--local S = minetest.get_translator("mobs_mc")
|
||||
--local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--maikerumines throwing code
|
||||
--arrow (weapon)
|
||||
|
@ -83,7 +83,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
|||
if self.timer>0.2 then
|
||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1.5)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity() then
|
||||
if obj:get_luaentity().name ~= "mobs_mc:arrow_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
local damage = 3
|
||||
minetest.sound_play("damage", {pos = pos}, true)
|
||||
|
@ -108,7 +108,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
|||
if self.lastpos.x~=nil then
|
||||
if node.name ~= "air" then
|
||||
minetest.sound_play("bowhit1", {pos = pos}, true)
|
||||
minetest.add_item(self.lastpos, 'mobs_mc:arrow')
|
||||
minetest.add_item(self.lastpos, "mobs_mc:arrow")
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
|
@ -155,7 +155,7 @@ end
|
|||
|
||||
if c("arrow") and c("flint") and c("feather") and c("stick") then
|
||||
minetest.register_craft({
|
||||
output = 'mobs_mc:arrow 4',
|
||||
output = "mobs_mc:arrow 4",
|
||||
recipe = {
|
||||
{mobs_mc.items.flint},
|
||||
{mobs_mc.items.stick},
|
||||
|
@ -181,11 +181,11 @@ if c("bow") then
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'mobs_mc:bow_wood',
|
||||
output = "mobs_mc:bow_wood",
|
||||
recipe = {
|
||||
{mobs_mc.items.string, mobs_mc.items.stick, ''},
|
||||
{mobs_mc.items.string, '', mobs_mc.items.stick},
|
||||
{mobs_mc.items.string, mobs_mc.items.stick, ''},
|
||||
{mobs_mc.items.string, mobs_mc.items.stick, ""},
|
||||
{mobs_mc.items.string, "", mobs_mc.items.stick},
|
||||
{mobs_mc.items.string, mobs_mc.items.stick, ""},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
@ -259,7 +259,7 @@ if c("egg") then
|
|||
})
|
||||
|
||||
-- shoot egg
|
||||
local mobs_shoot_egg = function (item, player, pointed_thing)
|
||||
local function mobs_shoot_egg(item, player, pointed_thing)
|
||||
|
||||
local playerpos = player:get_pos()
|
||||
|
||||
|
@ -349,7 +349,7 @@ mobs:register_arrow("mobs_mc:snowball_entity", {
|
|||
|
||||
if c("snowball") then
|
||||
-- shoot snowball
|
||||
local mobs_shoot_snowball = function (item, player, pointed_thing)
|
||||
local function mobs_shoot_snowball(item, player, pointed_thing)
|
||||
|
||||
local playerpos = player:get_pos()
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
-- TODO: Remove this file eventually, all items here are already outsourced in other mods.
|
||||
-- TODO: Add translation.
|
||||
|
||||
--local S = minetest.get_translator("mobs_mc")
|
||||
--local S = local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
-- Heads system
|
||||
|
||||
|
|
|
@ -190,9 +190,10 @@ Origin of those models:
|
|||
* [Spennnyyy](https://freesound.org/people/Spennnyyy/) (CC0)
|
||||
* `mcl_totems_totem.ogg`
|
||||
* Source: <https://freesound.org/people/Spennnyyy/sounds/323502/>
|
||||
* [Baŝto](https://opengameart.org/users/ba%C5%9Dto)
|
||||
* [Baŝto](https://opengameart.org/users/ba%C5%9Dto) (remixer) and [kantouth](https://freesound.org/people/kantouth/) (original author)
|
||||
* `mobs_mc_skeleton_random.*.ogg` (CC BY 3.0)
|
||||
* Source: <https://opengameart.org/content/walking-skeleton>
|
||||
* Based on: <https://freesound.org/people/kantouth/sounds/115113/>
|
||||
* [spookymodem](https://freesound.org/people/spookymodem/)
|
||||
* `mobs_mc_skeleton_death.ogg` (CC0)
|
||||
* <https://freesound.org/people/spookymodem/sounds/202091/>
|
||||
|
@ -306,4 +307,4 @@ Origin of those models:
|
|||
|
||||
Note: Many of these sounds have been more or less modified to fit the game.
|
||||
|
||||
Sounds not mentioned hre are licensed under CC0.
|
||||
Sounds not mentioned here are licensed under CC0.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
--################### AGENT - seemingly unused
|
||||
--###################
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:agent", {
|
||||
type = "npc",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:bat", {
|
||||
description = S("Bat"),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models -hi 22i ~jordan4ibanez
|
||||
-- blaze.lua partial copy of mobs_mc/ghast.lua
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### BLAZE
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### CHICKEN
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local cow_def = {
|
||||
description = S("Cow"),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### CREEPER
|
||||
|
@ -72,7 +72,7 @@ mobs:register_mob("mobs_mc:creeper", {
|
|||
-- TODO: Make creeper flash after doing this as well.
|
||||
-- TODO: Test and debug this code.
|
||||
on_rightclick = function(self, clicker)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
if self._forced_explosion_countdown_timer then
|
||||
return
|
||||
end
|
||||
local item = clicker:get_wielded_item()
|
||||
|
@ -92,7 +92,7 @@ mobs:register_mob("mobs_mc:creeper", {
|
|||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
if self._forced_explosion_countdown_timer then
|
||||
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
|
||||
if self._forced_explosion_countdown_timer <= 0 then
|
||||
mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength)
|
||||
|
@ -196,7 +196,7 @@ mobs:register_mob("mobs_mc:creeper_charged", {
|
|||
-- TODO: Make creeper flash after doing this as well.
|
||||
-- TODO: Test and debug this code.
|
||||
on_rightclick = function(self, clicker)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
if self._forced_explosion_countdown_timer then
|
||||
return
|
||||
end
|
||||
local item = clicker:get_wielded_item()
|
||||
|
@ -216,7 +216,7 @@ mobs:register_mob("mobs_mc:creeper_charged", {
|
|||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
if self._forced_explosion_countdown_timer then
|
||||
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
|
||||
if self._forced_explosion_countdown_timer <= 0 then
|
||||
mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
--################### ENDERDRAGON
|
||||
--###################
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:enderdragon", {
|
||||
description = S("Ender Dragon"),
|
||||
|
|
|
@ -24,9 +24,11 @@
|
|||
-- added rain damage.
|
||||
-- fixed the grass_with_dirt issue.
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local telesound = function(pos, is_source)
|
||||
local vector = vector
|
||||
|
||||
local function telesound(pos, is_source)
|
||||
local snd
|
||||
if is_source then
|
||||
snd = "mobs_mc_enderman_teleport_src"
|
||||
|
@ -302,7 +304,7 @@ mobs:register_mob("mobs_mc:enderman", {
|
|||
if self.attacking then
|
||||
local target = self.attacking
|
||||
local pos = target:get_pos()
|
||||
if pos ~= nil then
|
||||
if pos then
|
||||
if vector.distance(self.object:get_pos(), target:get_pos()) > 10 then
|
||||
self:teleport(target)
|
||||
end
|
||||
|
@ -341,8 +343,8 @@ mobs:register_mob("mobs_mc:enderman", {
|
|||
-- self:teleport(nil)
|
||||
-- self.state = ""
|
||||
--else
|
||||
if self.attack ~= nil and not minetest.settings:get_bool("creative_mode") then
|
||||
self.state = 'attack'
|
||||
if self.attack and not minetest.settings:get_bool("creative_mode") then
|
||||
self.state = "attack"
|
||||
end
|
||||
--end
|
||||
end
|
||||
|
@ -459,7 +461,7 @@ mobs:register_mob("mobs_mc:enderman", {
|
|||
end
|
||||
end
|
||||
end
|
||||
elseif self._taken_node ~= nil and self._taken_node ~= "" and self._take_place_timer >= self._next_take_place_time then
|
||||
elseif self._taken_node and self._taken_node ~= "" and self._take_place_timer >= self._next_take_place_time then
|
||||
-- Place taken node
|
||||
self._take_place_timer = 0
|
||||
self._next_take_place_time = math.random(take_frequency_min, take_frequency_max)
|
||||
|
@ -485,12 +487,12 @@ mobs:register_mob("mobs_mc:enderman", {
|
|||
end
|
||||
end,
|
||||
do_teleport = function(self, target)
|
||||
if target ~= nil then
|
||||
if target then
|
||||
local target_pos = target:get_pos()
|
||||
-- Find all solid nodes below air in a 10×10×10 cuboid centered on the target
|
||||
local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(target_pos, 5), vector.add(target_pos, 5), {"group:solid", "group:cracky", "group:crumbly"})
|
||||
local telepos
|
||||
if nodes ~= nil then
|
||||
if nodes then
|
||||
if #nodes > 0 then
|
||||
-- Up to 64 attempts to teleport
|
||||
for n=1, math.min(64, #nodes) do
|
||||
|
@ -525,7 +527,7 @@ mobs:register_mob("mobs_mc:enderman", {
|
|||
-- We need to add (or subtract) different random numbers to each vector component, so it couldn't be done with a nice single vector.add() or .subtract():
|
||||
local randomCube = vector.new( pos.x + 8*(pr:next(0,16)-8), pos.y + 8*(pr:next(0,16)-8), pos.z + 8*(pr:next(0,16)-8) )
|
||||
local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(randomCube, 4), vector.add(randomCube, 4), {"group:solid", "group:cracky", "group:crumbly"})
|
||||
if nodes ~= nil then
|
||||
if nodes then
|
||||
if #nodes > 0 then
|
||||
-- Up to 8 low-level (in total up to 8*8 = 64) attempts to teleport
|
||||
for n=1, math.min(8, #nodes) do
|
||||
|
@ -557,13 +559,13 @@ mobs:register_mob("mobs_mc:enderman", {
|
|||
end,
|
||||
on_die = function(self, pos)
|
||||
-- Drop carried node on death
|
||||
if self._taken_node ~= nil and self._taken_node ~= "" then
|
||||
if self._taken_node and self._taken_node ~= "" then
|
||||
minetest.add_item(pos, self._taken_node)
|
||||
end
|
||||
end,
|
||||
do_punch = function(self, hitter, tflp, tool_caps, dir)
|
||||
-- damage from rain caused by itself so we don't want it to attack itself.
|
||||
if hitter ~= self.object and hitter ~= nil then
|
||||
if hitter ~= self.object and hitter then
|
||||
--if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then
|
||||
-- self:teleport(nil)
|
||||
--else
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
--################### ENDERMITE
|
||||
--###################
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:endermite", {
|
||||
description = S("Endermite"),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### GHAST
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
--################### GUARDIAN
|
||||
--###################
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:guardian", {
|
||||
description = S("Guardian"),
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
--################### GUARDIAN
|
||||
--###################
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:guardian_elder", {
|
||||
description = S("Elder Guardian"),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### HORSE
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local path = minetest.get_modpath("mobs_mc")
|
||||
local path = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
if not minetest.get_modpath("mobs_mc_gameconfig") then
|
||||
mobs_mc = {}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### IRON GOLEM
|
||||
|
@ -158,11 +158,11 @@ mobs_mc.tools.check_iron_golem_summon = function(pos)
|
|||
if ok then
|
||||
-- Remove the nodes
|
||||
minetest.remove_node(pos)
|
||||
core.check_for_falling(pos)
|
||||
minetest.check_for_falling(pos)
|
||||
for i=1, 4 do
|
||||
local cpos = vector.add(pos, checks[c][i])
|
||||
minetest.remove_node(cpos)
|
||||
core.check_for_falling(cpos)
|
||||
minetest.check_for_falling(cpos)
|
||||
end
|
||||
-- Summon iron golem
|
||||
local place
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### LLAMA
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
# textdomain: mobs_mc
|
||||
Totem of Undying=Token nieśmiertelności
|
||||
A totem of undying is a rare artifact which may safe you from certain death.=Totem nieśmiertelności to rzadki artefakt, który może uchronić cię przed pewną śmiercią.
|
||||
The totem only works while you hold it in your hand. If you receive fatal damage, you are saved from death and you get a second chance with 1 HP. The totem is destroyed in the process, however.=Totem działa tylko kiedy trzymasz go w dłoni. Jeśli otrzymasz obrażenia od upadku zostaniesz oszczędzony i pozostanie ci 1 HP, jednak totem zostanie wtedy zniszczony.
|
||||
Agent=Agent
|
||||
Bat=Nietoperz
|
||||
Blaze=Płomyk
|
||||
Chicken=Kurczak
|
||||
Cow=Krowa
|
||||
Mooshroom=Muuuchomor
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Smok kresu
|
||||
Enderman=Enderman
|
||||
Endermite=Endermit
|
||||
Ghast=Ghast
|
||||
Elder Guardian=Prastrażnik
|
||||
Guardian=Strażnik
|
||||
Horse=Koń
|
||||
Skeleton Horse=Koń szkielet
|
||||
Zombie Horse=Koń zombie
|
||||
Donkey=Osioł
|
||||
Mule=Muł
|
||||
Iron Golem=Żelazny golem
|
||||
Llama=Lama
|
||||
Ocelot=Ocelot
|
||||
Parrot=Papuga
|
||||
Pig=Świnia
|
||||
Polar Bear=Niedźwiedź polarny
|
||||
Rabbit=Królik
|
||||
Killer Bunny=Królik zabójca
|
||||
Sheep=Owca
|
||||
Shulker=Shulker
|
||||
Silverfish=Rybik cukrowy
|
||||
Skeleton=Szkielet
|
||||
Stray=Tułacz
|
||||
Wither Skeleton=Witherowy szkielet
|
||||
Magma Cube=Kostka magmy
|
||||
Slime=Szlam
|
||||
Snow Golem=Śnieżny golem
|
||||
Spider=Pająk
|
||||
Cave Spider=Pająk jaskiniowy
|
||||
Squid=Kałamarnica
|
||||
Vex=Dręczyciel
|
||||
Evoker=Przywoływacz
|
||||
Illusioner=Iluzjonista
|
||||
Villager=Osadnik
|
||||
Vindicator=Obrońca
|
||||
Zombie Villager=Osadnik zombie
|
||||
Witch=Wiedźma
|
||||
Wither=Wither
|
||||
Wolf=Wilk
|
||||
Husk=Posuch
|
||||
Zombie=Zombie
|
||||
Zombie Pigman=Świniak zombie
|
||||
Iron Horse Armor=Żelazna zbroja dla konia
|
||||
Iron horse armor can be worn by horses to increase their protection from harm a bit.=Żelazna zbroja dla konia może być noszona przez konie aby nieco zwiększyć ich odporność na obrażenia.
|
||||
Golden Horse Armor=Złota zbroja dla konia
|
||||
Golden horse armor can be worn by horses to increase their protection from harm.=Złota zbroja dla konia może być noszona przez konie aby zwiększyć ich odporność na obrażenia.
|
||||
Diamond Horse Armor=Diamentowa zbroja dla konia
|
||||
Diamond horse armor can be worn by horses to greatly increase their protection from harm.=Diamentowa zbroja dla konia może być noszona przez konie aby istotnie zwiększyć ich odporność na obrażenia.
|
||||
Place it on a horse to put on the horse armor. Donkeys and mules can't wear horse armor.=Połóż ją na koniu aby założyć zbroję dla konia. Osły i muły nie mogą nosić zbroi dla konia.
|
||||
Farmer=Rolnik
|
||||
Fisherman=Rybak
|
||||
Fletcher=Łuczarz
|
||||
Shepherd=Pasterz
|
||||
Librarian=Bibliotekarz
|
||||
Cartographer=Kartograf
|
||||
Armorer=Płatnerz
|
||||
Leatherworker=Rymarz
|
||||
Butcher=Rzeźnik
|
||||
Weapon Smith=Zbrojmistrz
|
||||
Tool Smith=Narzędziarz
|
||||
Cleric=Kapłan
|
||||
Nitwit=Głupiec
|
||||
Protects you from death while wielding it=Chroni przed śmiercią gdy go trzymasz
|
|
@ -28,6 +28,7 @@ Pig=
|
|||
Polar Bear=
|
||||
Rabbit=
|
||||
Killer Bunny=
|
||||
The Killer Bunny=
|
||||
Sheep=
|
||||
Shulker=
|
||||
Silverfish=
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### OCELOT AND CAT
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### PARROT
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:pig", {
|
||||
description = S("Pig"),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### POLARBEAR
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local rabbit = {
|
||||
description = S("Rabbit"),
|
||||
|
@ -233,4 +233,4 @@ mobs:spawn(spawn_grass)
|
|||
mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0)
|
||||
|
||||
-- Note: This spawn egg does not exist in Minecraft
|
||||
mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit.png^[colorize:#FF0000:192", 0) -- TODO: Update inventory image
|
||||
mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit_caerbannog.png", 0)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### SHEEP
|
||||
|
@ -38,7 +38,7 @@ local rainbow_colors = {
|
|||
"unicolor_red_violet"
|
||||
}
|
||||
|
||||
if minetest.get_modpath("mcl_wool") ~= nil then
|
||||
if minetest.get_modpath("mcl_wool") then
|
||||
colors["unicolor_light_blue"] = { mobs_mc.items.wool_light_blue, "#5050FFD0" }
|
||||
end
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### SHULKER
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
--################### SILVERFISH
|
||||
--###################
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:silverfish", {
|
||||
description = S("Silverfish"),
|
||||
|
@ -61,7 +61,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
|
|||
description = "Stone Monster Egg",
|
||||
tiles = {"default_stone.png"},
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
drop = "",
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
|
@ -72,7 +72,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
|
|||
tiles = {"default_cobble.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
drop = "",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
@ -82,7 +82,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
|
|||
tiles = {"default_mossycobble.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
drop = "",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
@ -94,7 +94,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
|
|||
tiles = {"default_stone_brick.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
drop = "",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
@ -104,7 +104,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
|
|||
tiles = {"default_stone_block.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
drop = "",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local mod_bows = minetest.get_modpath("mcl_bows") ~= nil
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local mod_bows = minetest.get_modpath("mcl_bows")
|
||||
|
||||
--###################
|
||||
--################### SKELETON
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### WITHER SKELETON
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
-- Returns a function that spawns children in a circle around pos.
|
||||
-- To be used as on_die callback.
|
||||
|
@ -41,10 +41,10 @@ local spawn_children_on_die = function(child_mob, children_count, spawn_distance
|
|||
-- If mother was murdered, children attack the killer after 1 second
|
||||
if self.state == "attack" then
|
||||
minetest.after(1.0, function(children, enemy)
|
||||
for c=1, #children do
|
||||
for c = 1, #children do
|
||||
local child = children[c]
|
||||
local le = child:get_luaentity()
|
||||
if le ~= nil then
|
||||
if le then
|
||||
le.state = "attack"
|
||||
le.attack = enemy
|
||||
end
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local snow_trail_frequency = 0.5 -- Time in seconds for checking to add a new snow trail
|
||||
|
||||
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
|
||||
local mod_throwing = minetest.get_modpath("mcl_throwing") ~= nil
|
||||
local mod_throwing = minetest.get_modpath("mcl_throwing")
|
||||
|
||||
local gotten_texture = {
|
||||
"mobs_mc_snowman.png",
|
||||
|
@ -179,9 +179,9 @@ mobs_mc.tools.check_snow_golem_summon = function(pos)
|
|||
minetest.remove_node(pos)
|
||||
minetest.remove_node(b1)
|
||||
minetest.remove_node(b2)
|
||||
core.check_for_falling(pos)
|
||||
core.check_for_falling(b1)
|
||||
core.check_for_falling(b2)
|
||||
minetest.check_for_falling(pos)
|
||||
minetest.check_for_falling(b1)
|
||||
minetest.check_for_falling(b2)
|
||||
local obj = minetest.add_entity(place, "mobs_mc:snowman")
|
||||
if obj then
|
||||
summon_particles(obj)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### SPIDER
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
--################### SQUID
|
||||
--###################
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:squid", {
|
||||
description = S("Squid"),
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### VEX
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
-- TODO: Internal inventory, pick up items, trade with other villagers
|
||||
-- TODO: Farm stuff
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local N = function(s) return s end
|
||||
local F = minetest.formspec_escape
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### EVOKER
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local mod_bows = minetest.get_modpath("mcl_bows") ~= nil
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local mod_bows = minetest.get_modpath("mcl_bows")
|
||||
|
||||
mobs:register_mob("mobs_mc:illusioner", {
|
||||
description = S("Illusioner"),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### VINDICATOR
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### ZOMBIE VILLAGER
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### WITCH
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### WITHER
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local default_walk_chance = 50
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### ZOMBIE
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
--###################
|
||||
--################### ZOMBIE PIGMAN
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
--[[
|
||||
|
||||
Copyright (C) 2016 - Auke Kok <sofar@foo-projects.org>
|
||||
Adapted by MineClone2 contributors
|
||||
|
||||
"lightning" is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
|
@ -9,7 +10,7 @@ of the license, or (at your option) any later version.
|
|||
|
||||
--]]
|
||||
|
||||
local S = minetest.get_translator("lightning")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local get_connected_players = minetest.get_connected_players
|
||||
local line_of_sight = minetest.line_of_sight
|
||||
|
@ -22,22 +23,22 @@ local add_entity = minetest.add_entity
|
|||
local get_objects_inside_radius = minetest.get_objects_inside_radius
|
||||
local get_item_group = minetest.get_item_group
|
||||
|
||||
lightning = {}
|
||||
|
||||
lightning.interval_low = 17
|
||||
lightning.interval_high = 503
|
||||
lightning.range_h = 100
|
||||
lightning.range_v = 50
|
||||
lightning.size = 100
|
||||
-- disable this to stop lightning mod from striking
|
||||
lightning.auto = true
|
||||
lightning = {
|
||||
interval_low = 17,
|
||||
interval_high = 503,
|
||||
range_h = 100,
|
||||
range_v = 50,
|
||||
size = 100,
|
||||
-- disable this to stop lightning mod from striking
|
||||
auto = true,
|
||||
}
|
||||
|
||||
local rng = PcgRandom(32321123312123)
|
||||
|
||||
local ps = {}
|
||||
local ttl = -1
|
||||
|
||||
local revertsky = function(dtime)
|
||||
local function revertsky(dtime)
|
||||
if ttl == 0 then
|
||||
return
|
||||
end
|
||||
|
@ -96,7 +97,7 @@ end
|
|||
-- lightning strike API
|
||||
-- * pos: optional, if not given a random pos will be chosen
|
||||
-- * returns: bool - success if a strike happened
|
||||
lightning.strike = function(pos)
|
||||
function lightning.strike(pos)
|
||||
if lightning.auto then
|
||||
after(rng:next(lightning.interval_low, lightning.interval_high), lightning.strike)
|
||||
end
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: lightning
|
||||
@1 was struck by lightning.=@1 została trafiona przez piorun.
|
||||
Let lightning strike at the specified position or yourself=Pozwala by piorun uderzył we wskazaną pozycję lub ciebie
|
||||
No position specified and unknown player=Nie wskazano pozycji i nieznany gracz
|
|
@ -1,4 +1,4 @@
|
|||
local S = minetest.get_translator("mcl_void_damage")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
--local enable_damage = minetest.settings:get_bool("enable_damage")
|
||||
|
||||
local pos_to_dim = mcl_worlds.pos_to_dimension
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_void_damage
|
||||
The void is off-limits to you!=Otchłań jest poza twoim zasięgiem!
|
||||
@1 fell into the endless void.=@1 spadła w bezkresną otchłań.
|
|
@ -1,4 +1,4 @@
|
|||
local modpath = minetest.get_modpath("mcl_weather")
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
mcl_weather = {}
|
||||
|
||||
|
@ -12,6 +12,6 @@ dofile(modpath.."/snow.lua")
|
|||
dofile(modpath.."/rain.lua")
|
||||
dofile(modpath.."/nether_dust.lua")
|
||||
|
||||
if minetest.get_modpath("lightning") ~= nil then
|
||||
if minetest.get_modpath("lightning") then
|
||||
dofile(modpath.."/thunder.lua")
|
||||
end
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# textdomain: mcl_weather
|
||||
Gives ability to control weather=Daje możliwość kontrolowania pogody
|
||||
Changes the weather to the specified parameter.=Zmienia pogodę na wskazany parametr
|
||||
Error: No weather specified.=Błąd: nie wskazano pogody.
|
||||
Error: Invalid parameters.=Błąd: nieprawidłowy parametr.
|
||||
Error: Duration can't be less than 1 second.=Błąd: Czas trwania nie może być mniejszy niż 1 sekunda.
|
||||
Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.=Błąd: wskazano nieprawidłową pogodę. Użyj "clear", "rain", "snow" lub "thunder".
|
||||
Toggles between clear weather and weather with downfall (randomly rain, thunderstorm or snow)=Zmienia pomiędzy czystą pogodą i pogodą z opadami (losowo deszcz, burza lub śnieg)
|
|
@ -2,7 +2,7 @@ mcl_weather.nether_dust = {}
|
|||
mcl_weather.nether_dust.particles_count = 99
|
||||
|
||||
-- calculates coordinates and draw particles for Nether dust
|
||||
mcl_weather.nether_dust.add_dust_particles = function(player)
|
||||
function mcl_weather.nether_dust.add_dust_particles(player)
|
||||
for i=mcl_weather.nether_dust.particles_count, 1,-1 do
|
||||
local rpx, rpy, rpz = mcl_weather.get_random_pos_by_player_look_dir(player)
|
||||
minetest.add_particle({
|
||||
|
|
|
@ -96,7 +96,7 @@ end
|
|||
-- be sure to remove sound before removing player otherwise soundhandler reference will be lost.
|
||||
function mcl_weather.rain.remove_player(player)
|
||||
local player_meta = mcl_weather.players[player:get_player_name()]
|
||||
if player_meta ~= nil and player_meta.origin_sky ~= nil then
|
||||
if player_meta and player_meta.origin_sky then
|
||||
player:set_clouds({color="#FFF0F0E5"})
|
||||
mcl_weather.players[player:get_player_name()] = nil
|
||||
end
|
||||
|
@ -120,12 +120,12 @@ end)
|
|||
-- when player stay on 'edge' where sound should play and stop depending from random raindrop appearance.
|
||||
function mcl_weather.rain.update_sound(player)
|
||||
local player_meta = mcl_weather.players[player:get_player_name()]
|
||||
if player_meta ~= nil then
|
||||
if player_meta.sound_updated ~= nil and player_meta.sound_updated + 5 > minetest.get_gametime() then
|
||||
if player_meta then
|
||||
if player_meta.sound_updated and player_meta.sound_updated + 5 > minetest.get_gametime() then
|
||||
return false
|
||||
end
|
||||
|
||||
if player_meta.sound_handler ~= nil then
|
||||
if player_meta.sound_handler then
|
||||
if mcl_weather.rain.last_rp_count == 0 then
|
||||
minetest.sound_fade(player_meta.sound_handler, -0.5, 0.0)
|
||||
player_meta.sound_handler = nil
|
||||
|
@ -141,7 +141,7 @@ end
|
|||
-- rain sound removed from player.
|
||||
function mcl_weather.rain.remove_sound(player)
|
||||
local player_meta = mcl_weather.players[player:get_player_name()]
|
||||
if player_meta ~= nil and player_meta.sound_handler ~= nil then
|
||||
if player_meta and player_meta.sound_handler then
|
||||
minetest.sound_fade(player_meta.sound_handler, -0.5, 0.0)
|
||||
player_meta.sound_handler = nil
|
||||
player_meta.sound_updated = nil
|
||||
|
|
|
@ -235,7 +235,7 @@ minetest.register_globalstep(function(dtime)
|
|||
|
||||
end)
|
||||
|
||||
local initsky = function(player)
|
||||
local function initsky(player)
|
||||
if (mcl_weather.skycolor.active) then
|
||||
mcl_weather.skycolor.force_update = true
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ mcl_weather.snow.particles_count = 15
|
|||
mcl_weather.snow.init_done = false
|
||||
|
||||
-- calculates coordinates and draw particles for snow weather
|
||||
mcl_weather.snow.add_snow_particles = function(player)
|
||||
function mcl_weather.snow.add_snow_particles(player)
|
||||
mcl_weather.rain.last_rp_count = 0
|
||||
for i=mcl_weather.snow.particles_count, 1,-1 do
|
||||
local random_pos_x, _, random_pos_z = mcl_weather.get_random_pos_by_player_look_dir(player)
|
||||
|
@ -30,7 +30,7 @@ mcl_weather.snow.add_snow_particles = function(player)
|
|||
end
|
||||
end
|
||||
|
||||
mcl_weather.snow.set_sky_box = function()
|
||||
function mcl_weather.snow.set_sky_box()
|
||||
mcl_weather.skycolor.add_layer(
|
||||
"weather-pack-snow-sky",
|
||||
{{r=0, g=0, b=0},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local S = minetest.get_translator("mcl_weather")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local math = math
|
||||
|
||||
|
@ -39,7 +39,7 @@ mcl_weather.reg_weathers["none"] = {
|
|||
|
||||
local storage = minetest.get_mod_storage()
|
||||
-- Save weather into mod storage, so it can be loaded after restarting the server
|
||||
local save_weather = function()
|
||||
local function save_weather()
|
||||
if not mcl_weather.end_time then return end
|
||||
storage:set_string("mcl_weather_state", mcl_weather.state)
|
||||
storage:set_int("mcl_weather_end_time", mcl_weather.end_time)
|
||||
|
@ -47,9 +47,9 @@ local save_weather = function()
|
|||
end
|
||||
minetest.register_on_shutdown(save_weather)
|
||||
|
||||
mcl_weather.get_rand_end_time = function(min_duration, max_duration)
|
||||
function mcl_weather.get_rand_end_time(min_duration, max_duration)
|
||||
local r
|
||||
if min_duration ~= nil and max_duration ~= nil then
|
||||
if min_duration and max_duration then
|
||||
r = math.random(min_duration, max_duration)
|
||||
else
|
||||
r = math.random(mcl_weather.min_duration, mcl_weather.max_duration)
|
||||
|
@ -57,7 +57,7 @@ mcl_weather.get_rand_end_time = function(min_duration, max_duration)
|
|||
return minetest.get_gametime() + r
|
||||
end
|
||||
|
||||
mcl_weather.get_current_light_factor = function()
|
||||
function mcl_weather.get_current_light_factor()
|
||||
if mcl_weather.state == "none" then
|
||||
return nil
|
||||
else
|
||||
|
@ -68,7 +68,7 @@ end
|
|||
-- Returns true if pos is outdoor.
|
||||
-- Outdoor is defined as any node in the Overworld under open sky.
|
||||
-- FIXME: Nodes below glass also count as “outdoor”, this should not be the case.
|
||||
mcl_weather.is_outdoor = function(pos)
|
||||
function mcl_weather.is_outdoor(pos)
|
||||
local cpos = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local dim = mcl_worlds.pos_to_dimension(cpos)
|
||||
if minetest.get_node_light(cpos, 0.5) == 15 and dim == "overworld" then
|
||||
|
@ -79,7 +79,7 @@ end
|
|||
|
||||
-- checks if player is undewater. This is needed in order to
|
||||
-- turn off weather particles generation.
|
||||
mcl_weather.is_underwater = function(player)
|
||||
function mcl_weather.is_underwater(player)
|
||||
local ppos = player:get_pos()
|
||||
local offset = player:get_eye_offset()
|
||||
local player_eye_pos = {x = ppos.x + offset.x,
|
||||
|
@ -94,7 +94,7 @@ end
|
|||
|
||||
-- trying to locate position for particles by player look direction for performance reason.
|
||||
-- it is costly to generate many particles around player so goal is focus mainly on front view.
|
||||
mcl_weather.get_random_pos_by_player_look_dir = function(player)
|
||||
function mcl_weather.get_random_pos_by_player_look_dir(player)
|
||||
local look_dir = player:get_look_dir()
|
||||
local player_pos = player:get_pos()
|
||||
|
||||
|
@ -123,6 +123,7 @@ mcl_weather.get_random_pos_by_player_look_dir = function(player)
|
|||
end
|
||||
|
||||
local t, wci = 0, mcl_weather.check_interval
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
t = t + dtime
|
||||
if t < wci then return end
|
||||
|
@ -146,7 +147,7 @@ minetest.register_globalstep(function(dtime)
|
|||
end)
|
||||
|
||||
-- Sets random weather (which could be 'none' (no weather)).
|
||||
mcl_weather.set_random_weather = function(weather_name, weather_meta)
|
||||
function mcl_weather.set_random_weather(weather_name, weather_meta)
|
||||
if weather_meta == nil then return end
|
||||
local transitions = weather_meta.transitions
|
||||
local random_roll = math.random(0,100)
|
||||
|
@ -166,11 +167,11 @@ end
|
|||
-- * explicit_end_time is OPTIONAL. If specified, explicitly set the
|
||||
-- gametime (minetest.get_gametime) in which the weather ends.
|
||||
-- * changer is OPTIONAL, for logging purposes.
|
||||
mcl_weather.change_weather = function(new_weather, explicit_end_time, changer_name)
|
||||
function mcl_weather.change_weather(new_weather, explicit_end_time, changer_name)
|
||||
local changer_name = changer_name or debug.getinfo(2).name.."()"
|
||||
|
||||
if (mcl_weather.reg_weathers ~= nil and mcl_weather.reg_weathers[new_weather] ~= nil) then
|
||||
if (mcl_weather.state ~= nil and mcl_weather.reg_weathers[mcl_weather.state] ~= nil) then
|
||||
if (mcl_weather.reg_weathers and mcl_weather.reg_weathers[new_weather]) then
|
||||
if (mcl_weather.state and mcl_weather.reg_weathers[mcl_weather.state]) then
|
||||
mcl_weather.reg_weathers[mcl_weather.state].clear()
|
||||
end
|
||||
|
||||
|
@ -199,7 +200,7 @@ mcl_weather.change_weather = function(new_weather, explicit_end_time, changer_na
|
|||
return false
|
||||
end
|
||||
|
||||
mcl_weather.get_weather = function()
|
||||
function mcl_weather.get_weather()
|
||||
return mcl_weather.state
|
||||
end
|
||||
|
||||
|
@ -268,12 +269,12 @@ minetest.register_chatcommand("toggledownfall", {
|
|||
-- Configuration setting which allows user to disable ABM for weathers (if they use it).
|
||||
-- Weather mods expected to be use this flag before registering ABM.
|
||||
local weather_allow_abm = minetest.settings:get_bool("weather_allow_abm")
|
||||
if weather_allow_abm ~= nil and weather_allow_abm == false then
|
||||
if weather_allow_abm == false then
|
||||
mcl_weather.allow_abm = false
|
||||
end
|
||||
|
||||
|
||||
local load_weather = function()
|
||||
local function load_weather()
|
||||
local weather = storage:get_string("mcl_weather_state")
|
||||
if weather and weather ~= "" then
|
||||
mcl_weather.state = weather
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
local S = minetest.get_translator("doc")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local F = function(f) return minetest.formspec_escape(S(f)) end
|
||||
|
||||
local mod_central_messages = minetest.get_modpath("central_message")
|
||||
local mod_inventory_plus = minetest.get_modpath("inventory_plus")
|
||||
|
||||
local math = math
|
||||
local colorize = minetest.colorize
|
||||
|
||||
doc = {}
|
||||
|
@ -63,7 +67,7 @@ local set_category_order_was_called = false
|
|||
local function get_entry(category_id, entry_id)
|
||||
local category = doc.data.categories[category_id]
|
||||
local entry
|
||||
if category ~= nil then
|
||||
if category then
|
||||
entry = category.entries[entry_id]
|
||||
end
|
||||
if category == nil or entry == nil then
|
||||
|
@ -93,7 +97,7 @@ end
|
|||
|
||||
-- Add a new category
|
||||
function doc.add_category(id, def)
|
||||
if doc.data.categories[id] == nil and id ~= nil then
|
||||
if doc.data.categories[id] == nil and id then
|
||||
doc.data.categories[id] = {}
|
||||
doc.data.categories[id].entries = {}
|
||||
doc.data.categories[id].entry_count = 0
|
||||
|
@ -123,7 +127,7 @@ end
|
|||
-- Add a new entry
|
||||
function doc.add_entry(category_id, entry_id, def)
|
||||
local cat = doc.data.categories[category_id]
|
||||
if cat ~= nil then
|
||||
if cat then
|
||||
local hidden = def.hidden or (def.hidden == nil and cat.def.hide_entries_by_default)
|
||||
if hidden then
|
||||
cat.hidden_count = cat.hidden_count + 1
|
||||
|
@ -177,7 +181,7 @@ function doc.mark_entry_as_revealed(playername, category_id, entry_id)
|
|||
doc.data.players[playername].entry_textlist_needs_updating = true
|
||||
-- Notify player of entry revelation
|
||||
if doc.data.players[playername].stored_data.notify_on_reveal == true then
|
||||
if minetest.get_modpath("central_message") ~= nil then
|
||||
if mod_central_messages then
|
||||
local cat = doc.data.categories[category_id]
|
||||
cmsg.push_message_player(minetest.get_player_by_name(playername), S("New help entry unlocked: @1 > @2", cat.def.name, entry.name))
|
||||
end
|
||||
|
@ -224,7 +228,7 @@ function doc.mark_all_entries_as_revealed(playername)
|
|||
msg = S("All help entries are already revealed.")
|
||||
end
|
||||
-- Notify
|
||||
if minetest.get_modpath("central_message") ~= nil then
|
||||
if mod_central_messages then
|
||||
cmsg.push_message_player(minetest.get_player_by_name(playername), msg)
|
||||
else
|
||||
minetest.chat_send_player(playername, msg)
|
||||
|
@ -427,7 +431,7 @@ end
|
|||
-- Returns the currently viewed entry and/or category of the player
|
||||
function doc.get_selection(playername)
|
||||
local playerdata = doc.data.players[playername]
|
||||
if playerdata ~= nil then
|
||||
if playerdata then
|
||||
local cat = playerdata.category
|
||||
if cat then
|
||||
local entry = playerdata.entry
|
||||
|
@ -448,18 +452,18 @@ end
|
|||
doc.entry_builders = {}
|
||||
|
||||
-- Scrollable freeform text
|
||||
doc.entry_builders.text = function(data)
|
||||
function doc.entry_builders.text(data)
|
||||
local formstring = doc.widgets.text(data, doc.FORMSPEC.ENTRY_START_X, doc.FORMSPEC.ENTRY_START_Y, doc.FORMSPEC.ENTRY_WIDTH - 0.4, doc.FORMSPEC.ENTRY_HEIGHT)
|
||||
return formstring
|
||||
end
|
||||
|
||||
-- Scrollable freeform text with an optional standard gallery (3 rows, 3:2 aspect ratio)
|
||||
doc.entry_builders.text_and_gallery = function(data, playername)
|
||||
function doc.entry_builders.text_and_gallery(data, playername)
|
||||
-- How much height the image gallery “steals” from the text widget
|
||||
local stolen_height = 0
|
||||
local formstring = ""
|
||||
-- Only add the gallery if images are in the data, otherwise, the text widget gets all of the space
|
||||
if data.images ~= nil then
|
||||
if data.images then
|
||||
local gallery
|
||||
gallery, stolen_height = doc.widgets.gallery(data.images, playername, nil, doc.FORMSPEC.ENTRY_END_Y + 0.2, nil, nil, nil, nil, false)
|
||||
formstring = formstring .. gallery
|
||||
|
@ -476,7 +480,7 @@ end
|
|||
doc.widgets = {}
|
||||
|
||||
-- Scrollable freeform text
|
||||
doc.widgets.text = function(data, x, y, width, height)
|
||||
function doc.widgets.text(data, x, y, width, height)
|
||||
if x == nil then
|
||||
x = doc.FORMSPEC.ENTRY_START_X
|
||||
end
|
||||
|
@ -502,7 +506,7 @@ end
|
|||
|
||||
-- Image gallery
|
||||
-- Currently, only one gallery per entry is supported. TODO: Add support for multiple galleries in an entry (low priority)
|
||||
doc.widgets.gallery = function(imagedata, playername, x, y, aspect_ratio, width, rows, align_left, align_top)
|
||||
function doc.widgets.gallery(imagedata, playername, x, y, aspect_ratio, width, rows, align_left, align_top)
|
||||
if playername == nil then return nil end -- emergency exit
|
||||
|
||||
local formstring = ""
|
||||
|
@ -591,7 +595,7 @@ doc.widgets.gallery = function(imagedata, playername, x, y, aspect_ratio, width,
|
|||
end
|
||||
|
||||
-- Direct formspec
|
||||
doc.entry_builders.formspec = function(data)
|
||||
function doc.entry_builders.formspec(data)
|
||||
return data
|
||||
end
|
||||
|
||||
|
@ -605,7 +609,7 @@ do
|
|||
minetest.log("action", "[doc] doc.mt opened.")
|
||||
local string = file:read()
|
||||
io.close(file)
|
||||
if(string ~= nil) then
|
||||
if string then
|
||||
local savetable = minetest.deserialize(string)
|
||||
for name, players_stored_data in pairs(savetable.players_stored_data) do
|
||||
doc.data.players[name] = {}
|
||||
|
@ -672,13 +676,13 @@ function doc.formspec_main(playername)
|
|||
local data = doc.data.categories[id]
|
||||
local bw = doc.FORMSPEC.WIDTH / math.floor(((doc.data.category_count-1) / CATEGORYFIELDSIZE.HEIGHT)+1)
|
||||
-- Skip categories which do not exist
|
||||
if data ~= nil then
|
||||
if data then
|
||||
-- Category buton
|
||||
local button = "button["..((x-1)*bw)..","..y..";"..bw..",1;doc_button_category_"..id..";"..minetest.formspec_escape(data.def.name).."]"
|
||||
local tooltip = ""
|
||||
-- Optional description
|
||||
if data.def.description ~= nil then
|
||||
tooltip = "tooltip[doc_button_category_"..id..";"..minetest.formspec_escape(data.def.description).."]"
|
||||
if data.def.description then
|
||||
tooltip = "tooltip[doc_button_category_"..id..";"..minetest.formspec_escape(data.def.description).."]"
|
||||
end
|
||||
formstring = formstring .. button .. tooltip
|
||||
y = y + 1
|
||||
|
@ -701,7 +705,7 @@ function doc.formspec_main(playername)
|
|||
end
|
||||
end
|
||||
local sel = doc.data.categories[doc.data.players[playername].category]
|
||||
if sel ~= nil then
|
||||
if sel then
|
||||
formstring = formstring .. ";"
|
||||
formstring = formstring .. doc.data.categories[doc.data.players[playername].category].order_position
|
||||
end
|
||||
|
@ -711,7 +715,7 @@ function doc.formspec_main(playername)
|
|||
notify_checkbox_y = doc.FORMSPEC.HEIGHT-1
|
||||
end
|
||||
local text
|
||||
if minetest.get_modpath("central_message") then
|
||||
if mod_central_messages then
|
||||
text = F("Notify me when new help is available")
|
||||
else
|
||||
text = F("Play notification sound when new help is available")
|
||||
|
@ -802,7 +806,7 @@ function doc.get_sorted_entry_names(cid)
|
|||
local cat = doc.data.categories[cid]
|
||||
local used_eids = {}
|
||||
-- Helper function to extract the entry ID out of the output table
|
||||
local extract = function(entry_table)
|
||||
local function extract(entry_table)
|
||||
local eids = {}
|
||||
for k,v in pairs(entry_table) do
|
||||
local eid = v.eid
|
||||
|
@ -944,7 +948,7 @@ function doc.process_form(player,formname,fields)
|
|||
local playername = player:get_player_name()
|
||||
--[[ process clicks on the tab header ]]
|
||||
if(formname == "doc:main" or formname == "doc:category" or formname == "doc:entry") then
|
||||
if fields.doc_header ~= nil then
|
||||
if fields.doc_header then
|
||||
local tab = tonumber(fields.doc_header)
|
||||
local formspec, subformname, contents
|
||||
local cid, eid
|
||||
|
@ -959,7 +963,7 @@ function doc.process_form(player,formname,fields)
|
|||
elseif(tab==3) then
|
||||
doc.data.players[playername].galidx = 1
|
||||
contents = doc.formspec_entry(cid, eid, playername)
|
||||
if cid ~= nil and eid ~= nil then
|
||||
if cid and eid then
|
||||
doc.mark_entry_as_viewed(playername, cid, eid)
|
||||
end
|
||||
subformname = "entry"
|
||||
|
@ -984,7 +988,7 @@ function doc.process_form(player,formname,fields)
|
|||
if fields["doc_mainlist"] then
|
||||
local event = minetest.explode_textlist_event(fields["doc_mainlist"])
|
||||
local cid = doc.data.category_order[event.index]
|
||||
if cid ~= nil then
|
||||
if cid then
|
||||
if event.type == "CHG" then
|
||||
doc.data.players[playername].catsel = nil
|
||||
doc.data.players[playername].category = cid
|
||||
|
@ -1014,10 +1018,10 @@ function doc.process_form(player,formname,fields)
|
|||
elseif(formname == "doc:category") then
|
||||
if fields["doc_button_goto_entry"] then
|
||||
local cid = doc.data.players[playername].category
|
||||
if cid ~= nil then
|
||||
if cid then
|
||||
local eid = nil
|
||||
local eids, catsel = doc.data.players[playername].entry_ids, doc.data.players[playername].catsel
|
||||
if eids ~= nil and catsel ~= nil then
|
||||
if eids and catsel then
|
||||
eid = eids[catsel]
|
||||
end
|
||||
doc.data.players[playername].galidx = 1
|
||||
|
@ -1040,7 +1044,7 @@ function doc.process_form(player,formname,fields)
|
|||
local cid = doc.data.players[playername].category
|
||||
local eid = nil
|
||||
local eids, catsel = doc.data.players[playername].entry_ids, event.index
|
||||
if eids ~= nil and catsel ~= nil then
|
||||
if eids and catsel then
|
||||
eid = eids[catsel]
|
||||
end
|
||||
doc.mark_entry_as_viewed(playername, cid, eid)
|
||||
|
@ -1101,7 +1105,7 @@ function doc.process_form(player,formname,fields)
|
|||
minetest.show_formspec(playername, "doc:entry", formspec)
|
||||
end
|
||||
else
|
||||
if fields["doc_inventory_plus"] and minetest.get_modpath("inventory_plus") then
|
||||
if fields["doc_inventory_plus"] and mod_inventory_plus then
|
||||
doc.show_doc(playername)
|
||||
return
|
||||
end
|
||||
|
@ -1169,18 +1173,18 @@ minetest.register_on_joinplayer(function(player)
|
|||
end
|
||||
|
||||
-- Add button for Inventory++
|
||||
if minetest.get_modpath("inventory_plus") ~= nil then
|
||||
if mod_inventory_plus then
|
||||
inventory_plus.register_button(player, "doc_inventory_plus", S("Help"))
|
||||
end
|
||||
end)
|
||||
|
||||
---[[ Add buttons for inventory mods ]]
|
||||
local button_action = function(player)
|
||||
local function button_action(player)
|
||||
doc.show_doc(player:get_player_name())
|
||||
end
|
||||
|
||||
-- Unified Inventory
|
||||
if minetest.get_modpath("unified_inventory") ~= nil then
|
||||
if minetest.get_modpath("unified_inventory") then
|
||||
unified_inventory.register_button("doc", {
|
||||
type = "image",
|
||||
image = "doc_button_icon_hires.png",
|
||||
|
@ -1190,7 +1194,7 @@ if minetest.get_modpath("unified_inventory") ~= nil then
|
|||
end
|
||||
|
||||
-- sfinv_buttons
|
||||
if minetest.get_modpath("sfinv_buttons") ~= nil then
|
||||
if minetest.get_modpath("sfinv_buttons") then
|
||||
sfinv_buttons.register_button("doc", {
|
||||
image = "doc_button_icon_lores.png",
|
||||
tooltip = S("Collection of help texts"),
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
# textdomain:doc
|
||||
<=<
|
||||
>=>
|
||||
Access to the requested entry has been denied; this entry is secret. You may unlock access by progressing in the game. Figure out on your own how to unlock this entry.=Brak dostępu do zażądanego wpisu; ten wpis jest tajemnicą. Możesz odblokować do niego dostęp przez robienie postępów w grze. Wymyśl jak go odblokować.
|
||||
All entries read.=Wszystkie wpisy przeczytane.
|
||||
All help entries revealed!=Wszystkie wpisy pomocnicze odkryte!
|
||||
All help entries are already revealed.=Wszystkie wpisy pomocnicze są już odkryte.
|
||||
Allows you to reveal all hidden help entries with /help_reveal=Pozwala odkryć wszystkie wpisy pomocnicze przy użyciu /help_reveal
|
||||
Category list=Lista kategorii
|
||||
Currently all entries in this category are hidden from you.=Aktualnie wszystkie wpisy w tej kategorii są przed tobą ukryte.
|
||||
Unlock new entries by progressing in the game.=Odblokuj nowe wpisy przez robienie postępów w grze.
|
||||
Help=Pomoc
|
||||
Entry=Wpis
|
||||
Entry list=Lista wpisów
|
||||
Error: Access denied.=Błąd: Odmowa dostępu.
|
||||
Error: No help available.=Błąd: Brak dostępnej pomocy.
|
||||
Go to category list=Idź do listy kategorii
|
||||
Go to entry list=Idź do listy wpisów
|
||||
Help > @1=Pomoc > @1
|
||||
Help > @1 > @2=Pomoc > @1 > @2
|
||||
Help > @1 > (No Entry)=Pomoc > @1 > (Brak wpisu)
|
||||
Help > (No Category)=Pomoc > (Brak kategorii)
|
||||
Hidden entries: @1=Ukryte wpisy: @1
|
||||
Nameless entry (@1)=Nienazwany wpis (@1)
|
||||
New entries: @1=Nowe wpisy: @1
|
||||
New help entry unlocked: @1 > @2=Nowy wpis pomocniczy odblokowany: @1 > @2
|
||||
No categories have been registered, but they are required to provide help.=Nie zarejestrowano żadnych kategorii, ale są one wymagane do uzyskania pomocy.
|
||||
The Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again.=System dokumentacji [doc] nie ma sam z siebie żadnej zawartości, potrzebuje dodatkowych modów, które dodadzą zawartość.
|
||||
Number of entries: @1=Liczba wpisów: @1
|
||||
OK=OK
|
||||
Open a window providing help entries about Minetest and more=Otwórz okno aby zobaczyć wpisy pomocnicze na temat Minetest i innych rzeczy
|
||||
Please select a category you wish to learn more about:=Wybierz kategorię o której chciałbyś się więcej dowiedzieć:
|
||||
Recommended mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.=Rekomendowane mody: doc_basics, doc_items, doc_identifier, doc_encyclopedia.
|
||||
Reveal all hidden help entries to you=Odkryj wszystkie ukryte wpisy pomocnicze
|
||||
Show entry=Pokaż wpis
|
||||
Show category=Pokaż kategorię
|
||||
Show next entry=Pokaż następny wpis
|
||||
Show previous entry=Pokaż poprzedni wpis
|
||||
This category does not have any entries.=W tej kategorii nie ma żadnych wpisów.
|
||||
This category has the following entries:=W tej kategorii są następujące wpisy:
|
||||
This category is empty.=Ta kategoria jest pusta.
|
||||
This is the help.=To jest pomoc.
|
||||
You haven't chosen a category yet. Please choose one in the category list first.=Nie wybrano żadnej kategorii. Proszę wybrać jedną z listy kategorii.
|
||||
You haven't chosen an entry yet. Please choose one in the entry list first.=Nie wybrano wpisu. Proszę wybrać jeden z listy wpisów.
|
||||
Collection of help texts=Kolekcja tekstów pomocniczych.
|
||||
Notify me when new help is available=Powiadom mnie gdy nowa pomoc jest dostępna.
|
||||
Play notification sound when new help is available=Odegraj dźwięk powiadomienia gdy nowa pomoc jest dostępna
|
||||
Show previous image=Pokaż poprzedni obrazek
|
||||
Show previous gallery page=Pokaż poprzednią stronę galerii
|
||||
Show next image=Pokaż następny obrazek
|
||||
Show next gallery page=Pokaż następną stronę galerii
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
local S = minetest.get_translator("doc_identifier")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local mod_doc_basics = minetest.get_modpath("doc_basics")
|
||||
|
||||
local doc_identifier = {}
|
||||
|
||||
|
@ -6,15 +8,16 @@ doc_identifier.registered_objects = {}
|
|||
|
||||
-- API
|
||||
doc.sub.identifier = {}
|
||||
doc.sub.identifier.register_object = function(object_name, category_id, entry_id)
|
||||
|
||||
function doc.sub.identifier.register_object(object_name, category_id, entry_id)
|
||||
doc_identifier.registered_objects[object_name] = { category = category_id, entry = entry_id }
|
||||
end
|
||||
|
||||
-- END OF API
|
||||
|
||||
doc_identifier.identify = function(itemstack, user, pointed_thing)
|
||||
function doc_identifier.identify(itemstack, user, pointed_thing)
|
||||
local username = user:get_player_name()
|
||||
local show_message = function(username, itype, param)
|
||||
local function show_message(username, itype, param)
|
||||
local vsize = 2
|
||||
local message
|
||||
if itype == "error_item" then
|
||||
|
@ -24,9 +27,9 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
|
|||
elseif itype == "error_unknown" then
|
||||
vsize = vsize + 2
|
||||
local mod
|
||||
if param ~= nil then
|
||||
if param then
|
||||
local colon = string.find(param, ":")
|
||||
if colon ~= nil and colon > 1 then
|
||||
if colon and colon > 1 then
|
||||
mod = string.sub(param,1,colon-1)
|
||||
end
|
||||
end
|
||||
|
@ -36,8 +39,8 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
|
|||
S("• The author of the game or a mod has made a mistake")
|
||||
message = message .. "\n\n"
|
||||
|
||||
if mod ~= nil then
|
||||
if minetest.get_modpath(mod) ~= nil then
|
||||
if mod then
|
||||
if minetest.get_modpath(mod) then
|
||||
message = message .. S("It appears to originate from the mod “@1”, which is enabled.", mod)
|
||||
message = message .. "\n"
|
||||
else
|
||||
|
@ -45,7 +48,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
|
|||
message = message .. "\n"
|
||||
end
|
||||
end
|
||||
if param ~= nil then
|
||||
if param then
|
||||
message = message .. S("Its identifier is “@1”.", param)
|
||||
end
|
||||
elseif itype == "error_ignore" then
|
||||
|
@ -66,7 +69,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
|
|||
if pointed_thing.type == "node" then
|
||||
local pos = pointed_thing.under
|
||||
local node = minetest.get_node(pos)
|
||||
if minetest.registered_nodes[node.name] ~= nil then
|
||||
if minetest.registered_nodes[node.name] then
|
||||
--local nodedef = minetest.registered_nodes[node.name]
|
||||
if(node.name == "ignore") then
|
||||
show_message(username, "error_ignore")
|
||||
|
@ -82,14 +85,14 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
|
|||
local object = pointed_thing.ref
|
||||
local le = object:get_luaentity()
|
||||
if object:is_player() then
|
||||
if minetest.get_modpath("doc_basics") ~= nil and doc.entry_exists("basics", "players") then
|
||||
if mod_doc_basics and doc.entry_exists("basics", "players") then
|
||||
doc.show_entry(username, "basics", "players", true)
|
||||
else
|
||||
-- Fallback message
|
||||
show_message(username, "player")
|
||||
end
|
||||
-- luaentity exists
|
||||
elseif le ~= nil then
|
||||
elseif le then
|
||||
local ro = doc_identifier.registered_objects[le.name]
|
||||
-- Dropped items
|
||||
if le.name == "__builtin:item" then
|
||||
|
@ -112,7 +115,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
|
|||
doc.show_entry(username, "nodes", itemstring, true)
|
||||
end
|
||||
-- A known registered object
|
||||
elseif ro ~= nil then
|
||||
elseif ro then
|
||||
doc.show_entry(username, ro.category, ro.entry, true)
|
||||
-- Undefined object (error)
|
||||
elseif minetest.registered_entities[le.name] == nil then
|
||||
|
@ -195,7 +198,7 @@ minetest.register_craft({
|
|||
{"group:stick", ""} }
|
||||
})
|
||||
|
||||
if minetest.get_modpath("mcl_core") ~= nil then
|
||||
if minetest.get_modpath("mcl_core") then
|
||||
minetest.register_craft({
|
||||
output = "doc_identifier:identifier_solid",
|
||||
recipe = { { "mcl_core:glass" },
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue