resolve merge conflicts

This commit is contained in:
chmodsayshello 2023-08-28 16:47:31 +02:00
commit fb74689f3d
1213 changed files with 4892 additions and 2257 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
*.blend3 *.blend3
/.idea/ /.idea/
*.xcf *.xcf
.Rproj.user

View File

@ -1,10 +1,12 @@
---@diagnostic disable
unused_args = false unused_args = false
allow_defined_top = true allow_defined_top = true
max_line_length = false max_line_length = false
redefined = false redefined = false
globals = { globals = {
"minetest", "core", "minetest", "core",
} }
read_globals = { read_globals = {
@ -40,16 +42,16 @@ read_globals = {
"factorial" "factorial"
} }
}, },
------ ------
--MODS --MODS
------ ------
--GENERAL --GENERAL
"default", "default",
--ENTITIES --ENTITIES
"cmi", "cmi",
--HUD --HUD
"sfinv", "sfinv_buttons", "unified_inventory", "cmsg", "inventory_plus", "sfinv", "sfinv_buttons", "unified_inventory", "cmsg", "inventory_plus",
} }

22
.luarc.json Normal file
View File

@ -0,0 +1,22 @@
{
"runtime.version": "LuaJIT",
"diagnostics": { "disable": ["lowercase-global"] },
"diagnostics.globals": [
"minetest",
"dump",
"dump2",
"Raycast",
"Settings",
"PseudoRandom",
"PerlinNoise",
"VoxelManip",
"SecureRandom",
"VoxelArea",
"PerlinNoiseMap",
"PcgRandom",
"ItemStack",
"AreaStore",
"vector"
],
"workspace.ignoreDir": [".luacheckrc"]
}

View File

@ -9,10 +9,9 @@ You can help with MineClone2's development in many different ways,
whether you're a programmer or not. whether you're a programmer or not.
## MineClone2's development target is to... ## MineClone2's development target is to...
- Crucially, create a stable, moddable, free/libre clone of Minecraft - Create a stable, peformant, moddable, free/libre game based on Minecraft
based on the Minetest engine with polished features, usable in both using the Minetest engine, usable in both singleplayer and multiplayer.
singleplayer and multiplayer. Currently, a lot of Minecraft features - Currently, a lot of features are already implemented.
are already implemented.
Polishing existing features is always welcome. Polishing existing features is always welcome.
## Links ## Links
@ -120,11 +119,11 @@ It's also a good idea to join the Discord server
(or alternatively IRC or Matrix). (or alternatively IRC or Matrix).
#### Textures #### Textures
For textures we use the Pixel Perfection texture pack. For older Minecraft For textures we prefer original art, but in the absence of that will accept
features that is mostly enough but a lot of the newer textures in it are Pixel Perfection texture pack contributions. Be warned many of the newer
copies or slight modifications of the original MC textures so great caution textures in it are copies or slight modifications of the original MC textures
needs to be taken when using any textures coming from Minecraft texture so great caution needs to be taken when using any textures coming from
packs. Minecraft texture packs.
If you want to make such contributions, join our Discord server. Demands If you want to make such contributions, join our Discord server. Demands
for textures will be communicated there. for textures will be communicated there.
@ -135,7 +134,10 @@ resource pack or minetest_game. Unfortunately, MineClone2 does not play
a sound in every situation you would get one in Minecraft. Any help with a sound in every situation you would get one in Minecraft. Any help with
sounds is greatly appreciated, however if you add new sounds you should sounds is greatly appreciated, however if you add new sounds you should
probably work together with a programmer, to write the code to actually probably work together with a programmer, to write the code to actually
play these sounds in game. play these sounds in game. All sounds should be released under an open
source license with clear information on the source, licencing and any
changes made by the contributor. Use the README files in the mod to
communicate this information.
#### 3D Models #### 3D Models
Most of the 3D Models in MineClone2 come from Most of the 3D Models in MineClone2 come from
@ -145,9 +147,9 @@ Blender on demand. Many of the models have to be patched, some new
animations have to be added etc. animations have to be added etc.
#### Crediting #### Crediting
Asset contributions will be credited in their own respective sections in Asset contributions will be credited in their mods and their own respective
CREDITS.md. If you have commited the results yourself, you will also be sections in CREDITS.md. If you have commited the results yourself, you will
credited in the Contributors section. also be credited in the Contributors section.
### Contributing Translations ### Contributing Translations
@ -182,7 +184,12 @@ information about the game's performance and let us know places to
investigate optimization issues. This way we can make the game faster. investigate optimization issues. This way we can make the game faster.
#### Using Minetest's profiler #### Using Minetest's profiler
Minetest has a built in profiler. Simply set `profiler.load = true` in We frequently will use profiling to optimise our code. We recommend use of
the JIT profiler (RIP Jude) to fully understand performance impact:
https://content.minetest.net/packages/jwmhjwmh/jitprofiler/
Minetest also has a built in profiler. Simply set `profiler.load = true` in
your configuration file and restart the server. After running the server your configuration file and restart the server. After running the server
for some time, just run `/profiler save` in chat - then you will find a for some time, just run `/profiler save` in chat - then you will find a
file in the world directory containing the results. Open a new issue and file in the world directory containing the results. Open a new issue and
@ -213,10 +220,14 @@ they have made their donation Incognito).
* Fork the repository (in case you have not already) * Fork the repository (in case you have not already)
* Do your change in a new branch * Do your change in a new branch
* Create a pull request to get your changes merged into master * Create a pull request to get your changes merged into master
* Keep your pull request up to date by regularly merging upstream. It is * It is important that conflicts are resolved prior to merging the pull
imperative that conflicts are resolved prior to merging the pull
request. request.
* After the pull request got merged, you can delete the branch * We update our branches via rebasing. Please avoid merging master into
your branch unless it's the only way you can resolve a conflict. We can
rebase branches from the GUI if the user has not merged master into the
branch.
* After the pull request got merged, you can delete the branch if the
merger hasn't done this already.
### Discuss first ### Discuss first
If you feel like a problem needs to fixed or you want to make a new If you feel like a problem needs to fixed or you want to make a new
@ -262,9 +273,7 @@ excessive git bureaucracy commits in master)
* Submodules should only be used if a) upstream is highly reliable and * Submodules should only be used if a) upstream is highly reliable and
b) it is 100% certain that no mcl2 specific changes to the code will be b) it is 100% certain that no mcl2 specific changes to the code will be
needed (this has never been the case before, hence mcl2 is submodule free so far) needed (this has never been the case before, hence mcl2 is submodule free so far)
* Commit messages should be descriptive and never contain mcl2 specific * Commit messages should be descriptive
issueids - there are other projects who might use commits from mcl2 and
it will confuse their issue trackers.
* Try to group your submissions best as you can: * Try to group your submissions best as you can:
* Try to keep your PRs small: In some cases things reasonably be can't * Try to keep your PRs small: In some cases things reasonably be can't
split up but in general multiple small PRs are better than a big one. split up but in general multiple small PRs are better than a big one.
@ -348,18 +357,24 @@ end
### Developer status ### Developer status
Active and trusted contributors are often granted write access to the Active and trusted contributors are often granted write access to the
MineClone2 repository. MineClone2 repository as a contributor. Those that have demonstrated the right
technical skills and behaviours may be granted developer access. These are the
most trusted contributors who will contribute to ensure coding standards and
processes are followed.
#### Developer responsibilities #### Developer responsibilities
- If you have developer privileges you can just open a new branch in the - If you have developer/contributor privileges you can just open a new branch
mcl2 repository (which is preferred). From that you create a pull request. in the mcl2 repository (which is preferred). From that you create a pull request.
This way other people can review your changes and make sure they work This way other people can review your changes and make sure they work
before they get merged. before they get merged.
- If you do not (yet) have developer privs you do your work on a branch - If you do not (yet) have developer privs you do your work on a branch
on your private repository e.g. using the "fork" function on mesehub. on your private repository e.g. using the "fork" function on mesehub.
- Any developer is welcome to review, test and merge PRs. A PR needs - Any developer is welcome to review, test and approve PRs. A maintainer may prefer
at least one approval (by someone else than the author) but the maintainers to merge the PR especially if it is in a similar area to what has been worked on
are usually relatively quick to react to new submissions. and could result in merge conflicts for a larger older branch, or needs
art/licencing reviewing. A PR needs at least one approval (by someone else other
than the author).
- The maintainers are usually relatively quick to react to new submissions.
### Maintainer status ### Maintainer status
Maintainers carry the main responsibility for the project. Maintainers carry the main responsibility for the project.

View File

@ -6,40 +6,42 @@
## Creator of MineClone2 ## Creator of MineClone2
* Wuzzy * Wuzzy
## Maintainers ## Maintainers
* AncientMariner * AncientMariner
* Nicu * Nicu
## Previous Maintainers ## Previous Maintainers
* Fleckenstein * Fleckenstein
* jordan4ibanez
* cora * cora
## Developers ## Developers
* bzoss
* AFCMS * AFCMS
* epCode * epCode
* ryvnf
* iliekprogrammar
* MysticTempest
* Rootyjr
* aligator
* Code-Sploit
* NO11
* kabou
* rudzik8
* chmodsayshello * chmodsayshello
* PrairieWind * PrairieWind
* RandomLegoBrick
* SumianVoice
* MrRar * MrRar
* talamh
* Faerraven / Michieal
* FossFanatic * FossFanatic
* SmokeyDope * SmokeyDope
## Past Developers
* jordan4ibanez
* iliekprogrammar
* kabou
* kay27
* Faerraven / Michieal
* MysticTempest
* NO11
* SumianVoice
## Contributors ## Contributors
* RandomLegoBrick
* rudzik8
* Code-Sploit
* aligator
* Rootyjr
* ryvnf
* bzoss
* talamh
* Laurent Rocher * Laurent Rocher
* HimbeerserverDE * HimbeerserverDE
* TechDudie * TechDudie
@ -68,6 +70,10 @@
* Marcin Serwin * Marcin Serwin
* erlehmann * erlehmann
* E * E
* n_to
* debiankaios
* Gustavo6046 / wallabra
* CableGuy67
* Benjamin Schötz * Benjamin Schötz
* Doloment * Doloment
* Sydney Gems * Sydney Gems
@ -101,25 +107,18 @@
* gldrk * gldrk
* atomdmac * atomdmac
* emptyshore * emptyshore
* FlamingRCCars
* uqers
* Niterux
* appgurueu
* seventeenthShulker
## MineClone5 ## Music
* kay27 * Jordach for the jukebox music compilation from Big Freaking Dig
* Debiankaios * Dark Reaven Music (https://soundcloud.com/dark-reaven-music) for the main menu theme (Calmed Cube) and Traitor (horizonchris96), which is licensed under https://creativecommons.org/licenses/by-sa/3.0/
* epCode * Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)
* NO11 * Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)
* j45 * Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0)
* chmodsayshello
* 3raven
* PrairieWind
* Gustavo6046 / wallabra
* CableGuy67
* MrRar
## Mineclonia
* erlehmann
* Li0n
* E
* n_to
## Original Mod Authors ## Original Mod Authors
* Wuzzy * Wuzzy
@ -151,14 +150,18 @@
* 4Evergreen4 * 4Evergreen4
* jordan4ibanez * jordan4ibanez
* paramat * paramat
* debian044 / debian44
* chmodsayshello
* cora * cora
* Faerraven / Michieal * Faerraven / Michieal
* PrairieWind
## 3D Models ## 3D Models
* 22i * 22i
* tobyplowy * tobyplowy
* epCode * epCode
* Faerraven / Michieal * Faerraven / Michieal
* SumianVoice
## Textures ## Textures
* XSSheep * XSSheep
@ -176,6 +179,8 @@
* Nicu * Nicu
* Exhale * Exhale
* Aeonix_Aeon (armor trim models) https://www.curseforge.com/minecraft/texture-packs/ozocraft-remix (CC BY 4.0) * Aeonix_Aeon (armor trim models) https://www.curseforge.com/minecraft/texture-packs/ozocraft-remix (CC BY 4.0)
* Wbjitscool
* SmokeyDope
## Translations ## Translations
* Wuzzy * Wuzzy
@ -192,6 +197,9 @@
* SakuraRiu * SakuraRiu
* anarquimico * anarquimico
* syl * syl
* Temak
* megustanlosfrijoles
* kbundg
## Funders ## Funders
* 40W * 40W
@ -199,12 +207,6 @@
* Cora * Cora
## Special thanks ## Special thanks
* celeron55 for creating Minetest * The Minetest team for making and supporting an engine, and distribution infrastructure that makes this all possible
* Jordach for the jukebox music compilation from Big Freaking Dig
* wsor for working tirelessly in the shadows for the good of all of us, particularly helping with solving contentDB and copyright issues.
* The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game * The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game
* Notch and Jeb for being the major forces behind Minecraft * Notch and Jeb for being the major forces behind Minecraft
* Dark Reaven Music (https://soundcloud.com/dark-reaven-music) for the main menu theme (Calmed Cube) and Traitor (horizonchris96), which is licensed under https://creativecommons.org/licenses/by-sa/3.0/
* Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)
* Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)
* Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0)

View File

@ -5,7 +5,7 @@ Copying is an act of love. Please copy and share! <3
Here's the detailed legalese for those who need it: Here's the detailed legalese for those who need it:
## License of source code ## License of source code
MineClone 2 (by kay27, EliasFleckenstein, Wuzzy, davedevils and countless others) MineClone 2 (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others)
is an imitation of Minecraft. is an imitation of Minecraft.
MineClone 2 is free software: you can redistribute it and/or modify MineClone 2 is free software: you can redistribute it and/or modify
@ -38,11 +38,11 @@ No non-free licenses are used anywhere.
The textures, unless otherwise noted, are based on the Pixel Perfection resource pack for Minecraft 1.11, The textures, unless otherwise noted, are based on the Pixel Perfection resource pack for Minecraft 1.11,
authored by XSSheep. Most textures are verbatim copies, while some textures have been changed or redone authored by XSSheep. Most textures are verbatim copies, while some textures have been changed or redone
from scratch. from scratch.
The glazed terracotta textures have been created by (MysticTempest)[https://github.com/MysticTempest]. The glazed terracotta textures have been created by [MysticTempest](https://github.com/MysticTempest).
Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/> Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/>
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/) License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
The main menu images are release under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/) The main menu images are released under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
All other files, unless mentioned otherwise, fall under: All other files, unless mentioned otherwise, fall under:
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)

View File

@ -1,13 +1,14 @@
#Models in Minetest/Mineclone2 # Models in Minetest/Mineclone2
Models are an important part of all entities & unique nodes in Mineclone2. They provide a 3 dimensional map of an object for which textures are then applied to. This document is for modders, it quickly highlights some important information for the software needed to open models in Mineclone2. Models are an important part of all entities & unique nodes in Mineclone2. They provide a 3 dimensional map of an object for which textures are then applied to. This document is for modders, it quickly highlights some important information for the software needed to open models in Mineclone2.
## Minetest Wiki ## Minetest Wiki
For more detailed information on actually using blender to create and modify models for Minetest/Mineclone2, please visit the Minetest wiki's page on using Blender [Here](https://wiki.minetest.net/Using_Blender) For more detailed information on actually using blender to create and modify models for Minetest/Mineclone2, please visit the Minetest wiki's page on using Blender [Here](https://wiki.minetest.net/Using_Blender)
##Recommended software ## Recommended software
###Blender ### Blender
Blender is a very popular and free modeling software supported on Windows, MacOS, and most Linux distributions. It is recommended to use Blender to create and modify 3D models within the minetest engine. Blender is a very popular and free modeling software supported on Windows, MacOS, and most Linux distributions. It is recommended to use Blender to create and modify 3D models within the minetest engine.
@ -19,14 +20,16 @@ Blitz 3D (.b3d) Is one of the main animated model formats used for entities in t
The most up to date version of this Blender plugin can be downloaded [Here](https://github.com/GreenXenith/io_scene_b3d/releases/tag/f189786) The most up to date version of this Blender plugin can be downloaded [Here](https://github.com/GreenXenith/io_scene_b3d/releases/tag/f189786)
##Types of model formats ## Types of model formats
### Animated, skinned models
###Animated, skinned models
* Blitz 3D files (.b3d) * Blitz 3D files (.b3d)
* Microsoft DirectX (.x) (binary & text, compression is not supported) * Microsoft DirectX (.x) (binary & text, compression is not supported)
###Static meshes ### Static meshes
* Wavefront OBJ (.obj) * Wavefront OBJ (.obj)
Note: The sometimes accompanying .mtl files are not supported and can safely be deleted. Note: The sometimes accompanying .mtl files are not supported and can safely be deleted.
@ -45,16 +48,18 @@ Note: Do not use .b3d and .x files for static meshes at the moment, Minetest cur
Note: Any formats not mentioned above but known to work in the past were removed in 5.5.0 and aren't supported anymore. Note: Any formats not mentioned above but known to work in the past were removed in 5.5.0 and aren't supported anymore.
##Pros & Cons of .b3d vs .x ## Pros & Cons of .b3d vs .x
### B3D
###B3D
* [+] Binary format means a small size * [+] Binary format means a small size
* [-] Difficult to postprocess after exporting * [-] Difficult to postprocess after exporting
* [-] Difficult to debug problems * [-] Difficult to debug problems
###X (text version) ### X (text version)
* [+] Can be parsed easily with lua scripts * [+] Can be parsed easily with lua scripts
* [+] Can be easily generated by scripts * [+] Can be easily generated by scripts

View File

@ -79,34 +79,32 @@ The MineClone2 repository is hosted at Mesehub. To contribute or report issues,
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2> * Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
* Discord: <https://discord.gg/xE4z8EEpDC> * Discord: <https://discord.gg/xE4z8EEpDC>
* YouTube: <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A> * 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>
* ContentDB: <https://content.minetest.net/packages/wuzzy/mineclone2/> * ContentDB: <https://content.minetest.net/packages/wuzzy/mineclone2/>
* OpenCollective: <https://opencollective.com/mineclone2> * OpenCollective: <https://opencollective.com/mineclone2>
* Mastodon: <https://fosstodon.org/@MineClone2>
* Lemmy: <https://lemmy.world/c/mineclone2>
* Matrix space: <https://app.element.io/#/room/#mcl2:matrix.org>
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
* Reddit: <https://www.reddit.com/r/MineClone2/>
* IRC (barely used): <https://web.libera.chat/#mineclone2>
## Target ## Target
- Crucially, create a stable, moddable, free/libre clone of Minecraft - Create a stable, moddable, free/libre game based on Minecraft
based on the Minetest engine with polished features, usable in both on the Minetest engine with polished features, usable in both
singleplayer and multiplayer. Currently, a lot of **Minecraft Java singleplayer and multiplayer. Currently, a lot of **Minecraft Java
Edition** features are already implemented and polishing existing Edition** features are already implemented and polishing existing
features are prioritized over new feature requests. features are prioritized over new feature requests.
- With lessened priority yet strictly, implement features targetting - Implement features targetting
**Current Minecraft versions + OptiFine** (OptiFine only as far as supported **Current Minecraft versions + OptiFine** (OptiFine only as far as supported
by the Minetest Engine). This means features in parity with the listed by the Minetest Engine).
Minecraft experiences are prioritized over those that don't fulfill this - Create a performant experience that will run relatively
scope. well on really low spec computers.
- Optionally, create a performant experience that will run relatively
well on really low spec computers. Unfortunately, due to Minecraft's
mechanisms and Minetest engine's limitations along with a very small
playerbase on low spec computers, optimizations are hard to investigate.
## Completion status ## Completion status
This game is currently in **beta** stage. This game is currently in **beta** stage.
It is playable, but not yet feature-complete. It is playable, but not yet feature-complete.
Backwards-compability is not entirely guaranteed, updating your world might cause small bugs. Backwards-compability is not entirely guaranteed, updating your world might cause small bugs.
If you want to use the development version of MineClone2 in production, the master branch is usually relatively stable. The testing branch often features some experimental PRs and should be considered less stable. If you want to use the development version of MineClone2 in production, the master branch is usually relatively stable.
The following main features are available: The following main features are available:

View File

@ -1,10 +1,11 @@
### Standard Release ### Standard Release
#File to document release steps with a view to evolving into a script # File to document release steps with a view to evolving into a script
#Update CREDITS.md # Update CREDITS.md
#Update version in game.conf # Update version in game.conf
```
lua tools/generate_ingame_credits.lua lua tools/generate_ingame_credits.lua
git add CREDITS.md git add CREDITS.md
@ -18,10 +19,11 @@ git commit -m "Pre-release update credits and set version 0.83.0"
git tag 0.83.0 git tag 0.83.0
git push origin 0.83.0 git push origin 0.83.0
```
#Update version in game.conf to the next version with -SNAPSHOT suffix # Update version in game.conf to the next version with -SNAPSHOT suffix
git commit -m "Post-release set version 0.84.0-SNAPSHOT" `git commit -m "Post-release set version 0.84.0-SNAPSHOT"`
### Hotfix Release ### Hotfix Release
@ -32,15 +34,17 @@ To mitigate this, you just release the last release, and the relevant bug fix. F
* Create release branch from the last release tag, push it: * Create release branch from the last release tag, push it:
```
git checkout -b release/0.82.1 0.82.0 git checkout -b release/0.82.1 0.82.0
git push origin release/0.82.1 git push origin release/0.82.1
```
##### Prepare feature branch and fix ##### Prepare feature branch and fix
* Create feature branch from that release branch (can review it to check only fix is there, nothing else, and use to also merge into master separately) * Create feature branch from that release branch (can review it to check only fix is there, nothing else, and use to also merge into master separately)
git checkout -b hotfix_bug_1_branch `git checkout -b hotfix_bug_1_branch`
* Fix crash/serious bug and commit * Fix crash/serious bug and commit
* Push branch and create pr to the release and also the master branch (Do not rebase, to reduce merge conflict risk. Do not delete after first merge or it needs to be repushed) * Push branch and create pr to the release and also the master branch (Do not rebase, to reduce merge conflict risk. Do not delete after first merge or it needs to be repushed)
@ -53,11 +57,13 @@ git checkout -b hotfix_bug_1_branch
* Tag it, push tag and branch: * Tag it, push tag and branch:
```
git tag 0.82.1 git tag 0.82.1
git push origin 0.82.1 git push origin 0.82.1
git push origin release/0.82.1 git push origin release/0.82.1
```
Note: If you have to do more than 1 hotfix release, can do it on the same release branch. Note: If you have to do more than 1 hotfix release, can do it on the same release branch.
@ -71,5 +77,13 @@ Note: If you have to do more than 1 hotfix release, can do it on the same releas
##### Inform people ##### Inform people
* Add a comment to the forum post with the release number and what is involved, and maintainer will update main post. * Upload video to YouTube
* Add a comment in Discord announcement * Add a comment to the forum post with the release number and change log. Maintainer will update main post with code link.
* Add a Discord announcement post and @everyone with link to video, forum post and release notes.
* Share the news on reddit + Lemmy. Good subs to share with:
* r/linux_gaming
* r/opensourcegames
* r/opensource
* r/freesoftware
* r/linuxmasterrace
* r/MineClone2

View File

@ -12,13 +12,13 @@ GIMP Tutorials has an excellent guide to making pixel art in GIMP. If you would
### GIMP ### GIMP
GIMP (Gnu Image Manipulation Program) is a very popular and free image editing software supported on Windows, MacOS, and most Linux distributions. It is recommended to use GIMP to create and modify textures within the minetest engine. GIMP (GNU Image Manipulation Program) is a very popular and free image editing software supported on Windows, MacOS, and most Linux distributions. It is recommended to use GIMP to create and modify textures within the minetest engine.
Download GIMP [here](http://gimp.org/) Download GIMP [here](http://gimp.org/)
# Getting Started # Getting Started
## Creating a new file ## Creating a new file
the first thing to do is open GIMP and create a new file to work in by opening the File menu and choosing New. the first thing to do is open GIMP and create a new file to work in by opening the File menu and choosing "New".
Choose width of 16 and height of 16 for the image size. While higher resolution textures are possible, The default size is 16x16. It is recommended you use this size as well, as it is universally supported on all systems. Choose width of 16 and height of 16 for the image size. While higher resolution textures are possible, The default size is 16x16. It is recommended you use this size as well, as it is universally supported on all systems.
@ -50,7 +50,7 @@ For those running a GNU/linux distribution, you most likely have the 'optipng' c
First, Open up the terminal in the directory where your exported texture is located (or navigate to the directory with the 'cd your/directory/path/to/textures'), then run this command First, Open up the terminal in the directory where your exported texture is located (or navigate to the directory with the 'cd your/directory/path/to/textures'), then run this command
``` ```
optipng -o7 -zm1-9 -nc -clobber *.png optipng -o7 -zm1-9 -nc -clobber -strip all *.png
``` ```
This will further optimize all the textures in the directory. This will further optimize all the textures in the directory.

View File

@ -1 +1 @@
A survival sandbox game. Survive, gather, hunt, mine, build, explore, and do much more. Faithful clone of Minecraft 1.12. This is a work in progress! Expect bugs! A survival sandbox game. Survive, gather, hunt, mine, build, explore, and do much more.

View File

@ -1,4 +1,4 @@
title = MineClone 2 title = MineClone 2
description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more. description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more.
disallowed_mapgens = v6 disallowed_mapgens = v6
version=0.84.0-SNAPSHOT version=0.85.0-SNAPSHOT

View File

@ -215,6 +215,10 @@ function mcl_autogroup.can_harvest(nodename, toolname, player)
return true return true
end end
if minetest.get_item_group(nodename, "dig_immediate_piston") >= 1 then
return true
end
-- Check if it can be dug by tool -- Check if it can be dug by tool
local tdef = minetest.registered_tools[toolname] local tdef = minetest.registered_tools[toolname]
if tdef and tdef._mcl_diggroups then if tdef and tdef._mcl_diggroups then

View File

@ -96,8 +96,8 @@ function mcl_damage.finish_reason(mcl_reason)
end end
function mcl_damage.from_mt(mt_reason) function mcl_damage.from_mt(mt_reason)
if mt_reason._mcl_chached_reason then if mt_reason._mcl_cached_reason then
return mt_reason._mcl_chached_reason return mt_reason._mcl_cached_reason
end end
local mcl_reason local mcl_reason

View File

@ -437,9 +437,9 @@ cboat.selectionbox = {-0.7, -0.15, -0.7, 0.7, 0.75, 0.7}
minetest.register_entity("mcl_boats:chest_boat", cboat) minetest.register_entity("mcl_boats:chest_boat", cboat)
mcl_entity_invs.register_inv("mcl_boats:chest_boat","Boat",27) mcl_entity_invs.register_inv("mcl_boats:chest_boat","Boat",27)
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak", "boat_obsidian", "boat_mangrove", "chest_boat", "chest_boat_spruce", "chest_boat_birch", "chest_boat_jungle", "chest_boat_acacia", "chest_boat_dark_oak", "chest_boat_mangrove" } local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak", "boat_obsidian", "boat_mangrove", "boat_cherry", "chest_boat", "chest_boat_spruce", "chest_boat_birch", "chest_boat_jungle", "chest_boat_acacia", "chest_boat_dark_oak", "chest_boat_mangrove", "chest_boat_cherry" }
local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat"), S("Obsidian Boat"), S("Mangrove Boat"), S("Oak Chest Boat"), S("Spruce Chest Boat"), S("Birch Chest Boat"), S("Jungle Chest Boat"), S("Acacia Chest Boat"), S("Dark Oak Chest Boat"), S("Mangrove Chest Boat") } local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat"), S("Obsidian Boat"), S("Mangrove Boat"), S("Cherry Boat"), S("Oak Chest Boat"), S("Spruce Chest Boat"), S("Birch Chest Boat"), S("Jungle Chest Boat"), S("Acacia Chest Boat"), S("Dark Oak Chest Boat"), S("Mangrove Chest Boat"), S("Cherry Chest Boat") }
local craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood", "mcl_core:obsidian", "mcl_mangrove:mangrove_wood" } local craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood", "mcl_core:obsidian", "mcl_mangrove:mangrove_wood", "mcl_cherry_blossom:cherrywood" }
for b=1, #boat_ids do for b=1, #boat_ids do
local itemstring = "mcl_boats:"..boat_ids[b] local itemstring = "mcl_boats:"..boat_ids[b]

View File

@ -0,0 +1,13 @@
# textdomain: mcl_boats
Acacia Boat=Akaciebåd
Birch Boat=Birkebåd
Boat=Båd
Boats are used to travel on the surface of water.=Både blier brugt til at rejse på vandoverflader.
Dark Oak Boat=Mørk egetræsbåd
Jungle Boat=Junglebåd
Oak Boat=Egetræsbå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.=Højre-klik på en vand for at placere båden. Højre-klik på båden for at gå ombord. Brug [Left] og [Right] til at styre. [Forwards] for at øge hastigheden, og [Backwards] for at sænke farten eller sejle bagud. Brug [Sneak] for at forlade båden, slå båden for at lave den om til en genstand.
Spruce Boat=Granbåd
Water vehicle=Vandfartøj
Sneak to dismount=Snig for at stige ud
Obsidian Boat=Obsidianbåd

View File

@ -12,6 +12,7 @@ Water vehicle=
Sneak to dismount= Sneak to dismount=
Obsidian Boat= Obsidian Boat=
Mangrove Boat= Mangrove Boat=
Cherry Boat=
Oak Chest Boat= Oak Chest Boat=
Spruce Chest Boat= Spruce Chest Boat=
Birch Chest Boat= Birch Chest Boat=
@ -19,3 +20,4 @@ Jungle Chest Boat=
Acacia Chest Boat= Acacia Chest Boat=
Dark Oak Chest Boat= Dark Oak Chest Boat=
Mangrove Chest Boat= Mangrove Chest Boat=
Cherry Chest Boat=

View File

@ -0,0 +1,3 @@
# textdomain: mcl_falling_nodes
@1 was smashed by a falling anvil.=@1 blev smadret af en nedfaldende ambolt.
@1 was smashed by a falling block.=@1 blev smadret af en nedfaldende blok.

View File

@ -85,101 +85,93 @@ local function hopper_take_item(self, dtime)
for k, v in pairs(objs) do for k, v in pairs(objs) do
local ent = v:get_luaentity() local ent = v:get_luaentity()
if ent._removed or not ent.itemstring or ent.itemstring == "" then if ent and not ent._removed and ent.itemstring and ent.itemstring ~= "" then
--minetest.log("Ignore this item") local taken_items = false
break
end
-- Don't forget actual hoppers mcl_log("ent.name: " .. tostring(ent.name))
mcl_log("ent pos: " .. tostring(ent.object:get_pos()))
local taken_items = false local inv = mcl_entity_invs.load_inv(self, 5)
if not inv then return false end
mcl_log("ent.name: " .. tostring(ent.name)) local current_itemstack = ItemStack(ent.itemstring)
mcl_log("ent pos: " .. tostring(ent.object:get_pos()))
local inv = mcl_entity_invs.load_inv(self, 5) mcl_log("inv. size: " .. self._inv_size)
if inv:room_for_item("main", current_itemstack) then
mcl_log("Room")
inv:add_item("main", current_itemstack)
ent.object:get_luaentity().itemstring = ""
ent.object:remove()
taken_items = true
else
mcl_log("no Room")
end
if not inv then if not taken_items then
mcl_log("No inv") local items_remaining = current_itemstack:get_count()
return false
end
local current_itemstack = ItemStack(ent.itemstring) -- This will take part of a floating item stack if no slot can hold the full amount
for i = 1, self._inv_size, 1 do
local stack = inv:get_stack("main", i)
mcl_log("inv. size: " .. self._inv_size) mcl_log("i: " .. tostring(i))
if inv:room_for_item("main", current_itemstack) then mcl_log("Items remaining: " .. items_remaining)
mcl_log("Room") mcl_log("Name: " .. tostring(stack:get_name()))
inv:add_item("main", current_itemstack)
ent.object:get_luaentity().itemstring = ""
ent.object:remove()
taken_items = true
else
mcl_log("no Room")
end
if not taken_items then if current_itemstack:get_name() == stack:get_name() then
local items_remaining = current_itemstack:get_count() mcl_log("We have a match. Name: " .. tostring(stack:get_name()))
-- This will take part of a floating item stack if no slot can hold the full amount local room_for = stack:get_stack_max() - stack:get_count()
for i = 1, self._inv_size, 1 do mcl_log("Room for: " .. tostring(room_for))
local stack = inv:get_stack("main", i)
mcl_log("i: " .. tostring(i)) if room_for == 0 then
mcl_log("Items remaining: " .. items_remaining) -- Do nothing
mcl_log("Name: " .. tostring(stack:get_name())) mcl_log("No room")
elseif room_for < items_remaining then
mcl_log("We have more items remaining than space")
if current_itemstack:get_name() == stack:get_name() then items_remaining = items_remaining - room_for
mcl_log("We have a match. Name: " .. tostring(stack:get_name())) stack:set_count(stack:get_stack_max())
inv:set_stack("main", i, stack)
taken_items = true
else
local new_stack_size = stack:get_count() + items_remaining
stack:set_count(new_stack_size)
mcl_log("We have more than enough space. Now holds: " .. new_stack_size)
local room_for = stack:get_stack_max() - stack:get_count() inv:set_stack("main", i, stack)
mcl_log("Room for: " .. tostring(room_for)) items_remaining = 0
if room_for == 0 then ent.object:get_luaentity().itemstring = ""
-- Do nothing ent.object:remove()
mcl_log("No room")
elseif room_for < items_remaining then
mcl_log("We have more items remaining than space")
items_remaining = items_remaining - room_for taken_items = true
stack:set_count(stack:get_stack_max()) break
inv:set_stack("main", i, stack) end
taken_items = true
else
local new_stack_size = stack:get_count() + items_remaining
stack:set_count(new_stack_size)
mcl_log("We have more than enough space. Now holds: " .. new_stack_size)
inv:set_stack("main", i, stack) mcl_log("Count: " .. tostring(stack:get_count()))
items_remaining = 0 mcl_log("stack max: " .. tostring(stack:get_stack_max()))
--mcl_log("Is it empty: " .. stack:to_string())
ent.object:get_luaentity().itemstring = ""
ent.object:remove()
taken_items = true
break
end end
mcl_log("Count: " .. tostring(stack:get_count())) if i == self._inv_size and taken_items then
mcl_log("stack max: " .. tostring(stack:get_stack_max())) mcl_log("We are on last item and still have items left. Set final stack size: " .. items_remaining)
--mcl_log("Is it empty: " .. stack:to_string()) current_itemstack:set_count(items_remaining)
end --mcl_log("Itemstack2: " .. current_itemstack:to_string())
ent.itemstring = current_itemstack:to_string()
if i == self._inv_size and taken_items then end
mcl_log("We are on last item and still have items left. Set final stack size: " .. items_remaining)
current_itemstack:set_count(items_remaining)
--mcl_log("Itemstack2: " .. current_itemstack:to_string())
ent.itemstring = current_itemstack:to_string()
end end
end end
end
--Add in, and delete --Add in, and delete
if taken_items then if taken_items then
mcl_log("Saving") mcl_log("Saving")
mcl_entity_invs.save_inv(ent) mcl_entity_invs.save_inv(ent)
return taken_items return taken_items
else else
mcl_log("No need to save") mcl_log("No need to save")
end
end end
end end
end end

View File

@ -0,0 +1,36 @@
# textdomain: mcl_minecarts
Minecart=Minevogn
Minecarts can be used for a quick transportion on rails.=Minevogne kan bruges til hurtig transport på spor.
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.=Minevogne kan kun køre på spor, og følger dem altid. Ved et T-kryds uden en vej ligeud drejer de altid til venstre. Farten påvirkes af sportypen.
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Du kan placere minevogne på spor. Højre-klik for at stige ombord.
To obtain the minecart, punch it while holding down the sneak key.=For at at få minevognen i din oppakning.
A minecart with TNT is an explosive vehicle that travels on rail.=En minevogn med TNT as et eksplosivt fartøj som kører på spor.
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.=Placér den på spor. Slå den for at flytte den. TNTet bliver antændt med flint og stål eller når minevognen er på et aktiveringsspor.
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=For at få minevognen med TNT i din oppakning skal du slå den mens du holder snigeknappen nede. Du kan ikke gøre dette hvis TNTen er antændt.
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=En minevogn med ovn er et fartøj som kører på spor. Den kan køre af sig selv med brændstof.
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.=Placér den på spor. Hvis du putter kul i den vil ovnen brænde i lang tid, og minevognen vil køre af sig selv. Slå den for at sætte den i bevægelse.
To obtain the minecart and furnace, punch them while holding down the sneak key.=For at få minevognen med ovn i din oppakning skal du slå den mens du holder snigeknappen nede.
Minecart with Chest=Minevogn med kiste
Minecart with Furnace=Minevogn med ovn
Minecart with Command Block=Minevogn med kommandoblok
Minecart with Hopper=Minevogn med tragt
Minecart with TNT=Minevogn med 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.=Placér dem på jorden for at bygge din jerbane. Sporene kobler sig automatisk sammen med hinanden og laver sving, T-kryds, kryds og skråninger efter behov.
Rail=Spor
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Spor kan bruges til at bygge jernbaner til minevogne. Normale spor sænker minevognene en smule på grund af friktionsmodstand.
Powered Rail=Strømspor
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Spor kan bruges til at bygge jernbaner til minevogne. Strømspor kan accelerere eller bremse minevogne.
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Uden redstonekraft vil sporet bremse minevognen. For at accelerere minevognen skal den bruge redstoneskraft.
Activator Rail=Aktiveringsspor
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Spor kan bruges til at bygge jernbaner til minevogne. Aktiveringsspor bruges til at aktivere specielle minevogne.
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=For at få dette spor til at aktiere minevogne skal du give det redstonekraft og sende en minevogn over dette sporstykke.
Detector Rail=Detektorspor
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.=Spor kan bruges til at bygge jernbaner til minevogne. Et detektorspor kan opdage en minevogn som kører over det og give kraft til redstonemekanismer.
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=For at opdage en minevogn og give redstonekraft skal den forbindes til redstonestøv eller redstonemekanismer og send en hvilkensomhelst minevogn hen over sporet.
Track for minecarts=Spor til minevogne.
Speed up when powered, slow down when not powered=Accelerérer når der er strøm, sænk hastigheden når der ikke er strøm.
Activates minecarts when powered=Aktieverer minevogne når der er strøm.
Emits redstone power when a minecart is detected=Udsender redstonekraft når en minevogn bliver opdaget.
Vehicle for fast travel on rails=Fartøj til hurtig kørsel på spor.
Can be ignited by tools or powered activator rail=Kan antændes med værktøj eller et aktivatorspor med strøm.
Sneak to dismount=Snig for at stige af.

View File

@ -873,10 +873,13 @@ function mob_class:do_states_attack (dtime)
local dist = vector.distance(p, s) local dist = vector.distance(p, s)
if self.attack_type == "explode" then if self.attack_type == "explode" then
local vec = { x = p.x - s.x, z = p.z - s.z }
yaw = (atan(vec.z / vec.x) +math.pi/ 2) - self.rotate if target_line_of_sight then
if p.x > s.x then yaw = yaw +math.pi end local vec = { x = p.x - s.x, z = p.z - s.z }
yaw = self:set_yaw( yaw, 0, dtime) yaw = (atan(vec.z / vec.x) +math.pi/ 2) - self.rotate
if p.x > s.x then yaw = yaw +math.pi end
yaw = self:set_yaw( yaw, 0, dtime)
end
local node_break_radius = self.explosion_radius or 1 local node_break_radius = self.explosion_radius or 1
local entity_damage_radius = self.explosion_damage_radius local entity_damage_radius = self.explosion_damage_radius
@ -900,10 +903,10 @@ function mob_class:do_states_attack (dtime)
end end
-- walk right up to player unless the timer is active -- walk right up to player unless the timer is active
if self.v_start and (self.stop_to_explode or dist < self.reach) then if self.v_start and (self.stop_to_explode or dist < self.reach) or not target_line_of_sight then
self:set_velocity( 0) self:set_velocity(0)
else else
self:set_velocity( self.run_velocity) self:set_velocity(self.run_velocity)
end end
if self.animation and self.animation.run_start then if self.animation and self.animation.run_start then

View File

@ -316,8 +316,14 @@ local function who_are_you_looking_at (self, dtime)
local stop_look_at_player = stop_look_at_player_chance == 1 local stop_look_at_player = stop_look_at_player_chance == 1
if self.attack or self.following then if self.attack then
self._locked_object = self.attack or self.following if not self.target_time_lost then
self._locked_object = self.attack
else
self._locked_object = nil
end
elseif self.following then
self._locked_object = self.following
elseif self._locked_object then elseif self._locked_object then
if stop_look_at_player then if stop_look_at_player then
--minetest.log("Stop look: ".. self.name) --minetest.log("Stop look: ".. self.name)

View File

@ -0,0 +1,11 @@
# textdomain: mcl_mobs
Peaceful mode active! No monsters will spawn.=Fredelig tilstand aktiveret! Ingen monstre vil spawne.
This allows you to place a single mob.=Dette gør dig i stand til at placere et enkelt monster.
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.=Placér det blot der hvor du ønsker, at monsteret skal komme. Dyr vil spawne tamme, medmindre du holder snige-knappen nede mens du placerer dem. Hvis du placerer denne på et monsterspawn, ændrer du hvilket monster det spawner.
You need the “maphack” privilege to change the mob spawner.=Du skal have "maphack" privilegier for at ændre monsterspawneren.
Name Tag=Navneskilt
A name tag is an item to name a mob.=Et navneskilt bruges til at navngive et monster.
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.=Før du bruger navneskiltet, skal du vælge navnet ved en ambolt. Derefter kan du bruge navneskiltet til at navngive et monster. Dette opbruger navneskiltet.
Only peaceful mobs allowed!=Kun fredelige monstre er tilladt!
Give names to mobs=Giv navne til monstre
Set name at anvil=Vælg navn ved en ambolt.

View File

@ -1,11 +1,11 @@
# textdomain: mcl_mobs # textdomain: mcl_mobs
Peaceful mode active! No monsters will spawn.=Мирный режим включён! Монстры не будут появляться. Peaceful mode active! No monsters will spawn.=Мирный режим включён! Чудовища не будут появляться.
This allows you to place a single mob.=Позволяет вам разместить одного моба. This allows you to place a single mob.=Позволяет вам породить одно существо.
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Просто поместите это туда, где хотите, чтобы появился моб. Животные будут появляться уже прирученные, если это не нужно, удерживайте клавишу [Красться] при размещении. Если поместить это на спаунер, появляющийся из него моб будет изменён. Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Просто нажмите на блок, где хотите, чтобы появилось существо. Животные будут появляться уже прирученные, если это не нужно, удерживайте клавишу [Красться] при размещении. Если использовать на порождателе, тогда существо будет изменено.
You need the “maphack” privilege to change the mob spawner.=Вам нужно обладать привилегией “maphack”, чтобы изменить спаунер моба. You need the “maphack” privilege to change the mob spawner.=Вам нужно обладать привилегией «maphack», чтобы изменить порождатель существ.
Name Tag=Именная бирка Name Tag=Именная бирка
A name tag is an item to name a mob.=Именная бирка это предмет, чтобы дать мобу имя. A name tag is an item to name a mob.=Именная бирка — это предмет, чтобы дать существу имя.
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Прежде чем использовать именную бирку, нужно задать имя на наковальне. Тогда вы сможете использовать бирку, чтобы дать имя мобу. Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Прежде чем использовать именную бирку, нужно задать имя на наковальне. Тогда вы сможете использовать бирку, чтобы дать имя мобу.
Only peaceful mobs allowed!=Разрешены только мирные мобы! Only peaceful mobs allowed!=Разрешены только мирные существа!
Give names to mobs=Даёт имена мобам Give names to mobs=Даёт имена существам
Set name at anvil=Задайте имя при помощи наковальни Set name at anvil=Задайте имя при помощи наковальни

View File

@ -675,6 +675,9 @@ function mob_class:do_env_damage()
self.standing_in = node_ok(pos, "air").name self.standing_in = node_ok(pos, "air").name
self.standing_on = node_ok(pos2, "air").name self.standing_on = node_ok(pos2, "air").name
local pos3 = vector.offset(pos, 0, 1, 0)
self.standing_under = node_ok(pos3, "air").name
-- don't fall when on ignore, just stand still -- don't fall when on ignore, just stand still
if self.standing_in == "ignore" then if self.standing_in == "ignore" then
self.object:set_velocity({x = 0, y = 0, z = 0}) self.object:set_velocity({x = 0, y = 0, z = 0})
@ -682,6 +685,7 @@ function mob_class:do_env_damage()
local nodef = minetest.registered_nodes[self.standing_in] local nodef = minetest.registered_nodes[self.standing_in]
local nodef2 = minetest.registered_nodes[self.standing_on] local nodef2 = minetest.registered_nodes[self.standing_on]
local nodef3 = minetest.registered_nodes[self.standing_under]
-- rain -- rain
if self.rain_damage > 0 then if self.rain_damage > 0 then
@ -761,7 +765,7 @@ function mob_class:do_env_damage()
if minetest.get_item_group(self.standing_in, "water") == 0 then if minetest.get_item_group(self.standing_in, "water") == 0 then
drowning = true drowning = true
end end
elseif nodef.drowning > 0 then elseif nodef.drowning > 0 and nodef3.drowning > 0 then
drowning = true drowning = true
end end
@ -939,7 +943,7 @@ function mob_class:falling(pos)
-- in water then float up -- in water then float up
if registered_node.groups.water then if registered_node.groups.water then
if acc and self.floats == 1 then if acc and self.floats == 1 and minetest.registered_nodes[node_ok(vector.offset(pos,0,self.collisionbox[5] -0.25,0)).name].groups.water then
self.object:set_acceleration(vector.new(0, -self.fall_speed / (math.max(1, v.y) ^ 2), 0)) self.object:set_acceleration(vector.new(0, -self.fall_speed / (math.max(1, v.y) ^ 2), 0))
end end
else else

View File

@ -0,0 +1,2 @@
# textdomain:mcl_paintings
Painting=Maleri

View File

@ -191,9 +191,10 @@ Origin of those models:
* [Spennnyyy](https://freesound.org/people/Spennnyyy/) (CC0) * [Spennnyyy](https://freesound.org/people/Spennnyyy/) (CC0)
* `mcl_totems_totem.ogg` * `mcl_totems_totem.ogg`
* Source: <https://freesound.org/people/Spennnyyy/sounds/323502/> * 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) * `mobs_mc_skeleton_random.*.ogg` (CC BY 3.0)
* Source: <https://opengameart.org/content/walking-skeleton> * Source: <https://opengameart.org/content/walking-skeleton>
* Based on: <https://freesound.org/people/kantouth/sounds/115113/>
* [spookymodem](https://freesound.org/people/spookymodem/) * [spookymodem](https://freesound.org/people/spookymodem/)
* `mobs_mc_skeleton_death.ogg` (CC0) * `mobs_mc_skeleton_death.ogg` (CC0)
* <https://freesound.org/people/spookymodem/sounds/202091/> * <https://freesound.org/people/spookymodem/sounds/202091/>
@ -307,4 +308,4 @@ Origin of those models:
Note: Many of these sounds have been more or less modified to fit the game. 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.

View File

@ -105,7 +105,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
end end
local item = clicker:get_wielded_item() local item = clicker:get_wielded_item()
-- Use shears to get mushrooms and turn mooshroom into cow -- Use shears to get mushrooms and turn mooshroom into cow
if item:get_name() == "mcl_tools:shears" then if minetest.get_item_group(item:get_name(), "shears") > 0 then
local pos = self.object:get_pos() local pos = self.object:get_pos()
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true) minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)

View File

@ -0,0 +1,70 @@
# textdomain: mobs_mc
Agent=Agent
Axolotl=Salamander
Bat=Flagermus
Blaze=Blaze
Chicken=Kylling
Cow=Ko
Mooshroom=Svamp
Creeper=Creeper
Ender Dragon=Enderdrage
Enderman=Enderman
Endermite=Endermide
Ghast=Ghast
Elder Guardian=Gammel beskytter
Guardian=Beskytter
Horse=Hest
Skeleton Horse=Skelethest
Zombie Horse=Zombiehest
Donkey=Æsel
Mule=Muldyr
Iron Golem=Jerngolem
Llama=Lama
Ocelot=Ozelot
Parrot=Papegøje
Pig=Gris
Polar Bear=Isbjørn
Rabbit=Kanin
Killer Bunny=Dræberkanin
Sheep=Får
Shulker=Shulker
Silverfish=Sølvfisk
Skeleton=Skelet
Stray=Omstrejfer
Wither Skeleton=Wither-skelet
Magma Cube=Magmakube
Slime=Slimklump
Snow Golem=Snegolem
Spider=Edderkop
Cave Spider=Huleedderkop
Squid=Blæksprutte
Vex=Vex
Evoker=Fremkalder
Illusioner=Illusionist
Villager=Landsbyboer
Vindicator=Hævner
Zombie Villager=Zombie landsbyboer
Witch=Heks
Wither=Wither
Wolf=Ulv
Husk=Udtørretskal
Zombie=Zombie
Zombie Pigman=Zombificeret piglin
Farmer=Landmand
Fisherman=Fisker
Fletcher=Pilemager
Shepherd=Fårehyrde
Librarian=Bibliotikar
Cartographer=Kartograf
Armorer=Rustningesmed
Leatherworker=Læderarbejder
Butcher=Slagter
Weapon Smith=Våbensmed
Tool Smith=Værktøjssmed
Cleric=Gejstlig
Nitwit=Tåbe
Cod=Torsk
Salmon=Laks
Dolphin=Delfin
Pillager=Plyndrer
Tropical fish=Tropisk fisk

View File

@ -69,3 +69,6 @@ Salmon=Salmón
Dolphin=Delfín Dolphin=Delfín
Pillager=Saqueador Pillager=Saqueador
Tropical fish=Pez tropical Tropical fish=Pez tropical
Hoglin=Hoglin
Strider=Lavagante
Glow Squid=Calamar luminoso

View File

@ -6,6 +6,8 @@ local S = minetest.get_translator("mobs_mc")
--################### SHEEP --################### SHEEP
--################### --###################
local WOOL_REPLACE_RATE = 80
local colors = { local colors = {
-- group = { wool, textures } -- group = { wool, textures }
unicolor_white = { "mcl_wool:white", "#FFFFFF00" }, unicolor_white = { "mcl_wool:white", "#FFFFFF00" },
@ -113,7 +115,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
view_range = 12, view_range = 12,
-- Eat grass -- Eat grass
replace_rate = 80, replace_rate = WOOL_REPLACE_RATE,
replace_delay = 1.3, replace_delay = 1.3,
replace_what = { replace_what = {
{ "mcl_core:dirt_with_grass", "mcl_core:dirt", -1 }, { "mcl_core:dirt_with_grass", "mcl_core:dirt", -1 },
@ -121,25 +123,42 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
}, },
-- Properly regrow wool after eating grass -- Properly regrow wool after eating grass
on_replace = function(self, pos, oldnode, newnode) on_replace = function(self, pos, oldnode, newnode)
if not self.color or not colors[self.color] then
self.color = "unicolor_white"
end
self.base_texture = sheep_texture(self.color)
self.drops = {
{name = "mcl_mobitems:mutton",
chance = 1,
min = 1,
max = 2,},
{name = colors[self.color][1],
chance = 1,
min = 1,
max = 1,},
}
self.state = "eat" self.state = "eat"
self:set_animation("eat") self:set_animation("eat")
self:set_velocity(0) self:set_velocity(0)
minetest.after(self.replace_delay, function() minetest.after(self.replace_delay, function()
if self and self.object and self.object:get_velocity() and self.health > 0 then if self and self.object and self.object:get_velocity() and self.health > 0 then
self.object:set_velocity(vector.zero()) self.object:set_velocity(vector.zero())
if not self.color or not colors[self.color] then
self.color = "unicolor_white"
end
self.gotten = false self.gotten = false
self.base_texture = sheep_texture(self.color)
self.object:set_properties({ textures = self.base_texture }) self.object:set_properties({ textures = self.base_texture })
end end
end) end)
minetest.after(2.5, function() minetest.after(2.5, function()
if self and self.object and self.state == 'eat' and self.health > 0 and self.object:get_velocity() then if self and self.object and self.state == 'eat' and self.health > 0 then
self.state = "walk" self.state = "walk"
end end
end) end)
end, end,
-- Set random color on spawn -- Set random color on spawn
@ -215,7 +234,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
if self:feed_tame(clicker, 1, true, false) then return end if self:feed_tame(clicker, 1, true, false) then return end
if mcl_mobs:protect(self, clicker) then return end if mcl_mobs:protect(self, clicker) then return end
if item:get_name() == "mcl_tools:shears" and not self.gotten and not self.child then if minetest.get_item_group(item:get_name(), "shears") > 0 and not self.gotten and not self.child then
self.gotten = true self.gotten = true
local pos = self.object:get_pos() local pos = self.object:get_pos()
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true) minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)

View File

@ -105,8 +105,7 @@ local skeleton = {
if self.attack then if self.attack then
self.object:set_yaw(minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.attack:get_pos()))) self.object:set_yaw(minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.attack:get_pos())))
end end
-- 2-4 damage per arrow local dmg = math.random(2, 4)
local dmg = math.max(4, math.random(2, 8))
mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg) mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
end end
end, end,

View File

@ -114,7 +114,7 @@ mcl_mobs.register_mob("mobs_mc:snowman", {
-- Remove pumpkin if using shears -- Remove pumpkin if using shears
on_rightclick = function(self, clicker) on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item() local item = clicker:get_wielded_item()
if self.gotten ~= true and item:get_name() == "mcl_tools:shears" then if self.gotten ~= true and minetest.get_item_group(item:get_name(), "shears") > 0 then
-- Remove pumpkin -- Remove pumpkin
self.gotten = true self.gotten = true
self.object:set_properties({ self.object:set_properties({

View File

@ -351,7 +351,7 @@ local professions = {
leatherworker = { leatherworker = {
name = N("Leatherworker"), name = N("Leatherworker"),
texture = "mobs_mc_villager_leatherworker.png", texture = "mobs_mc_villager_leatherworker.png",
jobsite = "mcl_cauldrons:cauldron", jobsite = "group:cauldron",
trades = { trades = {
{ {
{ { "mcl_mobitems:leather", 9, 12 }, E1 }, { { "mcl_mobitems:leather", 9, 12 }, E1 },
@ -1008,7 +1008,15 @@ end
----- JOBSITE LOGIC ----- JOBSITE LOGIC
local function get_profession_by_jobsite(js) local function get_profession_by_jobsite(js)
for k,v in pairs(professions) do for k,v in pairs(professions) do
if v.jobsite == js then return k end if v.jobsite == js then
return k
-- Catch Nitwit doesn't have a jobsite
elseif v.jobsite and v.jobsite:find("^group:") then
local group = v.jobsite:gsub("^group:", "")
if minetest.get_item_group(js, group) > 0 then
return k
end
end
end end
end end

View File

@ -0,0 +1,3 @@
# textdomain: lightning
Let lightning strike at the specified position or player. No parameter will strike yourself.=Lad lynet slå ned på den angivne position eller spiller. Hvis du ikke skriver et parameter vil lynet ramme dig selv.
No position specified and unknown player=Ingen position og ukendt spiller.

View File

@ -0,0 +1,3 @@
# textdomain: mcl_void_damage
The void is off-limits to you!=Tomrummet er forbudt område for dig!
@1 fell into the endless void.=@1 faldt ned i det uendelige tomrum.

View File

@ -0,0 +1,8 @@
# textdomain: mcl_weather
Gives ability to control weather=Gør en i stand til at styre vejret
Changes the weather to the specified parameter.=Ændrer vejret til det angivne.
Error: No weather specified.=Fejl: Intet vejr angivet.
Error: Invalid parameters.=Fejl: Ugyldige parametre.
Error: Duration can't be less than 1 second.=Fejl: Vargihed kan ikke være under 1 sekund.
Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.=Fejl: Ugyldigt vejr angivet. Brug "clear","rain","snow" eller "thunder".
Toggles between clear weather and weather with downfall (randomly rain, thunderstorm or snow)=Skifter mellem klart vejr og vejr med nedbør (tilfældigt enten regn, tordenstorm eller sne)

View File

@ -0,0 +1,51 @@
# 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.=Adgang til det forespurgte blev nægtet; det er hemmeligt. Du kan få adgang ved at nå længere i spillet. Find selv ud af, hvordan du får adgang.
All entries read.=Alle indtastninger læst.
All help entries revealed!=Alle hjælpeindtastninger afsløret!
All help entries are already revealed.=Alle hjælpeindtasterninger er allerede afsløret.
Allows you to reveal all hidden help entries with /help_reveal=Gør dig i stand til at afsløre alle skjulte hjælpeindtaster med /help_reveal
Category list=Kategoriliste
Currently all entries in this category are hidden from you.=Alle indtastninger i denne kategori er i øjeblikket skjult for dig.
Unlock new entries by progressing in the game.=Lås nye indtastninger op ved at nå længere i spillet.
Help=Hjælp
Entry=Indtastning
Entry list=Indtastningsliste
Error: Access denied.=Fejl: Adgang nægtet.
Error: No help available.=Fejl: Igen hjælp tilgængelig.
Go to category list=Gå til kategoriliste
Go to entry list=Gå til indtastningsliste
Help > @1=Hjælp > @1
Help > @1 > @2= Hjælp > @1 > @2
Help > @1 > (No Entry)=Hjælp > @1 > (Ingen indtasting)
Help > (No Category)=Hjælp > (Ingen kategori)
Hidden entries: @1=Skjult indtastning: @1
Nameless entry (@1)=Unavngiven indtastning (@1)
New entries: @1=Nye indtastninger: @1
New help entry unlocked: @1 > @2=Ny hjælpeindtastning låst op: @1 > @2
No categories have been registered, but they are required to provide help.=Nye kategorier er blevet registreret, men de er påkrævede for at give hjælp.
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.= Dokumentationssystemet [doc] har ikke medfølgende hjælpeindhold, det behøver yderligere mods for at tilføje hjælpeindhold.
Number of entries: @1=Antal indtastninger: @1
OK=OK
Open a window providing help entries about Minetest and more=Åbn et vindue med hjælpeindtastninger om Minetest og mere
Please select a category you wish to learn more about:=Vælg venlist en kategori som du ønsker at lære mere om:
Recommended mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.=Anbefalede mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.
Reveal all hidden help entries to you=Afslør alle gemte hjælpeindtastninger for dig.
Show entry=Vis indtastning
Show category=Vis kategori
Show next entry=Vis næste indtastning
Show previous entry=Vis forrige indtastning
This category does not have any entries.=Denne kategori har ingen indtastninger.
This category has the following entries:=Denne kategori har følgende indtastninger:
This category is empty.=Denne kategori er tom.
This is the help.=Dette er hjælpen.
You haven't chosen a category yet. Please choose one in the category list first.=Du har endnu ikke vagt en kategori. Vælg venligst én i kategoriliste før.
You haven't chosen an entry yet. Please choose one in the entry list first.=Du har ikke valgt en indtastning endnu. Vælg venligst en fra indtastningslisten først.
Collection of help texts=Samling at hjælpetekster.
Notify me when new help is available=Giv mig besked når ny hjælp er tilgængelig.
Play notification sound when new help is available=Afspil lyd når ny hjælp er tilgængeig.
Show previous image=Vis forrige billede
Show previous gallery page=Vis forrige galleriside
Show next image=Vis næste billede
Show next gallery page=Vis næste galleriside

View File

@ -0,0 +1,18 @@
# textdomain:doc_identifier
Error: This node, item or object is undefined. This is always an error.=Fejl: Dette knudepunkt, genstand eller objekt er ikke defineret.
This can happen for the following reasons:=Dette kan ske af følgende grunde:
• The mod which is required for it is not enabled=• Det mod som er krævet er ikke aktiveret
• The author of the game or a mod has made a mistake=• Ophavsmanden til spillet eller moddet har lavet en fejltagelse
It appears to originate from the mod “@1”, which is enabled.=Det ser ud til at stamme fra moddet "@1" som er aktiveret.
It appears to originate from the mod “@1”, which is not enabled!=Det ser ud til at stamme fra moddet "01" som er deaktiveret!
Its identifier is “@1”.=Dets identificering er "@1".
Lookup Tool=Opslagsværktøj
No help entry for this block could be found.=Der kunne ikke findes nogen hjælpeindtastning til denne blok.
No help entry for this item could be found.=Der kunne ikke findes nogen hjælpeindtastning til denne genstand.
No help entry for this object could be found.=Der kunne ikke findes nogen hjælpeindtastning for stte objekt.
OK=OK
Punch any block, item or other thing about you wish to learn more about. This will open up the appropriate help entry. The tool comes in two modes which are changed by using. In liquid mode, this tool points to liquids as well while in solid mode this is not the case.=Slå en hvilkensomhelst blok, genstand eller andre ting som du ønsker at vide mere om. Dette vil åbne den relevante hjælpeindtastning. Værktøjet findes i to tilstande som skiftes ved brug. I flydende tilstand vil værktøjet også peje på væsker, mens dette ikke er tilfældet i fast tilstand.
This block cannot be identified because the world has not materialized at this point yet. Try again in a few seconds.=Denne blok kan ikke identificeres fordi verdenen ikke har materialiseret sig endnu. Forsøg igen om et par sekunder.
This is a player.=Dette er en spiller.
This useful little helper can be used to quickly learn more about about one's closer environment. It identifies and analyzes blocks, items and other things and it shows extensive information about the thing on which it is used.=Denne smarte lille hjælper kan bruges til hurtigt at lære mere om omgivelserne. Den identificerer og analyserer blokke, genstande og andre ting, og den viser udtømmende informationer om den ting den bliver brugt på.
Show help for pointed thing=Vis hjælp til tingen

View File

@ -0,0 +1,143 @@
# textdomain:doc_items
Using it as fuel turns it into: @1.=At bruge det som brændstof laver det om til: @1.
@1 seconds=@1 sekunder
# Item count times item name
@1×@2=@1x@2
# Itemname (25%)
@1 (@2%)=@1 (@2%)
# Itemname (<0.5%)
@1 (<0.5%)= @1 (<0.5%)
# Itemname (ca. 25%)
@1 (ca. @2%)=@1 (ca. @2%)
# List separator (e.g. “one, two, three”)
, = ,
# Final list separator (e.g. “One, two and three”)
and = and
1 second=1 sekund
A transparent block, basically empty space. It is usually left behind after digging something.=En gennemsigtig blok, egentlig bare tom luft. Det efterlades typisk efter at have gravet.
Air=Luft
Blocks=Blokke
Building another block at this block will place it inside and replace it.=At sætte en ny blok ved denne blok vil placere den indeni og erstatte den.
Building this block is completely silent.=Det er helt lydløst at bygge denne blok.
Collidable: @1=Kan kollidere: @1
Description: @1=Beskrivelse: @1
Falling blocks can go through this block; they destroy it when doing so.=Faldende blokke kan gå igennem denne blok; de ødelægger den idet i går igennem den.
Full punch interval: @1 s=Tid mellem hele slag: @1
Hand=Hånd
Hold it in your hand, then leftclick to eat it.=Hold det i din hånd, og venstre-klik for at spise det.
Hold it in your hand, then leftclick to eat it. But why would you want to do this?=Hold det i din hånd, og venstre-klik for at spise det. Men hvorfor i alverden ville du have lyst til dét?
Item reference of all wieldable tools and weapons=Genstandsreference til alt værktøj og alle våden man kan bære.
Item reference of blocks and other things which are capable of occupying space=Genstandsreference til blokke og andre ting som kan optage plads.
Item reference of items which are neither blocks, tools or weapons (esp. crafting items)=Genstandsreference til genstanse som hverken er blokke, værktøj eller våben (især håndværksmateriale)
Liquids can flow into this block and destroy it.=Væsker kan flyde ind i denne blok og ødelægge den.
Maximum stack size: @1=Største stakstørrelse: @1
Mining level: @1=Udvindingsevneevne: @1
Mining ratings:=Udvindelsesvurdering
• @1, rating @2: @3 s - @4 s=• @1, vurdering @2: @3 s -@4 s
• @1, rating @2: @3 s=• @1, vurdering @2: @3 s
Mining times:=Udvindingstider
Mining this block is completely silent.=Det er helt lydløst at udvinde denne blok.
Miscellaneous items=Diverse genstande
No=Nej
Pointable: No=Retningsbestemt: Nej
Pointable: Only by special items=Retningsbestemt: Kun af særlige genstande
Pointable: Yes=Retningsbestemt: Ja
Punches with this block don't work as usual; melee combat and mining are either not possible or work differently.=Slag med denne blok virker ikke som normalt; nærkamp og udvinding er enten umulig eller virker anderledes.
Punches with this item don't work as usual; melee combat and mining are either not possible or work differently.=Slag med dette objekt virker ikke som normalt; nærkamp og udvinding er enten umulig eller virker anderledes.
Punches with this tool don't work as usual; melee combat and mining are either not possible or work differently.=Slag med dette værktøj virker ikke som normalt; nærkamp og udvinding er enten umulig eller virker anderledes.
Range: @1=Rækkevidde: @1
# Range: <Hand> (<Range>)
Range: @1 (@2)=Rækkevidde: @1 (@2)
Range: 4=Rækkevidde: 4
# Rating used for digging times
Rating @1=Vurdering: @1
# @1 is minimal rating, @2 is maximum rating
Rating @1-@2=Vurdering @1-@2
The fall damage on this block is increased by @1%.=Faldskade på denne blok er øget med @1%.
The fall damage on this block is reduced by @1%.=Faldskade på denne blok er reduceret med @1%.
This block allows light to propagate with a small loss of brightness, and sunlight can even go through losslessly.=Denne blok lader lys sprede sig med et lille tab af styrke, og sollys kan endda gå igennem uden tab.
This block allows light to propagate with a small loss of brightness.=Denne blok tillader lys at sprede med et lille tab af styrke.
This block allows sunlight to propagate without loss in brightness.=Denne blok tillader sollys at sprede sig uden tab af styrke.
This block belongs to the @1 group.=Denne blok tilhører @1gruppen
This block belongs to these groups: @1.=Denne blok hører til følgende grupper: @1.
This block can be climbed.=Man kan klatre på denne blok.
This block can be destroyed by any mining tool immediately.=Denne blok kan ødelægges straks med ethvert udvindingsværktøj.
This block can be destroyed by any mining tool in half a second.=Denne blok kan ødelægges på et halvt sekund med ethvert udvindingsværktøj.
This block can be mined by any mining tool immediately.=Denne blok kan udvindes straks med ethvert udvindingsværktøj.
This block can be mined by any mining tool in half a second.=Denne blok kan udvindes på et halvt sekund med ethvert udvindingsværktøj.
This block can be mined by mining tools which match any of the following mining ratings and its toughness level.=Denne blok kan udvindes med ethvert udvindingsværktøj som svarer til en hvilkensomhelst af følgende udvindingsvurderinger og hårdhedsgrad.
This block can not be destroyed by ordinary mining tools.=Denne blok kan ikke ødelægges af normalt udvindingsværktøj.
This block can not be mined by ordinary mining tools.=Denne blok kan ikke udvindes med normalt udvindingsværktøj.
This block can serve as a smelting fuel with a burning time of @1.=Denne blok virker som brændstof til at smelte og har en brændetid på @1.
This block causes a damage of @1 hit point per second.=Denne blok giver @1 skade per sekund.
This block causes a damage of @1 hit points per second.=Denne blok giver @1 skade per sekund.
This block connects to blocks of the @1 group.=Denne blok forbindes til blokke i @1gruppen.
This block connects to blocks of the following groups: @1.=Denne blok forbindes til blokke i følgende grupper: @1.
This block connects to these blocks: @1.=Denne blok forbindes til disse blokke: @1.
This block connects to this block: @1.=Denne blok forbindes til denne blok: @1.
This block decreases your breath and causes a drowning damage of @1 hit point every 2 seconds.=Denne blok nedsætter dit åndedræt og giver @1 drukningsskade hvert 2. sekund.
This block decreases your breath and causes a drowning damage of @1 hit points every 2 seconds.=Denne blok nedsætter dit åndedræt og giver @1 drukneskade hvert 2. sekund.
This block is a light source with a light level of @1.=Denne blok er en lyskilde med lysniveau @1.
This block glows faintly with a light level of @1.=Denne blok gløder svagt med et lysniveau på @1.
This block is a building block for creating various buildings.=Denne blok er en byggesten til at bygge forskellige bygninger.
This block is a liquid with these properties:=Denne blok er en væske med følgende egenskaber:
This block is affected by gravity and can fall.=Denne blok påvirkes af tyngdekraften og kan falde ned.
This block is completely silent when mined or built.=Denne blok er helt lydløs når den udvindes eller bygges.
This block is completely silent when walked on, mined or built.=Denne blok er helt lydløs når den betrædes, udvindes eller bygges.
This block is destroyed when a falling block ends up inside it.=Denne blok ødelægges når en nedfaldende blok ender indeni den.
This block negates all fall damage.=Denne blok modvirker al faldskade.
This block points to liquids.=Denne blok orienteres mod væsker.
This block will drop as an item when a falling block ends up inside it.=Denne blok dropper som genstand når en faldende blok ender indeni den.
This block will drop as an item when it is not attached to a surrounding block.=Denne blok dropper som genstand når den ikke sidder fast på en tilstødende blok.
This block will drop as an item when no collidable block is below it.=Denne blok dropper som genstand når der ikke er en bæredygtig blok under den.
This block will drop the following items when mined: @1.=Denne blok dropper følgende genstande når den udvindes: @1.
This block will drop the following when mined: @1×@2.=Denne blok dropper følgende når den udvindes: @1x@2.
This block will drop the following when mined: @1.=Denne blok dropper følgende når den udvindes: @1.
This block will drop the following when mined: @1.=Denne blok dropper følgende når den udvindes: @1.
This block will make you bounce off with an elasticity of @1%.=Denne blok får dig til at hoppe af med en elasticitet på @1%.
This block will randomly drop one of the following when mined: @1.=Denne blok dropper en vilkårlig af følgende genstande når den udvindes: @1.
This block will randomly drop up to @1 drops of the following possible drops when mined: @2.=Denne blok dropper et vilkårligt antal op til @1 af følgende mulige ting når den udvindes: @2.
This block won't drop anything when mined.=Denne blok dropper ikke noget når den udvindes.
This is a decorational block.=Dette er en pynteblok.
This is a melee weapon which deals damage by punching.=Dette er et nærkampsvåben som giver skade ved at slå.
Maximum damage per hit:=Højeste skade per slag:
This item belongs to the @1 group.=Denne genstand hører til @1gruppen.
This item belongs to these groups: @1.=Denne genstand hører til disse grupper: @1.
This item can serve as a smelting fuel with a burning time of @1.=Denne genstand virker som brændstof til at smelte og har en brændetid på @1.
This item is primarily used for crafting other items.=Denne genstand bruges mest til at lave andre genstande.
This item points to liquids.=Denne genstand orienterer sig mod væsker.
This tool belongs to the @1 group.=Dette værktøj hører til @1gruppen
This tool belongs to these groups: @1.=Dette værktøj hører til disse grupper:
This tool can serve as a smelting fuel with a burning time of @1.=Dette værktøj virker som brændstof til at smelte og har en brændetid på @1.
This tool is capable of mining.=Dette værktøj kan bruges til udvinding.
Maximum toughness levels:=Højeste hårdhedsgrad.
This tool points to liquids.=Dette værktøj orienterer sig mod væsker.
Tools and weapons=Værktøj og våben
Unknown Node=Ukendt knudepunkt
Usage help: @1=Hjælp til brug: @1
Walking on this block is completely silent.=Det er helt lydløst at gå på denne blok.
Whenever you are not wielding any item, you use the hand which acts as a tool with its own capabilities. When you are wielding an item which is not a mining tool or a weapon it will behave as if it would be the hand.=Når du ikke anvender en genstand, bruger du din hånd som fungerer som et værktøj med sine egne egenskaber. Når du anvender en genstand som ikke er et værktøj til udvinding eller våben virker det som om du bruger din hånd.
Yes=Ja
You can not jump while standing on this block.=Du kan ikke hoppe mens du står på dene blok.
any level=hvilketsomhelst level
level 0=level 0
level 0-@1=level 0-@1
unknown=ukendt
Unknown item (@1)=ukendt genstand (@1)
• @1: @2=
• @1: @2 HP=• @1: @2 HP
• @1: @2, @3=• @1: @2, @3
• Flowing range: @1=• Flydende rækkevidde: @1
• No flowing=• Ingen strøm
• Not renewable=• Kan ikke genopfriskes
• Renewable=• Kan genopfriskes
• Viscosity: @1=• Viskositet: @1
Itemstring: "@1"=Genstandsstreng: "@1"
Durability: @1 uses=Holdbarhed: @1 anvendelser
Durability: @1=Holdbarhed: @1
Mining durability:=Udvindingsholdbarhed:
• @1, level @2: @3 uses=• @1, level @2: @3 anvendelser
• @1, level @2: Unlimited=• @1, level @2: Uendelig
This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=Denne bloks rotation påvirkes af måden du placerer den på: Placér den på gulvet eller loftet for en lodret orientering; placér den på siden for en horisontal orientering. Hvis du sniger dig mens den placeres den vinkelret i stedet.
Toughness level: @1=Hårdhedsgrad: @1
This block is slippery.=Denne blok er glat.

View File

@ -53,8 +53,8 @@ Range: 4=Range: 4
Rating @1=Classificação @1 Rating @1=Classificação @1
# @1 is minimal rating, @2 is maximum rating # @1 is minimal rating, @2 is maximum rating
Rating @1-@2=Classificação @1-@2 Rating @1-@2=Classificação @1-@2
The fall damage on this block is increased by @1%.=O dano por queda nesse bloco é aumentado em @ 1%. The fall damage on this block is increased by @1%.=O dano por queda nesse bloco é aumentado em @1%.
The fall damage on this block is reduced by @1%.=O dano por queda nesse bloco é reduzido em @ 1%. The fall damage on this block is reduced by @1%.=O dano por queda nesse bloco é reduzido em @1%.
This block allows light to propagate with a small loss of brightness, and sunlight can even go through losslessly.=Esse bloco permite que a luz se propague com uma pequena perda de brilho, e a luz solar pode até passar sem perdas. This block allows light to propagate with a small loss of brightness, and sunlight can even go through losslessly.=Esse bloco permite que a luz se propague com uma pequena perda de brilho, e a luz solar pode até passar sem perdas.
This block allows light to propagate with a small loss of brightness.=Esse bloco permite que a luz se propague com uma pequena perda de brilho. This block allows light to propagate with a small loss of brightness.=Esse bloco permite que a luz se propague com uma pequena perda de brilho.
This block allows sunlight to propagate without loss in brightness.=Esse bloco permite que a luz solar se propague sem perda de brilho. This block allows sunlight to propagate without loss in brightness.=Esse bloco permite que a luz solar se propague sem perda de brilho.
@ -78,7 +78,7 @@ This block connects to this block: @1.=Esse bloco se conecta a esse bloco: @1.
This block decreases your breath and causes a drowning damage of @1 hit point every 2 seconds.=Esse bloco diminui a sua respiração e causa um dano por afogamento de @1 ponto de vida a cada 2 segundos. This block decreases your breath and causes a drowning damage of @1 hit point every 2 seconds.=Esse bloco diminui a sua respiração e causa um dano por afogamento de @1 ponto de vida a cada 2 segundos.
This block decreases your breath and causes a drowning damage of @1 hit points every 2 seconds.=Esse bloco diminui a sua respiração e causa um dano por afogamento de @1 pontos de vida a cada 2 segundos. This block decreases your breath and causes a drowning damage of @1 hit points every 2 seconds.=Esse bloco diminui a sua respiração e causa um dano por afogamento de @1 pontos de vida a cada 2 segundos.
This block is a light source with a light level of @1.=Esse bloco é uma fonte de luz com um nível de luz de @1. This block is a light source with a light level of @1.=Esse bloco é uma fonte de luz com um nível de luz de @1.
This block glows faintly with a light level of @1.=Esse bloco tem um brilho fraco com um nível de luz de @ 1. This block glows faintly with a light level of @1.=Esse bloco tem um brilho fraco com um nível de luz de @1.
This block is a building block for creating various buildings.=Esse bloco é um bloco de construção para criar vários edifícios. This block is a building block for creating various buildings.=Esse bloco é um bloco de construção para criar vários edifícios.
This block is a liquid with these properties:=Esse bloco é um líquido com as seguintes propriedades: This block is a liquid with these properties:=Esse bloco é um líquido com as seguintes propriedades:
This block is affected by gravity and can fall.=Esse bloco é afetado pela gravidade e pode cair. This block is affected by gravity and can fall.=Esse bloco é afetado pela gravidade e pode cair.
@ -123,7 +123,7 @@ any level=qualquer nível
level 0=nível 0 level 0=nível 0
level 0-@1=nivel 0-@1 level 0-@1=nivel 0-@1
unknown=desconhecido unknown=desconhecido
Unknown item (@1)=Item desconhecido Unknown item (@1)=Item desconhecido (@1)
• @1: @2= • @1: @2=
• @1: @2 HP= • @1: @2 HP=
• @1: @2, @3= • @1: @2, @3=

View File

@ -0,0 +1,37 @@
# textdomain: craftguide
Any shulker box=Hvilkensomhelst shulkerboks
Any wool=Hvilkensomhelst uld
Any wood planks=Hvilkensomhelst træplanker
Any wood=Hvilkensomhelst træ
Any sand=Hvilkensomhelst sand
Any normal sandstone=Hvilkensomhelst normal sandsten
Any red sandstone=Hvilkensomhelst rød sandsten
Any carpet=HVilketsomhelst tæppe
Any dye=Hvilkensomhelst farvestof
Any water bucket=Hvilkensomhelst vandpand
Any flower=Hvilkensomhelst blomst
Any mushroom=Hvilkensomhelst svamp
Any wooden slab=Hvilkensomhelst træplade
Any wooden stairs=Hvilkensomhelst trætrappe
Any coal=Hvilketsomhelst kul
Any kind of quartz block=Hvilkensomhelst quartzblok
Any kind of purpur block=Hvilkensomhelst pupurblok
Any stone bricks=Hvilkensomhelst mursten af sten
Any stick=Hvilkensomhelst pind
Any item belonging to the @1 group=Hvilkensomhelst genstant i @1gruppen
Any item belonging to the groups: @1=Hvilkensomhelst genstand som hører til grupperne: @1
Search=Søg
Reset=Nulstil
Previous page=Forrige side
Next page=Næste side
Usage @1 of @2=Brug @1 af @2
Recipe @1 of @2=Opskrift @1 af @2
Burning time: @1=Brændetid: @1
Cooking time: @1=Tilberedelsestid: @1
Recipe is too big to be displayed (@1×@2)=Formen er for stor til at blive vist (@1x@2)
Shapeless=Uformelig
Cooking=Madlavning
Increase window size=Øg vinduesstørrelsen
Decrease window size=Mindsk vinduesstørrelsen
No item to show=Ingen genstande at vise
Collect items to reveal more recipes=Saml genstande for at afsløre flere opskrifter

View File

@ -0,0 +1,79 @@
# textdomain: mcl_doc
Water can flow into this block and cause it to drop as an item.=Der kan flyde vandt i denne blok, hvilket får den til at droppe som en genstand.
This block can be turned into dirt with a hoe.=Denne blok kan omdannes til jord med en hakke.
This block can be turned into farmland with a hoe.=Denne blok kan omdannes til landbrugsjord med en hakke.
This block acts as a soil for all saplings.=Denne blok virker som jord for alle spirer.
This block acts as a soil for some saplings.=Denne blok virker som jord for nogle spirer.
Sugar canes will grow on this block.=Sukkerrør gror på denne blok.
Nether wart will grow on this block.=Nethervorder gror på denne blok.
This block quickly decays when there is no wood block of any species within a distance of @1. When decaying, it disappears and may drop one of its regular drops. The block does not decay when the block has been placed by a player.=Denne blok forgår hurtigt når der ikke er træblokke af nogen art af træblokke indenfor en afstand af @1. Når den forgår, forsvinder den, og dropper måske et af sine normale drops. Blokken forgår ikke når den er blevet placeret af en spiller.
This block quickly decays and disappears when there is no wood block of any species within a distance of @1. The block does not decay when the block has been placed by a player.=Denne blok forgår hurtigt og forsvinder når der ikke er nogen art af træblokke indenfor en afstand af @1. Blokken forgår ikke når den er blevet placeret af en spiller.
This plant can only grow on grass blocks and dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.=Denne plante kan kun gro på græsblokke eller jord. For at overleve, har den brug for direkte udsyn til himlen, eller et lysniveau på 8 eller derover.
This plant can grow on grass blocks, podzol, dirt and coarse dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.=Denne plante kan gro på græsblokke, podsol, jord eller grov jord. For at overleve, har den brug for direkte udsyn til himlen, eller et lysniveau på 8 eller derover.
This block is flammable.=Denne blok er brændfarlig.
This block destroys any item it touches.=Denne blok ødelægger enhver genstand den berør.
To eat it, wield it, then rightclick.=For at spise det skal du bære det og højre-klikke.
You can eat this even when your hunger bar is full.=Du kan spise dette selvom din sultbjælke er fuld.
You cannot eat this when your hunger bar is full.=Du kan ikke spise dette når din sultbjælke er fuld.
To drink it, wield it, then rightclick.=For at drikke det skal du bære det og højre-klikke.
You cannot drink this when your hunger bar is full.=Du kan ikke drikke dette når din sultbjælke er fuld.
To consume it, wield it, then rightclick.=For at indtage det skal du bære det og højre-klikke.
You cannot consume this when your hunger bar is full.=Du kan ikke indtage dette når din sultbjælke er fuld.
You have to wait for about 2 seconds before you can eat or drink again.=Du er nødt til at vente omkring 2 sekunder før du kan drikke eller spise igen.
Hunger points restored: @1=Sultpoint genvundet: @1
Saturation points restored: @1%.1f=Mæthedspoint genvundet: @1%.1f
This item can be repaired at an anvil with: @1.=Denne genstand kan repareres ved en ambolt med: @1.
This item can be repaired at an anvil with any wooden planks.=Denne genstand kan repareres ved en ambolt med hvilkensomhelst træplanke.
This item can be repaired at an anvil with any item in the “@1” group.=Denne genstand kan repareres ved en ambolt med hvilkensomhelst genstand i "@1"gruppen
This item cannot be renamed at an anvil.=Denne genstand kan ikke omdøbes ved en ambolt.
This block crushes any block it falls into.=Denn blok knuser enhver blok den falder ind i.
When this block falls deeper than 1 block, it causes damage to any player it hits. The damage dealt is B×22 hit points with B @= number of blocks fallen. The damage can never be more than 40 HP.=Denne blok falder dybere end 1 blok, og giver skade til enhver spiller den rammer. Skaden givet er Bx2-2 ned B @= antal faldne blokke.
Diamond Pickaxe=Minehakke i diamant
Iron Pickaxe=Jernhakke
Stone Pickaxe=Stenhakke
Golden Pickaxe=Guldhakke
Wooden Pickaxe=Træhakke
Diamond Axe=Diamantøkse
Iron Axe=Jernøkse
Stone Axe=Stenøkse
Golden Axe=Guldøkse
Wooden Axe=Træøkse
Diamond Shovel=Diamantskovl
Iron Shovel=Jernskovl
Stone Shovel=Stenskovl
Golden Shovel=Guldskovl
Wooden Shovel=Træskovl
This block can be mined by any tool instantly.=Denne blok kan udvindes momentant med ethvert værktøj.
This block can be mined by:=Denne blok kan udvindes med:
Hardness: ∞= Hårdhed:∞
Hardness: @1=Hårdhed @1
This block will not be destroyed by TNT explosions.=Denne blok ødelægges ikke af TNT-eksplosioner.
This block drops itself when mined by shears.=Denne blok dropper sig selv når den udvindes med sakse.
@1×@2=@1x@2
This blocks drops the following when mined by shears: @1=Denne blok dropper følgende når den udvindes med sakse: @1
, =,
• Shears=• Sakse
• Sword=• Sværd
• Hand=• Hånd
This is a melee weapon which deals damage by punching.=Dette er et nærkampsvåben som giver skade ved at slå.
Maximum damage: @1 HP=Højeste skade: @1
Full punch interval: @1 s=Helt interval mellem slag: @1 s
This tool is capable of mining.=Dette værktøj kan bruges til udvinding.
Mining speed: @1=Udvindingshastighed: @1
Painfully slow=Pinagtig langsom
Very slow=Meget langsom
Slow=Langsom
Fast=Hurtig
Very fast=Meget hurtig
Extremely fast=Ekstremt hurtig
Instantaneous=Momentan
@1 uses=@1 anvendelser
Unlimited uses=Uendelige anvendelser
Block breaking strength: @1=Blokkens brudstyrke: @1
Mining durability: @1=Udvindingsholdbarhed: @1
Armor points: @1=Rustningspoint: @1
Armor durability: @1=Rustningens holdbarhed: @1
It can be worn on the head.=Den kan bæres på hovedet.
It can be worn on the torso.=Den kan bæres på kroppen.
It can be worn on the legs.=De kan bæres på benene.
It can be worn on the feet.=De kan bæres på fødderne.

View File

@ -1,25 +1,24 @@
# textdomain:awards # textdomain:awards
@1/@2 chat messages=@1/@2 сообщений чата @1/@2 chat messages=@1/@2 сообщений чата
@1/@2 crafted=@1/@2 скрафчено @1/@2 crafted=@1/@2 создано
@1/@2 deaths=@1/@2 смертей @1/@2 deaths=@1/@2 смертей
@1/@2 dug=@1/@2 выкопано @1/@2 dug=@1/@2 выкопано
@1/@2 game joins=@1/@2 присоединений к игре @1/@2 game joins=@1/@2 присоединений к игре
@1/@2 placed=@1/@2 помещено @1/@2 placed=@1/@2 размещено
@1 (got)=@1 (получено) @1 (got)=@1 (получено)
@1: @1=@1: @1 @1: @2=@1: @2
@1s awards:=Награды @1: @1s awards:=Награды @1:
(Secret Award)=(Секретная награда) (Secret Award)=(Тайная награда)
<achievement ID>=<идентификатор достижения> <achievement ID>=<идентификатор достижения>
<name>=<имя> <name>=<имя>
A Cat in a Pop-Tart?!=Кот в печеньке?! Advancement Made!=Получено достижение!
Achievement gotten!=Получено достижение! Advancement Made:=Получено достижение:
Achievement gotten:=Получено достижение: Advancement: @1=Достижение: @1
Achievement gotten: @1=Получено достижение: @1
Achievement not found.=Достижение не найдено. Achievement not found.=Достижение не найдено.
All your awards and statistics have been cleared. You can now start again.=Ваши награды удалены вместе со всей статистикой. Теперь можно начать всё сначала. All your awards and statistics have been cleared. You can now start again.=Ваши награды удалены вместе со всей статистикой. Теперь можно начать всё сначала.
Awards=Награды Awards=Награды
Craft: @1×@2=Скрафчено: @1×@2 Craft: @1×@2=Создано: @1×@2
Craft: @1=Скрафчено: @1 Craft: @1=Создано: @1
Die @1 times.=Умер(ла) @1 раз(а). Die @1 times.=Умер(ла) @1 раз(а).
Die.=Умер(ла). Die.=Умер(ла).
Get the achievements statistics for the given player or yourself=Получение статистики достижений для заданного игрока или для себя Get the achievements statistics for the given player or yourself=Получение статистики достижений для заданного игрока или для себя
@ -28,35 +27,44 @@ Join the game.=Присоединился(ась) к игре.
List awards in chat (deprecated)=Вывести список наград в чат (устарело). List awards in chat (deprecated)=Вывести список наград в чат (устарело).
Place a block: @1=Разметил(а) блок: @1 Place a block: @1=Разметил(а) блок: @1
Place blocks: @1×@2=Разместил(а) блоки: @1×@2 Place blocks: @1×@2=Разместил(а) блоки: @1×@2
Secret Achievement gotten!=Секретное достижение получено! Secret Advancement Made!=Тайное достижение получено!
Secret Achievement gotten:=Секретное достижение получено: Secret Advancement Made:=Тайное достижение получено:
Secret Achievement gotten: @1=Секретное достижение получено: @1 Secret Advancement Made: @1=Тайное достижение получено: @1
Show details of an achievement=Показать подробности достижения Show details of an achievement=Показать подробности достижения
Show, clear, disable or enable your achievements=Отобразить, очистить, запретить или разрешить ваши достижения Show, clear, disable or enable your advancements.=Отобразить, очистить, запретить или разрешить ваши достижения
Get this achievement to find out what it is.=Получите это достижение, чтобы узнать, что это. Make this advancement to find out what it is.=Получите это достижение, чтобы узнать, что это.
Write @1 chat messages.=Написано @1 сообщений(е,я) в чате. Write @1 chat messages.=Написано @1 сообщений(е,я) в беседе.
Write something in chat.=Написал(а) что-то в чате. Write something in chat.=Написал(а) что-то в беседе.
You have disabled your achievements.=Вы запретили ваши достижения. You have disabled your advancements.=Вы запретили ваши достижения.
You have enabled your achievements.=Вы разрешили ваши достижения. You have enabled your advancements.=Вы разрешили ваши достижения.
You have not gotten any awards.=Вы пока не получали наград. You have not gotten any awards.=Вы пока не получали наград.
You've disabled awards. Type /awards enable to reenable.=Вы запретили награды. Выполните /awards enable, чтобы разрешить их обратно. You've disabled awards. Type /awards enable to reenable.=Вы запретили награды. Выполните /awards enable, чтобы разрешить их обратно.
[c|clear|disable|enable]=[c|clear - очистить|disable - запретить|enable - разрешить] [c|clear|disable|enable]=[c|clear — очистить|disable — запретить|enable — разрешить]
OK=О'кей OK=Ладно
Error: No awards available.=Ошибка: Награды недоступны Error: No awards available.=Ошибка: награды недоступны
Eat: @1×@2=Съедено: @1×@2 Eat: @1×@2=Съедено: @1×@2
Eat: @1=Съедено: @1 Eat: @1=Съедено: @1
@1/@2 eaten=@1/@2 съедено @1/@2 eaten=@1/@2 съедено
Place @1 block(s).=Поместил(а) @1 блок(а,ов). Place @1 block(s).=Разместил(а) @1 блок(а,ов).
Dig @1 block(s).=Выкопал(а) @1 блок(а,ов). Dig @1 block(s).=Выкопал(а) @1 блок(а,ов).
Eat @1 item(s).=Съел(а) @1 предмет(а,ов). Eat @1 item(s).=Съел(а) @1 предмет(а,ов).
Craft @1 item(s).=Скрафтил(а) @1 предмет(а,ов). Craft @1 item(s).=Сделал(а) @1 предмет(а,ов).
Can give achievements to any player=Может выдавать достижения любому игроку Can give advancements to any player=Может выдавать достижения любому игроку
(grant <player> (<achievement> | all)) | list=(grant <игрок> (<достижение> | all - всем)) | список (grant <player> (<advancement> | all)) | list=(grant <игрок> (<достижение> | all — всем)) | список
Give achievement to player or list all achievements=Выдать достижение игроку или отобразить все достижения Give advancement to player or list all advancements=Выдать достижение игроку или отобразить все достижения
@1 (@2)=@1 (@2) @1 (@2)=@1 (@2)
Invalid syntax.=Неверный синтаксис. Invalid syntax.=Неверное составление.
Invalid action.=Непредусмотренное действие. Invalid action.=Непредусмотренное действие.
Player is not online.=Игрок не подключён. Player is not online.=Игрок не подключён.
Done.=Сделано. Done.=Готово.
Achievement “@1” does not exist.=Достижения “@1” не существует. Advancement “@1” does not exist.=Достижения «@1» не существует.
@1 has made the achievement @2=@1 получил(а) достижение @2 @1 has made the advancement @2=@1 получил(а) достижение @2
Mine a block: @1=Добыл(а) блок: @1
Mine blocks: @1×@2=Добыл(а) блоки: @1×@2
Awards are disabled, enable them first by using /awards enable!=Награды отключены, сначала включите их с помощью /awards enable!
Goal Completed:=Цель выполнена:
Goal Completed!=Цель выполнена!
Goal Completed: @1=Цель выполнена: @1
Challenge Completed:=Задача выполнена:
Challenge Completed!=Задача выполнена!
Challenge Completed: @1=Задача выполнена: @1

View File

@ -518,7 +518,7 @@ awards.register_achievement("mcl:stoneAge", {
awards.register_achievement("mcl:hotStuff", { awards.register_achievement("mcl:hotStuff", {
title = S("Hot Stuff"), title = S("Hot Stuff"),
description = S("Put lava in a bucket."), description = S("Put lava in a bucket."),
icon = "bucket_lava.png", icon = "mcl_buckets_lava_bucket.png",
type = "Advancement", type = "Advancement",
group = "Overworld", group = "Overworld",
}) })

View File

@ -3,7 +3,7 @@ Acquire Hardware=Куй Железо
Bake Bread=Хлеб всему голова Bake Bread=Хлеб всему голова
Benchmarking=Верстак Benchmarking=Верстак
Cow Tipper=Кожа да кости Cow Tipper=Кожа да кости
Craft a bookshelf.=Создание книжной полки Craft a bookshelf.=Создание книжной полки.
Craft a cake using wheat, sugar, milk and an egg.=Создание торта из пшеницы, сахара, молока и яйца. Craft a cake using wheat, sugar, milk and an egg.=Создание торта из пшеницы, сахара, молока и яйца.
Craft a crafting table from 4 wooden planks.=Создание верстака из 4 досок. Craft a crafting table from 4 wooden planks.=Создание верстака из 4 досок.
Craft a stone pickaxe using sticks and cobblestone.=Создание каменного топора из палок и булыжников. Craft a stone pickaxe using sticks and cobblestone.=Создание каменного топора из палок и булыжников.
@ -15,12 +15,12 @@ Eat a cooked porkchop.=Употребление в пищу приготовле
Eat a cooked rabbit.=Употребление в пищу приготовленного кролика. Eat a cooked rabbit.=Употребление в пищу приготовленного кролика.
Get really desperate and eat rotten flesh.=Отчаянное и необдуманное употребление в пищу гнилого мяса Get really desperate and eat rotten flesh.=Отчаянное и необдуманное употребление в пищу гнилого мяса
Getting Wood=Рубка Леса Getting Wood=Рубка Леса
Getting an Upgrade=Модернизация Getting an Upgrade=Обновка
Hit a skeleton, wither skeleton or stray by bow and arrow from a distance of at least 20 meters.=Удар по скелету, скелету-иссушителю либо уклонение от стрелы на расстоянии не менее 20 метров. Hit a skeleton, wither skeleton or stray by bow and arrow from a distance of at least 20 meters.=Попадание по скелету, скелету-иссушителю либо уклонение от стрелы на расстоянии не менее 20 метров.
Hot Topic=Автор Жжёт Hot Topic=Печник жжёт
Into Fire=В Огне Into Fire=В огне
Into the Nether=В Аду We Need to Go Deeper=В глубь
Iron Belly=Железный Живот Iron Belly=Железный живот
Librarian=Библиотекарь Librarian=Библиотекарь
Mine emerald ore.=Добыча изумрудной руды. Mine emerald ore.=Добыча изумрудной руды.
On A Rail=На Рельсах On A Rail=На Рельсах
@ -30,20 +30,84 @@ Pick up a wood item from the ground.@nHint: Punch a tree trunk until it pops out
Pick up leather from the floor.@nHint: Cows and some other animals have a chance to drop leather, when killed.=Поднятие кожи с пола.@nПодсказка: Коровы и некоторые другие животные могут оставлять кожу, если их убивать. Pick up leather from the floor.@nHint: Cows and some other animals have a chance to drop leather, when killed.=Поднятие кожи с пола.@nПодсказка: Коровы и некоторые другие животные могут оставлять кожу, если их убивать.
Place a dispenser.=Установка диспенсера. Place a dispenser.=Установка диспенсера.
Place a flower pot.=Установка цветочного горшка. Place a flower pot.=Установка цветочного горшка.
Pork Chop=Свиная Отбивная Pork Chop=Свиная отбивная
Pot Planter=Сажатель Горшков Pot Planter=Сажатель горшков
Rabbit Season=Кроличий Сезон Rabbit Season=Заячья пора
Sniper Duel=Снайперская Дуэль Sniper Duel=Лучный бой
Take a cooked fish from a furnace.@nHint: Use a fishing rod to catch a fish and cook it in a furnace.=Приготовление рыбы в печи.@nПодсказка: Ловите рыбу удочкой и готовьте её в печи. Take a cooked fish from a furnace.@nHint: Use a fishing rod to catch a fish and cook it in a furnace.=Приготовление рыбы в печи.@nПодсказка: Ловите рыбу удочкой и готовьте её в печи.
Take an iron ingot from a furnace's output slot.@nHint: To smelt an iron ingot, put a fuel (like coal) and iron ore into a furnace.=Получение слитка железа из печи.@nПодсказка: чтобы переплавить железную руду, нужно положить её в печь и туда же поместить топливо (уголь или другое). Take an iron ingot from a furnace's output slot.@nHint: To smelt an iron ingot, put a fuel (like coal) and iron ore into a furnace.=Получение слитка железа из печи.@nПодсказка: чтобы переплавить железную руду, нужно положить её в печь и туда же поместить топливо (уголь или другое).
The Haggler=Хагглер The Haggler=Торговец
The Lie=Тортик The Lie=Тортик
Time to Farm!=Время фермерства! Time to Farm!=Время земледелия!
Time to Mine!=Время добывать! Time to Mine!=Время добывать!
Time to Strike!=Время сражаться! Time to Strike!=Время сражаться!
Travel by minecart for at least 1000 meters from your starting point in a single ride.=Поездка на вагонетке минимум на 1000 метров от стартовой точки за один раз. Travel by minecart for at least 1000 meters from your starting point in a single ride.=Поездка на вагонетке минимум на 1000 метров от стартовой точки за один раз.
Use 8 cobblestones to craft a furnace.=Создание печи из 8 булыжников. Use 8 cobblestones to craft a furnace.=Создание печи из 8 булыжников.
Use a crafting table to craft a wooden hoe from wooden planks and sticks.=Создание деревянной мотыги из досок и палок на верстаке. Use a crafting table to craft a wooden hoe from wooden planks and sticks.=Создание деревянной мотыги из досок и палок на верстаке.
Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.=Создание деревянной кирки из досок и палок на верстаке. Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.=Создание деревянной кирки из досок и палок на верстаке.
Use obsidian and a fire starter to construct a Nether portal.=Создание Адского портала при помощи обсидиана и огнива. Use obsidian and a fire starter to construct a Nether portal.=Создание при помощи обсидиана и огнива.
Use wheat to craft a bread.=Использование пшеницы для приготовления хлеба. Use wheat to craft a bread.=Использование пшеницы для приготовления хлеба.
Who is Cutting Onions?=
Pick up a crying obsidian from the floor.=
Hidden in the Depths=
Pick up an Ancient Debris from the floor.=
The Nether=Преисподняя
Bring summer clothes.@nHint: Enter the Nether.=Возьмите с собой летнюю одежду.@nПодсказка: войдите в преисподнюю.
Isn't It Iron Pick=
Craft a iron pickaxe using sticks and iron.=
Postmortal=
Use a Totem of Undying to cheat death.=
Sweet Dreams=
Sleep in a bed to change your respawn point.=
Not Quite "Nine" Lives=
Charge a Respawn Anchor to the maximum.=
What A Deal!=Вот так сделка!
Successfully trade with a Villager.=Успешная торговля с жителем.
Withering Heights=
Summon the wither from the dead.=
The Cutest Predator=
Catch an Axolotl with a bucket!=
Fishy Business=
Catch a fish.@nHint: Catch a fish, salmon, clownfish, or pufferfish.=
Country Lode, Take Me Home=
Use a compass on a Lodestone.=
Serious Dedication=
Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices.=
Local Brewery=
Brew a Potion.@nHint: Take a potion or glass bottle out of the brewing stand.=
Enchanter=
Enchant an item using an Enchantment Table.=
Bring Home the Beacon=
Use a beacon.=
Beaconator=
Use a fully powered beacon.=
The Next Generation=
Hold the Dragon Egg.@nHint: Pick up the egg from the ground and have it in your inventory.=
The End... Again...=
Respawn the Ender Dragon.=
Sky's the Limit=
Find the elytra and prepare to fly above and beyond!=
Free the End=
Kill the ender dragon. Good Luck!=
Bee Our Guest=
Use a campfire to collect a bottle of honey from a beehive without aggrivating the bees inside.=
Total Beelocation=
Move a bee nest, with 3 bees inside, using a silk touch enchanted tool.=
Wax On=
Apply honeycomb to a copper block to protect it from the elements.=
Wax Off=
Scrape wax off of a copper block.=
The End?=
Or the beginning?@nHint: Enter an end portal.=
Stone Age=
Mine a stone with new pickaxe.=
Ice Bucket Challenge=
Obtain an obsidian block.=
Hot Stuff=
Put lava in a bucket.=
Hero of the Village=
Successfully defend a village from a raid=
Voluntary Exile=
Kill a raid captain. Maybe consider staying away from the local villages for the time being...=
Tactical Fishing=
Catch a fish... without a fishing rod!=

View File

@ -1 +0,0 @@
-- This mod has no code and is only a collection of textures.

View File

@ -1,3 +0,0 @@
name = mcl_base_textures
author = Wuzzy
description = Provides core textures needed by Minetest.

View File

@ -14,33 +14,36 @@ return {
}}, }},
{S("Previous Maintainers"), 0xFFFFFF, { {S("Previous Maintainers"), 0xFFFFFF, {
"Fleckenstein", "Fleckenstein",
"jordan4ibanez",
"cora", "cora",
}}, }},
{S("Developers"), 0xF84355, { {S("Developers"), 0xF84355, {
"bzoss",
"AFCMS", "AFCMS",
"epCode", "epCode",
"ryvnf",
"iliekprogrammar",
"MysticTempest",
"Rootyjr",
"aligator",
"Code-Sploit",
"NO11",
"kabou",
"rudzik8",
"chmodsayshello", "chmodsayshello",
"PrairieWind", "PrairieWind",
"RandomLegoBrick",
"SumianVoice",
"MrRar", "MrRar",
"talamh",
"Faerraven / Michieal",
"FossFanatic ", "FossFanatic ",
"SmokeyDope", "SmokeyDope",
}}, }},
{S("Past Developers"), 0xF84355, {
"jordan4ibanez",
"iliekprogrammar",
"kabou",
"kay27",
"Faerraven / Michieal",
"MysticTempest",
"NO11",
"SumianVoice",
}},
{S("Contributors"), 0x52FF00, { {S("Contributors"), 0x52FF00, {
"RandomLegoBrick",
"rudzik8",
"Code-Sploit",
"aligator",
"Rootyjr",
"ryvnf",
"bzoss",
"talamh",
"Laurent Rocher", "Laurent Rocher",
"HimbeerserverDE", "HimbeerserverDE",
"TechDudie", "TechDudie",
@ -69,6 +72,10 @@ return {
"Marcin Serwin", "Marcin Serwin",
"erlehmann", "erlehmann",
"E", "E",
"n_to",
"debiankaios",
"Gustavo6046 / wallabra",
"CableGuy67",
"Benjamin Schötz", "Benjamin Schötz",
"Doloment", "Doloment",
"Sydney Gems", "Sydney Gems",
@ -102,25 +109,18 @@ return {
"gldrk", "gldrk",
"atomdmac", "atomdmac",
"emptyshore", "emptyshore",
"FlamingRCCars",
"uqers",
"Niterux",
"appgurueu",
"seventeenthShulker",
}}, }},
{S("MineClone5"), 0xA60014, { {S("Music"), 0xA60014, {
"kay27", "Jordach for the jukebox music compilation from Big Freaking Dig",
"Debiankaios", "Dark Reaven Music (https://soundcloud.com/dark-reaven-music) for the main menu theme (Calmed Cube) and Traitor (horizonchris96), which is licensed under https://creativecommons.org/licenses/by-sa/3.0/",
"epCode", "Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)",
"NO11", "Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)",
"j45", "Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0)",
"chmodsayshello",
"3raven",
"PrairieWind",
"Gustavo6046 / wallabra",
"CableGuy67",
"MrRar",
}},
{S("Mineclonia"), 0xFFFFFF, {
"erlehmann",
"Li0n",
"E",
"n_to",
}}, }},
{S("Original Mod Authors"), 0x343434, { {S("Original Mod Authors"), 0x343434, {
"Wuzzy", "Wuzzy",
@ -152,14 +152,18 @@ return {
"4Evergreen4", "4Evergreen4",
"jordan4ibanez", "jordan4ibanez",
"paramat", "paramat",
"debian044 / debian44",
"chmodsayshello",
"cora", "cora",
"Faerraven / Michieal", "Faerraven / Michieal",
"PrairieWind",
}}, }},
{S("3D Models"), 0x0019FF, { {S("3D Models"), 0x0019FF, {
"22i", "22i",
"tobyplowy", "tobyplowy",
"epCode", "epCode",
"Faerraven / Michieal", "Faerraven / Michieal",
"SumianVoice",
}}, }},
{S("Textures"), 0xFF9705, { {S("Textures"), 0xFF9705, {
"XSSheep", "XSSheep",
@ -176,6 +180,8 @@ return {
"Faerraven / Michieal", "Faerraven / Michieal",
"Nicu", "Nicu",
"Exhale", "Exhale",
"Wbjitscool",
"SmokeyDope",
}}, }},
{S("Translations"), 0x00FF60, { {S("Translations"), 0x00FF60, {
"Wuzzy", "Wuzzy",
@ -192,6 +198,9 @@ return {
"SakuraRiu", "SakuraRiu",
"anarquimico", "anarquimico",
"syl", "syl",
"Temak",
"megustanlosfrijoles",
"kbundg",
}}, }},
{S("Funders"), 0xF7FF00, { {S("Funders"), 0xF7FF00, {
"40W", "40W",
@ -199,14 +208,8 @@ return {
"Cora", "Cora",
}}, }},
{S("Special thanks"), 0x00E9FF, { {S("Special thanks"), 0x00E9FF, {
"celeron55 for creating Minetest", "The Minetest team for making and supporting an engine, and distribution infrastructure that makes this all possible",
"Jordach for the jukebox music compilation from Big Freaking Dig",
"wsor for working tirelessly in the shadows for the good of all of us, particularly helping with solving contentDB and copyright issues.",
"The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game", "The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game",
"Notch and Jeb for being the major forces behind Minecraft", "Notch and Jeb for being the major forces behind Minecraft",
"Dark Reaven Music (https://soundcloud.com/dark-reaven-music) for the main menu theme (Calmed Cube) and Traitor (horizonchris96), which is licensed under https://creativecommons.org/licenses/by-sa/3.0/",
"Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)",
"Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)",
"Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0)",
}}, }},
} }

View File

@ -147,13 +147,13 @@ function mcl_experience.throw_xp(pos, total_xp)
obj:set_velocity(vector.new( obj:set_velocity(vector.new(
math.random(-2, 2) * math.random(), math.random(-2, 2) * math.random(),
math.random( 2, 5), math.random(2, 5),
math.random(-2, 2) * math.random() math.random(-2, 2) * math.random()
)) ))
i = i + xp i = i + xp
j = j + 1 j = j + 1
table.insert(obs,obj) table.insert(obs, obj)
end end
return obs return obs
end end
@ -179,18 +179,18 @@ function mcl_experience.setup_hud(player)
if not minetest.is_creative_enabled(player:get_player_name()) then if not minetest.is_creative_enabled(player:get_player_name()) then
hud_bars[player] = player:hud_add({ hud_bars[player] = player:hud_add({
hud_elem_type = "image", hud_elem_type = "image",
position = {x = 0.5, y = 1}, position = { x = 0.5, y = 1 },
offset = {x = (-9 * 28) - 3, y = -(48 + 24 + 16 - 5)}, offset = { x = (-9 * 28) - 3, y = -(48 + 24 + 16 - 5) },
scale = {x = 0.35, y = 0.375}, scale = { x = 0.35, y = 0.375 },
alignment = {x = 1, y = 1}, alignment = { x = 1, y = 1 },
z_index = 11, z_index = 11,
}) })
hud_levels[player] = player:hud_add({ hud_levels[player] = player:hud_add({
hud_elem_type = "text", hud_elem_type = "text",
position = {x = 0.5, y = 1}, position = { x = 0.5, y = 1 },
number = 0x80FF20, number = 0x80FF20,
offset = {x = 0, y = -(48 + 24 + 24)}, offset = { x = 0, y = -(48 + 24 + 24) },
z_index = 12, z_index = 12,
}) })
end end
@ -221,7 +221,7 @@ function mcl_experience.update(player)
end end
function mcl_experience.register_on_add_xp(func, priority) function mcl_experience.register_on_add_xp(func, priority)
table.insert(mcl_experience.on_add_xp, {func = func, priority = priority or 0}) table.insert(mcl_experience.on_add_xp, { func = func, priority = priority or 0 })
end end
-- callbacks -- callbacks
@ -232,9 +232,9 @@ minetest.register_on_joinplayer(function(player)
end) end)
minetest.register_on_leaveplayer(function(player) minetest.register_on_leaveplayer(function(player)
hud_bars[player] = nil hud_bars[player] = nil
hud_levels[player] = nil hud_levels[player] = nil
caches[player] = nil caches[player] = nil
end) end)
minetest.register_on_dieplayer(function(player) minetest.register_on_dieplayer(function(player)
@ -247,3 +247,12 @@ end)
minetest.register_on_mods_loaded(function() minetest.register_on_mods_loaded(function()
table.sort(mcl_experience.on_add_xp, function(a, b) return a.priority < b.priority end) table.sort(mcl_experience.on_add_xp, function(a, b) return a.priority < b.priority end)
end) end)
mcl_gamemode.register_on_gamemode_change(function(player, old_gamemode, new_gamemode)
if new_gamemode == "survival" then
mcl_experience.setup_hud(player)
mcl_experience.update(player)
elseif new_gamemode == "creative" then
mcl_experience.remove_hud(player)
end
end)

View File

@ -1,3 +1,4 @@
name = mcl_experience name = mcl_experience
author = oilboi author = oilboi
description = eXPerience mod description = eXPerience mod
depends = mcl_gamemode

View File

@ -0,0 +1,40 @@
# MineClone2 Formspec API
## `mcl_formspec.label_color`
Contains the color used for formspec labels, currently `#313131`.
## `mcl_formspec.get_itemslot_bg(x, y, w, h)`
Get the background of inventory slots (formspec version = 1)
ex:
```lua
local formspec = table.concat({
mcl_formspec.get_itemslot_bg(0, 0, 5, 2),
"list[current_player;super_inventory;0,0;5,2;]",
})
```
## `mcl_formspec.get_itemslot_bg_v4(x, y, w, h, size, texture)`
Get the background of inventory slots (formspec version > 1)
Works basically the same as `mcl_formspec.get_itemslot_bg(x, y, w, h)` but have more customisation options:
- `size`: allow you to customize the size of the slot borders, default is 0.05
- `texture`: allow you to specify a custom texture tu use instead of the default one
ex:
```lua
local formspec = table.concat({
mcl_formspec.get_itemslot_bg_v4(0.375, 0.375, 5, 2, 0.1, "super_slot_background.png"),
"list[current_player;super_inventory;0.375,0.375;5,2;]",
})
```
## `mcl_formspec.itemslot_border_size`
Contains the default item slot border size used by `mcl_formspec.get_itemslot_bg_v4`, currently 0.05

View File

@ -0,0 +1,21 @@
# MineClone2 Formspec Guide
**_This guide will teach you the rules for creating formspecs for the MineClone2 game._**
Formspecs are an important part of game and mod development.
First of all, MineClone2 aims to support ONLY last formspec version. Many utility functions will not work with formspec v1 or v2.
The typical width of an 9 slots width inventory formspec is `0.375 + 9 + ((9-1) * 0.25) + 0.375 = 11.75`
Margins are 0.375.
The labels color is `mcl_formspec.label_color`
Space between 1st inventory line and the rest of inventory is 0.45
Labels should have 0.375 space above if there is no other stuff above and 0.45 between content
- 0.375 under
According to minetest modding book, table.concat is faster than string concatenation, so this method should be prefered (the code is also more clear)

View File

@ -1,10 +1,55 @@
mcl_formspec = {} mcl_formspec = {}
mcl_formspec.label_color = "#313131"
---Get the background of inventory slots (formspec version = 1)
---@param x number
---@param y number
---@param w number
---@param h number
---@return string
function mcl_formspec.get_itemslot_bg(x, y, w, h) function mcl_formspec.get_itemslot_bg(x, y, w, h)
local out = "" local out = ""
for i = 0, w - 1, 1 do for i = 0, w - 1, 1 do
for j = 0, h - 1, 1 do for j = 0, h - 1, 1 do
out = out .."image["..x+i..","..y+j..";1,1;mcl_formspec_itemslot.png]" out = out .. "image[" .. x + i .. "," .. y + j .. ";1,1;mcl_formspec_itemslot.png]"
end
end
return out
end
---This function will replace mcl_formspec.get_itemslot_bg then every formspec will be upgrade to version 4
---@param x number
---@param y number
---@param size number
---@param texture? string
---@return string
---@nodiscard
local function get_slot(x, y, size, texture)
local t = "image[" .. x - size .. "," .. y - size .. ";" .. 1 + (size * 2) ..
"," .. 1 + (size * 2) .. ";" .. (texture and texture or "mcl_formspec_itemslot.png") .. "]"
return t
end
mcl_formspec.itemslot_border_size = 0.05
---Get the background of inventory slots (formspec version > 1)
---@param x number
---@param y number
---@param w integer
---@param h integer
---@param size? number Optional size of the slot border (default: 0.05)
---@param texture? string Optional texture to replace the default one
---@return string
---@nodiscard
function mcl_formspec.get_itemslot_bg_v4(x, y, w, h, size, texture)
if not size then
size = mcl_formspec.itemslot_border_size
end
local out = ""
for i = 0, w - 1, 1 do
for j = 0, h - 1, 1 do
out = out .. get_slot(x + i + (i * 0.25), y + j + (j * 0.25), size, texture)
end end
end end
return out return out

View File

@ -0,0 +1,35 @@
# `mcl_inventory`
## `mcl_inventory.register_survival_inventory_tab(def)`
```lua
mcl_inventory.register_survival_inventory_tab({
-- Page identifier
-- Used to uniquely identify the tab
id = "test",
-- The tab description, can be translated
description = "Test",
-- The name of the item that will be used as icon
item_icon = "mcl_core:stone",
-- If true, the main inventory will be shown at the bottom of the tab
-- Listrings need to be added by hand
show_inventory = true,
-- This function must return the tab's formspec for the player
build = function(player)
return "label[1,1;Hello hello]button[2,2;2,2;Hello;hey]"
end,
-- This function will be called in the on_player_receive_fields callback if the tab is currently open
handle = function(player, fields)
print(dump(fields))
end,
-- This function will be called to know if a player can see the tab
-- Returns true by default
access = function(player)
end,
```

View File

@ -3,19 +3,35 @@ local F = minetest.formspec_escape
local C = minetest.colorize local C = minetest.colorize
-- Prepare player info table -- Prepare player info table
---@type table<string, {page: string, filter: string, start_i: integer, inv_size: integer}>
local players = {} local players = {}
-- Containing all the items for each Creative Mode tab -- Containing all the items for each Creative Mode tab
---@type table<string, string[]>
local inventory_lists = {} local inventory_lists = {}
--local mod_player = minetest.get_modpath("mcl_player")
-- Create tables -- Create tables
local builtin_filter_ids = {"blocks","deco","redstone","rail","food","tools","combat","mobs","brew","matr","misc","all"} ---@type string[]
local builtin_filter_ids = {
"blocks",
"deco",
"redstone",
"rail",
"food",
"tools",
"combat",
"mobs",
"brew",
"matr",
"misc",
"all"
}
for _, f in pairs(builtin_filter_ids) do for _, f in pairs(builtin_filter_ids) do
inventory_lists[f] = {} inventory_lists[f] = {}
end end
---@param tbl string[]
local function replace_enchanted_books(tbl) local function replace_enchanted_books(tbl)
for k, item in ipairs(tbl) do for k, item in ipairs(tbl) do
if item:find("mcl_enchanting:book_enchanted") == 1 then if item:find("mcl_enchanting:book_enchanted") == 1 then
@ -28,20 +44,32 @@ local function replace_enchanted_books(tbl)
end end
end end
--[[ Populate all the item tables. We only do this once. Note this code must be -- Populate all the item tables. We only do this once.
executed after loading all the other mods in order to work. ]] -- Note this code must be executed after loading all the other mods in order to work.
minetest.register_on_mods_loaded(function() minetest.register_on_mods_loaded(function()
for name,def in pairs(minetest.registered_items) do for name, def in pairs(minetest.registered_items) do
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and
def.description ~= "" then
---@param def mt.ItemDef|mt.NodeDef
local function is_redstone(def) local function is_redstone(def)
return def.mesecons or def.groups.mesecon or def.groups.mesecon_conductor_craftable or def.groups.mesecon_effecor_off return def.mesecons or def.groups.mesecon or def.groups.mesecon_conductor_craftable or
def.groups.mesecon_effecor_off
end end
---@param def mt.ItemDef|mt.NodeDef
local function is_tool(def) local function is_tool(def)
return def.groups.tool or (def.tool_capabilities and def.tool_capabilities.damage_groups == nil) return def.groups.tool or (def.tool_capabilities and def.tool_capabilities.damage_groups == nil)
end end
---@param def mt.ItemDef|mt.NodeDef
local function is_weapon_or_armor(def) local function is_weapon_or_armor(def)
return def.groups.weapon or def.groups.weapon_ranged or def.groups.ammo or def.groups.combat_item or ((def.groups.armor_head or def.groups.armor_torso or def.groups.armor_legs or def.groups.armor_feet or def.groups.horse_armor) and def.groups.non_combat_armor ~= 1) return def.groups.weapon or def.groups.weapon_ranged or def.groups.ammo or def.groups.combat_item or
(
(
def.groups.armor_head or def.groups.armor_torso or def.groups.armor_legs or def.groups.armor_feet or
def.groups.horse_armor) and def.groups.non_combat_armor ~= 1)
end end
-- Is set to true if it was added in any category besides misc -- Is set to true if it was added in any category besides misc
local nonmisc = false local nonmisc = false
if def.groups.building_block then if def.groups.building_block then
@ -110,6 +138,11 @@ minetest.register_on_mods_loaded(function()
end end
end) end)
---@param name string
---@param description string
---@param lang mt.LangCode
---@param filter string
---@return integer
local function filter_item(name, description, lang, filter) local function filter_item(name, description, lang, filter)
local desc local desc
if not lang then if not lang then
@ -120,13 +153,16 @@ local function filter_item(name, description, lang, filter)
return string.find(name, filter, nil, true) or string.find(desc, filter, nil, true) return string.find(name, filter, nil, true) or string.find(desc, filter, nil, true)
end end
---@param filter string
---@param player mt.PlayerObjectRef
local function set_inv_search(filter, player) local function set_inv_search(filter, player)
local playername = player:get_player_name() local playername = player:get_player_name()
local inv = minetest.get_inventory({type="detached", name="creative_"..playername}) local inv = minetest.get_inventory({ type = "detached", name = "creative_" .. playername })
local creative_list = {} local creative_list = {}
local lang = minetest.get_player_information(playername).lang_code local lang = minetest.get_player_information(playername).lang_code
for name,def in pairs(minetest.registered_items) do for name, def in pairs(minetest.registered_items) do
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and
def.description ~= "" then
if filter_item(string.lower(def.name), def.description, lang, filter) then if filter_item(string.lower(def.name), def.description, lang, filter) then
table.insert(creative_list, name) table.insert(creative_list, name)
end end
@ -147,9 +183,11 @@ local function set_inv_search(filter, player)
inv:set_list("main", creative_list) inv:set_list("main", creative_list)
end end
---@param page string
---@param player mt.PlayerObjectRef
local function set_inv_page(page, player) local function set_inv_page(page, player)
local playername = player:get_player_name() local playername = player:get_player_name()
local inv = minetest.get_inventory({type="detached", name="creative_"..playername}) local inv = minetest.get_inventory({ type = "detached", name = "creative_" .. playername })
inv:set_size("main", 0) inv:set_size("main", 0)
local creative_list = {} local creative_list = {}
if inventory_lists[page] then -- Standard filter if inventory_lists[page] then -- Standard filter
@ -160,9 +198,11 @@ local function set_inv_page(page, player)
inv:set_list("main", creative_list) inv:set_list("main", creative_list)
end end
---@param player mt.PlayerObjectRef
local function init(player) local function init(player)
local playername = player:get_player_name() local playername = player:get_player_name()
minetest.create_detached_inventory("creative_"..playername, { minetest.create_detached_inventory("creative_" .. playername, {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
if minetest.is_creative_enabled(playername) then if minetest.is_creative_enabled(playername) then
return count return count
@ -197,24 +237,45 @@ local trash = minetest.create_detached_inventory("trash", {
inv:set_stack(listname, index, "") inv:set_stack(listname, index, "")
end, end,
}) })
trash:set_size("main", 1) trash:set_size("main", 1)
local noffset = {} -- numeric tab offset ------------------------------
local offset = {} -- string offset: -- Formspec Precalculations --
local boffset = {} -- ------------------------------
local hoch = {}
local filtername = {}
--local bg = {}
local noffset_x_start = -0.24 -- Numeric position of tab background image, indexed by tab name
---@type table<string, {[0]: number, [1]: number}>
local noffset = {}
-- String position of tab button background image, indexed by tab name
---@type table<string, string>
local offset = {}
-- String position of tab button, indexed by tab name
---@type table<string, string>
local boffset = {}
-- Used to determine the tab button background image
---@type table<string, ""|"_down">
local button_bg_postfix = {}
-- Tab caption/tooltip translated string, indexed by tab name
---@type table<string, string>
local filtername = {}
local noffset_x_start = 0.2
local noffset_x = noffset_x_start local noffset_x = noffset_x_start
local noffset_y = -0.25 local noffset_y = -1.34
---@param id string
---@param right? boolean
local function next_noffset(id, right) local function next_noffset(id, right)
if right then if right then
noffset[id] = { 8.94, noffset_y } noffset[id] = { 11.3, noffset_y }
else else
noffset[id] = { noffset_x, noffset_y } noffset[id] = { noffset_x, noffset_y }
noffset_x = noffset_x + 1.25 noffset_x = noffset_x + 1.6
end end
end end
@ -228,7 +289,7 @@ next_noffset("misc")
next_noffset("nix", true) next_noffset("nix", true)
noffset_x = noffset_x_start noffset_x = noffset_x_start
noffset_y = 8.12 noffset_y = 8.64
-- Lower row -- Lower row
next_noffset("food") next_noffset("food")
@ -238,25 +299,25 @@ next_noffset("mobs")
next_noffset("matr") next_noffset("matr")
next_noffset("inv", true) next_noffset("inv", true)
for k,v in pairs(noffset) do for k, v in pairs(noffset) do
offset[k] = tostring(v[1]) .. "," .. tostring(v[2]) offset[k] = tostring(v[1]) .. "," .. tostring(v[2])
boffset[k] = tostring(v[1]+0.19) .. "," .. tostring(v[2]+0.25) boffset[k] = tostring(v[1] + 0.24) .. "," .. tostring(v[2] + 0.25)
end end
hoch["blocks"] = "" button_bg_postfix["blocks"] = ""
hoch["deco"] = "" button_bg_postfix["deco"] = ""
hoch["redstone"] = "" button_bg_postfix["redstone"] = ""
hoch["rail"] = "" button_bg_postfix["rail"] = ""
hoch["brew"] = "" button_bg_postfix["brew"] = ""
hoch["misc"] = "" button_bg_postfix["misc"] = ""
hoch["nix"] = "" button_bg_postfix["nix"] = ""
hoch["default"] = "" button_bg_postfix["default"] = ""
hoch["food"] = "_down" button_bg_postfix["food"] = "_down"
hoch["tools"] = "_down" button_bg_postfix["tools"] = "_down"
hoch["combat"] = "_down" button_bg_postfix["combat"] = "_down"
hoch["mobs"] = "_down" button_bg_postfix["mobs"] = "_down"
hoch["matr"] = "_down" button_bg_postfix["matr"] = "_down"
hoch["inv"] = "_down" button_bg_postfix["inv"] = "_down"
filtername["blocks"] = S("Building Blocks") filtername["blocks"] = S("Building Blocks")
filtername["deco"] = S("Decoration Blocks") filtername["deco"] = S("Decoration Blocks")
@ -291,197 +352,252 @@ filtername["inv"] = S("Survival Inventory")
bg["default"] = dark_bg bg["default"] = dark_bg
end]] end]]
-- Item name representing a tab, indexed by tab name
---@type table<string, string>
local tab_icon = {
blocks = "mcl_core:brick_block",
deco = "mcl_flowers:peony",
redstone = "mesecons:redstone",
rail = "mcl_minecarts:golden_rail",
misc = "mcl_buckets:bucket_lava",
nix = "mcl_compass:compass",
food = "mcl_core:apple",
tools = "mcl_core:axe_iron",
combat = "mcl_core:sword_gold",
mobs = "mobs_mc:cow",
brew = "mcl_potions:dragon_breath",
matr = "mcl_core:stick",
inv = "mcl_chests:chest",
}
-- Get the player configured stack size when taking items from creative inventory
---@param player mt.PlayerObjectRef
---@return integer
local function get_stack_size(player) local function get_stack_size(player)
return player:get_meta():get_int("mcl_inventory:switch_stack") return player:get_meta():get_int("mcl_inventory:switch_stack")
end end
-- Set the player configured stack size when taking items from creative inventory
---@param player mt.PlayerObjectRef
---@param n integer
local function set_stack_size(player, n) local function set_stack_size(player, n)
player:get_meta():set_int("mcl_inventory:switch_stack", n) player:get_meta():set_int("mcl_inventory:switch_stack", n)
end end
minetest.register_on_joinplayer(function (player) minetest.register_on_joinplayer(function(player)
if get_stack_size(player) == 0 then if get_stack_size(player) == 0 then
set_stack_size(player, 64) set_stack_size(player, 64)
end end
end) end)
---@param player mt.PlayerObjectRef
function mcl_inventory.set_creative_formspec(player) function mcl_inventory.set_creative_formspec(player)
local playername = player:get_player_name() local playername = player:get_player_name()
if not players[playername] then return end if not players[playername] then return end
local start_i = players[playername].start_i local start_i = players[playername].start_i
local pagenum = start_i / (9*5) + 1 local pagenum = start_i / (9 * 5) + 1
local name = players[playername].page local page = players[playername].page
local inv_size = players[playername].inv_size local inv_size = players[playername].inv_size
local filter = players[playername].filter local filter = players[playername].filter
local pagemax = math.max(1, math.floor((inv_size-1) / (9*5) + 1))
if not inv_size then
if page == "nix" then
local inv = minetest.get_inventory({ type = "detached", name = "creative_" .. playername })
inv_size = inv:get_size("main")
elseif page and page ~= "inv" then
inv_size = #(inventory_lists[page])
else
inv_size = 0
end
end
local pagemax = math.max(1, math.floor((inv_size - 1) / (9 * 5) + 1))
local name = "nix"
local main_list local main_list
local listrings = "listring[detached:creative_"..playername..";main]".. local listrings = table.concat({
"listring[current_player;main]".. "listring[detached:creative_" .. playername .. ";main]",
"listring[detached:trash;main]" "listring[current_player;main]",
"listring[detached:trash;main]",
})
if page then
name = page
if players[playername] then
players[playername].page = page
end
end
local inv_bg = "crafting_inventory_creative.png"
if name == "inv" then if name == "inv" then
inv_bg = "crafting_inventory_creative_survival.png"
-- Background images for armor slots (hide if occupied) -- Background images for armor slots (hide if occupied)
local armor_slot_imgs = "" local armor_slot_imgs = ""
local inv = player:get_inventory() local inv = player:get_inventory()
if inv:get_stack("armor", 2):is_empty() then if inv:get_stack("armor", 2):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[2.5,1.3;1,1;mcl_inventory_empty_armor_slot_helmet.png]" armor_slot_imgs = armor_slot_imgs .. "image[3.5,0.375;1,1;mcl_inventory_empty_armor_slot_helmet.png]"
end end
if inv:get_stack("armor", 3):is_empty() then if inv:get_stack("armor", 3):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[2.5,2.75;1,1;mcl_inventory_empty_armor_slot_chestplate.png]" armor_slot_imgs = armor_slot_imgs .. "image[3.5,2.125;1,1;mcl_inventory_empty_armor_slot_chestplate.png]"
end end
if inv:get_stack("armor", 4):is_empty() then if inv:get_stack("armor", 4):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[5.5,1.3;1,1;mcl_inventory_empty_armor_slot_leggings.png]" armor_slot_imgs = armor_slot_imgs .. "image[7.25,0.375;1,1;mcl_inventory_empty_armor_slot_leggings.png]"
end end
if inv:get_stack("armor", 5):is_empty() then if inv:get_stack("armor", 5):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[5.5,2.75;1,1;mcl_inventory_empty_armor_slot_boots.png]" armor_slot_imgs = armor_slot_imgs .. "image[7.25,2.125;1,1;mcl_inventory_empty_armor_slot_boots.png]"
end end
if inv:get_stack("offhand", 1):is_empty() then if inv:get_stack("offhand", 1):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[1.5,2.025;1,1;mcl_inventory_empty_armor_slot_shield.png]" armor_slot_imgs = armor_slot_imgs .. "image[2.25,1.25;1,1;mcl_inventory_empty_armor_slot_shield.png]"
end end
local stack_size = get_stack_size(player) local stack_size = get_stack_size(player)
-- Survival inventory slots -- Survival inventory slots
main_list = "list[current_player;main;0,3.75;9,3;9]" .. main_list = table.concat({
mcl_formspec.get_itemslot_bg(0, 3.75, 9, 3) .. mcl_formspec.get_itemslot_bg_v4(0.375, 3.375, 9, 3),
"list[current_player;main;0.375,3.375;9,3;9]",
-- Armor -- Armor
"list[current_player;armor;2.5,1.3;1,1;1]" .. mcl_formspec.get_itemslot_bg_v4(3.5, 0.375, 1, 1),
"list[current_player;armor;2.5,2.75;1,1;2]" .. mcl_formspec.get_itemslot_bg_v4(3.5, 2.125, 1, 1),
"list[current_player;armor;5.5,1.3;1,1;3]" .. mcl_formspec.get_itemslot_bg_v4(7.25, 0.375, 1, 1),
"list[current_player;armor;5.5,2.75;1,1;4]" .. mcl_formspec.get_itemslot_bg_v4(7.25, 2.125, 1, 1),
mcl_formspec.get_itemslot_bg(2.5, 1.3, 1, 1) .. "list[current_player;armor;3.5,0.375;1,1;1]",
mcl_formspec.get_itemslot_bg(2.5, 2.75, 1, 1) .. "list[current_player;armor;3.5,2.125;1,1;2]",
mcl_formspec.get_itemslot_bg(5.5, 1.3, 1, 1) .. "list[current_player;armor;7.25,0.375;1,1;3]",
mcl_formspec.get_itemslot_bg(5.5, 2.75, 1, 1) .. "list[current_player;armor;7.25,2.125;1,1;4]",
"list[current_player;offhand;1.5,2.025;1,1]" ..
mcl_formspec.get_itemslot_bg(1.5, 2.025, 1, 1) .. -- Offhand
armor_slot_imgs .. mcl_formspec.get_itemslot_bg_v4(2.25, 1.25, 1, 1),
"list[current_player;offhand;2.25,1.25;1,1]",
armor_slot_imgs,
-- Player preview -- Player preview
mcl_player.get_player_formspec_model(player, 3.9, 1.4, 1.2333, 2.4666, "") .. "image[4.75,0.33;2.25,2.83;mcl_inventory_background9.png;2]",
mcl_player.get_player_formspec_model(player, 4.75, 0.45, 2.25, 2.75, ""),
-- Crafting guide button -- Crafting guide button
"image_button[9,1;1,1;craftguide_book.png;__mcl_craftguide;]" .. "image_button[11.575,0.825;1.1,1.1;craftguide_book.png;__mcl_craftguide;]",
"tooltip[__mcl_craftguide;"..F(S("Recipe book")) .. "]" .. "tooltip[__mcl_craftguide;" .. F(S("Recipe book")) .. "]",
-- Help button -- Help button
"image_button[9,2;1,1;doc_button_icon_lores.png;__mcl_doc;]" .. "image_button[11.575,2.075;1.1,1.1;doc_button_icon_lores.png;__mcl_doc;]",
"tooltip[__mcl_doc;" .. F(S("Help")) .. "]" .. "tooltip[__mcl_doc;" .. F(S("Help")) .. "]",
-- Achievements button -- Advancements button
"image_button[9,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" .. "image_button[11.575,3.325;1.1,1.1;mcl_achievements_button.png;__mcl_achievements;]",
--"style_type[image_button;border=;bgimg=;bgimg_pressed=]" .. --"style_type[image_button;border=;bgimg=;bgimg_pressed=]",
"tooltip[__mcl_achievements;"..F(S("Advancements")) .. "]" .. "tooltip[__mcl_achievements;" .. F(S("Advancements")) .. "]",
-- Switch stack size button -- Switch stack size button
"image_button[9,4;1,1;default_apple.png;__switch_stack;]" .. "image_button[11.575,4.575;1.1,1.1;default_apple.png;__switch_stack;]",
"label[9.4,4.4;" .. F(C("#FFFFFF", stack_size ~= 1 and stack_size or "")) .. "]" .. "label[12.275,5.35;" .. F(C("#FFFFFF", tostring(stack_size ~= 1 and stack_size or ""))) .. "]",
"tooltip[__switch_stack;" .. F(S("Switch stack size")) .. "]" "tooltip[__switch_stack;" .. F(S("Switch stack size")) .. "]",
-- Skins button -- Skins button
if minetest.global_exists("mcl_skins") then "image_button[11.575,5.825;1.1,1.1;mcl_skins_button.png;__mcl_skins;]",
main_list = main_list .. "tooltip[__mcl_skins;" .. F(S("Select player skin")) .. "]",
"image_button[9,5;1,1;mcl_skins_button.png;__mcl_skins;]" .. })
"tooltip[__mcl_skins;"..F(S("Select player skin")) .. "]"
end
-- For shortcuts -- For shortcuts
listrings = listrings .. listrings = listrings ..
"listring[detached:"..playername.."_armor;armor]".. "listring[detached:" .. playername .. "_armor;armor]" ..
"listring[current_player;main]" "listring[current_player;main]"
else else
--local nb_lines = math.ceil(inv_size / 9)
-- Creative inventory slots -- Creative inventory slots
main_list = "list[detached:creative_"..playername..";main;0,1.75;9,5;"..tostring(start_i).."]".. main_list = table.concat({
mcl_formspec.get_itemslot_bg(0,1.75,9,5).. mcl_formspec.get_itemslot_bg_v4(0.375, 0.875, 9, 5),
-- Page buttons
"label[9.0,5.5;"..F(S("@1/@2", pagenum, pagemax)).."]".. -- Basic code to replace buttons by scrollbar
"image_button[9.0,6.0;0.7,0.7;crafting_creative_prev.png;creative_prev;]".. -- Require Minetest 5.8
"image_button[9.5,6.0;0.7,0.7;crafting_creative_next.png;creative_next;]" --
--"scroll_container[0.375,0.875;11.575,6;scroll;vertical;1.25]",
--"list[detached:creative_" .. playername .. ";main;0,0;9," .. nb_lines .. ";]",
--"scroll_container_end[]",
--"scrollbaroptions[min=0;max=" .. math.max(nb_lines - 5, 0) .. ";smallstep=1;largesteps=1;arrows=hide]",
--"scrollbar[11.75,0.825;0.75,6.1;vertical;scroll;0]",
"list[detached:creative_" .. playername .. ";main;0.375,0.875;9,5;" .. tostring(start_i) .. "]",
-- Page buttons
"label[11.65,4.33;" .. F(S("@1 / @2", pagenum, pagemax)) .. "]",
"image_button[11.575,4.58;1.1,1.1;crafting_creative_prev.png^[transformR270;creative_prev;]",
"image_button[11.575,5.83;1.1,1.1;crafting_creative_next.png^[transformR270;creative_next;]",
})
end end
local tab_icon = { ---@param current_tab string
blocks = "mcl_core:brick_block", ---@param this_tab string
deco = "mcl_flowers:peony", ---@return string
redstone = "mesecons:redstone",
rail = "mcl_minecarts:golden_rail",
misc = "mcl_buckets:bucket_lava",
nix = "mcl_compass:compass",
food = "mcl_core:apple",
tools = "mcl_core:axe_iron",
combat = "mcl_core:sword_gold",
mobs = "mobs_mc:cow",
brew = "mcl_potions:dragon_breath",
matr = "mcl_core:stick",
inv = "mcl_chests:chest",
}
local function tab(current_tab, this_tab) local function tab(current_tab, this_tab)
local bg_img local bg_img
if current_tab == this_tab then if current_tab == this_tab then
bg_img = "crafting_creative_active"..hoch[this_tab]..".png" bg_img = "crafting_creative_active" .. button_bg_postfix[this_tab] .. ".png"
else else
bg_img = "crafting_creative_inactive"..hoch[this_tab]..".png" bg_img = "crafting_creative_inactive" .. button_bg_postfix[this_tab] .. ".png"
end end
return return table.concat({
"style["..this_tab..";border=false;bgimg=;bgimg_pressed=]".. "style[" .. this_tab .. ";border=false;bgimg=;bgimg_pressed=;noclip=true]",
"item_image_button[" .. boffset[this_tab] ..";1,1;"..tab_icon[this_tab]..";"..this_tab..";]".. "image[" .. offset[this_tab] .. ";1.5,1.44;" .. bg_img .. "]",
"image[" .. offset[this_tab] .. ";1.5,1.44;" .. bg_img .. "]" "item_image_button[" .. boffset[this_tab] .. ";1,1;" .. tab_icon[this_tab] .. ";" .. this_tab .. ";]",
"tooltip[blocks;" .. F(filtername[this_tab]) .. "]"
})
end end
local caption = "" local caption = ""
if name ~= "inv" and filtername[name] then if name ~= "inv" and filtername[name] then
caption = "label[0,1.2;"..F(minetest.colorize("#313131", filtername[name])).."]" caption = "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, filtername[name])) .. "]"
end end
local formspec = "size[10,9.3]".. local formspec = table.concat({
"no_prepend[]".. "formspec_version[6]",
mcl_vars.gui_nonbg..mcl_vars.gui_bg_color.. "size[13,8.75]",
"background[-0.19,-0.25;10.5,9.87;"..inv_bg.."]"..
"label[-5,-5;"..name.."]".. "style_type[image;noclip=true]",
tab(name, "blocks") ..
"tooltip[blocks;"..F(filtername["blocks"]).."]".. -- Hotbar
tab(name, "deco") .. mcl_formspec.get_itemslot_bg_v4(0.375, 7.375, 9, 1),
"tooltip[deco;"..F(filtername["deco"]).."]".. "list[current_player;main;0.375,7.375;9,1;]",
tab(name, "redstone") ..
"tooltip[redstone;"..F(filtername["redstone"]).."]".. -- Trash
tab(name, "rail") .. mcl_formspec.get_itemslot_bg_v4(11.625, 7.375, 1, 1, nil, "crafting_creative_trash.png"),
"tooltip[rail;"..F(filtername["rail"]).."]".. "list[detached:trash;main;11.625,7.375;1,1;]",
tab(name, "misc") ..
"tooltip[misc;"..F(filtername["misc"]).."]".. main_list,
tab(name, "nix") ..
"tooltip[nix;"..F(filtername["nix"]).."]".. caption,
caption..
"list[current_player;main;0,7;9,1;]".. listrings,
mcl_formspec.get_itemslot_bg(0,7,9,1)..
main_list.. tab(name, "blocks"),
tab(name, "food") .. tab(name, "deco"),
"tooltip[food;"..F(filtername["food"]).."]".. tab(name, "redstone"),
tab(name, "tools") .. tab(name, "rail"),
"tooltip[tools;"..F(filtername["tools"]).."]".. tab(name, "misc"),
tab(name, "combat") .. tab(name, "nix"),
"tooltip[combat;"..F(filtername["combat"]).."]"..
tab(name, "mobs") .. tab(name, "food"),
"tooltip[mobs;"..F(filtername["mobs"]).."]".. tab(name, "tools"),
tab(name, "brew") .. tab(name, "combat"),
"tooltip[brew;"..F(filtername["brew"]).."]".. tab(name, "mobs"),
tab(name, "matr") .. tab(name, "brew"),
"tooltip[matr;"..F(filtername["matr"]).."]".. tab(name, "matr"),
tab(name, "inv") .. tab(name, "inv"),
"tooltip[inv;"..F(filtername["inv"]).."]".. })
"list[detached:trash;main;9,7;1,1;]"..
mcl_formspec.get_itemslot_bg(9,7,1,1)..
"image[9,7;1,1;crafting_creative_trash.png]"..
listrings
if name == "nix" then if name == "nix" then
formspec = formspec .. "field[5.3,1.34;4,0.75;search;;"..minetest.formspec_escape(filter).."]" if filter == nil then
formspec = formspec .. "field_close_on_enter[search;false]" filter = ""
end
formspec = formspec .. table.concat({
"field[5.325,0.15;6.1,0.6;search;;" .. minetest.formspec_escape(filter) .. "]",
"field_close_on_enter[search;false]",
"set_focus[search;true]",
})
end end
if pagenum then formspec = formspec .. "p"..tostring(pagenum) end if pagenum then formspec = formspec .. "p" .. tostring(pagenum) end
player:set_inventory_formspec(formspec) player:set_inventory_formspec(formspec)
end end
@ -500,50 +616,50 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.blocks then if fields.blocks then
if players[name].page == "blocks" then return end if players[name].page == "blocks" then return end
set_inv_page("blocks",player) set_inv_page("blocks", player)
page = "blocks" page = "blocks"
elseif fields.deco then elseif fields.deco then
if players[name].page == "deco" then return end if players[name].page == "deco" then return end
set_inv_page("deco",player) set_inv_page("deco", player)
page = "deco" page = "deco"
elseif fields.redstone then elseif fields.redstone then
if players[name].page == "redstone" then return end if players[name].page == "redstone" then return end
set_inv_page("redstone",player) set_inv_page("redstone", player)
page = "redstone" page = "redstone"
elseif fields.rail then elseif fields.rail then
if players[name].page == "rail" then return end if players[name].page == "rail" then return end
set_inv_page("rail",player) set_inv_page("rail", player)
page = "rail" page = "rail"
elseif fields.misc then elseif fields.misc then
if players[name].page == "misc" then return end if players[name].page == "misc" then return end
set_inv_page("misc",player) set_inv_page("misc", player)
page = "misc" page = "misc"
elseif fields.nix then elseif fields.nix then
set_inv_page("all",player) set_inv_page("all", player)
page = "nix" page = "nix"
elseif fields.food then elseif fields.food then
if players[name].page == "food" then return end if players[name].page == "food" then return end
set_inv_page("food",player) set_inv_page("food", player)
page = "food" page = "food"
elseif fields.tools then elseif fields.tools then
if players[name].page == "tools" then return end if players[name].page == "tools" then return end
set_inv_page("tools",player) set_inv_page("tools", player)
page = "tools" page = "tools"
elseif fields.combat then elseif fields.combat then
if players[name].page == "combat" then return end if players[name].page == "combat" then return end
set_inv_page("combat",player) set_inv_page("combat", player)
page = "combat" page = "combat"
elseif fields.mobs then elseif fields.mobs then
if players[name].page == "mobs" then return end if players[name].page == "mobs" then return end
set_inv_page("mobs",player) set_inv_page("mobs", player)
page = "mobs" page = "mobs"
elseif fields.brew then elseif fields.brew then
if players[name].page == "brew" then return end if players[name].page == "brew" then return end
set_inv_page("brew",player) set_inv_page("brew", player)
page = "brew" page = "brew"
elseif fields.matr then elseif fields.matr then
if players[name].page == "matr" then return end if players[name].page == "matr" then return end
set_inv_page("matr",player) set_inv_page("matr", player)
page = "matr" page = "matr"
elseif fields.inv then elseif fields.inv then
if players[name].page == "inv" then return end if players[name].page == "inv" then return end
@ -552,7 +668,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
set_inv_page("all", player) set_inv_page("all", player)
page = "nix" page = "nix"
elseif fields.search and not fields.creative_next and not fields.creative_prev then elseif fields.search and not fields.creative_next and not fields.creative_prev then
set_inv_search(string.lower(fields.search),player) set_inv_search(string.lower(fields.search), player)
page = "nix" page = "nix"
elseif fields.__switch_stack then elseif fields.__switch_stack then
local switch = 1 local switch = 1
@ -570,20 +686,20 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local start_i = players[name].start_i local start_i = players[name].start_i
if fields.creative_prev then if fields.creative_prev then
start_i = start_i - 9*5 start_i = start_i - 9 * 5
elseif fields.creative_next then elseif fields.creative_next then
start_i = start_i + 9*5 start_i = start_i + 9 * 5
else else
-- Reset scroll bar if not scrolled -- Reset scroll bar if not scrolled
start_i = 0 start_i = 0
end end
if start_i < 0 then if start_i < 0 then
start_i = start_i + 9*5 start_i = start_i + 9 * 5
end end
local inv_size local inv_size
if page == "nix" then if page == "nix" then
local inv = minetest.get_inventory({type="detached", name="creative_"..name}) local inv = minetest.get_inventory({ type = "detached", name = "creative_" .. name })
inv_size = inv:get_size("main") inv_size = inv:get_size("main")
elseif page and page ~= "inv" then elseif page and page ~= "inv" then
inv_size = #(inventory_lists[page]) inv_size = #(inventory_lists[page])
@ -593,7 +709,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
players[name].inv_size = inv_size players[name].inv_size = inv_size
if start_i >= inv_size then if start_i >= inv_size then
start_i = start_i - 9*5 start_i = start_i - 9 * 5
end end
if start_i < 0 or start_i >= inv_size then if start_i < 0 or start_i >= inv_size then
start_i = 0 start_i = 0
@ -609,11 +725,34 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
mcl_inventory.set_creative_formspec(player) mcl_inventory.set_creative_formspec(player)
end) end)
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
return placer and placer:is_player() and minetest.is_creative_enabled(placer:get_player_name()) return placer and placer:is_player() and minetest.is_creative_enabled(placer:get_player_name())
end) end)
if minetest.is_creative_enabled("") then
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
-- Place infinite nodes, except for shulker boxes
local group = minetest.get_item_group(itemstack:get_name(), "shulker_box")
return group == 0 or group == nil
end)
function minetest.handle_node_drops(pos, drops, digger)
if not digger or not digger:is_player() then
for _, item in ipairs(drops) do
minetest.add_item(pos, item)
end
end
local inv = digger:get_inventory()
if inv then
for _, item in ipairs(drops) do
if not inv:contains_item("main", item, true) then
inv:add_item("main", item)
end
end
end
end
end
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
-- Initialize variables and inventory -- Initialize variables and inventory
local name = player:get_player_name() local name = player:get_player_name()
@ -629,7 +768,8 @@ minetest.register_on_joinplayer(function(player)
end) end)
minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info) minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info)
if minetest.is_creative_enabled(player:get_player_name()) and get_stack_size(player) == 64 and action == "put" and inventory_info.listname == "main" then if minetest.is_creative_enabled(player:get_player_name()) and get_stack_size(player) == 64 and action == "put" and
inventory_info.listname == "main" then
local stack = inventory_info.stack local stack = inventory_info.stack
stack:set_count(stack:get_stack_max()) stack:set_count(stack:get_stack_max())
player:get_inventory():set_stack("main", inventory_info.index, stack) player:get_inventory():set_stack("main", inventory_info.index, stack)

View File

@ -1,13 +1,17 @@
local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape
mcl_inventory = {} mcl_inventory = {}
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/creative.lua")
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/survival.lua")
--local mod_player = minetest.get_modpath("mcl_player") --local mod_player = minetest.get_modpath("mcl_player")
--local mod_craftguide = minetest.get_modpath("mcl_craftguide") --local mod_craftguide = minetest.get_modpath("mcl_craftguide")
-- Returns a single itemstack in the given inventory to the main inventory, or drop it when there's no space left ---Returns a single itemstack in the given inventory to the main inventory, or drop it when there's no space left.
function return_item(itemstack, dropper, pos, inv) ---@param itemstack mt.ItemStack
---@param dropper mt.ObjectRef
---@param pos mt.Vector
---@param inv mt.InvRef
local function return_item(itemstack, dropper, pos, inv)
if dropper:is_player() then if dropper:is_player() then
-- Return to main inventory -- Return to main inventory
if inv:room_for_item("main", itemstack) then if inv:room_for_item("main", itemstack) then
@ -15,14 +19,14 @@ function return_item(itemstack, dropper, pos, inv)
else else
-- Drop item on the ground -- Drop item on the ground
local v = dropper:get_look_dir() local v = dropper:get_look_dir()
local p = {x=pos.x, y=pos.y+1.2, z=pos.z} local p = vector.offset(pos, 0, 1.2, 0)
p.x = p.x+(math.random(1,3)*0.2) p.x = p.x + (math.random(1, 3) * 0.2)
p.z = p.z+(math.random(1,3)*0.2) p.z = p.z + (math.random(1, 3) * 0.2)
local obj = minetest.add_item(p, itemstack) local obj = minetest.add_item(p, itemstack)
if obj then if obj then
v.x = v.x*4 v.x = v.x * 4
v.y = v.y*4 + 2 v.y = v.y * 4 + 2
v.z = v.z*4 v.z = v.z * 4
obj:set_velocity(v) obj:set_velocity(v)
obj:get_luaentity()._insta_collect = false obj:get_luaentity()._insta_collect = false
end end
@ -34,111 +38,53 @@ function return_item(itemstack, dropper, pos, inv)
return itemstack return itemstack
end end
-- Return items in the given inventory list (name) to the main inventory, or drop them if there is no space left ---Return items in the given inventory list (name) to the main inventory, or drop them if there is no space left.
function return_fields(player, name) ---@param player mt.PlayerObjectRef
---@param name string
local function return_fields(player, name)
local inv = player:get_inventory() local inv = player:get_inventory()
local list = inv:get_list(name) local list = inv:get_list(name)
if not list then return end if not list then return end
for i,stack in ipairs(list) do for i, stack in ipairs(list) do
return_item(stack, player, player:get_pos(), inv) return_item(stack, player, player:get_pos(), inv)
stack:clear() stack:clear()
inv:set_stack(name, i, stack) inv:set_stack(name, i, stack)
end end
end end
local function set_inventory(player) ---@param player mt.PlayerObjectRef
---@param armor_change_only? boolean
local function set_inventory(player, armor_change_only)
if minetest.is_creative_enabled(player:get_player_name()) then if minetest.is_creative_enabled(player:get_player_name()) then
mcl_inventory.set_creative_formspec(player) if armor_change_only then
-- Stay on survival inventory plage if only the armor has been changed
mcl_inventory.set_creative_formspec(player, 0, 0, nil, nil, "inv")
else
mcl_inventory.set_creative_formspec(player, 0, 1)
end
return return
end end
local inv = player:get_inventory()
inv:set_width("craft", 2)
inv:set_size("craft", 4)
local armor_slots = {"helmet", "chestplate", "leggings", "boots"} player:set_inventory_formspec(mcl_inventory.build_survival_formspec(player))
local armor_slot_imgs = ""
for a=1,4 do
if inv:get_stack("armor", a+1):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[0,"..(a-1)..";1,1;mcl_inventory_empty_armor_slot_"..armor_slots[a]..".png]"
end
end
if inv:get_stack("offhand", 1):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[3,2;1,1;mcl_inventory_empty_armor_slot_shield.png]"
end
local form = "size[9,8.75]" ..
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png]" ..
mcl_player.get_player_formspec_model(player, 1.0, 0.0, 2.25, 4.5, "") ..
-- Armor
"list[current_player;armor;0,0;1,1;1]" ..
"list[current_player;armor;0,1;1,1;2]" ..
"list[current_player;armor;0,2;1,1;3]" ..
"list[current_player;armor;0,3;1,1;4]" ..
mcl_formspec.get_itemslot_bg(0,0,1,1) ..
mcl_formspec.get_itemslot_bg(0,1,1,1) ..
mcl_formspec.get_itemslot_bg(0,2,1,1) ..
mcl_formspec.get_itemslot_bg(0,3,1,1) ..
"list[current_player;offhand;3,2;1,1]" ..
mcl_formspec.get_itemslot_bg(3,2,1,1) ..
armor_slot_imgs ..
-- Craft and inventory
"label[0,4;"..F(minetest.colorize("#313131", S("Inventory"))) .. "]" ..
"list[current_player;main;0,4.5;9,3;9]" ..
"list[current_player;main;0,7.74;9,1;]" ..
"label[4,0.5;"..F(minetest.colorize("#313131", S("Crafting"))) .. "]" ..
"list[current_player;craft;4,1;2,2]" ..
"list[current_player;craftpreview;7,1.5;1,1;]" ..
mcl_formspec.get_itemslot_bg(0, 4.5, 9, 3) ..
mcl_formspec.get_itemslot_bg(0, 7.74, 9, 1) ..
mcl_formspec.get_itemslot_bg(4, 1,2, 2) ..
mcl_formspec.get_itemslot_bg(7, 1.5, 1, 1) ..
-- Crafting guide button
"image_button[4.5,3;1,1;craftguide_book.png;__mcl_craftguide;]" ..
"tooltip[__mcl_craftguide;"..F(S("Recipe book")) .. "]" ..
-- Help button
"image_button[8,3;1,1;doc_button_icon_lores.png;__mcl_doc;]" ..
"tooltip[__mcl_doc;" .. F(S("Help")) .. "]"
-- Skins button
if minetest.global_exists("mcl_skins") then
form = form ..
"image_button[3,3;1,1;mcl_skins_button.png;__mcl_skins;]" ..
"tooltip[__mcl_skins;" .. F(S("Select player skin")) .. "]"
end
form = form ..
-- Achievements button
"image_button[7,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" ..
"tooltip[__mcl_achievements;" .. F(S("Advancements")) .. "]" ..
-- For shortcuts
"listring[current_player;main]" ..
"listring[current_player;armor]" ..
"listring[current_player;main]" ..
"listring[current_player;craft]" ..
"listring[current_player;main]"
player:set_inventory_formspec(form)
end end
-- Drop items in craft grid and reset inventory on closing -- Drop items in craft grid and reset inventory on closing
minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.quit then if fields.quit then
return_fields(player,"craft") return_fields(player, "craft")
return_fields(player,"enchanting_lapis") return_fields(player, "enchanting_lapis")
return_fields(player,"enchanting_item") return_fields(player, "enchanting_item")
if not minetest.is_creative_enabled(player:get_player_name()) and (formname == "" or formname == "main") then if not minetest.is_creative_enabled(player:get_player_name()) and (formname == "" or formname == "main") then
set_inventory(player) set_inventory(player)
end end
end end
end) end)
mcl_inventory.update_inventory_formspec = set_inventory
function mcl_inventory.update_inventory_formspec(player)
set_inventory(player)
end
-- Drop crafting grid items on leaving -- Drop crafting grid items on leaving
minetest.register_on_leaveplayer(function(player) minetest.register_on_leaveplayer(function(player)
@ -150,6 +96,7 @@ end)
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
--init inventory --init inventory
local inv = player:get_inventory() local inv = player:get_inventory()
inv:set_width("main", 9) inv:set_width("main", 9)
inv:set_size("main", 36) inv:set_size("main", 36)
inv:set_size("offhand", 1) inv:set_size("offhand", 1)
@ -174,73 +121,18 @@ minetest.register_on_joinplayer(function(player)
return_fields(player, "enchanting_lapis") return_fields(player, "enchanting_lapis")
end) end)
dofile(minetest.get_modpath(minetest.get_current_modname()).."/creative.lua") ---@param player mt.PlayerObjectRef
function mcl_inventory.update_inventory(player)
local player_gamemode = mcl_gamemode.get_gamemode(player)
if player_gamemode == "creative" then
mcl_inventory.set_creative_formspec(player)
elseif player_gamemode == "survival" then
player:set_inventory_formspec(mcl_inventory.build_survival_formspec(player))
end
end
mcl_gamemode.register_on_gamemode_change(function(player, old_gamemode, new_gamemode)
set_inventory(player)
end)
mcl_player.register_on_visual_change(mcl_inventory.update_inventory_formspec) mcl_player.register_on_visual_change(mcl_inventory.update_inventory_formspec)
local mt_is_creative_enabled = minetest.is_creative_enabled
function minetest.is_creative_enabled(name)
if mt_is_creative_enabled(name) then return true end
if not name then return false end
local p = minetest.get_player_by_name(name)
if p then
return p:get_meta():get_string("gamemode") == "creative"
end
return false
end
local function in_table(n,h)
for k,v in pairs(h) do
if v == n then return true end
end
return false
end
local gamemodes = {
"survival",
"creative"
}
function mcl_inventory.player_set_gamemode(p,g)
local m = p:get_meta()
m:set_string("gamemode",g)
if g == "survival" then
mcl_experience.setup_hud(p)
mcl_experience.update(p)
elseif g == "creative" then
mcl_experience.remove_hud(p)
end
mcl_meshhand.update_player(p)
set_inventory(p)
end
minetest.register_chatcommand("gamemode",{
params = S("[<gamemode>] [<player>]"),
description = S("Change gamemode (survival/creative) for yourself or player"),
privs = { server = true },
func = function(n,param)
-- Full input validation ( just for @erlehmann <3 )
local p
local args = param:split(" ")
if args[2] ~= nil then
p = minetest.get_player_by_name(args[2])
n = args[2]
else
p = minetest.get_player_by_name(n)
end
if not p then
return false, S("Player not online")
end
if args[1] ~= nil and not in_table(args[1],gamemodes) then
return false, S("Gamemode " .. args[1] .. " does not exist.")
elseif args[1] ~= nil then
mcl_inventory.player_set_gamemode(p,args[1])
end
--Result message - show effective game mode
local gm = p:get_meta():get_string("gamemode")
if gm == "" then gm = gamemodes[1] end
return true, S("Gamemode for player ")..n..S(": "..gm)
end
})

View File

@ -1,21 +1,21 @@
# textdomain: mcl_inventory # textdomain: mcl_inventory
Recipe book=Книга рецептов Recipe book=Книга рецептов
Help=Помощь Help=Справка
Select player skin=Выбор скина Select player skin=Выбор внешности
Achievements=Достижения Achievements=Достижения
Building Blocks=Строительные блоки Building Blocks=Строительные блоки
Decoration Blocks=Декоративные блоки Decoration Blocks=Отделочные блоки
Redstone=Редстоун (красный камень) Redstone=Красный камень
Transportation=Транспорт Transportation=Транспорт
Brewing=Зелья Brewing=Зелья
Miscellaneous=Прочее Miscellaneous=Прочее
Search Items=Искать предметы Search Items=Поиск предметов
Foodstuffs=Продовольствие Foodstuffs=Продовольствие
Tools=Инструменты Tools=Инструменты
Combat=Битва Combat=Битва
Mobs=Мобы Mobs=Сущности
Materials=Материалы Materials=Материалы
Survival Inventory=Инвентарь выживания Survival Inventory=Инвентарь выживания
Crafting=Крафтинг (изготовление) Crafting=Создание
Inventory=Инвентарь Inventory=Инвентарь
@1/@2=@1/@2 @1/@2=@1/@2

View File

@ -1,5 +1,5 @@
name = mcl_inventory name = mcl_inventory
author = BlockMen author = BlockMen
description = Adds the player inventory and creative inventory. description = Adds the player inventory and creative inventory.
depends = mcl_init, mcl_formspec, mcl_enchanting, mcl_player depends = mcl_init, mcl_formspec, mcl_enchanting, mcl_gamemode
optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player

View File

@ -0,0 +1,224 @@
---@diagnostic disable need-check-nil
local table = table
local ipairs = ipairs
local S = minetest.get_translator("mcl_inventory")
local F = minetest.formspec_escape
---@type {id: string, description: string, item_icon: string, build: (fun(player: ObjectRef): string), handle: fun(player: ObjectRef, fields: table), access: (fun(player): boolean), show_inventory: boolean}[]
mcl_inventory.registered_survival_inventory_tabs = {}
---@param def {id: string, description: string, item_icon: string, build: (fun(player: ObjectRef): string), handle: fun(player: ObjectRef, fields: table), access: (fun(player): boolean), show_inventory: boolean}
function mcl_inventory.register_survival_inventory_tab(def)
if #mcl_inventory.registered_survival_inventory_tabs == 7 then
error("Too much tabs registered!")
end
assert(def.id)
assert(def.description)
assert(def.item_icon)
assert(def.build)
assert(def.handle)
for _, d in ipairs(mcl_inventory.registered_survival_inventory_tabs) do
assert(d.id ~= def.id, "Another tab exists with the same name!")
end
if not def.access then
function def.access(player)
return true
end
end
if def.show_inventory == nil then
def.show_inventory = true
end
table.insert(mcl_inventory.registered_survival_inventory_tabs, def)
end
local player_current_tab = {}
minetest.register_on_joinplayer(function(player, last_login)
player_current_tab[player] = "main"
end)
minetest.register_on_leaveplayer(function(player, timed_out)
player_current_tab[player] = nil
end)
---@param player ObjectRef
---@param content string
---@param inventory boolean
---@param tabname string
local function build_page(player, content, inventory, tabname)
local tab_buttons = "style_type[image;noclip=true]"
if #mcl_inventory.registered_survival_inventory_tabs ~= 1 then
for i, d in ipairs(mcl_inventory.registered_survival_inventory_tabs) do
local btn_name = "tab_" .. d.id
tab_buttons = tab_buttons .. table.concat({
"style[" .. btn_name .. ";border=false;bgimg=;bgimg_pressed=;noclip=true]",
"image[" ..
(0.2 + (i - 1) * 1.6) ..
",-1.34;1.5,1.44;" .. (tabname == d.id and "crafting_creative_active.png" or "crafting_creative_inactive.png") ..
"]",
"item_image_button[" .. (0.44 + (i - 1) * 1.6) .. ",-1.1;1,1;" .. d.item_icon .. ";" .. btn_name .. ";]",
"tooltip[" .. btn_name .. ";" .. F(d.description) .. "]"
})
end
end
return table.concat({
"formspec_version[6]",
"size[11.75,10.9]",
inventory and table.concat({
--Main inventory
mcl_formspec.get_itemslot_bg_v4(0.375, 5.575, 9, 3),
"list[current_player;main;0.375,5.575;9,3;9]",
--Hotbar
mcl_formspec.get_itemslot_bg_v4(0.375, 9.525, 9, 1),
"list[current_player;main;0.375,9.525;9,1;]"
}) or "",
content,
tab_buttons,
})
end
local main_page_static = table.concat({
--Armor slots
mcl_formspec.get_itemslot_bg_v4(0.375, 0.375, 1, 4),
"list[current_player;armor;0.375,0.375;1,1;1]",
"list[current_player;armor;0.375,1.625;1,1;2]",
"list[current_player;armor;0.375,2.875;1,1;3]",
"list[current_player;armor;0.375,4.125;1,1;4]",
--Player model background
"image[1.57,0.343;3.62,4.85;mcl_inventory_background9.png;2]",
--Offhand
mcl_formspec.get_itemslot_bg_v4(5.375, 4.125, 1, 1),
"list[current_player;offhand;5.375,4.125;1,1]",
--Craft grid
"label[6.61,0.5;" .. F(minetest.colorize(mcl_formspec.label_color, S("Crafting"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(6.625, 0.875, 2, 2),
"list[current_player;craft;6.625,0.875;2,2]",
"image[9.125,1.5;1,1;crafting_formspec_arrow.png]",
mcl_formspec.get_itemslot_bg_v4(10.375, 1.5, 1, 1),
"list[current_player;craftpreview;10.375,1.5;1,1;]",
--Crafting guide button
"image_button[6.575,4.075;1.1,1.1;craftguide_book.png;__mcl_craftguide;]",
"tooltip[__mcl_craftguide;" .. F(S("Recipe book")) .. "]",
--Help button
"image_button[7.825,4.075;1.1,1.1;doc_button_icon_lores.png;__mcl_doc;]",
"tooltip[__mcl_doc;" .. F(S("Help")) .. "]",
--Skins button
"image_button[9.075,4.075;1.1,1.1;mcl_skins_button.png;__mcl_skins;]",
"tooltip[__mcl_skins;" .. F(S("Select player skin")) .. "]",
--Achievements button
"image_button[10.325,4.075;1.1,1.1;mcl_achievements_button.png;__mcl_achievements;]",
"tooltip[__mcl_achievements;" .. F(S("Achievements")) .. "]",
--Listring
"listring[current_player;main]",
"listring[current_player;armor]",
"listring[current_player;main]",
"listring[current_player;craft]",
"listring[current_player;main]",
})
mcl_inventory.register_survival_inventory_tab({
id = "main",
description = "Main Inventory",
item_icon = "mcl_crafting_table:crafting_table",
show_inventory = true,
build = function(player)
local inv = player:get_inventory()
local armor_slots = { "helmet", "chestplate", "leggings", "boots" }
local armor_slot_imgs = ""
for a = 1, 4 do
if inv:get_stack("armor", a + 1):is_empty() then
armor_slot_imgs = armor_slot_imgs ..
"image[0.375," .. (0.375 + (a - 1) * 1.25) .. ";1,1;mcl_inventory_empty_armor_slot_" .. armor_slots[a] .. ".png]"
end
end
if inv:get_stack("offhand", 1):is_empty() then
armor_slot_imgs = armor_slot_imgs .. "image[5.375,4.125;1,1;mcl_inventory_empty_armor_slot_shield.png]"
end
return main_page_static .. armor_slot_imgs .. mcl_player.get_player_formspec_model(player, 1.57, 0.4, 3.62, 4.85, "")
end,
handle = function() end,
})
--[[
mcl_inventory.register_survival_inventory_tab({
id = "test",
description = "Test",
item_icon = "mcl_core:stone",
show_inventory = true,
build = function(player)
return "label[1,1;Hello hello]button[2,2;2,2;Hello;hey]"
end,
handle = function(player, fields)
print(dump(fields))
end,
})]]
---@param player ObjectRef
function mcl_inventory.build_survival_formspec(player)
local inv = player:get_inventory()
inv:set_width("craft", 2)
inv:set_size("craft", 4)
local tab = player_current_tab[player]
local tab_def = nil
for _, d in ipairs(mcl_inventory.registered_survival_inventory_tabs) do
if tab == d.id then
tab_def = d
break
end
end
local form = build_page(player, tab_def.build(player), tab_def.show_inventory, tab)
return form
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "" and #mcl_inventory.registered_survival_inventory_tabs ~= 1 and
mcl_gamemode.get_gamemode(player) == "survival" then
for _, d in ipairs(mcl_inventory.registered_survival_inventory_tabs) do
if fields["tab_" .. d.id] and d.access(player) then
player_current_tab[player] = d.id
mcl_inventory.update_inventory(player)
return
end
end
for _, d in ipairs(mcl_inventory.registered_survival_inventory_tabs) do
if player_current_tab[player] == d.id and d.access(player) then
d.handle(player, fields)
return
end
end
end
end)

View File

@ -8,23 +8,36 @@ All node definitions share a lot of code, so this is the reason why there
are so many weird tables below. are so many weird tables below.
]] ]]
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local F = minetest.formspec_escape
-- For after_place_node local dispenser_formspec = table.concat({
"formspec_version[4]",
"size[11.75,10.425]",
"label[4.125,0.375;" .. F(C(mcl_formspec.label_color, S("Dispenser"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(4.125, 0.75, 3, 3),
"list[context;main;4.125,0.75;3,3;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
"listring[context;main]",
"listring[current_player;main]",
})
---For after_place_node
---@param pos Vector
local function setup_dispenser(pos) local function setup_dispenser(pos)
-- Set formspec and inventory -- Set formspec and inventory
local form = "size[9,8.75]"..
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
"list[current_player;main;0,4.5;9,3;9]"..
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
"list[current_player;main;0,7.74;9,1;]"..
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dispenser"))).."]"..
"list[context;main;3,0.5;3,3;]"..
mcl_formspec.get_itemslot_bg(3,0.5,3,3)..
"listring[context;main]"..
"listring[current_player;main]"
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", form) meta:set_string("formspec", dispenser_formspec)
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main", 9) inv:set_size("main", 9)
end end
@ -38,9 +51,9 @@ local function orientate_dispenser(pos, placer)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
if pitch > 55 then if pitch > 55 then
minetest.swap_node(pos, {name="mcl_dispensers:dispenser_up", param2 = node.param2}) minetest.swap_node(pos, { name = "mcl_dispensers:dispenser_up", param2 = node.param2 })
elseif pitch < -55 then elseif pitch < -55 then
minetest.swap_node(pos, {name="mcl_dispensers:dispenser_down", param2 = node.param2}) minetest.swap_node(pos, { name = "mcl_dispensers:dispenser_down", param2 = node.param2 })
end end
end end
@ -85,11 +98,10 @@ local dispenserdef = {
local meta2 = meta:to_table() local meta2 = meta:to_table()
meta:from_table(oldmetadata) meta:from_table(oldmetadata)
local inv = meta:get_inventory() local inv = meta:get_inventory()
for i=1, inv:get_size("main") do for i = 1, inv:get_size("main") do
local stack = inv:get_stack("main", i) local stack = inv:get_stack("main", i)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} minetest.add_item(vector.offset(pos, math.random(0, 10) / 10 - 0.5, 0, math.random(0, 10) / 10 - 0.5), stack)
minetest.add_item(p, stack)
end end
end end
meta:from_table(meta2) meta:from_table(meta2)
@ -107,19 +119,19 @@ local dispenserdef = {
dropdir = vector.multiply(minetest.facedir_to_dir(node.param2), -1) dropdir = vector.multiply(minetest.facedir_to_dir(node.param2), -1)
droppos = vector.add(pos, dropdir) droppos = vector.add(pos, dropdir)
elseif node.name == "mcl_dispensers:dispenser_up" then elseif node.name == "mcl_dispensers:dispenser_up" then
dropdir = {x=0, y=1, z=0} dropdir = vector.new(0, 1, 0)
droppos = {x=pos.x, y=pos.y+1, z=pos.z} droppos = vector.offset(pos, 0, 1, 0)
elseif node.name == "mcl_dispensers:dispenser_down" then elseif node.name == "mcl_dispensers:dispenser_down" then
dropdir = {x=0, y=-1, z=0} dropdir = vector.new(0, -1, 0)
droppos = {x=pos.x, y=pos.y-1, z=pos.z} droppos = vector.offset(pos, 0, -1, 0)
end end
local dropnode = minetest.get_node(droppos) local dropnode = minetest.get_node(droppos)
local dropnodedef = minetest.registered_nodes[dropnode.name] local dropnodedef = minetest.registered_nodes[dropnode.name]
local stacks = {} local stacks = {}
for i=1,inv:get_size("main") do for i = 1, inv:get_size("main") do
local stack = inv:get_stack("main", i) local stack = inv:get_stack("main", i)
if not stack:is_empty() then if not stack:is_empty() then
table.insert(stacks, {stack = stack, stackpos = i}) table.insert(stacks, { stack = stack, stackpos = i })
end end
end end
if #stacks >= 1 then if #stacks >= 1 then
@ -143,9 +155,10 @@ local dispenserdef = {
-- Armor, mob heads and pumpkins -- Armor, mob heads and pumpkins
if igroups.armor then if igroups.armor then
local droppos_below = {x = droppos.x, y = droppos.y - 1, z = droppos.z} local droppos_below = vector.offset(droppos, 0, -1, 0)
for _, objs in ipairs({minetest.get_objects_inside_radius(droppos, 1), minetest.get_objects_inside_radius(droppos_below, 1)}) do for _, objs in ipairs({ minetest.get_objects_inside_radius(droppos, 1),
minetest.get_objects_inside_radius(droppos_below, 1) }) do
for _, obj in ipairs(objs) do for _, obj in ipairs(objs) do
stack = mcl_armor.equip(stack, obj) stack = mcl_armor.equip(stack, obj)
if stack:is_empty() then if stack:is_empty() then
@ -157,11 +170,11 @@ local dispenserdef = {
end end
end end
-- Place head or pumpkin as node, if equipping it as armor has failed -- Place head or pumpkin as node, if equipping it as armor has failed
if not stack:is_empty() then if not stack:is_empty() then
if igroups.head or iname == "mcl_farming:pumpkin_face" then if igroups.head or iname == "mcl_farming:pumpkin_face" then
if dropnodedef.buildable_to then if dropnodedef.buildable_to then
minetest.set_node(droppos, {name = iname, param2 = node.param2}) minetest.set_node(droppos, { name = iname, param2 = node.param2 })
stack:take_item() stack:take_item()
end end
end end
@ -169,7 +182,7 @@ local dispenserdef = {
inv:set_stack("main", stack_id, stack) inv:set_stack("main", stack_id, stack)
-- Use shears on sheeps -- Use shears on sheeps
elseif igroups.shears then elseif igroups.shears then
for _, obj in pairs(minetest.get_objects_inside_radius(droppos, 1)) do for _, obj in pairs(minetest.get_objects_inside_radius(droppos, 1)) do
local entity = obj:get_luaentity() local entity = obj:get_luaentity()
@ -178,7 +191,9 @@ local dispenserdef = {
local pos = obj:get_pos() local pos = obj:get_pos()
local used, texture = false local used, texture = false
if entname == "mobs_mc:sheep" then if entname == "mobs_mc:sheep" then
minetest.add_item(pos, entity.drops[2].name .. " " .. math.random(1, 3)) if entity.drops[2] then
minetest.add_item(pos, entity.drops[2].name .. " " .. math.random(1, 3))
end
if not entity.color then if not entity.color then
entity.color = "unicolor_white" entity.color = "unicolor_white"
end end
@ -218,7 +233,7 @@ local dispenserdef = {
end end
end end
-- Spawn Egg -- Spawn Egg
elseif igroups.spawn_egg then elseif igroups.spawn_egg then
-- Spawn mob -- Spawn mob
if not dropnodedef.walkable then if not dropnodedef.walkable then
@ -229,7 +244,7 @@ local dispenserdef = {
inv:set_stack("main", stack_id, stack) inv:set_stack("main", stack_id, stack)
end end
-- Generalized dispension -- Generalized dispension
elseif (not dropnodedef.walkable or stackdef._dispense_into_walkable) then elseif (not dropnodedef.walkable or stackdef._dispense_into_walkable) then
--[[ _on_dispense(stack, pos, droppos, dropnode, dropdir) --[[ _on_dispense(stack, pos, droppos, dropnode, dropdir)
* stack: Itemstack which is dispense * stack: Itemstack which is dispense
@ -261,7 +276,7 @@ local dispenserdef = {
local item_entity = minetest.add_item(droppos, dropitem) local item_entity = minetest.add_item(droppos, dropitem)
local drop_vel = vector.subtract(droppos, pos) local drop_vel = vector.subtract(droppos, pos)
local speed = 3 local speed = 3
item_entity:set_velocity(vector.multiply(drop_vel,speed)) item_entity:set_velocity(vector.multiply(drop_vel, speed))
end end
else else
stack:take_item() stack:take_item()
@ -278,7 +293,7 @@ local dispenserdef = {
local item_entity = minetest.add_item(droppos, dropitem) local item_entity = minetest.add_item(droppos, dropitem)
local drop_vel = vector.subtract(droppos, pos) local drop_vel = vector.subtract(droppos, pos)
local speed = 3 local speed = 3
item_entity:set_velocity(vector.multiply(drop_vel,speed)) item_entity:set_velocity(vector.multiply(drop_vel, speed))
stack:take_item() stack:take_item()
inv:set_stack("main", stack_id, stack) inv:set_stack("main", stack_id, stack)
end end
@ -297,27 +312,28 @@ local dispenserdef = {
local horizontal_def = table.copy(dispenserdef) local horizontal_def = table.copy(dispenserdef)
horizontal_def.description = S("Dispenser") horizontal_def.description = S("Dispenser")
horizontal_def._tt_help = S("9 inventory slots").."\n"..S("Launches item when powered by redstone power") horizontal_def._tt_help = S("9 inventory slots") .. "\n" .. S("Launches item when powered by redstone power")
horizontal_def._doc_items_longdesc = S("A dispenser is a block which acts as a redstone component which, when powered with redstone power, dispenses an item. It has a container with 9 inventory slots.") horizontal_def._doc_items_longdesc = S("A dispenser is a block which acts as a redstone component which, when powered with redstone power, dispenses an item. It has a container with 9 inventory slots.")
horizontal_def._doc_items_usagehelp = S("Place the dispenser in one of 6 possible directions. The “hole” is where items will fly out of the dispenser. Use the dispenser to access its inventory. Insert the items you wish to dispense. Supply the dispenser with redstone energy once to dispense a random item.").."\n\n".. horizontal_def._doc_items_usagehelp = S("Place the dispenser in one of 6 possible directions. The “hole” is where items will fly out of the dispenser. Use the dispenser to access its inventory. Insert the items you wish to dispense. Supply the dispenser with redstone energy once to dispense a random item.")
.. "\n\n" ..
S("The dispenser will do different things, depending on the dispensed item:").."\n\n".. S("The dispenser will do different things, depending on the dispensed item:") .. "\n\n" ..
S("• Arrows: Are launched").."\n".. S("• Arrows: Are launched") .. "\n" ..
S("• Eggs and snowballs: Are thrown").."\n".. S("• Eggs and snowballs: Are thrown") .. "\n" ..
S("• Fire charges: Are fired in a straight line").."\n".. S("• Fire charges: Are fired in a straight line") .. "\n" ..
S("• Armor: Will be equipped to players and armor stands").."\n".. S("• Armor: Will be equipped to players and armor stands") .. "\n" ..
S("• Boats: Are placed on water or are dropped").."\n".. S("• Boats: Are placed on water or are dropped") .. "\n" ..
S("• Minecart: Are placed on rails or are dropped").."\n".. S("• Minecart: Are placed on rails or are dropped") .. "\n" ..
S("• Bone meal: Is applied on the block it is facing").."\n".. S("• Bone meal: Is applied on the block it is facing") .. "\n" ..
S("• Empty buckets: Are used to collect a liquid source").."\n".. S("• Empty buckets: Are used to collect a liquid source") .. "\n" ..
S("• Filled buckets: Are used to place a liquid source").."\n".. S("• Filled buckets: Are used to place a liquid source") .. "\n" ..
S("• Heads, pumpkins: Equipped to players and armor stands, or placed as a block").."\n".. S("• Heads, pumpkins: Equipped to players and armor stands, or placed as a block") .. "\n" ..
S("• Shulker boxes: Are placed as a block").."\n".. S("• Shulker boxes: Are placed as a block") .. "\n" ..
S("• TNT: Is placed and ignited").."\n".. S("• TNT: Is placed and ignited") .. "\n" ..
S("• Flint and steel: Is used to ignite a fire in air and to ignite TNT").."\n".. S("• Flint and steel: Is used to ignite a fire in air and to ignite TNT") .. "\n" ..
S("• Spawn eggs: Will summon the mob they contain").."\n".. S("• Spawn eggs: Will summon the mob they contain") .. "\n" ..
S("• Other items: Are simply dropped") S("• Other items: Are simply dropped")
function horizontal_def.after_place_node(pos, placer, itemstack, pointed_thing) function horizontal_def.after_place_node(pos, placer, itemstack, pointed_thing)
setup_dispenser(pos) setup_dispenser(pos)
@ -330,7 +346,7 @@ horizontal_def.tiles = {
"default_furnace_side.png", "mcl_dispensers_dispenser_front_horizontal.png" "default_furnace_side.png", "mcl_dispensers_dispenser_front_horizontal.png"
} }
horizontal_def.paramtype2 = "facedir" horizontal_def.paramtype2 = "facedir"
horizontal_def.groups = {pickaxey=1, container=2, material_stone=1} horizontal_def.groups = { pickaxey = 1, container = 2, material_stone = 1 }
minetest.register_node("mcl_dispensers:dispenser", horizontal_def) minetest.register_node("mcl_dispensers:dispenser", horizontal_def)
@ -343,7 +359,7 @@ down_def.tiles = {
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png" "default_furnace_side.png", "default_furnace_side.png"
} }
down_def.groups = {pickaxey=1, container=2,not_in_creative_inventory=1, material_stone=1} down_def.groups = { pickaxey = 1, container = 2, not_in_creative_inventory = 1, material_stone = 1 }
down_def._doc_items_create_entry = false down_def._doc_items_create_entry = false
down_def.drop = "mcl_dispensers:dispenser" down_def.drop = "mcl_dispensers:dispenser"
minetest.register_node("mcl_dispensers:dispenser_down", down_def) minetest.register_node("mcl_dispensers:dispenser_down", down_def)
@ -363,9 +379,9 @@ minetest.register_node("mcl_dispensers:dispenser_up", up_def)
minetest.register_craft({ minetest.register_craft({
output = "mcl_dispensers:dispenser", output = "mcl_dispensers:dispenser",
recipe = { recipe = {
{"mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble",}, { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble", },
{"mcl_core:cobble", "mcl_bows:bow", "mcl_core:cobble",}, { "mcl_core:cobble", "mcl_bows:bow", "mcl_core:cobble", },
{"mcl_core:cobble", "mesecons:redstone", "mcl_core:cobble",}, { "mcl_core:cobble", "mesecons:redstone", "mcl_core:cobble", },
} }
}) })
@ -382,6 +398,6 @@ minetest.register_lbm({
nodenames = { "mcl_dispensers:dispenser", "mcl_dispensers:dispenser_down", "mcl_dispensers:dispenser_up" }, nodenames = { "mcl_dispensers:dispenser", "mcl_dispensers:dispenser_down", "mcl_dispensers:dispenser_up" },
action = function(pos, node) action = function(pos, node)
setup_dispenser(pos) setup_dispenser(pos)
minetest.log("action", "[mcl_dispenser] Node formspec updated at "..minetest.pos_to_string(pos)) minetest.log("action", "[mcl_dispenser] Node formspec updated at " .. minetest.pos_to_string(pos))
end, end,
}) })

View File

@ -9,23 +9,36 @@ are so many weird tables below.
]] ]]
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local F = minetest.formspec_escape
-- For after_place_node local dropper_formspec = table.concat({
"formspec_version[4]",
"size[11.75,10.425]",
"label[4.125,0.375;" .. F(C(mcl_formspec.label_color, S("Dropper"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(4.125, 0.75, 3, 3),
"list[context;main;4.125,0.75;3,3;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
"listring[context;main]",
"listring[current_player;main]",
})
---For after_place_node
---@param pos Vector
local function setup_dropper(pos) local function setup_dropper(pos)
-- Set formspec and inventory -- Set formspec and inventory
local form = "size[9,8.75]"..
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
"list[current_player;main;0,4.5;9,3;9]"..
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
"list[current_player;main;0,7.74;9,1;]"..
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dropper"))).."]"..
"list[context;main;3,0.5;3,3;]"..
mcl_formspec.get_itemslot_bg(3,0.5,3,3)..
"listring[context;main]"..
"listring[current_player;main]"
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", form) meta:set_string("formspec", dropper_formspec)
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main", 9) inv:set_size("main", 9)
end end
@ -38,9 +51,9 @@ local function orientate_dropper(pos, placer)
local pitch = placer:get_look_vertical() * (180 / math.pi) local pitch = placer:get_look_vertical() * (180 / math.pi)
if pitch > 55 then if pitch > 55 then
minetest.swap_node(pos, {name="mcl_droppers:dropper_up"}) minetest.swap_node(pos, { name = "mcl_droppers:dropper_up" })
elseif pitch < -55 then elseif pitch < -55 then
minetest.swap_node(pos, {name="mcl_droppers:dropper_down"}) minetest.swap_node(pos, { name = "mcl_droppers:dropper_down" })
end end
end end
@ -58,11 +71,10 @@ local dropperdef = {
local meta2 = meta:to_table() local meta2 = meta:to_table()
meta:from_table(oldmetadata) meta:from_table(oldmetadata)
local inv = meta:get_inventory() local inv = meta:get_inventory()
for i=1, inv:get_size("main") do for i = 1, inv:get_size("main") do
local stack = inv:get_stack("main", i) local stack = inv:get_stack("main", i)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} minetest.add_item(vector.offset(pos, math.random(0, 10) / 10 - 0.5, 0, math.random(0, 10) / 10 - 0.5), stack)
minetest.add_item(p, stack)
end end
end end
meta:from_table(meta2) meta:from_table(meta2)
@ -96,7 +108,7 @@ local dropperdef = {
end, end,
_mcl_blast_resistance = 3.5, _mcl_blast_resistance = 3.5,
_mcl_hardness = 3.5, _mcl_hardness = 3.5,
mesecons = {effector = { mesecons = { effector = {
-- Drop random item when triggered -- Drop random item when triggered
action_on = function(pos, node) action_on = function(pos, node)
if not pos then return end if not pos then return end
@ -104,11 +116,11 @@ local dropperdef = {
local inv = meta:get_inventory() local inv = meta:get_inventory()
local droppos local droppos
if node.name == "mcl_droppers:dropper" then if node.name == "mcl_droppers:dropper" then
droppos = vector.subtract(pos, minetest.facedir_to_dir(node.param2)) droppos = vector.subtract(pos, minetest.facedir_to_dir(node.param2))
elseif node.name == "mcl_droppers:dropper_up" then elseif node.name == "mcl_droppers:dropper_up" then
droppos = {x=pos.x, y=pos.y+1, z=pos.z} droppos = vector.offset(pos, 0, 1, 0)
elseif node.name == "mcl_droppers:dropper_down" then elseif node.name == "mcl_droppers:dropper_down" then
droppos = {x=pos.x, y=pos.y-1, z=pos.z} droppos = vector.offset(pos, 0, -1, 0)
end end
local dropnode = minetest.get_node(droppos) local dropnode = minetest.get_node(droppos)
-- Do not drop into solid nodes, unless they are containers -- Do not drop into solid nodes, unless they are containers
@ -117,10 +129,10 @@ local dropperdef = {
return return
end end
local stacks = {} local stacks = {}
for i=1,inv:get_size("main") do for i = 1, inv:get_size("main") do
local stack = inv:get_stack("main", i) local stack = inv:get_stack("main", i)
if not stack:is_empty() then if not stack:is_empty() then
table.insert(stacks, {stack = stack, stackpos = i}) table.insert(stacks, { stack = stack, stackpos = i })
end end
end end
if #stacks >= 1 then if #stacks >= 1 then
@ -136,22 +148,22 @@ local dropperdef = {
if not dropped and not dropnodedef.groups.container then if not dropped and not dropnodedef.groups.container then
-- Drop item normally -- Drop item normally
local pos_variation = 100 local pos_variation = 100
droppos = { droppos = vector.offset(droppos,
x = droppos.x + math.random(-pos_variation, pos_variation) / 1000, math.random(-pos_variation, pos_variation) / 1000,
y = droppos.y + math.random(-pos_variation, pos_variation) / 1000, math.random(-pos_variation, pos_variation) / 1000,
z = droppos.z + math.random(-pos_variation, pos_variation) / 1000, math.random(-pos_variation, pos_variation) / 1000
} )
local item_entity = minetest.add_item(droppos, dropitem) local item_entity = minetest.add_item(droppos, dropitem)
local drop_vel = vector.subtract(droppos, pos) local drop_vel = vector.subtract(droppos, pos)
local speed = 3 local speed = 3
item_entity:set_velocity(vector.multiply(drop_vel,speed)) item_entity:set_velocity(vector.multiply(drop_vel, speed))
stack:take_item() stack:take_item()
inv:set_stack("main", stack_id, stack) inv:set_stack("main", stack_id, stack)
end end
end end
end, end,
rules = mesecon.rules.alldirs, rules = mesecon.rules.alldirs,
}}, } },
on_rotate = on_rotate, on_rotate = on_rotate,
} }
@ -159,20 +171,21 @@ local dropperdef = {
local horizontal_def = table.copy(dropperdef) local horizontal_def = table.copy(dropperdef)
horizontal_def.description = S("Dropper") horizontal_def.description = S("Dropper")
horizontal_def._tt_help = S("9 inventory slots").."\n"..S("Drops item when powered by redstone power") horizontal_def._tt_help = S("9 inventory slots") .. "\n" .. S("Drops item when powered by redstone power")
horizontal_def._doc_items_longdesc = S("A dropper is a redstone component and a container with 9 inventory slots which, when supplied with redstone power, drops an item or puts it into a container in front of it.") horizontal_def._doc_items_longdesc = S("A dropper is a redstone component and a container with 9 inventory slots which, when supplied with redstone power, drops an item or puts it into a container in front of it.")
horizontal_def._doc_items_usagehelp = S("Droppers can be placed in 6 possible directions, items will be dropped out of the hole. Use the dropper to access its inventory. Supply it with redstone energy once to make the dropper drop or transfer a random item.") horizontal_def._doc_items_usagehelp = S("Droppers can be placed in 6 possible directions, items will be dropped out of the hole. Use the dropper to access its inventory. Supply it with redstone energy once to make the dropper drop or transfer a random item.")
function horizontal_def.after_place_node(pos, placer, itemstack, pointed_thing) function horizontal_def.after_place_node(pos, placer, itemstack, pointed_thing)
setup_dropper(pos) setup_dropper(pos)
orientate_dropper(pos, placer) orientate_dropper(pos, placer)
end end
horizontal_def.tiles = { horizontal_def.tiles = {
"default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_top.png", "default_furnace_bottom.png",
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png", "mcl_droppers_dropper_front_horizontal.png" "default_furnace_side.png", "mcl_droppers_dropper_front_horizontal.png"
} }
horizontal_def.paramtype2 = "facedir" horizontal_def.paramtype2 = "facedir"
horizontal_def.groups = {pickaxey=1, container=2, material_stone=1} horizontal_def.groups = { pickaxey = 1, container = 2, material_stone = 1 }
minetest.register_node("mcl_droppers:dropper", horizontal_def) minetest.register_node("mcl_droppers:dropper", horizontal_def)
@ -185,7 +198,7 @@ down_def.tiles = {
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png" "default_furnace_side.png", "default_furnace_side.png"
} }
down_def.groups = {pickaxey=1, container=2,not_in_creative_inventory=1, material_stone=1} down_def.groups = { pickaxey = 1, container = 2, not_in_creative_inventory = 1, material_stone = 1 }
down_def._doc_items_create_entry = false down_def._doc_items_create_entry = false
down_def.drop = "mcl_droppers:dropper" down_def.drop = "mcl_droppers:dropper"
minetest.register_node("mcl_droppers:dropper_down", down_def) minetest.register_node("mcl_droppers:dropper_down", down_def)
@ -207,9 +220,9 @@ minetest.register_node("mcl_droppers:dropper_up", up_def)
minetest.register_craft({ minetest.register_craft({
output = "mcl_droppers:dropper", output = "mcl_droppers:dropper",
recipe = { recipe = {
{"mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble",}, { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble", },
{"mcl_core:cobble", "", "mcl_core:cobble",}, { "mcl_core:cobble", "", "mcl_core:cobble", },
{"mcl_core:cobble", "mesecons:redstone", "mcl_core:cobble",}, { "mcl_core:cobble", "mesecons:redstone", "mcl_core:cobble", },
} }
}) })
@ -226,6 +239,6 @@ minetest.register_lbm({
nodenames = { "mcl_droppers:dropper", "mcl_droppers:dropper_down", "mcl_droppers:dropper_up" }, nodenames = { "mcl_droppers:dropper", "mcl_droppers:dropper_down", "mcl_droppers:dropper_up" },
action = function(pos, node) action = function(pos, node)
setup_dropper(pos) setup_dropper(pos)
minetest.log("action", "[mcl_droppers] Node formspec updated at "..minetest.pos_to_string(pos)) minetest.log("action", "[mcl_droppers] Node formspec updated at " .. minetest.pos_to_string(pos))
end, end,
}) })

View File

@ -177,7 +177,7 @@ end
function mesecon.effector_get_rules(node) function mesecon.effector_get_rules(node)
local effector = mesecon.get_effector(node.name) local effector = mesecon.get_effector(node.name)
if effector then if effector and effector.rules then
local rules = effector.rules local rules = effector.rules
if type(rules) == "function" then if type(rules) == "function" then
return rules(node) return rules(node)

View File

@ -92,6 +92,7 @@ function mesecon.register_button(basename, description, texture, recipeitem, sou
groups_off.dig_by_water=1 groups_off.dig_by_water=1
groups_off.destroy_by_lava_flow=1 groups_off.destroy_by_lava_flow=1
groups_off.dig_by_piston=1 groups_off.dig_by_piston=1
groups_off.dig_immediate_piston=1
groups_off.button=1 -- button (off) groups_off.button=1 -- button (off)
local groups_on = table.copy(groups_off) local groups_on = table.copy(groups_off)
@ -103,6 +104,14 @@ function mesecon.register_button(basename, description, texture, recipeitem, sou
end end
button_sounds["mesecons_button:button_"..basename.."_off"] = button_sound button_sounds["mesecons_button:button_"..basename.."_off"] = button_sound
if not longdesc then
if groups_off.material_wood ~= 0 then
longdesc = S("A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows.")
else
longdesc = S("A button is a redstone compent which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for @1 seconds.", button_timer)
end
end
if push_by_arrow then if push_by_arrow then
groups_off.button_push_by_arrow = 1 groups_off.button_push_by_arrow = 1
groups_on.button_push_by_arrow = 1 groups_on.button_push_by_arrow = 1
@ -251,7 +260,7 @@ for w=1, #woods do
{material_wood=1,handy=1,axey=1}, {material_wood=1,handy=1,axey=1},
1.5, 1.5,
true, true,
S("A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows."), nil,
"mesecons_button_push_wood") "mesecons_button_push_wood")
minetest.register_craft({ minetest.register_craft({

View File

@ -17,3 +17,4 @@ A wooden button is a redstone component made out of wood which can be pushed to
Provides redstone power when pushed= Provides redstone power when pushed=
Push duration: @1s= Push duration: @1s=
Pushable by arrow= Pushable by arrow=
A button is a redstone compent which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for @1 seconds.=

View File

@ -415,8 +415,13 @@ mesecon.register_mvps_stopper("mcl_banners:standing_banner")
-- Unmovable by technical restrictions. -- Unmovable by technical restrictions.
-- Open formspec would screw up if node is destroyed (minor problem) -- Open formspec would screw up if node is destroyed (minor problem)
-- Would screw up on/off state of trapped chest (big problem) -- Would screw up on/off state of trapped chest (big problem)
-- Would duplicate xp when moved
mesecon.register_mvps_stopper("mcl_furnaces:furnace") mesecon.register_mvps_stopper("mcl_furnaces:furnace")
mesecon.register_mvps_stopper("mcl_furnaces:furnace_active") mesecon.register_mvps_stopper("mcl_furnaces:furnace_active")
mesecon.register_mvps_stopper("mcl_blast_furnace:blast_furnace")
mesecon.register_mvps_stopper("mcl_blast_furnace:blast_furnace_active")
mesecon.register_mvps_stopper("mcl_smoker:smoker")
mesecon.register_mvps_stopper("mcl_smoker:smoker_active")
mesecon.register_mvps_stopper("mcl_hoppers:hopper") mesecon.register_mvps_stopper("mcl_hoppers:hopper")
mesecon.register_mvps_stopper("mcl_hoppers:hopper_side") mesecon.register_mvps_stopper("mcl_hoppers:hopper_side")
mesecon.register_mvps_stopper("mcl_droppers:dropper") mesecon.register_mvps_stopper("mcl_droppers:dropper")

View File

@ -153,7 +153,11 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te
groups_on.not_in_creative_inventory = 1 groups_on.not_in_creative_inventory = 1
groups_on.pressure_plate = 2 groups_on.pressure_plate = 2
if not longdesc then if not longdesc then
longdesc = S("A pressure plate is a redstone component which supplies its surrounding blocks with redstone power while someone or something rests on top of it.") if groups_off.material_wood ~= 0 then
longdesc = S("A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.")
else
longdesc = S("A pressure plate is a redstone component which supplies its surrounding blocks with redstone power while someone or something rests on top of it.")
end
end end
local tt = S("Provides redstone power when pushed") local tt = S("Provides redstone power when pushed")
if not activated_by then if not activated_by then
@ -238,8 +242,7 @@ for w=1, #woods do
{{woods[w][2], woods[w][2]}}, {{woods[w][2], woods[w][2]}},
mcl_sounds.node_sound_wood_defaults(), mcl_sounds.node_sound_wood_defaults(),
{axey=1, material_wood=1}, {axey=1, material_wood=1},
nil, nil)
S("A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it."))
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -0,0 +1,19 @@
# textdomain: mcl_amethyst
Amethyst Cluster=Ametystklynge
Amethyst Cluster is the final growth of amethyst bud.=En ameystklynge er den sidste udvikling af en ametystspire.
Amethyst Shard=Ametystskår
An amethyst shard is a crystalline mineral.=Et ametystskår er et krystallisk mineral.
Block of Amethyst=Blok af ametyst
Budding Amethyst=Spirende ametyst
Calcite=Calcedon
Calcite can be found as part of amethyst geodes.=Calcedon kan findes som en del af krystalhuler med ametyst.
Large Amethyst Bud=Stor ametystknop
Large Amethyst Bud is the third growth of amethyst bud.=En stor ametystknop er den trejde udvikling af en ametystspire.
Medium Amethyst Bud=Mellem ametystknop
Medium Amethyst Bud is the second growth of amethyst bud.=En mellem ametystknop er den anden udvikling af en ametystspire.
Small Amethyst Bud=Lille ametystknop
Small Amethyst Bud is the first growth of amethyst bud.=En lille ametystknop er den første udvikling af en ametystspire.
The Block of Amethyst is a decoration block crafted from amethyst shards.=En blok af ametyst er en udsmykningsblok som kan laves ametystskår.
The Budding Amethyst can grow amethyst=Den spirende ametyst kan gro ametyst
Tinted Glass=Farvet glas
Tinted Glass is a type of glass which blocks lights while it is visually transparent.=Farvet glas er en glastype som er gennemsigtig, men lukker lys ude.

View File

@ -1,4 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape
local C = minetest.colorize
local MAX_NAME_LENGTH = 35 local MAX_NAME_LENGTH = 35
local MAX_WEAR = 65535 local MAX_WEAR = 65535
@ -10,41 +12,65 @@ local MATERIAL_TOOL_REPAIR_BOOST = {
MAX_WEAR, -- 100% MAX_WEAR, -- 100%
} }
---@param set_name? string
local function get_anvil_formspec(set_name) local function get_anvil_formspec(set_name)
if not set_name then if not set_name then
set_name = "" set_name = ""
end end
return "size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;mcl_anvils_inventory.png]".. return table.concat({
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
"list[current_player;main;0,7.74;9,1;]".. "label[4.125,0.375;" .. F(C(mcl_formspec.label_color, S("Repair and Name"))) .. "]",
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
"list[context;input;1,2.5;1,1;]".. "image[0.875,0.375;1.75,1.75;mcl_anvils_inventory_hammer.png]",
mcl_formspec.get_itemslot_bg(1,2.5,1,1)..
"list[context;input;4,2.5;1,1;1]".. "field[4.125,0.75;7.25,1;name;;" .. F(set_name) .. "]",
mcl_formspec.get_itemslot_bg(4,2.5,1,1).. "field_close_on_enter[name;false]",
"list[context;output;8,2.5;1,1;]".. "set_focus[name;true]",
mcl_formspec.get_itemslot_bg(8,2.5,1,1)..
"label[3,0.1;"..minetest.formspec_escape(minetest.colorize("#313131", S("Repair and Name"))).."]".. mcl_formspec.get_itemslot_bg_v4(1.625, 2.6, 1, 1),
"field[3.25,1;4,1;name;;"..minetest.formspec_escape(set_name).."]".. "list[context;input;1.625,2.6;1,1;]",
"field_close_on_enter[name;false]"..
"button[7,0.7;2,1;name_button;"..minetest.formspec_escape(S("Set Name")).."]".. "image[3.5,2.6;1,1;mcl_anvils_inventory_cross.png]",
"listring[context;output]"..
"listring[current_player;main]".. mcl_formspec.get_itemslot_bg_v4(5.375, 2.6, 1, 1),
"listring[context;input]".. "list[context;input;5.375,2.6;1,1;1]",
"listring[current_player;main]"
"image[6.75,2.6;2,1;mcl_anvils_inventory_arrow.png]",
mcl_formspec.get_itemslot_bg_v4(9.125, 2.6, 1, 1),
"list[context;output;9.125,2.6;1,1;]",
-- Player Inventory
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Listrings
"listring[context;output]",
"listring[current_player;main]",
"listring[context;input]",
"listring[current_player;main]",
})
end end
-- Given a tool and material stack, returns how many items of the material stack -- Given a tool and material stack, returns how many items of the material stack
-- needs to be used up to repair the tool. -- needs to be used up to repair the tool.
---@param tool ItemStack
---@param material ItemStack
---@return integer
local function get_consumed_materials(tool, material) local function get_consumed_materials(tool, material)
local wear = tool:get_wear() local wear = tool:get_wear()
--local health = (MAX_WEAR - wear) --local health = (MAX_WEAR - wear)
local matsize = material:get_count() local matsize = material:get_count()
local materials_used = 0 local materials_used = 0
for m=1, math.min(4, matsize) do for m = 1, math.min(4, matsize) do
materials_used = materials_used + 1 materials_used = materials_used + 1
if (wear - MATERIAL_TOOL_REPAIR_BOOST[m]) <= 0 then if (wear - MATERIAL_TOOL_REPAIR_BOOST[m]) <= 0 then
break break
@ -53,27 +79,20 @@ local function get_consumed_materials(tool, material)
return materials_used return materials_used
end end
local function contains(table, value)
for _, i in pairs(table) do
if i == value then
return true
end
end
return false
end
-- Given 2 input stacks, tells you which is the tool and which is the material. -- Given 2 input stacks, tells you which is the tool and which is the material.
-- Returns ("tool", input1, input2) if input1 is tool and input2 is material. -- Returns ("tool", input1, input2) if input1 is tool and input2 is material.
-- Returns ("material", input2, input1) if input1 is material and input2 is tool. -- Returns ("material", input2, input1) if input1 is material and input2 is tool.
-- Returns nil otherwise. -- Returns nil otherwise.
---@param input1 ItemStack
---@param input2 ItemStack
local function distinguish_tool_and_material(input1, input2) local function distinguish_tool_and_material(input1, input2)
local def1 = input1:get_definition() local def1 = input1:get_definition()
local def2 = input2:get_definition() local def2 = input2:get_definition()
local r1 = def1._repair_material local r1 = def1._repair_material
local r2 = def2._repair_material local r2 = def2._repair_material
if def1.type == "tool" and r1 and type(r1) == "table" and contains(r1, input2) then if def1.type == "tool" and r1 and type(r1) == "table" and table.indexof(r1, input2) ~= -1 then
return "tool", input1, input2 return "tool", input1, input2
elseif def2.type == "tool" and r2 and type(r2) == "table" and contains(r2, input1) then elseif def2.type == "tool" and r2 and type(r2) == "table" and table.indexof(r1, input1) ~= -1 then
return "material", input2, input1 return "material", input2, input1
elseif def1.type == "tool" and r1 then elseif def1.type == "tool" and r1 then
return "tool", input1, input2 return "tool", input1, input2
@ -84,7 +103,8 @@ local function distinguish_tool_and_material(input1, input2)
end end
end end
-- Helper function to make sure update_anvil_slots NEVER overstacks the output slot ---Helper function to make sure update_anvil_slots NEVER overstacks the output slot
---@param stack ItemStack
local function fix_stack_size(stack) local function fix_stack_size(stack)
if not stack or stack == "" then return "" end if not stack or stack == "" then return "" end
local count = stack:get_count() local count = stack:get_count()
@ -99,6 +119,7 @@ end
-- Update the inventory slots of an anvil node. -- Update the inventory slots of an anvil node.
-- meta: Metadata of anvil node -- meta: Metadata of anvil node
---@param meta NodeMetaRef
local function update_anvil_slots(meta) local function update_anvil_slots(meta)
local inv = meta:get_inventory() local inv = meta:get_inventory()
local new_name = meta:get_string("set_name") local new_name = meta:get_string("set_name")
@ -137,7 +158,7 @@ local function update_anvil_slots(meta)
name_item = input1 name_item = input1
new_output = name_item new_output = name_item
-- Tool + repair item -- Tool + repair item
else else
-- Any tool can have a repair item. This may be defined in the tool's item definition -- Any tool can have a repair item. This may be defined in the tool's item definition
-- as an itemstring in the field `_repair_material`. Only if this field is set, the -- as an itemstring in the field `_repair_material`. Only if this field is set, the
@ -159,7 +180,7 @@ local function update_anvil_slots(meta)
has_correct_material = true has_correct_material = true
end end
else else
if contains(repair, material_name) then if table.indexof(repair, material_name) ~= -1 then
has_correct_material = true has_correct_material = true
else else
for _, r in pairs(repair) do for _, r in pairs(repair) do
@ -185,7 +206,7 @@ local function update_anvil_slots(meta)
new_output = "" new_output = ""
end end
end end
-- Exactly 1 input slot occupied -- Exactly 1 input slot occupied
elseif (not input1:is_empty() and input2:is_empty()) or (input1:is_empty() and not input2:is_empty()) then elseif (not input1:is_empty() and input2:is_empty()) or (input1:is_empty() and not input2:is_empty()) then
-- Just rename item -- Just rename item
if input1:is_empty() then if input1:is_empty() then
@ -231,28 +252,32 @@ local function update_anvil_slots(meta)
end end
end end
-- Drop input items of anvil at pos with metadata meta ---Drop input items of anvil at pos with metadata meta
---@param pos Vector
---@param meta NodeMetaRef
local function drop_anvil_items(pos, meta) local function drop_anvil_items(pos, meta)
local inv = meta:get_inventory() local inv = meta:get_inventory()
for i=1, inv:get_size("input") do for i = 1, inv:get_size("input") do
local stack = inv:get_stack("input", i) local stack = inv:get_stack("input", i)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = vector.offset(pos, math.random(0, 10) / 10 - 0.5, 0, math.random(0, 10) / 10 - 0.5)
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end
end end
---@param pos Vector
---@param node node
local function damage_particles(pos, node) local function damage_particles(pos, node)
minetest.add_particlespawner({ minetest.add_particlespawner({
amount = 30, amount = 30,
time = 0.1, time = 0.1,
minpos = vector.add(pos, {x=-0.5, y=-0.5, z=-0.5}), minpos = vector.offset(pos, -0.5, -0.5, -0.5),
maxpos = vector.add(pos, {x=0.5, y=-0.25, z=0.5}), maxpos = vector.offset(pos, 0.5, -0.25, 0.5),
minvel = {x=-0.5, y=0.05, z=-0.5}, minvel = vector.new(-0.5, 0.05, -0.5),
maxvel = {x=0.5, y=0.3, z=0.5}, maxvel = vector.new(0.5, 0.3, 0.5),
minacc = {x=0, y=-9.81, z=0}, minacc = vector.new(0, -9.81, 0),
maxacc = {x=0, y=-9.81, z=0}, maxacc = vector.new(0, -9.81, 0),
minexptime = 0.1, minexptime = 0.1,
maxexptime = 0.5, maxexptime = 0.5,
minsize = 0.4, minsize = 0.4,
@ -267,12 +292,12 @@ local function destroy_particles(pos, node)
minetest.add_particlespawner({ minetest.add_particlespawner({
amount = math.random(20, 30), amount = math.random(20, 30),
time = 0.1, time = 0.1,
minpos = vector.add(pos, {x=-0.4, y=-0.4, z=-0.4}), minpos = vector.offset(pos, -0.4, -0.4, -0.4),
maxpos = vector.add(pos, {x=0.4, y=0.4, z=0.4}), maxpos = vector.offset(pos, 0.4, 0.4, 0.4),
minvel = {x=-0.5, y=-0.1, z=-0.5}, minvel = vector.new(-0.5, -0.1, -0.5),
maxvel = {x=0.5, y=0.2, z=0.5}, maxvel = vector.new(0.5, 0.2, 0.5),
minacc = {x=0, y=-9.81, z=0}, minacc = vector.new(0, -9.81, 0),
maxacc = {x=0, y=-9.81, z=0}, maxacc = vector.new(0, -9.81, 0),
minexptime = 0.2, minexptime = 0.2,
maxexptime = 0.65, maxexptime = 0.65,
minsize = 0.8, minsize = 0.8,
@ -289,28 +314,29 @@ end
local function damage_anvil(pos) local function damage_anvil(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
if node.name == "mcl_anvils:anvil" then if node.name == "mcl_anvils:anvil" then
minetest.swap_node(pos, {name="mcl_anvils:anvil_damage_1", param2=node.param2}) minetest.swap_node(pos, { name = "mcl_anvils:anvil_damage_1", param2 = node.param2 })
damage_particles(pos, node) damage_particles(pos, node)
minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}, true) minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, { pos = pos, max_hear_distance = 16 }, true)
return false return false
elseif node.name == "mcl_anvils:anvil_damage_1" then elseif node.name == "mcl_anvils:anvil_damage_1" then
minetest.swap_node(pos, {name="mcl_anvils:anvil_damage_2", param2=node.param2}) minetest.swap_node(pos, { name = "mcl_anvils:anvil_damage_2", param2 = node.param2 })
damage_particles(pos, node) damage_particles(pos, node)
minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}, true) minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, { pos = pos, max_hear_distance = 16 }, true)
return false return false
elseif node.name == "mcl_anvils:anvil_damage_2" then elseif node.name == "mcl_anvils:anvil_damage_2" then
-- Destroy anvil -- Destroy anvil
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
drop_anvil_items(pos, meta) drop_anvil_items(pos, meta)
minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dug, {pos=pos, max_hear_distance=16}, true) minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dug, { pos = pos, max_hear_distance = 16 }, true)
minetest.remove_node(pos) minetest.remove_node(pos)
destroy_particles(pos, node) destroy_particles(pos, node)
minetest.check_single_for_falling({x=pos.x, y=pos.y+1, z=pos.z}) minetest.check_single_for_falling(vector.offset(pos, 0, 1, 0))
return true return true
end end
end end
-- Roll a virtual dice and damage anvil at a low chance. ---Roll a virtual dice and damage anvil at a low chance.
---@param pos Vector
local function damage_anvil_by_using(pos) local function damage_anvil_by_using(pos)
local r = math.random(1, 100) local r = math.random(1, 100)
-- 12% chance -- 12% chance
@ -321,25 +347,30 @@ local function damage_anvil_by_using(pos)
end end
end end
---@param pos Vector
---@param distance number
local function damage_anvil_by_falling(pos, distance) local function damage_anvil_by_falling(pos, distance)
local r = math.random(1, 100) local r = math.random(1, 100)
if distance > 1 then if distance > 1 then
if r <= (5*distance) then if r <= (5 * distance) then
damage_anvil(pos) damage_anvil(pos)
end end
end end
end end
---@type nodebox
local anvilbox = { local anvilbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -8 / 16, -6 / 16, 8 / 16, 8 / 16, 6 / 16 }, { -8 / 16, -8 / 16, -6 / 16, 8 / 16, 8 / 16, 6 / 16 },
}, },
} }
---@type node_definition
local anvildef = { local anvildef = {
groups = {pickaxey=1, falling_node=1, falling_node_damage=1, crush_after_fall=1, deco_block=1, anvil=1}, groups = { pickaxey = 1, falling_node = 1, falling_node_damage = 1, crush_after_fall = 1, deco_block = 1, anvil = 1 },
tiles = {"mcl_anvils_anvil_top_damaged_0.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png"}, tiles = { "mcl_anvils_anvil_top_damaged_0.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png" },
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, use_texture_alpha = "opaque",
_tt_help = S("Repair and rename items"), _tt_help = S("Repair and rename items"),
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
@ -353,7 +384,7 @@ local anvildef = {
{ -5 / 16, -4 / 16, -4 / 16, 5 / 16, -3 / 16, 4 / 16 }, { -5 / 16, -4 / 16, -4 / 16, 5 / 16, -3 / 16, 4 / 16 },
{ -4 / 16, -3 / 16, -2 / 16, 4 / 16, 2 / 16, 2 / 16 }, { -4 / 16, -3 / 16, -2 / 16, 4 / 16, 2 / 16, 2 / 16 },
{ -8 / 16, 2 / 16, -5 / 16, 8 / 16, 8 / 16, 5 / 16 }, { -8 / 16, 2 / 16, -5 / 16, 8 / 16, 8 / 16, 5 / 16 },
} },
}, },
selection_box = anvilbox, selection_box = anvilbox,
collision_box = anvilbox, collision_box = anvilbox,
@ -416,7 +447,7 @@ local anvildef = {
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if from_list == "output" and to_list == "input" then if from_list == "output" and to_list == "input" then
local inv = meta:get_inventory() local inv = meta:get_inventory()
for i=1, inv:get_size("input") do for i = 1, inv:get_size("input") do
if i ~= to_index then if i ~= to_index then
local istack = inv:get_stack("input", i) local istack = inv:get_stack("input", i)
istack:set_count(math.max(0, istack:get_count() - count)) istack:set_count(math.max(0, istack:get_count() - count))
@ -504,22 +535,20 @@ local anvildef = {
minetest.record_protection_violation(pos, sender_name) minetest.record_protection_violation(pos, sender_name)
return return
end end
if fields.name_button or fields.name then
local set_name if fields.name then
if fields.name == nil then
set_name = ""
else
set_name = fields.name
end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
-- Limit name length -- Limit name length
set_name = string.sub(set_name, 1, MAX_NAME_LENGTH) local set_name = string.sub(fields.name, 1, MAX_NAME_LENGTH)
meta:set_string("set_name", set_name) meta:set_string("set_name", set_name)
update_anvil_slots(meta) update_anvil_slots(meta)
meta:set_string("formspec", get_anvil_formspec(set_name)) meta:set_string("formspec", get_anvil_formspec(set_name))
end end
end, end,
} }
if minetest.get_modpath("screwdriver") then if minetest.get_modpath("screwdriver") then
anvildef.on_rotate = screwdriver.rotate_simple anvildef.on_rotate = screwdriver.rotate_simple
end end
@ -527,29 +556,34 @@ end
local anvildef0 = table.copy(anvildef) local anvildef0 = table.copy(anvildef)
anvildef0.description = S("Anvil") anvildef0.description = S("Anvil")
anvildef0._doc_items_longdesc = anvildef0._doc_items_longdesc =
S("The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!") S("The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!")
anvildef0._doc_items_usagehelp = anvildef0._doc_items_usagehelp =
S("To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.").."\n".. S("To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.") .. "\n" ..
S("To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.").."\n".. S("To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.")
S("There are two possibilities to repair tools (and armor):").."\n".. .. "\n" ..
S("• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.").."\n".. S("There are two possibilities to repair tools (and armor):") .. "\n" ..
S("• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.").."\n".. S("• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.")
S("Armor counts as a tool. It is possible to repair and rename a tool in a single step.").."\n\n".. .. "\n" ..
S("The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.") S("• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.")
.. "\n" ..
S("Armor counts as a tool. It is possible to repair and rename a tool in a single step.") .. "\n\n" ..
S("The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.")
local anvildef1 = table.copy(anvildef) local anvildef1 = table.copy(anvildef)
anvildef1.description = S("Slightly Damaged Anvil") anvildef1.description = S("Slightly Damaged Anvil")
anvildef1._doc_items_create_entry = false anvildef1._doc_items_create_entry = false
anvildef1.groups.anvil = 2 anvildef1.groups.anvil = 2
anvildef1._doc_items_create_entry = false anvildef1._doc_items_create_entry = false
anvildef1.tiles = {"mcl_anvils_anvil_top_damaged_1.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png"} anvildef1.tiles = { "mcl_anvils_anvil_top_damaged_1.png^[transformR90", "mcl_anvils_anvil_base.png",
"mcl_anvils_anvil_side.png" }
local anvildef2 = table.copy(anvildef) local anvildef2 = table.copy(anvildef)
anvildef2.description = S("Very Damaged Anvil") anvildef2.description = S("Very Damaged Anvil")
anvildef2._doc_items_create_entry = false anvildef2._doc_items_create_entry = false
anvildef2.groups.anvil = 3 anvildef2.groups.anvil = 3
anvildef2._doc_items_create_entry = false anvildef2._doc_items_create_entry = false
anvildef2.tiles = {"mcl_anvils_anvil_top_damaged_2.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png"} anvildef2.tiles = { "mcl_anvils_anvil_top_damaged_2.png^[transformR90", "mcl_anvils_anvil_base.png",
"mcl_anvils_anvil_side.png" }
minetest.register_node("mcl_anvils:anvil", anvildef0) minetest.register_node("mcl_anvils:anvil", anvildef0)
minetest.register_node("mcl_anvils:anvil_damage_1", anvildef1) minetest.register_node("mcl_anvils:anvil_damage_1", anvildef1)
@ -562,7 +596,7 @@ if minetest.get_modpath("mcl_core") then
{ "mcl_core:ironblock", "mcl_core:ironblock", "mcl_core:ironblock" }, { "mcl_core:ironblock", "mcl_core:ironblock", "mcl_core:ironblock" },
{ "", "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:iron_ingot", "mcl_core:iron_ingot" },
} },
}) })
end end

View File

@ -0,0 +1,16 @@
# textdomain: mcl_anvils
Set Name=Navngiv
Repair and Name=Reparér og navngiv
Inventory=Oppakning
Anvil=Ambolt
The anvil allows you to repair tools and armor, and to give names to items. It has a limited durability, however. Don't let it fall on your head, it could be quite painful!=Ambolten gør dig i stand til at reparere værktøj og rustninger, og til at navngive genstande. Den har dog begrænset holdbarhed. Lad den ikke falde ned i hovedet på dig, det kunne gøre meget ondt!
To use an anvil, rightclick it. An anvil has 2 input slots (on the left) and one output slot.=For at bruge ambolten skal du højre-klikke på den. En ambolt har to indgangspladser (til venstre), og én udgangsplads.
To rename items, put an item stack in one of the item slots while keeping the other input slot empty. Type in a name, hit enter or “Set Name”, then take the renamed item from the output slot.=For at omdøbe en genstande skal du putte dem i den ene indgangsplads og lade den anden indgangsplads være tom. Skriv et navn, tryk på enter eller "Giv navn", og tag så den omdøbte genstand fra udgangspladsen.
There are two possibilities to repair tools (and armor):=Der er to muligheder for at reparere værktøj (og rustninger)
• Tool + Tool: Place two tools of the same type in the input slots. The “health” of the repaired tool is the sum of the “health” of both input tools, plus a 12% bonus.=• Værktøj + Værktøj: Placér to stykker værktøj af samme type i indgangspladserne. Holbarheden af det reparerede stykke værktøj er summen af holdbarheden på begge stykker værktøj plus 12% bonus.
• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.=• Værktøj + Materiale: Noget værktøj kan også repareres ved at kombinere dem med en genstand de er lavet af. For eksempel kan en jernhakke repareres med jernbarre. Dette reparerer værktøjet med 25%.
Armor counts as a tool. It is possible to repair and rename a tool in a single step.=Rustninger tæller som værktøj. Det er muligt at reparere og omdøbe værktøj i ét enkelt trin.
The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.=Ambolten har en begrænset holdbarhed og 3 skadeniveauer: Ubeskadiget, let beskadiget og meget beskadiget. Hver gang du reparerer eller omdøber noget er der en 12% chance for, at ambolten bliver beskadiget. Ambolte har også en risiko for at blive beskadiget når de falder mere end én blok ned. Hvis en beskadiget ambolt beskadiges igen bliver den ødelagt.
Slightly Damaged Anvil=Let beskadiget ambolt
Very Damaged Anvil=Meget beskadiget ambolt
Repair and rename items=Reparér og omdøb genstande

View File

@ -0,0 +1,48 @@
# textdomain: mcl_armor
This is a piece of equippable armor which reduces the amount of damage you receive.=Dette er et stykke rustning du kan tage på for at reducere den mængde du tager.
To equip it, put it on the corresponding armor slot in your inventory menu.=For at tage den på, skal du putte den i den tilsvarende rustningsplads i din oppakningsmenu.
Leather Cap=Læderhat
Iron Helmet=Jernhjelm
Golden Helmet=Guldhjelm
Diamond Helmet=Diamanthjelm
Chain Helmet=Brynjehjelm
Netherite Helmet=Netherritehjelm
Leather Tunic=Lædertunika
Iron Chestplate=Jernbrystplade
Golden Chestplate=Guldbrystplade
Diamond Chestplate=Diamantbrystplade
Chain Chestplate=Brynjeskjorte
Netherite Chestplate=Netheritebrystplade
Leather Pants=Læderbukser
Iron Leggings=Jernbenplader
Golden Leggings=Guldbenplader
Diamond Leggings=Diamantbenplader
Chain Leggings=Brynjebukser
Netherite Leggings=Netheritebenplader
Leather Boots=Læderstøvler
Iron Boots=Jernstøvler
Golden Boots=Guldstøvler
Diamond Boots=Diamantstøvler
Chain Boots=Brynjestøvler
Netherite Boots=Netheritestøvler
Elytra=Elytra
#Translations of enchantements
Increases underwater mining speed.=Øger udvindingshastigheden under vand.
Blast Protection=Eksplosionsbeskyttelse
Reduces explosion damage and knockback.=Reducerer eksplosionsskade og -tilbageslag.
Curse of Binding=Bindende forbandelse.
Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.=Objektet kan ikke fjernes fra rustninspladser undtagen ved død, hvis den går i stykker ikke i kreativ tilstand.
Feather Falling=Fjerfald
Reduces fall damage.=Reduerer faldskade.
Fire Protection=Ildbeskyttelse
Reduces fire damage.=Reducerer ildskade.
Shooting consumes no regular arrows.=Det bruger ingen normale pile at skyde.
Shoot 3 arrows at the cost of one.=Skyd 3 pile for én pils pris.
Projectile Protection=Projektilbeskyttelse
Reduces projectile damage.=Reducerer projektilskade
Protection=Beskyttelse
Reduces most types of damage by 4% for each level.=Reducerer det fleste skadestyper med 4% for hvert level.
Thorns=Torne
Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.=Reflekterer skade ved træfning, men koster holdbarhed ved hver brug.
Aqua Affinity=Vandaffinitet

View File

@ -0,0 +1,5 @@
# textdomain: mcl_armor_stand
Armor Stand=Rustningsstativ
An armor stand is a decorative object which can display different pieces of armor. Anything which players can wear as armor can also be put on an armor stand.=Et rustningsstativ er en udsmykningsgenstand som kan fremvise forskellige rustninger. Alt hvad spillere kan bære som rusning kan sættes på rustningsstativet.
Just place an armor item on the armor stand. To take the top piece of armor from the armor stand, select your hand and use the place key on the armor stand.=Placér blot et rustningsstykke på rustningsstativet. For at take den øverste rustningsstykke skal du vælge din hånd og bruge placér knappen på rustningsstativet.
Displays pieces of armor=Fremviser rustningsstykker.

View File

@ -203,11 +203,11 @@ local bamboo_def = {
if node_above_name ~= "mcl_core:water_source" and node_above_name ~= "mcl_core:lava_source" if node_above_name ~= "mcl_core:water_source" and node_above_name ~= "mcl_core:lava_source"
and node_above_name ~= "mcl_nether:nether_lava_source" then and node_above_name ~= "mcl_nether:nether_lava_source" then
local _, position = minetest.item_place(place_item, placer, pointed_thing, fdir) local _, position = minetest.item_place(place_item, placer, pointed_thing, fdir)
if not minetest.is_creative_enabled(placer:get_player_name()) then if position then
itemstack:take_item(1) if not minetest.is_creative_enabled(placer:get_player_name()) then
end itemstack:take_item(1)
if rand_height and rand_height > 1 then end
if position then if rand_height and rand_height > 1 then
mcl_bamboo.mcl_log("Setting Height Data...") mcl_bamboo.mcl_log("Setting Height Data...")
meta = minetest.get_meta(position) meta = minetest.get_meta(position)
if meta then if meta then

View File

@ -4,10 +4,6 @@
--- DateTime: 12/29/22 12:38 PM -- Restructure Date --- DateTime: 12/29/22 12:38 PM -- Restructure Date
--- Copyright (C) 2022 - 2023, Michieal. See License.txt --- Copyright (C) 2022 - 2023, Michieal. See License.txt
-- CONSTS
-- Due to door fix #2736, doors are displayed backwards. When this is fixed, set this variable to false.
local BROKEN_DOORS = true
-- FUTURE USE VARIABLE. MUST REMAIN FALSE UNTIL IT HAS BEEN FULLY IMPLEMENTED. DO NOT ENABLE. -- FUTURE USE VARIABLE. MUST REMAIN FALSE UNTIL IT HAS BEEN FULLY IMPLEMENTED. DO NOT ENABLE.
local SIDE_SCAFFOLDING = false local SIDE_SCAFFOLDING = false
local SIDE_SCAFFOLD_NAME = "mcl_bamboo:scaffolding_horizontal" local SIDE_SCAFFOLD_NAME = "mcl_bamboo:scaffolding_horizontal"
@ -49,17 +45,6 @@ end
if minetest.get_modpath("mcl_doors") then if minetest.get_modpath("mcl_doors") then
if mcl_doors then if mcl_doors then
local top_door_tiles = {}
local bot_door_tiles = {}
if BROKEN_DOORS then
top_door_tiles = { "mcl_bamboo_door_top_alt.png", "mcl_bamboo_door_top.png" }
bot_door_tiles = { "mcl_bamboo_door_bottom_alt.png", "mcl_bamboo_door_bottom.png" }
else
top_door_tiles = { "mcl_bamboo_door_top.png", "mcl_bamboo_door_top.png" }
bot_door_tiles = { "mcl_bamboo_door_bottom.png", "mcl_bamboo_door_bottom.png" }
end
local name = "mcl_bamboo:bamboo_door" local name = "mcl_bamboo:bamboo_door"
local def = { local def = {
description = S("Bamboo Door"), description = S("Bamboo Door"),
@ -70,8 +55,8 @@ if minetest.get_modpath("mcl_doors") then
groups = { handy = 1, axey = 1, material_wood = 1, flammable = -1 }, groups = { handy = 1, axey = 1, material_wood = 1, flammable = -1 },
_mcl_hardness = 3, _mcl_hardness = 3,
_mcl_blast_resistance = 3, _mcl_blast_resistance = 3,
tiles_bottom = bot_door_tiles, tiles_bottom = "mcl_bamboo_door_bottom.png",
tiles_top = top_door_tiles, tiles_top = "mcl_bamboo_door_top.png",
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
} }

View File

@ -0,0 +1,36 @@
# textdomain: mcl_bamboo
### init.lua ###
A bamboo button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.=En bambusknap er en rødstenskomponent lavet af sten som giver rødstensenergi når den aktiveres. Når den aktiveres forsyner den tilstøende rødstenskomponenter i 1 sekund.
A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=En trætrykplade er en rødstenskomponent som forsyner omkringliggende blokke med rødstensenergi når et bevægeligt objekt (inklusiv tabte genstande, spillere og monstre) er ovenpå den.
Bamboo=Bambus
Bamboo Button=Bambusknap
Bamboo Door.=Bambusdør
Bamboo Fence=Bambushegn
Bamboo Fence Gate=Bambushegnslåge
Bamboo Plank=Bambusplanke
Bamboo Plank Slab=Bambusplankeplade
Bamboo Plank Stair=Bambusplanketrappe
Bamboo Pressure Plate=Bambustrykplade
Bamboo Sign=Bambusskilt
Bamboo Slab=Bambusplade
Bamboo Stair=Bambustrappe
Bamboo Trapdoor.=Bambusfaldlem
Double Bamboo Plank Slab=Dobbelbambusplanke
Double Bamboo Slab=Dobbelbambusplade
Double Stripped Bamboo Slab=Afbarket dobbelbambus
Nether Brick Fence=Netherstenshegn
Scaffolding=Stillads
Scaffolding (horizontal)=Stillads (horisontal)
Scaffolding block used to climb up or out across areas.=Stilladsblok som bruges til at kravle op ad eller på tværs af områder
Stripped Bamboo Slab=Afbarket bambusplade
Stripped Bamboo Stair=Afbarket bambustrappe
To open or close the trapdoor, rightclick it or send a redstone signal to it.=Højre-klik eller send rødstensenergi til en faldlem for at åbne eller lukke den,
Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.=Træfaldlemme er horisontale barrierer som kan åbnes og lukkes med håndkraft eller med rødstensenergi. De kan udgøre den øverste eller den nederste del af en blok afhængigt af hvordan de placeres. Når de er åbne, kan man bruge dem ligesom en stige.

View File

@ -0,0 +1,45 @@
# textdomain: mcl_bamboo
### bamboo_base.lua ###
Bamboo=Бамбук
Bamboo Mosaic Plank=Бамбуковая мозаика
Bamboo Plank=Бамбуковые доски
Stripped Bamboo Block=Блок обтёсанного бамбука
Bamboo Block=Блок бамбука
### bamboo_items.lua ###
A bamboo button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.=Бамбуковая кнопка - это компонент красного камня, который изготовлен из краснокаменной руды. Ее можно нажать, чтобы обеспечить питание красному камню. При нажатии он приводит в действие соседние компоненты красного камня на 1 секунду.
A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Деревянная нажимная пластина - это компонент красного камня, который снабжает окружающие блоки энергией красного камня, в то время как любой подвижный объект (включая выпавшие предметы, игроков и мобов) стоит на ней.
Bamboo=Бамбук
Bamboo Button=Бамбуковая кнопка
Bamboo Door=Бамбуковая дверь
Bamboo Fence=Бамбуковый забор
Bamboo Fence Gate=Бамбуковая калитка
Bamboo Mosaic Slab=Плита из бамбуковой мозаики
Bamboo Mosaic Stair=Ступеньки из бамбуковой мозаики
Bamboo Plank Slab=Бамбуковая плита из досок
Bamboo Plank Stair=Бамбуковые ступеньки из досок
Bamboo Pressure Plate=Бамбуковая нажимная плита
Bamboo Slab=Бамбуковая плита
Bamboo Stair=Бамбуковые ступеньки
Bamboo Trapdoor=Бамбуковый люк
Double Bamboo Mosaic Slab=Двойная бамбуковая мозаичная плита
Double Bamboo Plank Slab=Двойная бамбуковая дощатая плита
Double Bamboo Slab=Двойная бамбуковая плита
Double Stripped Bamboo Slab=Двойная обтесанная бамбуковая плита
Scaffolding=Строительные леса
Scaffolding (horizontal)=Строительные леса (горизонтальный)
Scaffolding block used to climb up or out across areas.=Блок строительных лесов, используемый для подъема вверх или перемещения по другим участкам.
Stripped Bamboo Slab=Обтесанная бамбуковая плита
Stripped Bamboo Stair=Обтесанные бамбуковые ступеньки
To open or close the trapdoor, rightclick it or send a redstone signal to it.=Чтобы открыть или закрыть люк, щелкните по нему правой кнопкой мыши или отправьте на него сигнал redstone.
Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.=Деревянные люки - это горизонтальные барьеры, которые можно открывать и закрывать вручную или по сигналу красного камня. Они занимают верхнюю или нижнюю часть блока, в зависимости от того, как они были размещены. Когда они открыты, по ним можно подниматься, как по лестнице.
Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.=Деревянные двери представляют собой барьеры высотой в 2 блока, которые можно открывать или закрывать вручную и по сигналу redstone.
To open or close a wooden door, rightclick it or supply its lower half with a redstone signal.=Чтобы открыть или закрыть деревянную дверь, щелкните по ней правой кнопкой мыши или снабдите ее нижнюю половину сигналом красного камня.

View File

@ -0,0 +1,77 @@
# textdomain: mcl_banners
White Banner=Hvidt vanner
White=Hvid
Grey Banner=Gråt banner
Grey=Grå
Light Grey Banner=Lysegråt banner
Light Grey=Lysegrå
Black Banner=Sort banner
Black=Sort
Red Banner=Rødt banner
Red=Rød
Yellow Banner=Gult banner
Yellow=Gul
Green Banner=Grønt banner
Green=Grøn
Cyan Banner=Cyanblåt banner
Cyan=Cyanblå
Blue Banner=Blåt banner
Blue=Blå
Magenta Banner=Magenta banner
Magenta=Magenta
Orange Banner=Orange banner
Orange=Orange
Purple Banner=Lilla banner
Violet=Lilla
Brown Banner=Brunt banner
Brown=Brund
Pink Banner=Lyserødt banner
Pink=Lyserøde
Lime Banner=Limegrønt banner
Lime=Limegrøn
Light Blue Banner=Lyseblåt banner
Light Blue=Lyseblå
Banners are tall colorful decorative blocks. They can be placed on the floor and at walls. Banners can be emblazoned with a variety of patterns using a lot of dye in crafting.=Bannere er høje, farverige udsmykningsblokke. De kan placeres på gulve og vægge. Bannere kan præges med et væld af mønste ved at bruge meget farvestof ved produktion.
Use crafting to draw a pattern on top of the banner. Emblazoned banners can be emblazoned again to combine various patterns. You can draw up to 12 layers on a banner that way. If the banner includes a gradient, only 3 layers are possible.=Brug håndværk til at tegne et mønster på banneret. Prægede bannere kan præges igen for at skabe forskellige mønstre. Du kan lave op til 12 lag ovenpå hinanden. Hvis banneret har en gradient, kan du kun lave 3 lag.
You can copy the pattern of a banner by placing two banners of the same color in the crafting grid—one needs to be emblazoned, the other one must be clean. Finally, you can use a banner on a cauldron with water to wash off its top-most layer.=Du kan kopiere menteret på et banner ved at placere to bannere i den samme farve i håndværksgitteret. Det ene skal være præget, det andet rent. Du kan også bruge et banner på en keddel med vand for at vaske det øverste lag af.
@1 Bordure=@1 kantbånd
@1 Bricks=@1 mursten
@1 Roundel=@1 rundstok
@1 Creeper Charge=@1 creeper
@1 Saltire=@1 saltire
@1 Bordure Indented=@1 kantbånd med savtakker
@1 Per Bend Inverted=@1 nederste venstre diagnoal halvfarvning
@1 Per Bend Sinister Inverted=@1 nederste højre diagonal halvfarvning
@1 Per Bend=@1 øverste højre diagonal halvfarvning
@1 Per Bend Sinister=@1 øverste venstre diagonal halvfarvning
@1 Flower Charge=@1 blomst
@1 Gradient=@1 gradvist oppefra
@1 Base Gradient=@1 gradvist nedefra
@1 Per Fess Inverted=@1 nederste halvdel
@1 Per Fess=@1 øverste halvdel
@1 Per Pale=@1 venstre halvdel
@1 Per Pale Inverted=@1 højre halvdel
@1 Thing Charge=Mojang
@1 Lozenge=Rhombe
@1 Skull Charge=@1 dødningehovde
@1 Paly=@1 lodrette striber
@1 Base Dexter Canton=@1 nederste højre hjørne
@1 Base Sinister Canton=@1 nederste venstre hjørne
@1 Chief Dexter Canton=@1 øverste højre hjørne
@1 Chief Sinister Canton=@1 øverste venstre hjørne
@1 Cross=@1 kryds
@1 Base=@1 bundstribe
@1 Pale=@1 lodret centerstribe
@1 Bend Sinister=@1 diagonal stribe fra nederste venstre hjørne
@1 Bend=@1 diagonal stribe fra nederste højre hjørne
@1 Pale Dexter=@1 venstrestribe
@1 Fess=@1 vandret midterstribe
@1 Pale Sinister=@1 højrestribe
@1 Chief=@1 topstribe
@1 Chevron=@1 bundtrekant
@1 Chevron Inverted=@1 toptrekant
@1 Base Indented=@1 savtakker i bunden
@1 Chief Indented=@1 savtakker i toppen
And one additional layer=Og ét yderligere lag
And @1 additional layers=Og @1 yderligere lag
Paintable decoration=Udsmykning som kan males

View File

@ -8,6 +8,7 @@ local open_barrels = {}
local drop_content = mcl_util.drop_items_from_meta_container("main") local drop_content = mcl_util.drop_items_from_meta_container("main")
---@param pos Vector
local function on_blast(pos) local function on_blast(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
drop_content(pos, node) drop_content(pos, node)
@ -45,30 +46,34 @@ local function barrel_open(pos, node, clicker)
local playername = clicker:get_player_name() local playername = clicker:get_player_name()
minetest.show_formspec(playername, minetest.show_formspec(playername,
"mcl_barrels:barrel_"..pos.x.."_"..pos.y.."_"..pos.z, "mcl_barrels:barrel_" .. pos.x .. "_" .. pos.y .. "_" .. pos.z,
table.concat({ table.concat({
"size[9,8.75]", "formspec_version[4]",
"label[0,0;"..F(C("#313131", name)).."]", "size[11.75,10.425]",
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]",
mcl_formspec.get_itemslot_bg(0, 0.5, 9, 3), "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, name)) .. "]",
"label[0,4.0;"..F(C("#313131", S("Inventory"))).."]", mcl_formspec.get_itemslot_bg_v4(0.375, 0.75, 9, 3),
"list[current_player;main;0,4.5;9,3;9]", "list[nodemeta:" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ";main;0.375,0.75;9,3;]",
mcl_formspec.get_itemslot_bg(0, 4.5, 9, 3), "label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
"list[current_player;main;0,7.74;9,1;]", mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
mcl_formspec.get_itemslot_bg(0, 7.74, 9, 1), "list[current_player;main;0.375,5.1;9,3;9]",
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
"listring[nodemeta:" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ";main]",
"listring[current_player;main]", "listring[current_player;main]",
}) })
) )
minetest.swap_node(pos, { name = "mcl_barrels:barrel_open", param2 = node.param2 }) minetest.swap_node(pos, { name = "mcl_barrels:barrel_open", param2 = node.param2 })
open_barrels[playername] = pos open_barrels[playername] = pos
minetest.sound_play({name="mcl_barrels_default_barrel_open", pos=pos, gain=0.5, max_hear_distance=16}, true) minetest.sound_play({ name = "mcl_barrels_default_barrel_open", pos = pos, gain = 0.5, max_hear_distance = 16 }, true)
end end
---@param pos Vector
local function close_forms(pos) local function close_forms(pos)
local players = minetest.get_connected_players() local players = minetest.get_connected_players()
local formname = "mcl_barrels:barrel_"..pos.x.."_"..pos.y.."_"..pos.z local formname = "mcl_barrels:barrel_" .. pos.x .. "_" .. pos.y .. "_" .. pos.z
for p = 1, #players do for p = 1, #players do
if vector.distance(players[p]:get_pos(), pos) <= 30 then if vector.distance(players[p]:get_pos(), pos) <= 30 then
minetest.close_formspec(players[p]:get_player_name(), formname) minetest.close_formspec(players[p]:get_player_name(), formname)
@ -76,15 +81,18 @@ local function close_forms(pos)
end end
end end
---@param pos Vector
local function update_after_close(pos) local function update_after_close(pos)
local node = minetest.get_node_or_nil(pos) local node = minetest.get_node_or_nil(pos)
if not node then return end if not node then return end
if node.name == "mcl_barrels:barrel_open" then if node.name == "mcl_barrels:barrel_open" then
minetest.swap_node(pos, {name = "mcl_barrels:barrel_closed", param2 = node.param2}) minetest.swap_node(pos, { name = "mcl_barrels:barrel_closed", param2 = node.param2 })
minetest.sound_play({name="mcl_barrels_default_barrel_close", pos=pos, gain=0.5, max_hear_distance=16}, true) minetest.sound_play({ name = "mcl_barrels_default_barrel_close", pos = pos, gain = 0.5, max_hear_distance = 16 },
true)
end end
end end
---@param player ObjectRef
local function close_barrel(player) local function close_barrel(player)
local name = player:get_player_name() local name = player:get_player_name()
local open = open_barrels[name] local open = open_barrels[name]
@ -102,20 +110,22 @@ minetest.register_node("mcl_barrels:barrel_closed", {
_tt_help = S("27 inventory slots"), _tt_help = S("27 inventory slots"),
_doc_items_longdesc = S("Barrels are containers which provide 27 inventory slots."), _doc_items_longdesc = S("Barrels are containers which provide 27 inventory slots."),
_doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."), _doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."),
tiles = {"mcl_barrels_barrel_top.png^[transformR270", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png"}, tiles = { "mcl_barrels_barrel_top.png^[transformR270", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
minetest.rotate_and_place(itemstack, placer, pointed_thing, minetest.is_creative_enabled(placer:get_player_name()), {}, false) minetest.rotate_and_place(itemstack, placer, pointed_thing,
minetest.is_creative_enabled(placer:get_player_name()), {}
, false)
return itemstack return itemstack
end, end,
stack_max = 64, stack_max = 64,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
groups = {handy = 1, axey = 1, container = 2, material_wood = 1, flammable = -1, deco_block = 1}, groups = { handy = 1, axey = 1, container = 2, material_wood = 1, flammable = -1, deco_block = 1 },
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main", 9*3) inv:set_size("main", 9 * 3)
end, end,
after_place_node = function(pos, placer, itemstack, pointed_thing) after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name")) minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name"))
@ -124,16 +134,16 @@ minetest.register_node("mcl_barrels:barrel_closed", {
allow_metadata_inventory_take = protection_check_put_take, allow_metadata_inventory_take = protection_check_put_take,
allow_metadata_inventory_put = protection_check_put_take, allow_metadata_inventory_put = protection_check_put_take,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" moves stuff in barrel at "..minetest.pos_to_string(pos)) " moves stuff in barrel at " .. minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" moves stuff to barrel at "..minetest.pos_to_string(pos)) " moves stuff to barrel at " .. minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" takes stuff from barrel at "..minetest.pos_to_string(pos)) " takes stuff from barrel at " .. minetest.pos_to_string(pos))
end, end,
after_dig_node = drop_content, after_dig_node = drop_content,
on_blast = on_blast, on_blast = on_blast,
@ -149,27 +159,35 @@ minetest.register_node("mcl_barrels:barrel_open", {
_doc_items_longdesc = S("Barrels are containers which provide 27 inventory slots."), _doc_items_longdesc = S("Barrels are containers which provide 27 inventory slots."),
_doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."), _doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."),
_doc_items_create_entry = false, _doc_items_create_entry = false,
tiles = {"mcl_barrels_barrel_top_open.png", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png"}, tiles = { "mcl_barrels_barrel_top_open.png", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png" },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
drop = "mcl_barrels:barrel_closed", drop = "mcl_barrels:barrel_closed",
stack_max = 64, stack_max = 64,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
groups = {handy = 1, axey = 1, container = 2, material_wood = 1, flammable = -1, deco_block = 1, not_in_creative_inventory = 1}, groups = {
handy = 1,
axey = 1,
container = 2,
material_wood = 1,
flammable = -1,
deco_block = 1,
not_in_creative_inventory = 1
},
allow_metadata_inventory_move = protection_check_move, allow_metadata_inventory_move = protection_check_move,
allow_metadata_inventory_take = protection_check_put_take, allow_metadata_inventory_take = protection_check_put_take,
allow_metadata_inventory_put = protection_check_put_take, allow_metadata_inventory_put = protection_check_put_take,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" moves stuff in barrel at "..minetest.pos_to_string(pos)) " moves stuff in barrel at " .. minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" moves stuff to barrel at "..minetest.pos_to_string(pos)) " moves stuff to barrel at " .. minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" takes stuff from barrel at "..minetest.pos_to_string(pos)) " takes stuff from barrel at " .. minetest.pos_to_string(pos))
end, end,
after_dig_node = drop_content, after_dig_node = drop_content,
on_blast = on_blast, on_blast = on_blast,
@ -193,10 +211,10 @@ end)
minetest.register_craft({ minetest.register_craft({
output = "mcl_barrels:barrel_closed", output = "mcl_barrels:barrel_closed",
recipe = { recipe = {
{"group:wood", "group:wood_slab", "group:wood"}, { "group:wood", "group:wood_slab", "group:wood" },
{"group:wood", "", "group:wood"}, { "group:wood", "", "group:wood" },
{"group:wood", "group:wood_slab", "group:wood"}, { "group:wood", "group:wood_slab", "group:wood" },
} },
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -0,0 +1,5 @@
# textdomain: mcl_barrels
Barrel=Tønde
Barrels are containers which provide 27 inventory slots.=Tønder er beholdere som kan give 27 oppakningspladser.
To access its inventory, rightclick it. When broken, the items will drop out.=For at tilgå dens indhold kan du højre-klikke. Når den ødelægges falder genstandene ud.
27 inventory slots=27 indholdsspladser.

View File

@ -1,5 +1,5 @@
# textdomain: mcl_barrels # textdomain: mcl_barrels
Barrel= Barrel=Бочка
Barrels are containers which provide 27 inventory slots.= Barrels are containers which provide 27 inventory slots.=Бочки — это хранилища, у которых 27 ячеек хранения.
To access its inventory, rightclick it. When broken, the items will drop out.= To access its inventory, rightclick it. When broken, the items will drop out.=Чтобы получить доступ к хранилищу, нажмите по нему правой кнопкой мыши. Если его сломать, тогда выпадут предметы.
27 inventory slots= 27 inventory slots=27 ячеек хранения

View File

@ -89,7 +89,7 @@ local function get_beacon_beam(glass_nodename)
end end
minetest.register_node("mcl_beacons:beacon_beam", { minetest.register_node("mcl_beacons:beacon_beam", {
tiles = {"^[colorize:#b8bab9"}, tiles = {"blank.png^[noalpha^[colorize:#b8bab9"},
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",

View File

@ -0,0 +1,6 @@
# textdomain: mcl_beacons
Beacon=Magisk fyrtårn
Beacon:=Magisk fyrtårn:
Primary Power:=Primær kraft:
Inventory:=Indhold:

View File

@ -0,0 +1,6 @@
# textdomain: mcl_beacons
Beacon=Маяк
Beacon:=Маяк:
Primary Power:=Основной эффект:
Inventory:=Инвентарь:

View File

@ -0,0 +1,43 @@
# textdomain: mcl_beds
Beds allow you to sleep at night and make the time pass faster.=Senge giver dig mulighed for at sove om natten, og få tiden til at gå hurtigere.
To use a bed, stand close to it and right-click the bed to sleep in it. Sleeping only works when the sun sets, at night or during a thunderstorm. The bed must also be clear of any danger.=For at lægge dig til at sove i en seng skal du stå tæt på den og højre-klikke. Man kan kun sove når solen går ned, om natten eller i tordenvejr.
You have heard of other worlds in which a bed would set the start point for your next life. But this world is not one of them.=Du har hørt om andre verdener hvor en seng var udgangspunktet for dit næste liv, men denne verden er ikke en af dem.
By using a bed, you set the starting point for your next life. If you die, you will start your next life at this bed, unless it is obstructed or destroyed.=Ved at bruge en sætter du udgangspunktet for dit næste liv. Hvis du dør, vil dit næste liv starte i denne seng, medmindre sengen bliver blokeret eller ødelagt.
In this world, going to bed won't skip the night, but it will skip thunderstorms.=I denne verden, springer det ikke natten over at sove, men det springer tordenvejr over.
Sleeping allows you to skip the night. The night is skipped when all players in this world went to sleep. The night is skipped after sleeping for a few seconds. Thunderstorms can be skipped in the same manner.=Du kan springe natten over ved at sove. Natten bliver sprunget over hvis alle spillere i verdenen sover. Natten bliver sprunget over efter at have sovet i nogle få sekunder. Tordenvejr kan springes over på samme måde.
Bed=Seng
Red Bed=Rød seng
Blue Bed=Blå seng
Cyan Bed=Cyanblå seng
Grey Bed=Grå seng
Light Grey Bed=Lysegrå seng
Black Bed=Sort senge
Yellow Bed=Gul senge
Green Bed=Grøn seng
Magenta Bed=Magenta seng
Orange Bed=Orange seng
Purple Bed=Lilla seng
Brown Bed=Brun seng
Pink Bed=Lyserød seng
Lime Bed=Limegrøn seng
Light Blue Bed=Lyseblå seng
White Bed=Hvid seng
You can't sleep, the bed's too far away!=Du kan ikke gå i seng, sengen er for langt væk!
This bed is already occupied!=Denne seng er optaget!
You have to stop moving before going to bed!=Du skal stå stille før du kan gå i seng.
You can't sleep now, monsters are nearby!=Du kan ikke lægge dig til at sove nu, der er monstre tæt på!
You can't sleep, the bed is obstructed!=Du kan ikke gå i seng, denne seng er blokeret!
It's too dangerous to sleep here!=Det er for farligt at sove her!
New respawn position set! But you can only sleep at night or during a thunderstorm.=Nyt genopståelsespunt sat! Men du kan kun sover om natten eller under et tordenvejr.
You can only sleep at night or during a thunderstorm.=Du kan kun sover om natten eller under et tordenvejr.
New respawn position set!=Nyt genopståelsespunkt sat!
Leave bed=Forlad seng
Abort sleep=Afbryd søvn
Players in bed: @1/@2=@1 af @2 spillere er gået i seng.
Note: Night skip is disabled.=Bemærk: Det er slået fra at springe natten over.
You're sleeping.=Du sover.
You will fall asleep when all players are in bed.=Du falder i søvn når alle andre spillere er gået i seng.
You will fall asleep when @1% of all players are in bed.=Du falder i søvn når @1% af alle spillere er gået i seng.
You're in bed.=Du er gået i seng.
Allows you to sleep=Gør dig i stand til at sove.
Respawn Anchor=Genopståelsesanker

View File

@ -8,7 +8,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
-- Function to allow harvesting honey and honeycomb from the beehive and bee nest. -- Function to allow harvesting honey and honeycomb from the beehive and bee nest.
local honey_harvest = function(pos, node, player, itemstack, pointed_thing) local honey_harvest = function(pos, node, player, itemstack, pointed_thing)
local inv = player:get_inventory() local inv = player:get_inventory()
local shears = player:get_wielded_item():get_name() == "mcl_tools:shears" local shears = minetest.get_item_group(player:get_wielded_item():get_name(), "shears") > 0
local bottle = player:get_wielded_item():get_name() == "mcl_potions:glass_bottle" local bottle = player:get_wielded_item():get_name() == "mcl_potions:glass_bottle"
local beehive = "mcl_beehives:beehive" local beehive = "mcl_beehives:beehive"
local is_creative = minetest.is_creative_enabled(player:get_player_name()) local is_creative = minetest.is_creative_enabled(player:get_player_name())

View File

@ -0,0 +1,4 @@
Beehive=Bistade
Artificial bee nest.=Kunstigt bibo.
Bee Nest=Bibo
A naturally generating block that houses bees and a tasty treat...if you can get it.=En naturligt genereret blok som indeholde bier og velsmagende godter... hvis du kan få fat i dem.

View File

@ -0,0 +1,2 @@
# textdomain: mcl_bells
Bell=Klokke

View File

@ -36,7 +36,13 @@ minetest.register_node("mcl_blackstone:blackstone_gilded", {
_mcl_blast_resistance = 2, _mcl_blast_resistance = 2,
_mcl_hardness = 2, _mcl_hardness = 2,
_mcl_silk_touch_drop = true, _mcl_silk_touch_drop = true,
_mcl_fortune_drop = mcl_core.fortune_drop_ore, _mcl_fortune_drop = {
discrete_uniform_distribution = true,
items = {"mcl_core:gold_nugget"},
min_count = 2,
max_count = 5,
cap = 5,
},
}) })
minetest.register_node("mcl_blackstone:nether_gold", { minetest.register_node("mcl_blackstone:nether_gold", {
description = S("Nether Gold Ore"), description = S("Nether Gold Ore"),

View File

@ -0,0 +1,28 @@
# textdomain: mcl_blackstone
Blackstone=Sortsten
Polished Blackstone=Poleret sortsten
Chiseled Polished Blackstone=Majslet poleret sortsten
Polished Blackstone Bricks=Poleret sortsten-mursten
Basalt=Basalt
Polished Basalt=Poleret basalt
Blackstone Slab=Sortstensflise
Polished Blackstone Slab=Poleret sortstensflise
Chiseled Polished Blackstone Slab=Majslet poleret sortstensflise
Polished Blackstone Brick Slab=Poleret sortstens-murstensflise
Blackstone Stair=Sortstenstrappe
Polished Blackstone Stair=Poleret sortstenstrappe
Chiseled Polished Blackstone Stair=Majslet poleret sortstenstrappe
Polished Blackstone Brick Stair=Poleret sortstens-murstenstrappe
Quartz Bricks=Qvarts-mursten
Soul Torch=Sjæleildsfakkel
Soul Lantern=Sjældeildslaterne
Soul Soil=Sjælejord
Eternal Soul Fire=Evig sjæleild
Gilded Blackstone=Forgyldt sortsten
Nether Gold Ore=Nether guldmalm
Smooth Basalt=Glat basalt
Blackstone Wall=Sorstensmur
Double Blackstone Slab=Dobbelt sortstensflise
Polished Double Blackstone Slab=Poleret dobbelt sortstensflise
Double Chiseled Polished Blackstone Slab=Dobbelt majslet poleret sortstensflise
Double Polished Blackstone Brick Slab=Dobbelt poleret sortstens-murstensflise

View File

@ -0,0 +1,29 @@
# textdomain: mcl_blackstone
Blackstone=Чернит
Polished Blackstone=Полированный чернит
Chiseled Polished Blackstone=Резной полированный чернит
Polished Blackstone Bricks=Полированный чернокаменный кирпич
Basalt=Базальт
Polished Basalt=Полированный базальт
Blackstone Slab=Чернитная плита
Polished Blackstone Slab=Плита из полированного чернита
Chiseled Polished Blackstone Slab=Резная полированная чернитная плита
Polished Blackstone Brick Slab=Плита из полированно-чернитного кирпича
Blackstone Stair=Чернитные ступеньки
Polished Blackstone Stair=Ступеньки из полированно-чернитного кирпича
Chiseled Polished Blackstone Stair=Резные полированные чернитные ступеньки
Polished Blackstone Brick Stair=Ступеньки из полированно-чернитного кирпича
Quartz Bricks=Кварцевые кирпичи
Soul Torch=Факел душ
Torches are light sources which can be placed at the side or on the top of most blocks.=Факелы - это источники света, которые могут быть размещены сбоку или сверху большинства блоков.
Soul Lantern=Фонарь душ
Soul Soil=Почва душ
Eternal Soul Fire=Пламя душ
Gilded Blackstone=Золочёный чернит
Nether Gold Ore=Незерская золотая руда
Smooth Basalt=Гладкий базальт
Blackstone Wall=Чернитная стена
Double Blackstone Slab=Двойная чернитная плита
Polished Double Blackstone Slab=Полированная двойная чернитная плита
Double Chiseled Polished Blackstone Slab=Двойная резная полированная чернитная плита
Double Polished Blackstone Brick Slab=Двойная плита из полированно-чернитного кирпича

View File

@ -1,5 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local F = minetest.formspec_escape
local LIGHT_ACTIVE_FURNACE = 13 local LIGHT_ACTIVE_FURNACE = 13
@ -8,60 +9,82 @@ local LIGHT_ACTIVE_FURNACE = 13
-- --
local function active_formspec(fuel_percent, item_percent) local function active_formspec(fuel_percent, item_percent)
return "size[9,8.75]".. return table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Blast Furnace"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Blast Furnace"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png^[lowpart:" ..
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. (100 - fuel_percent) .. ":default_furnace_fire_fg.png]",
"list[context;fuel;2.75,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
"list[context;dst;5.75,1.5;1,1;]".. "list[context;fuel;3.5,3.25;1,1;]",
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1)..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[lowpart:" ..
(100-fuel_percent)..":default_furnace_fire_fg.png]".. (item_percent) .. ":gui_furnace_arrow_fg.png^[transformR270]",
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. "list[context;dst;7.875,2;1,1;]",
-- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. "label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. "list[current_player;main;0.375,5.1;9,3;9]",
"listring[context;dst]"..
"listring[current_player;main]".. mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"listring[context;src]".. "list[current_player;main;0.375,9.05;9,1;]",
"listring[current_player;main]"..
"listring[context;fuel]".. -- Craft guide button temporarily removed due to Minetest bug.
"listring[current_player;main]" -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]",
"listring[current_player;main]",
"listring[context;src]",
"listring[current_player;main]",
"listring[context;fuel]",
"listring[current_player;main]",
})
end end
local inactive_formspec = "size[9,8.75]".. local inactive_formspec = table.concat({
"label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "formspec_version[4]",
"list[current_player;main;0,4.5;9,3;9]".. "size[11.75,10.425]",
mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Blast Furnace"))) .. "]",
"list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 0.75, 1, 1),
mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "list[context;src;3.5,0.75;1,1;]",
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Blast Furnace"))).."]"..
"list[context;src;2.75,0.5;1,1;]".. "image[3.5,2;1,1;default_furnace_fire_bg.png]",
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
"list[context;fuel;2.75,2.5;1,1;]".. mcl_formspec.get_itemslot_bg_v4(3.5, 3.25, 1, 1),
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. "list[context;fuel;3.5,3.25;1,1;]",
"list[context;dst;5.75,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. "image[5.25,2;1.5,1;gui_furnace_arrow_bg.png^[transformR270]",
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. mcl_formspec.get_itemslot_bg_v4(7.875, 2, 1, 1, 0.2),
"list[context;dst;7.875,2;1,1;]",
"label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
-- Craft guide button temporarily removed due to Minetest bug. -- Craft guide button temporarily removed due to Minetest bug.
-- TODO: Add it back when the Minetest bug is fixed. -- TODO: Add it back when the Minetest bug is fixed.
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. --"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
"listring[context;dst]"..
"listring[current_player;main]".. "listring[context;dst]",
"listring[context;src]".. "listring[current_player;main]",
"listring[current_player;main]".. "listring[context;src]",
"listring[context;fuel]".. "listring[current_player;main]",
"listring[current_player;main]" "listring[context;fuel]",
"listring[current_player;main]",
})
local receive_fields = function(pos, formname, fields, sender) local receive_fields = function(pos, formname, fields, sender)
if fields.craftguide then if fields.craftguide then
@ -71,7 +94,7 @@ end
local function give_xp(pos, player) local function give_xp(pos, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2), -1.95)
local xp = meta:get_int("xp") local xp = meta:get_int("xp")
if xp > 0 then if xp > 0 then
if player then if player then
@ -99,7 +122,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player)
-- Test stack with size 1 because we burn one fuel at a time -- Test stack with size 1 because we burn one fuel at a time
local teststack = ItemStack(stack) local teststack = ItemStack(stack)
teststack:set_count(1) teststack:set_count(1)
local output, decremented_input = minetest.get_craft_result({method="fuel", width=1, items={teststack}}) local output, decremented_input = minetest.get_craft_result({ method = "fuel", width = 1, items = { teststack } })
if output.time ~= 0 then if output.time ~= 0 then
-- Only allow to place 1 item if fuel get replaced by recipe. -- Only allow to place 1 item if fuel get replaced by recipe.
-- This is the case for lava buckets. -- This is the case for lava buckets.
@ -160,17 +183,17 @@ local function spawn_flames(pos, param2)
local minrelpos, maxrelpos local minrelpos, maxrelpos
local dir = minetest.facedir_to_dir(param2) local dir = minetest.facedir_to_dir(param2)
if dir.x > 0 then if dir.x > 0 then
minrelpos = { x = -0.6, y = -0.05, z = -0.25 } minrelpos = vector.new(-0.6, -0.05, -0.25)
maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } maxrelpos = vector.new(-0.55, -0.45, 0.25)
elseif dir.x < 0 then elseif dir.x < 0 then
minrelpos = { x = 0.55, y = -0.05, z = -0.25 } minrelpos = vector.new(0.55, -0.05, -0.25)
maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } maxrelpos = vector.new(0.6, -0.45, 0.25)
elseif dir.z > 0 then elseif dir.z > 0 then
minrelpos = { x = -0.25, y = -0.05, z = -0.6 } minrelpos = vector.new(-0.25, -0.05, -0.6)
maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } maxrelpos = vector.new(0.25, 0.45, -0.55)
elseif dir.z < 0 then elseif dir.z < 0 then
minrelpos = { x = -0.25, y = -0.05, z = 0.55 } minrelpos = vector.new(-0.25, -0.05, 0.55)
maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } maxrelpos = vector.new(0.25, -0.45, 0.6)
else else
return return
end end
@ -179,8 +202,8 @@ local function spawn_flames(pos, param2)
time = 0, time = 0,
minpos = vector.add(pos, minrelpos), minpos = vector.add(pos, minrelpos),
maxpos = vector.add(pos, maxrelpos), maxpos = vector.add(pos, maxrelpos),
minvel = { x = -0.01, y = 0, z = -0.01 }, minvel = vector.new(-0.01, 0, -0.01),
maxvel = { x = 0.01, y = 0.1, z = 0.01 }, maxvel = vector.new(0.01, 0.1, 0.01),
minexptime = 0.3, minexptime = 0.3,
maxexptime = 0.6, maxexptime = 0.6,
minsize = 0.4, minsize = 0.4,
@ -293,7 +316,7 @@ local function blast_furnace_node_timer(pos, elapsed)
-- Check if we have cookable content: cookable -- Check if we have cookable content: cookable
local aftercooked local aftercooked
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) cooked, aftercooked = minetest.get_craft_result({ method = "cooking", width = 1, items = srclist })
cookable = minetest.get_item_group(inv:get_stack("src", 1):get_name(), "blast_furnace_smeltable") == 1 cookable = minetest.get_item_group(inv:get_stack("src", 1):get_name(), "blast_furnace_smeltable") == 1
if cookable then if cookable then
-- Successful cooking requires space in dst slot and time -- Successful cooking requires space in dst slot and time
@ -311,7 +334,7 @@ local function blast_furnace_node_timer(pos, elapsed)
if cookable and not active then if cookable and not active then
-- We need to get new fuel -- We need to get new fuel
local afterfuel local afterfuel
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) fuel, afterfuel = minetest.get_craft_result({ method = "fuel", width = 1, items = fuellist })
if fuel.time == 0 then if fuel.time == 0 then
-- No valid fuel in fuel list -- stop -- No valid fuel in fuel list -- stop
@ -343,7 +366,7 @@ local function blast_furnace_node_timer(pos, elapsed)
srclist = inv:get_list("src") srclist = inv:get_list("src")
src_time = 0 src_time = 0
meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count
end end
end end
@ -390,9 +413,9 @@ local function blast_furnace_node_timer(pos, elapsed)
meta:set_float("fuel_time", fuel_time) meta:set_float("fuel_time", fuel_time)
meta:set_float("src_time", src_time) meta:set_float("src_time", src_time)
if srclist then if srclist then
meta:set_string("src_item", src_item) meta:set_string("src_item", src_item)
else else
meta:set_string("src_item", "") meta:set_string("src_item", "")
end end
meta:set_string("formspec", formspec) meta:set_string("formspec", formspec)
@ -415,13 +438,14 @@ end
minetest.register_node("mcl_blast_furnace:blast_furnace", { minetest.register_node("mcl_blast_furnace:blast_furnace", {
description = S("Blast Furnace"), description = S("Blast Furnace"),
_tt_help = S("Smelts ores faster than furnace"), _tt_help = S("Smelts ores faster than furnace"),
_doc_items_longdesc = S("Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, but twice as fast as a normal furnace."), _doc_items_longdesc = S(
"Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, but twice as fast as a normal furnace."),
_doc_items_usagehelp = _doc_items_usagehelp =
S("Use the blast furnace to open the furnace menu.").."\n".. S("Use the blast furnace to open the furnace menu.") .. "\n" ..
S("Place a furnace fuel in the lower slot and the source material in the upper slot.").."\n".. S("Place a furnace fuel in the lower slot and the source material in the upper slot.") .. "\n" ..
S("The blast furnace will slowly use its fuel to smelt the item.").."\n".. S("The blast furnace will slowly use its fuel to smelt the item.") .. "\n" ..
S("The result will be placed into the output slot at the right side.").."\n".. S("The result will be placed into the output slot at the right side.") .. "\n" ..
S("Use the recipe book to see what ores you can smelt, what you can use as fuel and how long it will burn."), S("Use the recipe book to see what ores you can smelt, what you can use as fuel and how long it will burn."),
_doc_items_hidden = false, _doc_items_hidden = false,
tiles = { tiles = {
"blast_furnace_top.png", "blast_furnace_top.png", "blast_furnace_top.png", "blast_furnace_top.png",
@ -429,7 +453,7 @@ minetest.register_node("mcl_blast_furnace:blast_furnace", {
"blast_furnace_side.png", "blast_furnace_front.png" "blast_furnace_side.png", "blast_furnace_front.png"
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {pickaxey=1, container=4, deco_block=1, material_stone=1}, groups = { pickaxey = 1, container = 4, deco_block = 1, material_stone = 1 },
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
@ -439,11 +463,10 @@ minetest.register_node("mcl_blast_furnace:blast_furnace", {
local meta2 = meta:to_table() local meta2 = meta:to_table()
meta:from_table(oldmetadata) meta:from_table(oldmetadata)
local inv = meta:get_inventory() local inv = meta:get_inventory()
for _, listname in ipairs({"src", "dst", "fuel"}) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} minetest.add_item(vector.offset(pos, math.random(0, 10) / 10 - 0.5, 0, math.random(0, 10) / 10 - 0.5), stack)
minetest.add_item(p, stack)
end end
end end
meta:from_table(meta2) meta:from_table(meta2)
@ -499,14 +522,16 @@ minetest.register_node("mcl_blast_furnace:blast_furnace_active", {
tiles = { tiles = {
"blast_furnace_top.png", "blast_furnace_top.png", "blast_furnace_top.png", "blast_furnace_top.png",
"blast_furnace_side.png", "blast_furnace_side.png", "blast_furnace_side.png", "blast_furnace_side.png",
"blast_furnace_side.png", {name = "blast_furnace_front_on.png", "blast_furnace_side.png", {
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48}}, name = "blast_furnace_front_on.png",
animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 48 }
},
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = "light", paramtype = "light",
light_source = LIGHT_ACTIVE_FURNACE, light_source = LIGHT_ACTIVE_FURNACE,
drop = "mcl_blast_furnace:blast_furnace", drop = "mcl_blast_furnace:blast_furnace",
groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, groups = { pickaxey = 1, container = 4, deco_block = 1, not_in_creative_inventory = 1, material_stone = 1 },
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
on_timer = blast_furnace_node_timer, on_timer = blast_furnace_node_timer,
@ -516,10 +541,14 @@ minetest.register_node("mcl_blast_furnace:blast_furnace_active", {
local meta2 = meta local meta2 = meta
meta:from_table(oldmetadata) meta:from_table(oldmetadata)
local inv = meta:get_inventory() local inv = meta:get_inventory()
for _, listname in ipairs({"src", "dst", "fuel"}) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} local p = vector.new(
pos.x + math.random(0, 10) / 10 - 0.5,
pos.y,
pos.z + math.random(0, 10) / 10 - 0.5
)
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end
@ -550,8 +579,8 @@ minetest.register_node("mcl_blast_furnace:blast_furnace_active", {
minetest.register_craft({ minetest.register_craft({
output = "mcl_blast_furnace:blast_furnace", output = "mcl_blast_furnace:blast_furnace",
recipe = { recipe = {
{ "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:iron_ingot", "mcl_furnaces:furnace", "mcl_core:iron_ingot" }, { "mcl_core:iron_ingot", "mcl_furnaces:furnace", "mcl_core:iron_ingot" },
{ "mcl_core:stone_smooth", "mcl_core:stone_smooth", "mcl_core:stone_smooth" }, { "mcl_core:stone_smooth", "mcl_core:stone_smooth", "mcl_core:stone_smooth" },
} }
}) })
@ -564,10 +593,9 @@ end
minetest.register_lbm({ minetest.register_lbm({
label = "Active blast_furnace flame particles", label = "Active blast_furnace flame particles",
name = "mcl_blast_furnace:flames", name = "mcl_blast_furnace:flames",
nodenames = {"mcl_blast_furnace:blast_furnace_active"}, nodenames = { "mcl_blast_furnace:blast_furnace_active" },
run_at_every_load = true, run_at_every_load = true,
action = function(pos, node) action = function(pos, node)
spawn_flames(pos, node.param2) spawn_flames(pos, node.param2)
end, end,
}) })

View File

@ -0,0 +1,8 @@
# textdomain: mcl_blast_furnace
Inventory=Indhold
Blast Furnace=Højovn
Smelts ores faster than furnace=Smelter malm hurtere end en normal ovn.
Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn.=Brug opskriftsbogen for at se hvad du kan smelte, hvad du kan bruge som brændsel og hvor længe det brænder.
Use the furnace to open the furnace menu.\nPlace a furnace fuel in the lower slot and the source material in the upper slot.\nThe furnace will slowly use its fuel to smelt the item.\nThe result will be placed into the output slot at the right side.=Brug ovnen for at åbne ovnmenuen. \nPut ovnbrændsel i den nederste plads og det som skal smeltes i den øverste plads.\nOvnen vil langsom bruge dens brændsel til at smelte genstanden.\nResultatet vil blive puttet i pladsen på højre side.
Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, into something else.=Højovne kan, ved brug af brændsel, smelte flere genstande, hovedsageligt malm og rustning, og lave dem til noget andet.
Active Blast Furnace=Aktiv højovn

View File

@ -0,0 +1,11 @@
# textdomain: mcl_blast_furnace
Inventory=Inventario
Blast Furnace=Alto horno
Smelts ores faster than furnace=Funde menas más rápido que el horno
Use the recipe book to see what ores you can smelt, what you can use as fuel and how long it will burn.=Use el libro de recetas para ver que menas puede fundir, qué puede usar como combustible y durante cuánto tiempo arderá.
Use the blast furnace to open the furnace menu.=Use el alto horno para abrir el menú del horno.
Place a furnace fuel in the lower slot and the source material in the upper slot.=Coloque un combustible de horno en la ranura inferior y el material de origen en la ranura superior.
The blast furnace will slowly use its fuel to smelt the item.=El alto horno usará lentamente su combustible para fundir el artículo.
The result will be placed into the output slot at the right side.=El resultado se colocará en la ranura de salida en el lado derecho.
Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, but twice as fast as a normal furnace.=Los altos hornos funden varios artículos, principalmente menas y armadura, usando combustible de horno, pero el doble de rápido que un horno normal.
Active Blast Furnace=Alto horno activo

View File

@ -5,7 +5,7 @@ local C = minetest.colorize
local max_text_length = 4500 -- TODO: Increase to 12800 when scroll bar was added to written book local max_text_length = 4500 -- TODO: Increase to 12800 when scroll bar was added to written book
local max_title_length = 64 local max_title_length = 64
local bookshelf_inv = minetest.settings:get_bool("mcl_bookshelf_inventories",true) local bookshelf_inv = minetest.settings:get_bool("mcl_bookshelf_inventories", true)
local header = "" local header = ""
if minetest.get_modpath("mcl_init") then if minetest.get_modpath("mcl_init") then
@ -19,7 +19,7 @@ minetest.register_craftitem("mcl_books:book", {
_doc_items_longdesc = S("Books are used to make bookshelves and book and quills."), _doc_items_longdesc = S("Books are used to make bookshelves and book and quills."),
inventory_image = "default_book.png", inventory_image = "default_book.png",
stack_max = 64, stack_max = 64,
groups = { book=1, craftitem = 1, enchantability = 1 }, groups = { book = 1, craftitem = 1, enchantability = 1 },
_mcl_enchanting_enchanted_tool = "mcl_enchanting:book_enchanted", _mcl_enchanting_enchanted_tool = "mcl_enchanting:book_enchanted",
}) })
@ -85,18 +85,19 @@ local function write(itemstack, user, pointed_thing)
local node = minetest.get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
if user and not user:get_player_control().sneak then if user and not user:get_player_control().sneak then
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack) or itemstack return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack) or
itemstack
end end
end end
end end
local text = get_text(itemstack) local text = get_text(itemstack)
local formspec = "size[8,9]".. local formspec = "size[8,9]" ..
header.. header ..
"background[-0.5,-0.5;9,10;mcl_books_book_bg.png]".. "background[-0.5,-0.5;9,10;mcl_books_book_bg.png]" ..
"textarea[0.75,0.1;7.25,9;text;;"..minetest.formspec_escape(text).."]".. "textarea[0.75,0.1;7.25,9;text;;" .. minetest.formspec_escape(text) .. "]" ..
"button[0.75,7.95;3,1;sign;"..minetest.formspec_escape(S("Sign")).."]".. "button[0.75,7.95;3,1;sign;" .. minetest.formspec_escape(S("Sign")) .. "]" ..
"button_exit[4.25,7.95;3,1;ok;"..minetest.formspec_escape(S("Done")).."]" "button_exit[4.25,7.95;3,1;ok;" .. minetest.formspec_escape(S("Done")) .. "]"
minetest.show_formspec(user:get_player_name(), "mcl_books:writable_book", formspec) minetest.show_formspec(user:get_player_name(), "mcl_books:writable_book", formspec)
end end
@ -106,17 +107,18 @@ local function read(itemstack, user, pointed_thing)
local node = minetest.get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
if user and not user:get_player_control().sneak then if user and not user:get_player_control().sneak then
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack) or itemstack return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack) or
itemstack
end end
end end
end end
local text = get_text(itemstack) local text = get_text(itemstack)
local formspec = "size[8,9]".. local formspec = "size[8,9]" ..
header.. header ..
"background[-0.5,-0.5;9,10;mcl_books_book_bg.png]".. "background[-0.5,-0.5;9,10;mcl_books_book_bg.png]" ..
"textarea[0.75,0.1;7.25,9;;"..minetest.formspec_escape(text)..";]".. "textarea[0.75,0.1;7.25,9;;" .. minetest.formspec_escape(text) .. ";]" ..
"button_exit[2.25,7.95;3,1;ok;"..minetest.formspec_escape(S("Done")).."]" "button_exit[2.25,7.95;3,1;ok;" .. minetest.formspec_escape(S("Done")) .. "]"
minetest.show_formspec(user:get_player_name(), "mcl_books:written_book", formspec) minetest.show_formspec(user:get_player_name(), "mcl_books:written_book", formspec)
end end
@ -125,16 +127,18 @@ minetest.register_craftitem("mcl_books:writable_book", {
description = S("Book and Quill"), description = S("Book and Quill"),
_tt_help = S("Write down some notes"), _tt_help = S("Write down some notes"),
_doc_items_longdesc = S("This item can be used to write down some notes."), _doc_items_longdesc = S("This item can be used to write down some notes."),
_doc_items_usagehelp = S("Hold it in the hand, then rightclick to read the current notes and edit then. You can edit the text as often as you like. You can also sign the book which turns it into a written book which you can stack, but it can't be edited anymore.").."\n".. _doc_items_usagehelp = S(
S("A book can hold up to 4500 characters. The title length is limited to 64 characters."), "Hold it in the hand, then rightclick to read the current notes and edit then. You can edit the text as often as you like. You can also sign the book which turns it into a written book which you can stack, but it can't be edited anymore.")
.. "\n" ..
S("A book can hold up to 4500 characters. The title length is limited to 64 characters."),
inventory_image = "mcl_books_book_writable.png", inventory_image = "mcl_books_book_writable.png",
groups = { book=1 }, groups = { book = 1 },
stack_max = 1, stack_max = 1,
on_place = write, on_place = write,
on_secondary_use = write, on_secondary_use = write,
}) })
minetest.register_on_player_receive_fields(function ( player, formname, fields ) minetest.register_on_player_receive_fields(function(player, formname, fields)
if ((formname == "mcl_books:writable_book") and fields and fields.text) then if ((formname == "mcl_books:writable_book") and fields and fields.text) then
local stack = player:get_wielded_item() local stack = player:get_wielded_item()
if (stack:get_name() and (stack:get_name() == "mcl_books:writable_book")) then if (stack:get_name() and (stack:get_name() == "mcl_books:writable_book")) then
@ -148,14 +152,17 @@ minetest.register_on_player_receive_fields(function ( player, formname, fields )
player:set_wielded_item(stack) player:set_wielded_item(stack)
local name = player:get_player_name() local name = player:get_player_name()
local formspec = "size[8,9]".. local formspec = "size[8,9]" ..
header.. header ..
"background[-0.5,-0.5;9,10;mcl_books_book_bg.png]".. "background[-0.5,-0.5;9,10;mcl_books_book_bg.png]" ..
"field[0.75,1;7.25,1;title;"..minetest.formspec_escape(minetest.colorize("#000000", S("Enter book title:")))..";]".. "field[0.75,1;7.25,1;title;" ..
"label[0.75,1.5;"..minetest.formspec_escape(minetest.colorize("#404040", S("by @1", name))).."]".. minetest.formspec_escape(minetest.colorize("#000000", S("Enter book title:"))) .. ";]" ..
"button_exit[0.75,7.95;3,1;sign;"..minetest.formspec_escape(S("Sign and Close")).."]".. "label[0.75,1.5;" ..
"tooltip[sign;"..minetest.formspec_escape(S("Note: The book will no longer be editable after signing")).."]".. minetest.formspec_escape(minetest.colorize("#404040", S("by @1", name))) .. "]" ..
"button[4.25,7.95;3,1;cancel;"..minetest.formspec_escape(S("Cancel")).."]" "button_exit[0.75,7.95;3,1;sign;" .. minetest.formspec_escape(S("Sign and Close")) .. "]" ..
"tooltip[sign;" ..
minetest.formspec_escape(S("Note: The book will no longer be editable after signing")) .. "]" ..
"button[4.25,7.95;3,1;cancel;" .. minetest.formspec_escape(S("Cancel")) .. "]"
minetest.show_formspec(player:get_player_name(), "mcl_books:signing", formspec) minetest.show_formspec(player:get_player_name(), "mcl_books:signing", formspec)
end end
end end
@ -181,7 +188,7 @@ minetest.register_on_player_receive_fields(function ( player, formname, fields )
player:set_wielded_item(newbook) player:set_wielded_item(newbook)
else else
minetest.log("error", "[mcl_books] "..name.." failed to sign a book!") minetest.log("error", "[mcl_books] " .. name .. " failed to sign a book!")
end end
elseif ((formname == "mcl_books:signing") and fields and fields.cancel) then elseif ((formname == "mcl_books:signing") and fields and fields.cancel) then
local book = player:get_wielded_item() local book = player:get_wielded_item()
@ -202,12 +209,16 @@ end
-- Written Book -- Written Book
minetest.register_craftitem("mcl_books:written_book", { minetest.register_craftitem("mcl_books:written_book", {
description = S("Written Book"), description = S("Written Book"),
_doc_items_longdesc = S("Written books contain some text written by someone. They can be read and copied, but not edited."), _doc_items_longdesc = S(
_doc_items_usagehelp = S("Hold it in your hand, then rightclick to read the book.").."\n\n".. "Written books contain some text written by someone. They can be read and copied, but not edited."
),
S("To copy the text of the written book, place it into the crafting grid together with a book and quill (or multiple of those) and craft. The written book will not be consumed. Copies of copies can not be copied."), _doc_items_usagehelp = S("Hold it in your hand, then rightclick to read the book.") ..
"\n\n" ..
S(
"To copy the text of the written book, place it into the crafting grid together with a book and quill (or multiple of those) and craft. The written book will not be consumed. Copies of copies can not be copied."
),
inventory_image = "mcl_books_book_written.png", inventory_image = "mcl_books_book_written.png",
groups = { not_in_creative_inventory=1, book=1, no_rename=1 }, groups = { not_in_creative_inventory = 1, book = 1, no_rename = 1 },
stack_max = 16, stack_max = 16,
on_place = read, on_place = read,
on_secondary_use = read on_secondary_use = read
@ -219,19 +230,19 @@ S("To copy the text of the written book, place it into the crafting grid togethe
local baq = "mcl_books:writable_book" local baq = "mcl_books:writable_book"
local wb = "mcl_books:written_book" local wb = "mcl_books:written_book"
local recipes = { local recipes = {
{wb, baq}, { wb, baq },
{baq, baq, wb}, { baq, baq, wb },
{baq, baq, wb, baq}, { baq, baq, wb, baq },
{baq, baq, baq, baq, wb}, { baq, baq, baq, baq, wb },
{baq, baq, baq, baq, wb, baq}, { baq, baq, baq, baq, wb, baq },
{baq, baq, baq, baq, wb, baq, baq}, { baq, baq, baq, baq, wb, baq, baq },
{baq, baq, baq, baq, wb, baq, baq, baq}, { baq, baq, baq, baq, wb, baq, baq, baq },
{baq, baq, baq, baq, wb, baq, baq, baq, baq}, { baq, baq, baq, baq, wb, baq, baq, baq, baq },
} }
for r=#recipes, 1, -1 do for r = #recipes, 1, -1 do
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = "mcl_books:written_book "..r, output = "mcl_books:written_book " .. r,
recipe = recipes[r], recipe = recipes[r],
}) })
end end
@ -367,6 +378,9 @@ local function protection_check_put_take(pos, listname, index, stack, player)
end end
end end
---@param pos Vector
---@param node node
---@param clicker ObjectRef
local function bookshelf_gui(pos, node, clicker) local function bookshelf_gui(pos, node, clicker)
if not bookshelf_inv then return end if not bookshelf_inv then return end
local name = minetest.get_meta(pos):get_string("name") local name = minetest.get_meta(pos):get_string("name")
@ -378,18 +392,22 @@ local function bookshelf_gui(pos, node, clicker)
local playername = clicker:get_player_name() local playername = clicker:get_player_name()
minetest.show_formspec(playername, minetest.show_formspec(playername,
"mcl_books:bookshelf_"..pos.x.."_"..pos.y.."_"..pos.z, "mcl_books:bookshelf_" .. pos.x .. "_" .. pos.y .. "_" .. pos.z,
table.concat({ table.concat({
"size[9,8.75]", "formspec_version[4]",
"label[0,0;"..F(C("#313131", name)).."]", "size[11.75,10.425]",
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]",
mcl_formspec.get_itemslot_bg(0, 0.5, 9, 3), "label[0.375,0.375;" .. F(C(mcl_formspec.label_color, name)) .. "]",
"label[0,4.0;"..F(C("#313131", S("Inventory"))).."]", mcl_formspec.get_itemslot_bg_v4(0.375, 0.75, 9, 3),
"list[current_player;main;0,4.5;9,3;9]", mcl_formspec.get_itemslot_bg_v4(0.375, 0.75, 9, 3, 0, "mcl_book_book_empty_slot.png"),
mcl_formspec.get_itemslot_bg(0, 4.5, 9, 3), "list[nodemeta:" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ";main;0.375,0.75;9,3;]",
"list[current_player;main;0,7.74;9,1;]", "label[0.375,4.7;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg(0, 7.74, 9, 1), mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3),
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]", "list[current_player;main;0.375,5.1;9,3;9]",
mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1),
"list[current_player;main;0.375,9.05;9,1;]",
"listring[nodemeta:" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ";main]",
"listring[current_player;main]", "listring[current_player;main]",
}) })
) )
@ -397,7 +415,7 @@ end
local function close_forms(pos) local function close_forms(pos)
local players = minetest.get_connected_players() local players = minetest.get_connected_players()
local formname = "mcl_books:bookshelf_"..pos.x.."_"..pos.y.."_"..pos.z local formname = "mcl_books:bookshelf_" .. pos.x .. "_" .. pos.y .. "_" .. pos.z
for p = 1, #players do for p = 1, #players do
if vector.distance(players[p]:get_pos(), pos) <= 30 then if vector.distance(players[p]:get_pos(), pos) <= 30 then
minetest.close_formspec(players[p]:get_player_name(), formname) minetest.close_formspec(players[p]:get_player_name(), formname)
@ -409,12 +427,18 @@ end
minetest.register_node("mcl_books:bookshelf", { minetest.register_node("mcl_books:bookshelf", {
description = S("Bookshelf"), description = S("Bookshelf"),
_doc_items_longdesc = S("Bookshelves are used for decoration."), _doc_items_longdesc = S("Bookshelves are used for decoration."),
tiles = {"mcl_books_bookshelf_top.png", "mcl_books_bookshelf_top.png", "default_bookshelf.png"}, tiles = { "mcl_books_bookshelf_top.png", "mcl_books_bookshelf_top.png", "default_bookshelf.png" },
stack_max = 64, stack_max = 64,
is_ground_content = false, is_ground_content = false,
groups = { groups = {
handy=1, axey=1, deco_block=1, material_wood=1, handy = 1,
flammable=3, fire_encouragement=30, fire_flammability=20, container=1 axey = 1,
deco_block = 1,
material_wood = 1,
flammable = 3,
fire_encouragement = 30,
fire_flammability = 20,
container = 1
}, },
drop = "mcl_books:book 3", drop = "mcl_books:book 3",
sounds = wood_sound, sounds = wood_sound,
@ -424,7 +448,7 @@ minetest.register_node("mcl_books:bookshelf", {
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main", 9*3) inv:set_size("main", 9 * 3)
end, end,
after_place_node = function(pos, placer, itemstack, pointed_thing) after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name")) minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name"))
@ -433,16 +457,16 @@ minetest.register_node("mcl_books:bookshelf", {
allow_metadata_inventory_take = protection_check_put_take, allow_metadata_inventory_take = protection_check_put_take,
allow_metadata_inventory_put = protection_check_put_take, allow_metadata_inventory_put = protection_check_put_take,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" moves stuff in bookshelf at "..minetest.pos_to_string(pos)) " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" moves stuff to bookshelf at "..minetest.pos_to_string(pos)) " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name() ..
" takes stuff from bookshelf at "..minetest.pos_to_string(pos)) " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
end, end,
after_dig_node = drop_content, after_dig_node = drop_content,
on_blast = on_blast, on_blast = on_blast,
@ -453,9 +477,9 @@ minetest.register_node("mcl_books:bookshelf", {
minetest.register_craft({ minetest.register_craft({
output = "mcl_books:bookshelf", output = "mcl_books:bookshelf",
recipe = { recipe = {
{"group:wood", "group:wood", "group:wood"}, { "group:wood", "group:wood", "group:wood" },
{"mcl_books:book", "mcl_books:book", "mcl_books:book"}, { "mcl_books:book", "mcl_books:book", "mcl_books:book" },
{"group:wood", "group:wood", "group:wood"}, { "group:wood", "group:wood", "group:wood" },
} }
}) })
@ -464,4 +488,3 @@ minetest.register_craft({
recipe = "mcl_books:bookshelf", recipe = "mcl_books:bookshelf",
burntime = 15, burntime = 15,
}) })

View File

@ -0,0 +1,28 @@
# textdomain: mcl_books
Book=Bog
Books are used to make bookshelves and book and quills.=Bøger bruges til at lave bogreoler og bog og fjerpen
“@1”="@1"
Copy of “@1”=Kopi af "@1"
Copy of Copy of “@1”=Kopi af kopi af "@1"
Tattered Book=Flosset bog
by @1=af @1
# as in “to sign a book”
Sign=Underskriv
Done=Færdig
This item can be used to write down some notes.=Denne genstand kan bruges til at skrive notater.
Hold it in the hand, then rightclick to read the current notes and edit then. You can edit the text as often as you like. You can also sign the book which turns it into a written book which you can stack, but it can't be edited anymore.=Hold den i hånden, højre-klik så for at læse og redigere aktuelle notater. Du kan redigere teksten så ofte du har lyst. Du kan også signere bogen hvilken gør den til en skrevet bog som du kan gemme, men som ikke kan redigeres mere.
A book can hold up to 4500 characters. The title length is limited to 64 characters.=En bog kan indeholde op til 4500 anslag. Titellængden er begrænset til 64 anslag.
Enter book title:=Indtast bogens titel:
by @1=af @1
Note: The book will no longer be editable after signing=Bemærk: Bogen vil ikke længere kunne redigeres efter signering.
Sign and Close=Signér og luk
Cancel=Afbryd
Nameless Book=Unavngiven bog
Written Book=Skrevet bog
Written books contain some text written by someone. They can be read and copied, but not edited.=Skrevne bøger indeholder tekst som nogen har skrevet. De kan læses og kopieres, men ikke redigeres.
Hold it in your hand, then rightclick to read the book.=Hold den i hånden og højre-klik for at læse bogen.
To copy the text of the written book, place it into the crafting grid together with a book and quill (or multiple of those) and craft. The written book will not be consumed. Copies of copies can not be copied.=For at kopiere teksten i den skrevne bog skal du placere den i arbejdsgitteret sammen med en (eller flere) bog og fjerdpen og udfør. Den skrevne bog bliver ikke opbrugt. Kopier kan ikke kopieres.
Bookshelf=Bogreol
Bookshelves are used for decoration.=Bogreoler bruges til udsmykning.
Book and Quill=Bog og fjerdpen
Write down some notes=Skriv nogle notater

View File

@ -105,8 +105,20 @@ local function player_shoot_arrow(wielditem, player, power, damage, is_critical)
local yaw = player:get_look_horizontal() local yaw = player:get_look_horizontal()
if has_multishot_enchantment then if has_multishot_enchantment then
mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, {x=dir.x, y=dir.y, z=dir.z + .2}, yaw, player, power, damage, is_critical, player:get_wielded_item(), false) -- calculate rotation by 10 degrees 'left' and 'right' of facing direction
mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, {x=dir.x, y=dir.y, z=dir.z - .2}, yaw, player, power, damage, is_critical, player:get_wielded_item(), false) local pitch = player:get_look_vertical()
local pitch_c = math.cos(pitch)
local pitch_s = math.sin(pitch)
local yaw_c = math.cos(yaw + math.pi / 2)
local yaw_s = math.sin(yaw + math.pi / 2)
local rot_left = {x = yaw_c * pitch_s * math.pi / 18, y = pitch_c * math.pi / 18, z = yaw_s * pitch_s * math.pi / 18}
local rot_right = {x = - yaw_c * pitch_s * math.pi / 18, y = - pitch_c * math.pi / 18, z = - yaw_s * pitch_s * math.pi / 18}
local dir_left = vector.rotate(dir, rot_left)
local dir_right = vector.rotate(dir, rot_right)
mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, {x=dir_left.x, y=dir_left.y, z=dir_left.z}, yaw, player, power, damage, is_critical, player:get_wielded_item(), false)
mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, {x=dir_right.x, y=dir_right.y, z=dir_right.z}, yaw, player, power, damage, is_critical, player:get_wielded_item(), false)
mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, dir, yaw, player, power, damage, is_critical, player:get_wielded_item(), true) mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, dir, yaw, player, power, damage, is_critical, player:get_wielded_item(), true)
else else
mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, dir, yaw, player, power, damage, is_critical, player:get_wielded_item(), true) mcl_bows_s.shoot_arrow_crossbow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, dir, yaw, player, power, damage, is_critical, player:get_wielded_item(), true)

View File

@ -0,0 +1,5 @@
# textdomain: mcl_campfires
Campfire=Fogata
Soul Campfire=Fogata de almas
Cooks food and keeps bees happy.=Cocina comida y mantiene a las abejas felices.
Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap.=Las fogatas tienen múltiples usos, incluyendo mantener a las abejas felices, cocinar carne cruda y pescado, y como trampa.

View File

@ -0,0 +1,86 @@
-- Crafting
local planks = "mcl_cherry_blossom:cherrywood"
local logs = "mcl_cherry_blossom:cherrytree"
local stripped_logs = "mcl_cherry_blossom:stripped_cherrytree"
minetest.register_craft({
output = "mcl_cherry_blossom:cherrytree_bark 3",
recipe = {
{ logs, logs },
{ logs, logs },
}
})
minetest.register_craft({
output = "mcl_cherry_blossom:stripped_cherrytree_bark 3",
recipe = {
{ stripped_logs, stripped_logs },
{ stripped_logs, stripped_logs },
}
})
minetest.register_craft({
output = "mcl_cherry_blossom:cherrywood 4",
recipe = {
{ logs },
}
})
minetest.register_craft({
output = "mcl_cherry_blossom:cherry_door 3",
recipe = {
{planks, planks},
{planks, planks},
{planks, planks}
}
})
minetest.register_craft({
output = "mcl_cherry_blossom:cherry_trapdoor 2",
recipe = {
{planks, planks, planks},
{planks, planks, planks},
}
})
minetest.register_craft({
output = "mcl_cherry_blossom:cherry_fence 3",
recipe = {
{planks, "mcl_core:stick", planks},
{planks, "mcl_core:stick", planks},
}
})
minetest.register_craft({
output = "mcl_cherry_blossom:cherry_fence_gate",
recipe = {
{"mcl_core:stick", planks, "mcl_core:stick"},
{"mcl_core:stick", planks, "mcl_core:stick"},
}
})
mcl_signs.register_sign_craft("mcl_cherry_blossom", "mcl_cherry_blossom:cherrywood", "_cherrywood")
-- Smelting
minetest.register_craft({
type = "fuel",
recipe = "mcl_cherry_blossom:cherry_door",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_cherry_blossom:cherry_trapdoor",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_cherry_blossom:pressure_plate_cherrywood_off",
burntime = 15
})
minetest.register_craft({
type = "fuel",
recipe = "mesecons_button:button_cherrywood_off",
burntime = 5,
})

View File

@ -0,0 +1,53 @@
-- Tree Growth
-- TODO: Use better spawning behavior and wood api when wood api is finished.
function mcl_cherry_blossom.generate_cherry_tree(pos)
local pr = PseudoRandom(pos.x+pos.y+pos.z)
local r = pr:next(1,3)
local modpath = minetest.get_modpath("mcl_cherry_blossom")
local path = modpath.."/schematics/mcl_cherry_blossom_tree_"..tostring(r)..".mts"
if mcl_core.check_growth_width(pos,7,8) then
minetest.set_node(pos, {name = "air"})
if r == 1 then
minetest.place_schematic(vector.offset(pos, -2, 0, -2), path, "random", nil, false)
elseif r == 2 then
minetest.place_schematic(vector.offset(pos, -2, 0, -2), path, nil, nil, false)
elseif r == 3 then
minetest.place_schematic(vector.offset(pos, -3, 0, -3), path, nil, nil, false)
end
end
end
minetest.register_abm({
label = "Cherry Tree Growth",
nodenames = "mcl_cherry_blossom:cherrysapling",
interval = 30,
chance = 5,
action = function(pos,node)
mcl_cherry_blossom.generate_cherry_tree(pos)
end,
})
local cherry_particle = {
velocity = vector.zero(),
acceleration = vector.new(0,-1,0),
size = math.random(1.3,2.5),
texture = "mcl_cherry_blossom_particle.png",
collision_removal = false,
collisiondetection = false,
}
minetest.register_abm({
label = "Cherry Blossom Particles",
nodenames = {"mcl_cherry_blossom:cherryleaves"},
interval = 5,
chance = 10,
action = function(pos, node)
minetest.after(math.random(0.1,1.5),function()
local pt = table.copy(cherry_particle)
pt.pos = vector.offset(pos,math.random(-0.5,0.5),-0.51,math.random(-0.5,0.5))
pt.expirationtime = math.random(1.2,4.5)
minetest.add_particle(pt)
end)
end
})

View File

@ -0,0 +1,6 @@
mcl_cherry_blossom = {}
local modpath = minetest.get_modpath("mcl_cherry_blossom")
dofile(modpath.."/nodes.lua") -- Load Nodes
dofile(modpath.."/crafting.lua") -- Load Crafting Recipes
dofile(modpath.."/growth.lua") -- Load Cherry Blossom Tree Growth

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