diff --git a/.gitea/issue_template/bug.md b/.gitea/issue_template/bug.md index be76e6395..1ec1f0918 100644 --- a/.gitea/issue_template/bug.md +++ b/.gitea/issue_template/bug.md @@ -20,11 +20,11 @@ https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUC --> -MineClone2 version: +VoxeLibre version: ### What happened? Report about the bug! Please send large log snippets as an attachement file. diff --git a/.gitea/issue_template/missing_feature_request.md b/.gitea/issue_template/missing_feature_request.md index b3e275c9b..ebcb1cc62 100644 --- a/.gitea/issue_template/missing_feature_request.md +++ b/.gitea/issue_template/missing_feature_request.md @@ -21,5 +21,5 @@ https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUC ### Current feature in Minecraft Tell us about the feature currently in Minecraft! What is it like on Minecraft? -### Current feature in MineClone2 -Tell us about the feature currently in MineClone2! What is different? +### Current feature in VoxeLibre +Tell us about the feature currently in VoxeLibre! What is different? diff --git a/API.md b/API.md index 865630c78..cd438e2bf 100644 --- a/API.md +++ b/API.md @@ -1,10 +1,10 @@ # API ## Groups -MineClone 2 makes very extensive use of groups. Making sure your items and objects have the correct group memberships is very important. +VoxeLibre makes very extensive use of groups. Making sure your items and objects have the correct group memberships is very important. Groups are explained in `GROUPS.md`. ## Mod naming convention -Mods mods in MineClone 2 follow a simple naming convention: Mods with the prefix “`mcl_`” are specific to MineClone 2, although they may be based on an existing standalone. Mods which lack this prefix are *usually* verbatim copies of a standalone mod. Some modifications may still have been applied, but the APIs are held compatible. +Mods mods in VoxeLibre follow a simple naming convention: Mods with the prefix "`vl_`" and “`mcl_`” are specific to VoxeLibre (formerly known as MineClone2), although they may be based on an existing standalone. Mods which lack this prefix are *usually* verbatim copies of a standalone mod. Some modifications may still have been applied, but the APIs are held compatible. ## Adding items ### Special fields @@ -31,7 +31,7 @@ All nodes can have these fields: Use the `mcl_sounds` mod for the sounds. ## APIs -A lot of things are possible by using one of the APIs in the mods. Note that not all APIs are documented yet, but it is planned. The following APIs should be more or less stable but keep in mind that MineClone 2 is still unfinished. All directory names are relative to `mods/` +A lot of things are possible by using one of the APIs in the mods. Many of them are documented in `API.md` files located in the directories of the specific mods. Some use `.txt` files or have some documentation in the comments along the code. Note that not all APIs are documented yet, but it is planned. The following APIs should be more or less stable but keep in mind that VoxeLibre is still unfinished. All directory names are relative to `mods/` ### Items * Doors: `ITEMS/mcl_doors` @@ -46,8 +46,7 @@ A lot of things are possible by using one of the APIs in the mods. Note that not ### Mobs * Mobs: `ENTITIES/mcl_mobs` -MineClone 2 uses its own mobs framework, called “Mobs Redo: MineClone 2 Edition” or “MRM” for short. -This is a fork of Mobs Redo [`mobs`] by TenPlus1. +VoxeLibre uses its own mobs framework, which is a fork of Mobs Redo [`mobs`] by TenPlus1. You can add your own mobs, spawn eggs and spawning rules with this mod. API documnetation is included in `ENTITIES/mcl_mobs/api.txt`. @@ -55,7 +54,7 @@ API documnetation is included in `ENTITIES/mcl_mobs/api.txt`. This mod includes modificiations from the original Mobs Redo. Some items have been removed or moved to other mods. The API is mostly identical, but a few features have been added. Compability is not really a goal, but function and attribute names of Mobs Redo 1.41 are kept. -If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in MineClone 2, +If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in VoxeLibre. chances are good that it works out of the box. ### Help @@ -68,6 +67,7 @@ chances are good that it works out of the box. ### Utility APIs * Change player physics: `PLAYER/playerphysics` +* Change player FOV: `PLAYER/mcl_fovapi` * Select random treasures: `CORE/mcl_loot` * Get flowing direction of liquids: `CORE/flowlib` * `on_walk_over` callback for nodes: `CORE/walkover` @@ -77,7 +77,7 @@ chances are good that it works out of the box. * Flowers and flower pots ### Unstable APIs -The following APIs may be subject to change in future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk! +The following APIs may be subject to change in the future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk! * Panes (like glass panes and iron bars): `ITEMS/xpanes` * `_on_ignite` callback: `ITEMS/mcl_fire` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 781b1b85f..cd6eb1801 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,48 +1,47 @@ -# Contributing to MineClone2 -So you want to contribute to MineClone2? +# Contributing to VoxeLibre +So you want to contribute to VoxeLibre? Wow, thank you! :-) -MineClone2 is maintained by AncientMariner and Nicu. If you have any +VoxeLibre is maintained by AncientMariner and Herowl. If you have any problems or questions, contact us on Discord/Matrix (See Links section below). -You can help with MineClone2's development in many different ways, +You can help with VoxeLibre's development in many different ways, whether you're a programmer or not. -## MineClone2's development target is to... -- Create a stable, peformant, moddable, free/libre game based on Minecraft +## VoxeLibre's development target is to... +- Create a stable, peformant, moddable, free/libre game inspired by Minecraft using the Minetest engine, usable in both singleplayer and multiplayer. - Currently, a lot of features are already implemented. Polishing existing features is always welcome. ## Links -* [Mesehub](https://git.minetest.land/MineClone2/MineClone2) +* [Mesehub](https://git.minetest.land/VoxeLibre/VoxeLibre) * [Discord](https://discord.gg/xE4z8EEpDC) * [YouTube](https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A) -* [IRC](https://web.libera.chat/#mineclone2) -* [Matrix](https://app.element.io/#/room/#mc2:matrix.org) -* [Reddit](https://www.reddit.com/r/MineClone2/) +* [Matrix](https://app.element.io/#/room/#voxelibre:matrix.org) +* [Reddit](https://www.reddit.com/r/VoxeLibre/) * [Minetest forums](https://forum.minetest.net/viewtopic.php?f=50&t=16407) * [ContentDB](https://content.minetest.net/packages/wuzzy/mineclone2/) * [OpenCollective](https://opencollective.com/mineclone2) ## Using git -MineClone2 is developed using the version control system +VoxeLibre is developed using the version control system [git](https://git-scm.com/). If you want to contribute code to the project, it is **highly recommended** that you learn the git basics. For non-programmers and people who do not plan to contribute code to -MineClone2, git is not required. However, git is a tool that will be +VoxeLibre, git is not required. However, git is a tool that will be referenced frequently because of its usefulness. As such, it is valuable in learning how git works and its terminology. It can also help you keeping your game updated, and easily test pull requests. Look at our wiki for some concrete guides: -https://git.minetest.land/MineClone2/MineClone2/wiki/ +https://git.minetest.land/VoxeLibre/VoxeLibre/wiki/ ## How you can help as a non-programmer As someone who does not know how to write programs in Lua or does not know how to use the Minetest API, you can still help us out a lot. For example, by opening an issue in the -[Issue tracker](https://git.minetest.land/MineClone2/MineClone2/issues), +[Issue tracker](https://git.minetest.land/VoxeLibre/VoxeLibre/issues), you can report a bug or request a feature. ### Rules about both bugs and feature requests @@ -60,8 +59,7 @@ actually an issue with Minetest itself, and if it is, head to the [Minetest issue tracker](https://github.com/minetest/minetest/issues) instead. * If you need any help regarding creating a Mesehub account or opening -an issue, feel free to ask on the Discord / Matrix server or the IRC -channel. +an issue, feel free to ask on the Discord or Matrix space. The link to the mesehub registration page is: https://git.minetest.land/user/sign_up (It appears to sometimes get lost on the page itsself) @@ -75,7 +73,7 @@ in singleplayer, post a screenshot of the message that Minetest showed when the crash happened (or copy the message into your issue). If you are a server admin, you can find error messages in the log file of the server. -* Tell us which MineClone2 and Minetest versions you are using (from Minetest 5.7 type /ver, for previous versions, check the game.conf or README.md file). +* Tell us which VoxeLibre and Minetest versions you are using (from Minetest 5.7 type /ver, for previous versions, check the game.conf or README.md file). * Tell us how to reproduce the problem: What you were doing to trigger the bug, e.g. before the crash happened or what causes the faulty behavior. @@ -84,14 +82,14 @@ behavior. * Ensure the requested feature fulfills our development targets and goals. * Begging or excessive attention seeking does not help us in the -slightest, and may very well disrupt MineClone2 development. It's better +slightest, and may very well disrupt VoxeLibre development. It's better to put that energy into helping or researching the feature in question. After all, we're just volunteers working on our spare time. -* Ensure the requested feature has not been implemented in MineClone2 +* Ensure the requested feature has not been implemented in VoxeLibre latest or development versions. ### Testing code -If you want to help us with speeding up MineClone2 development and +If you want to help us with speeding up VoxeLibre development and making the game more stable, a great way to do that is by testing out new features from contributors. For most new things that get into the game, a pull request is created. A pull request is essentially a @@ -103,20 +101,21 @@ tell us if the code works as expected without any issues. Ideally, you would report issues will pull requests similar to when you were reporting bugs that are the mainline (See Reporting bugs section). You can find currently open pull requests here: -. Note that pull +. Note that pull requests that start with a `WIP:` are not done yet and therefore could still undergo substantial change. Testing these is still helpful however because that is the reason developers put them up as WIP so other people -can have a look at the PR. +can have a look at the PR. The wiki has an article with instructions +on how to test Pull Requests: +. ### Contributing assets -Due to license problems, MineClone2 cannot use Minecraft's assets, +Due to license problems, VoxeLibre cannot use Minecraft's assets, therefore we are always looking for asset contributions. To contribute assets, it can be useful to learn git basics and read the section for Programmers of this document, however this is not required. -It's also a good idea to join the Discord server -(or alternatively IRC or Matrix). +It's also a good idea to join the Discord server and/or Matrix space. #### Textures For textures we prefer original art, but in the absence of that will accept @@ -128,9 +127,9 @@ If you want to make such contributions, join our Discord server. Demands for textures will be communicated there. #### Sounds -MineClone2 currently does not have a consistent way to handle sounds. +VoxeLibre currently does not have a consistent way to handle sounds. The sounds in the game come from different sources, like the SnowZone -resource pack or minetest_game. Unfortunately, MineClone2 does not play +resource pack or minetest_game. Unfortunately, VoxeLibre does not play 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 probably work together with a programmer, to write the code to actually @@ -140,7 +139,7 @@ changes made by the contributor. Use the README files in the mod to communicate this information. #### 3D Models -Most of the 3D Models in MineClone2 come from +Many of the 3D Models in VoxeLibre come from [22i's repository](https://github.com/22i/minecraft-voxel-blender-models). Similar to the textures, we need people that can make 3D Models with Blender on demand. Many of the models have to be patched, some new @@ -154,13 +153,13 @@ also be credited in the Contributors section. ### Contributing Translations #### Workflow -To add/update support for your language to MineClone2, you should take +To add/update support for your language to VoxeLibre, you should take the steps documented in the section for Programmers, add/update the translation files of the mods that you want to update. You can add support for all mods, just some of them or only one mod; you can update the translation file entirely or only partly; basically any effort is valued. If your changes are small, you can also send them to developers -via E-Mail, Discord, IRC or Matrix - they will credit you appropriately. +via E-Mail, Discord or Matrix - they will credit you appropriately. #### Things to note You can use the script at `tools/check_translate_files.py` to compare @@ -178,7 +177,7 @@ If you have commited the results yourself, you will also be credited in the Contributors section. ### Profiling -If you own a server, a great way to help us improve MineClone2's code +If you own a server, a great way to help us improve VoxeLibre's code is by giving us profiler results. Profiler results give us detailed information about the game's performance and let us know places to investigate optimization issues. This way we can make the game faster. @@ -203,18 +202,23 @@ decisions. Also, note that a lot of discussion takes place on the Discord server, so it's definitely worth checking it out. ### Funding -You can help pay for our infrastructure (Mesehub) by donating to our -OpenCollective link (See Links section). +You can help pay for our infrastructure (Mesehub) and other unforeseen +expenses (in the last few years, only payments for Mesehub have been done) +by donating to our OpenCollective link (See Links section). ### Crediting If you opened or have contributed to an issue, you receive the `Community` role on our Discord (after asking for it). +If you have been an author of a PR that got merged or contributed +significantly to art that got merged into the game, you receive the +`Contributor` role on our Discord (after asking for it). +Please note that what counts as "significant" is decided by Maintainers. OpenCollective Funders are credited in their own section in `CREDITS.md` and receive a special role "Funder" on our discord (unless they have made their donation Incognito). ## How you can help as a programmer -(Almost) all the MineClone2 development is done using pull requests. +(Almost) all the VoxeLibre development is done using pull requests. ### Recommended workflow * Fork the repository (in case you have not already) @@ -237,11 +241,11 @@ is no issue on the topic, open one. If there is an issue, tell us that you'd like to take care of it, to avoid duplicate work. ### Don't hesitate to ask for help -We appreciate any contributing effort to MineClone2. If you are a -relatively new programmer, you can reach us on Discord, Matrix or IRC -for questions about git, Lua, Minetest API, MineClone2 codebase or -anything related to MineClone2. We can help you avoid writing code that -would be deemed inadequate, or help you become familiar with MineClone2 +We appreciate any contributing effort to VoxeLibre. If you are a +relatively new programmer, you can reach us on Discord or Matrix +for questions about git, Lua, Minetest API, VoxeLibre codebase or +anything related to VoxeLibre. We can help you avoid writing code that +would be deemed inadequate, or help you become familiar with VoxeLibre better, or assist you use development tools. ### Maintain your own code, even if already got merged @@ -250,40 +254,52 @@ scenarios by testing every time before merging it, but if your merged work causes problems, we ask you fix the issues as soon as possible. ### Changing Gameplay -Pull Requests that change gameplay have to be properly researched and -need to state their sources. These PRs also need the maintainer's approval -before they are merged. -You can use these sources: - -* Testing things inside of Minecraft (Attach screenshots / video footage -of the results) -* Looking at [Minestom](https://github.com/Minestom/Minestom) code. An open source Minecraft Server implementation -* [Official Minecraft Wiki](https://minecraft.fandom.com/wiki/Minecraft_Wiki) -(Include a link to the specific page you used) +Pull Requests that change gameplay are always subject to discussion. +Opinions from the community on such PRs are valued, and Maintainer +should approve the concept (which is usually granted) as well as +the implementation (for which changes are often requested for either +code quality or game design reasons). ### Guidelines #### Git Guidelines -* Pushing to master is disabled - don't even try it. -* Every change is tracked as a PR. -* All but the tiniest changes require at least one approval from a Developer +* Pushing to master is disabled - don't even try it! +* Every change is tracked as a PR +* All changes require at least one approval from a Developer +* Maintainers may merge PRs without formal approval, but should also +take others' opinions and testing into account * To update branches we use rebase not merge (so we don't end up with excessive git bureaucracy commits in master) * We use merge to add the commits from a PR/branch to master +* Smaller PRs may be squashed before merging (especially if the commit history +on them isn't valuable), but when in doubt prefer merging +* Manual merging may be done by a Maintainer if there are technical problems +with the branch, with Gitea, or the PR had been merged to from master and +the author can't fix it for whatever reason +* PR from a fork (usually the author has no contributor/developer privileges) +can be retargeted and merged first into a buffer (normal new) branch on the repo +when adopted by a Developer, and only later into master * 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 -needed (this has never been the case before, hence mcl2 is submodule free so far) +b) it is 100% certain that no VL specific changes to the code will be +needed (this has never been the case before, hence VL is submodule free so far) +* Subtrees may be used for including outside mods that don't need changes +in the foreseeable future * Commit messages should be descriptive * Try to group your submissions best as you can: -* 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. -* Similarly multiple small commits are better than a giant one. (use git commit -p) + * 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 + * Similarly multiple small commits are better than a giant one. (use git commit -p) #### Code Guidelines * Each mod must provide `mod.conf`. -* Mod names are snake case, and newly added mods start with `mcl_`, e.g. -`mcl_core`, `mcl_farming`, `mcl_monster_eggs`. Keep in mind Minetest +* Mod names are snake case, and newly added mods (or substantially changed mods +that are included from the outside) start with `vl_`, e.g. +`vl_hollow_logs`, . Keep in mind Minetest does not support capital letters in mod names. +* In the past mods were prefixed with `mcl_`, e.g. +`mcl_core`, `mcl_farming`, `mcl_monster_eggs`. New mods should **never** use this prefix. +* Mods included from outside with no significant changes to the API +(especially those using git-subtree or such) aren't prefixed. * To export functions, store them inside a global table named like the mod, e.g. @@ -357,17 +373,21 @@ end ### Developer status Active and trusted contributors are often granted write access to the -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. +VoxeLibre repository as a contributor. This means that they can push +directly to the branches of our repo (except for `master`). +Pushing to others' branches without asking is discouraged, open a PR +targeting that branch instead (PRs can target any branch). + +Those that have demonstrated the right technical skills and behaviour +may be granted developer access. These are the most trusted contributors +who will contribute to ensure coding standards and processes are followed. #### Developer responsibilities - If you have developer/contributor privileges you can just open a new branch -in the mcl2 repository (which is preferred). From that you create a pull request. +in the VL repository (which is preferred). From that you create a pull request. This way other people can review your changes and make sure they work 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 contributor or developer privs you do your work on a branch on your private repository e.g. using the "fork" function on mesehub. - Any developer is welcome to review, test and approve PRs. A maintainer may prefer to merge the PR especially if it is in a similar area to what has been worked on @@ -390,14 +410,14 @@ merged. - Resolving conflicts and problems within the community #### Current maintainers -* AncientMariner - responsible for gameplay review, publishing releases, +* AncientMariner - responsible for gameplay review, publishing releases +* Herowl - responsible for gameplay review, publishing releases, technical guidelines -* Nicu - responsible for community related issues #### Release process * Run `tools/generate_ingame_credits.lua` to update the ingame credits from `CREDITS.md` and commit the result (if anything changed) -* Launch MineClone2 to make sure it still runs +* Launch VoxeLibre to make sure it still runs * Update the version number in README.md * Use `git tag ` to tag the latest commit with the version number @@ -415,6 +435,5 @@ become part of a free/libre software. ### Crediting Contributors, Developers and Maintainers will be credited in -`CREDITS.md`. If you make your first time contribution, please add -yourself to this file. There are also Discord roles for Contributors, +`CREDITS.md`. There are also Discord roles for Contributors, Developers and Maintainers. diff --git a/CREDITS.md b/CREDITS.md index 548ff94f6..2855ab6e5 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -3,7 +3,7 @@ ## Creator of MineClone * davedevils -## Creator of MineClone2 +## Creator of VoxeLibre * Wuzzy ## Maintainers @@ -24,6 +24,8 @@ * SmokeyDope * Faerraven / Michieal * Codiac +* rudzik8 +* teknomunk ## Past Developers * jordan4ibanez @@ -37,7 +39,6 @@ ## Contributors * RandomLegoBrick -* rudzik8 * Code-Sploit * aligator * Rootyjr @@ -129,12 +130,22 @@ * Bakawun * JoseDouglas26 * Zasco +* PrWalterB +* michaljmalinowski +* nixnoxus +* Potiron +* Tuxilio +* Impulse +* Doods +* SOS-Games +* Bram +* qoheniac ## Music * Jordach for the jukebox music compilation from Big Freaking Dig * 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) +* Jester for helping to finely tune VoxeLibre (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 VoxeLibre 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) ## Original Mod Authors diff --git a/GROUPS.md b/GROUPS.md index 0eb2d2d7c..18510430e 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -25,7 +25,7 @@ The basic digging time groups determine by which tools a node can be dug. * `handy=1`: Breakable by hand and this node gives it useful drop when dug by hand. All nodes which are breakable by pickaxe, axe, shovel, sword or shears are also automatically breakable by hand, but not neccess * `creative_breakable=1`: Block is breakable by hand in creative mode. This group is implied if the node belongs to any other digging group -Please read to learn how digging times work in Minecraft, as MineClone 2 is based on the same system. +Please read to learn how digging times work in Minecraft, as VoxeLibre is based on the same system. ### Groups for interactions @@ -117,7 +117,7 @@ These groups correspond to the Minecraft materials. They classify the block into * `material_glass=1`: Glass Currently, these groups are used for the note block. -Note that not all Minecraft materials are used so far. More Minecraft materials will lilely only be added when they are needed for a concrete use case. +Note that not all Minecraft materials are used so far. More Minecraft materials will likely only be added when they are needed for a concrete use case. ### Declarative groups These groups are used mostly for informational purposes diff --git a/HOW_TO_PLAY.md b/HOW_TO_PLAY.md index bc6cad1a5..30e279ecc 100644 --- a/HOW_TO_PLAY.md +++ b/HOW_TO_PLAY.md @@ -1,4 +1,4 @@ -Survive, farm, build, explore, play with friends, and do much more. Inspired by a well known block game, pushing beyond. +Survive, farm, build, explore, play with friends, and do much more. Inspired by a well-known block game, pushing beyond. How to play: @@ -6,16 +6,18 @@ How to play: - Navigate to https://www.minetest.net/ to download the client. - Once installed, open and select the "Content" tab -#### Install MineClone2 from ContentDB +#### Install VoxeLibre from ContentDB - Click "Browse Online Content" and filter by Games (select "Games" from the dropdown box) -- Find "MineClone2" (should be first on the list or on the first page) -- Click the [+] button next to MineClone2 and wait for download to finish +- Find "VoxeLibre" (should be first on the list or on the first page) +- Click the [+] button next to VoxeLibre and wait for download to finish - Click "Back to Main Menu" #### Create new world and play - Click "Start Game" tab -- At the bottom click the MineClone2 icon (the 2 dirt with grass blocks) +- At the bottom click the VoxeLibre icon (the stone & sandstone ball with the letters VL) - Click "New", give your world a name - You can leave seed blank or put in a word of your choice +- Pick a mapgen or leave the default (v7, valleys or carpathian mapgens are recommended) +- Pick mapgen options on the right (enabling everything is recommended) - Select your new world -- Click "Play Game" and enjoy! \ No newline at end of file +- Click "Play Game" and enjoy! diff --git a/LEGAL.md b/LEGAL.md index a181da398..d95f17624 100644 --- a/LEGAL.md +++ b/LEGAL.md @@ -1,14 +1,14 @@ # Legal information -This is a fan game, not developed or endorsed by Mojang AB. +This is a game inspired by Minecraft with unique content. Copying is an act of love. Please copy and share! <3 Here's the detailed legalese for those who need it: ## License of source code -MineClone 2 (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others) -is an imitation of Minecraft. +VoxeLibre (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others) +is inspired by Minecraft. -MineClone 2 is free software: you can redistribute it and/or modify +VoxeLibre is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -22,15 +22,15 @@ details. In the mods you might find in the read-me or license text files a different license. This counts as dual-licensing. You can choose which license applies to you: Either the -license of MineClone 2 (GNU GPLv3) or the mod's license. +license of VoxeLibre (GNU GPLv3) or the mod's license. -MineClone 2 is a direct continuation of the discontinued MineClone +VoxeLibre is a direct continuation of the discontinued MineClone project by davedevils. Mod credits: See `README.txt` or `README.md` in each mod directory for information about other authors. For mods that do not have such a file, the license is the source code license -of MineClone 2 and the author is Wuzzy. +of VoxeLibre and the author is Wuzzy. ## License of media (textures and sounds) No non-free licenses are used anywhere. diff --git a/MODELS.md b/MODELS.md index 663313f30..60a21c3ce 100644 --- a/MODELS.md +++ b/MODELS.md @@ -1,10 +1,10 @@ -# Models in Minetest/Mineclone2 +# Models in Minetest/VoxeLibre -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 VoxeLibre. 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 VoxeLibre. ## 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/VoxeLibre, please visit the Minetest wiki's page on using Blender [Here](https://wiki.minetest.net/Using_Blender) ## Recommended software diff --git a/README.md b/README.md index 4dc0ee92d..02f55b4d6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# MineClone2 -An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. -Developed by many people. Not developed or endorsed by Mojang AB. +# VoxeLibre +A game inspired by Minecraft for Minetest. Forked from MineClone by davedevils. +Developed by many people, see CREDITS.md for a complete list. ### Gameplay You start in a randomly-generated world made entirely of cubes. You can explore @@ -64,47 +64,44 @@ Use the `/giveme` chat command to obtain them. See the in-game help for an explanation. ## Installation -This game requires [Minetest](http://minetest.net) to run (version 5.4.1 or -later). So you need to install Minetest first. Only stable versions of Minetest -are officially supported. -There is no support for running MineClone2 in development versions of Minetest. +To run the game with the best performance and support, we recommend the latest +stable version of [Minetest](http://minetest.net), be we always make an effort +to support one version behind the latest stable version. In some cases, older +versions might still be good enough but you would be missing out on important +Minetest features that enable important features for our game. -To install MineClone2 (if you haven't already), move this directory into the +There is no support for running VoxeLibre in development versions of Minetest. + +To install VoxeLibre (if you haven't already), move this directory into the “games” directory of your Minetest data directory. Consult the help of Minetest to learn more. ## Useful links -The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there. +The VoxeLibre repository is hosted at Mesehub. To contribute or report issues, head there. -* Mesehub: +* Mesehub: * Discord: * YouTube: * ContentDB: * OpenCollective: -* Mastodon: -* Lemmy: -* Matrix space: +* Mastodon: +* Lemmy: +* Matrix space: * Minetest forums: -* Reddit: +* Reddit: * IRC (barely used): ## Target -- Create a stable, moddable, free/libre game based on Minecraft -on the Minetest engine with polished features, usable in both -singleplayer and multiplayer. Currently, a lot of **Minecraft Java -Edition** features are already implemented and polishing existing -features are prioritized over new feature requests. -- Implement features targetting -**Current Minecraft versions + OptiFine** (OptiFine only as far as supported -by the Minetest Engine). -- Create a performant experience that will run relatively -well on really low spec computers. +- Create a stable, peformant, moddable, free/libre game inspired by Minecraft +using the Minetest engine, usable in both singleplayer and multiplayer. +- Currently, a lot of features are already implemented. +Polishing existing features is always welcome. ## Completion status This game is currently in **beta** stage. It is playable, but not yet feature-complete. 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. +If you want to use the development version of VoxeLibre in production, the master branch is usually relatively stable. The following main features are available: @@ -187,7 +184,7 @@ Technical differences from Minecraft: * Different engine (Minetest) * Different easter eggs -… and finally, MineClone2 is free software (“free” as in “freedom”)! +… and finally, VoxeLibre is free software (“free” as in “freedom”)! ## Other readme files diff --git a/README_locale/README.fr.md b/README_locale/README.fr.md index 624e540da..f6bc85eb5 100644 --- a/README_locale/README.fr.md +++ b/README_locale/README.fr.md @@ -1,7 +1,8 @@ -# MineClone2 -Un jeu non-officiel similaire à Minecraft pour Minetest. Forké depuis Mineclone par davedevils. Développé par de nombreuses personnes. Pas développé ni supporté par Mojang AB. +# VoxeLibre +Un jeu inspiré de Minecraft pour Minetest. Forké depuis Mineclone par davedevils. +Développé par de nombreuses personnes, voir CREDITS.md pour une liste complète. -### Gameplay +### Gameplay Vous atterissez dans un monde fait entièrement de cubes et généré aléatoirement. Vous pouvez explorer le monde, miner et construire presque n'importe quel bloc pour créer de nouvelles structures. Vous pouvez choisir de jouer en "mode survie" dans lequel vous devez combattre des monstres et la faim et progresser lentement dans différents aspects du jeu, comme l'extraction de minerai, l'agriculture, la construction de machines et ainsi de suite. Ou alors vous pouvez jouer en "mode créatif" où vous pouvez construire à peu près n'importe quoi instantanément. ### Résumé du Gameplay @@ -21,7 +22,7 @@ Vous atterissez dans un monde fait entièrement de cubes et généré aléatoire ### Commencer * **Frappez un arbre** jusqu'à ce qu'il casse et donne du bois * Placez le **bois dans la grille 2x2** (la "grille de fabrication" de votre menu d'inventaire) et fabriquez 4 planches de bois -* Placer les 4 planches de bois dans la grille 2x2 et **fabriquez un établi** +* Placez les 4 planches de bois dans la grille 2x2 et **fabriquez un établi** * **Faites un clic droit sur l'établi** (icone livre) pour apprendre toutes les recettes possibles * **Fabriquez une pioche de bois** pour miner la pierre * Différents outils minent différentes sortes de blocs. Essayez-les ! @@ -30,10 +31,10 @@ Vous atterissez dans un monde fait entièrement de cubes et généré aléatoire ### Agriculture * Trouvez des graines * Fabriquez une houe -* Faites un clic droit sur la terre ou des blocs similaires avec la houe pour créer des terres agricoles -* Placer des graines sur des terres agricoles et regardez les pousser +* Faites un clic droit sur la terre ou un bloc similaire avec la houe pour créer des terres agricoles +* Placez des graines sur des terres agricoles et regardez les pousser * Récoltez les plantes une fois matûres -* Les terres agricoles proche de l'eau deviennent humides et accélèrent la croissance +* Les terres agricoles proches de l'eau deviennent humides et accélèrent la croissance ### Four * Fabriquez un four @@ -46,7 +47,7 @@ Vous atterissez dans un monde fait entièrement de cubes et généré aléatoire Plus d'aide à propos du jeu, des blocs, objets et plus encore peuvent être trouvés dans le jeu. Vous pouvez accéder à l'aide depuis le menu inventaire. ### Objets spéciaux -Les objets suivants sont intéressants pour le mode Créatif et pour les constructeurs de cartes d'aventure. Ils ne peuvent être obtenus dans le jeu ou dans l'inventaire créatif. +Les objets suivants sont intéressants pour le mode Créatif et pour les constructeurs de cartes d'aventure. Ils ne peuvent être obtenus dans le jeu ou dans l'inventaire créatif. * Barrière : `mcl_core:barrier` @@ -54,33 +55,35 @@ Utilisez la commande de chat `/giveme` pour les obtenir. Voir l'aide interne au ## Installation Ce jeu nécessite [Minetest](http://minetest.net) pour fonctionner (version 5.4.1 ou plus). Vous devez donc installer Minetest d'abord. Seules les versions stables de Minetest sont officielement supportées. -Il n'y a pas de support de MineClone2 dans les versions développement de Minetest. +Il n'y a pas de support de VoxeLibre dans les versions développement de Minetest. -Pour installer MineClone2 (si ce n'est pas déjà fait), déplacez ce dossier dans le dossier “games” de Minetest. Consultez l'aide de Minetest pour en apprendre plus. +Pour installer VoxeLibre (si ce n'est pas déjà fait), déplacez ce dossier dans le dossier “games” de Minetest. Consultez l'aide de Minetest pour en apprendre plus. -## Liens utiles -Le dépôt de MineClone2 est hébergé sur Mesehub. Pour contribuer ou signaler des problèmes, allez là-bas. +## Liens utiles +Le dépôt de VoxeLibre est hébergé sur Mesehub. Pour contribuer ou signaler des problèmes, allez là-bas. -* Mesehub : +* Mesehub : * Discord : * YouTube : -* IRC : -* Matrix : -* Reddit : -* Forums Minetest : * ContentDB : * OpenCollective : +* Mastodon : +* Lemmy : +* Espace Matrix : +* Forums Minetest : +* Reddit : +* IRC (peu utilisé) : ## Objectif -* Essentiellement, créer un clone de Minecraft stable, moddable, libre et gratuit basé sur le moteur de jeu Minetest avec des fonctionnalités abouties, utilisable à la fois en mode solo et multijoueur. Actuellement, beaucoup des fonctionnalités de **Minecraft Java Edition** sont déjà implémentées et leur amélioration est prioritaire sur les nouvelles demandes. -* Avec une priorité moindre, implémenter les fonctionnalités des versions **Minecraft + OptiFine** (OptiFine autant que supporté par le moteur Minetest). Cela signifie que les fonctionnalités présentes dans les versions listées sont priorisées. -* Dans l'idéal, créer une expérience performante qui tourne bien sur des ordinateurs à basse performance. Malheureusement, en raison des mécanismes de Minecraft et des limitations du moteur Minetest ainsi que de la petite taille de la communauté de joueurs sur des ordinateurs à basses performances, les optimisations sont difficiles à explorer. +* Créer un jeu stable, performant, moddable et libre inspiré de Minecraft en utilisant le moteur de jeu Minetest, utilisable à la fois en mode solo et multijoueur. +* Actuellement, un grand nombre de fonctionnalités sont déjà implémentées. +L'amélioration des fonctionnalités existantes est toujours la bienvenue. ## Statut de complétion Ce jeu est actuellement au stade **beta**. Il est jouable mais incomplet en fonctionnalités. La rétro-compatibilité n'est pas entièrement garantie, mettre votre monde à jour peut causer de petits bugs. -Si vous voulez utiliser la version de développement de MineClone2 en production, la branche master est habituellement relativement stable. Les branches de test fusionnent souvent des pull requests expérimentales et doivent être considérées comme moins stable. +Si vous voulez utiliser la version de développement de VoxeLibre en production, la branche master est habituellement relativement stable. Les principales fonctionnalités suivantes sont disponibles : @@ -108,12 +111,12 @@ Les principales fonctionnalités suivantes sont disponibles : * Horloge * Boussole * Éponge -* Bloc de slime +* Bloc de slime * Petites plantes et pousses * Teintures * Bannières * Blocs de décoration : verre, verre teinté, vitres, barres de fer, terre cuites (et couleurs), têtes et plus -* Cadres d'objets +* Cadres d'objets * Juke-boxes * Lits * Menu d'inventaire @@ -122,7 +125,7 @@ Les principales fonctionnalités suivantes sont disponibles : * Livres pour écrire * Commandes * Villages -* L'End +* L'End * et plus ! Les fonctionnalités suivantes sont incomplètes : @@ -162,7 +165,7 @@ Différences techniques avec Minecraft : * Un moteur de jeu différent (Minetest) * Des bonus cachés différents -...et enfin MineClone2 est un logiciel libre ! +...et enfin VoxeLibre est un logiciel libre ! ## Autres fichiers readme diff --git a/README_locale/README.ru.md b/README_locale/README.ru.md index 99fe93db8..b339d9e62 100644 --- a/README_locale/README.ru.md +++ b/README_locale/README.ru.md @@ -1,4 +1,4 @@ -# MineClone2 +# VoxeLibre Неофициальная игра в стиле Minecraft для Minetest. Форк MineClone от davedevils. Разработана многими людьми. Не разработана и не одобрена Mojang AB. @@ -67,13 +67,13 @@ ## Установка Эта игра требует [Minetest](http://minetest.net) для запуска (версия 5.4.1 или выше). Вам нужно сперва установить Minetest. Только стабильные версии поддерживаются -официально. Не поддерживается запуск MineClone2 на разрабатываемых версиях Minetest. +официально. Не поддерживается запуск VoxeLibre на разрабатываемых версиях Minetest. -Чтобы установить MineClone2 (если вы этого еще не сделали), переместите эту папку в +Чтобы установить VoxeLibre (если вы этого еще не сделали), переместите эту папку в “games” в папке данных Minetest. Смотрите справку Minetest, чтобы узнать больше. ## Полезные ссылки -Репозиторий MineClone2 хранится на Mesehub. Зайдите туда, чтобы оставить запрос или +Репозиторий VoxeLibre хранится на Mesehub. Зайдите туда, чтобы оставить запрос или поучаствовать в разработке. * Mesehub: @@ -102,7 +102,7 @@ Edition** уже реализовано и доработка имеющегос Игра сейчас на стадии **бета**. Она играбельна, но еще не имеет всех возможностей. Обратная совместимость целиком не гарантируется, обновление вашего мира может повлечь за собой небольшие ошибки. Если вы хотите использовать разрабатываемую версию -Mineclone2, то ветка master обычно относительно стабильна. +VoxeLibre, то ветка master обычно относительно стабильна. Следущие возможности уже доступны: @@ -182,7 +182,7 @@ Mineclone2, то ветка master обычно относительно ста * Другой движок (Minetest) * Другие пасхалки -… и наконец, MineClone2 это свободное программное обеспечение! +… и наконец, VoxeLibre это свободное программное обеспечение! ## Другие readme файлы diff --git a/README_locale/README.zh_TW.md b/README_locale/README.zh_TW.md index eb7540247..47d29cd59 100644 --- a/README_locale/README.zh_TW.md +++ b/README_locale/README.zh_TW.md @@ -1,4 +1,6 @@ -# MineClone 2 +This file is severely out of date. If you can help updating this translation, please reach out to us (contact in README.md - the English version). + +# VoxeLibre 一個非官方的Minetest遊戲,遊玩方式和Minecraft類似。由davedevils從MineClone分拆。 由許多人開發。並非由Mojang Studios開發。 @@ -83,11 +85,11 @@ Minetest to learn more. The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software. * **開發目標:我的世界, Java版, 版本 1.12** -* MineClone2還包括Minetest支持的Optifine功能。 +* VoxeLibre還包括Minetest支持的Optifine功能。 * 後期Minecraft版本的功能可能會偷偷加入,但它們的優先級較低。 * 總的來說,Minecraft的目標是在Minetest目前允許的情況下進行克隆。 * 克隆Minecraft是最優先的。 -* MineClone2將使用不同的圖形和聲音,但風格相似。 +* VoxeLibre將使用不同的圖形和聲音,但風格相似。 * 克隆界面沒有優先權。只會被粗略地模仿。 * 在Minetest中發現的局限性將在開發過程中被記錄和報告。 @@ -173,7 +175,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release * 不同的聲音(各種來源) * 不同的引擎(Minetest) -...最後,MineClone2是自由軟件! +...最後,VoxeLibre是自由軟件! ## 錯誤報告 請在此處報告所有錯誤和缺少的功能: @@ -190,7 +192,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release * `LICENSE.txt`:GPLv3許可文本 * `CONTRIBUTING.md`: 為那些想參與貢獻的人提供資訊 -* `MISSING_ENGINE_FEATURES.md`: MineClone2需要改进,Minetest中缺失的功能列表。 +* `MISSING_ENGINE_FEATURES.md`: VoxeLibre需要改进,Minetest中缺失的功能列表。 * `API.md`: 關於MineClone2的API ## 參與者 @@ -235,7 +237,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release * [kingoscargames](https://github.com/kingoscargames):現有材質的各種編輯和添加 * [leorockway](https://github.com/leorockway):怪物紋理的一些編輯 * [xMrVizzy](https://minecraft.curseforge.com/members/xMrVizzy):釉陶(材質以後會被替換) -* yutyo :MineClone2標志 +* yutyo :VoxeLibre標志 * 其他:GUI圖片 ### 翻譯 @@ -254,7 +256,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release ### 特殊感謝 -* Wuzzy,感謝他啟動和維護MineClone2多年。 +* Wuzzy,感謝他啟動和維護VoxeLibre多年。 * celeron55,創建Minetest。 * Minetest的社區提供了大量的mods選擇,其中一些最終被納入MineClone 2。 * Jordach,為《Big Freaking Dig》的唱片機音樂合輯而來 diff --git a/RELEASE.md b/RELEASE.md index 3984c4c84..d24f54b0d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,33 +1,76 @@ -### Standard Release +## Standard Release -# File to document release steps with a view to evolving into a script +### Before releasing -# Update CREDITS.md -# Update version in game.conf +Make sure all PRs in the release milestone are merged and you are working on a clean branch based on the master branch, up-to-date with the one on the repo. +### Release process + +1. Update CREDITS.md +2. Update version in game.conf +3. Run the script: ``` lua tools/generate_ingame_credits.lua - +``` +4. Make a commit for the above: +``` git add CREDITS.md git add mods/HUD/mcl_credits/people.lua git add game.conf - -#git add RELEASE.md - -git commit -m "Pre-release update credits and set version 0.83.0" - -git tag 0.83.0 - -git push origin 0.83.0 +git commit -m "Updated release credits and set version for v0.87" ``` +5. Add release notes to the `releasenotes` folder, named like +``` +0_87-the_prismatic_release.md +``` +6. Make a commit for the release notes: +``` +git add releasenotes/0_87-the_prismatic_release.md +git commit -m "Add release notes for v0.87" +``` +5. **Tag and push to the tag:** +``` +git tag 0.87.0 +git push origin 0.87.0 +``` +6. Update version in game.conf to the next version with -SNAPSHOT suffix: +``` +git commit -m "Post-release set version 0.87.0-SNAPSHOT" +``` +7. Push the above to a new branch, and make the release PR. Merge to finalize release process. -# Update version in game.conf to the next version with -SNAPSHOT suffix +### Release via ContentDB -`git commit -m "Post-release set version 0.84.0-SNAPSHOT"` +1. Go to VoxeLibre page (https://content.minetest.net/packages/Wuzzy/mineclone2/) +2. Click [+Release] button +3. Enter the release tag number in the title and Git reference box. For example (without quotes): "0.87.0" +4. In the minimum minetest version, put the oldest supported version (as of 19/05/2024 it is 5.6), leave the Maximum minetest version blank +5. Click save. Release is now live. -### Hotfix Release +### After releasing -##### Prepare release branch +...inform people. + +* Open a release meta issue on the tracker, unpin and close the issue for the previous release, pin the new one. +* Upload video to YouTube. +* Add a comment to the forum post with the release number and change log. Maintainer will update the main post with code link. +* Add a Discord announcement post and @everyone with link to the release issue, release notes and other content, like video and forum post. +* Add a Matrix announcement post and @room with links like above. +* Share the news on reddit + Lemmy. Good subs to share with: + * r/linux_gaming + * r/opensourcegames + * r/opensource + * r/freesoftware + * r/linuxmasterrace + * r/VoxeLibre + * r/MineClone2 (*for now*) + + +## Hotfix Release + +The below is not up-to-date. At the next hotfix the process should be finalized and updated. + +### Prepare release branch When hotfixing, you should never release new features. Any new code increases risk of new bugs which has additional testing/release concerns. To mitigate this, you just release the last release, and the relevant bug fix. For this, we do the following: @@ -40,7 +83,7 @@ git checkout -b release/0.82.1 0.82.0 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) @@ -49,7 +92,7 @@ git push origin release/0.82.1 * 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) -##### Update version and tag the release +#### Update version and tag the release * After all fixes are in release branch, pull it locally (best to avoid a merge conflict as feature branch will need to be merged into master also, which already changed version): @@ -67,23 +110,4 @@ 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. -### Release via ContentDB -* Go to MineClone2 page (https://content.minetest.net/packages/Wuzzy/mineclone2/) -* Click +Release -* Enter the release tag number in the title and Git reference box. For example (without quotes): "0.82.1" -* In the minimum minetest version, put the oldest supported version (as of 14/02/2023 it is 5.5), leave the Maximum minetest version blank -* Click save. Release is now live. - -##### Inform people - -* Upload video to YouTube -* 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 diff --git a/TEXTURES.md b/TEXTURES.md index 157965ae6..b29e19ed6 100644 --- a/TEXTURES.md +++ b/TEXTURES.md @@ -1,9 +1,9 @@ -# Making Textures In Mineclone2 +# Making Textures In VoxeLibre -Textures are a crucial asset for all items, nodes, and models in mineclone2. This document is for artist who would like to make and modify textures for mineclone2. While no means comprehensive, this document contains the basic important information for beginners to get started with texture curation and optimization. +Textures are a crucial asset for all items, nodes, and models in VoxeLibre. This document is for artist who would like to make and modify textures for VoxeLibre. While no means comprehensive, this document contains the basic important information for beginners to get started with texture curation and optimization. ## Minetest Wiki -For more detailed information on creating and modifing texture packs for Minetest/Mineclone2, please visit the Minetest wiki's page on creating a texture pack. Click [here](https://wiki.minetest.net/Creating_texture_packs) to view the wiki page on creating texture packs. +For more detailed information on creating and modifing texture packs for Minetest/VoxeLibre, please visit the Minetest wiki's page on creating a texture pack. Click [here](https://wiki.minetest.net/Creating_texture_packs) to view the wiki page on creating texture packs. ## GIMP Tutorials Pixel Art Guide GIMP Tutorials has an excellent guide to making pixel art in GIMP. If you would like further clarification as well as screenshots for what we are about to cover, it is an excellent resource to turn to. Click [here](https://thegimptutorials.com/how-to-make-pixel-art/) to view the guide diff --git a/game.conf b/game.conf index d238ce93c..61cedc596 100644 --- a/game.conf +++ b/game.conf @@ -1,4 +1,4 @@ -title = MineClone 2 +title = VoxeLibre description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more. disallowed_mapgens = v6 -version=0.87.0-SNAPSHOT +version=0.88.0-SNAPSHOT diff --git a/menu/HeaderTemplate.png b/menu/HeaderTemplate.png index ceddaa1f6..69aa42d5b 100644 Binary files a/menu/HeaderTemplate.png and b/menu/HeaderTemplate.png differ diff --git a/menu/header.1.png b/menu/header.1.png index 5204a0d02..55677d4ab 100644 Binary files a/menu/header.1.png and b/menu/header.1.png differ diff --git a/menu/header.2.png b/menu/header.2.png index 8b131302e..af735f03e 100644 Binary files a/menu/header.2.png and b/menu/header.2.png differ diff --git a/menu/header.3.png b/menu/header.3.png index dc618d7c6..a513af8ac 100644 Binary files a/menu/header.3.png and b/menu/header.3.png differ diff --git a/menu/header.png b/menu/header.png index 3c146f3cd..5e6eb5ee0 100644 Binary files a/menu/header.png and b/menu/header.png differ diff --git a/menu/icon.png b/menu/icon.png index 46b7475e3..433532678 100644 Binary files a/menu/icon.png and b/menu/icon.png differ diff --git a/mods/CORE/_mcl_autogroup/init.lua b/mods/CORE/_mcl_autogroup/init.lua index 1a259189b..884508032 100644 --- a/mods/CORE/_mcl_autogroup/init.lua +++ b/mods/CORE/_mcl_autogroup/init.lua @@ -16,7 +16,7 @@ information. How the mod is used =================== -In MineClone 2, all diggable nodes have the hardness set in the custom field +In VoxeLibre, all diggable nodes have the hardness set in the custom field "_mcl_hardness" (0 by default). These values are used together with digging groups by this mod to create the correct digging times for nodes. Digging groups are registered using the following code: diff --git a/mods/CORE/_mcl_autogroup/mod.conf b/mods/CORE/_mcl_autogroup/mod.conf index eea72c40f..db43aff39 100644 --- a/mods/CORE/_mcl_autogroup/mod.conf +++ b/mods/CORE/_mcl_autogroup/mod.conf @@ -1,3 +1,3 @@ name = _mcl_autogroup author = ryvnf -description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times. +description = VoxeLibre core mod which automatically adds groups to all items. Very important for digging times. diff --git a/mods/CORE/mcl_attached/init.lua b/mods/CORE/mcl_attached/init.lua index 2013dbde2..51ea2b0ae 100644 --- a/mods/CORE/mcl_attached/init.lua +++ b/mods/CORE/mcl_attached/init.lua @@ -1,5 +1,5 @@ -- Overrides the builtin minetest.check_single_for_falling. --- We need to do this in order to handle nodes in mineclone specific groups +-- We need to do this in order to handle nodes in VoxeLibre specific groups -- "supported_node" and "attached_node_facedir". -- -- Nodes in group "supported_node" can be placed on any node that does not @@ -94,5 +94,16 @@ function minetest.check_single_for_falling(pos) end end + if get_item_group(node.name, "supported_node_facedir") ~= 0 then + local dir = facedir_to_dir(node.param2) + if dir then + local def = registered_nodes[get_node(vector.add(pos, dir)).name] + if def and def.drawtype == "airlike" then + drop_attached_node(pos) + return true + end + end + end + return false end diff --git a/mods/CORE/mcl_autogroup/mod.conf b/mods/CORE/mcl_autogroup/mod.conf index 45818cd58..7222839aa 100644 --- a/mods/CORE/mcl_autogroup/mod.conf +++ b/mods/CORE/mcl_autogroup/mod.conf @@ -1,3 +1,3 @@ name = mcl_autogroup author = ryvnf -description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times. +description = VoxeLibre core mod which automatically adds groups to all items. Very important for digging times. diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index c6a6d192f..4fbe81860 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -1,8 +1,8 @@ --[[ -Explosion API mod for Minetest (adapted to MineClone 2) +Explosion API mod for Minetest (adapted to VoxeLibre) This mod is based on the Minetest explosion API mod, but has been changed -to have the same explosion mechanics as Minecraft and work with MineClone. +to have the same explosion mechanics as Minecraft and work with VoxeLibre The computation-intensive parts of the mod has been optimized to allow for larger explosions and faster world updating. diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index b97e2a97d..a099f2136 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -1,6 +1,8 @@ -- Some global variables (don't overwrite them!) mcl_vars = {} +minetest.log("action", "World seed = " .. minetest.get_mapgen_setting("seed")) + mcl_vars.redstone_tick = 0.1 -- GUI / inventory menu settings @@ -37,7 +39,7 @@ mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, minetest.MAX_MAP_GENERATION_LIMIT or 31000) -- Central chunk is offset from 0,0,0 coordinates by 32 nodes (2 blocks) --- See more in https://git.minetest.land/MineClone2/MineClone2/wiki/World-structure%3A-positions%2C-boundaries%2C-blocks%2C-chunks%2C-dimensions%2C-barriers-and-the-void +-- See more in https://git.minetest.land/VoxeLibre/VoxeLibre/wiki/World-structure%3A-positions%2C-boundaries%2C-blocks%2C-chunks%2C-dimensions%2C-barriers-and-the-void local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2) mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE @@ -183,7 +185,7 @@ mcl_vars.mg_end_exit_portal_pos = vector.new(0, mcl_vars.mg_end_min + 71, 0) mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max mcl_vars.mg_realm_barrier_overworld_end_min = mcl_vars.mg_end_max - 11 --- Use MineClone 2-style dungeons +-- Use VoxeLibre-style dungeons mcl_vars.mg_dungeons = true -- Set default stack sizes @@ -280,3 +282,19 @@ function mcl_vars.get_node(pos, force, us_timeout) return node -- it still can return "ignore", LOL, even if force = true, but only after time out end + +-- Workaround because pairs() doesn't always work as expected +do + local old_minetest_register_item = minetest.register_item + local items_registered = {} + mcl_vars.items_registered = items_registered + minetest.register_item = function(name, itemdef) + if name:sub(1,1) == ":" then + items_registered[#items_registered + 1] = name:sub(2) + else + items_registered[#items_registered + 1] = name + end + return old_minetest_register_item(name, itemdef) + end +end + diff --git a/mods/CORE/mcl_init/mod.conf b/mods/CORE/mcl_init/mod.conf index a0e810a2f..4ce7b394d 100644 --- a/mods/CORE/mcl_init/mod.conf +++ b/mods/CORE/mcl_init/mod.conf @@ -1,3 +1,3 @@ name = mcl_init author = Wuzzy -description = Initialization mod of MineClone 2. Defines some common shared variables and sets up initial default settings which have to be set at the beginning. +description = Initialization mod of VoxeLibre. Defines some common shared variables and sets up initial default settings which have to be set at the beginning. diff --git a/mods/CORE/mcl_oxidation/README.md b/mods/CORE/mcl_oxidation/README.md index 06ad09489..0fef8fc3d 100644 --- a/mods/CORE/mcl_oxidation/README.md +++ b/mods/CORE/mcl_oxidation/README.md @@ -1,4 +1,4 @@ -# Oxidization API for MineClone 2 +# Oxidization API for VoxeLibre This mods adds the oxidization api, so that modders can easily use the same features that copper uses. ## API diff --git a/mods/CORE/mcl_oxidation/mod.conf b/mods/CORE/mcl_oxidation/mod.conf index 7ab7eeffe..84d5d6828 100644 --- a/mods/CORE/mcl_oxidation/mod.conf +++ b/mods/CORE/mcl_oxidation/mod.conf @@ -1,4 +1,4 @@ name = mcl_oxidation -title = Oxidation API for MineClone 2 +title = Oxidation API for VoxeLibre author = PrairieWind, N011, Michael description = API to allow oxidizing different nodes. diff --git a/mods/CORE/mcl_particles/mod.conf b/mods/CORE/mcl_particles/mod.conf index b8252cbc5..8b02369ea 100644 --- a/mods/CORE/mcl_particles/mod.conf +++ b/mods/CORE/mcl_particles/mod.conf @@ -1,3 +1,2 @@ name = mcl_particles author = Wuzzy -description = Contains particle images of MineClone 2. No code. diff --git a/mods/CORE/mcl_sounds/mod.conf b/mods/CORE/mcl_sounds/mod.conf index 33bcafd9f..947fd1ba7 100644 --- a/mods/CORE/mcl_sounds/mod.conf +++ b/mods/CORE/mcl_sounds/mod.conf @@ -1,3 +1,3 @@ name = mcl_sounds author = Wuzzy -description = This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them. +description = This mod contains the core sounds of VoxeLibre as well as helper function for mods to access them. diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 477d05b4e..b6fd71673 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1,5 +1,7 @@ mcl_util = {} +dofile(minetest.get_modpath(minetest.get_current_modname()).."/roman_numerals.lua") + -- Updates all values in t using values from to*. function table.update(t, ...) for _, to in ipairs {...} do @@ -113,7 +115,7 @@ end -- Minetest 5.3.0 or less can only measure the light level. This came in at 5.4 -- This function has been known to fail in multiple places so the error handling is added increase safety and improve -- debugging. See: --- https://git.minetest.land/MineClone2/MineClone2/issues/1392 +-- https://git.minetest.land/VoxeLibre/VoxeLibre/issues/1392 function mcl_util.get_natural_light (pos, time) local status, retVal = pcall(minetest.get_natural_light, pos, time) if status then @@ -436,10 +438,11 @@ function mcl_util.generate_on_place_plant_function(condition) if not def_under or not def_above then return itemstack end - if def_under.buildable_to then + if def_under.buildable_to and def_under.name ~= itemstack:get_name() then place_pos = pointed_thing.under - elseif def_above.buildable_to then + elseif def_above.buildable_to and def_above.name ~= itemstack:get_name() then place_pos = pointed_thing.above + pointed_thing.under = pointed_thing.above else return itemstack end @@ -534,6 +537,7 @@ end function mcl_util.use_item_durability(itemstack, n) local uses = mcl_util.calculate_durability(itemstack) itemstack:add_wear(65535 / uses * n) + tt.reload_itemstack_description(itemstack) -- update tooltip end function mcl_util.deal_damage(target, damage, mcl_reason) diff --git a/mods/CORE/mcl_util/mod.conf b/mods/CORE/mcl_util/mod.conf index 82f9137e4..f43663852 100644 --- a/mods/CORE/mcl_util/mod.conf +++ b/mods/CORE/mcl_util/mod.conf @@ -1,4 +1,4 @@ name = mcl_util author = Wuzzy -description = Helper functions for MineClone 2. +description = Helper functions for VoxeLibre. depends = mcl_init diff --git a/mods/CORE/mcl_util/roman_numerals.lua b/mods/CORE/mcl_util/roman_numerals.lua new file mode 100644 index 000000000..a808e43f1 --- /dev/null +++ b/mods/CORE/mcl_util/roman_numerals.lua @@ -0,0 +1,30 @@ +local converter = { + {1000, "M"}, + {900, "CM"}, + {500, "D"}, + {400, "CD"}, + {100, "C"}, + {90, "XC"}, + {50, "L"}, + {40, "XL"}, + {10, "X"}, + {9, "IX"}, + {5, "V"}, + {4, "IV"}, + {1, "I"} +} + +mcl_util.to_roman = function(number) + local r = "" + local a = number + local i = 1 + while a > 0 do + if a >= converter[i][1] then + a = a - converter[i][1] + r = r.. converter[i][2] + else + i = i + 1 + end + end + return r +end diff --git a/mods/CORE/mcl_worlds/API.md b/mods/CORE/mcl_worlds/API.md index 69508e924..6ad7639f4 100644 --- a/mods/CORE/mcl_worlds/API.md +++ b/mods/CORE/mcl_worlds/API.md @@ -31,7 +31,7 @@ This function return the Minecraft dimension of ("overworld", "nether" or * pos: position ## mcl_worlds.layer_to_y(layer, mc_dimension) -Takes a Minecraft layer and a “dimension” name and returns the corresponding Y coordinate for MineClone 2. +Takes a Minecraft layer and a “dimension” name and returns the corresponding Y coordinate for VoxeLibre. mc_dimension can be "overworld", "nether", "end" (default: "overworld"). * layer: int diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index 4f8914506..f397ccfd5 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -58,7 +58,7 @@ local pos_to_dimension = mcl_worlds.pos_to_dimension -- Takes a Minecraft layer and a “dimension” name -- and returns the corresponding Y coordinate for --- MineClone 2. +-- VoxeLibre -- mc_dimension is one of "overworld", "nether", "end" (default: "overworld"). function mcl_worlds.layer_to_y(layer, mc_dimension) if mc_dimension == "overworld" or mc_dimension == nil then diff --git a/mods/CORE/tga_encoder/README.md b/mods/CORE/tga_encoder/README.md index 1ad978a22..ed7d14538 100644 --- a/mods/CORE/tga_encoder/README.md +++ b/mods/CORE/tga_encoder/README.md @@ -1,7 +1,7 @@ # tga_encoder A TGA Encoder written in Lua without the use of external Libraries. -Created by fleckenstein for MineClone2, then improved by erlehmann. +Created by fleckenstein for VoxeLibre, then improved by erlehmann. May be used as a Minetest mod. diff --git a/mods/ENTITIES/mcl_boats/README.txt b/mods/ENTITIES/mcl_boats/README.txt index 0d56aa0e1..12b5d49f2 100644 --- a/mods/ENTITIES/mcl_boats/README.txt +++ b/mods/ENTITIES/mcl_boats/README.txt @@ -10,7 +10,7 @@ License of boat model: GNU GPLv3 ## Textures -See the main MineClone 2 README.md file to learn more. +See the main VoxeLibre README.md file to learn more. ## Code Code based on Minetest Game, licensed under the MIT License (MIT). diff --git a/mods/ENTITIES/mcl_burning/mod.conf b/mods/ENTITIES/mcl_burning/mod.conf index 651698fc7..8a3d6ea00 100644 --- a/mods/ENTITIES/mcl_burning/mod.conf +++ b/mods/ENTITIES/mcl_burning/mod.conf @@ -1,4 +1,4 @@ name = mcl_burning -description = Burning Objects for MineClone2 +description = Burning Objects for VoxeLibre author = Fleckenstein -depends = mcl_weather \ No newline at end of file +depends = mcl_weather diff --git a/mods/ENTITIES/mcl_dripping/README.md b/mods/ENTITIES/mcl_dripping/README.md index 5f4b2854f..37658292c 100644 --- a/mods/ENTITIES/mcl_dripping/README.md +++ b/mods/ENTITIES/mcl_dripping/README.md @@ -1,6 +1,6 @@ # mcl_dripping -Dripping Mod by kddekadenz, modified for MineClone 2 by Wuzzy, NO11 and AFCM +Dripping Mod by kddekadenz, modified for VoxeLibre by Wuzzy, NO11 and AFCM ## Manual diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 1734fa6af..2cb506450 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -127,6 +127,7 @@ local function try_object_pickup(player, inv, object, checkpos) -- Add what we can to the inventory local itemstack = ItemStack(le.itemstring) + tt.reload_itemstack_description(itemstack) local leftovers = inv:add_item("main", itemstack ) check_pickup_achievements(object, player) @@ -448,6 +449,7 @@ function minetest.node_dig(pos, node, digger) end end end + tt.reload_itemstack_description(wielded) -- update tooltip digger:set_wielded_item(wielded) end diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index a9a1a0dad..873d05bf2 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1,7 +1,7 @@ local mob_class = mcl_mobs.mob_class local mob_class_meta = {__index = mcl_mobs.mob_class} local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs --- API for Mobs Redo: MineClone 2 Edition (MRM) +-- API for Mobs Redo: VoxeLibre Edition local PATHFINDING = "gowp" local CRASH_WARN_FREQUENCY = 60 @@ -96,15 +96,23 @@ function mob_class:get_staticdata() local tmp = {} - for _,stat in pairs(self) do + for tag, stat in pairs(self) do local t = type(stat) if t ~= "function" and t ~= "nil" and t ~= "userdata" - and _ ~= "_cmi_components" then - tmp[_] = self[_] + and tag ~= "_cmi_components" then + tmp[tag] = self[tag] + end + end + + tmp._mcl_potions = self._mcl_potions + if tmp._mcl_potions then + for name_raw, data in pairs(tmp._mcl_potions) do + local def = mcl_potions.registered_effects[name_raw:match("^_EF_(.+)$")] + if def and def.on_save_effect then def.on_save_effect(self.object) end end end @@ -306,7 +314,10 @@ function mob_class:mob_activate(staticdata, def, dtime) self._run_armor_init = true end - + if not self._mcl_potions then + self._mcl_potions = {} + end + mcl_potions._load_entity_effects(self) if def.after_activate then @@ -473,7 +484,7 @@ local function warn_user_error () if time_since_warning > CRASH_WARN_FREQUENCY then last_crash_warn_time = current_time - minetest.log("A game crashing bug was prevented. Please provide debug.log information to MineClone2 dev team for investigation. (Search for: --- Bug report start)") + minetest.log("A game crashing bug was prevented. Please provide debug.log information to VoxeLibre dev team for investigation. (Search for: --- Bug report start)") end end diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index fe0da4be2..29cdc2c48 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -1,5 +1,5 @@ -Mobs Redo: MineClone 2 Edition +Mobs Redo: VoxeLibre Edition API documentation ============================== @@ -231,7 +231,7 @@ functions needed for the mob to work properly which contains the following: - MineClone 2 extensions: + VoxeLibre extensions: 'spawn_class' Classification of mod for the spawning algorithm: "hostile", "passive", "ambient" or "water" @@ -434,7 +434,7 @@ true the mob will not spawn. 'name' is the name of the animal/monster -MineClone 2 extensions +VoxeLibre extensions ---------------------- mcl_mobs:spawn_child(pos, mob_type) @@ -524,7 +524,7 @@ Does nothing and returns false. This function is provided for compability with Mobs Redo for an attempt to capture a mob. -Mobs cannot be captured in MineClone 2. +Mobs cannot be captured in VoxeLibre. In Mobs Redo, this is generally called inside the on_rightclick section of the mob api code, it provides a chance of capturing the mob. See Mobs Redo documentation @@ -671,6 +671,13 @@ mob will spawn e.g. mobs_animal:sheep_chance 11000 mobs_monster:sand_monster_chance 100 +Registering Mob Conversion +---------------- + +Sometimes you need to completely replace one mob with a different version. To do this, use: + + mcl_mobs.register_conversion(old_name, new_name) + Rideable Horse Example Mob -------------------------- diff --git a/mods/ENTITIES/mcl_mobs/breeding.lua b/mods/ENTITIES/mcl_mobs/breeding.lua index 7b5d91119..90e625db8 100644 --- a/mods/ENTITIES/mcl_mobs/breeding.lua +++ b/mods/ENTITIES/mcl_mobs/breeding.lua @@ -78,6 +78,7 @@ function mob_class:feed_tame(clicker, feed_count, breed, tame, notake) self.food = 0 self.horny = true self.persistent = true + self._luck = mcl_luck.get_luck(clicker:get_player_name()) end end @@ -273,7 +274,7 @@ function mob_class:check_breeding() return end - mcl_experience.throw_xp(pos, math.random(1, 7)) + mcl_experience.throw_xp(pos, math.random(1, 7) + (parent1._luck or 0) + (parent2._luck or 0)) -- custom breed function if parent1.on_breed then diff --git a/mods/ENTITIES/mcl_mobs/combat.lua b/mods/ENTITIES/mcl_mobs/combat.lua index 745a06c5c..d9df817e4 100644 --- a/mods/ENTITIES/mcl_mobs/combat.lua +++ b/mods/ENTITIES/mcl_mobs/combat.lua @@ -21,8 +21,6 @@ local function atan(x) end end -mcl_mobs.effect_functions = {} - -- check if daytime and also if mob is docile during daylight hours function mob_class:day_docile() @@ -534,6 +532,8 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) if self.protected and minetest.is_protected(mob_pos, hitter:get_player_name()) then return end + + mcl_potions.update_haste_and_fatigue(hitter) end local time_now = minetest.get_us_time() @@ -605,6 +605,13 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) * tmp * ((armor[group] or 0) / 100.0) end + -- strength and weakness effects + local strength = mcl_potions.get_effect(hitter, "strength") + local weakness = mcl_potions.get_effect(hitter, "weakness") + local str_fac = strength and strength.factor or 1 + local weak_fac = weakness and weakness.factor or 1 + damage = damage * str_fac * weak_fac + if weapon then local fire_aspect_level = mcl_enchanting.get_enchantment(weapon, "fire_aspect") if fire_aspect_level > 0 then @@ -646,6 +653,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir) if def.tool_capabilities and def.tool_capabilities.punch_attack_uses then local wear = math.floor(65535/tool_capabilities.punch_attack_uses) weapon:add_wear(wear) + tt.reload_itemstack_description(weapon) -- update tooltip hitter:set_wielded_item(weapon) end end, hitter:get_player_name()) @@ -957,6 +965,7 @@ function mob_class:do_states_attack (dtime) if self.v_start then self.timer = self.timer + dtime self.blinktimer = (self.blinktimer or 0) + dtime + self:set_animation("fuse") if self.blinktimer > 0.2 then self.blinktimer = 0 @@ -1142,9 +1151,8 @@ function mob_class:do_states_attack (dtime) damage_groups = {fleshy = self.damage} }, nil) if self.dealt_effect then - mcl_mobs.effect_functions[self.dealt_effect.name]( - self.attack, self.dealt_effect.factor, self.dealt_effect.dur - ) + mcl_potions.give_effect_by_level(self.dealt_effect.name, self.attack, + self.dealt_effect.level, self.dealt_effect.dur) end end else diff --git a/mods/ENTITIES/mcl_mobs/init.lua b/mods/ENTITIES/mcl_mobs/init.lua index 65272eebf..44eae7b13 100644 --- a/mods/ENTITIES/mcl_mobs/init.lua +++ b/mods/ENTITIES/mcl_mobs/init.lua @@ -314,6 +314,7 @@ function mcl_mobs.register_mob(name, def) return self:mob_activate(staticdata, def, dtime) end, + after_activate = def.after_activate, attack_state = def.attack_state, -- custom attack state on_attack = def.on_attack, -- called after attack, useful with otherwise predefined attack states (not custom) harmed_by_heal = def.harmed_by_heal, @@ -324,6 +325,7 @@ function mcl_mobs.register_mob(name, def) attack_exception = def.attack_exception or function(p) return false end, _spawner = def._spawner, + _mcl_potions = {}, } if minetest.get_modpath("doc_identifier") ~= nil then @@ -340,6 +342,17 @@ function mcl_mobs.register_mob(name, def) minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta)) end -- END mcl_mobs.register_mob function +function mcl_mobs.register_conversion(old_name, new_name) + minetest.register_entity(old_name, { + on_activate = function(self, staticdata, dtime) + local obj = minetest.add_entity(self.object:get_pos(), new_name, staticdata) + local hook = (obj:get_luaentity() or {})._on_after_convert + if hook then hook(obj) end + self.object:remove() + end, + _convert_to = new_name, + }) +end function mcl_mobs.get_arrow_damage_func(damage, typ) local typ = mcl_damage.types[typ] and typ or "arrow" diff --git a/mods/ENTITIES/mcl_mobs/mod.conf b/mods/ENTITIES/mcl_mobs/mod.conf index 9c10e9a2b..927c1c905 100644 --- a/mods/ENTITIES/mcl_mobs/mod.conf +++ b/mods/ENTITIES/mcl_mobs/mod.conf @@ -1,5 +1,5 @@ name = mcl_mobs author = PilzAdam description = Adds a mob API for mods to add animals or monsters, etc. -depends = mcl_particles +depends = mcl_particles, mcl_luck optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience, mcl_sculk diff --git a/mods/ENTITIES/mcl_mobs/physics.lua b/mods/ENTITIES/mcl_mobs/physics.lua index 705b22dbb..73aefb509 100644 --- a/mods/ENTITIES/mcl_mobs/physics.lua +++ b/mods/ENTITIES/mcl_mobs/physics.lua @@ -684,7 +684,7 @@ function mob_class:do_env_damage() self.object:set_velocity({x = 0, y = 0, z = 0}) -- wither rose effect elseif self.standing_in == "mcl_flowers:wither_rose" then - mcl_potions.withering_func(self.object, 1, 2) + mcl_potions.give_effect_by_level("withering", self.object, 2, 2) end local nodef = minetest.registered_nodes[self.standing_in] diff --git a/mods/ENTITIES/mcl_mobs/readme.MD b/mods/ENTITIES/mcl_mobs/readme.MD index aa79d909c..df4ecc4c4 100644 --- a/mods/ENTITIES/mcl_mobs/readme.MD +++ b/mods/ENTITIES/mcl_mobs/readme.MD @@ -1,74 +1,74 @@ - -Mobs Redo: MineClone 2 Edition - -Based on Mobs Redo from TenPlus1 -Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint. - - -This mod contains the API only for adding your own mobs into the world, so please use the additional modpacks to add animals, monsters etc. - - -https://forum.minetest.net/viewtopic.php?f=11&t=9917 - ------------- -Credits: - -mcl_mobs_mob_poof.ogg: -- by Planman (license: Creative Commons Zero) -- Source: - ------------- - -Changelog from original Mobs Redo mod: -- 1.41- Mob pathfinding has been updated thanks to Elkien3 -- 1.40- Updated to use newer functions, requires Minetest 0.4.16+ to work. -- 1.39- Added 'on_breed', 'on_grown' and 'do_punch' custom functions per mob -- 1.38- Better entity checking, nametag setting and on_spawn function added to mob registry, tweaked light damage -- 1.37- Added support for Raymoo's CMI (common mob interface) mod: https://forum.minetest.net/viewtopic.php?f=9&t=15448 -- 1.36- Death check added, if mob dies in fire/lava/with lava pick then drops are cooked -- 1.35- Added owner_loyal flag for owned mobs to attack player enemies, also fixed group_attack -- 1.34- Added function to fly mob using directional movement (thanks D00Med for flying code) -- 1.33- Added functions to mount ride mobs (mobs.attach, mobs.detach, mobs.drive) many thanks to Blert2112 -- 1.32- Added new spawn check to count specific mobs AND new minetest.conf setting to chance spawn chance and numbers, added ability to protect tamed mobs -- 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks, also 'mob_difficulty' .conf setting to make mobs harder. -- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code -- 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod -- 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :) -- 1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function. -- 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :) -- 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak. -- 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition) -- 1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings) -- 1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner -- 1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp) -- 1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error -- 1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick -- 1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first -- 1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added -- 1.16- Mobs follow multiple items now, Npc's can breed -- 1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility. -- 1.14- All .self variables saved in staticdata, Fixed self.health bug -- 1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's -- 1.12- Added animal ownership so that players cannot steal your tamed animals -- 1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy -- 1,10- Footstep removed (use replace), explosion routine added for exploding mobs. -- 1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals -- 1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added -- 1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables -- beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop -- 1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal) -- 1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten -- 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :) -- 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc. -- 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions -- 1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items -- 1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :) -- 0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked -- 0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound -- 0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes -- 0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block -- 0.5 - Mobs now float in water, die from falling, and some code improvements -- 0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :) -- 0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :) -- 0.2 - Cooking bucket of milk into cheese now returns empty bucket -- 0.1 - Initial Release + +Mobs Redo: VoxeLibre Edition + +Based on Mobs Redo from TenPlus1 +Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint. + + +This mod contains the API only for adding your own mobs into the world, so please use the additional modpacks to add animals, monsters etc. + + +https://forum.minetest.net/viewtopic.php?f=11&t=9917 + +------------ +Credits: + +mcl_mobs_mob_poof.ogg: +- by Planman (license: Creative Commons Zero) +- Source: + +------------ + +Changelog from original Mobs Redo mod: +- 1.41- Mob pathfinding has been updated thanks to Elkien3 +- 1.40- Updated to use newer functions, requires Minetest 0.4.16+ to work. +- 1.39- Added 'on_breed', 'on_grown' and 'do_punch' custom functions per mob +- 1.38- Better entity checking, nametag setting and on_spawn function added to mob registry, tweaked light damage +- 1.37- Added support for Raymoo's CMI (common mob interface) mod: https://forum.minetest.net/viewtopic.php?f=9&t=15448 +- 1.36- Death check added, if mob dies in fire/lava/with lava pick then drops are cooked +- 1.35- Added owner_loyal flag for owned mobs to attack player enemies, also fixed group_attack +- 1.34- Added function to fly mob using directional movement (thanks D00Med for flying code) +- 1.33- Added functions to mount ride mobs (mobs.attach, mobs.detach, mobs.drive) many thanks to Blert2112 +- 1.32- Added new spawn check to count specific mobs AND new minetest.conf setting to chance spawn chance and numbers, added ability to protect tamed mobs +- 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks, also 'mob_difficulty' .conf setting to make mobs harder. +- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code +- 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod +- 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :) +- 1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function. +- 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :) +- 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak. +- 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition) +- 1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings) +- 1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner +- 1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp) +- 1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error +- 1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick +- 1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first +- 1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added +- 1.16- Mobs follow multiple items now, Npc's can breed +- 1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility. +- 1.14- All .self variables saved in staticdata, Fixed self.health bug +- 1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's +- 1.12- Added animal ownership so that players cannot steal your tamed animals +- 1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy +- 1,10- Footstep removed (use replace), explosion routine added for exploding mobs. +- 1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals +- 1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added +- 1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables +- beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop +- 1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal) +- 1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten +- 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :) +- 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc. +- 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions +- 1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items +- 1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :) +- 0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked +- 0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound +- 0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes +- 0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block +- 0.5 - Mobs now float in water, die from falling, and some code improvements +- 0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :) +- 0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :) +- 0.2 - Cooking bucket of milk into cheese now returns empty bucket +- 0.1 - Initial Release diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua old mode 100755 new mode 100644 index 6bfca0082..8a8a42281 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -23,6 +23,7 @@ local math_ceil = math.ceil local math_cos = math.cos local math_sin = math.sin local math_round = function(x) return (x > 0) and math_floor(x + 0.5) or math_ceil(x - 0.5) end +local math_sqrt = math.sqrt local vector_distance = vector.distance local vector_new = vector.new @@ -564,6 +565,9 @@ function mcl_mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ return end + assert(min_height) + assert(max_height) + -- chance/spawn number override in minetest.conf for registered mob local numbers = minetest.settings:get(name) @@ -595,25 +599,119 @@ function mcl_mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ spawn_dictionary[key]["max_height"] = max_height spawn_dictionary[key]["day_toggle"] = day_toggle spawn_dictionary[key]["check_position"] = check_position - end +-- Calculate the inverse of a piecewise linear function f(x). Line segments are represented as two +-- adjacent points specified as { x, f(x) }. At least 2 points are required. If there are most solutions, +-- the one with a lower x value will be chosen. +local function inverse_pwl(fx, f) + if fx < f[1][2] then + return f[1][1] + end + + for i=2,#f do + local x0,fx0 = unpack(f[i-1]) + local x1,fx1 = unpack(f[i ]) + if fx < fx1 then + return (fx - fx0) * (x1 - x0) / (fx1 - fx0) + x0 + end + end + + return f[#f][1] +end + +local SPAWN_DISTANCE_CDF_PWL = { + {0.000,0.00}, + {0.083,0.40}, + {0.416,0.75}, + {1.000,1.00}, +} + local two_pi = 2 * math.pi local function get_next_mob_spawn_pos(pos) - -- TODO We should consider spawning something a little further away sporadically. - -- It would be good for sky farms and variance, rather than all being on the 24 - 32 block away radius - local distance = math_random(MOB_SPAWN_ZONE_INNER, MOB_SPAWN_ZONE_MIDDLE) - local angle = math_random() * two_pi + -- Select a distance such that distances closer to the player are selected much more often than + -- those further away from the player. + local fx = (math_random(1,10000)-1) / 10000 + local x = inverse_pwl(fx, SPAWN_DISTANCE_CDF_PWL) + distance = x * (MOB_SPAWN_ZONE_OUTER - MOB_SPAWN_ZONE_INNER) + MOB_SPAWN_ZONE_INNER + --print("Using spawn distance of "..tostring(distance).." fx="..tostring(fx)..",x="..tostring(x)) -- TODO Floor xoff and zoff and add 0.5 so it tries to spawn in the middle of the square. Less failed attempts. - local xoff = math_round(distance * math_cos(angle)) - local zoff = math_round(distance * math_sin(angle)) - return vector.offset(pos, xoff, 0, zoff) -end + -- Use spherical coordinates https://en.wikipedia.org/wiki/Spherical_coordinate_system#Cartesian_coordinates + local theta = math_random() * two_pi + local phi = math_random() * two_pi + local xoff = math_round(distance * math_sin(theta) * math_cos(phi)) + local yoff = math_round(distance * math_cos(theta)) + local zoff = math_round(distance * math_sin(theta) * math_sin(phi)) + local goal_pos = vector.offset(pos, xoff, yoff, zoff) -local function decypher_limits(posy) - posy = math_floor(posy) - return posy - MOB_SPAWN_ZONE_MIDDLE, posy + MOB_SPAWN_ZONE_MIDDLE + if not ( math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(pos.y) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT ) then + mcl_log("Pos outside mapgen limits: " .. minetest.pos_to_string(goal_pos)) + return nil + end + + -- Calculate upper/lower y limits + local R1 = MOB_SPAWN_ZONE_OUTER + local d = vector_distance( pos, vector.new( goal_pos.x, pos.y, goal_pos.z ) ) -- distance from player to projected point on horizontal plane + local y1 = math_sqrt( R1*R1 - d*d ) -- absolue value of distance to outer sphere + + local y_min + local y_max + if d >= MOB_SPAWN_ZONE_INNER then + -- Outer region, y range has both ends on the outer sphere + y_min = pos.y - y1 + y_max = pos.y + y1 + else + -- Inner region, y range spans between inner and outer spheres + local R2 = MOB_SPAWN_ZONE_INNER + local y2 = math_sqrt( R2*R2 - d*d ) + if goal_pos.y > pos. y then + -- Upper hemisphere + y_min = pos.y + y2 + y_max = pos.y + y1 + else + -- Lower hemisphere + y_min = pos.y - y1 + y_max = pos.y - y2 + end + end + y_min = math_round(y_min) + y_max = math_round(y_max) + + -- Limit total range of check to 32 nodes (maximum of 3 map blocks) + if y_max > goal_pos.y + 16 then + y_max = goal_pos.y + 16 + end + if y_min < goal_pos.y - 16 then + y_min = goal_pos.y - 16 + end + + -- Ask engine for valid spawn locations + local spawning_position_list = find_nodes_in_area_under_air( + {x = goal_pos.x, y = y_min, z = goal_pos.z}, + {x = goal_pos.x, y = y_max, z = goal_pos.z}, + {"group:solid", "group:water", "group:lava"} + ) or {} + + -- Select only the locations at a valid distance + local valid_positions = {} + for _,check_pos in ipairs(spawning_position_list) do + local dist = vector.distance(pos, check_pos) + if dist >= MOB_SPAWN_ZONE_INNER and dist <= MOB_SPAWN_ZONE_OUTER then + valid_positions[#valid_positions + 1] = check_pos + end + end + spawning_position_list = valid_positions + + -- No valid locations, failed to find a position + if #spawning_position_list == 0 then + mcl_log("Spawning position isn't good. Do not spawn: " .. minetest.pos_to_string(goal_pos)) + return nil + end + + -- Pick a random valid location + mcl_log("Spawning positions available: " .. minetest.pos_to_string(goal_pos)) + return spawning_position_list[math_random(1, #spawning_position_list)] end --a simple helper function for mob_spawn @@ -938,42 +1036,16 @@ if mobs_spawn then local function find_spawning_position(pos, max_times) local spawning_position - - local max_loops = 1 - if max_times then max_loops = max_times end - - local y_min, y_max = decypher_limits(pos.y) + local max_loops = max_times or 1 --mcl_log("mapgen_limit: " .. SPAWN_MAPGEN_LIMIT) - local i = 0 - repeat - local goal_pos = get_next_mob_spawn_pos(pos) + while max_loops > 0 do + local spawning_position = get_next_mob_spawn_pos(pos) + if spawning_position then return spawning_position end + max_loops = max_loops - 1 - if math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(pos.y) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT then - local spawning_position_list = find_nodes_in_area_under_air( - {x = goal_pos.x, y = y_min, z = goal_pos.z}, - {x = goal_pos.x, y = y_max, z = goal_pos.z}, - {"group:solid", "group:water", "group:lava"} - ) - if #spawning_position_list > 0 then - mcl_log("Spawning positions available: " .. minetest.pos_to_string(goal_pos)) - spawning_position = spawning_position_list[math_random(1, #spawning_position_list)] - else - mcl_log("Spawning position isn't good. Do not spawn: " .. minetest.pos_to_string(goal_pos)) - end - - else - mcl_log("Pos outside mapgen limits: " .. minetest.pos_to_string(goal_pos)) - end - - - i = i + 1 - if i >= max_loops then - mcl_log("Cancel finding spawn positions at: " .. max_loops) - break - end - until spawning_position - return spawning_position + end + return nil end local cumulative_chance = nil @@ -1199,7 +1271,6 @@ function mob_class:check_despawn(pos, dtime) end end - minetest.register_chatcommand("mobstats",{ privs = { debug = true }, func = function(n,param) diff --git a/mods/ENTITIES/mcl_wither_spawning/mod.conf b/mods/ENTITIES/mcl_wither_spawning/mod.conf index d144bb1ea..f73ef558e 100644 --- a/mods/ENTITIES/mcl_wither_spawning/mod.conf +++ b/mods/ENTITIES/mcl_wither_spawning/mod.conf @@ -1,4 +1,4 @@ name = mcl_wither_spawning -description = Wither Spawning for MineClone2 +description = Wither Spawning for VoxeLibre author = Fleckenstein depends = mobs_mc, mcl_heads diff --git a/mods/ENTITIES/mobs_mc/README.md b/mods/ENTITIES/mobs_mc/README.md index bdc561295..db5663abb 100644 --- a/mods/ENTITIES/mobs_mc/README.md +++ b/mods/ENTITIES/mobs_mc/README.md @@ -33,11 +33,11 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers * Husk * Skeleton * Stray -* Creeper +* Stalker * Slime * Spider * Cave Spider -* Enderman +* Rover * Zombie Villager * Zombie Piglin * Wither Skeleton diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index 4ee21b2ea..4722c157c 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -122,6 +122,7 @@ mooshroom_def.on_rightclick = function(self, clicker) if not minetest.is_creative_enabled(clicker:get_player_name()) then item:add_wear(mobs_mc.shears_wear) + tt.reload_itemstack_description(item) -- update tooltip clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item) end -- Use bucket to milk diff --git a/mods/ENTITIES/mobs_mc/guardian.lua b/mods/ENTITIES/mobs_mc/guardian.lua index f2addbfa0..ab4051626 100644 --- a/mods/ENTITIES/mobs_mc/guardian.lua +++ b/mods/ENTITIES/mobs_mc/guardian.lua @@ -99,9 +99,7 @@ mcl_mobs.register_mob("mobs_mc:guardian", { view_range = 16, }) --- Spawning disabled due to size issues --- TODO: Re-enable spawning ---mcl_mobs:spawn_specific("mobs_mc:guardian", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level - 10) +mcl_mobs:spawn_specific("mobs_mc:guardian", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level - 10, mobs_mc.water_level) mcl_mobs:non_spawn_specific("mobs_mc:guardian","overworld",0,minetest.LIGHT_MAX+1) -- spawn eggs mcl_mobs.register_egg("mobs_mc:guardian", S("Guardian"), "#5a8272", "#f17d31", 0) diff --git a/mods/ENTITIES/mobs_mc/guardian_elder.lua b/mods/ENTITIES/mobs_mc/guardian_elder.lua index 094c0513c..be787216c 100644 --- a/mods/ENTITIES/mobs_mc/guardian_elder.lua +++ b/mods/ENTITIES/mobs_mc/guardian_elder.lua @@ -105,11 +105,14 @@ mcl_mobs.register_mob("mobs_mc:guardian_elder", { fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, jump = false, view_range = 16, + dealt_effect = { + name = "fatigue", + level = 3, + dur = 30, + }, }) --- Spawning disabled due to size issues <- what do you mean? -j4i --- TODO: Re-enable spawning --- mcl_mobs:spawn_specific("mobs_mc:guardian_elder", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level-18) +mcl_mobs:spawn_specific("mobs_mc:guardian_elder", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level-18, mobs_mc.water_level) -- spawn eggs mcl_mobs.register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "#ceccba", "#747693", 0) diff --git a/mods/ENTITIES/mobs_mc/init.lua b/mods/ENTITIES/mobs_mc/init.lua index 483efdcb4..f22f1ebcf 100644 --- a/mods/ENTITIES/mobs_mc/init.lua +++ b/mods/ENTITIES/mobs_mc/init.lua @@ -124,9 +124,7 @@ dofile(path .. "/witch.lua") -- Mesh and animation by toby109tt / https://githu --Monsters dofile(path .. "/blaze.lua") -- Animation by daufinsyd -dofile(path .. "/creeper.lua") -- Mesh by Morn76 Animation by Pavel_S dofile(path .. "/ender_dragon.lua") -- Mesh and animation by toby109tt / https://github.com/22i -dofile(path .. "/enderman.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/endermite.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/villager_illusioner.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/ghast.lua") -- maikerumine @@ -134,10 +132,12 @@ dofile(path .. "/guardian.lua") -- maikerumine Mesh and animation by toby109tt dofile(path .. "/guardian_elder.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/snowman.lua") dofile(path .. "/iron_golem.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i +dofile(path .. "/rover.lua") -- Mesh and Animation by Herowl dofile(path .. "/shulker.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/silverfish.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/skeleton+stray.lua") -- Mesh by Morn76 Animation by Pavel_S dofile(path .. "/skeleton_wither.lua") -- Mesh by Morn76 Animation by Pavel_S +dofile(path .. "/stalker.lua") -- Mesh and Animation by Herowl dofile(path .. "/zombie.lua") -- Mesh by Morn76 Animation by Pavel_S dofile(path .. "/slime+magma_cube.lua") -- Wuzzy dofile(path .. "/spider.lua") -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture) diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.de.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.de.tr index 84aade90e..d807cfa32 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.de.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.de.tr @@ -5,7 +5,7 @@ Blaze=Lohe Chicken=Huhn Cow=Kuh Mooshroom=Pilzkuh -Creeper=Creeper +Stalker=Stalker Ender Dragon=Enderdrache Enderman=Enderman Endermite=Endermilbe diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.dk.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.dk.tr index 5df92f2f8..c125411eb 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.dk.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.dk.tr @@ -6,7 +6,7 @@ Blaze=Blaze Chicken=Kylling Cow=Ko Mooshroom=Svamp -Creeper=Creeper +Stalker=Stalker Ender Dragon=Enderdrage Enderman=Enderman Endermite=Endermide @@ -67,4 +67,4 @@ Cod=Torsk Salmon=Laks Dolphin=Delfin Pillager=Plyndrer -Tropical fish=Tropisk fisk \ No newline at end of file +Tropical fish=Tropisk fisk diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr index 47e19cc42..44b6e1ef5 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.es.tr @@ -5,7 +5,7 @@ Chicken=Pollo Cod=Bacalao Cow=Vaca Mooshroom=Champivaca -Creeper=Creeper +Stalker=Stalker Dolphin=Delfín Ender Dragon=Ender Dragon Enderman=Enderman diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr index 2c71ff47e..94b99bd49 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr @@ -6,7 +6,7 @@ Blaze=Blaze Chicken=Poulet Cow=Vache Mooshroom=Champimeuh -Creeper=Creeper +Stalker=Stalker Ender Dragon=Ender Dragon Enderman=Enderman Endermite=Endermite diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.oc.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.oc.tr index ad81ec88c..aabbe2d63 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.oc.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.oc.tr @@ -6,7 +6,7 @@ Blaze=Flamor Chicken=Polet Cow=Vacha Mooshroom=Vachairòla -Creeper=Creeper +Stalker=Stalker Ender Dragon=Dragon de Finuèit Enderman=Finuèairi Endermite=Finuèibau diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.pt_BR.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.pt_BR.tr index a20d703a8..aa68482c7 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.pt_BR.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.pt_BR.tr @@ -6,7 +6,7 @@ Blaze=Blaze Chicken=Galinha Cow=Vaca Mooshroom=Coguvaca -Creeper=Creeper +Stalker=Stalker Ender Dragon=Dragão do Fim Enderman=Enderman Endermite=Endermite diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.ru.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.ru.tr index 3a1af1dde..d5ee3b187 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.ru.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.ru.tr @@ -6,7 +6,7 @@ Blaze=Ифрит Chicken=Курица Cow=Корова Mooshroom=Грибная корова -Creeper=Крипер +Stalker=Сталкер Ender Dragon=Дракон Края Enderman=Эндермен Endermite=Эндермит diff --git a/mods/ENTITIES/mobs_mc/locale/template.txt b/mods/ENTITIES/mobs_mc/locale/template.txt index b783681ee..c81e13e41 100644 --- a/mods/ENTITIES/mobs_mc/locale/template.txt +++ b/mods/ENTITIES/mobs_mc/locale/template.txt @@ -6,7 +6,7 @@ Blaze= Chicken= Cow= Mooshroom= -Creeper= +Stalker= Ender Dragon= Enderman= Endermite= diff --git a/mods/ENTITIES/mobs_mc/models/vl_rover.b3d b/mods/ENTITIES/mobs_mc/models/vl_rover.b3d new file mode 100644 index 000000000..9d9a2809e Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/vl_rover.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/vl_stalker.b3d b/mods/ENTITIES/mobs_mc/models/vl_stalker.b3d new file mode 100644 index 000000000..c47edf5b2 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/vl_stalker.b3d differ diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/rover.lua similarity index 75% rename from mods/ENTITIES/mobs_mc/enderman.lua rename to mods/ENTITIES/mobs_mc/rover.lua index d3ce1e5cc..d1f21ffd0 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/rover.lua @@ -31,20 +31,9 @@ local place_frequency_min = 235 local place_frequency_max = 245 minetest.register_entity("mobs_mc:ender_eyes", { - visual = "mesh", - mesh = "mobs_mc_spider.b3d", - visual_size = {x=1.01/3, y=1.01/3}, - textures = { - "mobs_mc_enderman_eyes.png", - }, on_step = function(self) - if self and self.object then - if not self.object:get_attach() then - self.object:remove() - end - end + self.object:remove() end, - glow = 50, }) local S = minetest.get_translator("mobs_mc") @@ -66,142 +55,8 @@ end local pr = PseudoRandom(os.time()*(-334)) --- Texuture overrides for enderman block. Required for cactus because it's original is a nodebox --- and the textures have tranparent pixels. -local block_texture_overrides -do - local cbackground = "mobs_mc_enderman_cactus_background.png" - local ctiles = minetest.registered_nodes["mcl_core:cactus"].tiles - - local ctable = {} - local last - for i=1, 6 do - if ctiles[i] then - last = ctiles[i] - end - table.insert(ctable, cbackground .. "^" .. last) - end - - block_texture_overrides = { - ["mcl_core:cactus"] = ctable, - -- FIXME: replace colorize colors with colors from palette - ["mcl_core:dirt_with_grass"] = - { - "mcl_core_grass_block_top.png^[colorize:green:90", - "default_dirt.png", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)"} - } -end - --- Create the textures table for the enderman, depending on which kind of block --- the enderman holds (if any). -local create_enderman_textures = function(block_type, itemstring) - local base = "mobs_mc_enderman.png^mobs_mc_enderman_eyes.png" - - --[[ Order of the textures in the texture table: - Flower, 90 degrees - Flower, 45 degrees - Held block, backside - Held block, bottom - Held block, front - Held block, left - Held block, right - Held block, top - Enderman texture (base) - ]] - -- Regular cube - if block_type == "cube" then - local tiles = minetest.registered_nodes[itemstring].tiles - local textures = {} - local last - if block_texture_overrides[itemstring] then - -- Texture override available? Use these instead! - textures = block_texture_overrides[itemstring] - else - -- Extract the texture names - for i = 1, 6 do - if type(tiles[i]) == "string" then - last = tiles[i] - elseif type(tiles[i]) == "table" then - if tiles[i].name then - last = tiles[i].name - end - end - table.insert(textures, last) - end - end - return { - "blank.png", - "blank.png", - textures[5], - textures[2], - textures[6], - textures[3], - textures[4], - textures[1], - base, -- Enderman texture - } - -- Node of plantlike drawtype, 45° (recommended) - elseif block_type == "plantlike45" then - local textures = minetest.registered_nodes[itemstring].tiles - return { - "blank.png", - textures[1], - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - base, - } - -- Node of plantlike drawtype, 90° - elseif block_type == "plantlike90" then - local textures = minetest.registered_nodes[itemstring].tiles - return { - textures[1], - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - base, - } - elseif block_type == "unknown" then - return { - "blank.png", - "blank.png", - "unknown_node.png", - "unknown_node.png", - "unknown_node.png", - "unknown_node.png", - "unknown_node.png", - "unknown_node.png", - base, -- Enderman texture - } - -- No block held (for initial texture) - elseif block_type == "nothing" or block_type == nil then - return { - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - "blank.png", - base, -- Enderman texture - } - end -end - -- Select a new animation definition. -local select_enderman_animation = function(animation_type) +local select_rover_animation = function(animation_type) -- Enderman holds a block if animation_type == "block" then return { @@ -254,8 +109,8 @@ local psdefs = {{ texture = "mcl_portals_particle"..math.random(1, 5)..".png", }} -mcl_mobs.register_mob("mobs_mc:enderman", { - description = S("Enderman"), +mcl_mobs.register_mob("mobs_mc:rover", { + description = S("Rover"), type = "monster", spawn_class = "passive", can_despawn = true, @@ -267,23 +122,11 @@ mcl_mobs.register_mob("mobs_mc:enderman", { xp_max = 5, collisionbox = {-0.3, -0.01, -0.3, 0.3, 2.89, 0.3}, visual = "mesh", - mesh = "mobs_mc_enderman.b3d", - textures = create_enderman_textures(), - visual_size = {x=3, y=3}, + mesh = "vl_rover.b3d", + textures = { "vl_mobs_rover.png^vl_mobs_rover_face.png" }, + glow = 100, + visual_size = {x=10, y=10}, makes_footstep_sound = true, - on_spawn = function(self) - local spider_eyes=false - for n = 1, #self.object:get_children() do - local obj = self.object:get_children()[n] - if obj:get_luaentity() and self.object:get_luaentity().name == "mobs_mc:ender_eyes" then - spider_eyes = true - end - end - if not spider_eyes then - minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(0,2.54,-1.99), vector.new(90,0,180)) - minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(1,2.54,-1.99), vector.new(90,0,180)) - end - end, sounds = { -- TODO: Custom war cry sound war_cry = "mobs_sandmonster", @@ -292,8 +135,8 @@ mcl_mobs.register_mob("mobs_mc:enderman", { random = {name="mobs_mc_enderman_random", gain=0.5}, distance = 16, }, - walk_velocity = 0.2, - run_velocity = 3.4, + walk_velocity = 2, + run_velocity = 4, damage = 7, reach = 2, particlespawners = psdefs, @@ -304,7 +147,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", { max = 1, looting = "common"}, }, - animation = select_enderman_animation("normal"), + animation = select_rover_animation("normal"), _taken_node = "", can_spawn = function(pos) return #minetest.find_nodes_in_area(vector.offset(pos,0,1,0),vector.offset(pos,0,3,0),{"air"}) > 2 @@ -348,6 +191,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", { -- AGRESSIVELY WARP/CHASE PLAYER BEHAVIOUR HERE. if self.state == "attack" then + self.object:set_properties({textures={"vl_mobs_rover.png^vl_mobs_rover_face_angry.png"}}) if self.attack then local target = self.attack local pos = target:get_pos() @@ -358,6 +202,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", { end end else --if not attacking try to tp to the dark + self.object:set_properties({textures={"vl_mobs_rover.png^vl_mobs_rover_face.png"}}) if dim == 'overworld' then local light = minetest.get_node_light(enderpos) if light and light > minetest.LIGHT_MAX then @@ -489,38 +334,17 @@ mcl_mobs.register_mob("mobs_mc:enderman", { minetest.remove_node(take_pos) local dug = minetest.get_node_or_nil(take_pos) if dug and dug.name == "air" then - self._taken_node = node.name - self.persistent = true - local def = minetest.registered_nodes[self._taken_node] - -- Update animation and texture accordingly (adds visibly carried block) - local block_type - -- Cube-shaped - if def.drawtype == "normal" or - def.drawtype == "nodebox" or - def.drawtype == "liquid" or - def.drawtype == "flowingliquid" or - def.drawtype == "glasslike" or - def.drawtype == "glasslike_framed" or - def.drawtype == "glasslike_framed_optional" or - def.drawtype == "allfaces" or - def.drawtype == "allfaces_optional" or - def.drawtype == nil then - block_type = "cube" - elseif def.drawtype == "plantlike" then - -- Flowers and stuff - block_type = "plantlike45" - elseif def.drawtype == "airlike" then - -- Just air - block_type = nil - else - -- Fallback for complex drawtypes - block_type = "unknown" + local node_obj = vl_held_item.create_item_entity(take_pos, node.name) + if node_obj then + node_obj:set_attach(self.object, "held_node") + self._node_obj = node_obj + self._taken_node = node.name + node_obj:set_properties({visual_size={x=0.02, y=0.02}}) end - self.base_texture = create_enderman_textures(block_type, self._taken_node) - self.object:set_properties({ textures = self.base_texture }) - self.animation = select_enderman_animation("block") + local def = minetest.registered_nodes[self._taken_node] + self.animation = select_rover_animation("block") self:set_animation(self.animation.current) - if def.sounds and def.sounds.dug then + if def and def.sounds and def.sounds.dug then minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16}, true) end end @@ -542,12 +366,14 @@ mcl_mobs.register_mob("mobs_mc:enderman", { local def = minetest.registered_nodes[self._taken_node] -- Update animation accordingly (removes visible block) self.persistent = false - self.animation = select_enderman_animation("normal") + self.animation = select_rover_animation("normal") self:set_animation(self.animation.current) - if def.sounds and def.sounds.place then + if def and def.sounds and def.sounds.place then minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16}, true) end - self._taken_node = "" + self._node_obj:remove() + self._node_obj = nil + self._taken_node = nil end end end @@ -645,16 +471,41 @@ mcl_mobs.register_mob("mobs_mc:enderman", { --end end end, + after_activate = function(self, staticdata, def, dtime) + if not self._taken_node or self._taken_node == "" then + self.animation = select_rover_animation("normal") + self:set_animation(self.animation.current) + return + end + self.animation = select_rover_animation("block") + self:set_animation(self.animation.current) + local node_obj = vl_held_item.create_item_entity(self.object:get_pos(), self._taken_node) + if node_obj then + node_obj:set_attach(self.object, "held_node") + self._node_obj = node_obj + node_obj:set_properties({visual_size={x=0.02, y=0.02}}) + end + end, armor = { fleshy = 100, water_vulnerable = 100 }, water_damage = 8, view_range = 64, fear_height = 4, attack_type = "dogfight", -}) + _on_after_convert = function(obj) + obj:set_properties({ + mesh = "vl_rover.b3d", + textures = { "vl_mobs_rover.png^vl_mobs_rover_face.png" }, + visual_size = {x=10, y=10}, + }) + end +}) -- END mcl_mobs.register_mob("mobs_mc:rover", { + +-- compat +mcl_mobs.register_conversion("mobs_mc:enderman", "mobs_mc:rover") -- End spawn mcl_mobs:spawn_specific( -"mobs_mc:enderman", +"mobs_mc:rover", "end", "ground", { @@ -674,7 +525,7 @@ mcl_vars.mg_end_min, mcl_vars.mg_end_max) -- Overworld spawn mcl_mobs:spawn_specific( -"mobs_mc:enderman", +"mobs_mc:rover", "overworld", "ground", { @@ -823,7 +674,7 @@ mcl_vars.mg_overworld_max) -- Nether spawn (rare) mcl_mobs:spawn_specific( -"mobs_mc:enderman", +"mobs_mc:rover", "nether", "ground", { @@ -840,7 +691,7 @@ mcl_vars.mg_nether_max) -- Warped Forest spawn (common) mcl_mobs:spawn_specific( -"mobs_mc:enderman", +"mobs_mc:rover", "nether", "ground", { @@ -855,4 +706,5 @@ mcl_vars.mg_nether_min, mcl_vars.mg_nether_max) -- spawn eggs -mcl_mobs.register_egg("mobs_mc:enderman", S("Enderman"), "#252525", "#151515", 0) +mcl_mobs.register_egg("mobs_mc:rover", S("Rover"), "#252525", "#151515", 0) +minetest.register_alias("mobs_mc:enderman", "mobs_mc:rover") diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 6ef8016e6..e0df5323c 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -249,6 +249,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", { }) if not minetest.is_creative_enabled(clicker:get_player_name()) then item:add_wear(mobs_mc.shears_wear) + tt.reload_itemstack_description(item) -- update tooltip clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item) end return diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index 274c8aee4..8ea4d9ced 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -73,7 +73,7 @@ local skeleton = { looting = "common",}, -- Head - -- TODO: Only drop if killed by charged creeper + -- TODO: Only drop if killed by charged stalker {name = "mcl_heads:skeleton", chance = 200, -- 0.5% chance min = 1, @@ -113,7 +113,8 @@ local skeleton = { self.object:set_yaw(minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.attack:get_pos()))) end local dmg = math.random(2, 4) - mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg) + local arrow = self.arrow:match("^(.+)_entity$") + mcl_bows.shoot_arrow(arrow, pos, dir, self.object:get_yaw(), self.object, nil, dmg) end end, shoot_interval = 2, @@ -140,10 +141,10 @@ stray.textures = { "mcl_bows_bow_0.png", }, } +stray.arrow = "mcl_potions:frost_arrow_entity" -- TODO: different sound (w/ echo) --- TODO: stray's arrow inflicts slowness status table.insert(stray.drops, { - name = "mcl_potions:slowness_arrow", + name = "mcl_potions:frost_arrow", chance = 2, min = 1, max = 1, @@ -152,13 +153,20 @@ table.insert(stray.drops, { local chance = 0.5 for i = 1, lvl do if chance > 1 then - return 1 + return 1 -- TODO verify this logic, I think this is not how chance works end chance = chance + (1 - chance) / 2 end return chance end, }) +table.insert(stray.drops, { + name = "mcl_mobitems:shiny_ice_crystal", + chance = 3, + min = 1, + max = 2, + looting = "rare", +}) mcl_mobs.register_mob("mobs_mc:stray", stray) diff --git a/mods/ENTITIES/mobs_mc/skeleton_wither.lua b/mods/ENTITIES/mobs_mc/skeleton_wither.lua index c39104f4b..b01fb4b96 100644 --- a/mods/ENTITIES/mobs_mc/skeleton_wither.lua +++ b/mods/ENTITIES/mobs_mc/skeleton_wither.lua @@ -98,7 +98,7 @@ mcl_mobs.register_mob("mobs_mc:witherskeleton", { fire_resistant = true, dealt_effect = { name = "withering", - factor = 1, + level = 1, dur = 10, }, }) diff --git a/mods/ENTITIES/mobs_mc/snowman.lua b/mods/ENTITIES/mobs_mc/snowman.lua index 62b988b9a..595c7d63e 100644 --- a/mods/ENTITIES/mobs_mc/snowman.lua +++ b/mods/ENTITIES/mobs_mc/snowman.lua @@ -131,6 +131,7 @@ mcl_mobs.register_mob("mobs_mc:snowman", { -- Wear out if not minetest.is_creative_enabled(clicker:get_player_name()) then item:add_wear(mobs_mc.shears_wear) + tt.reload_itemstack_description(item) -- update tooltip clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item) end end diff --git a/mods/ENTITIES/mobs_mc/spider.lua b/mods/ENTITIES/mobs_mc/spider.lua index 16f802c09..d01c7afbe 100644 --- a/mods/ENTITIES/mobs_mc/spider.lua +++ b/mods/ENTITIES/mobs_mc/spider.lua @@ -138,7 +138,7 @@ cave_spider.sounds = table.copy(spider.sounds) cave_spider.sounds.base_pitch = 1.25 cave_spider.dealt_effect = { name = "poison", - factor = 2.5, + level = 2, dur = 7, } mcl_mobs.register_mob("mobs_mc:cave_spider", cave_spider) diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/stalker.lua similarity index 72% rename from mods/ENTITIES/mobs_mc/creeper.lua rename to mods/ENTITIES/mobs_mc/stalker.lua index 2c95407c8..5b1fd6a08 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/stalker.lua @@ -3,14 +3,59 @@ local S = minetest.get_translator("mobs_mc") --################### ---################### CREEPER +--################### STALKER --################### +local function get_texture(self) + local on_name = self.standing_on + local texture + local texture_suff = "" + if on_name and on_name ~= "air" then + local tiles = minetest.registered_nodes[on_name].tiles + if tiles then + local tile = tiles[1] + local color + if type(tile) == "table" then + texture = tile.name or tile.image + if tile.color then + color = minetest.colorspec_to_colorstring(tile.color) + end + elseif type(tile) == "string" then + texture = tile + end + if not color then + color = minetest.colorspec_to_colorstring(minetest.registered_nodes[on_name].color) + end + if color then + texture_suff = "^[multiply:" .. color .. "^[hsl:0:0:20" + end + end + end + if not texture or texture == "" then + texture = "vl_stalker_default.png" + end + texture = "([combine:16x24:0,0=" .. texture .. ":0,16=" .. texture .. texture_suff + if self.attack then + texture = texture .. ")^vl_mobs_stalker_overlay_angry.png" + else + texture = texture .. ")^vl_mobs_stalker_overlay.png" + end + return texture +end + +local AURA = "vl_stalker_overloaded_aura.png" +local function get_overloaded_aura(timer) + local frame = math.floor(timer*16) + local f = tostring(frame) + local nf = tostring(16-f) + return "[combine:16x24:-" .. nf ..",0=" .. AURA .. ":" .. f .. ",0=" .. AURA +end -mcl_mobs.register_mob("mobs_mc:creeper", { - description = S("Creeper"), + +mcl_mobs.register_mob("mobs_mc:stalker", { + description = S("Stalker"), type = "monster", spawn_class = "hostile", spawn_in_group = 1, @@ -21,16 +66,16 @@ mcl_mobs.register_mob("mobs_mc:creeper", { collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3}, pathfinding = 1, visual = "mesh", - mesh = "mobs_mc_creeper.b3d", - head_swivel = "Head_Control", + mesh = "vl_stalker.b3d", +-- head_swivel = "Head_Control", bone_eye_height = 2.35, head_eye_height = 1.8; curiosity = 2, textures = { - {"mobs_mc_creeper.png", + {get_texture({}), "mobs_mc_empty.png"}, }, - visual_size = {x=3, y=3}, + visual_size = {x=2, y=2}, sounds = { attack = "tnt_ignite", death = "mobs_mc_creeper_death", @@ -56,8 +101,8 @@ mcl_mobs.register_mob("mobs_mc:creeper", { allow_fuse_reset = true, stop_to_explode = true, - -- Force-ignite creeper with flint and steel and explode after 1.5 seconds. - -- TODO: Make creeper flash after doing this as well. + -- Force-ignite stalker with flint and steel and explode after 1.5 seconds. + -- TODO: Make stalker flash after doing this as well. -- TODO: Test and debug this code. on_rightclick = function(self, clicker) if self._forced_explosion_countdown_timer ~= nil then @@ -86,6 +131,7 @@ mcl_mobs.register_mob("mobs_mc:creeper", { self:boom(mcl_util.get_object_center(self.object), self.explosion_strength) end end + self.object:set_properties({textures={get_texture(self)}}) end, on_die = function(self, pos, cmi_cause) -- Drop a random music disc when killed by skeleton or stray @@ -108,35 +154,42 @@ mcl_mobs.register_mob("mobs_mc:creeper", { looting = "common",}, -- Head - -- TODO: Only drop if killed by charged creeper - {name = "mcl_heads:creeper", + -- TODO: Only drop if killed by charged stalker + {name = "mcl_heads:stalker", chance = 200, -- 0.5% min = 1, max = 1,}, }, animation = { - speed_normal = 24, - speed_run = 48, + speed_normal = 30, + speed_run = 60, stand_start = 0, stand_end = 23, walk_start = 24, walk_end = 49, run_start = 24, run_end = 49, - hurt_start = 110, - hurt_end = 139, - death_start = 140, - death_end = 189, - look_start = 50, - look_end = 108, + fuse_start = 49, + fuse_end = 80, }, floats = 1, fear_height = 4, view_range = 16, -}) -mcl_mobs.register_mob("mobs_mc:creeper_charged", { - description = S("Charged Creeper"), + _on_after_convert = function(obj) + obj:set_properties({ + visual_size = {x=2, y=2}, + mesh = "vl_stalker.b3d", + textures = { + {get_texture({}), + "mobs_mc_empty.png"}, + }, + }) + end, +}) -- END mcl_mobs.register_mob("mobs_mc:stalker", { + +mcl_mobs.register_mob("mobs_mc:stalker_overloaded", { + description = S("Overloaded Stalker"), type = "monster", spawn_class = "hostile", hp_min = 20, @@ -146,15 +199,16 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", { collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3}, pathfinding = 1, visual = "mesh", - mesh = "mobs_mc_creeper.b3d", + mesh = "vl_stalker.b3d", --BOOM textures = { - {"mobs_mc_creeper.png", - "mobs_mc_creeper_charge.png"}, + {get_texture({}), + AURA}, }, - visual_size = {x=3, y=3}, + use_texture_alpha = true, + visual_size = {x=2, y=2}, sounds = { attack = "tnt_ignite", death = "mobs_mc_creeper_death", @@ -178,8 +232,8 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", { allow_fuse_reset = true, stop_to_explode = true, - -- Force-ignite creeper with flint and steel and explode after 1.5 seconds. - -- TODO: Make creeper flash after doing this as well. + -- Force-ignite stalker with flint and steel and explode after 1.5 seconds. + -- TODO: Make stalker flash after doing this as well. -- TODO: Test and debug this code. on_rightclick = function(self, clicker) if self._forced_explosion_countdown_timer ~= nil then @@ -208,6 +262,9 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", { self:boom(mcl_util.get_object_center(self.object), self.explosion_strength) end end + if not self._aura_timer or self._aura_timer > 1 then self._aura_timer = 0 end + self._aura_timer = self._aura_timer + dtime + self.object:set_properties({textures={get_texture(self), get_overloaded_aura(self._aura_timer)}}) end, on_die = function(self, pos, cmi_cause) -- Drop a random music disc when killed by skeleton or stray @@ -222,7 +279,7 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", { end end, on_lightning_strike = function(self, pos, pos2, objects) - mcl_util.replace_mob(self.object, "mobs_mc:creeper_charged") + mcl_util.replace_mob(self.object, "mobs_mc:stalker_overloaded") return true end, maxdrops = 2, @@ -234,27 +291,23 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", { looting = "common",}, -- Head - -- TODO: Only drop if killed by charged creeper - {name = "mcl_heads:creeper", + -- TODO: Only drop if killed by overloaded stalker + {name = "mcl_heads:stalker", chance = 200, -- 0.5% min = 1, max = 1,}, }, animation = { - speed_normal = 24, - speed_run = 48, + speed_normal = 30, + speed_run = 60, stand_start = 0, stand_end = 23, walk_start = 24, walk_end = 49, run_start = 24, run_end = 49, - hurt_start = 110, - hurt_end = 139, - death_start = 140, - death_end = 189, - look_start = 50, - look_end = 108, + fuse_start = 49, + fuse_end = 80, }, floats = 1, fear_height = 4, @@ -262,10 +315,25 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", { --Having trouble when fire is placed with lightning fire_resistant = true, glow = 3, -}) + + _on_after_convert = function(obj) + obj:set_properties({ + visual_size = {x=2, y=2}, + mesh = "vl_stalker.b3d", + textures = { + {get_texture({}), + AURA}, + }, + }) + end, +}) -- END mcl_mobs.register_mob("mobs_mc:stalker_overloaded", { + +-- compat +mcl_mobs.register_conversion("mobs_mc:creeper", "mobs_mc:stalker") +mcl_mobs.register_conversion("mobs_mc:creeper_charged", "mobs_mc:stalker_overloaded") mcl_mobs:spawn_specific( -"mobs_mc:creeper", +"mobs_mc:stalker", "overworld", "ground", { @@ -413,4 +481,6 @@ mcl_vars.mg_overworld_min, mcl_vars.mg_overworld_max) -- spawn eggs -mcl_mobs.register_egg("mobs_mc:creeper", S("Creeper"), "#0da70a", "#000000", 0) +mcl_mobs.register_egg("mobs_mc:stalker", S("Stalker"), "#0da70a", "#000000", 0) +minetest.register_alias("mobs_mc:creeper", "mobs_mc:stalker") +mcl_mobs.register_egg("mobs_mc:stalker_overloaded", S("Overloaded Stalker"), "#00a77a", "#000000", 0) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 2897650c8..b1e291037 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -608,6 +608,8 @@ local professions = { { { { "mcl_nether:nether_wart_item", 22, 22 }, E1 }, { { "mcl_core:emerald", 3, 3 }, { "mcl_experience:bottle", 1, 1 } }, + { { "mcl_core:emerald", 15, 15 }, { "mcl_mobitems:aery_charge", 1, 1 } }, -- TODO reconsider + { { "mcl_core:emerald", 15, 15 }, { "mcl_mobitems:earthen_ash", 1, 1 } }, -- TODO reconsider }, }, }, diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index f1e1e6e78..252873629 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -349,7 +349,7 @@ mcl_mobs.register_mob("mobs_mc:wither", { mcl_util.deal_damage(objs[n], 8, {type = "magic"}) hit_some = true end - mcl_mobs.effect_functions["withering"](objs[n], 0.5, 10) + mcl_potions.give_effect("withering", objs[n], 2, 10) end if hit_some then mcl_mobs.effect(pos, 32, "mcl_particles_soul_fire_flame.png", 5, 10, self.reach, 1, 0) @@ -469,7 +469,7 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", { -- direct hit hit_player = function(self, player) local pos = vector.new(self.object:get_pos()) - mcl_mobs.effect_functions["withering"](player, 0.5, 10) + mcl_potions.give_effect("withering", player, 2, 10) player:punch(self.object, 1.0, { full_punch_interval = 0.5, damage_groups = {fleshy = 8}, @@ -484,7 +484,7 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", { hit_mob = function(self, mob) local pos = vector.new(self.object:get_pos()) - mcl_mobs.effect_functions["withering"](mob, 0.5, 10) + mcl_potions.give_effect("withering", mob, 2, 10) mob:punch(self.object, 1.0, { full_punch_interval = 0.5, damage_groups = {fleshy = 8}, @@ -522,7 +522,7 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull_strong", { -- direct hit hit_player = function(self, player) local pos = vector.new(self.object:get_pos()) - mcl_mobs.effect_functions["withering"](player, 0.5, 10) + mcl_potions.give_effect("withering", player, 2, 10) player:punch(self.object, 1.0, { full_punch_interval = 0.5, damage_groups = {fleshy = 12}, @@ -541,7 +541,7 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull_strong", { hit_mob = function(self, mob) local pos = vector.new(self.object:get_pos()) - mcl_mobs.effect_functions["withering"](mob, 0.5, 10) + mcl_potions.give_effect("withering", mob, 2, 10) mob:punch(self.object, 1.0, { full_punch_interval = 0.5, damage_groups = {fleshy = 12}, diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index cf2001f9b..2f6d7e79f 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -38,7 +38,7 @@ local drops_common = { local drops_zombie = table.copy(drops_common) table.insert(drops_zombie, { -- Zombie Head - -- TODO: Only drop if killed by charged creeper + -- TODO: Only drop if killed by charged stalker name = "mcl_heads:zombie", chance = 200, -- 0.5% min = 1, diff --git a/mods/ENTITIES/modpack.conf b/mods/ENTITIES/modpack.conf index 07731c775..95265a8a0 100644 --- a/mods/ENTITIES/modpack.conf +++ b/mods/ENTITIES/modpack.conf @@ -1,2 +1,2 @@ name = ENTITIES -description = Meta-modpack containing entity-related mods for MineClone 2 +description = Meta-modpack containing entity-related mods for VoxeLibre diff --git a/mods/ENTITIES/vl_held_item/init.lua b/mods/ENTITIES/vl_held_item/init.lua new file mode 100644 index 000000000..f64ad9928 --- /dev/null +++ b/mods/ENTITIES/vl_held_item/init.lua @@ -0,0 +1,40 @@ +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +vl_held_item = {} +local mod = vl_held_item + +local held_item_entity = { + initial_properties = { + hp_max = 1, + physical = true, + pointable = false, + collide_with_objects = true, + static_save = false, -- TODO remove/change later when needed to persist + -- WARNING persisting held items not recommended, mob can recreate it after_activate + collision_box = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, + }, + visual = "wielditem", + textures = { "mcl_core:dirt_with_grass" }, +} +function held_item_entity:on_activate(staticdata, dtime_unloaded) + local staticdata = minetest.deserialize(staticdata) + self._staticdata = staticdata + + local props = { + visual = "wielditem", + textures = { staticdata.itemname }, + } + self.object:set_properties(props) +end +function held_item_entity:get_staticdata() + return minetest.serialize(self._staticdata) +end +minetest.register_entity("vl_held_item:held_item_entity", held_item_entity) + +function mod.create_item_entity(pos, itemname) + local staticdata = { + itemname = itemname + } + return minetest.add_entity(pos, "vl_held_item:held_item_entity", minetest.serialize(staticdata)) +end + diff --git a/mods/ENTITIES/vl_held_item/mod.conf b/mods/ENTITIES/vl_held_item/mod.conf new file mode 100644 index 000000000..c5068855f --- /dev/null +++ b/mods/ENTITIES/vl_held_item/mod.conf @@ -0,0 +1,4 @@ +name = vl_held_item +author = teknomunk, Herowl +description = An entity that represents an item held by a mob +depends = mcl_core diff --git a/mods/ENVIRONMENT/lightning/API.md b/mods/ENVIRONMENT/lightning/API.md index ad4f0a3b4..d420bd4b3 100644 --- a/mods/ENVIRONMENT/lightning/API.md +++ b/mods/ENVIRONMENT/lightning/API.md @@ -1,5 +1,5 @@ # lightning -Lightning mod for MineClone2 with the following API: +Lightning mod for VoxeLibre with the following API: ## lightning.register_on_strike(function(pos, pos2, objects)) Custom function called when a lightning strikes. @@ -28,4 +28,4 @@ end) minetest.register_on_respawnplayer(function(player) lightning.strike(player:get_pos()) end) -``` \ No newline at end of file +``` diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index 59591b061..41d6f458c 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -1,7 +1,7 @@ --[[ Copyright (C) 2016 - Auke Kok -Adapted by MineClone2 contributors +Adapted by VoxeLibre contributors "lightning" is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/mods/ENVIRONMENT/mcl_raids/init.lua b/mods/ENVIRONMENT/mcl_raids/init.lua index 8e7c644ae..d0c10eb20 100644 --- a/mods/ENVIRONMENT/mcl_raids/init.lua +++ b/mods/ENVIRONMENT/mcl_raids/init.lua @@ -104,11 +104,9 @@ function mcl_raids.promote_to_raidcaptain(c) -- object mcl_raids.drop_obanner(pos) if cmi_cause and cmi_cause.type == "punch" and cmi_cause.puncher:is_player() then awards.unlock(cmi_cause.puncher:get_player_name(), "mcl:voluntary_exile") - local lv = mcl_potions.player_get_effect(cmi_cause.puncher, "bad_omen") - if not lv then lv = 0 - else lv = lv.factor end + local lv = mcl_potions.get_effect_level(cmi_cause.puncher, "bad_omen") lv = math.max(5,lv + 1) - mcl_potions.bad_omen_func(cmi_cause.puncher,lv,6000) + mcl_potions.give_effect_by_level("bad_omen", cmi_cause.puncher, lv, 6000) end end if old_ondie then return old_ondie(self,pos,cmi_cause) end @@ -296,7 +294,7 @@ mcl_events.register_event("raid",{ --minetest.log("Cond start raid") local r = {} for _,p in pairs(minetest.get_connected_players()) do - if mcl_potions.player_has_effect(p,"bad_omen") then + if mcl_potions.has_effect(p,"bad_omen") then local raid_pos = mcl_raids.find_village(p:get_pos()) if raid_pos then --minetest.log("We have a raid position. Start raid") @@ -310,8 +308,8 @@ mcl_events.register_event("raid",{ self.mobs = {} self.health_max = 1 self.health = 0 - local lv = mcl_potions.player_get_effect(minetest.get_player_by_name(self.player), "bad_omen") - if lv and lv.factor and lv.factor > 1 then self.max_stage = 6 end + local lv = mcl_potions.get_effect_level(minetest.get_player_by_name(self.player), "bad_omen") + if lv > 1 then self.max_stage = 6 end end, cond_progress = function(self) if not is_player_near(self) then return false end @@ -331,7 +329,7 @@ mcl_events.register_event("raid",{ end, on_complete = function(self) awards.unlock(self.player,"mcl:hero_of_the_village") - mcl_potions.player_clear_effect(minetest.get_player_by_name(self.player),"bad_omen") + mcl_potions.clear_effect(minetest.get_player_by_name(self.player),"bad_omen") make_firework(self.pos,os.time()) end, }) diff --git a/mods/ENVIRONMENT/mcl_weather/README.md b/mods/ENVIRONMENT/mcl_weather/README.md index 08f748dfb..be313cf86 100644 --- a/mods/ENVIRONMENT/mcl_weather/README.md +++ b/mods/ENVIRONMENT/mcl_weather/README.md @@ -1,6 +1,6 @@ `mcl_weather` ======================= -Weather mod for MineClone 2. Forked from the `weather_pack` mod by xeranas. +Weather mod for VoxeLibre. Forked from the `weather_pack` mod by xeranas. Weathers included ----------------------- diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 6d9efd47a..87952845b 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -120,20 +120,26 @@ mcl_weather.skycolor = { override_day_night_ratio = function(player, ratio) local meta = player:get_meta() local has_night_vision = meta:get_int("night_vision") == 1 + local has_darkness = meta:get_int("darkness") == 1 local is_visited_shepherd = meta:get_int("mcl_shepherd:special") == 1 local arg - -- Apply night vision only for dark sky - local is_dark = minetest.get_timeofday() > 0.8 or minetest.get_timeofday() < 0.2 or mcl_weather.state ~= "none" - local pos = player:get_pos() - local dim = mcl_worlds.pos_to_dimension(pos) - if (has_night_vision or is_visited_shepherd) and is_dark and dim ~= "nether" and dim ~= "end" then - if ratio == nil then - arg = NIGHT_VISION_RATIO - else - arg = math.max(ratio, NIGHT_VISION_RATIO) - end + if has_darkness and not is_visited_shepherd then + if has_night_vision then arg = 0.1 + else arg = 0 end else - arg = ratio + -- Apply night vision only for dark sky + local is_dark = minetest.get_timeofday() > 0.8 or minetest.get_timeofday() < 0.2 or mcl_weather.state ~= "none" + local pos = player:get_pos() + local dim = mcl_worlds.pos_to_dimension(pos) + if (has_night_vision or is_visited_shepherd) and is_dark and dim ~= "nether" and dim ~= "end" then + if ratio == nil then + arg = NIGHT_VISION_RATIO + else + arg = math.max(ratio, NIGHT_VISION_RATIO) + end + else + arg = ratio + end end player:override_day_night_ratio(arg) end, diff --git a/mods/ENVIRONMENT/modpack.conf b/mods/ENVIRONMENT/modpack.conf index 8c40cfab8..8376be988 100644 --- a/mods/ENVIRONMENT/modpack.conf +++ b/mods/ENVIRONMENT/modpack.conf @@ -1,2 +1,2 @@ name = ENVIRONMENT -description = Meta-modpack containing environment and nature-related mods for MineClone 2 +description = Meta-modpack containing environment and nature-related mods for VoxeLibre diff --git a/mods/HELP/doc/README.md b/mods/HELP/doc/README.md index c8fd1407d..37e6e6489 100644 --- a/mods/HELP/doc/README.md +++ b/mods/HELP/doc/README.md @@ -1,5 +1,5 @@ # Help -MineClone 2 uses some of the mods found in the Help modpack by Wuzzy. +VoxeLibre uses some of the mods found in the Help modpack by Wuzzy. The goal of this modpack is to make using Minetest and mods easier for both newcomers and advanced users. @@ -11,7 +11,7 @@ directly into mods (via `doc_items`). More information is given in the respective mods. -Overview of the mods used in MineClone 2: +Overview of the mods used in VoxeLibre: * `doc`: Documentation System. Core API and user interface. Mods can add arbitrary categories and entries * `doc_items`: Item Help. Adds automatically generated help texts for items and an API diff --git a/mods/HELP/doc/doc_items/init.lua b/mods/HELP/doc/doc_items/init.lua index d0106c847..0c3205b04 100644 --- a/mods/HELP/doc/doc_items/init.lua +++ b/mods/HELP/doc/doc_items/init.lua @@ -255,7 +255,7 @@ local function factoid_toolcaps(tool_capabilities, check_uses) formstring = formstring .. miningtimesstr end if useslines > 0 then - formstring = formstring .. S("Mining durability:") .. "\n" + formstring = formstring .. S("Durability:") .. "\n" formstring = formstring .. miningusesstr end if caplines > 0 or useslines > 0 or timelines > 0 then diff --git a/mods/HELP/doc/doc_items/locale/doc_items.de.tr b/mods/HELP/doc/doc_items/locale/doc_items.de.tr index f14c99314..c816d6efd 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.de.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.de.tr @@ -134,7 +134,7 @@ Unknown item (@1)=Unbekannter Gegenstand (@1) Itemstring: "@1"=Itemstring: „@1“ Durability: @1 uses=Haltbarkeit: @1 Benutzungen Durability: @1=Haltbarkeit: @1 -Mining durability:=Grabehaltbarkeit: +Durability:=Haltbarkeit: • @1, level @2: @3 uses=• @1, Stufe @2: @3 Benutzungen • @1, level @2: Unlimited=• @1, Stufe @2: Unbegrenzt 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.=Die Rotation dieses Blocks hängt davon ab, wie sie ihn platzieren: Platzieren Sie ihn auf den Boden oder an die Decke, um ihn vertikal aufzustellen; platzieren Sie in an der Seite für eine horizontale Ausrichtung. Wenn Sie während des Bauens schleichen, wird der Block stattdessen senkrecht zur üblichen Ausrichtung rotiert. diff --git a/mods/HELP/doc/doc_items/locale/doc_items.dk.tr b/mods/HELP/doc/doc_items/locale/doc_items.dk.tr index 1dd3eff8a..435e98779 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.dk.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.dk.tr @@ -135,7 +135,7 @@ Unknown item (@1)=ukendt genstand (@1) Itemstring: "@1"=Genstandsstreng: "@1" Durability: @1 uses=Holdbarhed: @1 anvendelser Durability: @1=Holdbarhed: @1 -Mining durability:=Udvindingsholdbarhed: +Durability:=Holdbarhed: • @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. diff --git a/mods/HELP/doc/doc_items/locale/doc_items.fr.tr b/mods/HELP/doc/doc_items/locale/doc_items.fr.tr index 269c97480..fe3a136c6 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.fr.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.fr.tr @@ -135,7 +135,7 @@ Unknown item (@1)=Objet inconnu (@1) Itemstring: "@1"=Identifiant d'objet : "@1" Durability: @1 uses=Durabilité : @1 utilisations Durability: @1=Durabilité : @1 -Mining durability:=Durabilité de minage : +Durability:=Durabilité : • @1, level @2: @3 uses=• @1, niveau @2 : @3 utilisations • @1, level @2: Unlimited=• @1, niveau @2 : Illimité 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.=La manière dont vous placez ce bloc affecte sa rotation : placez-le au sol ou au plafond pour une orientation verticale ; placez-le sur un coté pour une orientation horizontale. Pour le placer de manière perpendiculaire, utilisez la touche déplacement discrêt en le plaçant. diff --git a/mods/HELP/doc/doc_items/locale/doc_items.ja.tr b/mods/HELP/doc/doc_items/locale/doc_items.ja.tr index a2e1107de..3617081cd 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.ja.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.ja.tr @@ -135,7 +135,7 @@ Unknown item (@1)=不明なアイテム (@1) Itemstring: "@1"=アイテム文字列:"@1" Durability: @1 uses=耐久度:@1回 使用 Durability: @1=耐久度:@1 -Mining durability:=採掘耐久度: +Durability:=耐久度: • @1, level @2: @3 uses=・@1, レベル @2:@3回 使用 • @1, level @2: Unlimited=・@1, レベル @2:無限 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.=このブロックの回転は、置き方に影響されます:床や天井に置くと垂直方向、横に置くと水平方向になります。スニークしながら置くと、代わって直角の方向に向きます。 diff --git a/mods/HELP/doc/doc_items/locale/doc_items.pl.tr b/mods/HELP/doc/doc_items/locale/doc_items.pl.tr index 8ff945368..efa035429 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.pl.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.pl.tr @@ -135,7 +135,7 @@ Unknown item (@1)=Nieznany przedmiot (@1) Itemstring: "@1"=Id przedmiotu: "@1" Durability: @1 uses=Wytrzymałość: @1 użyć Durability: @1=Wytrzymałość: @1 -Mining durability:=Wytrzymałość kopania: +Durability:=Wytrzymałość: • @1, level @2: @3 uses=• @1, poziom @2: @3 użyć • @1, level @2: Unlimited=• @1, poziom @2: Nielimitowane 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.=Na rotację tego bloku wpływa sposób postawienia: Postaw go na podłodze lub suficie aby uzyskać pionową orientację; postaw go na boku by uzyskać poziomą orientację. Skradanie się podczas postawiania sprawia, że zostanie postawiony prostopadle. diff --git a/mods/HELP/doc/doc_items/locale/doc_items.pt.tr b/mods/HELP/doc/doc_items/locale/doc_items.pt.tr index abcf11547..3dcc3c760 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.pt.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.pt.tr @@ -135,7 +135,7 @@ Unknown item (@1)=Item desconhecido (@1) Itemstring: "@1"= Durability: @1 uses= Durability: @1= -Mining durability:= +Durability:= • @1, level @2: @3 uses= • @1, level @2: Unlimited= 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.= diff --git a/mods/HELP/doc/doc_items/locale/doc_items.pt_BR.tr b/mods/HELP/doc/doc_items/locale/doc_items.pt_BR.tr index eec43dba7..a9c219343 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.pt_BR.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.pt_BR.tr @@ -135,7 +135,7 @@ Unknown item (@1)=Item desconhecido (@1) Itemstring: "@1"= Durability: @1 uses=Durabilidade: @1 usos Durability: @1=Durabilidade: @1 -Mining durability:= +Durability:=Durabilidade: • @1, level @2: @3 uses= • @1, level @2: Unlimited= 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.= diff --git a/mods/HELP/doc/doc_items/locale/doc_items.ru.tr b/mods/HELP/doc/doc_items/locale/doc_items.ru.tr index ce5a9ca0a..1a6e5b3df 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.ru.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.ru.tr @@ -135,7 +135,7 @@ Unknown item (@1)=Неизвестный предмет (@1) Itemstring: "@1"=Техническое название: "@1" Durability: @1 uses=Прочность: @1 использований Durability: @1=Прочность: @1 -Mining durability:=Прочность при добыче: +Durability:=Прочность: • @1, level @2: @3 uses=• @1, уровень @2: @3 раз(а) • @1, level @2: Unlimited=• @1, уровень @2: Неограниченно 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.=Поворот этого блока зависит от того как вы его ставите: поставьте его на пол или потолок для вертикальной ориентации; поместите на стену для горизонтальной ориентации. Удерживайте [Красться] при размещении для перпендикулярной ориентации. diff --git a/mods/HELP/doc/doc_items/locale/template.txt b/mods/HELP/doc/doc_items/locale/template.txt index 77f107863..8ddcc553d 100644 --- a/mods/HELP/doc/doc_items/locale/template.txt +++ b/mods/HELP/doc/doc_items/locale/template.txt @@ -135,7 +135,7 @@ Unknown item (@1)= Itemstring: "@1"= Durability: @1 uses= Durability: @1= -Mining durability:= +Durability:= • @1, level @2: @3 uses= • @1, level @2: Unlimited= 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.= diff --git a/mods/HELP/mcl_craftguide/README.md b/mods/HELP/mcl_craftguide/README.md index f02ad3462..173e297a8 100644 --- a/mods/HELP/mcl_craftguide/README.md +++ b/mods/HELP/mcl_craftguide/README.md @@ -1,4 +1,4 @@ -# Crafting Guide (MineClone 2 edition) +# Crafting Guide (VoxeLibre edition) #### `mcl_craftguide` is based on, `craftguide` the most comprehensive crafting guide on Minetest. #### Consult the [Minetest Wiki](http://wiki.minetest.net/Crafting_guide) for more details. diff --git a/mods/HELP/mcl_doc/init.lua b/mods/HELP/mcl_doc/init.lua index 4ba387e12..034e7f38c 100644 --- a/mods/HELP/mcl_doc/init.lua +++ b/mods/HELP/mcl_doc/init.lua @@ -374,7 +374,7 @@ doc.sub.items.register_factoid("tools", "misc", function(itemstring, def) capstr = capstr .. S("Mining speed: @1", speedstr) .. "\n" end if miningusesstr ~= "" then - capstr = capstr .. S("Mining durability: @1", miningusesstr) .. "\n" + capstr = capstr .. S("Durability: @1", miningusesstr) .. "\n" end -- Only show one group at max diff --git a/mods/HELP/mcl_doc/locale/mcl_doc.de.tr b/mods/HELP/mcl_doc/locale/mcl_doc.de.tr index e929f9aec..5d64b387e 100644 --- a/mods/HELP/mcl_doc/locale/mcl_doc.de.tr +++ b/mods/HELP/mcl_doc/locale/mcl_doc.de.tr @@ -70,7 +70,7 @@ Instantaneous=Unmittelbar @1 uses=@1 Verwendungen Unlimited uses=Unbegrenzte Verwendungen Block breaking strength: @1=Blockbruchstärke: @1 -Mining durability: @1=Grabehaltbarkeit: @1 +Durability: @1=Haltbarkeit: @1 Armor points: @1=Rüstungspunkte: @1 Armor durability: @1=Rüstungshaltbarkeit: @1 It can be worn on the head.=Es kann auf dem Kopf getragen werden. diff --git a/mods/HELP/mcl_doc/locale/mcl_doc.dk.tr b/mods/HELP/mcl_doc/locale/mcl_doc.dk.tr index 7dfc40fdf..d4e45b1fa 100644 --- a/mods/HELP/mcl_doc/locale/mcl_doc.dk.tr +++ b/mods/HELP/mcl_doc/locale/mcl_doc.dk.tr @@ -70,7 +70,7 @@ Instantaneous=Momentan @1 uses=@1 anvendelser Unlimited uses=Uendelige anvendelser Block breaking strength: @1=Blokkens brudstyrke: @1 -Mining durability: @1=Udvindingsholdbarhed: @1 +Durability: @1=Holdbarhed: @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. diff --git a/mods/HELP/mcl_doc/locale/mcl_doc.fr.tr b/mods/HELP/mcl_doc/locale/mcl_doc.fr.tr index 529615821..9126a08de 100644 --- a/mods/HELP/mcl_doc/locale/mcl_doc.fr.tr +++ b/mods/HELP/mcl_doc/locale/mcl_doc.fr.tr @@ -6,7 +6,7 @@ This block can be turned into grass path with a shovel.=Ce bloc peut être trans This block acts as a soil for all saplings.=Ce bloc agit comme un sol pour tous les pousses arbres. This block acts as a soil for some saplings.=Ce bloc agit comme un sol pour certains pousses arbres. Sugar canes will grow on this block.=Les cannes à sucre pousseront sur ce bloc. -Nether wart will grow on this block.=La verrue du Néant se développera sur ce bloc. +Nether wart will grow on this block.=La verrue du Nether se développera sur ce bloc. 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.=Ce bloc se désintègre rapidement lorsqu'il n'y a aucun bloc de bois de n'importe quel espèce à une distance de @1. En décomposition, il disparaît et peut lâcher un des ses objets habituels. Le bloc ne se désintègre pas lorsque le bloc a été placé par un joueur. 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.=Ce bloc se désintègre rapidement et disparaît lorsqu'il n'y a aucun bloc de bois de n'importe quel espèce à une distance de @1. Le bloc ne se désintègre pas lorsque le bloc a été placé par un joueur. 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.=Cette plante ne peut pousser que sur des blocs d'herbe et de terre. Pour survivre, il doit avoir une vue dégagée sur le ciel au-dessus ou être exposé à un niveau de lumière de 8 ou plus. @@ -71,7 +71,7 @@ Instantaneous=Instantané @1 uses=@1 utilisations Unlimited uses=Utilisations illimitées Block breaking strength: @1=Résistance de rupture de bloc : @1 -Mining durability: @1=Durabilité de minage : @1 +Durability: @1=Durabilité : @1 Armor points: @1=Point d'armure : @1 Armor durability: @1=Durabilité de l'armure : @1 It can be worn on the head.=Il peut être porté sur la tête. diff --git a/mods/HELP/mcl_doc/locale/mcl_doc.ja.tr b/mods/HELP/mcl_doc/locale/mcl_doc.ja.tr index 0cef853c8..0d00f4a3a 100644 --- a/mods/HELP/mcl_doc/locale/mcl_doc.ja.tr +++ b/mods/HELP/mcl_doc/locale/mcl_doc.ja.tr @@ -70,7 +70,7 @@ Instantaneous=瞬間的 @1 uses=@1 使用 Unlimited uses=無限に使用可能 Block breaking strength: @1=ブロック破壊力:@1 -Mining durability: @1=採掘耐久度:@1 +Durability: @1=耐久性:@1 Armor points: @1=防具値:@1 Armor durability: @1=防具耐久度:@1 It can be worn on the head.=頭に装着することもできます。 diff --git a/mods/HELP/mcl_doc/locale/mcl_doc.pl.tr b/mods/HELP/mcl_doc/locale/mcl_doc.pl.tr index c451c8c39..015b0c45f 100644 --- a/mods/HELP/mcl_doc/locale/mcl_doc.pl.tr +++ b/mods/HELP/mcl_doc/locale/mcl_doc.pl.tr @@ -70,7 +70,7 @@ Instantaneous=Natychmiastowe @1 uses=@1 użyć Unlimited uses=Nielimitowane użycia Block breaking strength: @1=Siła niszczenia bloku: @1 -Mining durability: @1=Wytrzymałość kopania: @1 +Durability: @1=Wytrzymałość: @1 Armor points: @1=Punkty zbroi: @1 Armor durability: @1=Wytrzymałość zbroi: @1 It can be worn on the head.=Może być noszony na głowie. diff --git a/mods/HELP/mcl_doc/locale/mcl_doc.ru.tr b/mods/HELP/mcl_doc/locale/mcl_doc.ru.tr index 741c0742c..ce2da5a5d 100644 --- a/mods/HELP/mcl_doc/locale/mcl_doc.ru.tr +++ b/mods/HELP/mcl_doc/locale/mcl_doc.ru.tr @@ -70,7 +70,7 @@ Instantaneous=мгновенно @1 uses=@1 Unlimited uses=не ограничено Block breaking strength: @1=Сила добычи: @1 -Mining durability: @1=Прочность при добыче: @1 +Durability: @1=Прочность: @1 Armor points: @1=Очки брони: @1 Armor durability: @1=Прочность брони: @1 It can be worn on the head.=Это можно носить на голове. diff --git a/mods/HELP/mcl_doc/locale/template.txt b/mods/HELP/mcl_doc/locale/template.txt index ec825644c..2d4e20044 100644 --- a/mods/HELP/mcl_doc/locale/template.txt +++ b/mods/HELP/mcl_doc/locale/template.txt @@ -71,7 +71,7 @@ Instantaneous= @1 uses= Unlimited uses= Block breaking strength: @1= -Mining durability: @1= +Durability: @1= Armor points: @1= Armor durability: @1= It can be worn on the head.= diff --git a/mods/HELP/mcl_doc/mod.conf b/mods/HELP/mcl_doc/mod.conf index d939761d5..080a69252 100644 --- a/mods/HELP/mcl_doc/mod.conf +++ b/mods/HELP/mcl_doc/mod.conf @@ -1,4 +1,4 @@ name = mcl_doc author = Wuzzy -description = This MineClone 2 mod sets up and configures the Help modpack mods to tailor the help towards MineClone 2. +description = This VoxeLibre mod sets up and configures the Help modpack mods to tailor the help towards VoxeLibre. depends = doc, doc_items diff --git a/mods/HELP/mcl_doc_basics/README.md b/mods/HELP/mcl_doc_basics/README.md index 13ac04e4a..f68ed9724 100644 --- a/mods/HELP/mcl_doc_basics/README.md +++ b/mods/HELP/mcl_doc_basics/README.md @@ -1,4 +1,4 @@ -# Basic help, MineClone 2 edition [`mcl_doc_basics`] +# Basic help, VoxeLibre edition [`mcl_doc_basics`] Adds basic help texts about Minetest, controls, gameplay and other basics. This mod uses the Documentation System [`doc`] as a basis and adds these categories: diff --git a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.de.tr b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.de.tr index 236d5a6bb..c66bd29b0 100644 --- a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.de.tr +++ b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.de.tr @@ -448,7 +448,7 @@ Pitch movement mode:=Nick-Bewegungsmodus: • No privilege required=• Kein Privileg nötig Creative Mode=Kreativmodus -Enabling Creative Mode in MineClone 2 applies the following changes:=Der Kreativmodus in MineClone 2 nimmt die folgenden Änderungen vor: +Enabling Creative Mode in VoxeLibre applies the following changes:=Der Kreativmodus in VoxeLibre nimmt die folgenden Änderungen vor: • You keep the things you've placed=• Sie behalten die Dinge, die Sie platzieren • Creative inventory is available to obtain most items easily=• Das Kreativinventar ist verfügbar, mit dem Sie die meisten Dinge leicht erhalten • Hand breaks all default blocks instantly=• Hand zerbricht alle Standardblöcke sofort diff --git a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.fr.tr b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.fr.tr index cf0b402a5..f3e597533 100644 --- a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.fr.tr +++ b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.fr.tr @@ -160,7 +160,7 @@ By holding down [Z], you can zoom the view at your crosshair. You need the “zo • Toggle Cinematic Mode: [F8]=• Basculer le mode cinématique : [F8] • Zoom: [Z]=• Zoom : [Z] Blocks=Blocs -The world of MineClone 2 is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Le monde de MineClone 2 est entièrement constitué de blocs (voxels, pour être précis). Les blocs peuvent être ajoutés ou supprimés avec les bons outils. +The world of VoxeLibre is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Le monde de VoxeLibre est entièrement constitué de blocs (voxels, pour être précis). Les blocs peuvent être ajoutés ou supprimés avec les bons outils. The world is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Le monde est entièrement fait de blocs (voxels, pour être précis). Les blocs peuvent être ajoutés ou supprimés avec les bons outils. Blocks can have a wide range of different properties which determine mining times, behavior, looks, shape, and much more. Their properties include:=Les blocs peuvent avoir un large éventail de propriétés différentes qui déterminent les temps d'exploration, le comportement, l'apparence, la forme et bien plus encore. Leurs propriétés comprennent: • Collidable: Collidable blocks can not be passed through; players can walk on them. Non-collidable blocks can be passed through freely=• Collidable : les blocs collidables ne peuvent pas être traversés; les joueurs peuvent marcher dessus. Les blocs non collidables peuvent passer librement @@ -260,15 +260,15 @@ Throwing away: If you hold an item stack and click with it somewhere outside the Quick transfer: You can quickly transfer an item stack to/from the player inventory to/from another item's inventory slot like a furnace, chest, or any other item with an inventory slot when that item's inventory is accessed. The target inventory is generally the most relevant inventory in this context.=Transfert rapide : vous pouvez rapidement transférer une pile d'objets vers / depuis l'inventaire du joueur vers / depuis l'emplacement d'inventaire d'un autre objet comme un four, un coffre ou tout autre élément avec un emplacement d'inventaire lorsque l'inventaire de cet article est accessible. L'inventaire cible est généralement l'inventaire le plus pertinent dans ce contexte. • Sneak+Left click: Automatically transfer item stack=• Faufiler+clic gauche : transférer automatiquement la pile d'objets Online help=Aide en ligne -You may want to check out these online resources related to MineClone 2.=Vous voudrez peut-être consulter ces ressources en ligne liées à MineClone 2. -MineClone 2 download and forum discussion: =Téléchargement de MineClone 2 et discussion sur le forum : -Here you find the most recent version of MineClone 2 and can discuss it.=Vous trouverez ici la version la plus récente de MineClone 2 et pouvez en discuter. +You may want to check out these online resources related to VoxeLibre.=Vous voudrez peut-être consulter ces ressources en ligne liées à VoxeLibre. +VoxeLibre download and forum discussion: =Téléchargement de VoxeLibre et discussion sur le forum : +Here you find the most recent version of VoxeLibre and can discuss it.=Vous trouverez ici la version la plus récente de VoxeLibre et pouvez en discuter. Bug tracker: =Suivi des bogues : Report bugs here.=Signalez les bugs ici. Minetest links:=Liens Minetest: You may want to check out these online resources related to Minetest:=Vous voudrez peut-être consulter ces ressources en ligne liées à Minetest: Official homepage of Minetest: =Page d'accueil officielle de Minetest : -The main place to find the most recent version of Minetest, the engine used by MineClone 2.=L'endroit principal pour trouver la version la plus récente de Minetest, le moteur utilisé par MineClone 2. +The main place to find the most recent version of Minetest, the engine used by VoxeLibre.=L'endroit principal pour trouver la version la plus récente de Minetest, le moteur utilisé par VoxeLibre. The main place to find the most recent version of Minetest.=L'endroit principal pour trouver la version la plus récente de Minetest. Community wiki: =Wiki de la communauté : A community-based documentation website for Minetest. Anyone with an account can edit it! It also features a documentation of Minetest Game.=Un site Web de documentation communautaire pour Minetest. N'importe qui avec un compte peut le modifier! C'est aussi une documentation pour Minetest. @@ -333,7 +333,7 @@ Online multiplayer:=Multijoueur en ligne: • Protection: Mechanism to own areas of the world, which only allows the owners to modify blocks inside=• Protection : Mécanisme pour posséder des zones du monde, qui permet uniquement aux propriétaires de modifier les blocs à l'intérieur Technical terms:=Termes techniques: • Minetest: This game engine=• Minetest : Ce moteur de jeu -• MineClone 2: What you play right now=• MineClone 2 : Ce à quoi vous jouez en ce moment +• VoxeLibre: What you play right now=• VoxeLibre : Ce à quoi vous jouez en ce moment • Minetest Game: A game for Minetest by the Minetest developers=• Minetest Game : Un jeu pour Minetest par les développeurs de Minetest • Game: A complete playing experience to be used in Minetest; such as a game or sandbox or similar=• Jeu : Une expérience de jeu complète à utiliser dans Minetest; comme un jeu ou un bac à sable ou similaire • Mod: A single subsystem which adds or modifies functionality; is the basic building block of games and can be used to further enhance or modify them=• Mod : un sous-système unique qui ajoute ou modifie des fonctionnalités; est le bloc de construction de base des jeux et peut être utilisé pour les améliorer ou les modifier davantage @@ -448,7 +448,7 @@ You can view your current position in the debug screen (open with [F5]).=Vous po # MCL2 extensions Creative Mode=Mode créatif -Enabling Creative Mode in MineClone 2 applies the following changes:=L'activation du mode créatif dans MineClone 2 applique les modifications suivantes : +Enabling Creative Mode in VoxeLibre applies the following changes:=L'activation du mode créatif dans VoxeLibre applique les modifications suivantes : • You keep the things you've placed=• Vous gardez les choses que vous avez placées • Creative inventory is available to obtain most items easily=• Un inventaire créatif est disponible pour obtenir facilement la plupart des objets • Hand breaks all default blocks instantly=• La main brise instantanément tous les blocs par défaut diff --git a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ja.tr b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ja.tr index bde6e2152..2fb0596f6 100644 --- a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ja.tr +++ b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ja.tr @@ -160,7 +160,7 @@ By holding down [Z], you can zoom the view at your crosshair. You need the “zo • Toggle Cinematic Mode: [F8]=・シネマティックモードの切替:[F8] • Zoom: [Z]=・ズーム:[Z] Blocks=ブロック -The world of MineClone 2 is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=MineClone 2のワールドは、すべてがブロック(正確にはボクセル)で構成されています。ブロックは、適切なツールで追加や削除ができます。 +The world of VoxeLibre is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=VoxeLibreのワールドは、すべてがブロック(正確にはボクセル)で構成されています。ブロックは、適切なツールで追加や削除ができます。 The world is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=ワールドは、すべてがブロック(正確にはボクセル)で構成されています。ブロックは、適切なツールで追加や削除ができます。 Blocks can have a wide range of different properties which determine mining times, behavior, looks, shape, and much more. Their properties include:=ブロックは幅広く多様なプロパティを持つことができ、採掘時間、動作、外観、形状などが定まります。プロパティは次のとおり: • Collidable: Collidable blocks can not be passed through; players can walk on them. Non-collidable blocks can be passed through freely=・衝突性:衝突性ブロックは通過できず、プレイヤーはその上を歩ける。非衝突性ブロックは、自由に通り抜けられる @@ -260,15 +260,15 @@ Throwing away: If you hold an item stack and click with it somewhere outside the Quick transfer: You can quickly transfer an item stack to/from the player inventory to/from another item's inventory slot like a furnace, chest, or any other item with an inventory slot when that item's inventory is accessed. The target inventory is generally the most relevant inventory in this context.=直送する:炉やチェストなどのインベントリスロットに対しては、プレイヤーインベントリからアイテムスタックを直送できます。この場合対象となるのは、一般的に最も関連性の高いインベントリスロットです。 • Sneak+Left click: Automatically transfer item stack=・スニークキー + 左クリック:アイテムスタックの自動転送 Online help=オンラインヘルプ -You may want to check out these online resources related to MineClone 2.=MineClone 2 に関連するオンライン資料もチェックしてみてください。 -MineClone 2 download and forum discussion: =MineClone 2 のダウンロードと掲示板での意見交換: -Here you find the most recent version of MineClone 2 and can discuss it.=ここでは MineClone 2 の最新バージョンを確認し、意見を交換できます。 +You may want to check out these online resources related to VoxeLibre.=VoxeLibre に関連するオンライン資料もチェックしてみてください。 +VoxeLibre download and forum discussion: =VoxeLibre のダウンロードと掲示板での意見交換: +Here you find the most recent version of VoxeLibre and can discuss it.=ここでは VoxeLibre の最新バージョンを確認し、意見を交換できます。 Bug tracker: =バグ追跡: Report bugs here.=バグの報告はこちら。 Minetest links:=Minetest リンク: You may want to check out these online resources related to Minetest:=Minetest に関連するオンライン資料もチェックしてみてください: Official homepage of Minetest: =Minetest の公式ホームページ: -The main place to find the most recent version of Minetest, the engine used by MineClone 2.=MineClone 2 で使用されているエンジン、Minetest の最新版を入手できるメインサイトです。 +The main place to find the most recent version of Minetest, the engine used by VoxeLibre.=VoxeLibre で使用されているエンジン、Minetest の最新版を入手できるメインサイトです。 The main place to find the most recent version of Minetest.=Minetest の最新版を入手できるメインサイトです。 Community wiki: =コミュニティ wiki: A community-based documentation website for Minetest. Anyone with an account can edit it! It also features a documentation of Minetest Game.=Minetest のための、コミュニティベースの文書サイトです。アカウントがあれば誰でも編集可能です! また、Minetest Game の資料も掲載されています。 @@ -333,7 +333,7 @@ Online multiplayer:=オンライン マルチプレイヤー • Protection: Mechanism to own areas of the world, which only allows the owners to modify blocks inside=・保護:ワールドの各エリアを所有する仕組み。エリア内部のブロックは、所有者のみが変更可能となる Technical terms:=技術的な用語: • Minetest: This game engine=・Minetest:マインテスト。本ゲームエンジン -• MineClone 2: What you play right now=・MineClone 2:マインクローン2。今、プレイしているもの +• VoxeLibre: What you play right now=・VoxeLibre:マインクローン2。今、プレイしているもの • Minetest Game: A game for Minetest by the Minetest developers=・Minetest Game:Minetest 開発者による、Minetest のためのゲーム • Game: A complete playing experience to be used in Minetest; such as a game or sandbox or similar=・Game:ゲームやサンドボックスなど、Minetest で使用される完全なプレイ体験 • Mod: A single subsystem which adds or modifies functionality; is the basic building block of games and can be used to further enhance or modify them=・Mod:モッド。機能を追加または変更する1つのサブシステム。ゲームの基本的な構成要素であり、ゲームをさらに強化または変更するために使用できる @@ -448,7 +448,7 @@ You can view your current position in the debug screen (open with [F5]).=デバ # MCL2 extensions Creative Mode=クリエイティブモード -Enabling Creative Mode in MineClone 2 applies the following changes:=MineClone 2 で Creative Mode を有効にすると、以下の変更が適用されます: +Enabling Creative Mode in VoxeLibre applies the following changes:=VoxeLibre で Creative Mode を有効にすると、以下の変更が適用されます: • You keep the things you've placed=・あなたが置いたものを保つ • Creative inventory is available to obtain most items easily=・ほとんどのアイテムを簡単に入手できるクリエイティブインベントリが利用可能 • Hand breaks all default blocks instantly=・すべてのデフォルトブロックを手で即座に壊せる diff --git a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.pl.tr b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.pl.tr index 37fe955ca..44f3cfb1d 100644 --- a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.pl.tr +++ b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.pl.tr @@ -160,7 +160,7 @@ By holding down [Z], you can zoom the view at your crosshair. You need the “zo • Toggle Cinematic Mode: [F8]=• Przełącz tryb kinowy: [F8] • Zoom: [Z]=• Przybliż: [Z] Blocks=Bloki -The world of MineClone 2 is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Świat MineClone 2 jest w całości złożony z bloków (a bardziej precyzyjnie voxeli). Bloki mogą być dodawane lub usuwane przy użyciu odpowiednich narzędzi. +The world of VoxeLibre is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Świat VoxeLibre jest w całości złożony z bloków (a bardziej precyzyjnie voxeli). Bloki mogą być dodawane lub usuwane przy użyciu odpowiednich narzędzi. The world is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Świat jest w całości złożony z bloków (a bardziej precyzyjnie voxeli). Bloki mogą być dodawane lub usuwane przy użyciu odpowiednich narzędzi. Blocks can have a wide range of different properties which determine mining times, behavior, looks, shape, and much more. Their properties include:=Bloki mogą mieć wiele różnych właściwości określających czas kopania, zachowanie, wygląd, kształt i wiele więcej. Te własności to między innymi: • Collidable: Collidable blocks can not be passed through; players can walk on them. Non-collidable blocks can be passed through freely=• Zderzalne: Przez bloki z tą własnością nie można przechodzić; gracze mogą po nich chodzić. Przez nie-zderzalne bloki można swobodnie przechodzić. @@ -260,15 +260,15 @@ Throwing away: If you hold an item stack and click with it somewhere outside the Quick transfer: You can quickly transfer an item stack to/from the player inventory to/from another item's inventory slot like a furnace, chest, or any other item with an inventory slot when that item's inventory is accessed. The target inventory is generally the most relevant inventory in this context.=Szybki transfer: Możesz szybko przemieszczać grupę przedmiotów z/do ekwipunku gracza do/z ekwipunku innego przedmiotu, takich jak piec, skrzynia czy innego z ekwipunkiem, gdy jego ekwipunek jest otworzony. Docelowy ekwipunek jest najczęściej najbardziej istotnym ekwipunkiem w takim kontekście. • Sneak+Left click: Automatically transfer item stack=• Skradanie+Lewy przycisk: Automatycznie przenieś grupę przedmiotów Online help=Pomoc online -You may want to check out these online resources related to MineClone 2.=Możesz chcieć zobaczyć na te zasoby online powiązane z MineClone 2. -MineClone 2 download and forum discussion: =MineClone 2 pobieranie oraz dyskusja na forum: -Here you find the most recent version of MineClone 2 and can discuss it.=Tutaj możesz znaleźć najnowszą wersję MineClone 2 i porozmawiać o niej +You may want to check out these online resources related to VoxeLibre.=Możesz chcieć zobaczyć na te zasoby online powiązane z VoxeLibre. +VoxeLibre download and forum discussion: =VoxeLibre pobieranie oraz dyskusja na forum: +Here you find the most recent version of VoxeLibre and can discuss it.=Tutaj możesz znaleźć najnowszą wersję VoxeLibre i porozmawiać o niej Bug tracker: =Śledzenie błędów: Report bugs here.=Zgłaszaj tu zauważone błędy. Minetest links:=Linki dotyczące Minetest: You may want to check out these online resources related to Minetest:=Możesz chcieć zobaczyć te zasoby online dotyczące Minetest Official homepage of Minetest: =Oficjalna strona Minetest: -The main place to find the most recent version of Minetest, the engine used by MineClone 2.=Miejsce gdzie można znaleźć najnowszą wersję Minetesta, silnika wykorzystywanego przez MineClone 2. +The main place to find the most recent version of Minetest, the engine used by VoxeLibre.=Miejsce gdzie można znaleźć najnowszą wersję Minetesta, silnika wykorzystywanego przez VoxeLibre. The main place to find the most recent version of Minetest.=Miejsce gdzie można znaleźć najnowszą wersję Minetesta. Community wiki: =Wiki społeczności: A community-based documentation website for Minetest. Anyone with an account can edit it! It also features a documentation of Minetest Game.=Utrzymywana przez społeczność dokumentacja na temat Minetest. Każdy z kontem może ją edytować! Znajduje się na niej również dokumentacja Gry Minetest. @@ -333,7 +333,7 @@ Online multiplayer:=Gra wieloosobowa w internecie: • Protection: Mechanism to own areas of the world, which only allows the owners to modify blocks inside=• Ochrona: Mechanizm pozwalający wejść w posiadanie pewnych części świata, co pozwala tylko właścicielom modyfikować bloki wewnątrz Technical terms:=Techniczne terminy: • Minetest: This game engine=• Minetest: Ten silnik gier -• MineClone 2: What you play right now=• MineClone 2: To w co teraz grasz +• VoxeLibre: What you play right now=• VoxeLibre: To w co teraz grasz • Minetest Game: A game for Minetest by the Minetest developers=• Gra Minetest: Gra w Minetest napisana przez jego twórców • Game: A complete playing experience to be used in Minetest; such as a game or sandbox or similar=• Gra: Kompletny doświadczenie do wykorzystania w Minetest; takie jak gry, piaskownice i podobne • Mod: A single subsystem which adds or modifies functionality; is the basic building block of games and can be used to further enhance or modify them=• Mod: Pojedynczy system, który dodaje, lub modyfikuje funkcjonalność; jest podstawowym blokiem budowalnym gier i może być wykorzystywany do dalszego urozmaicania i modyfikowania ich @@ -448,7 +448,7 @@ You can view your current position in the debug screen (open with [F5]).=Możesz # MCL2 extensions Creative Mode=Tryb kreatywny -Enabling Creative Mode in MineClone 2 applies the following changes:=Włączenie trybu kreatywnego w MineClone 2 aplikuje następujące zmiany: +Enabling Creative Mode in VoxeLibre applies the following changes:=Włączenie trybu kreatywnego w VoxeLibre aplikuje następujące zmiany: • You keep the things you've placed=• Nie tracisz postawionych rzeczy • Creative inventory is available to obtain most items easily=• Kreatywny ekwipunek jest dostępny, który pozwala łatwo zdobywać przedmioty • Hand breaks all default blocks instantly=• Ręka niszczy wszystkie domyślne bloki natychmiastowo diff --git a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ru.tr b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ru.tr index 8e8124f35..2367fbcbd 100644 --- a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ru.tr +++ b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.ru.tr @@ -160,7 +160,7 @@ By holding down [Z], you can zoom the view at your crosshair. You need the “zo • Toggle Cinematic Mode: [F8]=• [F8] - переключение кинематографического режима • Zoom: [Z]=• [Z] - приблизить Blocks=Блоки -The world of MineClone 2 is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Мир MineClone 2 полностью состоит из блоков (вокселей, если быть точнее). Блоки могут быть добавлены или удалены с помощью правильных инструментов. +The world of VoxeLibre is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Мир VoxeLibre полностью состоит из блоков (вокселей, если быть точнее). Блоки могут быть добавлены или удалены с помощью правильных инструментов. The world is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Мир целиком состоит из блоков (вокселей, если быть точнее). Блоки могут быть добавлены или удалены с помощью правильных инструментов. Blocks can have a wide range of different properties which determine mining times, behavior, looks, shape, and much more. Their properties include:=Блоки могут иметь широкий спектр различных свойств, которые определяют время добычи, поведение, внешний вид, форму и многое другое. Их свойства включают в себя: • Collidable: Collidable blocks can not be passed through; players can walk on them. Non-collidable blocks can be passed through freely=• Непроходимые: непроходимые блоки не могут быть пройдены насквозь; игроки могут ходить по ним. Проходимые блоки могут свободно пропускать вас сквозь себя @@ -260,15 +260,15 @@ Throwing away: If you hold an item stack and click with it somewhere outside the Quick transfer: You can quickly transfer an item stack to/from the player inventory to/from another item's inventory slot like a furnace, chest, or any other item with an inventory slot when that item's inventory is accessed. The target inventory is generally the most relevant inventory in this context.=Быстрая передача: вы можете быстро передавать стаки предметов между вашим личным инвентарём и инвентарём другого предмета (печи, сундука или любого другого, имеющего инвентарный слот) во время доступа к эту предмету. Обычно это используется для загрузки/выгрузки нужных предметов. • Sneak+Left click: Automatically transfer item stack=• [Красться]+[Левая кнопка] - автоматическая передача стака предметов Online help=Онлайн-помощь -You may want to check out these online resources related to MineClone 2.=Возможно, вы захотите ознакомиться с этими онлайн-ресурсами, связанными с MineClone 2. -MineClone 2 download and forum discussion: =Официальный форум MineClone 2: -Here you find the most recent version of MineClone 2 and can discuss it.=Здесь вы найдете самую последнюю версию MineClone 2 и сможете обсудить её. +You may want to check out these online resources related to VoxeLibre.=Возможно, вы захотите ознакомиться с этими онлайн-ресурсами, связанными с VoxeLibre. +VoxeLibre download and forum discussion: =Официальный форум VoxeLibre: +Here you find the most recent version of VoxeLibre and can discuss it.=Здесь вы найдете самую последнюю версию VoxeLibre и сможете обсудить её. Bug tracker: =Баг-трекер: Report bugs here.=С помощью баг-трекера можно сообщить об ошибке, если вы её обнаружите. Minetest links:=Ссылки Minetest: You may want to check out these online resources related to Minetest:=Возможно, вы захотите посетить эти онлайн-ресурсы, связанные с Minetest: Official homepage of Minetest: =Официальная домашняя страница Minetest: -The main place to find the most recent version of Minetest, the engine used by MineClone 2.=Это основное место для скачивания свежих версий Minetest, движка, используемого MineClone 2. +The main place to find the most recent version of Minetest, the engine used by VoxeLibre.=Это основное место для скачивания свежих версий Minetest, движка, используемого VoxeLibre. The main place to find the most recent version of Minetest.=Это основное место для скачивания свежих версий Minetest. Community wiki: =Wiki сообщества: A community-based documentation website for Minetest. Anyone with an account can edit it! It also features a documentation of Minetest Game.=Веб-сайт документации сообщества. Любой, у кого есть учетная запись, может её редактировать! Там много документации по Minetest Game. @@ -333,7 +333,7 @@ Online multiplayer:=Сетевая многопользовательская и • Protection: Mechanism to own areas of the world, which only allows the owners to modify blocks inside=• Защита/приват: механизм присваивания себе некоторых областей мира, позволяющий владельцам запретить изменять блоки внутри этих областей всем, кроме себя, либо ограниченного списка друзей Technical terms:=Технические условия: • Minetest: This game engine=• Minetest: движок этой игры -• MineClone 2: What you play right now=• MineClone 2: то, во что вы играете прямо сейчас +• VoxeLibre: What you play right now=• VoxeLibre: то, во что вы играете прямо сейчас • Minetest Game: A game for Minetest by the Minetest developers=• Minetest Game: игра для Minetest от разработчиков Minetest • Game: A complete playing experience to be used in Minetest; such as a game or sandbox or similar=• Игра: весь игровой процесс, принятый в Minetest; например, обычная игра, или песочница, или подобное • Mod: A single subsystem which adds or modifies functionality; is the basic building block of games and can be used to further enhance or modify them=• Мод: отдельная подсистема, которая добавляет или изменяет функциональность; является основным способом конструирования игр и может быть использована для их дальнейшего улучшения или изменения @@ -448,7 +448,7 @@ You can view your current position in the debug screen (open with [F5]).=Вы м # Расширения MCL2 Creative Mode=Творческий режим -Enabling Creative Mode in MineClone 2 applies the following changes:=При включении творческого режима в MineClone 2 применяются следующие изменения: +Enabling Creative Mode in VoxeLibre applies the following changes:=При включении творческого режима в VoxeLibre применяются следующие изменения: • You keep the things you've placed=• У вас сохраняются вещи, которые вы размещаете в мире • Creative inventory is available to obtain most items easily=• Вам доступен творческий инвентарь для легкого получения большинства предметов • Hand breaks all default blocks instantly=• Рука мгновенно разбивает все стандартные блоки diff --git a/mods/HELP/mcl_doc_basics/mcl_extension.lua b/mods/HELP/mcl_doc_basics/mcl_extension.lua index a0f31a2c8..42d93e661 100644 --- a/mods/HELP/mcl_doc_basics/mcl_extension.lua +++ b/mods/HELP/mcl_doc_basics/mcl_extension.lua @@ -3,7 +3,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) doc.add_entry("advanced", "creative", { name = S("Creative Mode"), data = { text = -S("Enabling Creative Mode in MineClone 2 applies the following changes:").."\n\n".. +S("Enabling Creative Mode in VoxeLibre applies the following changes:").."\n\n".. S("• You keep the things you've placed").."\n".. S("• Creative inventory is available to obtain most items easily").."\n".. diff --git a/mods/HELP/mcl_item_id/API.md b/mods/HELP/mcl_item_id/API.md index a2f244e0c..1a499fd38 100644 --- a/mods/HELP/mcl_item_id/API.md +++ b/mods/HELP/mcl_item_id/API.md @@ -1,6 +1,6 @@ # mcl_item_id Show the item ID of an item in the description. -With this API, you can register a different name space than "mineclone" for your mod. +With this API, you can register a different name space than "voxelibre" for your mod. ## mcl_item_id.set_mod_namespace(modname, namespace) Set a name space for all items in a mod. @@ -21,4 +21,4 @@ The name of the mod is "mod" which registered an item called "mod:itemname". * mcl_item_id.set_mod_namespace(minetest.get_current_modname()) will show "mod:itemname" in the description of "mod:itemname" * mcl_item_id.get_mod_namespace(minetest.get_current_modname()) will return "mod" -(If no namespace is set by a mod, mcl_item_id.get_mod_namespace(minetest.get_current_modname()) will return "mineclone") +(If no namespace is set by a mod, mcl_item_id.get_mod_namespace(minetest.get_current_modname()) will return "voxelibre") diff --git a/mods/HELP/mcl_item_id/init.lua b/mods/HELP/mcl_item_id/init.lua index 0e029932b..6172e4f67 100644 --- a/mods/HELP/mcl_item_id/init.lua +++ b/mods/HELP/mcl_item_id/init.lua @@ -2,7 +2,7 @@ mcl_item_id = { mod_namespaces = {}, } -local game = "mineclone" +local game = "voxelibre" function mcl_item_id.set_mod_namespace(modname, namespace) local namespace = namespace or modname @@ -21,7 +21,7 @@ end local same_id = { enchanting = { "table" }, experience = { "bottle" }, - heads = { "skeleton", "zombie", "creeper", "wither_skeleton" }, + heads = { "skeleton", "zombie", "stalker", "wither_skeleton" }, mobitems = { "rabbit", "chicken" }, walls = { "andesite", "brick", "cobble", "diorite", "endbricks", @@ -42,11 +42,13 @@ tt.register_snippet(function(itemstring) local id_string = itemstring:sub(item_split) local id_modname = itemstring:sub(1, item_split - 1) local new_id = game .. id_string + local alt_id = "mineclone" .. id_string local mod_namespace = mcl_item_id.get_mod_namespace(id_modname) for mod, ids in pairs(same_id) do for _, id in pairs(ids) do if itemstring == "mcl_" .. mod .. ":" .. id then new_id = game .. ":" .. id .. "_" .. mod:gsub("s", "") + alt_id = "mineclone:" .. id .. "_" .. mod:gsub("s", "") end end end @@ -55,8 +57,9 @@ tt.register_snippet(function(itemstring) end if mod_namespace ~= id_modname then minetest.register_alias_force(new_id, itemstring) + minetest.register_alias_force(alt_id, itemstring) end if minetest.settings:get_bool("mcl_item_id_debug", false) then return new_id, "#555555" end -end) \ No newline at end of file +end) diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.de.tr b/mods/HELP/mcl_tt/locale/mcl_tt.de.tr index 54c376c3b..5cc402167 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.de.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.de.tr @@ -14,7 +14,7 @@ Grows on grass blocks, podzol, dirt or coarse dirt=Wächst auf Grasblöcken, Pod Flammable=Entzündlich Zombie view range: -50%=Zombiesichtweite: -50% Skeleton view range: -50%=Skelettsichtweite: -50% -Creeper view range: -50%=Creepersichtweite: -50% +Stalker view range: -50%=Stalkersichtweite: -50% Damage: @1=Schaden: @1 Damage (@1): @2=Schaden (@1): @2 Healing: @1=Heilung: @1 @@ -41,7 +41,6 @@ Fast=Schnell Slow=Langsam Very slow=Sehr langsam Painfully slow=Furchtbar langsam -Mining durability: @1=Grabehaltbarkeit: @1 Block breaking strength: @1=Blockbruchstärke: @1 @1 uses=@1 Verwendungen Unlimited uses=Unbegrenzte Verwendungen diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.es.tr b/mods/HELP/mcl_tt/locale/mcl_tt.es.tr index bc962eef8..b845c4102 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.es.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.es.tr @@ -14,7 +14,7 @@ Grows on grass blocks, podzol, dirt or coarse dirt=Crece sobre bloques de pasto, Flammable=Inflamable Zombie view range: -50%=Rango de visión zombie: -50% Skeleton view range: -50%=Rango de visión de esqueleto: -50% -Creeper view range: -50%=Rango de visión de creeper: -50% +Stalker view range: -50%=Rango de visión de stalker: -50% Damage: @1=Daño: @1 Damage (@1): @2=Daño (@1): @2 Healing: @1=Curación: @1 @@ -41,7 +41,6 @@ Fast=Rápido Slow=Lento Very slow=Muy lento Painfully slow=Dolorosamente lento -Mining durability: @1=Durabilidad de minería: @1 Block breaking strength: @1=Fuerza para romper bloques: @1 @1 uses=@1 usos Unlimited uses=Usos ilimitados diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr b/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr index 77e9a35b0..1202581e9 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr @@ -14,7 +14,7 @@ Grows on grass blocks, podzol, dirt or coarse dirt=Pousse sur les blocs de gazon Flammable=Inflammable Zombie view range: -50%=Distance de vue de Zombie : -50% Skeleton view range: -50%=Distance de vue de Squelette : -50% -Creeper view range: -50%=Distance de vue de Creeper : -50% +Stalker view range: -50%=Distance de vue de Stalker : -50% Damage: @1=Dégâts : @1 Damage (@1): @2=Dégâts (@1) : @2 Healing: @1=Guérison : @1 @@ -41,7 +41,6 @@ Fast=Rapide Slow=Lent Very slow=Très lent Painfully slow=Péniblement lent -Mining durability: @1=Durabilité de minage : @1 Block breaking strength: @1=Résistance à la rupture : @1 @1 uses=@1 utilisations Unlimited uses=Utilisations illimitées diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.ja.tr b/mods/HELP/mcl_tt/locale/mcl_tt.ja.tr index 5e5cd5e7a..5bb044f3f 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.ja.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.ja.tr @@ -41,7 +41,6 @@ Fast=速い Slow=遅い Very slow=とても遅い Painfully slow=苦痛レベルで遅い -Mining durability: @1=採掘耐久度:@1 Block breaking strength: @1=ブロック破壊力:@1 @1 uses=@1 使用 Unlimited uses=無限に使用可能 diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.pl.tr b/mods/HELP/mcl_tt/locale/mcl_tt.pl.tr index aecc15d1e..912c98ac7 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.pl.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.pl.tr @@ -14,7 +14,7 @@ Grows on grass blocks, podzol, dirt or coarse dirt=Rośnie na blokach trawy, bie Flammable=Łatwopalne Zombie view range: -50%=Zasięg widzenia zombie: -50% Skeleton view range: -50%=Zasięg widzenia szkieleta: -50% -Creeper view range: -50%=Zasięg widzenia creepera: -50% +Stalker view range: -50%=Zasięg widzenia stalkera: -50% Damage: @1=Obrażenia: @1 Damage (@1): @2=Obrażenia (@1): @2 Healing: @1=Leczenie: @1 @@ -41,8 +41,8 @@ Fast=Szybkie Slow=Wolne Very slow=Bardzo wolne Painfully slow=Boleśnie wolne -Mining durability: @1=Wytrzymałość kopania: @1 +Durability: @1=Wytrzymałość: @1 Block breaking strength: @1=Siła niszczenia bloku: @1 @1 uses=@1 użyć Unlimited uses=Nielimitowane użycia - +...stacks=...kumuluje się diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.pt_BR.tr b/mods/HELP/mcl_tt/locale/mcl_tt.pt_BR.tr index 9d00a06d4..c97eb4176 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.pt_BR.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.pt_BR.tr @@ -14,7 +14,7 @@ Grows on grass blocks, podzol, dirt or coarse dirt=Cresce em blocos de grama, po Flammable=Inflamável Zombie view range: -50%=Alcançe de visão do zumbi: -50% Skeleton view range: -50%=Alcançe de visão do esqueleto: -50% -Creeper view range: -50%=Alcançe de visão do creeper: -50% +Stalker view range: -50%=Alcançe de visão do stalker: -50% Damage: @1= Dano: @1 Damage (@1): @2=Dano (@1): @2 Healing: @1=Cura: @1 @@ -41,7 +41,6 @@ Fast=Rápido Slow=Lento Very slow=Muito lento Painfully slow=Dolorosamente lento -Mining durability: @1=Durabilidade de mineração: @1 Block breaking strength: @1=Força de quebra do bloco: @1 @1 uses=@1 usos Unlimited uses=Usos ilimitados diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr b/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr index def0a6d1d..9e0487b5a 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr @@ -14,7 +14,7 @@ Grows on grass blocks, podzol, dirt or coarse dirt=Растёт на дёрне, Flammable=Воспламенимо Zombie view range: -50%=Дальность зрения зомби: -50% Skeleton view range: -50%=Дальность зрения скелета: -50% -Creeper view range: -50%=Дальность зрения крипера: -50% +Stalker view range: -50%=Дальность зрения сталкера: -50% Damage: @1=Урон: @1 Damage (@1): @2=Урон (@1): @2 Durability: @1=Прочность: @1 @@ -42,7 +42,6 @@ Fast=Высокая Slow=Низкая Very slow=Очень низкая Painfully slow=Крайне низкая -Mining durability: @1=Прочность при добыче: @1 Block breaking strength: @1=Сила добычи: @1 @1 uses=@1 Unlimited uses=не ограничено diff --git a/mods/HELP/mcl_tt/locale/template.txt b/mods/HELP/mcl_tt/locale/template.txt index 6fb735b13..15076ec24 100644 --- a/mods/HELP/mcl_tt/locale/template.txt +++ b/mods/HELP/mcl_tt/locale/template.txt @@ -14,7 +14,7 @@ Grows on grass blocks, podzol, dirt or coarse dirt= Flammable= Zombie view range: -50%= Skeleton view range: -50%= -Creeper view range: -50%= +Stalker view range: -50%= Damage: @1= Damage (@1): @2= Healing: @1= @@ -41,8 +41,8 @@ Fast= Slow= Very slow= Painfully slow= -Mining durability: @1= Block breaking strength: @1= @1 uses= Unlimited uses= Durability: @1= +...stacks= diff --git a/mods/HELP/mcl_tt/mod.conf b/mods/HELP/mcl_tt/mod.conf index e442e1320..b9ca12379 100644 --- a/mods/HELP/mcl_tt/mod.conf +++ b/mods/HELP/mcl_tt/mod.conf @@ -1,4 +1,4 @@ name = mcl_tt author = Wuzzy description = Add MCL2 tooltips -depends = tt, mcl_enchanting, mcl_colors +depends = tt, mcl_enchanting, mcl_colors, mcl_util diff --git a/mods/HELP/mcl_tt/snippets_base.lua b/mods/HELP/mcl_tt/snippets_base.lua index 4e200d539..f20f3dfe2 100644 --- a/mods/HELP/mcl_tt/snippets_base.lua +++ b/mods/HELP/mcl_tt/snippets_base.lua @@ -35,7 +35,7 @@ local function newline(str) end -- Digging capabilities of tool -tt.register_snippet(function(itemstring, toolcaps) +tt.register_snippet(function(itemstring, toolcaps, itemstack) local def = minetest.registered_items[itemstring] if not toolcaps then return @@ -85,7 +85,12 @@ tt.register_snippet(function(itemstring, toolcaps) if def._doc_items_durability == nil and base_uses > 0 then local real_uses = base_uses * math.pow(3, maxlevel) if real_uses < 65535 then - miningusesstr = S("@1 uses", real_uses) + if itemstack then + local remaining_uses = math.round(real_uses - (itemstack:get_wear() * base_uses) / 65535) + miningusesstr = remaining_uses .. "/" .. real_uses + else + miningusesstr = S("@1 uses", real_uses) + end else miningusesstr = S("Unlimited uses") end @@ -95,7 +100,7 @@ tt.register_snippet(function(itemstring, toolcaps) capstr = capstr .. S("Mining speed: @1", speedstr) .. "\n" end if miningusesstr ~= "" then - capstr = capstr .. S("Mining durability: @1", miningusesstr) .. "\n" + capstr = capstr .. S("Durability: @1", miningusesstr) .. "\n" end -- Only show one group at max diff --git a/mods/HELP/mcl_tt/snippets_mcl.lua b/mods/HELP/mcl_tt/snippets_mcl.lua index 825776f5f..639422295 100644 --- a/mods/HELP/mcl_tt/snippets_mcl.lua +++ b/mods/HELP/mcl_tt/snippets_mcl.lua @@ -25,6 +25,7 @@ tt.register_snippet(function(itemstring) end return s end) + tt.register_snippet(function(itemstring, _, itemstack) --local def = minetest.registered_items[itemstring] local s = "" @@ -34,13 +35,18 @@ tt.register_snippet(function(itemstring, _, itemstack) s = s .. S("Armor points: @1", pts) s = s .. "\n" end + local remaining_uses = use if itemstack then local unbreaking = mcl_enchanting.get_enchantment(itemstack, "unbreaking") if unbreaking > 0 then use = math.floor(use / (0.6 + 0.4 / (unbreaking + 1))) end + remaining_uses = math.round(use - (itemstack:get_wear() * use) / 65535) end if use > 0 then + if use ~= remaining_uses then + use = remaining_uses .. "/" .. use -- implicit conversion from number to string + end s = s .. S("Armor durability: @1", use) end if s == "" then @@ -102,13 +108,71 @@ tt.register_snippet(function(itemstring) return S("Zombie view range: -50%") elseif itemstring == "mcl_heads:skeleton" then return S("Skeleton view range: -50%") - elseif itemstring == "mcl_heads:creeper" then - return S("Creeper view range: -50%") + elseif itemstring == "mcl_heads:stalker" then + return S("Stalker view range: -50%") end end) tt.register_snippet(function(itemstring, _, itemstack) if itemstring:sub(1, 23) == "mcl_fishing:fishing_rod" or itemstring:sub(1, 12) == "mcl_bows:bow" then - return S("Durability: @1", S("@1 uses", mcl_util.calculate_durability(itemstack or ItemStack(itemstring)))) + local stack = itemstack or ItemStack(itemstring) + local use = mcl_util.calculate_durability(stack) + local remaining_use = math.round(use - (stack:get_wear() * use) / 65535) + return S("Durability: @1", S("@1 uses", remaining_use .."/".. use)) end end) + + +-- Potions info +tt.register_snippet(function(itemstring, _, itemstack) + if not itemstack then return end + local def = itemstack:get_definition() + if def.groups._mcl_potion ~= 1 then return end + + local s = "" + local meta = itemstack:get_meta() + local potency = meta:get_int("mcl_potions:potion_potent") + local plus = meta:get_int("mcl_potions:potion_plus") + local sl_factor = 1 + if def.groups.splash_potion == 1 then + sl_factor = mcl_potions.SPLASH_FACTOR + elseif def.groups.ling_potion == 1 then + sl_factor = mcl_potions.LINGERING_FACTOR + end + if def._dynamic_tt then s = s.. def._dynamic_tt((potency+1)*sl_factor).. "\n" end + local effects = def._effect_list + if effects then + local effect + local dur + local timestamp + local ef_level + local roman_lvl + local factor + local ef_tt + for name, details in pairs(effects) do + effect = mcl_potions.registered_effects[name] + if details.dur_variable then + dur = details.dur * math.pow(mcl_potions.PLUS_FACTOR, plus) * sl_factor + if potency > 0 and details.uses_level then + dur = dur / math.pow(mcl_potions.POTENT_FACTOR, potency) + end + else + dur = details.dur + end + timestamp = math.floor(dur/60)..string.format(":%02d",math.floor(dur % 60)) + if details.uses_level then + ef_level = details.level + details.level_scaling * (potency) + else + ef_level = details.level + end + if ef_level > 1 then roman_lvl = " ".. mcl_util.to_roman(ef_level) + else roman_lvl = "" end + s = s.. effect.description.. roman_lvl.. " (".. timestamp.. ")\n" + if effect.uses_factor then factor = effect.level_to_factor(ef_level) end + if effect.get_tt then ef_tt = minetest.colorize("grey", effect.get_tt(factor)) else ef_tt = "" end + if ef_tt ~= "" then s = s.. ef_tt.. "\n" end + if details.effect_stacks then s = s.. minetest.colorize("grey", S("...stacks")).. "\n" end + end + end + return s:trim() +end) diff --git a/mods/HELP/tt/init.lua b/mods/HELP/tt/init.lua index b3f2b8d55..8cc893d47 100644 --- a/mods/HELP/tt/init.lua +++ b/mods/HELP/tt/init.lua @@ -74,6 +74,22 @@ function tt.reload_itemstack_description(itemstack) local orig_desc = def._tt_original_description or def.description if meta:get_string("name") ~= "" then orig_desc = minetest.colorize(tt.NAME_COLOR, meta:get_string("name")) + elseif def.groups._mcl_potion == 1 then + local potency = meta:get_int("mcl_potions:potion_potent") + local plus = meta:get_int("mcl_potions:potion_plus") + if potency > 0 then + local sym_potency = mcl_util.to_roman(potency+1) + orig_desc = orig_desc.. " ".. sym_potency + end + if plus > 0 then + local sym_plus = " " + local i = plus + while i>0 do + i = i - 1 + sym_plus = sym_plus.. "+" + end + orig_desc = orig_desc.. sym_plus + end end local desc = apply_snippets(orig_desc, itemstring, toolcaps or def.tool_capabilities, itemstack) if desc == def.description and meta:get_string("description") == "" then return end diff --git a/mods/HELP/tt/mod.conf b/mods/HELP/tt/mod.conf index 2a260772d..7c4902418 100644 --- a/mods/HELP/tt/mod.conf +++ b/mods/HELP/tt/mod.conf @@ -1,4 +1,4 @@ name = tt author = Wuzzy description = Support for custom tooltip extensions for items -depends = mcl_colors +depends = mcl_colors, mcl_util diff --git a/mods/HUD/hudbars/init.lua b/mods/HUD/hudbars/init.lua index 505ff403b..7f86a959d 100644 --- a/mods/HUD/hudbars/init.lua +++ b/mods/HUD/hudbars/init.lua @@ -521,7 +521,9 @@ end local function update_health(player) local hp_max = player:get_properties().hp_max - hb.change_hudbar(player, "health", player:get_hp(), hp_max) + local hp = player:get_hp() + if hp > hp_max then hp = hp_max end + hb.change_hudbar(player, "health", hp, hp_max) end -- update built-in HUD bars diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua old mode 100755 new mode 100644 diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index db3ac8436..3ab08ab0f 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -58,7 +58,7 @@ function mcl_credits.show(player) } add_hud_element({ hud_elem_type = "image", - text = "mineclone2_logo.png", + text = "voxelibre_logo.png", scale = {x = 1, y = 1}, }, huds, 300, 0) add_hud_element({ @@ -89,7 +89,7 @@ function mcl_credits.show(player) end huds.icon = add_hud_element({ hud_elem_type = "image", - text = "mineclone2_icon.png", + text = "voxelibre_icon.png", scale = {x = 1, y = 1}, }, huds, y) mcl_credits.players[name] = huds diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.de.tr b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr index fa26f5bc4..73fac3aed 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.de.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft=Ein treuer Open-Source-Klon von Minecraft Contributors=Mitwirkende Creator of MineClone=Schöpfer von MineClone -Creator of MineClone2=Schöpfer von MineClone2 +Creator of VoxeLibre=Schöpfer von VoxeLibre Developers=Entwickler Jump to speed up (additionally sprint)=Springen, um zu beschleunigen (zusätzlich sprinten) Maintainers=Betreuer diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.es.tr b/mods/HUD/mcl_credits/locale/mcl_credits.es.tr index a8886286e..8dcbe2611 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.es.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.es.tr @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft= Contributors= Creator of MineClone= -Creator of MineClone2= +Creator of VoxeLibre= Developers= Jump to speed up (additionally sprint)= Maintainers= @@ -11,4 +11,4 @@ MineClone5= Original Mod Authors= Sneak to skip= Textures= -Translations= \ No newline at end of file +Translations= diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr b/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr index 4007ad4bc..293dcffe8 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft=Un clone open source de Minecraft Contributors=Contributeurs Creator of MineClone=Créateur de MineClone -Creator of MineClone2=Créateur de MineClone2 +Creator of VoxeLibre=Créateur de VoxeLibre Developers=Développeurs Past Developers=Anciens Développeurs Jump to speed up (additionally sprint)=Saut pour accélérer (peut être combiné avec sprint) diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.ja.tr b/mods/HUD/mcl_credits/locale/mcl_credits.ja.tr index e7bbbbfc2..76bc74a2a 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.ja.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.ja.tr @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft=オープンソースによるマインクラフトの忠実なクローン Contributors=投稿者 Creator of MineClone=MineClone の創始者 -Creator of MineClone2=MineClone2 の創始者 +Creator of VoxeLibre=VoxeLibre の創始者 Developers=開発者 Jump to speed up (additionally sprint)=ジャンプでスピードアップ(追加で疾走) Maintainers=メンテナンス diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr b/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr index a8886286e..8dcbe2611 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft= Contributors= Creator of MineClone= -Creator of MineClone2= +Creator of VoxeLibre= Developers= Jump to speed up (additionally sprint)= Maintainers= @@ -11,4 +11,4 @@ MineClone5= Original Mod Authors= Sneak to skip= Textures= -Translations= \ No newline at end of file +Translations= diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.pt_BR.tr b/mods/HUD/mcl_credits/locale/mcl_credits.pt_BR.tr index e693b0357..1956aa4e3 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.pt_BR.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.pt_BR.tr @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft=Um clone fiel Open Source do Minecraft Contributors=Colaboradores Creator of MineClone=Criador do MineClone -Creator of MineClone2=Criador do MineClone2 +Creator of VoxeLibre=Criador do VoxeLibre Developers=Desenvolvedores Past Developers=Desenvolvedores Passados Jump to speed up (additionally sprint)=Pule para acelerar (arrancada adicional) diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr b/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr index 2271a108d..f9b5f3d38 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft=Верный открытый клон Minecraft Contributors=Контрибьюторы Creator of MineClone=Создатель MineClone -Creator of MineClone2=Создатель MineClone2 +Creator of VoxeLibre=Создатель VoxeLibre Developers=Разработчики Past Developers=Бывшие разработчики Jump to speed up (additionally sprint)=[Прыжок] или [Спринт] для промотки вперед @@ -16,4 +16,4 @@ Textures=Текстуры Translations=Перевод Music=Музыка Funders=Спонсоры -Special thanks=Особая благодарность \ No newline at end of file +Special thanks=Особая благодарность diff --git a/mods/HUD/mcl_credits/locale/template.txt b/mods/HUD/mcl_credits/locale/template.txt index 51bb49873..3a6287437 100644 --- a/mods/HUD/mcl_credits/locale/template.txt +++ b/mods/HUD/mcl_credits/locale/template.txt @@ -3,7 +3,7 @@ A faithful Open Source clone of Minecraft= Contributors= Creator of MineClone= -Creator of MineClone2= +Creator of VoxeLibre= Developers= Past Developers= Jump to speed up (additionally sprint)= diff --git a/mods/HUD/mcl_credits/people.lua b/mods/HUD/mcl_credits/people.lua index d562f2e53..cbf6e569e 100644 --- a/mods/HUD/mcl_credits/people.lua +++ b/mods/HUD/mcl_credits/people.lua @@ -5,7 +5,7 @@ return { {S("Creator of MineClone"), 0x0A9400, { "davedevils", }}, - {S("Creator of MineClone2"), 0xFBF837, { + {S("Creator of VoxeLibre"), 0xFBF837, { "Wuzzy", }}, {S("Maintainers"), 0xFF51D5, { @@ -26,6 +26,8 @@ return { "SmokeyDope", "Faerraven / Michieal", "Codiac", + "rudzik8", + "teknomunk", }}, {S("Past Developers"), 0xF84355, { "jordan4ibanez", @@ -39,7 +41,6 @@ return { }}, {S("Contributors"), 0x52FF00, { "RandomLegoBrick", - "rudzik8", "Code-Sploit", "aligator", "Rootyjr", @@ -131,12 +132,22 @@ return { "Bakawun", "JoseDouglas26", "Zasco", + "PrWalterB", + "michaljmalinowski", + "nixnoxus", + "Potiron", + "Tuxilio", + "Impulse", + "Doods", + "SOS-Games", + "Bram", + "qoheniac", }}, {S("Music"), 0xA60014, { "Jordach for the jukebox music compilation from Big Freaking Dig", "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)", + "Jester for helping to finely tune VoxeLibre (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 VoxeLibre 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)", }}, {S("Original Mod Authors"), 0x343434, { diff --git a/mods/HUD/mcl_experience/README.md b/mods/HUD/mcl_experience/README.md index f59eab20f..8e37f9b6b 100644 --- a/mods/HUD/mcl_experience/README.md +++ b/mods/HUD/mcl_experience/README.md @@ -1,6 +1,6 @@ -- eXPerience mod -- This mod has adopted from oil_boi's Crafter-minetest -- ( https://www.patreon.com/oil_boi ) by kay27@bk.ru --- for MineClone 2 under GNU General Public License v3.0. +-- for VoxeLibre under GNU General Public License v3.0. -- Copyright (c) Oil_boi, Wuzzy, kay27, -- experience_orb texture by github.com/Gerold55 diff --git a/mods/HUD/mcl_experience/bottle.lua b/mods/HUD/mcl_experience/bottle.lua index 62a3fb9ca..50f96656f 100644 --- a/mods/HUD/mcl_experience/bottle.lua +++ b/mods/HUD/mcl_experience/bottle.lua @@ -14,7 +14,7 @@ minetest.register_entity("mcl_experience:bottle",{ local n = node.name if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and minetest.get_item_group(n, "liquid") == 0 then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) - mcl_experience.throw_xp(pos, math.random(3, 11)) + mcl_experience.throw_xp(pos, math.random(3, 11) + (self._luck or 0)) minetest.add_particlespawner({ amount = 50, time = 0.1, @@ -40,13 +40,18 @@ minetest.register_entity("mcl_experience:bottle",{ end, }) -local function throw_xp_bottle(pos, dir, velocity) +local function throw_xp_bottle(pos, dir, velocity, user) minetest.sound_play("mcl_throwing_throw", {pos = pos, gain = 0.4, max_hear_distance = 16}, true) local obj = minetest.add_entity(pos, "mcl_experience:bottle") obj:set_velocity(vector.multiply(dir, velocity)) local acceleration = vector.multiply(dir, -3) acceleration.y = -9.81 obj:set_acceleration(acceleration) + if user then + local ent = obj:get_luaentity() + local luck = mcl_luck.get_luck(user:get_player_name()) + ent._luck = luck + end end minetest.register_craftitem("mcl_experience:bottle", { @@ -55,7 +60,7 @@ minetest.register_craftitem("mcl_experience:bottle", { wield_image = "mcl_experience_bottle.png", stack_max = 64, on_use = function(itemstack, placer, pointed_thing) - throw_xp_bottle(vector.add(placer:get_pos(), vector.new(0, 1.5, 0)), placer:get_look_dir(), 10) + throw_xp_bottle(vector.add(placer:get_pos(), vector.new(0, 1.5, 0)), placer:get_look_dir(), 10, placer) if not minetest.is_creative_enabled(placer:get_player_name()) then itemstack:take_item() end diff --git a/mods/HUD/mcl_experience/mod.conf b/mods/HUD/mcl_experience/mod.conf index a8e992c06..1e0c09c31 100644 --- a/mods/HUD/mcl_experience/mod.conf +++ b/mods/HUD/mcl_experience/mod.conf @@ -1,4 +1,4 @@ name = mcl_experience author = oilboi description = eXPerience mod -depends = mcl_gamemode +depends = mcl_gamemode, mcl_luck diff --git a/mods/HUD/mcl_formspec/API.md b/mods/HUD/mcl_formspec/API.md index 64795f8c3..61b328ec5 100644 --- a/mods/HUD/mcl_formspec/API.md +++ b/mods/HUD/mcl_formspec/API.md @@ -1,4 +1,4 @@ -# MineClone2 Formspec API +# VoxeLibre Formspec API ## `mcl_formspec.label_color` diff --git a/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md b/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md index a5f3d4745..0721d3cce 100644 --- a/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md +++ b/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md @@ -1,10 +1,10 @@ -# MineClone2 Formspec Guide +# VoxeLibre Formspec Guide -**_This guide will teach you the rules for creating formspecs for the MineClone2 game._** +**_This guide will teach you the rules for creating formspecs for the VoxeLibre 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. +First of all, VoxeLibre 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` diff --git a/mods/HUD/mcl_hbarmor/README.md b/mods/HUD/mcl_hbarmor/README.md index 0eccd6916..0b87002b5 100644 --- a/mods/HUD/mcl_hbarmor/README.md +++ b/mods/HUD/mcl_hbarmor/README.md @@ -1,4 +1,4 @@ -# MineClone 2 HUD bar for `mcl_armor` [`mcl_hbarmor`] +# VoxeLibre HUD bar for `mcl_armor` [`mcl_hbarmor`] ## Description This mod adds a simple HUD bar which displays the player's armor points. @@ -14,7 +14,7 @@ License: MIT License (see below) ### Textures -See MineClone 2 license. +See VoxeLibre license. ### MIT License Everything else is under the MIT License: diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 1288bc1d5..fde4aeafc 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -47,7 +47,13 @@ end -- Populate all the item tables. We only do this once. -- Note this code must be executed after loading all the other mods in order to work. minetest.register_on_mods_loaded(function() - for name, def in pairs(minetest.registered_items) do + -- Workaround because pairs() doesn't always working as expected + local items_registered = mcl_vars.items_registered + mcl_vars.items_registered = nil -- cleanup after ourselves + for i = 1,#items_registered do + local name = items_registered[i] + local def = minetest.registered_items[name] + 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 @@ -105,7 +111,13 @@ minetest.register_on_mods_loaded(function() nonmisc = true end if def.groups.brewitem then - table.insert(inventory_lists["brew"], name) + local str = name + if def.groups._mcl_potion == 1 then + local stack = ItemStack(name) + tt.reload_itemstack_description(stack) + str = stack:to_string() + end + table.insert(inventory_lists["brew"], str) nonmisc = true end if def.groups.craftitem then @@ -117,9 +129,26 @@ minetest.register_on_mods_loaded(function() table.insert(inventory_lists["misc"], name) end + if def.groups._mcl_potion == 1 then + if def.has_potent then + local stack = ItemStack(name) + local potency = def._default_potent_level - 1 + stack:get_meta():set_int("mcl_potions:potion_potent", potency) + tt.reload_itemstack_description(stack) + table.insert(inventory_lists["brew"], stack:to_string()) + end + if def.has_plus then + local stack = ItemStack(name) + local extend = def._default_extend_level + stack:get_meta():set_int("mcl_potions:potion_plus", extend) + tt.reload_itemstack_description(stack) + table.insert(inventory_lists["brew"], stack:to_string()) + end + end + table.insert(inventory_lists["all"], name) end - end + end -- for i = 1,#items_registered do for ench, def in pairs(mcl_enchanting.enchantments) do local str = "mcl_enchanting:book_enchanted " .. ench .. " " .. def.max_level diff --git a/mods/HUD/mcl_inventory/mod.conf b/mods/HUD/mcl_inventory/mod.conf index 66f175c3b..fc10fe32a 100644 --- a/mods/HUD/mcl_inventory/mod.conf +++ b/mods/HUD/mcl_inventory/mod.conf @@ -2,4 +2,4 @@ name = mcl_inventory author = BlockMen description = Adds the player inventory and creative inventory. depends = mcl_init, mcl_formspec, mcl_enchanting, mcl_gamemode -optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player +optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player, tt diff --git a/mods/HUD/mcl_ver_info/init.lua b/mods/HUD/mcl_ver_info/init.lua index 632847275..82eb46cfe 100644 --- a/mods/HUD/mcl_ver_info/init.lua +++ b/mods/HUD/mcl_ver_info/init.lua @@ -25,7 +25,7 @@ end -- register normal user access to debug levels 1 and 0. minetest.register_chatcommand("ver", { - description = S("Display Mineclone 2 game version."), + description = S("Display VoxeLibre game version."), func = function(name, params) --[[ get_game_info's table data: { @@ -46,7 +46,7 @@ minetest.register_chatcommand("ver", { local version = conf:get("version") if game_info.title == nil or game_info.title == "" then - game_info.title = "Mineclone 2" + game_info.title = "VoxeLibre" end -- Notes: "game.conf doesn't support id currently, this is planned in the future" - rubenwardy from the github issue. -- TODO: Remove workaround after minetest.get_game_info().id is implemented. diff --git a/mods/HUD/mcl_ver_info/locale/mcl_ver_info.fr.tr b/mods/HUD/mcl_ver_info/locale/mcl_ver_info.fr.tr index 0a5d2bfd0..d55fdeb04 100644 --- a/mods/HUD/mcl_ver_info/locale/mcl_ver_info.fr.tr +++ b/mods/HUD/mcl_ver_info/locale/mcl_ver_info.fr.tr @@ -1,3 +1,3 @@ # textdomain: mcl_ver_info Sorry, but your version of Minetest doesn't support the latest API. Please upgrade your minetest.=Désolé, mais votre version de Minetest ne supporte la dernière API. Veuillez mettre à jour minetest. -Display Mineclone 2 game version.=Affiche la version de Mineclone 2. +Display VoxeLibre game version.=Affiche la version de VoxeLibre. diff --git a/mods/HUD/mcl_ver_info/locale/mcl_ver_info.pt_BR.tr b/mods/HUD/mcl_ver_info/locale/mcl_ver_info.pt_BR.tr index ef465f8a0..bb3e372ca 100644 --- a/mods/HUD/mcl_ver_info/locale/mcl_ver_info.pt_BR.tr +++ b/mods/HUD/mcl_ver_info/locale/mcl_ver_info.pt_BR.tr @@ -1,3 +1,3 @@ # textdomain: mcl_ver_info Sorry, but your version of Minetest doesn't support the latest API. Please upgrade your minetest.=Desculpe, mas sua versão do Minetest não suporta a última API. Por favor atualize seu minetest. -Display Mineclone 2 game version.=Mostrar a versão do jogo Mineclone 2. +Display VoxeLibre game version.=Mostrar a versão do jogo VoxeLibre. diff --git a/mods/HUD/mcl_ver_info/locale/mcl_ver_info.ru.tr b/mods/HUD/mcl_ver_info/locale/mcl_ver_info.ru.tr index bd09a68c5..5ade98601 100644 --- a/mods/HUD/mcl_ver_info/locale/mcl_ver_info.ru.tr +++ b/mods/HUD/mcl_ver_info/locale/mcl_ver_info.ru.tr @@ -1,3 +1,3 @@ # textdomain: mcl_ver_info Sorry, but your version of Minetest doesn't support the latest API. Please upgrade your minetest.=Ваша версия Minetest не поддерживает последнюю версию API. Пожалуйста, обновите ваш Minetest. -Display Mineclone 2 game version.=Показать версию Mineclone 2. \ No newline at end of file +Display VoxeLibre game version.=Показать версию VoxeLibre. diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua index ae419a512..9e5224b15 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua @@ -227,6 +227,7 @@ local dispenserdef = { entity.gotten = true minetest.sound_play("mcl_tools_shears_cut", { pos = pos }, true) stack:add_wear(65535 / stackdef._mcl_diggroups.shearsy.uses) + tt.reload_itemstack_description(stack) -- update tooltip inv:set_stack("main", stack_id, stack) break end diff --git a/mods/ITEMS/REDSTONE/mesecons_button/README.md b/mods/ITEMS/REDSTONE/mesecons_button/README.md index 31a1fa9de..80802ec64 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/README.md +++ b/mods/ITEMS/REDSTONE/mesecons_button/README.md @@ -1,5 +1,5 @@ Mesecons button mod. -This mod adds the buttons for MineClone 2. +This mod adds the buttons for VoxeLibre. MEDIA FILE CREDITS: diff --git a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua index 9fd381b76..1d2e7820d 100644 --- a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua @@ -661,7 +661,7 @@ mesecon.register_mvps_unsticky("mcl_flowers:tulip_red") mesecon.register_mvps_unsticky("mcl_flowers:tulip_white") mesecon.register_mvps_unsticky("mcl_flowers:waterlily") -- Heads -mesecon.register_mvps_unsticky("mcl_heads:creeper") +mesecon.register_mvps_unsticky("mcl_heads:stalker") mesecon.register_mvps_unsticky("mcl_heads:skeleton") mesecon.register_mvps_unsticky("mcl_heads:steve") mesecon.register_mvps_unsticky("mcl_heads:wither_skeleton") diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/README.txt b/mods/ITEMS/REDSTONE/mesecons_walllever/README.txt index 8744b5646..822cc973e 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/README.txt +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/README.txt @@ -8,4 +8,4 @@ Lever meshes created by Gerold55. Jeija and Wuzzy. ## Textures -(See main README file of MineClone 2). +See main README file of VoxeLibre. diff --git a/mods/ITEMS/mcl_armor/API.md b/mods/ITEMS/mcl_armor/API.md index 06292aab4..507deab39 100644 --- a/mods/ITEMS/mcl_armor/API.md +++ b/mods/ITEMS/mcl_armor/API.md @@ -226,7 +226,7 @@ mcl_armor.update(obj) Armors can be enchanted in most cases. -The enchanting part of MineClone2 is separated from the armor part, but closely linked. +The enchanting part of VoxeLibre is separated from the armor part, but closely linked. Existing armor enchantments in Minecraft improve most of the time how the armor protect the entity from damage. diff --git a/mods/ITEMS/mcl_armor/README.txt b/mods/ITEMS/mcl_armor/README.txt index 5e68b5746..82ff7af39 100644 --- a/mods/ITEMS/mcl_armor/README.txt +++ b/mods/ITEMS/mcl_armor/README.txt @@ -27,4 +27,4 @@ Licensed (CC BY-SA 3.0) by Mito551 All other sounds licensed CC0 by OpenGameArt.org user artisticdude. Source: -Other media files: See MineClone 2 license. +Other media files: See VoxeLibre license. diff --git a/mods/ITEMS/mcl_armor/locale/mcl_armor.de.tr b/mods/ITEMS/mcl_armor/locale/mcl_armor.de.tr index 7db10c8aa..cd2e9a479 100644 --- a/mods/ITEMS/mcl_armor/locale/mcl_armor.de.tr +++ b/mods/ITEMS/mcl_armor/locale/mcl_armor.de.tr @@ -23,4 +23,4 @@ Diamond Boots=Diamantstiefel Chain Boots=Kettenstiefel -Smithing Template '@1'=Schiedevorlage '@1' \ No newline at end of file +Smithing Template '@1'=Schmiedevorlage '@1' \ No newline at end of file diff --git a/mods/ITEMS/mcl_bamboo/README.md b/mods/ITEMS/mcl_bamboo/README.md index 469914294..d5b1e7b97 100644 --- a/mods/ITEMS/mcl_bamboo/README.md +++ b/mods/ITEMS/mcl_bamboo/README.md @@ -1,9 +1,9 @@ mcl_bamboo ========= -This mod adds working, familiar bamboo nodes to your Mineclone 2 world. +This mod adds working, familiar bamboo nodes to your VoxeLibre world. -Code: Michieal. Original (basic, used as inspiration) bamboo code by: Small Joker. Updates to the code: Mineclone Dev Team, Michieal. +Code: Michieal. Original (basic, used as inspiration) bamboo code by: Small Joker. Updates to the code: VoxeLibre Dev Team, Michieal. License for code: GPLv3. License for images / textures: CC-BY-SA except where noted. @@ -23,4 +23,4 @@ Nicu - You Rock! Small Joker's bamboo forum topic: Forum topic: https://forum.minetest.net/viewtopic.php?id=8289 -Scaffold inspiration: Cora, because she said that it couldn't be done. \ No newline at end of file +Scaffold inspiration: Cora, because she said that it couldn't be done. diff --git a/mods/ITEMS/mcl_banners/README.txt b/mods/ITEMS/mcl_banners/README.txt index 4de3ce439..d944c437d 100644 --- a/mods/ITEMS/mcl_banners/README.txt +++ b/mods/ITEMS/mcl_banners/README.txt @@ -1,6 +1,6 @@ License of code: WTFPL -License of textures: See README.md in top directory of MineClone 2. +License of textures: See README.md in top directory of VoxeLibre. License of models: GPLv3 (https://www.gnu.org/licenses/gpl-3.0.html) Models author: 22i. diff --git a/mods/ITEMS/mcl_banners/locale/mcl_banners.ru.tr b/mods/ITEMS/mcl_banners/locale/mcl_banners.ru.tr index 410c96687..4f2659e50 100644 --- a/mods/ITEMS/mcl_banners/locale/mcl_banners.ru.tr +++ b/mods/ITEMS/mcl_banners/locale/mcl_banners.ru.tr @@ -76,4 +76,4 @@ You can copy the pattern of a banner by placing two banners of the same color in And one additional layer=И один дополнительный слой And @1 additional layers=И @1 дополнительных слоёв Paintable decoration=Раскрашиваемая декорация -Preview Banner=Предпросмотр баннера \ No newline at end of file +Preview Banner=Предпросмотр баннера diff --git a/mods/ITEMS/mcl_banners/patterncraft.lua b/mods/ITEMS/mcl_banners/patterncraft.lua index 767235b1e..3beb9550d 100644 --- a/mods/ITEMS/mcl_banners/patterncraft.lua +++ b/mods/ITEMS/mcl_banners/patterncraft.lua @@ -36,7 +36,7 @@ local patterns = { ["creeper"] = { name = N("@1 Creeper Charge"), type = "shapeless", - { e, "mcl_heads:creeper", d }, + { e, "mcl_heads:stalker", d }, }, ["cross"] = { name = N("@1 Saltire"), diff --git a/mods/ITEMS/mcl_beacons/init.lua b/mods/ITEMS/mcl_beacons/init.lua index 9941e9e50..953d036d3 100644 --- a/mods/ITEMS/mcl_beacons/init.lua +++ b/mods/ITEMS/mcl_beacons/init.lua @@ -4,8 +4,12 @@ there are strings in meta, which are being used to see which effect will be give Valid strings: swiftness leaping - strenght + strength regeneration + haste + resistance + slow_falling + absorption ]]-- mcl_beacons = { @@ -122,10 +126,17 @@ local formspec_string= "image[1,4.5;1,1;custom_beacom_symbol_2.png]".. "image[1,6;1,1;custom_beacom_symbol_1.png]".. - "image_button[5.2,1.5;1,1;mcl_potions_effect_swift.png;swiftness;]".. + "image_button[5.2,1.5;1,1;mcl_potions_effect_swiftness.png;swiftness;]".. + "image_button[8.5,1.5;1,1;mcl_potions_effect_haste.png;haste;]".. + "image_button[5.2,3;1,1;mcl_potions_effect_leaping.png;leaping;]".. - "image_button[5.2,4.5;1,1;mcl_potions_effect_strong.png;strenght;]".. - "image_button[5.2,6;1,1;mcl_potions_effect_regenerating.png;regeneration;]".. + "image_button[8.5,3;1,1;mcl_potions_effect_resistance.png;resistance;]".. + + "image_button[5.2,4.5;1,1;mcl_potions_effect_strength.png;strength;]".. + "image_button[8.5,4.5;1,1;mcl_potions_effect_absorption.png;absorption;]".. + + "image_button[5.2,6;1,1;mcl_potions_effect_regeneration.png;regeneration;]".. + "image_button[8.5,6;1,1;mcl_potions_effect_slow_falling.png;slow_falling;]".. "item_image[1,7;1,1;mcl_core:diamond]".. "item_image[2.2,7;1,1;mcl_core:emerald]".. @@ -197,15 +208,7 @@ end local function effect_player(effect,pos,power_level, effect_level,player) local distance = vector.distance(player:get_pos(), pos) if distance > (power_level+1)*10 then return end - if effect == "swiftness" then - mcl_potions.swiftness_func(player,effect_level,16) - elseif effect == "leaping" then - mcl_potions.leaping_func(player, effect_level, 16) - elseif effect == "strenght" then - mcl_potions.strength_func(player, effect_level, 16) - elseif effect == "regeneration" then - mcl_potions.regeneration_func(player, effect_level, 16) - end + mcl_potions.give_effect_by_level(effect, player, effect_level, 16) end local function apply_effects_to_all_players(pos) @@ -254,7 +257,8 @@ minetest.register_node("mcl_beacons:beacon", { remove_beacon_beam(pos) end, on_receive_fields = function(pos, formname, fields, sender) - if fields.swiftness or fields.regeneration or fields.leaping or fields.strenght then + if fields.swiftness or fields.regeneration or fields.leaping or fields.strenght + or fields.haste or fields.resistance or fields.absorption or fields.slow_falling then local sender_name = sender:get_player_name() local power_level = beacon_blockcheck(pos) if minetest.is_protected(pos, sender_name) then @@ -293,6 +297,14 @@ minetest.register_node("mcl_beacons:beacon", { end minetest.get_meta(pos):set_string("effect","swiftness") successful = true + elseif fields.haste then + if power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + else + minetest.get_meta(pos):set_int("effect_level",1) + end + minetest.get_meta(pos):set_string("effect","haste") + successful = true elseif fields.leaping and power_level >= 2 then if power_level == 4 then minetest.get_meta(pos):set_int("effect_level",2) @@ -301,18 +313,38 @@ minetest.register_node("mcl_beacons:beacon", { end minetest.get_meta(pos):set_string("effect","leaping") successful = true + elseif fields.resistance and power_level >= 2 then + if power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + else + minetest.get_meta(pos):set_int("effect_level",1) + end + minetest.get_meta(pos):set_string("effect","resistance") + successful = true elseif fields.strenght and power_level >= 3 then if power_level == 4 then minetest.get_meta(pos):set_int("effect_level",2) else minetest.get_meta(pos):set_int("effect_level",1) end - minetest.get_meta(pos):set_string("effect","strenght") + minetest.get_meta(pos):set_string("effect","strength") + successful = true + elseif fields.absorption and power_level >= 3 then + if power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + else + minetest.get_meta(pos):set_int("effect_level",1) + end + minetest.get_meta(pos):set_string("effect","absorption") successful = true elseif fields.regeneration and power_level == 4 then minetest.get_meta(pos):set_int("effect_level",2) minetest.get_meta(pos):set_string("effect","regeneration") successful = true + elseif fields.slow_falling and power_level == 4 then + minetest.get_meta(pos):set_int("effect_level",2) + minetest.get_meta(pos):set_string("effect","slow_falling") + successful = true end if successful then if power_level == 4 then diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 69f69f17e..b1c3f0830 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -225,11 +225,9 @@ local function update_formspecs(finished, players) local button_abort = "button_exit[4,3;4,0.75;leave;"..F(S("Abort sleep")).."]" local bg_presleep = "bgcolor[#00000080;true]" local bg_sleep = "bgcolor[#000000FF;true]" - local chatbox = "field[0.2,4.5;9,1;chatmessage;"..F(S("Chat:"))..";]" - local chatsubmit = "button[9.2,3.75;1,2;chatsubmit;"..F(S("send!")).."]" - local defaultmessagebutton = "button[10.2,3.75;1,2;defaultmessage;zzZzzZ]" - - form_n = form_n .. chatbox .. chatsubmit --because these should be in the formspec in ANY case, they might as well be added here already + local chatbox = "field[0.3,4.5;10,1;chatmessage;"..F(S("Chat:"))..";]" + local chatsubmit = "button[10,3.73;2,2;chatsubmit;"..F(S("Send")).."]" + local defaultmessagebutton = "button[10.98,2.93;1,2;defaultmessage;zzZ]" if finished then for name,_ in pairs(mcl_beds.player) do @@ -237,6 +235,7 @@ local function update_formspecs(finished, players) end return elseif not is_sp then + form_n = form_n .. chatbox .. chatsubmit --because these should be in the formspec in ANY case, they might as well be added here already local text = S("Players in bed: @1/@2", player_in_bed, ges) if not night_skip then text = text .. "\n" .. S("Note: Night skip is disabled.") diff --git a/mods/ITEMS/mcl_bells/README.md b/mods/ITEMS/mcl_bells/README.md index 53cba890c..a865aa449 100644 --- a/mods/ITEMS/mcl_bells/README.md +++ b/mods/ITEMS/mcl_bells/README.md @@ -1,6 +1,6 @@ mcl_bells --------- -Village bells for MineClone2, originally imported from mcl5, heavily modified by cora. +Village bells for VoxeLibre, originally imported from mcl5, heavily modified by cora. License of media files ---------------------- diff --git a/mods/ITEMS/mcl_blast_furnace/README.md b/mods/ITEMS/mcl_blast_furnace/README.md index e96c21942..f61230fb8 100644 --- a/mods/ITEMS/mcl_blast_furnace/README.md +++ b/mods/ITEMS/mcl_blast_furnace/README.md @@ -1,5 +1,5 @@ -Blast Furnaces for MineClone 2. -Heavily based on Minetest Game (default/furnace.lua) and the MineClone 2 Furnaces. +Blast Furnaces for VoxeLibre. +Heavily based on Minetest Game (default/furnace.lua) and the VoxeLibre Furnaces. License of source code ---------------------- @@ -10,4 +10,4 @@ MCl 2 Furances modified by PrairieWind. License of media ---------------- -See the main MineClone 2 README.md file. +See the main VoxeLibre README.md file. diff --git a/mods/ITEMS/mcl_bows/README.txt b/mods/ITEMS/mcl_bows/README.txt index fe879c95c..8d25ad905 100644 --- a/mods/ITEMS/mcl_bows/README.txt +++ b/mods/ITEMS/mcl_bows/README.txt @@ -1,11 +1,11 @@ -This mod adds bows and arrows for MineClone 2. +This mod adds bows and arrows for VoxeLibre. License: * Source code: LGPL 3.0 * Incorporates code from the [bow] mod by Arcelmi. https://github.com/Arcelmi/minetest-bows -* Textures: See MineClone 2 license notes. +* Textures: See VoxeLibre license notes. * Sounds: * mcl_bows_bow_shoot.ogg: CC0 by Freesound.org user JoeDinesSound https://freesound.org/people/JoeDinesSound/sounds/534942/ diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index 37e41fa6d..652819aa6 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -249,7 +249,7 @@ function ARROW_ENTITY.on_step(self, dtime) end -- Punch target object but avoid hurting enderman. - if not lua or lua.name ~= "mobs_mc:enderman" then + if not lua or lua.name ~= "mobs_mc:rover" then if not self._in_player then damage_particles(vector.add(pos, vector.multiply(self.object:get_velocity(), 0.1)), self._is_critical) end diff --git a/mods/ITEMS/mcl_bows/bow.lua b/mods/ITEMS/mcl_bows/bow.lua index 37c38a085..9f381f501 100644 --- a/mods/ITEMS/mcl_bows/bow.lua +++ b/mods/ITEMS/mcl_bows/bow.lua @@ -270,10 +270,10 @@ controls.register_on_release(function(player, key, time) local is_critical = false if charge >= BOW_CHARGE_TIME_FULL then speed = BOW_MAX_SPEED - local r = math.random(1,5) - if r == 1 then - -- 20% chance for critical hit - damage = 10 + local r = math.random(1,5) + mcl_luck.get_luck(player:get_player_name()) + if r > 4 then + -- 20% chance for critical hit (by default) + damage = 10 + math.floor((r-5)/5) -- mega crit (over crit) with high luck is_critical = true else damage = 9 @@ -300,6 +300,7 @@ controls.register_on_release(function(player, key, time) durability = durability * (unbreaking + 1) end wielditem:add_wear(65535/durability) + tt.reload_itemstack_description(wielditem) -- update tooltip end player:set_wielded_item(wielditem) reset_bow_state(player, true) diff --git a/mods/ITEMS/mcl_bows/crossbow.lua b/mods/ITEMS/mcl_bows/crossbow.lua index b6a1a3ad6..c1cb7f8be 100644 --- a/mods/ITEMS/mcl_bows/crossbow.lua +++ b/mods/ITEMS/mcl_bows/crossbow.lua @@ -322,10 +322,10 @@ controls.register_on_press(function(player, key, time) -- Fully charged local is_critical = false speed = BOW_MAX_SPEED - local r = math.random(1,5) - if r == 1 then - -- 20% chance for critical hit - damage = 10 + local r = math.random(1,5) + mcl_luck.get_luck(player:get_player_name()) + if r > 4 then + -- 20% chance for critical hit (by default) + damage = 10 + math.floor((r-5)/5) -- mega crit (over crit) with high luck is_critical = true else damage = 9 @@ -350,6 +350,7 @@ controls.register_on_press(function(player, key, time) durability = durability / 3 end wielditem:add_wear(65535/durability) + tt.reload_itemstack_description(wielditem) -- update tooltip end player:set_wielded_item(wielditem) reset_bow_state(player, true) diff --git a/mods/ITEMS/mcl_bows/mod.conf b/mods/ITEMS/mcl_bows/mod.conf index 0fdd666a3..61fb52ddb 100644 --- a/mods/ITEMS/mcl_bows/mod.conf +++ b/mods/ITEMS/mcl_bows/mod.conf @@ -1,6 +1,6 @@ name = mcl_bows author = Arcelmi description = This mod adds bows and arrows for MineClone 2. -depends = controls, mcl_particles, mcl_enchanting, mcl_init, mcl_util, mcl_shields, mcl_fovapi +depends = controls, mcl_particles, mcl_enchanting, mcl_init, mcl_util, mcl_shields, mcl_fovapi, mcl_luck optional_depends = awards, mcl_achievements, mcl_core, mcl_mobitems, playerphysics, doc, doc_identifier, mesecons_button diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index 26998bb7c..8cd690171 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -470,7 +470,7 @@ function ARROW_ENTITY.on_step(self, dtime) end -- Punch target object but avoid hurting enderman. - if not lua or lua.name ~= "mobs_mc:enderman" then + if not lua or lua.name ~= "mobs_mc:rover" then if self._in_player == false then damage_particles(self.object:get_pos(), self._is_critical) end diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 306129320..cdac3429e 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -82,7 +82,7 @@ local function brewable(inv) for i=1,stand_size do - bottle = inv:get_stack("stand", i):get_name() + bottle = inv:get_stack("stand", i) alchemy = mcl_potions.get_alchemy(ingredient, bottle) if alchemy then diff --git a/mods/ITEMS/mcl_buckets/README.md b/mods/ITEMS/mcl_buckets/README.md index b783cc133..be186fc31 100644 --- a/mods/ITEMS/mcl_buckets/README.md +++ b/mods/ITEMS/mcl_buckets/README.md @@ -1,5 +1,5 @@ -# MineClone2 Bucket (`mcl_bucket`) -Originally taken from Minetest Game, adapted for MineClone2. +# VoxeLibre Bucket (`mcl_bucket`) +Originally taken from Minetest Game, adapted for VoxeLibre. This mod add buckets to the game, including an API to register your own (see `API.md`). diff --git a/mods/ITEMS/mcl_campfires/API.md b/mods/ITEMS/mcl_campfires/API.md index 727a26daf..db97366f8 100644 --- a/mods/ITEMS/mcl_campfires/API.md +++ b/mods/ITEMS/mcl_campfires/API.md @@ -1,4 +1,4 @@ -# MineClone 2 Campfire API +# VoxeLibre Campfire API ## `mcl_campfires.register_campfire` Used to register campfires. diff --git a/mods/ITEMS/mcl_campfires/README.md b/mods/ITEMS/mcl_campfires/README.md index 5390e982f..3ccd8becf 100644 --- a/mods/ITEMS/mcl_campfires/README.md +++ b/mods/ITEMS/mcl_campfires/README.md @@ -4,7 +4,7 @@ Adds the campfire and its soul variant. License of code --------------- -See the main MineClone 2 README.md file. +See the main VoxeLibre README.md file. Authors: Gerold55 - Code Start + Models? PrairieWind - Improved and Cleaned Up Code, and added the soul campfire and crafting recipes. @@ -16,7 +16,7 @@ Michieal - Fixed misc. errors. License of media ---------------- -See the main MineClone 2 README.md file for license on most of the textures. +See the main VoxeLibre README.md file for license on most of the textures. For the following textures: mcl_campfires_campfire_inv.png diff --git a/mods/ITEMS/mcl_campfires/api.lua b/mods/ITEMS/mcl_campfires/api.lua index 4c1ddc758..98318f3f1 100644 --- a/mods/ITEMS/mcl_campfires/api.lua +++ b/mods/ITEMS/mcl_campfires/api.lua @@ -323,6 +323,7 @@ function mcl_campfires.register_campfire(name, def) local wear = mcl_autogroup.get_wear(toolname, "shovely") if wear then itemstack:add_wear(wear) + tt.reload_itemstack_description(itemstack) -- update tooltip end end node.name = name @@ -379,7 +380,7 @@ minetest.register_globalstep(function(dtime) etime = 0 for _,pl in pairs(minetest.get_connected_players()) do local armor_feet = pl:get_inventory():get_stack("armor", 5) - if pl and pl:get_player_control().sneak or (minetest.global_exists("mcl_enchanting") and mcl_enchanting.has_enchantment(armor_feet, "frost_walker")) or (minetest.global_exists("mcl_potions") and mcl_potions.player_has_effect(pl, "fire_proof")) then + if pl and pl:get_player_control().sneak or (minetest.global_exists("mcl_enchanting") and mcl_enchanting.has_enchantment(armor_feet, "frost_walker")) or (minetest.global_exists("mcl_potions") and mcl_potions.has_effect(pl, "fire_resistance")) then return end burn_in_campfire(pl) diff --git a/mods/ITEMS/mcl_cartography_table/README.md b/mods/ITEMS/mcl_cartography_table/README.md index 4818b6784..0d66c8042 100644 --- a/mods/ITEMS/mcl_cartography_table/README.md +++ b/mods/ITEMS/mcl_cartography_table/README.md @@ -2,7 +2,7 @@ mcl_cartography_table ------------------- Cartography Tables, by PrairieWind -Adds Cartography Tables to MineClone 2/5. +Adds Cartography Tables to VoxeLibre. License of source code ---------------------- @@ -10,4 +10,4 @@ LGPLv2.1 License of media ---------------- -See the main MineClone 2 README.md file. \ No newline at end of file +See the main VoxeLibre README.md file. diff --git a/mods/ITEMS/mcl_cherry_blossom/growth.lua b/mods/ITEMS/mcl_cherry_blossom/growth.lua index 28cedea28..bca926539 100644 --- a/mods/ITEMS/mcl_cherry_blossom/growth.lua +++ b/mods/ITEMS/mcl_cherry_blossom/growth.lua @@ -31,11 +31,25 @@ 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", + texture = "mcl_cherry_blossom_particle_" .. math.random(1, 12) .. ".png", + animation = { + type = "vertical_frames", + aspect_w = 3, + aspect_h = 3, + length = 0.8, + }, collision_removal = false, collisiondetection = false, } +local wind_direction -- vector +local time_changed -- 0 - afternoon; 1 - evening; 2 - morning +local function change_wind_direction() + local east_west = math.random(-0.5,0.5) + local north_south = math.random(-0.5,0.5) + wind_direction = vector.new(east_west, 0, north_south) +end +change_wind_direction() minetest.register_abm({ label = "Cherry Blossom Particles", @@ -47,6 +61,20 @@ minetest.register_abm({ 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) + pt.texture = "mcl_cherry_blossom_particle_" .. math.random(1, 12) .. ".png" + local time = minetest.get_timeofday() + if time_changed ~= 0 and time > 0.6 and time < 0.605 then + time_changed = 0 + change_wind_direction() + elseif (time_changed ~= 1 and time > 0.8 and time < 0.805) then + time_changed = 1 + change_wind_direction() + elseif (time_changed ~= 2 and time > 0.3 and time < 0.305) then + time_changed = 2 + change_wind_direction() + end + pt.acceleration = pt.acceleration + wind_direction + minetest.add_particle(pt) end) end diff --git a/mods/ITEMS/mcl_colorblocks/locale/mcl_colorblocks.fr.tr b/mods/ITEMS/mcl_colorblocks/locale/mcl_colorblocks.fr.tr index a4bcf2c8f..d58e737da 100644 --- a/mods/ITEMS/mcl_colorblocks/locale/mcl_colorblocks.fr.tr +++ b/mods/ITEMS/mcl_colorblocks/locale/mcl_colorblocks.fr.tr @@ -1,94 +1,94 @@ # textdomain: mcl_colorblocks White Terracotta=Terre cuite blanche -White Glazed Terracotta=Terre cuite emaillée blanche -White Glazed Terracotta Pillar=Pilier de terre cuite emaillée blanche +White Glazed Terracotta=Terre cuite émaillée blanche +White Glazed Terracotta Pillar=Pilier de terre cuite émaillée blanche White Concrete Powder=Béton en poudre blanc White Concrete=Béton blanc Grey Terracotta=Terre cuite grise -Grey Glazed Terracotta=Terre cuite emaillée grise -Grey Glazed Terracotta Pillar=Pilier de terre cuite emaillée grise -Grey Concrete Powder=Béton en goudre gris +Grey Glazed Terracotta=Terre cuite émaillée grise +Grey Glazed Terracotta Pillar=Pilier de terre cuite émaillée grise +Grey Concrete Powder=Béton en poudre gris Grey Concrete=Béton gris Light Grey Terracotta=Terre cuite gris clair -Light Grey Glazed Terracotta=Terre cuite emaillée gris clair -Light Grey Glazed Terracotta Pillar=Pilier de terre cuite emaillée gris clair +Light Grey Glazed Terracotta=Terre cuite émaillée gris clair +Light Grey Glazed Terracotta Pillar=Pilier de terre cuite émaillée gris clair Light Grey Concrete Powder=Béton en poudre gris clair Light Grey Concrete=Béton gris clair -Black Terracotta=Terre cuite noir -Black Glazed Terracotta=Terre cuite emaillée noir -Black Glazed Terracotta Pillar=Pilier de terre cuite emaillée noir +Black Terracotta=Terre cuite noire +Black Glazed Terracotta=Terre cuite émaillée noire +Black Glazed Terracotta Pillar=Pilier de terre cuite émaillée noire Black Concrete Powder=Béton en poudre noir Black Concrete=Béton noir Red Terracotta=Terre cuite rouge -Red Glazed Terracotta=Terre cuite emaillée rouge -Red Glazed Terracotta Pillar=Pilier de terre cuite emaillée rouge +Red Glazed Terracotta=Terre cuite émaillée rouge +Red Glazed Terracotta Pillar=Pilier de terre cuite émaillée rouge Red Concrete Powder=Béton en poudre rouge Red Concrete=Béton rouge Yellow Terracotta=Terre cuite jaune -Yellow Glazed Terracotta=Terre cuite emaillée jaune -Yellow Glazed Terracotta Pillar=Pilier de terre cuite emaillée jaune +Yellow Glazed Terracotta=Terre cuite émaillée jaune +Yellow Glazed Terracotta Pillar=Pilier de terre cuite émaillée jaune Yellow Concrete Powder=Béton en poudre jaune Yellow Concrete=Béton jaune Green Terracotta=Terre cuite verte -Green Glazed Terracotta=Terre cuite emaillée verte -Green Glazed Terracotta Pillar=Pilier de terre cuite emaillée verte +Green Glazed Terracotta=Terre cuite émaillée verte +Green Glazed Terracotta Pillar=Pilier de terre cuite émaillée verte Green Concrete Powder=Béton en poudre vert Green Concrete=Béton vert Cyan Terracotta=Terre cuite cyan -Cyan Glazed Terracotta=Terre cuite emaillée cyan -Cyan Glazed Terracotta Pillar=Pilier de terre cuite emaillée cyan +Cyan Glazed Terracotta=Terre cuite émaillée cyan +Cyan Glazed Terracotta Pillar=Pilier de terre cuite émaillée cyan Cyan Concrete Powder=Béton en poudre cyan Cyan Concrete=Béton cyan Blue Terracotta=Terre cuite bleue -Blue Glazed Terracotta=Terre cuite emaillée bleue -Blue Glazed Terracotta Pillar=Pilier de terre cuite emaillée bleue +Blue Glazed Terracotta=Terre cuite émaillée bleue +Blue Glazed Terracotta Pillar=Pilier de terre cuite émaillée bleue Blue Concrete Powder=Béton en poudre bleu Blue Concrete=Béton bleu Magenta Terracotta=Terre cuite magenta -Magenta Glazed Terracotta=Terre cuite emaillée magenta -Magenta Glazed Terracotta Pillar=Pilier de terre cuite emaillée magenta +Magenta Glazed Terracotta=Terre cuite émaillée magenta +Magenta Glazed Terracotta Pillar=Pilier de terre cuite émaillée magenta Magenta Concrete Powder=Béton en poudre magenta Magenta Concrete=Béton magenta Orange Terracotta=Terre cuite orange -Orange Glazed Terracotta=Terre cuite emaillée orange -Orange Glazed Terracotta Pillar=Pilier de terre cuite emaillée orange +Orange Glazed Terracotta=Terre cuite émaillée orange +Orange Glazed Terracotta Pillar=Pilier de terre cuite émaillée orange Orange Concrete Powder=Béton en poudre orange Orange Concrete=Béton orange Purple Terracotta=Terre cuite violette -Purple Glazed Terracotta=Terre cuite emaillée violette -Purple Glazed Terracotta Pillar=Pilier de terre cuite emaillée violette +Purple Glazed Terracotta=Terre cuite émaillée violette +Purple Glazed Terracotta Pillar=Pilier de terre cuite émaillée violette Purple Concrete Powder=Béton en poudre violet Purple Concrete=Béton violet Brown Terracotta=Terre cuite marron -Brown Glazed Terracotta=Terre cuite emaillée marron -Brown Glazed Terracotta Pillar=Pilier de terre cuite emaillée marron +Brown Glazed Terracotta=Terre cuite émaillée marron +Brown Glazed Terracotta Pillar=Pilier de terre cuite émaillée marron Brown Concrete Powder=Béton en poudre marron Brown Concrete=Béton marron Pink Terracotta=Terre cuite rose -Pink Glazed Terracotta=Terre cuite emaillée rose -Pink Glazed Terracotta Pillar=Pilier de terre cuite emaillée rose +Pink Glazed Terracotta=Terre cuite émaillée rose +Pink Glazed Terracotta Pillar=Pilier de terre cuite émaillée rose Pink Concrete Powder=Béton en poudre rose Pink Concrete=Béton rose Lime Terracotta=Terre cuite verte clair -Lime Glazed Terracotta=Terre cuite emaillée verte clair -Lime Glazed Terracotta Pillar=Pilier de terre cuite emaillée verte clair +Lime Glazed Terracotta=Terre cuite émaillée verte clair +Lime Glazed Terracotta Pillar=Pilier de terre cuite émaillée verte clair Lime Concrete Powder=Béton en poudre vert clair Lime Concrete=Béton vert clair Light Blue Terracotta=Terre cuite bleu clair -Light Blue Glazed Terracotta=Terre cuite emaillée bleu clair -Light Blue Glazed Terracotta Pillar=Pilier de terre cuite emaillée bleu clair +Light Blue Glazed Terracotta=Terre cuite émaillée bleu clair +Light Blue Glazed Terracotta Pillar=Pilier de terre cuite émaillée bleu clair Light Blue Concrete Powder=Béton en poudre bleu clair Light Blue Concrete=Béton bleu clair -Terracotta is a basic building material. It comes in many different colors.=La terre cuite est un matériau de construction de base. Il est disponible dans de nombreuses couleurs différentes. -Glazed terracotta is a decorative block with a complex pattern. It can be rotated by placing it in different directions.=La terre cuite émaillée est un bloc décoratif au motif complexe. Il peut être tourné en le plaçant dans différentes directions. -Glazed terracotta pillar is a decorative block with a complex pattern. It can be used with Glazed terracotta to make uneven patterns.=Le pilier de terre cuite émaillée est un bloc décoratif au motif complexe. Il peut être utilisé avec la terre cuite émaillée pour réaliser des motifs impairs. -Concrete powder is used for creating concrete, but it can also be used as decoration itself. It comes in different colors. Concrete powder turns into concrete of the same color when it comes in contact with water.=La poudre de béton est utilisée pour créer du béton, mais elle peut également être utilisée comme décoration elle-même. Il est disponible en différentes couleurs. La poudre de béton se transforme en béton de la même couleur au contact de l'eau. -Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.=Le béton est un bloc décoratif qui se décline en de nombreuses couleurs différentes. Il est remarquable pour avoir une couleur très forte et propre. +Terracotta is a basic building material. It comes in many different colors.=La terre cuite est un matériau de construction de base. Elle est disponible dans de nombreuses couleurs différentes. +Glazed terracotta is a decorative block with a complex pattern. It can be rotated by placing it in different directions.=La terre cuite émaillée est un bloc décoratif au motif complexe. Elle peut être tournée en la plaçant dans différentes directions. +Glazed terracotta pillar is a decorative block with a complex pattern. It can be used with Glazed terracotta to make uneven patterns.=Le pilier de terre cuite émaillée est un bloc décoratif au motif complexe. Il peut être utilisé avec la terre cuite émaillée pour réaliser des motifs irréguliers. +Concrete powder is used for creating concrete, but it can also be used as decoration itself. It comes in different colors. Concrete powder turns into concrete of the same color when it comes in contact with water.=La poudre de béton est utilisée pour créer du béton, mais elle peut également être utilisée comme décoration elle-même. Elle est disponible en différentes couleurs. La poudre de béton se transforme en béton de la même couleur au contact de l'eau. +Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.=Le béton est un bloc décoratif qui se décline en de nombreuses couleurs différentes. Il est remarquable pour avoir une couleur très forte et nette. Terracotta=Terre cuite Terracotta is a basic building material which comes in many different colors. This particular block is uncolored.=La terre cuite est un matériau de construction de base qui se décline en de nombreuses couleurs différentes. Ce bloc particulier n'est pas coloré. Colored Terracotta=Terre cuite colorée -Glazed Terracotta=Terre cuite emaillée -Glazed Terracotta Pillar=Pilier de terre cuite emaillée +Glazed Terracotta=Terre cuite émaillée +Glazed Terracotta Pillar=Pilier de terre cuite émaillée Concrete Powder=Béton en poudre Concrete=Béton Turns into concrete on water contact=Se transforme en béton au contact de l'eau diff --git a/mods/ITEMS/mcl_compressed_blocks/mod.conf b/mods/ITEMS/mcl_compressed_blocks/mod.conf index 6e1128c1d..d3c5771c9 100644 --- a/mods/ITEMS/mcl_compressed_blocks/mod.conf +++ b/mods/ITEMS/mcl_compressed_blocks/mod.conf @@ -1,5 +1,3 @@ name = mcl_compressed_blocks depends = mcl_core -description = adds compressed blocks to mineclone2 - - +description = adds compressed blocks to voxelibre diff --git a/mods/ITEMS/mcl_copper/README.md b/mods/ITEMS/mcl_copper/README.md index af5794178..78d3f4971 100644 --- a/mods/ITEMS/mcl_copper/README.md +++ b/mods/ITEMS/mcl_copper/README.md @@ -1,4 +1,4 @@ -# MineClone2 Copper +# VoxeLibre Copper ### by NO11, JoseDouglas26 and teknomunk diff --git a/mods/ITEMS/mcl_core/README.txt b/mods/ITEMS/mcl_core/README.txt index 6c48d74fd..5a1d5d88f 100644 --- a/mods/ITEMS/mcl_core/README.txt +++ b/mods/ITEMS/mcl_core/README.txt @@ -1,4 +1,4 @@ -MineClone 2 core mod +VoxeLibre core mod ==================== Originally forked from Minetest Game's default mod in the distant past. diff --git a/mods/ITEMS/mcl_core/craftitems.lua b/mods/ITEMS/mcl_core/craftitems.lua index e89fe124a..f95d42ad2 100644 --- a/mods/ITEMS/mcl_core/craftitems.lua +++ b/mods/ITEMS/mcl_core/craftitems.lua @@ -167,17 +167,17 @@ local function eat_gapple(itemstack, placer, pointed_thing) return itemstack end - local regen_duration, absorbtion_factor = 5, 1 + local regen_duration, absorption = 5, 1 if itemstack:get_name() == "mcl_core:apple_gold_enchanted" then - regen_duration, absorbtion_factor = 20, 4 - mcl_potions.fire_resistance_func(placer, 1, 300) - mcl_potions.leaping_func(placer, 1, 300) + regen_duration, absorption = 20, 4 + mcl_potions.give_effect("fire_resistance", placer, 1, 300) + mcl_potions.give_effect_by_level("leaping", placer, 1, 300) if enable_fapples then - mcl_potions.swiftness_func(placer, absorbtion_factor, 120) + mcl_potions.give_effect_by_level("swiftness", placer, absorption, 120) end end - -- TODO: Absorbtion - mcl_potions.regeneration_func(placer, 2, regen_duration) + mcl_potions.give_effect_by_level("absorption", placer, absorption, 120) + mcl_potions.give_effect_by_level("regeneration", placer, 2, regen_duration) return gapple_hunger_restore(itemstack, placer, pointed_thing) end @@ -206,17 +206,17 @@ local function eat_gapple_delayed(itemstack, placer, pointed_thing) return itemstack end - local regen_duration, absorbtion_factor = 5, 1 + local regen_duration, absorption = 5, 1 if itemstack:get_name() == "mcl_core:apple_gold_enchanted" then - regen_duration, absorbtion_factor = 20, 4 - mcl_potions.fire_resistance_func(placer, 1, 300) - mcl_potions.leaping_func(placer, 1, 300) + regen_duration, absorption = 20, 4 + mcl_potions.give_effect("fire_resistance", placer, 1, 300) + mcl_potions.give_effect_by_level("leaping", placer, 1, 300) if enable_fapples then - mcl_potions.swiftness_func(placer, absorbtion_factor, 120) + mcl_potions.give_effect_by_level("swiftness", placer, absorption, 120) end end - -- TODO: Absorbtion - mcl_potions.regeneration_func(placer, 2, regen_duration) + mcl_potions.give_effect_by_level("absorption", placer, absorption, 120) + mcl_potions.give_effect_by_level("regeneration", placer, 2, regen_duration) --return gapple_hunger_restore(itemstack, placer, pointed_thing) end diff --git a/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr b/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr index e66d8b115..db90b43c6 100644 --- a/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr +++ b/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr @@ -132,8 +132,8 @@ Jungle leaves are grown from jungle trees.=Les feuilles d'acajou poussent sur le Ladder=Échelle Lapis Lazuli=Lapis-lazuli Lapis Lazuli are required for enchanting items on an enchanting table.=Les lapis-lazuli sont nécessaires pour enchanter des objets sur une table d'enchantement. -Lapis Lazuli Block=Bloc de lapis-Lazuli -Lapis Lazuli Ore=Minerai de lapis-Lazuli +Lapis Lazuli Block=Bloc de lapis-lazuli +Lapis Lazuli Ore=Minerai de lapis-lazuli Lapis lazuli ore is the ore of lapis lazuli. It can be rarely found in clusters near the bottom of the world.=Le minerai de lapis-lazuli produit du lapis-lazuli. Il peut être rarement trouvé dans des filons près du fond du monde. Lava Source=Source de Lave Lava is hot and rather dangerous. Don't touch it, it will hurt you a lot and it is hard to get out.=La lave est chaude et plutôt dangereuse. Ne le touchez pas, cela vous fera beaucoup de mal et il est difficile d'en sortir. @@ -208,8 +208,8 @@ Stripped Acacia Log=Bûche d'acacia écorcée Stripped Acacia Wood=Bois d'acacia écorcé Stripped Birch Log=Bûche de bouleau écorcée Stripped Birch Wood=Bois de bouleau écorcé -Stripped Dark Oak Log=Bûche de Chêne Noir -Stripped Dark Oak Wood=Bois de Chêne Noir +Stripped Dark Oak Log=Bûche de chêne noir +Stripped Dark Oak Wood=Bois de chêne noir Stripped Jungle Log=Bûche d'acajou écorcée Stripped Jungle Wood=Bois d'acajou écorcé Stripped Oak Log=Bûche de chêne écorcée diff --git a/mods/ITEMS/mcl_crimson/README.md b/mods/ITEMS/mcl_crimson/README.md index 45c475c11..196148795 100644 --- a/mods/ITEMS/mcl_crimson/README.md +++ b/mods/ITEMS/mcl_crimson/README.md @@ -1,4 +1,4 @@ -# Mineclone Crimson originally by debiankaios. Modified by MCL2 dev team +# VoxeLibre Crimson originally by debiankaios. Modified by VoxeLibre dev team Textures are from PixelPerfection other than: @@ -7,4 +7,4 @@ Exhale (License - CC-BY-SA 4.0 https://creativecommons.org/licenses/by-sa/4.0/): mcl_crimson_warped_hyphae_wood.png mcl_crimson_warped_hyphae_wood_2nd.png mcl_crimson_crimson_hyphae_wood.png -mcl_crimson_crimson_fungus.png \ No newline at end of file +mcl_crimson_crimson_fungus.png diff --git a/mods/ITEMS/mcl_deepslate/README.md b/mods/ITEMS/mcl_deepslate/README.md index 398e70361..e0147da0c 100644 --- a/mods/ITEMS/mcl_deepslate/README.md +++ b/mods/ITEMS/mcl_deepslate/README.md @@ -1,12 +1,10 @@ -# Mineclone2 New Ores and Deepslate +# VoxeLibre New Ores and Deepslate by NO11 -This mod adds Deepslate to the Minetest game Mineclone2, which Minecraft adds in version 1.17. +This mod adds Deepslate to the Minetest game VoxeLibre, which Minecraft adds in version 1.17. Find new ores or build something from the 30 new blocks! Deepslate is generated directly above the lava layer in overworld. -Important: You need my "Mineclone2 Raw Ores" mod for this mod to work! -All other dependencies are automatically in the mineclone2 game. -Optionally use "Mineclone2 Copper" to get the deepslate copper ore as well. +All dependencies are automatically in the VoxeLibre game. You can find all craft recipes for deepslate blocks here: https://minecraft.fandom.com/wiki/Deepslate_(disambiguation) diff --git a/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr b/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr index 18fcc415b..2c0ffaa55 100644 --- a/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr +++ b/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr @@ -18,8 +18,8 @@ Deepslate coal ore is a variant of coal ore that can generate in deepslate and t Deepslate Coal Ore=Minerai de charbon de l'ardoise des abîmes Deepslate copper ore is a variant of copper ore that can generate in deepslate and tuff blobs.=Le minerai de cuivre de l'ardoise des abîmes est une variante de minerai de cuivre qui apparaît dans l'ardoise des abîmes et les filons de tuf. Deepslate Copper Ore=Minerai de cuivre de l'ardoise des abîmes -Deepslate diamond ore is a variant of diamond ore that can generate in deepslate and tuff blobs.=Le minerai de diamand de l'ardoise des abîmes est une variante de minerai de diamand qui apparaît dans l'ardoise des abîmes et les filons de tuf. -Deepslate Diamond Ore=Minerai de diamand de l'ardoise des abîmes +Deepslate diamond ore is a variant of diamond ore that can generate in deepslate and tuff blobs.=Le minerai de diamant de l'ardoise des abîmes est une variante de minerai de diamant qui apparaît dans l'ardoise des abîmes et les filons de tuf. +Deepslate Diamond Ore=Minerai de diamant de l'ardoise des abîmes Deepslate emerald ore is a variant of emerald ore that can generate in deepslate and tuff blobs.=Le minerai d'émeraude de l'ardoise des abîmes est une variante de minerai d'émeraude qui apparaît dans l'ardoise des abîmes et les filons de tuf. Deepslate Emerald Ore=Minerai d'émeraude de l'ardoise des abîmes Deepslate gold ore is a variant of gold ore that can generate in deepslate and tuff blobs.=Le minerai d'or de l'ardoise des abîmes est une variante de minerai d'or qui apparaît dans l'ardoise des abîmes et les filons de tuf. diff --git a/mods/ITEMS/mcl_doors/README.txt b/mods/ITEMS/mcl_doors/README.txt index c0cfc0525..94558822e 100644 --- a/mods/ITEMS/mcl_doors/README.txt +++ b/mods/ITEMS/mcl_doors/README.txt @@ -23,7 +23,7 @@ Steel door sounds open & close (CC-BY-3.0) by HazMatt License/authors of texture files -------------------------------------- -Same as media license for MineClone 2 (see root directory). +Same as media license for VoxeLibre (see root directory). With modifications by GitHub user kingoscargames: - `doors_item_steel.png` diff --git a/mods/ITEMS/mcl_enchanting/enchantments.lua b/mods/ITEMS/mcl_enchanting/enchantments.lua index 591dfb679..379a18e07 100644 --- a/mods/ITEMS/mcl_enchanting/enchantments.lua +++ b/mods/ITEMS/mcl_enchanting/enchantments.lua @@ -485,6 +485,7 @@ mcl_experience.register_on_add_xp(function(player, xp) end stack:set_wear(math.floor(new_wear)) + tt.reload_itemstack_description(stack) -- update tooltip inv:set_stack(list, index, stack) end diff --git a/mods/ITEMS/mcl_enchanting/engine.lua b/mods/ITEMS/mcl_enchanting/engine.lua index 67ef72056..dd01d5950 100644 --- a/mods/ITEMS/mcl_enchanting/engine.lua +++ b/mods/ITEMS/mcl_enchanting/engine.lua @@ -56,7 +56,7 @@ end function mcl_enchanting.get_enchantment_description(enchantment, level) local enchantment_def = mcl_enchanting.enchantments[enchantment] return enchantment_def.name .. - (enchantment_def.max_level == 1 and "" or " " .. mcl_enchanting.roman_numerals.toRoman(level)) + (enchantment_def.max_level == 1 and "" or " " .. mcl_util.to_roman(level)) end function mcl_enchanting.get_colorized_enchantment_description(enchantment, level) diff --git a/mods/ITEMS/mcl_enchanting/init.lua b/mods/ITEMS/mcl_enchanting/init.lua index 9f9fbd271..02ed1ee85 100644 --- a/mods/ITEMS/mcl_enchanting/init.lua +++ b/mods/ITEMS/mcl_enchanting/init.lua @@ -11,7 +11,6 @@ mcl_enchanting = { book_animation_steps = {0, 640, 680, 700, 740}, book_animation_loop = {["open"] = true, ["close"] = true}, book_animation_speed = 40, - roman_numerals = dofile(modpath .. "/roman_numerals.lua"), -- https://exercism.io/tracks/lua/exercises/roman-numerals/solutions/73c2fb7521e347209312d115f872fa49 enchantments = {}, overlay = "^[colorize:purple:50", --overlay = "^[invert:rgb^[multiply:#4df44d:50^[invert:rgb", diff --git a/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr b/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr index 80912a711..23cf257da 100644 --- a/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr +++ b/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr @@ -36,7 +36,7 @@ Increases mob loot.=Augmente le butin des mobs. Increases rate of good loot (enchanting books, etc.)=Augmente le taux de bon butin (livres enchanteurs, etc.) Increases sweeping attack damage.=Augmente les dégâts de l'épée Increases underwater movement speed.=Augmente la vitesse de déplacement sous l'eau. -Increases walking speed on soul sand.=Augmente la vitesse de marche sur le sable de l'âme. +Increases walking speed on soul sand.=Augmente la vitesse de marche sur le sable des âmes. Infinity=Infinité Item destroyed on death.=Objet détruit à la mort. Knockback=Recul diff --git a/mods/ITEMS/mcl_enchanting/mod.conf b/mods/ITEMS/mcl_enchanting/mod.conf index 610492857..d163fcd55 100644 --- a/mods/ITEMS/mcl_enchanting/mod.conf +++ b/mods/ITEMS/mcl_enchanting/mod.conf @@ -1,5 +1,5 @@ name = mcl_enchanting description = Enchanting for MineClone2 -depends = tt, walkover, mcl_sounds, mcl_colors, mcl_experience +depends = tt, walkover, mcl_sounds, mcl_colors, mcl_experience, mcl_util optional_depends = screwdriver author = Fleckenstein diff --git a/mods/ITEMS/mcl_enchanting/roman_numerals.lua b/mods/ITEMS/mcl_enchanting/roman_numerals.lua deleted file mode 100644 index f40c65406..000000000 --- a/mods/ITEMS/mcl_enchanting/roman_numerals.lua +++ /dev/null @@ -1,34 +0,0 @@ --------------------------------------------------------------------- ---! @file ---! @brief Convert from normal numbers to Roman Numerals ---------------------------------------------------------------------- -local conversionTable = { - { number = 1000, symbol = "M" }, - { number = 900, symbol = "CM" }, - { number = 500, symbol = "D" }, - { number = 400, symbol = "CD" }, - { number = 100, symbol = "C" }, - { number = 90, symbol = "XC" }, - { number = 50, symbol = "L" }, - { number = 40, symbol = "XL" }, - { number = 10, symbol = "X" }, - { number = 9, symbol = "IX" }, - { number = 5, symbol = "V" }, - { number = 4, symbol = "IV" }, - { number = 1, symbol = "I" } -} - -return{ - toRoman = function(number) - local romanNumeral = "" - - for _,table in pairs (conversionTable) do - while(number >= table.number) do - romanNumeral = romanNumeral .. table.symbol - number = number - table.number - end - end - - return romanNumeral - end -} diff --git a/mods/ITEMS/mcl_end/eye_of_ender.lua b/mods/ITEMS/mcl_end/eye_of_ender.lua index b5adc7cb6..065d7657e 100644 --- a/mods/ITEMS/mcl_end/eye_of_ender.lua +++ b/mods/ITEMS/mcl_end/eye_of_ender.lua @@ -28,8 +28,8 @@ minetest.register_entity("mcl_end:ender_eye", { self._age = self._age + dtime if self._age >= 3 then -- End of life - local r = math.random(1,5) - if r == 1 then + local r = math.random(1,15) + self._luck + if r <= 3 then -- 20% chance to get destroyed completely. -- 100% if in Creative Mode self.object:remove() @@ -85,11 +85,12 @@ minetest.register_craftitem("mcl_end:ender_eye", { if user == nil then return end + local player_name = user:get_player_name() local origin = user:get_pos() origin.y = origin.y + 1.5 local strongholds = mcl_structures.registered_structures["end_shrine"].static_pos local dim = mcl_worlds.pos_to_dimension(origin) - local is_creative = minetest.is_creative_enabled(user:get_player_name()) + local is_creative = minetest.is_creative_enabled(player_name) -- Just drop the eye of ender if there are no strongholds if #strongholds <= 0 or dim ~= "overworld" then @@ -124,6 +125,8 @@ minetest.register_craftitem("mcl_end:ender_eye", { -- Throw it! local obj = minetest.add_entity(origin, "mcl_end:ender_eye") local dir + local ent = obj:get_luaentity() + ent._luck = mcl_luck.get_luck(player_name) if lowest_dist <= 25 then local velocity = 4 diff --git a/mods/ITEMS/mcl_end/mod.conf b/mods/ITEMS/mcl_end/mod.conf index 3547074cf..3666ace19 100644 --- a/mods/ITEMS/mcl_end/mod.conf +++ b/mods/ITEMS/mcl_end/mod.conf @@ -1,2 +1,2 @@ name = mcl_end -depends = screwdriver, mcl_sounds, mcl_util, doc_items, mcl_worlds, mcl_structures, mcl_stonecutter +depends = screwdriver, mcl_sounds, mcl_util, doc_items, mcl_worlds, mcl_structures, mcl_stonecutter, mcl_luck diff --git a/mods/ITEMS/mcl_farming/README.txt b/mods/ITEMS/mcl_farming/README.txt index 02cdaf93a..8fadc5ec6 100644 --- a/mods/ITEMS/mcl_farming/README.txt +++ b/mods/ITEMS/mcl_farming/README.txt @@ -1,7 +1,7 @@ ===FARMING MOD for MINETEST-C55=== by PilzAdam -Modified heavily by MineClone 2 Dev Team. +Modified heavily by VoxeLibre Dev Team. Introduction: This mod adds farming to Minetest. diff --git a/mods/ITEMS/mcl_farming/hoes.lua b/mods/ITEMS/mcl_farming/hoes.lua index 72d8f7b7a..0a389522e 100644 --- a/mods/ITEMS/mcl_farming/hoes.lua +++ b/mods/ITEMS/mcl_farming/hoes.lua @@ -43,6 +43,7 @@ local hoe_on_place_function = function(wear_divisor) if create_soil(pointed_thing.under, user:get_inventory()) then if not minetest.is_creative_enabled(user:get_player_name()) then itemstack:add_wear(65535/wear_divisor) + tt.reload_itemstack_description(itemstack) -- update tooltip end return itemstack end @@ -54,7 +55,7 @@ local uses = { stone = 132, iron = 251, gold = 33, - diamond = 1562, + diamond = 1562, netherite = 2031, } @@ -274,26 +275,26 @@ minetest.register_craft({ {"mcl_core:diamond", "mcl_core:diamond"}, {"mcl_core:stick", ""}, {"mcl_core:stick", ""} - } -}) - -minetest.register_tool("mcl_farming:hoe_netherite", { - description = S("Netherite Hoe"), - _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.netherite), - _doc_items_longdesc = hoe_longdesc, - _doc_items_usagehelp = hoe_usagehelp, - inventory_image = "farming_tool_netheritehoe.png", - wield_scale = mcl_vars.tool_wield_scale, - on_place = hoe_on_place_function(uses.netherite), - groups = { tool=1, hoe=1, enchantability=10, fire_immune=1 }, - tool_capabilities = { - full_punch_interval = 0.25, - damage_groups = { fleshy = 4, }, - punch_attack_uses = uses.netherite, - }, - _repair_material = "mcl_nether:netherite_ingot", - _mcl_toollike_wield = true, - _mcl_diggroups = { - hoey = { speed = 8, level = 5, uses = uses.netherite } - }, -}) + } +}) + +minetest.register_tool("mcl_farming:hoe_netherite", { + description = S("Netherite Hoe"), + _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.netherite), + _doc_items_longdesc = hoe_longdesc, + _doc_items_usagehelp = hoe_usagehelp, + inventory_image = "farming_tool_netheritehoe.png", + wield_scale = mcl_vars.tool_wield_scale, + on_place = hoe_on_place_function(uses.netherite), + groups = { tool=1, hoe=1, enchantability=10, fire_immune=1 }, + tool_capabilities = { + full_punch_interval = 0.25, + damage_groups = { fleshy = 4, }, + punch_attack_uses = uses.netherite, + }, + _repair_material = "mcl_nether:netherite_ingot", + _mcl_toollike_wield = true, + _mcl_diggroups = { + hoey = { speed = 8, level = 5, uses = uses.netherite } + }, +}) diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index d3f4e4fc0..66c5169c4 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -142,7 +142,7 @@ minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, -- 60% chance of poisoning with poisonous potato if itemstack:get_name() == "mcl_farming:potato_item_poison" then if math.random(1,10) >= 6 then - mcl_potions.poison_func(user, 1, 5) + mcl_potions.give_effect_by_level("poison", user, 1, 5) end end diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index 47c2a0ddf..fe437f5cf 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -119,7 +119,7 @@ pumpkin_face_base_def.groups.non_combat_armor=1 pumpkin_face_base_def.groups.armor_head=1 pumpkin_face_base_def.groups.non_combat_armor_head=1 pumpkin_face_base_def._mcl_armor_mob_range_factor = 0 -pumpkin_face_base_def._mcl_armor_mob_range_mob = "mobs_mc:enderman" +pumpkin_face_base_def._mcl_armor_mob_range_mob = "mobs_mc:rover" pumpkin_face_base_def._mcl_armor_element = "head" pumpkin_face_base_def._mcl_armor_texture = "mcl_farming_pumpkin_face.png" diff --git a/mods/ITEMS/mcl_fences/API.md b/mods/ITEMS/mcl_fences/API.md index 39ba314f2..01e04fdc6 100644 --- a/mods/ITEMS/mcl_fences/API.md +++ b/mods/ITEMS/mcl_fences/API.md @@ -1,4 +1,4 @@ -# API for adding MineClone 2 fences +# API for adding VoxeLibre fences This API allows you to add fences and fence gates. The recommended function is `mcl_fences.register_fence_and_fence_gate`. diff --git a/mods/ITEMS/mcl_fences/locale/mcl_fences.fr.tr b/mods/ITEMS/mcl_fences/locale/mcl_fences.fr.tr index 1044cf148..e161b5c9d 100644 --- a/mods/ITEMS/mcl_fences/locale/mcl_fences.fr.tr +++ b/mods/ITEMS/mcl_fences/locale/mcl_fences.fr.tr @@ -1,18 +1,18 @@ # textdomain: mcl_fences -Fences are structures which block the way. Fences will connect to each other and solid blocks. They cannot be jumped over with a simple jump.=Les barrières sont des structures qui bloquent le chemin. Les barrières se connecteront les unes aux autres et aux blocs solides. Ils ne peuvent pas être sautés par un simple saut. -Fence gates can be opened or closed and can't be jumped over. Fences will connect nicely to fence gates.=Les portillons peuvent être ouvertes ou fermées et ne peuvent pas être sautées. Les barrières se connecteront bien aux portillions. -Right-click the fence gate to open or close it.=Cliquez avec le bouton droit sur le portillon pour l'ouvrir ou la fermer. -Oak Fence=Barrière en bois de Chêne -Oak Fence Gate=Portillon en bois de Chêne -Spruce Fence=Barrière en bois de Sapin -Spruce Fence Gate=Portillon en bois de Sapin -Birch Fence=Barrière en bois de Bouleau -Birch Fence Gate=Portillon en bois de Bouleau -Jungle Fence=Barrière en bois d'Acajou -Jungle Fence Gate=Portillon en bois d'Acajou -Dark Oak Fence=Barrière en bois de Chêne Noir -Dark Oak Fence Gate=Portillon en bois de Chêne Noir -Acacia Fence=Barrière en bois d'Acacia -Acacia Fence Gate=Portillon en bois d'Acacia -Nether Brick Fence=Barrière en Brique du Nether +Fences are structures which block the way. Fences will connect to each other and solid blocks. They cannot be jumped over with a simple jump.=Les barrières sont des structures qui bloquent le chemin. Les barrières se connecteront les unes aux autres et aux blocs solides. Elles ne peuvent pas être sautées par un simple saut. +Fence gates can be opened or closed and can't be jumped over. Fences will connect nicely to fence gates.=Les portillons peuvent être ouverts ou fermés et ne peuvent pas être sautés. Les barrières se connecteront bien aux portillons. +Right-click the fence gate to open or close it.=Cliquez avec le bouton droit sur le portillon pour l'ouvrir ou le fermer. +Oak Fence=Barrière en bois de chêne +Oak Fence Gate=Portillon en bois de chêne +Spruce Fence=Barrière en bois de sapin +Spruce Fence Gate=Portillon en bois de sapin +Birch Fence=Barrière en bois de bouleau +Birch Fence Gate=Portillon en bois de bouleau +Jungle Fence=Barrière en bois d'acajou +Jungle Fence Gate=Portillon en bois d'acajou +Dark Oak Fence=Barrière en bois de chêne noir +Dark Oak Fence Gate=Portillon en bois de chêne noir +Acacia Fence=Barrière en bois d'acacia +Acacia Fence Gate=Portillon en bois d'acacia +Nether Brick Fence=Barrière en brique du Nether Openable by players and redstone power=Ouvrable par les joueurs et la puissance redstone diff --git a/mods/ITEMS/mcl_fire/README.txt b/mods/ITEMS/mcl_fire/README.txt index af46528a5..c189cbd9a 100644 --- a/mods/ITEMS/mcl_fire/README.txt +++ b/mods/ITEMS/mcl_fire/README.txt @@ -1,4 +1,4 @@ -mcl_fire: Fire mod for MineClone 2 +mcl_fire: Fire mod for VoxeLibre Based on fire from Minetest Game ================================== diff --git a/mods/ITEMS/mcl_fireworks/README.txt b/mods/ITEMS/mcl_fireworks/README.txt index 4cf71fc9b..3202bc137 100644 --- a/mods/ITEMS/mcl_fireworks/README.txt +++ b/mods/ITEMS/mcl_fireworks/README.txt @@ -1,4 +1,4 @@ -Firework mod for Mineclone 2 +Firework mod for VoxeLibre by NO11 and and some parts by j45 diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 4638325bd..f381ffefc 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -1,6 +1,7 @@ --Fishing Rod, Bobber, and Flying Bobber mechanics and Bobber artwork by Rootyjr. local S = minetest.get_translator(minetest.get_current_modname()) +local FISHING_ROD_DURABILITY = 65 local bobber_ENTITY={ physical = false, @@ -38,7 +39,7 @@ local fish = function(itemstack, player, pointed_thing) local ent = nil local noent = true - local durability = 65 + local durability = FISHING_ROD_DURABILITY local unbreaking = mcl_enchanting.get_enchantment(itemstack, "unbreaking") if unbreaking > 0 then durability = durability * (unbreaking + 1) @@ -61,8 +62,8 @@ local fish = function(itemstack, player, pointed_thing) local junk_values = {10, 8.1, 6.1, 4.2} local luck_of_the_sea = math.min(mcl_enchanting.get_enchantment(itemstack, "luck_of_the_sea"), 3) local index = luck_of_the_sea + 1 - local fish_value = fish_values[index] - local junk_value = junk_values[index] + fish_value + local fish_value = fish_values[index] - mcl_luck.get_luck(ent.player) + local junk_value = junk_values[index] + fish_value - mcl_luck.get_luck(ent.player) if r <= fish_value then -- Fish items = mcl_loot.get_loot({ @@ -113,6 +114,8 @@ local fish = function(itemstack, player, pointed_thing) { itemstring = "mcl_mobitems:saddle", }, { itemstring = "mcl_flowers:waterlily", }, { itemstring = "mcl_mobitems:nautilus_shell", }, + { itemstring = "mcl_mobitems:spectre_membrane", }, + { itemstring = "mcl_mobitems:crystalline_drop", }, }, stacks_min = 1, stacks_max = 1, @@ -140,6 +143,7 @@ local fish = function(itemstack, player, pointed_thing) if not minetest.is_creative_enabled(player:get_player_name()) then local idef = itemstack:get_definition() itemstack:add_wear(65535/durability) -- 65 uses + tt.reload_itemstack_description(itemstack) -- update tooltip if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}, true) end @@ -154,6 +158,7 @@ local fish = function(itemstack, player, pointed_thing) if not minetest.is_creative_enabled(player:get_player_name()) then local idef = itemstack:get_definition() itemstack:add_wear((65535/durability)*2) -- if so and not creative then wear double like in MC. + tt.reload_itemstack_description(itemstack) -- update tooltip if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}, true) end @@ -516,7 +521,8 @@ minetest.register_craftitem("mcl_fishing:pufferfish_raw", { minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) if itemstack:get_name() == "mcl_fishing:pufferfish_raw" then - mcl_potions.poison_func(user, 1/3, 60) + mcl_potions.give_effect_by_level("poison", user, 3, 60) + mcl_potions.give_effect_by_level("nausea", user, 2, 20) end end ) diff --git a/mods/ITEMS/mcl_fishing/mod.conf b/mods/ITEMS/mcl_fishing/mod.conf index 71bde6146..1af715aaf 100644 --- a/mods/ITEMS/mcl_fishing/mod.conf +++ b/mods/ITEMS/mcl_fishing/mod.conf @@ -1,3 +1,3 @@ name = mcl_fishing description = Adds fish and fishing poles to go fishing. -depends = mcl_core, mcl_sounds, mcl_loot, mcl_mobs, mcl_enchanting, mcl_throwing, mcl_colors, mcl_buckets +depends = mcl_core, mcl_sounds, mcl_loot, mcl_mobs, mcl_enchanting, mcl_throwing, mcl_colors, mcl_buckets, mcl_luck diff --git a/mods/ITEMS/mcl_fletching_table/README.md b/mods/ITEMS/mcl_fletching_table/README.md index a30e2c1b4..e6b41a7a5 100644 --- a/mods/ITEMS/mcl_fletching_table/README.md +++ b/mods/ITEMS/mcl_fletching_table/README.md @@ -2,7 +2,7 @@ mcl_fletching_table ------------------- Fletching Tables, by PrairieWind -Adds Fletching Tables to MineClone 2/5. +Adds Fletching Tables to VoxeLibre. License of source code ---------------------- diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index 7c1fa1de4..85a65a165 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -194,8 +194,8 @@ def_clover.mesh = "mcl_clover_3leaf.obj" def_clover.tiles = { "mcl_flowers_clover.png" } def_clover.inventory_image = "mcl_flowers_clover_inv.png" def_clover.wield_image = "mcl_flowers_clover_inv.png" -def_clover.drop = nil def_clover.use_texture_alpha = "clip" +def_clover.drop = "mcl_flowers:clover" def_clover.selection_box = { type = "fixed", fixed = { -4/16, -0.5, -4/16, 4/16, 0, 4/16 }, @@ -212,6 +212,7 @@ def_4l_clover.tiles = { "mcl_flowers_fourleaf_clover.png" } def_4l_clover.inventory_image = "mcl_flowers_fourleaf_clover_inv.png" def_4l_clover.wield_image = "mcl_flowers_fourleaf_clover_inv.png" def_4l_clover.use_texture_alpha = "clip" +def_4l_clover.drop = "mcl_flowers:fourleaf_clover" minetest.register_node("mcl_flowers:fourleaf_clover", def_4l_clover) diff --git a/mods/ITEMS/mcl_furnaces/README.md b/mods/ITEMS/mcl_furnaces/README.md index c7282124b..00a5f8fdb 100644 --- a/mods/ITEMS/mcl_furnaces/README.md +++ b/mods/ITEMS/mcl_furnaces/README.md @@ -1,4 +1,4 @@ -Furnaces for MineClone 2. +Furnaces for VoxeLibre. Heavily based on Minetest Game (default/furnace.lua). License of source code @@ -9,4 +9,4 @@ Modified by Wuzzy. License of media ---------------- -See the main MineClone 2 README.md file. +See the main VoxeLibre README.md file. diff --git a/mods/ITEMS/mcl_hamburger/readme.txt b/mods/ITEMS/mcl_hamburger/readme.txt index e479c01b9..da11f5527 100644 --- a/mods/ITEMS/mcl_hamburger/readme.txt +++ b/mods/ITEMS/mcl_hamburger/readme.txt @@ -27,7 +27,7 @@ suggestions are always welcome! The images contained within have been altered to be more legible within the game and not rendered with weird antialiasing by Michieal. All extraneous information in the images have been removed to decrease file size. -This mod is licensed under CC-BY-SA 3, with the intent of it being used by the Mineclone 2 game for Minetest. +This mod is licensed under CC-BY-SA 3, with the intent of it being used by the VoxeLibre game for Minetest. This code was written by Michieal, with additions included by Cora. The achievement "Burger Time!" is an homage to the classic coin-op arcade game BurgerTime, by Data East (1982) and diff --git a/mods/ITEMS/mcl_heads/init.lua b/mods/ITEMS/mcl_heads/init.lua index 69c26b97d..5409f21c4 100644 --- a/mods/ITEMS/mcl_heads/init.lua +++ b/mods/ITEMS/mcl_heads/init.lua @@ -264,11 +264,11 @@ mcl_heads.register_head{ } mcl_heads.register_head{ - name = "creeper", - texture = "mcl_heads_creeper.png", - description = S("Creeper Head"), - longdesc = S("A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%."), - range_mob = "mobs_mc:creeper", + name = "stalker", + texture = "mcl_heads_stalker.png", + description = S("Stalker Head"), + longdesc = S("A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet, which reduces the detection range of stalkers by 50%."), + range_mob = "mobs_mc:stalker", range_factor = 0.5, } diff --git a/mods/ITEMS/mcl_heads/locale/mcl_heads.de.tr b/mods/ITEMS/mcl_heads/locale/mcl_heads.de.tr index 75e92aef9..0d829b62b 100644 --- a/mods/ITEMS/mcl_heads/locale/mcl_heads.de.tr +++ b/mods/ITEMS/mcl_heads/locale/mcl_heads.de.tr @@ -1,8 +1,8 @@ # textdomain: mcl_heads Zombie Head=Zombiekopf A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%.=Ein Zombiekopf ist ein kleiner dekorativer Block, der so wie ein Kopf eines Zombies aussieht. Er kann auch als Helm getragen werden, was den Erkennungsradius von Zombies um 50% verringert. -Creeper Head=Creeper-Kopf -A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%.=Ein Creeperkopf ist ein kleiner dekorativer Block, der so wie ein Kopf eines Creepers aussieht. Er kann auch als Helm getragen werden, was den Erkennungsradius von Creepern um 50% verringert. +Stalker Head=Stalker-Kopf +A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet, which reduces the detection range of stalkers by 50%.=Ein Stalkerkopf ist ein kleiner dekorativer Block, der so wie ein Kopf eines Stalkers aussieht. Er kann auch als Helm getragen werden, was den Erkennungsradius von Stalkern um 50% verringert. Human Head=Menschenkopf A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.=Ein Menschenkopf ist ein kleiner dekorativer Block, der so wie der Kopf eines Menschen (das heißt, einer Spielerfigur) aussieht. Er kann auch als Helm zum Spaß getragen werden, aber er bietet keinerlei Schutz. Skeleton Skull=Skelettschädel diff --git a/mods/ITEMS/mcl_heads/locale/mcl_heads.es.tr b/mods/ITEMS/mcl_heads/locale/mcl_heads.es.tr index 308dd8b28..3c9a2a1c1 100644 --- a/mods/ITEMS/mcl_heads/locale/mcl_heads.es.tr +++ b/mods/ITEMS/mcl_heads/locale/mcl_heads.es.tr @@ -1,8 +1,8 @@ # textdomain: mcl_heads Zombie Head=Cabeza de zombie A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet for fun, but does not offer any protection.=Una cabeza de zombie es un pequeño bloque decorativo que se asemeja a la cabeza de un zombie. También se puede usar como casco por diversión, pero no ofrece ninguna protección. -Creeper Head=Cabeza de creeper -A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet for fun, but does not offer any protection.=Una cabeza de creeper es un pequeño bloque decorativo que se asemeja a la cabeza de un creeper. También se puede usar como casco por diversión, pero no ofrece ninguna protección. +Stalker Head=Cabeza de stalker +A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet for fun, but does not offer any protection.=Una cabeza de stalker es un pequeño bloque decorativo que se asemeja a la cabeza de un stalker. También se puede usar como casco por diversión, pero no ofrece ninguna protección. Human Head=Cabeza humana A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.=Una cabeza humana es un pequeño bloque decorativo que se asemeja a la cabeza de un humano (es decir, un personaje jugador). También se puede usar como casco por diversión, pero no ofrece ninguna protección. Skeleton Skull=Calavera de esqueleto diff --git a/mods/ITEMS/mcl_heads/locale/mcl_heads.fr.tr b/mods/ITEMS/mcl_heads/locale/mcl_heads.fr.tr index 56436f519..dd6c20339 100644 --- a/mods/ITEMS/mcl_heads/locale/mcl_heads.fr.tr +++ b/mods/ITEMS/mcl_heads/locale/mcl_heads.fr.tr @@ -1,8 +1,8 @@ # textdomain: mcl_heads Zombie Head=Tête de Zombie A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%.=Une tête de zombie est un petit bloc décoratif qui ressemble à la tête d'un zombie. Il peut également être porté comme un casque, ce qui réduit la plage de détection des zombies de 50%. -Creeper Head=Tête de Creeper -A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%.=Une tête de creepers est un petit bloc décoratif qui ressemble à la tête d'un creeper. Il peut également être porté comme un casque, ce qui réduit la plage de détection des creepers de 50%. +Stalker Head=Tête de Stalker +A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet, which reduces the detection range of stalkers by 50%.=Une tête de stalkers est un petit bloc décoratif qui ressemble à la tête d'un stalker. Il peut également être porté comme un casque, ce qui réduit la plage de détection des stalkers de 50%. Human Head=Tête de Joueur A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.=Une tête de joueur est un petit bloc décoratif qui ressemble à la tête d'un humain (c'est-à-dire un personnage de joueur). Il peut également être porté comme un casque pour le plaisir, mais n'offre aucune protection. Skeleton Skull=Crâne de Squelette diff --git a/mods/ITEMS/mcl_heads/locale/mcl_heads.pl.tr b/mods/ITEMS/mcl_heads/locale/mcl_heads.pl.tr index 4ed4bbbee..9091f92cb 100644 --- a/mods/ITEMS/mcl_heads/locale/mcl_heads.pl.tr +++ b/mods/ITEMS/mcl_heads/locale/mcl_heads.pl.tr @@ -1,8 +1,8 @@ # textdomain: mcl_heads Zombie Head=Głowa zombie A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%.=Głowa zombie jest małym blokiem dekoracyjnym i przypomina głowę zombie. Może być noszona jako hełm co zmniejsza obszar wykrycia przez zombie o 50%. -Creeper Head=Głowa creepera -A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%.=Głowa creepera jest małym blokiem dekoracyjnym i przypomina głowę creepera. Może być noszona jako hełm co zmniejsza obszar wykrycia przez creepera o 50%. +Stalker Head=Głowa stalkera +A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet, which reduces the detection range of stalkers by 50%.=Głowa stalkera jest małym blokiem dekoracyjnym i przypomina głowę stalkera. Może być noszona jako hełm co zmniejsza obszar wykrycia przez stalkera o 50%. Human Head=Głowa człowieka A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.=Głowa człowieka jest małym blokiem dekoracyjnym i przypomina głowę człowieka. Może być noszona jako hełm dla zabawy, ale nie zapewnia żadnej dodatkowej ochrony. Skeleton Skull=Głowa szkieleta diff --git a/mods/ITEMS/mcl_heads/locale/mcl_heads.pt_BR.tr b/mods/ITEMS/mcl_heads/locale/mcl_heads.pt_BR.tr index fb256997a..91cef7627 100644 --- a/mods/ITEMS/mcl_heads/locale/mcl_heads.pt_BR.tr +++ b/mods/ITEMS/mcl_heads/locale/mcl_heads.pt_BR.tr @@ -1,8 +1,8 @@ # textdomain: mcl_heads Zombie Head=Cabeça de Zumbi A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%.=Uma cabeça de zumbi é um pequeno bloco decorativo ao qual remete a cabeça de um zumbi. Também pode ser usado como um capacete, o que reduz o alcançe de detecção dos zumbis em 50%. -Creeper Head=Cabeça de Creeper -A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%.=Uma cabeça de creeper é um pequeno bloco decorativo ao qual remete a cabeça de um creeper. Também pode ser usado como um capacete, o que reduz o alcançe de detecção dos creepers em 50%. +Stalker Head=Cabeça de Stalker +A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet, which reduces the detection range of stalkers by 50%.=Uma cabeça de stalker é um pequeno bloco decorativo ao qual remete a cabeça de um stalker. Também pode ser usado como um capacete, o que reduz o alcançe de detecção dos stalkers em 50%. Human Head=Cabeça Humana A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.=Uma cabeça de humano é um pequeno bloco decorativo ao qual remete a cabeça de um humano (ou seja, o personagem do jogador). Também pode ser usado como um capacete por diversão, mas não oferece nenhuma proteção. Skeleton Skull=Cabeça de Esqueleto diff --git a/mods/ITEMS/mcl_heads/locale/mcl_heads.ru.tr b/mods/ITEMS/mcl_heads/locale/mcl_heads.ru.tr index f802ae92d..dbedbbfe0 100644 --- a/mods/ITEMS/mcl_heads/locale/mcl_heads.ru.tr +++ b/mods/ITEMS/mcl_heads/locale/mcl_heads.ru.tr @@ -1,8 +1,8 @@ # textdomain: mcl_heads Zombie Head=Голова зомби A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%.=Голова зомби это небольшой декоративный блок, немного похожий на голову зомби. Его можно носить в качестве шлема, что уменьшит радиус обнаружения вас зомби на 50%. -Creeper Head=Голова крипера -A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%.=Голова крипера это небольшой декоративный блок, немного похожий на голову крипера. Его можно носить в качестве шлема, что уменьшит радиус обнаружения вас крипером на 50%. +Stalker Head=Голова сталкера +A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet, which reduces the detection range of stalkers by 50%.=Голова сталкера это небольшой декоративный блок, немного похожий на голову сталкера. Его можно носить в качестве шлема, что уменьшит радиус обнаружения вас сталкером на 50%. Human Head=Голова игрока A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.=Голова игрока это небольшой декоративный блок, немного похожий на голову игрового персонажа. Его можно носить в качестве шлема просто для веселья, он не даёт никакой защиты. Skeleton Skull=Череп скелета diff --git a/mods/ITEMS/mcl_heads/locale/template.txt b/mods/ITEMS/mcl_heads/locale/template.txt index 59321099a..6fe2a212f 100644 --- a/mods/ITEMS/mcl_heads/locale/template.txt +++ b/mods/ITEMS/mcl_heads/locale/template.txt @@ -1,8 +1,8 @@ # textdomain: mcl_heads Zombie Head= A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%.= -Creeper Head= -A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%.= +Stalker Head= +A stalker head is a small decorative block which resembles the head of a stalker. It can also be worn as a helmet, which reduces the detection range of stalkers by 50%.= Human Head= A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection.= Skeleton Skull= diff --git a/mods/ITEMS/mcl_itemframes/README.txt b/mods/ITEMS/mcl_itemframes/README.txt index c2756a1c9..99495b850 100644 --- a/mods/ITEMS/mcl_itemframes/README.txt +++ b/mods/ITEMS/mcl_itemframes/README.txt @@ -1,12 +1,12 @@ This mod has been rewritten and revamped by Michieal / Faerraven. Based on the code originally done by Zeg9, and then -heavily modified by the Mineclone 2 dev team. +heavily modified by the VoxeLibre dev team. This mod now supports all the base item frame functions, like rotating the displayed item, which it didn't do before it was rewritten. Additionally, Glow Frames have been added in, and item frames now has an API to allow new item frames to be created in other modules. Now requires the Screwdriver to have full functionality. -The code is licenced under the standard MineClone 2 license for usage, with the requirement that this readme is +The code is licenced under the standard VoxeLibre license for usage, with the requirement that this readme is included in the code / module. Model created by 22i, licensed under the diff --git a/mods/ITEMS/mcl_itemframes/item_frames_API.lua b/mods/ITEMS/mcl_itemframes/item_frames_API.lua index 3cc1aaccd..b1b59e423 100644 --- a/mods/ITEMS/mcl_itemframes/item_frames_API.lua +++ b/mods/ITEMS/mcl_itemframes/item_frames_API.lua @@ -638,7 +638,7 @@ function mcl_itemframes.create_base_definitions() paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, - groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 1, attached_node_facedir = 1 }, + groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 1, supported_node_facedir = 1 }, sounds = mcl_sounds.node_sound_defaults(), node_placement_prediction = "", diff --git a/mods/ITEMS/mcl_jukebox/README.md b/mods/ITEMS/mcl_jukebox/README.md index 6376362bb..581addb09 100644 --- a/mods/ITEMS/mcl_jukebox/README.md +++ b/mods/ITEMS/mcl_jukebox/README.md @@ -1,4 +1,4 @@ -# Jukebox mod for MineClone 2. +# Jukebox mod for VoxeLibre. Based on the `jdukebox` mod by Jordach. This adds a jukebox block and music disc. Just place a music disc in a jukebox and music starts @@ -25,7 +25,7 @@ Note: 9 tracks are included. 3 music disc textures are currently unused. ### License Code licenced as GPLv3. Music under individual licenses (see abbreviations -above). Texture license: See main MineClone 2 README.md file. +above). Texture license: See main VoxeLibre README.md file. See here for the full license texts: diff --git a/mods/ITEMS/mcl_lectern/README.txt b/mods/ITEMS/mcl_lectern/README.txt index 8afe7108e..9427c4d4a 100644 --- a/mods/ITEMS/mcl_lectern/README.txt +++ b/mods/ITEMS/mcl_lectern/README.txt @@ -1,13 +1,13 @@ --- -# Mineclone2-Lectern +# VoxeLibre-Lectern --- -A ground up creation of a lectern to be used in MineClone 2. Requires Minetest and Mineclone2. +A ground up creation of a lectern to be used in VoxeLibre. Requires Minetest and VoxeLibre. --- Created by Michieal (FaerRaven) @ DateTime: 01/07/2023 (07JAN2023) -* Made for MineClone 2 by Michieal. +* Made for VoxeLibrea by Michieal. * Texture made by Michieal; The model borrows the top from NathanS21's (Nathan Salapat) Lectern model; The rest of the lectern model was created by Michieal. * Creation date: 01/07/2023 (07JAN2023) diff --git a/mods/ITEMS/mcl_loom/README.md b/mods/ITEMS/mcl_loom/README.md index e91bad8fd..279ec65f4 100644 --- a/mods/ITEMS/mcl_loom/README.md +++ b/mods/ITEMS/mcl_loom/README.md @@ -2,7 +2,7 @@ mcl_loom -------- Looms, by PrairieWind -Adds Looms to MineClone 2/5. Used to add patterns to banners. +Adds Looms to VoxeLibre. Used to add patterns to banners. License of source code ---------------------- diff --git a/mods/ITEMS/mcl_mangrove/init.lua b/mods/ITEMS/mcl_mangrove/init.lua index e23432a1f..a8ab01370 100644 --- a/mods/ITEMS/mcl_mangrove/init.lua +++ b/mods/ITEMS/mcl_mangrove/init.lua @@ -266,7 +266,7 @@ minetest.register_node("mcl_mangrove:river_water_logged_roots",rwlroots) minetest.register_node("mcl_mangrove:mangrove_mud_roots", { description = S("Muddy Mangrove Roots"), - _tt_help = S("crafted with Mud and Mangrove roots"), + _tt_help = S("Crafted with Mud and Mangrove roots"), _doc_items_longdesc = S("Muddy Mangrove Roots is a block from mangrove swamp.It drowns player a bit inside it."), tiles = { "mcl_mud.png^mcl_mangrove_roots_top.png", diff --git a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.fr.tr b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.fr.tr index 805666f67..94cc9ac6d 100644 --- a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.fr.tr +++ b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.fr.tr @@ -21,7 +21,7 @@ water logged mangrove roots=racines de palétuvier immergées Mangrove roots, despite being a full block, can be waterlogged and do not flow water out=Les racines de palétuvier sont un bloc plein mais qui peut être immergé et ne remplace pas l'eau. These cannot be crafted yet only occure when get in contact of water.=Elles ne peuvent être fabriquées mais se forment au contact de l'eau. Muddy Mangrove Roots=Racines de palétuvier boueuses -crafted with Mud and Mangrove roots=fabriqué avec de la boue et des racines de palétuvier +Crafted with Mud and Mangrove roots=Fabriqué avec de la boue et des racines de palétuvier Muddy Mangrove Roots is a block from mangrove swamp.It drowns player a bit inside it.=Les racines de palétuvier boueuses sont un bloc du marécage de la mangrove. Il noie un joueur à l'intérieur. Mangrove Door=Porte en palétuvier Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.=Les portes en bois sont des barrières hautes à 2 blocs qui peuvent être ouvertes ou fermées à la main et par un signal redstone. diff --git a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ja.tr b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ja.tr index 3191b3d7a..e5b826bb7 100644 --- a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ja.tr +++ b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ja.tr @@ -21,7 +21,7 @@ water logged mangrove roots=水没したマングローブの根 Mangrove roots, despite being a full block, can be waterlogged and do not flow water out=マングローブの根は、フルブロックであるにもかかわらず水没することがあり、水が流出しない These cannot be crafted yet only occure when get in contact of water.=これはクラフトできないものの、水と接触したときだけ発生します。 Muddy Mangrove Roots=泥に塗れたマングローブの根 -crafted with Mud and Mangrove roots=泥とマングローブの根で作られたもの +Crafted with Mud and Mangrove roots=泥とマングローブの根で作られたもの Muddy Mangrove Roots is a block from mangrove swamp.It drowns player a bit inside it.=泥に塗れたマングローブの根は、マングローブの沼地から1ブロックの場所にあります。 Mangrove Door=マングローブのドア Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.=木製のドアは、高さ2ブロックの障壁で、手やレッドストーンの信号で開閉できます。 diff --git a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.pt_BR.tr b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.pt_BR.tr index fc26a7531..07b1f4826 100644 --- a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.pt_BR.tr +++ b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.pt_BR.tr @@ -21,7 +21,7 @@ water logged mangrove roots=Raízes de Mangue Alagadas Mangrove roots, despite being a full block, can be waterlogged and do not flow water out=Raízes de mangue, mesmo sendo um bloco inteiro, podem ser alagadas e não escorre água delas. These cannot be crafted yet only occure when get in contact of water.=Essas não podem ser fabricadas ainda ocorrendo apenas quando tem contato com a água. Muddy Mangrove Roots=Raízes Barrentas de Mangue -crafted with Mud and Mangrove roots=Fabricadas com barro e raízes de mangue +Crafted with Mud and Mangrove roots=Fabricadas com barro e raízes de mangue Muddy Mangrove Roots is a block from mangrove swamp.It drowns player a bit inside it.=Raízes barrentas de mangue é um bloco dos pântanos de mangue. Afunda o jogador um pouco para dentro de si. Mangrove Door=Porta de Mangue Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.=Portas de madeira são barreiras de 2 blocos de altura as quais podem ser abertas ou fechadas pela mão e por um sinal de redstone. diff --git a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ru.tr b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ru.tr index b36fa5a0d..c16f757cf 100644 --- a/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ru.tr +++ b/mods/ITEMS/mcl_mangrove/locale/mcl_mangrove.ru.tr @@ -21,7 +21,7 @@ water logged mangrove roots=Затопленные мангровые корни Mangrove roots, despite being a full block, can be waterlogged and do not flow water out=Мангровые корни, не смотря на то что это полный блок, может быть затоплен и не выпускать воду наружу. These cannot be crafted yet only occure when get in contact of water.=Нельзя скрафтить, появляется только при контакте с водой. Muddy Mangrove Roots=Грязные мангровые корни -crafted with Mud and Mangrove roots=Крафтится с помощью грязи и мангровых корней +Crafted with Mud and Mangrove roots=Крафтится с помощью грязи и мангровых корней Muddy Mangrove Roots is a block from mangrove swamp.It drowns player a bit inside it.=Грязные мангровые корни это блок из мангровых болот. Игрок немного погружается внутрь них. Mangrove Door=Мангровая дверь Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.=Деревянные двери это преграды высотой в 2 блока, которые можно открывать и закрывать вручную и по сигналу редстоуна. diff --git a/mods/ITEMS/mcl_mangrove/locale/template.txt b/mods/ITEMS/mcl_mangrove/locale/template.txt index 71c713d16..cc0fccf48 100644 --- a/mods/ITEMS/mcl_mangrove/locale/template.txt +++ b/mods/ITEMS/mcl_mangrove/locale/template.txt @@ -21,7 +21,7 @@ water logged mangrove roots= Mangrove roots, despite being a full block, can be waterlogged and do not flow water out= These cannot be crafted yet only occure when get in contact of water.= Muddy Mangrove Roots= -crafted with Mud and Mangrove roots= +Crafted with Mud and Mangrove roots= Muddy Mangrove Roots is a block from mangrove swamp.It drowns player a bit inside it.= Mangrove Door= Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.= diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index 421ee184e..4d92c2d43 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -134,19 +134,7 @@ minetest.register_craftitem("mcl_mobitems:cooked_rabbit", { stack_max = 64, }) --- Reset food poisoning and status effects -local function drink_milk(itemstack, player, pointed_thing) - local bucket = minetest.do_item_eat(0, "mcl_buckets:bucket_empty", itemstack, player, pointed_thing) - -- Check if we were allowed to drink this (eat delay check) - if mcl_hunger.active and (bucket:get_name() ~= "mcl_mobitems:milk_bucket" or minetest.is_creative_enabled(player:get_player_name())) then - mcl_hunger.stop_poison(player) - end - mcl_potions._reset_player_effects(player) - return bucket -end - local function drink_milk_delayed(itemstack, player, pointed_thing) - if pointed_thing.type == "node" then local node = minetest.get_node(pointed_thing.under) if player and not player:get_player_control().sneak then @@ -159,35 +147,35 @@ local function drink_milk_delayed(itemstack, player, pointed_thing) end local function drink_milk(itemstack, player, pointed_thing) - --local bucket = minetest.do_item_eat(0, "mcl_buckets:bucket_empty", itemstack, player, pointed_thing) -- Check if we were allowed to drink this (eat delay check) - --if mcl_hunger.active and (bucket:get_name() ~= "mcl_mobitems:milk_bucket" or minetest.is_creative_enabled(player:get_player_name())) then - if mcl_hunger.active and (player:get_inventory():get_stack("main", player:get_wield_index(), itemstack) == "mcl_mobitems:milk_bucket" or minetest.is_creative_enabled(player:get_player_name())) then + if mcl_hunger.active and ( + player:get_inventory():get_stack("main", player:get_wield_index(), itemstack) == "mcl_mobitems:milk_bucket" or + minetest.is_creative_enabled(player:get_player_name()) + ) then mcl_hunger.stop_poison(player) end - mcl_potions._reset_player_effects(player) - return bucket + mcl_potions._reset_effects(player) end -- Wrapper for handling mcl_hunger delayed eating local name = player:get_player_name() - mcl_hunger.eat_internal[name]._custom_itemstack = itemstack -- Used as comparison to make sure the custom wrapper executes only when the same item is eaten - mcl_hunger.eat_internal[name]._custom_var = { + local hunger_internal = mcl_hunger.eat_internal[name] + hunger_internal._custom_itemstack = itemstack -- Used as comparison to make sure the custom wrapper executes only when the same item is eaten + hunger_internal._custom_var = { itemstack = itemstack, player = player, pointed_thing = pointed_thing, } - mcl_hunger.eat_internal[name]._custom_func = drink_milk - mcl_hunger.eat_internal[name]._custom_wrapper = function(name) - - mcl_hunger.eat_internal[name]._custom_func( - mcl_hunger.eat_internal[name]._custom_var.itemstack, - mcl_hunger.eat_internal[name]._custom_var.player, - mcl_hunger.eat_internal[name]._custom_var.pointed_thing + hunger_internal._custom_func = drink_milk + hunger_internal._custom_wrapper = function(name) + local hunger_internal2 = mcl_hunger.eat_internal[name] + hunger_internal2._custom_func( + hunger_internal2._custom_var.itemstack, + hunger_internal2._custom_var.player, + hunger_internal2._custom_var.pointed_thing ) end - --mcl_hunger.eat_internal[name]._custom_do_delayed = true -- Only _custom_wrapper will be executed after holding RMB or LMB within a specified delay minetest.do_item_eat(0, "mcl_buckets:bucket_empty", itemstack, player, pointed_thing) end @@ -198,8 +186,6 @@ minetest.register_craftitem("mcl_mobitems:milk_bucket", { _doc_items_usagehelp = S("Use the placement key to drink the milk."), inventory_image = "mcl_mobitems_bucket_milk.png", wield_image = "mcl_mobitems_bucket_milk.png", - --on_place = drink_milk, -- Will do effect immediately but not reduce item count until eating delay ends which makes it exploitable by deliberately not finishing delay - --on_secondary_use = drink_milk, on_place = drink_milk_delayed, on_secondary_use = drink_milk_delayed, stack_max = 1, @@ -245,6 +231,46 @@ minetest.register_craftitem("mcl_mobitems:string",{ groups = { craftitem = 1 }, }) +minetest.register_craftitem("mcl_mobitems:spectre_membrane",{ + description = S("Spectre Membrane"), + _doc_items_longdesc = S("This is a crafting component dropped from dead spectres."), + inventory_image = "vl_mobitems_spectre_membrane.png", + groups = { craftitem = 1, brewitem = 1 }, + stack_max = 64, +}) + +minetest.register_craftitem("mcl_mobitems:shiny_ice_crystal",{ + description = S("Shiny Ice Crystal"), + _doc_items_longdesc = S("This item is mainly used for crafting."), + inventory_image = "vl_mobitems_ice_crystal.png", + groups = { craftitem = 1, brewitem = 1 }, + stack_max = 64, +}) + +minetest.register_craftitem("mcl_mobitems:aery_charge",{ + description = S("Aery Charge"), + _doc_items_longdesc = S("This item is mainly used for crafting."), -- TODO shoot? + inventory_image = "vl_mobitems_aery_charge.png", + groups = { craftitem = 1, brewitem = 1 }, + stack_max = 64, +}) + +minetest.register_craftitem("mcl_mobitems:crystalline_drop",{ + description = S("Crystalline Drop"), + _doc_items_longdesc = S("This item is mainly used for crafting."), -- TODO other uses? + inventory_image = "vl_mobitems_crystalline_drop.png", + groups = { craftitem = 1, brewitem = 1 }, + stack_max = 64, +}) + +minetest.register_craftitem("mcl_mobitems:earthen_ash",{ + description = S("Earthen Ash"), + _doc_items_longdesc = S("This item is mainly used for crafting."), -- TODO other uses? + inventory_image = "vl_mobitems_earthen_ash.png", + groups = { craftitem = 1, brewitem = 1 }, + stack_max = 64, +}) + minetest.register_craftitem("mcl_mobitems:blaze_rod", { description = S("Blaze Rod"), _doc_items_longdesc = S("This is a crafting component dropped from dead blazes."), @@ -594,6 +620,6 @@ minetest.register_craft({ minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) -- poisoning with spider eye if itemstack:get_name() == "mcl_mobitems:spider_eye" then - mcl_potions.poison_func(user, 1, 4) + mcl_potions.give_effect_by_level("poison", user, 1, 4) end end) diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr index dd51c70b9..0b3e20f39 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr @@ -102,7 +102,7 @@ A warped fungus on a stick can be used on saddled striders to ride them.=Un cham Place it on a saddled strider to mount it. You can now ride the strider like a horse. Striders will also walk towards you when you just wield the fungus on a stick.=Placez-le sur un arpenteur sellé pour le monter. Vous pouvez maintenant monter l'arpenteur comme un cheval. Les arpenteurs marcheront également vers vous lorsque vous brandirez le champignon sur un bâton. Nautilus Shell=Coquille de nautile -Used to craft a conduit=Utilisé pour fabriquer un conduit. +Used to craft a conduit=Utilisé pour fabriquer un conduit The Nautilus Shell is used to craft a conduit. They can be obtained by fishing or killing a drowned that is wielding a shell.=La Coquille de nautile est utilisée pour fabriquer un conduit. Elles peuvent être obtenues en pêchant ou en tuant un noyé qui tient une coquille. Heart of the Sea=Coeur de la Mer The Heart of the Sea is used to craft a conduit. They can be obtained by finding them in a buried treasure chest.=Le Cœur de la Mer est utilisé pour fabriquer un conduit. Il peut être obtenu dans un coffre au trésor enterré. diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.pl.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.pl.tr index a58bfb474..484bc2d61 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.pl.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.pl.tr @@ -58,6 +58,12 @@ This item is dropped by dead squids. Squid ink can be used to as an ingredient String=Nić Strings are used in crafting.=Nić jest użyteczna w wytwarzaniu. +Spectre Membrane=Błona Widma +This is a crafting component dropped from dead spectres.=Jest to materiał do wytwarzania wypadający z martwych widm. +Shiny Ice Crystal=Lśniący Kryształ Lodu +Aery Charge=Powietrzny Ładunek +Crystalline Drop=Krystaliczna Kropla +Earthen Ash=Ziemny Popiół Blaze Rod=Płomienna różdżka This is a crafting component dropped from dead blazes.=Jest to materiał do wytwarzania wypadający z martwych płomyków. Blaze Powder=Płomienny proszek diff --git a/mods/ITEMS/mcl_mobspawners/README.md b/mods/ITEMS/mcl_mobspawners/README.md index 26ac39386..726036c9b 100644 --- a/mods/ITEMS/mcl_mobspawners/README.md +++ b/mods/ITEMS/mcl_mobspawners/README.md @@ -1,8 +1,8 @@ -This mod adds a mob spawner for MineClone 2. +This mod adds a mob spawner for VoxeLibre. Monsters will appear around the mob spawner in semi-regular intervals. This mod is originally based on the mob spawner from Mobs Redo by TenPlus1 -but has been modified quite a lot to fit the needs of MineClone 2. +but has been modified quite a lot to fit the needs of VoxeLibre. Players can get a mob spawner by `giveme` and is initially empty after placing. diff --git a/mods/ITEMS/mcl_mobspawners/init.lua b/mods/ITEMS/mcl_mobspawners/init.lua index 290980e78..f32558629 100644 --- a/mods/ITEMS/mcl_mobspawners/init.lua +++ b/mods/ITEMS/mcl_mobspawners/init.lua @@ -39,7 +39,7 @@ end local doll_size_overrides = { ["mobs_mc:guardian"] = { x = 0.6, y = 0.6 }, ["mobs_mc:guardian_elder"] = { x = 0.72, y = 0.72 }, - ["mobs_mc:enderman"] = { x = 0.8, y = 0.8 }, + ["mobs_mc:rover"] = { x = 0.8, y = 0.8 }, ["mobs_mc:iron_golem"] = { x = 0.9, y = 0.9 }, ["mobs_mc:ghast"] = { x = 1.05, y = 1.05 }, ["mobs_mc:wither"] = { x = 1.2, y = 1.2 }, @@ -63,8 +63,8 @@ local function set_doll_properties(doll, mob) xs = doll_size_overrides[mob].x ys = doll_size_overrides[mob].y else - xs = mobinfo.visual_size.x * 0.33333 - ys = mobinfo.visual_size.y * 0.33333 + xs = (mobinfo.visual_size.x or 0) * 0.33333 + ys = (mobinfo.visual_size.y or 0) * 0.33333 end local prop = { mesh = mobinfo.mesh, @@ -358,6 +358,11 @@ doll_def.on_activate = function(self, staticdata, dtime_s) if mob == "" or mob == nil then mob = default_mob end + + -- Handle conversion of mob spawners + local convert_to = (minetest.registered_entities[mob] or {})._convert_to + if convert_to then mob = convert_to end + set_doll_properties(self.object, mob) self.object:set_velocity({x=0, y=0, z=0}) self.object:set_acceleration({x=0, y=0, z=0}) @@ -390,3 +395,11 @@ minetest.register_lbm({ respawn_doll(pos) end, }) + +minetest.register_on_mods_loaded(function() + for name,mobinfo in pairs(minetest.registered_entities) do + if ( mobinfo.is_mob or name:find("mobs_mc") ) and not ( mobinfo.visual_size or mobinfo._convert_to ) then + minetest.log("warning", "Definition for "..tostring(name).." is missing field 'visual_size', mob spawners will not work properly") + end + end +end) diff --git a/mods/ITEMS/mcl_mushrooms/locale/mcl_mushrooms.fr.tr b/mods/ITEMS/mcl_mushrooms/locale/mcl_mushrooms.fr.tr index 40b6644d1..cba5f8019 100644 --- a/mods/ITEMS/mcl_mushrooms/locale/mcl_mushrooms.fr.tr +++ b/mods/ITEMS/mcl_mushrooms/locale/mcl_mushrooms.fr.tr @@ -9,7 +9,7 @@ Huge brown mushroom blocks are the cap parts of huge brown mushrooms. It consist The stem part of a huge brown mushroom.=La partie tige d'un énorme champignon brun. Huge Brown Mushroom Block=Bloc de champignon marron géant Huge Brown Mushroom Stem=Tige de champignon marron géant -Huge Brown Mushroom All-Faces Stem=Tige de Champignon marron géant avec pores +Huge Brown Mushroom All-Faces Stem=Tige de champignon marron géant avec pores Brown mushrooms are fungi which grow and spread in darkness, but are sensitive to light. They are inedible as such, but they can be used to craft food items.=Les champignons bruns sont des champignons qui poussent et se propagent dans l'obscurité, mais sont sensibles à la lumière. Ils sont non comestibles en tant que tels, mais ils peuvent être utilisés pour fabriquer des aliments. Red mushrooms are fungi which grow and spread in darkness, but are sensitive to light. They are inedible as such, but they can be used to craft food items.=Les champignons rouges sont des champignons qui poussent et se propagent dans l'obscurité, mais sont sensibles à la lumière. Ils sont non comestibles en tant que tels, mais ils peuvent être utilisés pour fabriquer des aliments. A single mushroom of this species will slowly spread over time towards a random solid opaque block with a light level of 12 or lower in a 3×3×3 cube around the mushroom. It stops spreading when there are 5 or more mushrooms of the same species within an area of 9×3×9 blocks around the mushroom.=Un seul champignon de cette espèce se propagera lentement au fil du temps vers un bloc opaque solide aléatoire avec un niveau de lumière de 12 ou moins dans un cube 3×3×3 autour du champignon. Il cesse de se propager lorsqu'il y a 5 champignons ou plus de la même espèce dans une zone de 9×3×9 blocs autour du champignon. diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 252768df5..b69355d5d 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -135,7 +135,7 @@ minetest.register_node("mcl_nether:magma", { -- From walkover mod on_walk_over = function(loc, nodeiamon, player) local armor_feet = player:get_inventory():get_stack("armor", 5) - if player and player:get_player_control().sneak or (minetest.global_exists("mcl_enchanting") and mcl_enchanting.has_enchantment(armor_feet, "frost_walker")) or (minetest.global_exists("mcl_potions") and mcl_potions.player_has_effect(player, "fire_proof")) then + if player and player:get_player_control().sneak or (minetest.global_exists("mcl_enchanting") and mcl_enchanting.has_enchantment(armor_feet, "frost_walker")) or (minetest.global_exists("mcl_potions") and mcl_potions.has_effect(player, "fire_resistance")) then return end -- Hurt players standing on top of this block diff --git a/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr b/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr index 70d8ca8e0..9e6d4e9d8 100644 --- a/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr +++ b/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr @@ -1,42 +1,42 @@ # textdomain: mcl_nether -Glowstone=Pierre Lumineuse -Glowstone is a naturally-glowing block which is home to the Nether.=La Pierre Lumineuse est un bloc naturellement brillant originaire du Nether. +Glowstone=Pierre lumineuse +Glowstone is a naturally-glowing block which is home to the Nether.=La pierre lumineuse est un bloc naturellement brillant originaire du Nether. Nether Quartz Ore=Minerai de quartz du Nether Nether quartz ore is an ore containing nether quartz. It is commonly found around netherrack in the Nether.=Le minerai de quartz du Nether est un minerai contenant du quartz du Nether. Il se trouve généralement autour de la netherrack dans le Nether. Netherrack=Netherrack Netherrack is a stone-like block home to the Nether. Starting a fire on this block will create an eternal fire.=La netherrack est un bloc de pierre originaire du Nether. Démarrer un feu sur ce bloc créera un feu éternel. -Magma Block=Bloc de Magma +Magma Block=Bloc de magma Magma blocks are hot solid blocks which hurt anyone standing on it, unless they have fire resistance. Starting a fire on this block will create an eternal fire.=Les blocs de magma sont des blocs solides chauds qui blessent quiconque s'y tient, à moins d'avoir une résistance au feu. Démarrer un feu sur ce bloc créera un feu éternel. @1 stood too long on a magma block.=@1 s'est tenu trop longtemps sur un bloc de magma. Soul Sand=Sable des âmes -Soul sand is a block from the Nether. One can only slowly walk on soul sand. The slowing effect is amplified when the soul sand is on top of ice, packed ice or a slime block.=Le sable de l'âme est un bloc du Nether. On ne peut marcher que lentement sur le sable de l'âme. L'effet de ralentissement est amplifié lorsque le sable de l'âme est au-dessus de la glace, de la glace tassée ou d'un bloc de slime. -Nether Brick Block=Bloc de Briques du Nether -Red Nether Brick Block=Bloc de Briques Rouges du Nether -Nether Wart Block=Bloc de Verrues du Nether +Soul sand is a block from the Nether. One can only slowly walk on soul sand. The slowing effect is amplified when the soul sand is on top of ice, packed ice or a slime block.=Le sable des âmes est un bloc du Nether. On ne peut marcher que lentement sur le sable des âmes. L'effet de ralentissement est amplifié lorsque le sable des âmes est au-dessus de la glace, de la glace tassée ou d'un bloc de slime. +Nether Brick Block=Bloc de briques du Nether +Red Nether Brick Block=Bloc de briques rouges du Nether +Nether Wart Block=Bloc de verrues du Nether A nether wart block is a purely decorative block made from nether wart.=Un bloc de verrues du Nether est un bloc purement décoratif fabriqué à partir de verrues du Nether. -Block of Quartz=Bloc de Quartz -Chiseled Quartz Block=Bloc de Quartz sculpté -Pillar Quartz Block=Bloc de Quartz rayé -Smooth Quartz=Quartz Lisse -Glowstone Dust=Poudre Lumineuse +Block of Quartz=Bloc de quartz +Chiseled Quartz Block=Bloc de quartz sculpté +Pillar Quartz Block=Bloc de quartz rayé +Smooth Quartz=Quartz lisse +Glowstone Dust=Poudre lumineuse Glowstone dust is the dust which comes out of broken glowstones. It is mainly used in crafting.=La poudre lumineuse est la poussière qui sort des pierres lumineuses brisées. Elle est principalement utilisée dans l'artisanat. Nether Quartz=Quartz du Nether Nether quartz is a versatile crafting ingredient.=Le quartz du Nether est un ingrédient artisanal polyvalent. Nether Brick=Brique du Nether Nether bricks are the main crafting ingredient for crafting nether brick blocks and nether fences.=Les briques du Nether sont le principal ingrédient pour la fabrication de blocs de briques et de clôtures du Nether. -Nether Lava Source=Source de Lave du Nether -Flowing Nether Lava=Lave du Nether en mouvement -Premature Nether Wart (Stage 1)=Verrue du Néant prématurée (étape 1) -A premature nether wart has just recently been planted on soul sand. Nether wart slowly grows on soul sand in 4 stages (the second and third stages look identical). Although nether wart is home to the Nether, it grows in any dimension.=Une verrue du Nether prématurée vient d'être plantée sur du sable d'âme. La verrue du Nether pousse lentement sur le sable de l'âme en 4 étapes (les deuxième et troisième étapes semblent identiques). Bien que la verrue du Nether soit originaire du Nether, elle se développe dans toutes les dimensions. +Nether Lava Source=Source de lave du Nether +Flowing Nether Lava=Lave du Nether en mouvement +Premature Nether Wart (Stage 1)=Verrue du Nether prématurée (étape 1) +A premature nether wart has just recently been planted on soul sand. Nether wart slowly grows on soul sand in 4 stages (the second and third stages look identical). Although nether wart is home to the Nether, it grows in any dimension.=Une verrue du Nether prématurée vient d'être plantée sur du sable des âmes. La verrue du Nether pousse lentement sur le sable des âmes en 4 étapes (les deuxième et troisième étapes semblent identiques). Bien que la verrue du Nether soit originaire du Nether, elle se développe dans toutes les dimensions. Premature Nether Wart (Stage 2)=Verrue du Nether prématurée (étape 2) Premature Nether Wart (Stage 3)=Verrue du Nether prématurée (étape 3) -Mature Nether Wart=Verrue du Nether Mature +Mature Nether Wart=Verrue du Nether mature The mature nether wart is a plant from the Nether and reached its full size and won't grow any further. It is ready to be harvested for its items.=La verrue du Nether mature est une plante du Nether qui a atteint sa taille maximale et ne poussera plus. Elle est prête à être récoltée. Nether Wart=Verrues du Nether -Nether warts are plants home to the Nether. They can be planted on soul sand and grow in 4 stages.=Les verrues du Nether sont des plantes originaires du Nether. Elles peuvent être plantées sur du sable d'âme et se développer en 4 étapes. -Place this item on soul sand to plant it and watch it grow.=Placez cet article sur du sable d'âme pour le planter et regardez-le grandir. +Nether warts are plants home to the Nether. They can be planted on soul sand and grow in 4 stages.=Les verrues du Nether sont des plantes originaires du Nether. Elles peuvent être plantées sur du sable des âmes et se développer en 4 étapes. +Place this item on soul sand to plant it and watch it grow.=Placez cet article sur du sable des âmes pour le planter et regardez-le grandir. Burns your feet=Vous brûle les pieds -Grows on soul sand=Pousse sur le sable de l'âme +Grows on soul sand=Pousse sur le sable des âmes Reduces walking speed=Réduit la vitesse de marche Netherite Scrap=Fragments de netherite Netherite Ingot=Lingot de netherite diff --git a/mods/ITEMS/mcl_ocean/locale/mcl_ocean.fr.tr b/mods/ITEMS/mcl_ocean/locale/mcl_ocean.fr.tr index a1b3f0b77..7521ff74c 100644 --- a/mods/ITEMS/mcl_ocean/locale/mcl_ocean.fr.tr +++ b/mods/ITEMS/mcl_ocean/locale/mcl_ocean.fr.tr @@ -1,51 +1,51 @@ # textdomain: mcl_ocean Sea Lantern=Lanterne aquatique -Sea lanterns are decorative light sources which look great underwater but can be placed anywhere.=Les lanternes marines sont des sources lumineuses décoratives qui ont fière allure sous l'eau mais peuvent être placées n'importe où. +Sea lanterns are decorative light sources which look great underwater but can be placed anywhere.=Les lanternes aquatiques sont des sources lumineuses décoratives qui ont fière allure sous l'eau mais peuvent être placées n'importe où. Prismarine=Prismarine -Prismarine is used as a building block. It slowly changes its color.=La prismarine est utilisée comme bloc de construction. Il change lentement de couleur. -Prismarine Bricks=Prismarine Taillée -Dark Prismarine=Prismarine Sombre -Prismarine Crystals=Cristaux de Prismarine -Prismarine Shard=Éclat de Prismarine -Dried Kelp=Algue Séchée -Dried Kelp Block=Bloc d'Algue Séchée -Brain Coral Block=Bloc de Corail -Brain Coral Fan=Gorgone de Corail -Brain Coral=Corail -Bubble Coral Block=Bloc de Corail Bulles -Bubble Coral Fan=Gorgone de Corail Bulles -Bubble Coral=Corail Bulles -Fire Coral Block=Bloc Corail de Feu -Fire Coral Fan=Gorgone Corail de Feu -Fire Coral=Corail de Feu -Horn Coral Block=Bloc de Corail Corné -Horn Coral Fan=Gorgone de Corail Corné -Horn Coral=Corail Corné -Tube Coral Block=Bloc de Corail Tubulaire -Tube Coral Fan=Gorgone de Corail Tubulaire -Tube Coral=Corail Tubulaire -Dead Brain Coral Block=Bloc de Corail Mort -Dead Brain Coral Fan=Gorgone de Corail Mort -Dead Brain Coral=Corail Mort -Dead Bubble Coral Block=Bloc de Corail Bulles Mort -Dead Bubble Coral Fan=Gorgone de Corail Bulles Mort -Dead Bubble Coral=Corail Bulles Mort -Dead Fire Coral Block=Bloc de Corail de Feu Mort -Dead Fire Coral Fan=Gorgone de Corail de Feu Mort -Dead Fire Coral=Corail de Feu Mort -Dead Horn Coral Block=Bloc de Corail Corné Mort -Dead Horn Coral Fan=Gorgone de Corail Corné Mort -Dead Horn Coral=Corail Corné Mort -Dead Tube Coral Block=Bloc de Corail Tubulaire Mort -Dead Tube Coral Fan=Gorgone de Corail Tubulaire Mort -Dead Tube Coral=Corail Tubulaire Mort +Prismarine is used as a building block. It slowly changes its color.=La prismarine est utilisée comme bloc de construction. Elle change lentement de couleur. +Prismarine Bricks=Prismarine taillée +Dark Prismarine=Prismarine sombre +Prismarine Crystals=Cristaux de prismarine +Prismarine Shard=Éclat de prismarine +Dried Kelp=Algue séchée +Dried Kelp Block=Bloc d'algue séchée +Brain Coral Block=Bloc de corail cerveau +Brain Coral Fan=Gorgone de corail cerveau +Brain Coral=Corail cerveau +Bubble Coral Block=Bloc de corail bulles +Bubble Coral Fan=Gorgone de corail bulles +Bubble Coral=Corail bulles +Fire Coral Block=Bloc de corail de feu +Fire Coral Fan=Gorgone de corail de feu +Fire Coral=Corail de feu +Horn Coral Block=Bloc de corail corné +Horn Coral Fan=Gorgone de corail corné +Horn Coral=Corail corné +Tube Coral Block=Bloc de corail tubulaire +Tube Coral Fan=Gorgone de corail tubulaire +Tube Coral=Corail tubulaire +Dead Brain Coral Block=Bloc de corail cerveau mort +Dead Brain Coral Fan=Gorgone de corail cerveau mort +Dead Brain Coral=Corail cerveau mort +Dead Bubble Coral Block=Bloc de corail bulles mort +Dead Bubble Coral Fan=Gorgone de corail bulles mort +Dead Bubble Coral=Corail bulles mort +Dead Fire Coral Block=Bloc de corail de feu mort +Dead Fire Coral Fan=Gorgone de corail de feu mort +Dead Fire Coral=Corail de feu mort +Dead Horn Coral Block=Bloc de corail corné mort +Dead Horn Coral Fan=Gorgone de corail corné mort +Dead Horn Coral=Corail corné mort +Dead Tube Coral Block=Bloc de corail tubulaire mort +Dead Tube Coral Fan=Gorgone de corail tubulaire mort +Dead Tube Coral=Corail tubulaire mort Seagrass=Herbe aquatique Kelp=Algue -Kelp grows inside water on top of dirt, sand or gravel.=Les Algues pousse à l'intérieur de l'eau sur la terre, le sable ou le gravier. +Kelp grows inside water on top of dirt, sand or gravel.=Les algues poussent dans l'eau sur la terre, le sable ou le gravier. Coral blocks live in the oceans and need a water source next to them to survive. Without water, they die off.=Les blocs de corail vivent dans les océans et ont besoin d'une source d'eau à côté d'eux pour survivre. Sans eau, ils meurent. -Corals grow on top of coral blocks and need to be inside a water source to survive. Without water, it will die off, as well as the coral block below.=Les coraux se développent au-dessus des blocs de corail et doivent être à l'intérieur d'une source d'eau pour survivre. Sans eau, il mourra, ainsi que le bloc de corail en dessous. -Corals fans grow on top of coral blocks and need to be inside a water source to survive. Without water, it will die off, as well as the coral block below.=Les gorgones de coraux se développent au-dessus des blocs de corail et doivent être à l'intérieur d'une source d'eau pour survivre. Sans eau, il mourra, ainsi que le bloc de corail en dessous. -Seagrass grows inside water on top of dirt, sand or gravel.=Les herbiers aquatique poussent à l'intérieur de l'eau sur la terre, le sable ou le gravier. +Corals grow on top of coral blocks and need to be inside a water source to survive. Without water, it will die off, as well as the coral block below.=Les coraux se développent au-dessus des blocs de corail et doivent être dans une source d'eau pour survivre. Sans eau, il mourra, ainsi que le bloc de corail en dessous. +Corals fans grow on top of coral blocks and need to be inside a water source to survive. Without water, it will die off, as well as the coral block below.=Les gorgones de corail se développent au-dessus des blocs de corail et doivent être dans une source d'eau pour survivre. Sans eau, elle mourra, ainsi que le bloc de corail en dessous. +Seagrass grows inside water on top of dirt, sand or gravel.=Les herbiers aquatique poussent dans l'eau sur la terre, le sable ou le gravier. A decorative block that serves as a great furnace fuel.=Un bloc décoratif qui sert de bon combustible pour le four. Dried kelp is a food item.=L'algue séchée est un aliment. Grows on coral block of same species=Pousse sur un bloc de corail de la même espèce @@ -53,7 +53,7 @@ Needs water to live=A besoin d'eau pour vivre Grows in water on dirt, sand, gravel=Pousse dans l'eau sur la terre, le sable et le gravier Glows in the water=Brille dans l'eau 4 possible sizes=4 tailles possibles -Grows on dead brain coral block=Pousse sur un bloc de corail mort +Grows on dead brain coral block=Pousse sur un bloc de corail cerveau mort Sea Pickle=Cornichon de mer -Sea pickles grow on dead brain coral blocks and provide light when underwater. They come in 4 sizes that vary in brightness.=Les cornichons de mer poussent sur des blocs de corail morts et fournissent de la lumière lorsqu'ils sont sous l'eau. Ils viennent en 4 tailles qui varient en luminosité. -It can only be placed on top of dead brain coral blocks. Placing a sea pickle on another sea pickle will make it grow and brighter.=Il ne peut être placé que sur des blocs de corail morts. Placer un cornichon sur un autre cornichon le rendra plus brillant et plus brillant. \ No newline at end of file +Sea pickles grow on dead brain coral blocks and provide light when underwater. They come in 4 sizes that vary in brightness.=Les cornichons de mer poussent sur des blocs de corail cerveau mort et fournissent de la lumière lorsqu'ils sont sous l'eau. Ils viennent en 4 tailles qui varient en luminosité. +It can only be placed on top of dead brain coral blocks. Placing a sea pickle on another sea pickle will make it grow and brighter.=Il ne peut être placé que sur des blocs de corail cerveau mort. Placer un cornichon sur un autre cornichon le rendra plus grand et plus brillant. diff --git a/mods/ITEMS/mcl_portals/README.md b/mods/ITEMS/mcl_portals/README.md index d3faaa8e2..4d00275b3 100644 --- a/mods/ITEMS/mcl_portals/README.md +++ b/mods/ITEMS/mcl_portals/README.md @@ -1,4 +1,4 @@ -# Portals mod for MineClone 2 +# Portals mod for VoxeLibre ## How to create portals Nether portal: Build an upright frame of obsidian, 4 blocks wide and 5 blocks high, and use a flint and steel inside it. @@ -8,7 +8,7 @@ End portal: Build an upright frame of red nether brick blocks, 4 blocks wide and Created by maikerumine and Wuzzy. Code license: MIT License (see `LICENSE`). -Texture license: See README.md in main MineClone 2 directory. +Texture license: See README.md in main VoxeLibre directory. `mcl_portals_teleport.ogg` * License: [CC BY 3.0](http://creativecommons.org/licenses/by/3.0/) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 64f54a080..d261b4bd3 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -20,10 +20,10 @@ end -- Resources --- Issue that has a lot of context: https://git.minetest.land/MineClone2/MineClone2/issues/4120 +-- Issue that has a lot of context: https://git.minetest.land/VoxeLibre/VoxeLibre/issues/4120 -- Minecraft portal mechanics: https://minecraft.fandom.com/wiki/Tutorials/Nether_portals -- Flow diagram: https://docs.google.com/drawings/d/1WIl4pVuxgOxI3Ncxk4g6D1pL4Fyll3bQ-fX6L9yyiLw/edit --- Useful boundaries: https://git.minetest.land/MineClone2/MineClone2/wiki/World-structure%3A-positions%2C-boundaries%2C-blocks%2C-chunks%2C-dimensions%2C-barriers-and-the-void +-- Useful boundaries: https://git.minetest.land/VoxeLibre/VoxeLibre/wiki/World-structure%3A-positions%2C-boundaries%2C-blocks%2C-chunks%2C-dimensions%2C-barriers-and-the-void -- Setup diff --git a/mods/ITEMS/mcl_potions/API.md b/mods/ITEMS/mcl_potions/API.md new file mode 100644 index 000000000..2bcef0c71 --- /dev/null +++ b/mods/ITEMS/mcl_potions/API.md @@ -0,0 +1,346 @@ +## Potions and Effects API + + +* [Potions and Effects API](#potions-and-effects-api) + * [Namespace](#namespace) + * [Effects](#effects) + * [Functions](#functions) + * [Deprecated Functions](#deprecated-functions) + * [Tables](#tables) + * [Internally registered effects](#internally-registered-effects) + * [Constants](#constants) + * [Effect Definition](#effect-definition) + * [HP Hudbar Modifiers](#hp-hudbar-modifiers) + * [Functions](#functions) + * [HP Hudbar Modifier Definition](#hp-hudbar-modifier-definition) + * [Potions](#potions) + * [Functions](#functions) + * [Tables](#tables) + * [Internally registered potions](#internally-registered-potions) + * [Constants](#constants) + * [Potion Definition](#potion-definition) + * [Brewing](#brewing) + * [Functions](#functions) + * [Miscellaneous Functions](#miscellaneous-functions) + + +### Namespace +All of the API is defined in the `mcl_potions` namespace. + +### Effects +This section describes parts of the API related to defining and managing effects on players and entities. The mod defines a bunch of effects internally using the same API as described below. + +#### Functions +`mcl_potions.register_effect(def)` – takes an effect definition (`def`) and registers an effect if the definition is valid, and adds the known parts of the definition as well as the outcomes of processing of some parts of the definition to the `mcl_potions.registered_effects` table. This should only be used at load time. + + +`mcl_potions.apply_haste_fatigue(toolcaps, h_fac, f_fac)` – takes a table of tool capabilities (`toolcaps`) and modifies it using the provided haste factor (`h_fac`) and fatigue factor (`f_fac`). The factors default to no-op values. + + +`mcl_potions.hf_update_internal(hand, object)` – returns the `hand` of the `object` updated according to their combined haste and fatigue. **This doesn't change anything by itself!** Manual update of the hand with the hand returned by this function has to be done. This should only be called in situations that are *directly* impacted by haste and/or fatigue, and therefore require an update of the hand. + + +`mcl_potions.update_haste_and_fatigue(player)` – updates haste and fatigue on a `player` (described by an ObjectRef). This should be called whenever an update of the haste-type and fatigue-type effects is desired. + + +`mcl_potions._reset_haste_fatigue_item_meta(player)` – resets the item meta changes caused by haste-type and fatigue-type effects throughout the inventory of the `player` described by an ObjectRef. + + +`mcl_potions._clear_cached_effect_data(object)` – clears cashed effect data for the `object`. This shouldn't be used for resetting effects. + + +`mcl_potions._reset_effects(object, set_hud)` – actually resets the effects for the `object`. It also updates HUD if `set_hud` is `true` or undefined (`nil`). + + +`mcl_potions._save_player_effects(player)` – saves all effects of the `player` described by an ObjectRef to metadata. + + +`mcl_potions._load_player_effects(player)` – loads all effects from the metadata of the `player` described by an ObjectRef. + + +`mcl_potions._load_entity_effects(entity)` – loads all effects from the `entity` (a LuaEntity). + + +`mcl_potions.has_effect(object, effect_name)` – returns `true` if `object` (described by an ObjectRef) has the effect of the ID `effect_name`, `false` otherwise. + + +`mcl_potions.get_effect(object, effect_name)` - returns a table containing values of the effect of the ID `effect_name` on the `object` if the object has the named effect, `false` otherwise. + +* table returned by the above function is like this: +```lua + effect = { + dur = float -- duration of the effect in seconds, may be infinite + timer = float -- how much of the duration (in seconds) has already elapsed + no_particles = bool -- if this is true, no particles signifying this effect will appear + + -- player-only fields + hud_index = int -- position in the HUD used by this effect (icon, level, timer) - probably meaningless outside mcl_potions + + -- optional fields + factor = float -- power of the effect if the effect uses factor; this may mean different things depending on the effect + step = float -- how often (in seconds) the on_step() function of the effect is executed, if it exists + hit_timer = float -- how much of the step (in seconds) has already elapsed + + -- effect-specific fields + -- effects in mcl_potions have their own fields here, for now external effects can't add any here + blocked = bool -- used by conduit power + high = bool -- used by nausea + vignette = int -- handle to the HUD vignette of the effect, used by effects that use one + absorb = float -- "HP" of the absorption effect + waypoints = table -- used by glowing, indexed by player ObjectRef, contains HUD handles for the glowing waypoints + flash = float -- used by darkness, denotes vision range modifier + flashdir = bool -- used by darkness, denotes whether vision range is increasing (or decreasing) + } +``` + + +`mcl_potions.get_effect_level(object, effect_name)` – returns the level of the effect of the ID `effect_name` on the `object`. If the effect has no levels, returns `1`. If the object doesn't have the effect, returns `0`. If the effect is not registered, returns `nil`. + + +`mcl_potions.get_total_haste(object)` – returns the total haste of the `object` (from all haste-type effects). + + +`mcl_potions.get_total_fatigue(object)` – returns the total fatigue of the `object` (from all fatigue-type effects). + + +`mcl_potions.clear_effect(object, effect)` – attempts to remove the effect of the ID `effect` from the `object`. If the effect is not registered, logs a warning and returns `false`. Otherwise, returns `nil`. + + +`mcl_potions.make_invisible(obj_ref, hide)` – makes the object going by the `obj_ref` invisible if `hide` is true, visible otherwise. + + +`mcl_potions.register_generic_resistance_predicate(predicate)` – registers an arbitrary effect resistance predicate. This can be used e.g. to make some entity resistant to all (or some) effects under specific conditions. + +* `predicate` – `function(object, effect_name)` - return `true` if `object` resists effect of the ID `effect_name` + + +`mcl_potions.give_effect(name, object, factor, duration, no_particles)` – attempts to give effect of the ID `name` to the `object` with the provided `factor` and `duration`. If `no_particles` is `true`, no particles will be emitted from the object when under the effect. If the effect is not registered, target is invalid (or resistant), or the same effect with more potency is already applied to the target, this function does nothing and returns `false`. On success, this returns `true`. + + +`mcl_potions.give_effect_by_level(name, object, level, duration, no_particles)` – attempts to give effect of the ID `name` to the `object` with the provided `level` and `duration`. If `no_particles` is `true`, no particles will be emitted from the object when under the effect. This converts `level` to factor and calls `mcl_potions.give_effect()` internally, returning the return value of that function. `level` equal to `0` is no-op. + + +`mcl_potions.healing_func(object, hp)` – attempts to heal the `object` by `hp`. Negative `hp` harms magically instead. + + +#### Deprecated functions +**Don't use the following functions, use the above API instead!** The following are only provided for backwards compatibility and will be removed later. They all call `mcl_potions.give_effect()` internally. + +* `mcl_potions.strength_func(object, factor, duration)` +* `mcl_potions.leaping_func(object, factor, duration)` +* `mcl_potions.weakness_func(object, factor, duration)` +* `mcl_potions.swiftness_func(object, factor, duration)` +* `mcl_potions.slowness_func(object, factor, duration)` +* `mcl_potions.withering_func(object, factor, duration)` +* `mcl_potions.poison_func(object, factor, duration)` +* `mcl_potions.regeneration_func(object, factor, duration)` +* `mcl_potions.invisiblility_func(object, null, duration)` +* `mcl_potions.water_breathing_func(object, null, duration)` +* `mcl_potions.fire_resistance_func(object, null, duration)` +* `mcl_potions.night_vision_func(object, null, duration)` +* `mcl_potions.bad_omen_func(object, factor, duration)` + + + +#### Tables +`mcl_potions.registered_effects` – contains all effects that have been registered. You can read from it various data about the effects. You can overwrite the data and alter the effects' definitions too, but this is discouraged, i.e. only do this if you really know what you are doing. You shouldn't add effects directly to this table, as this would skip important setup; instead use the `mcl_potions.register_effect()` function, which is described above. + +#### Internally registered effects +You can't register effects going by these names, because they are already used: + +* `invisibility` +* `poison` +* `regeneration` +* `strength` +* `weakness` +* `weakness` +* `dolphin_grace` +* `leaping` +* `slow_falling` +* `swiftness` +* `slowness` +* `levitation` +* `night_vision` +* `darkness` +* `glowing` +* `health_boost` +* `absorption` +* `fire_resistance` +* `resistance` +* `luck` +* `bad_luck` +* `bad_omen` +* `hero_of_village` +* `withering` +* `frost` +* `blindness` +* `nausea` +* `food_poisoning` +* `saturation` +* `haste` +* `fatigue` +* `conduit_power` + +#### Constants +`mcl_potions.LONGEST_MINING_TIME` – longest mining time of one block that can be achieved by slowing down the mining by fatigue-type effects. + +`mcl_potions.LONGEST_PUNCH_INTERVAL` – longest punch interval that can be achieved by slowing down the punching by fatigue-type effects. + +#### Effect Definition +```lua +def = { +-- required parameters in def: + name = string -- effect name in code (unique ID) - can't be one of the reserved words ("list", "heal", "remove", "clear") + description = S(string) -- actual effect name in game +-- optional parameters in def: + get_tt = function(factor) -- returns tooltip description text for use with potions + icon = string -- file name of the effect icon in HUD - defaults to one based on name + res_condition = function(object) -- returning true if target is to be resistant to the effect + on_start = function(object, factor) -- called when dealing the effect + on_load = function(object, factor) -- called on_joinplayer and on_activate + on_step = function(dtime, object, factor, duration) -- running every step for all objects with this effect + on_hit_timer = function(object, factor, duration) -- if defined runs a hit_timer depending on timer_uses_factor value + on_end = function(object) -- called when the effect wears off + after_end = function(object) -- called when the effect wears off, after purging the data of the effect + on_save_effect = function(object -- called when the effect is to be serialized for saving (supposed to do cleanup) + particle_color = string -- colorstring for particles - defaults to #3000EE + uses_factor = bool -- whether factor affects the effect + lvl1_factor = number -- factor for lvl1 effect - defaults to 1 if uses_factor + lvl2_factor = number -- factor for lvl2 effect - defaults to 2 if uses_factor + timer_uses_factor = bool -- whether hit_timer uses factor (uses_factor must be true) or a constant value (hit_timer_step must be defined) + hit_timer_step = float -- interval between hit_timer hits + damage_modifier = string -- damage flag of which damage is changed as defined by modifier_func, pass empty string for all damage + dmg_mod_is_type = bool -- damage_modifier string is used as type instead of flag of damage, defaults to false + modifier_func = function(damage, effect_vals) -- see damage_modifier, if not defined damage_modifier defaults to 100% resistance + modifier_priority = integer -- priority passed when registering damage_modifier - defaults to -50 + affects_item_speed = table +-- -- if provided, effect gets added to the item_speed_effects table, this should be true if the effect affects item speeds, +-- -- otherwise it won't work properly with other such effects (like haste and fatigue) +-- -- -- factor_is_positive - bool - whether values of factor between 0 and 1 should be considered +factor% or speed multiplier +-- -- -- - obviously +factor% is positive and speed multiplier is negative interpretation +-- -- -- - values of factor higher than 1 will have a positive effect regardless +-- -- -- - values of factor lower than 0 will have a negative effect regardless +} +``` + +### HP Hudbar Modifiers +This part of the API allows complex modification of the HP hudbar. It is mainly required here, so it is defined here. It may be moved to a different mod in the future. + +#### Functions +`mcl_potions.register_hp_hudbar_modifier(def)` – this function takes a modifier definition (`def`, described below) and registers a HP hudbar modifier if the definition is valid. + +#### HP Hudbar Modifier Definition +```lua +def = { +-- required parameters in def: + predicate = function(player) -- returns true if player fulfills the requirements (eg. has the effects) for the hudbar look + icon = string -- name of the icon to which the modifier should change the HP hudbar heart + priority = signed_int -- lower gets checked first, and first fulfilled predicate applies its modifier +} +``` + +### Potions +Magic! + +#### Functions +`mcl_potions.register_potion(def)` – takes a potion definition (`def`) and registers a potion if the definition is valid, and adds the known parts of the definition as well as the outcomes of processing of some parts of the definition to the `mcl_potions.registered_effects` table. This, depending on some fields of the definition, may as well register the corresponding splash potion, lingering potion and tipped arrow. This should only be used at load time. + +`mcl_potions.register_splash(name, descr, color, def)` – registers a splash potion (item and entity when thrown). This is mostly part of the internal API and probably shouldn't be used from outside, therefore not providing exact description. This is used by `mcl_potions.register_potion()`. + +`mcl_potions.register_lingering(name, descr, color, def)` – registers a lingering potion (item and entity when thrown). This is mostly part of the internal API and probably shouldn't be used from outside, therefore not providing exact description. This is used by `mcl_potions.register_potion()`. + +`mcl_potions.register_arrow(name, desc, color, def)` – registers a tipped arrow (item and entity when shot). This is mostly part of the internal API and probably shouldn't be used from outside, therefore not providing exact description. This is used by `mcl_potions.register_potion()`. + +#### Tables +`mcl_potions.registered_potions` – contains all potions that have been registered. You can read from it various data about the potions. You can overwrite the data and alter the definitions too, but this is discouraged, i.e. only do this if you really know what you are doing. You shouldn't add potions directly to this table, because they have to be registered as items too; instead use the `mcl_potions.register_potion()` function, which is described above. Some brewing recipes are autofilled based on this table after the loading of all the mods is done. + +#### Constants +* `mcl_potions.POTENT_FACTOR = 2` +* `mcl_potions.PLUS_FACTOR = 8/3` +* `mcl_potions.INV_FACTOR = 0.50` +* `mcl_potions.DURATION = 180` +* `mcl_potions.DURATION_INV = mcl_potions.DURATION * mcl_potions.INV_FACTOR` +* `mcl_potions.DURATION_POISON = 45` +* `mcl_potions.II_FACTOR = mcl_potions.POTENT_FACTOR` – **DEPRECATED** +* `mcl_potions.DURATION_PLUS = mcl_potions.DURATION * mcl_potions.PLUS_FACTOR` – **DEPRECATED** +* `mcl_potions.DURATION_2 = mcl_potions.DURATION / mcl_potions.II_FACTOR` – **DEPRECATED** +* `mcl_potions.SPLASH_FACTOR = 0.75` +* `mcl_potions.LINGERING_FACTOR = 0.25` + +#### Potion Definition +```lua +def = { +-- required parameters in def: + name = string, -- potion name in code +-- optional parameters in def: + desc_prefix = S(string), -- part of visible potion name, comes before the word "Potion" + desc_suffix = S(string), -- part of visible potion name, comes after the word "Potion" + _tt = S(string), -- custom tooltip text + _dynamic_tt = function(level), -- returns custom tooltip text dependent on potion level + _longdesc = S(string), -- text for in=game documentation + stack_max = int, -- max stack size - defaults to 1 + image = string, -- name of a custom texture of the potion icon + color = string, -- colorstring for potion icon when image is not defined - defaults to #0000FF + groups = table, -- item groups definition for the regular potion, not splash or lingering - +-- - must contain _mcl_potion=1 for tooltip to include dynamic_tt and effects +-- - defaults to {brewitem=1, food=3, can_eat_when_full=1, _mcl_potion=1} + nocreative = bool, -- adds a not_in_creative_inventory=1 group - defaults to false + _effect_list = {, -- all the effects dealt by the potion in the format of tables +-- -- the name of each sub-table should be a name of a registered effect, and fields can be the following: + uses_level = bool, -- whether the level of the potion affects the level of the effect - +-- -- -- - defaults to the uses_factor field of the effect definition + level = int, -- used as the effect level if uses_level is false and for lvl1 potions - defaults to 1 + level_scaling = int, -- used as the number of effect levels added per potion level - defaults to 1 - +-- -- -- - this has no effect if uses_level is false + dur = float, -- duration of the effect in seconds - defaults to mcl_potions.DURATION + dur_variable = bool, -- whether variants of the potion should have the length of this effect changed - +-- -- -- - defaults to true +-- -- -- - if at least one effect has this set to true, the potion has a "plus" variant + effect_stacks = bool, -- whether the effect stacks - defaults to false + } + uses_level = bool, -- whether the potion should come at different levels - +-- - defaults to true if uses_level is true for at least one effect, else false + drinkable = bool, -- defaults to true + has_splash = bool, -- defaults to true + has_lingering = bool, -- defaults to true + has_arrow = bool, -- defaults to false + has_potent = bool, -- whether there is a potent (e.g. II) variant - defaults to the value of uses_level + default_potent_level = int, -- potion level used for the default potent variant - defaults to 2 + default_extend_level = int, -- extention level (amount of +) used for the default extended variant - defaults to 1 + custom_on_use = function(user, level), -- called when the potion is drunk, returns true on success + custom_effect = function(object, level, plus), -- called when the potion effects are applied, returns true on success + custom_splash_effect = function(pos, level), -- called when the splash potion explodes, returns true on success + custom_linger_effect = function(pos, radius, level), -- called on the lingering potion step, returns true on success +} +``` + +### Brewing +Functions supporting brewing potions, used by the `mcl_brewing` module, which calls `mcl_potions.get_alchemy()`. + +#### Functions +`mcl_potions.register_ingredient_potion(input, out_table)` – registers a potion (`input`, item string) that can be combined with multiple ingredients for different outcomes; `out_table` contains the recipes for those outcomes + +`mcl_potions.register_water_brew(ingr, potion)` – registers a `potion` (item string) brewed from water with a specific ingredient (`ingr`) + +`mcl_potions.register_awkward_brew(ingr, potion)` – registers a `potion` (item string) brewed from an awkward potion with a specific ingredient (`ingr`) + +`mcl_potions.register_mundane_brew(ingr, potion)` – registers a `potion` (item string) brewed from a mundane potion with a specific ingredient (`ingr`) + +`mcl_potions.register_thick_brew(ingr, potion)` – registers a `potion` (item string) brewed from a thick potion with a specific ingredient (`ingr`) + +`mcl_potions.register_table_modifier(ingr, modifier)` – registers a brewing recipe altering the potion using a table; this is supposed to substitute one item with another + +`mcl_potions.register_inversion_recipe(input, output)` – what it says + +`mcl_potions.register_meta_modifier(ingr, mod_func)` – registers a brewing recipe altering the potion using a function; this is supposed to be a recipe that changes metadata only + +`mcl_potions.get_alchemy(ingr, pot)` – finds an alchemical recipe for given ingredient and potion; returns outcome + +### Miscellaneous Functions +`mcl_potions._extinguish_nearby_fire(pos, radius)` – attempts to extinguish fires in an area, both on objects and nodes. + +`mcl_potions._add_spawner(obj, color)` – adds a particle spawner denoting an effect being in action. + +`mcl_potions._use_potion(obj, color)` – visual and sound effects of drinking a potion. + +`mcl_potions.is_obj_hit(self, pos)` – determines if an object is hit (by a thrown potion). diff --git a/mods/ITEMS/mcl_potions/README.txt b/mods/ITEMS/mcl_potions/README.txt index 7ebe4ba6c..0bc98bcff 100644 --- a/mods/ITEMS/mcl_potions/README.txt +++ b/mods/ITEMS/mcl_potions/README.txt @@ -1,5 +1,5 @@ License information: * Code: MIT License -* Textures: See main MineClone 2 README.md file +* Textures: See main VoxeLibre README.md file * Sounds: CC0 diff --git a/mods/ITEMS/mcl_potions/commands.lua b/mods/ITEMS/mcl_potions/commands.lua index 10bf86311..1c2cd7347 100644 --- a/mods/ITEMS/mcl_potions/commands.lua +++ b/mods/ITEMS/mcl_potions/commands.lua @@ -8,23 +8,9 @@ local S = minetest.get_translator(minetest.get_current_modname()) -- ░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░  ░╚════╝░░╚════╝░╚═╝░░░░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═════╝░╚═════╝░ -local get_chat_function = {} - -get_chat_function["poison"] = mcl_potions.poison_func -get_chat_function["regeneration"] = mcl_potions.regeneration_func -get_chat_function["invisibility"] = mcl_potions.invisiblility_func -get_chat_function["fire_resistance"] = mcl_potions.fire_resistance_func -get_chat_function["night_vision"] = mcl_potions.night_vision_func -get_chat_function["water_breathing"] = mcl_potions.water_breathing_func -get_chat_function["leaping"] = mcl_potions.leaping_func -get_chat_function["swiftness"] = mcl_potions.swiftness_func -get_chat_function["heal"] = mcl_potions.healing_func -get_chat_function["bad_omen"] = mcl_potions.bad_omen_func -get_chat_function["withering"] = mcl_potions.withering_func - minetest.register_chatcommand("effect",{ - params = S(" []"), - description = S("Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 = 100%)"), + params = S("|heal|list|clear|remove |INF [] [] [NOPART]"), + description = S("Add a status effect to yourself. Arguments: : name of status effect. Passing \"list\" as effect name lists available effects. Passing \"heal\" as effect name heals (or harms) by amount designed by the next parameter. Passing \"clear\" as effect name removes all effects. Passing \"remove\" as effect name removes the effect named by the next parameter. : duration in seconds. Passing \"INF\" as duration makes the effect infinite. (: amount of healing when the effect is \"heal\", passing a negative value subtracts health. : name of a status effect to be removed when using \"remove\" as the previous parameter.) : effect power determinant, bigger level results in more powerful effect for effects that depend on the level (no changes for other effects), defaults to 1, pass F to use low-level factor instead. : effect strength modifier, can mean different things depending on the effect, no changes for effects that do not depend on level/factor. NOPART at the end means no particles will be shown for this effect."), privs = {server = true}, func = function(name, params) @@ -37,22 +23,93 @@ minetest.register_chatcommand("effect",{ if not P[1] then return false, S("Missing effect parameter!") - elseif not tonumber(P[2]) then + elseif P[1] == "list" then + local effects = "heal" + for effect, _ in pairs(mcl_potions.registered_effects) do + effects = effects .. ", " .. effect + end + return true, effects + elseif P[1] == "heal" then + local hp = tonumber(P[2]) + if not hp or hp == 0 then + return false, S("Missing or invalid heal amount parameter!") + else + mcl_potions.healing_func(minetest.get_player_by_name(name), hp) + if hp > 0 then + if hp < 1 then hp = 1 end + return true, S("Player @1 healed by @2 HP.", name, hp) + else + if hp > -1 then hp = -1 end + return true, S("Player @1 harmed by @2 HP.", name, hp) + end + end + elseif P[1] == "clear" then + mcl_potions._reset_effects(minetest.get_player_by_name(name)) + return true, S("Effects cleared for player @1", name) + elseif P[1] == "remove" then + if not P[2] then + return false, S("Missing effect parameter!") + end + if mcl_potions.registered_effects[P[2]] then + mcl_potions.clear_effect(minetest.get_player_by_name(name), P[2]) + return true, S("Removed effect @1 from player @2", P[2], name) + else + return false, S("@1 is not an available status effect.", P[2]) + end + elseif not tonumber(P[2]) and P[2] ~= "INF" then return false, S("Missing or invalid duration parameter!") - elseif P[3] and not tonumber(P[3]) then - return false, S("Invalid factor parameter!") - end - -- Default factor = 1 - if not P[3] then - P[3] = 1.0 + elseif P[3] and not tonumber(P[3]) and P[3] ~= "F" and P[3] ~= "NOPART" then + return false, S("Invalid level parameter!") + elseif P[3] and P[3] == "F" and not P[4] then + return false, S("Missing or invalid factor parameter when level is F!") end - if get_chat_function[P[1]] then - get_chat_function[P[1]](minetest.get_player_by_name(name), tonumber(P[3]), tonumber(P[2])) - return true + -- Default level = 1 + if not P[3] then + P[3] = 1 + elseif P[3] == "NOPART" then + P[3] = 1 + P[4] = "NOPART" + end + + local inf = P[2] == "INF" + + local nopart = false + if P[3] == "F" then + nopart = P[5] == "NOPART" + else + nopart = P[4] == "NOPART" + end + + local def = mcl_potions.registered_effects[P[1]] + if def then + if P[3] == "F" then + local given = mcl_potions.give_effect(P[1], minetest.get_player_by_name(name), tonumber(P[4]), inf and "INF" or tonumber(P[2]), nopart) + if given then + if def.uses_factor then + return true, S("@1 effect given to player @2 for @3 seconds with factor of @4.", def.description, name, P[2], P[4]) + else + return true, S("@1 effect given to player @2 for @3 seconds.", def.description, name, P[2]) + end + else + return false, S("Giving effect @1 to player @2 failed.", def.description, name) + end + else + local given = mcl_potions.give_effect_by_level(P[1], minetest.get_player_by_name(name), tonumber(P[3]), inf and "INF" or tonumber(P[2]), nopart) + if given then + if def.uses_factor then + return true, S("@1 effect on level @2 given to player @3 for @4 seconds.", def.description, P[3], name, P[2]) + else + return true, S("@1 effect given to player @2 for @3 seconds.", def.description, name, P[2]) + end + else + return false, S("Giving effect @1 to player @2 failed.", def.description, name) + end + end else return false, S("@1 is not an available status effect.", P[1]) end end, }) + diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 24aa2e402..90ac35004 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -1,47 +1,1228 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + local EF = {} -EF.invisible = {} -EF.poisoned = {} -EF.regenerating = {} -EF.strong = {} -EF.weak = {} -EF.water_breathing = {} -EF.leaping = {} -EF.swift = {} -- for swiftness AND slowness -EF.night_vision = {} -EF.fire_proof = {} -EF.bad_omen = {} -EF.withering = {} +mcl_potions.registered_effects = {} +local registered_effects = mcl_potions.registered_effects -- shorthand ref + +-- effects affecting item speed utilize numerous hacks, so they have to be counted separately +local item_speed_effects = {} local EFFECT_TYPES = 0 -for _,_ in pairs(EF) do - EFFECT_TYPES = EFFECT_TYPES + 1 +minetest.register_on_mods_loaded(function() + for _,_ in pairs(EF) do + EFFECT_TYPES = EFFECT_TYPES + 1 + end +end) + +-- ██████╗░███████╗░██████╗░██╗░██████╗████████╗███████╗██████╗ +-- ██╔══██╗██╔════╝██╔════╝░██║██╔════╝╚══██╔══╝██╔════╝██╔══██╗ +-- ██████╔╝█████╗░░██║░░██╗░██║╚█████╗░░░░██║░░░█████╗░░██████╔╝ +-- ██╔══██╗██╔══╝░░██║░░╚██╗██║░╚═══██╗░░░██║░░░██╔══╝░░██╔══██╗ +-- ██║░░██║███████╗╚██████╔╝██║██████╔╝░░░██║░░░███████╗██║░░██║ +-- ╚═╝░░╚═╝╚══════╝░╚═════╝░╚═╝╚═════╝░░░░╚═╝░░░╚══════╝╚═╝░░╚═╝ +-- +-- ███████╗███████╗███████╗███████╗░█████╗░████████╗░██████╗ +-- ██╔════╝██╔════╝██╔════╝██╔════╝██╔══██╗╚══██╔══╝██╔════╝ +-- █████╗░░█████╗░░█████╗░░█████╗░░██║░░╚═╝░░░██║░░░╚█████╗░ +-- ██╔══╝░░██╔══╝░░██╔══╝░░██╔══╝░░██║░░██╗░░░██║░░░░╚═══██╗ +-- ███████╗██║░░░░░██║░░░░░███████╗╚█████╔╝░░░██║░░░██████╔╝ +-- ╚══════╝╚═╝░░░░░╚═╝░░░░░╚══════╝░╚════╝░░░░╚═╝░░░╚═════╝░ + +local function generate_linear_lvl_to_fac(l1, l2) + local a = l2 - l1 + local b = 2*l1 - l2 + return function(level) + return (a*level + b) + end +end + +local function generate_linear_fac_to_lvl(l1, l2) + local a = 1/(l2 - l1) + local b = -(2*l1 - l2) * a + return function(factor) + return math.round(a*factor + b) + end +end + +local function generate_rational_lvl_to_fac(l1, l2) + local a = (l1 - l2) * 2 + local b = 2*l2 - l1 + return function(level) + if level == 0 then return 0 end + return (a/level + b) + end +end + +local function generate_rational_fac_to_lvl(l1, l2) + local a = (l1 - l2) * 2 + local b = 2*l2 - l1 + return function(factor) + if (factor - b) == 0 then return math.huge end + return math.round(a/(factor - b)) + end +end + +local function generate_modifier_func(name, dmg_flag, mod_func, is_type) + if dmg_flag == "" then return function(object, damage, reason) + if EF[name][object] and not reason.flags.bypasses_magic then + return mod_func and mod_func(damage, EF[name][object]) or 0 + end + end + elseif is_type then return function(object, damage, reason) + if EF[name][object] and not reason.flags.bypasses_magic and reason.type == dmg_flag then + return mod_func and mod_func(damage, EF[name][object]) or 0 + end + end + else return function(object, damage, reason) + if EF[name][object] and not reason.flags.bypasses_magic and reason.flags[dmg_flag] then + return mod_func and mod_func(damage, EF[name][object]) or 0 + end + end end +end + +-- API - registers an effect +-- required parameters in def: +-- name - string - effect name in code +-- description - translated string - actual effect name in game +-- optional parameters in def: +-- get_tt - function(factor) - returns tooltip description text for use with potions +-- icon - string - file name of the effect icon in HUD - defaults to one based on name +-- res_condition - function(object) - returning true if target is to be resistant to the effect +-- on_start - function(object, factor) - called when dealing the effect +-- on_load - function(object, factor) - called on_joinplayer and on_activate +-- on_step - function(dtime, object, factor, duration) - running every step for all objects with this effect +-- on_hit_timer - function(object, factor, duration) - if defined runs a hit_timer depending on timer_uses_factor value +-- on_end - function(object) - called when the effect wears off +-- after_end - function(object) - called when the effect wears off, after purging the data of the effect +-- on_save_effect - function(object - called when the effect is to be serialized for saving (supposed to do cleanup) +-- particle_color - string - colorstring for particles - defaults to #3000EE +-- uses_factor - bool - whether factor affects the effect +-- lvl1_factor - number - factor for lvl1 effect - defaults to 1 if uses_factor +-- lvl2_factor - number - factor for lvl2 effect - defaults to 2 if uses_factor +-- timer_uses_factor - bool - whether hit_timer uses factor (uses_factor must be true) or a constant value (hit_timer_step must be defined) +-- hit_timer_step - float - interval between hit_timer hits +-- damage_modifier - string - damage flag of which damage is changed as defined by modifier_func, pass empty string for all damage +-- dmg_mod_is_type - bool - damage_modifier string is used as type instead of flag of damage, defaults to false +-- modifier_func - function(damage, effect_vals) - see damage_modifier, if not defined damage_modifier defaults to 100% resistance +-- modifier_priority - integer - priority passed when registering damage_modifier - defaults to -50 +-- affects_item_speed - table +-- -- if provided, effect gets added to the item_speed_effects table, this should be true if the effect affects item speeds, +-- -- otherwise it won't work properly with other such effects (like haste and fatigue) +-- -- -- factor_is_positive - bool - whether values of factor between 0 and 1 should be considered +factor% or speed multiplier +-- -- -- - obviously +factor% is positive and speed multiplier is negative interpretation +-- -- -- - values of factor higher than 1 will have a positive effect regardless +-- -- -- - values of factor lower than 0 will have a negative effect regardless +-- -- -- - open an issue on our tracker if you have a usage that isn't supported by this API +function mcl_potions.register_effect(def) + local modname = minetest.get_current_modname() + local name = def.name + if name == nil then + error("Unable to register effect: name is nil") + end + if type(name) ~= "string" then + error("Unable to register effect: name is not a string") + end + if name == "list" or name == "heal" or name == "remove" or name == "clear" then + error("Unable to register effect: " .. name .. " is a reserved word") + end + if registered_effects[name] then + error("Effect named "..name.." already registered!") + end + if not def.description or type(def.description) ~= "string" then + error("Unable to register effect: description is not a string") + end + local pdef = {} + pdef.description = def.description + if not def.icon then + pdef.icon = modname.."_effect_"..name..".png" + else + pdef.icon = def.icon + end + pdef.get_tt = def.get_tt + pdef.res_condition = def.res_condition + pdef.on_start = def.on_start + pdef.on_load = def.on_load + pdef.on_step = def.on_step + pdef.on_hit_timer = def.on_hit_timer + pdef.on_end = def.on_end + pdef.on_save_effect = def.on_save_effect + if not def.particle_color then + pdef.particle_color = "#3000EE" + else + pdef.particle_color = def.particle_color + end + if def.uses_factor then + pdef.uses_factor = true + local l1 = def.lvl1_factor or 1 + local l2 = def.lvl2_factor or 2*l1 + if l1 < l2 then + pdef.level_to_factor = generate_linear_lvl_to_fac(l1, l2) + pdef.factor_to_level = generate_linear_fac_to_lvl(l1, l2) + pdef.inv_factor = false + elseif l1 > l2 then + pdef.level_to_factor = generate_rational_lvl_to_fac(l1, l2) + pdef.factor_to_level = generate_rational_fac_to_lvl(l1, l2) + pdef.inv_factor = true + else + error("Can't extrapolate levels from lvl1 and lvl2 bearing the same factor") + end + else + pdef.uses_factor = false + end + if def.on_hit_timer then + if def.timer_uses_factor then + if not def.uses_factor then error("Uses factor but does not use factor?") end + pdef.timer_uses_factor = true + else + if not def.hit_timer_step then error("If hit_timer does not use factor, hit_timer_step must be defined") end + pdef.timer_uses_factor = false + pdef.hit_timer_step = def.hit_timer_step + end + end + if def.damage_modifier then + mcl_damage.register_modifier( + generate_modifier_func(name, def.damage_modifier, def.modifier_func, def.dmg_mod_is_type), + def.modifier_priority or -50 + ) + end + registered_effects[name] = pdef + EF[name] = {} + item_speed_effects[name] = def.affects_item_speed +end + +mcl_potions.register_effect({ + name = "invisibility", + description = S("Invisiblity"), + get_tt = function(factor) + return S("body is invisible") + end, + on_start = function(object, factor) + mcl_potions.make_invisible(object, true) + end, + on_load = function(object, factor) + mcl_potions.make_invisible(object, true) + end, + on_end = function(object) + mcl_potions.make_invisible(object, false) + end, + particle_color = "#7F8392", + uses_factor = false, +}) + +mcl_potions.register_effect({ + name = "poison", + description = S("Poison"), + get_tt = function(factor) + return S("-1 HP / @1 s", factor) + end, + res_condition = function(object) + local entity = object:get_luaentity() + return (entity and (entity.harmed_by_heal or string.find(entity.name, "spider"))) + end, + on_hit_timer = function(object, factor, duration) + if mcl_util.get_hp(object) - 1 > 0 then + mcl_util.deal_damage(object, 1, {type = "magic"}) + end + end, + particle_color = "#4E9331", + uses_factor = true, + lvl1_factor = 1.25, + lvl2_factor = 0.6, + timer_uses_factor = true, +}) + +mcl_potions.register_effect({ + name = "regeneration", + description = S("Regeneration"), + get_tt = function(factor) + return S("+1 HP / @1 s", factor) + end, + res_condition = function(object) + local entity = object:get_luaentity() + return (entity and entity.harmed_by_heal) + end, + on_hit_timer = function(object, factor, duration) + local entity = object:get_luaentity() + if object:is_player() then + object:set_hp(math.min(object:get_properties().hp_max or 20, object:get_hp() + 1), { type = "set_hp", other = "regeneration" }) + elseif entity and entity.is_mob then + entity.health = math.min(entity.hp_max, entity.health + 1) + end + end, + particle_color = "#CD5CAB", + uses_factor = true, + lvl1_factor = 2.5, + lvl2_factor = 1.25, + timer_uses_factor = true, +}) + +mcl_potions.register_effect({ + name = "strength", + description = S("Strength"), + get_tt = function(factor) + return S("+@1% melee damage", 100*(factor-1)) + end, + particle_color = "#932423", + uses_factor = true, + lvl1_factor = 1.3, + lvl2_factor = 1.6, +}) + +mcl_potions.register_effect({ + name = "weakness", + description = S("Weakness"), + get_tt = function(factor) + return S("-@1% melee damage", 100*(1-factor)) + end, + particle_color = "#485D48", + uses_factor = true, + lvl1_factor = 0.8, + lvl2_factor = 0.6, +}) + +-- implementation of strength and weakness effects +-- mobs have this implemented in mcl_mobs/combat.lua in mob_class:on_punch() +mcl_damage.register_modifier(function(object, damage, reason) + if reason.direct and reason.direct == reason.source then + local hitter = reason.direct + local strength = EF.strength[hitter] + local weakness = EF.weakness[hitter] + if not strength and not weakness then return end + local str_fac = strength and strength.factor or 1 + local weak_fac = weakness and weakness.factor or 1 + return damage * str_fac * weak_fac + end +end, 0) + +mcl_potions.register_effect({ + name = "water_breathing", + description = S("Water Breathing"), + get_tt = function(factor) + return S("limitless breathing under water") + end, + res_condition = function(object) + return (not object:is_player()) -- TODO add support for breath setting for mobs + end, + on_step = function(dtime, object, factor, duration) + if object:get_breath() then + hb.hide_hudbar(object, "breath") + if object:get_breath() < 10 then object:set_breath(10) end + end + end, + particle_color = "#2E5299", + uses_factor = false, +}) + +mcl_potions.register_effect({ + name = "dolphin_grace", + description = S("Dolphin's Grace"), + get_tt = function(factor) + return S("swimming gracefully") + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob physics factor API + end, + on_hit_timer = function(object, factor, duration) + local node = minetest.get_node_or_nil(object:get_pos()) + if node and minetest.registered_nodes[node.name] + and minetest.get_item_group(node.name, "liquid") ~= 0 then + playerphysics.add_physics_factor(object, "speed", "mcl_potions:dolphin", 2) + else + playerphysics.remove_physics_factor(object, "speed", "mcl_potions:dolphin", 2) + end + end, + particle_color = "#6AABFD", + uses_factor = false, + timer_uses_factor = false, + hit_timer_step = 1, +}) + +mcl_potions.register_effect({ + name = "leaping", + description = S("Leaping"), + get_tt = function(factor) + if factor > 0 then return S("+@1% jumping power", math.floor(factor*100)) end + return S("-@1% jumping power", math.floor(-factor*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob physics factor API + end, + on_start = function(object, factor) + playerphysics.add_physics_factor(object, "jump", "mcl_potions:leaping", 1+factor) + end, + on_end = function(object) + playerphysics.remove_physics_factor(object, "jump", "mcl_potions:leaping") + end, + particle_color = "#22FF4C", + uses_factor = true, + lvl1_factor = 0.5, + lvl2_factor = 1, +}) + +mcl_potions.register_effect({ + name = "slow_falling", + description = S("Slow Falling"), + get_tt = function(factor) + return S("decreases gravity effects") + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob physics factor API + end, + on_start = function(object, factor) + playerphysics.add_physics_factor(object, "gravity", "mcl_potions:slow_falling", 0.5) + end, + on_step = function(dtime, object, factor, duration) + local vel = object:get_velocity() + if not vel then return end + vel = vel.y + if vel < -3 then object:add_velocity(vector.new(0,-3-vel,0)) end + end, + on_end = function(object) + playerphysics.remove_physics_factor(object, "gravity", "mcl_potions:slow_falling") + end, + particle_color = "#ACCCFF", +}) + +mcl_potions.register_effect({ + name = "swiftness", + description = S("Swiftness"), + get_tt = function(factor) + return S("+@1% running speed", math.floor(factor*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob physics factor API + end, + on_start = function(object, factor) + playerphysics.add_physics_factor(object, "speed", "mcl_potions:swiftness", 1+factor) + end, + on_end = function(object) + playerphysics.remove_physics_factor(object, "speed", "mcl_potions:swiftness") + end, + particle_color = "#7CAFC6", + uses_factor = true, + lvl1_factor = 0.2, + lvl2_factor = 0.4, +}) + +mcl_potions.register_effect({ + name = "slowness", + description = S("Slowness"), + get_tt = function(factor) + return S("-@1% running speed", math.floor(factor*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob physics factor API + end, + on_start = function(object, factor) + playerphysics.add_physics_factor(object, "speed", "mcl_potions:slowness", 1-factor) + end, + on_end = function(object) + playerphysics.remove_physics_factor(object, "speed", "mcl_potions:slowness") + end, + particle_color = "#5A6C81", + uses_factor = true, + lvl1_factor = 0.15, + lvl2_factor = 0.3, +}) + +mcl_potions.register_effect({ + name = "levitation", + description = S("Levitation"), + get_tt = function(factor) + return S("moves body upwards at @1 nodes/s", factor) + end, + on_step = function(dtime, object, factor, duration) + local vel = object:get_velocity() + if not vel then return end + vel = vel.y + if vel 0.6 then EF.darkness[object].flashdir = false end + flash = EF.darkness[object].flashdir and (flash + dtime) or (flash - dtime) + object:set_sky({fog = { + fog_start = flash, + }}) + EF.darkness[object].flash = flash + else + object:set_sky({fog = { + fog_start = 0.9, + }}) + end + mcl_weather.skycolor.update_sky_color({object}) + end, + on_end = function(object) + local meta = object:get_meta() + if not meta then return end + meta:set_int("darkness", 0) + mcl_weather.skycolor.update_sky_color({object}) + object:set_sky({fog = { + fog_distance = -1, + fog_start = -1, + }}) + end, + particle_color = "#000000", + uses_factor = true, + lvl1_factor = 30, + lvl2_factor = 20, +}) + +local GLOW_DISTANCE = 30 +local CLOSE_GLOW_LIMIT = 3 +local MIN_GLOW_SCALE = 1 +local MAX_GLOW_SCALE = 4 +local SCALE_DIFF = MAX_GLOW_SCALE - MIN_GLOW_SCALE +local SCALE_FACTOR = (GLOW_DISTANCE - CLOSE_GLOW_LIMIT) / SCALE_DIFF +local abs = math.abs +mcl_potions.register_effect({ + name = "glowing", + description = S("Glowing"), + get_tt = function(factor) + return S("more visible at all times") + end, + on_start = function(object, factor) + EF.glowing[object].waypoints = {} + end, + on_step = function(dtime, object, factor, duration) + local pos = object:get_pos() + if not pos then return end + local x, y, z = pos.x, pos.y, pos.z + for _, player in pairs(minetest.get_connected_players()) do + local pp = player:get_pos() + if pp and player ~= object then + local hud_id = EF.glowing[object].waypoints[player] + if abs(pp.x-x) < GLOW_DISTANCE and abs(pp.y-y) < GLOW_DISTANCE + and abs(pp.z-z) < GLOW_DISTANCE then + local distance = vector.distance(pos, pp) + local scale + if distance <= CLOSE_GLOW_LIMIT then scale = MAX_GLOW_SCALE + elseif distance >= GLOW_DISTANCE then scale = MIN_GLOW_SCALE + else scale = (GLOW_DISTANCE - distance) / SCALE_FACTOR + MIN_GLOW_SCALE end + if hud_id then + player:hud_change(hud_id, "world_pos", pos) + player:hud_change(hud_id, "scale", {x = scale, y = scale}) + else + EF.glowing[object].waypoints[player] = player:hud_add({ + hud_elem_type = "image_waypoint", + position = {x = 0.5, y = 0.5}, + scale = {x = scale, y = scale}, + text = "mcl_potions_glow_waypoint.png", + alignment = {x = 0, y = -1}, + world_pos = pos, + }) + end + elseif hud_id then + player:hud_remove(hud_id) + EF.glowing[object].waypoints[player] = nil + end + end + end + end, + on_end = function(object) + for player, hud_id in pairs(EF.glowing[object].waypoints) do + if player:get_pos() then player:hud_remove(hud_id) end + end + end, + on_save_effect = function(object) + for player, hud_id in pairs(EF.glowing[object].waypoints) do + if player:get_pos() then player:hud_remove(hud_id) end + end + EF.glowing[object].waypoints = {} + end, + particle_color = "#FFFF77", + uses_factor = false, +}) + +mcl_potions.register_effect({ + name = "health_boost", + description = S("Health Boost"), + get_tt = function(factor) + return S("HP increased by @1", factor) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob HP modifier API? + end, + on_start = function(object, factor) + object:set_properties({hp_max = minetest.PLAYER_MAX_HP_DEFAULT+factor}) + end, + on_end = function(object) + object:set_properties({hp_max = minetest.PLAYER_MAX_HP_DEFAULT}) + end, + particle_color = "#FF2222", + uses_factor = true, + lvl1_factor = 4, + lvl2_factor = 8, +}) + +mcl_potions.register_effect({ + name = "absorption", + description = S("Absorption"), + get_tt = function(factor) + return S("absorbs up to @1 incoming damage", factor) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO dmg modifiers don't work for mobs + end, + on_start = function(object, factor) + hb.change_hudbar(object, "absorption", factor, (math.floor(factor/20-0.05)+1)*20) + EF.absorption[object].absorb = factor + end, + on_load = function(object, factor) + minetest.after(0, function() hb.change_hudbar(object, "absorption", nil, (math.floor(factor/20-0.05)+1)*20) end) + end, + on_step = function(dtime, object, factor, duration) + hb.change_hudbar(object, "absorption", EF.absorption[object].absorb) + end, + on_end = function(object) + hb.change_hudbar(object, "absorption", 0) + end, + particle_color = "#B59500", + uses_factor = true, + lvl1_factor = 4, + lvl2_factor = 8, + damage_modifier = "", + modifier_func = function(damage, effect_vals) + local absorb = effect_vals.absorb + local carryover = 0 + if absorb > damage then + effect_vals.absorb = absorb - damage + else + carryover = damage - absorb + effect_vals.absorb = 0 + end + return carryover + end, +}) + +mcl_potions.register_effect({ + name = "fire_resistance", + description = S("Fire Resistance"), + get_tt = function(factor) + return S("resistance to fire damage") + end, + res_condition = function(object) + return (not object:is_player()) -- TODO dmg modifiers don't work for mobs + end, + particle_color = "#E49A3A", + uses_factor = false, + damage_modifier = "is_fire", +}) + +mcl_potions.register_effect({ + name = "resistance", + description = S("Resistance"), + get_tt = function(factor) + return S("resist @1% of incoming damage", math.floor(factor*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO dmg modifiers don't work for mobs + end, + particle_color = "#2552A5", + uses_factor = true, + lvl1_factor = 0.2, + lvl2_factor = 0.4, + damage_modifier = "", + modifier_func = function(damage, effect_vals) + return damage - (effect_vals.factor)*damage + end, +}) + +mcl_potions.register_effect({ + name = "luck", + description = S("Luck"), + particle_color = "#7BFF42", + res_condition = function(object) + return (not object:is_player()) -- TODO what should it do for mobs? + end, + on_start = function(object, factor) + mcl_luck.apply_luck_modifier(object:get_player_name(), "mcl_potions:luck", factor) + end, + on_load = function(object, factor) + mcl_luck.apply_luck_modifier(object:get_player_name(), "mcl_potions:luck", factor) + end, + on_end = function(object) + mcl_luck.remove_luck_modifier(object:get_player_name(), "mcl_potions:luck") + end, + uses_factor = true, +}) + +mcl_potions.register_effect({ + name = "bad_luck", + description = S("Bad Luck"), + particle_color = "#887343", + res_condition = function(object) + return (not object:is_player()) -- TODO what should it do for mobs? + end, + on_start = function(object, factor) + mcl_luck.apply_luck_modifier(object:get_player_name(), "mcl_potions:bad_luck", -factor) + end, + on_load = function(object, factor) + mcl_luck.apply_luck_modifier(object:get_player_name(), "mcl_potions:bad_luck", -factor) + end, + on_end = function(object) + mcl_luck.remove_luck_modifier(object:get_player_name(), "mcl_potions:bad_luck") + end, + uses_factor = true, +}) + +mcl_potions.register_effect({ + name = "bad_omen", + description = S("Bad Omen"), + get_tt = function(factor) + return S("danger is imminent") + end, + particle_color = "#472331", + uses_factor = true, +}) + +mcl_potions.register_effect({ + name = "hero_of_village", + description = S("Hero of the Village"), + particle_color = "#006D2A", +}) + +mcl_potions.register_effect({ + name = "withering", + description = S("Withering"), + get_tt = function(factor) + return S("-1 HP / @1 s, can kill", factor) + end, + res_condition = function(object) + local entity = object:get_luaentity() + return (entity and string.find(entity.name, "wither")) + end, + on_hit_timer = function(object, factor, duration) + if object:is_player() or object:get_luaentity() then + mcl_util.deal_damage(object, 1, {type = "magic"}) + end + end, + particle_color = "#292929", + uses_factor = true, + lvl1_factor = 2, + lvl2_factor = 1, + timer_uses_factor = true, +}) + +mcl_potions.register_effect({ + name = "frost", + description = S("Frost"), + get_tt = function(factor) + return S("-1 HP / 1 s, can kill, -@1% running speed", math.floor(factor*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob physics factor API + end, + on_start = function(object, factor) + mcl_burning.extinguish(object) + playerphysics.add_physics_factor(object, "speed", "mcl_potions:frost", 1-factor) + if EF.frost[object].vignette then return end + EF.frost[object].vignette = object:hud_add({ + hud_elem_type = "image", + position = {x = 0.5, y = 0.5}, + scale = {x = -101, y = -101}, + text = "mcl_potions_frost_hud.png", + z_index = -400 + }) + end, + on_load = function(object, factor) + EF.frost[object].vignette = object:hud_add({ + hud_elem_type = "image", + position = {x = 0.5, y = 0.5}, + scale = {x = -101, y = -101}, + text = "mcl_potions_frost_hud.png", + z_index = -400 + }) + end, + on_hit_timer = function(object, factor, duration) + if object:is_player() or object:get_luaentity() then + mcl_util.deal_damage(object, 1, {type = "magic"}) + end + end, + on_end = function(object) + playerphysics.remove_physics_factor(object, "speed", "mcl_potions:frost") + if not EF.frost[object] then return end + object:hud_remove(EF.frost[object].vignette) + end, + particle_color = "#5B7DAA", + uses_factor = true, + lvl1_factor = 0.1, + lvl2_factor = 0.2, + timer_uses_factor = false, + hit_timer_step = 1, + damage_modifier = "is_fire", + modifier_func = function(damage, effect_vals) + effect_vals.timer = effect_vals.dur + return 0 + end, +}) + +mcl_potions.register_effect({ + name = "blindness", + description = "Blindness", + get_tt = function(factor) + return S("impaired sight") + end, + res_condition = function(object) + return (not object:is_player()) -- TODO what should it do for mobs? + end, + on_start = function(object, factor) + EF.blindness[object].vignette = object:hud_add({ + hud_elem_type = "image", + position = {x = 0.5, y = 0.5}, + scale = {x = -101, y = -101}, + text = "mcl_potions_blindness_hud.png", + z_index = -401 + }) + mcl_fovapi.apply_modifier(object, "mcl_potions:blindness") + end, + on_load = function(object, factor) + EF.blindness[object].vignette = object:hud_add({ + hud_elem_type = "image", + position = {x = 0.5, y = 0.5}, + scale = {x = -101, y = -101}, + text = "mcl_potions_blindness_hud.png", + z_index = -401 + }) + mcl_fovapi.apply_modifier(object, "mcl_potions:blindness") + end, + on_end = function(object) + mcl_fovapi.remove_modifier(object, "mcl_potions:blindness") + if not EF.blindness[object] then return end + object:hud_remove(EF.blindness[object].vignette) + end, + particle_color = "#686868", + uses_factor = false, +}) +mcl_fovapi.register_modifier({ + name = "mcl_potions:blindness", + fov_factor = 0.6, + time = 1, +}) + +mcl_potions.register_effect({ + name = "nausea", + description = S("Nausea"), + get_tt = function(factor) + return S("not feeling very well...").."\n"..S("frequency: @1 / 1 s", factor) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO what should it do for mobs? + end, + on_start = function(object, factor) + object:set_lighting({ + saturation = -1.0, + }) + end, + on_hit_timer = function(object, factor, duration) + if EF.nausea[object].high then + mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_high", factor) + mcl_fovapi.apply_modifier(object, "mcl_potions:nausea_low", factor) + EF.nausea[object].high = false + else + mcl_fovapi.apply_modifier(object, "mcl_potions:nausea_high", factor) + mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_low", factor) + EF.nausea[object].high = true + end + end, + on_end = function(object) + object:set_lighting({ + saturation = 1.0, + }) + mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_high") + mcl_fovapi.remove_modifier(object, "mcl_potions:nausea_low") + end, + particle_color = "#60AA30", + uses_factor = true, + lvl1_factor = 2, + lvl2_factor = 1, + timer_uses_factor = true, +}) +mcl_fovapi.register_modifier({ + name = "mcl_potions:nausea_high", + fov_factor = 2.2, + time = 1, +}) +mcl_fovapi.register_modifier({ + name = "mcl_potions:nausea_low", + fov_factor = 0.2, + time = 1, +}) + +mcl_potions.register_effect({ + name = "food_poisoning", + description = S("Food Poisoning"), + get_tt = function(factor) + return S("exhausts by @1 per second", factor) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO what should it do for mobs? + end, + on_start = function(object, factor) + hb.change_hudbar(object, "hunger", nil, nil, "mcl_hunger_icon_foodpoison.png", nil, "mcl_hunger_bar_foodpoison.png") + if mcl_hunger.debug then + hb.change_hudbar(object, "exhaustion", nil, nil, nil, nil, "mcl_hunger_bar_foodpoison.png") + end + end, + on_load = function(object, factor) -- TODO refactor and add hunger bar modifier API + hb.change_hudbar(object, "hunger", nil, nil, "mcl_hunger_icon_foodpoison.png", nil, "mcl_hunger_bar_foodpoison.png") + if mcl_hunger.debug then + hb.change_hudbar(object, "exhaustion", nil, nil, nil, nil, "mcl_hunger_bar_foodpoison.png") + end + end, + on_step = function(dtime, object, factor, duration) + mcl_hunger.exhaust(object:get_player_name(), dtime*factor) + end, + on_end = function(object) + mcl_hunger.reset_bars_poison_hunger(object) + end, + particle_color = "#83A061", + uses_factor = true, + lvl1_factor = 100, + lvl2_factor = 200, +}) + +mcl_potions.register_effect({ + name = "saturation", + description = S("Saturation"), + get_tt = function(factor) + return S("saturates by @1 per second", factor) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO what should it do for mobs? + end, + on_step = function(dtime, object, factor, duration) + mcl_hunger.set_hunger(object, math.min(mcl_hunger.get_hunger(object)+dtime*factor, 20)) + mcl_hunger.saturate(object:get_player_name(), dtime*factor) + end, + particle_color = "#CEAE29", + uses_factor = true, +}) + +-- constants relevant for effects altering mining and attack speed +local LONGEST_MINING_TIME = 300 +local LONGEST_PUNCH_INTERVAL = 10 +mcl_potions.LONGEST_MINING_TIME = LONGEST_MINING_TIME +mcl_potions.LONGEST_PUNCH_INTERVAL = LONGEST_PUNCH_INTERVAL + +function mcl_potions.apply_haste_fatigue(toolcaps, h_fac, f_fac) + if f_fac == 0 then + local fpi = toolcaps.full_punch_interval + toolcaps.full_punch_interval = fpi > LONGEST_PUNCH_INTERVAL and fpi or LONGEST_PUNCH_INTERVAL + else + toolcaps.full_punch_interval = toolcaps.full_punch_interval / (1+h_fac) / f_fac + end + for name, group in pairs(toolcaps.groupcaps) do + local t = group.times + for i=1, #t do + if f_fac == 0 then + t[i] = t[i] > LONGEST_MINING_TIME and t[i] or LONGEST_MINING_TIME + else + local old_time = t[i] + t[i] = t[i] / (1+h_fac) / f_fac + if old_time < LONGEST_MINING_TIME and t[i] > LONGEST_MINING_TIME then + t[i] = LONGEST_MINING_TIME + end + end + end + end + return toolcaps +end + +function mcl_potions.hf_update_internal(hand, object) + -- TODO add a check for creative mode? + local meta = hand:get_meta() + local h_fac = mcl_potions.get_total_haste(object) + local f_fac = mcl_potions.get_total_fatigue(object) + local toolcaps = hand:get_tool_capabilities() + meta:set_tool_capabilities(mcl_potions.apply_haste_fatigue(toolcaps, h_fac, f_fac)) + return hand +end + +local function haste_fatigue_hand_update(object) + local inventory = object:get_inventory() + if not inventory or inventory:get_size("hand") < 1 then return end + local hand = inventory:get_stack("hand", 1) + inventory:set_stack("hand", 1, mcl_potions.hf_update_internal(hand, object)) +end + +mcl_potions.register_effect({ + name = "haste", + description = S("Haste"), + get_tt = function(factor) + return S("+@1% mining and attack speed", math.floor(factor*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob API support + end, + on_start = haste_fatigue_hand_update, + after_end = function(object) + haste_fatigue_hand_update(object) + mcl_potions._reset_haste_fatigue_item_meta(object) + end, + particle_color = "#FFFF00", + uses_factor = true, + lvl1_factor = 0.2, + lvl2_factor = 0.4, + affects_item_speed = {factor_is_positive = true}, +}) + +mcl_potions.register_effect({ + name = "fatigue", + description = S("Fatigue"), + get_tt = function(factor) + return S("-@1% mining and attack speed", math.floor((1-factor)*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob API support + end, + on_start = haste_fatigue_hand_update, + after_end = function(object) + haste_fatigue_hand_update(object) + mcl_potions._reset_haste_fatigue_item_meta(object) + end, + particle_color = "#64643D", + uses_factor = true, + lvl1_factor = 0.3, + lvl2_factor = 0.09, + affects_item_speed = {}, +}) + +mcl_potions.register_effect({ + name = "conduit_power", + description = S("Conduit Power"), + get_tt = function(factor) + return S("+@1% mining and attack speed in water").."\n"..S("limitless breathing under water", math.floor(factor*100)) + end, + res_condition = function(object) + return (not object:is_player()) -- TODO needs mob API support + end, + on_start = haste_fatigue_hand_update, + on_step = function(dtime, object, factor, duration) + if not object:is_player() then return end + local node = minetest.get_node_or_nil(object:get_pos()) + if node and minetest.registered_nodes[node.name] + and minetest.get_item_group(node.name, "liquid") ~= 0 + and minetest.get_item_group(node.name, "water") ~= 0 then + EF.conduit_power[object].blocked = nil + if object:get_breath() then + hb.hide_hudbar(object, "breath") + if object:get_breath() < 10 then object:set_breath(10) end + end + -- TODO implement improved underwater vision with this effect + else + EF.conduit_power[object].blocked = true + end + end, + after_end = function(object) + haste_fatigue_hand_update(object) + mcl_potions._reset_haste_fatigue_item_meta(object) + end, + particle_color = "#1FB1BA", + uses_factor = true, + lvl1_factor = 0.2, + lvl2_factor = 0.4, + affects_item_speed = {factor_is_positive = true}, +}) + +-- implementation of haste and fatigue effects +function mcl_potions.update_haste_and_fatigue(player) + if mcl_gamemode.get_gamemode(player) == "creative" then return end + local item = player:get_wielded_item() + local meta = item:get_meta() + local item_haste = meta:get_float("mcl_potions:haste") + local item_fatig = 1 - meta:get_float("mcl_potions:fatigue") + local h_fac = mcl_potions.get_total_haste(player) + local f_fac = mcl_potions.get_total_fatigue(player) + if item_haste ~= h_fac or item_fatig ~= f_fac then + if h_fac ~= 0 then meta:set_float("mcl_potions:haste", h_fac) + else meta:set_string("mcl_potions:haste", "") end + if f_fac ~= 1 then meta:set_float("mcl_potions:fatigue", 1 - f_fac) + else meta:set_string("mcl_potions:fatigue", "") end + meta:set_tool_capabilities() + mcl_enchanting.update_groupcaps(item) + if h_fac == 0 and f_fac == 1 then + player:set_wielded_item(item) + return + end + local toolcaps = item:get_tool_capabilities() + meta:set_tool_capabilities(mcl_potions.apply_haste_fatigue(toolcaps, h_fac, f_fac)) + player:set_wielded_item(item) + end + haste_fatigue_hand_update(player, h_fac, f_fac) +end +minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) + mcl_potions.update_haste_and_fatigue(puncher) +end) +minetest.register_on_punchplayer(function(player, hitter) + if not hitter:is_player() then return end -- TODO implement haste and fatigue support for mobs? + mcl_potions.update_haste_and_fatigue(hitter) +end) +-- update when hitting mob implemented in mcl_mobs/combat.lua + + + +-- ██╗░░░██╗██████╗░██████╗░░█████╗░████████╗███████╗ +-- ██║░░░██║██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔════╝ +-- ██║░░░██║██████╔╝██║░░██║███████║░░░██║░░░█████╗░░ +-- ██║░░░██║██╔═══╝░██║░░██║██╔══██║░░░██║░░░██╔══╝░░ +-- ╚██████╔╝██║░░░░░██████╦╝██║░░██║░░░██║░░░███████╗ +-- ░╚═════╝░╚═╝░░░░░╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░╚══════╝ +-- +-- ██╗░░██╗██╗░░░██╗██████╗░ +-- ██║░░██║██║░░░██║██╔══██╗ +-- ███████║██║░░░██║██║░░██║ +-- ██╔══██║██║░░░██║██║░░██║ +-- ██║░░██║╚██████╔╝██████╦╝ +-- ╚═╝░░╚═╝░╚═════╝░╚═════╝░ + +hb.register_hudbar("absorption", 0xFFFFFF, S("Absorption"), {bar = "[fill:2x16:#B59500", icon = "mcl_potions_icon_absorb.png"}, 0, 0, 0, false) + +local hp_hudbar_modifiers = {} + +-- API - registers a HP hudbar modifier +-- required parameters in def: +-- predicate - function(player) - returns true if player fulfills the requirements (eg. has the effects) for the hudbar look +-- icon - string - name of the icon to which the modifier should change the HP hudbar heart +-- priority - signed int - lower gets checked first, and first fulfilled predicate applies its modifier +function mcl_potions.register_hp_hudbar_modifier(def) + if type(def.predicate) ~= "function" then error("Predicate must be a function") end + if not def.icon then error("No icon provided") end + if not def.priority then error("No priority provided") end + table.insert(hp_hudbar_modifiers, { + predicate = def.predicate, + icon = def.icon, + priority = def.priority, + }) + table.sort(hp_hudbar_modifiers, function(a, b) return a.priority <= b.priority end) +end + +mcl_potions.register_hp_hudbar_modifier({ + predicate = function(player) + if EF.withering[player] and EF.regeneration[player] then return true end + end, + icon = "mcl_potions_icon_regen_wither.png", + priority = -30, +}) + +mcl_potions.register_hp_hudbar_modifier({ + predicate = function(player) + if EF.withering[player] then return true end + end, + icon = "mcl_potions_icon_wither.png", + priority = -20, +}) + +mcl_potions.register_hp_hudbar_modifier({ + predicate = function(player) + if EF.poison[player] and EF.regeneration[player] then return true end + end, + icon = "hbhunger_icon_regen_poison.png", + priority = -10, +}) + +mcl_potions.register_hp_hudbar_modifier({ + predicate = function(player) + if EF.poison[player] then return true end + end, + icon = "hbhunger_icon_health_poison.png", + priority = 0, +}) + +mcl_potions.register_hp_hudbar_modifier({ + predicate = function(player) + if EF.frost[player] and EF.regeneration[player] then return true end + end, + icon = "mcl_potions_icon_regen_frost.png", + priority = 10, +}) + +mcl_potions.register_hp_hudbar_modifier({ + predicate = function(player) + if EF.frost[player] then return true end + end, + icon = "mcl_potions_icon_frost.png", + priority = 20, +}) + +mcl_potions.register_hp_hudbar_modifier({ + predicate = function(player) + if EF.regeneration[player] then return true end + end, + icon = "hudbars_icon_regenerate.png", + priority = 30, +}) + +local function potions_set_hudbar(player) + for _, mod in pairs(hp_hudbar_modifiers) do + if mod.predicate(player) then + hb.change_hudbar(player, "health", nil, nil, mod.icon, nil, "hudbars_bar_health.png") + return + end + end + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") end local icon_ids = {} -local function potions_set_hudbar(player) - if EF.withering[player] and EF.regenerating[player] then - hb.change_hudbar(player, "health", nil, nil, "mcl_potions_icon_regen_wither.png", nil, "hudbars_bar_health.png") - elseif EF.withering[player] then - hb.change_hudbar(player, "health", nil, nil, "mcl_potions_icon_wither.png", nil, "hudbars_bar_health.png") - elseif EF.poisoned[player] and EF.regenerating[player] then - hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png") - elseif EF.poisoned[player] then - hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hudbars_bar_health.png") - elseif EF.regenerating[player] then - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_regenerate.png", nil, "hudbars_bar_health.png") - else - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") - end - -end - local function potions_init_icons(player) local name = player:get_player_name() icon_ids[name] = {} for e=1, EFFECT_TYPES do local x = -52 * e - 2 - local id = player:hud_add({ + local id = {} + id.img = player:hud_add({ hud_elem_type = "image", text = "blank.png", position = { x = 1, y = 0 }, @@ -50,8 +1231,31 @@ local function potions_init_icons(player) alignment = { x = 1, y = 1 }, z_index = 100, }) + id.label = player:hud_add({ + hud_elem_type = "text", + text = "", + position = { x = 1, y = 0 }, + offset = { x = x+22, y = 50 }, + scale = { x = 50, y = 15 }, + alignment = { x = 0, y = 1 }, + z_index = 100, + style = 1, + number = 0xFFFFFF, + }) + id.timestamp = player:hud_add({ + hud_elem_type = "text", + text = "", + position = { x = 1, y = 0 }, + offset = { x = x+22, y = 65 }, + scale = { x = 50, y = 15 }, + alignment = { x = 0, y = 1 }, + z_index = 100, + style = 1, + number = 0xFFFFFF, + }) table.insert(icon_ids[name], id) end + hb.init_hudbar(player, "absorption") end local function potions_set_icons(player) @@ -62,30 +1266,49 @@ local function potions_set_icons(player) local active_effects = {} for effect_name, effect in pairs(EF) do if effect[player] then - table.insert(active_effects, effect_name) + active_effects[effect_name] = effect[player] end end - for i=1, EFFECT_TYPES do - local icon = icon_ids[name][i] - local effect_name = active_effects[i] - if effect_name == "swift" and EF.swift[player].is_slow then - effect_name = "slow" - end - if effect_name == nil then - player:hud_change(icon, "text", "blank.png") - else - player:hud_change(icon, "text", "mcl_potions_effect_"..effect_name..".png^[resize:128x128") + local i = 1 + for effect_name, def in pairs(registered_effects) do + local icon = icon_ids[name][i].img + local label = icon_ids[name][i].label + local timestamp = icon_ids[name][i].timestamp + local vals = active_effects[effect_name] + if vals then + player:hud_change(icon, "text", def.icon .. "^[resize:128x128") + if def.uses_factor then + local level = def.factor_to_level(vals.factor) + if level > 3000 or level == math.huge then level = "∞" + elseif level < 0 then level = "???" + elseif level == 0 then level = "0" + else level = mcl_util.to_roman(level) end + player:hud_change(label, "text", level) + else + player:hud_change(label, "text", "") + end + if vals.dur == math.huge then + player:hud_change(timestamp, "text", "∞") + else + local dur = math.round(vals.dur-vals.timer) + player:hud_change(timestamp, "text", math.floor(dur/60)..string.format(":%02d",math.floor(dur % 60))) + end + EF[effect_name][player].hud_index = i + i = i + 1 end end - + while i < EFFECT_TYPES do + player:hud_change(icon_ids[name][i].img, "text", "blank.png") + player:hud_change(icon_ids[name][i].label, "text", "") + player:hud_change(icon_ids[name][i].timestamp, "text", "") + i = i + 1 + end end local function potions_set_hud(player) - potions_set_hudbar(player) potions_set_icons(player) - end @@ -103,315 +1326,54 @@ end -- ╚█████╔╝██║░░██║███████╗╚█████╔╝██║░╚██╗███████╗██║░░██║ -- ░╚════╝░╚═╝░░╚═╝╚══════╝░╚════╝░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝ -local is_player, entity, meta - minetest.register_globalstep(function(dtime) + for name, effect in pairs(registered_effects) do + for object, vals in pairs(EF[name]) do + if vals.dur ~= math.huge then EF[name][object].timer = vals.timer + dtime end - -- Check for invisible players - for player, vals in pairs(EF.invisible) do - - EF.invisible[player].timer = EF.invisible[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#7F8392") end - - if EF.invisible[player].timer >= EF.invisible[player].dur then - mcl_potions.make_invisible(player, false) - EF.invisible[player] = nil - if player:is_player() then - meta = player:get_meta() - meta:set_string("_is_invisible", minetest.serialize(EF.invisible[player])) + if object:get_pos() and not vals.no_particles then mcl_potions._add_spawner(object, effect.particle_color) end + if effect.on_step then effect.on_step(dtime, object, vals.factor, vals.dur) end + if effect.on_hit_timer then + EF[name][object].hit_timer = (vals.hit_timer or 0) + dtime + if EF[name][object].hit_timer >= vals.step then + effect.on_hit_timer(object, vals.factor, vals.dur) + if EF[name][object] then EF[name][object].hit_timer = 0 end + end end - potions_set_hud(player) + if not object or not EF[name][object] or EF[name][object].timer >= vals.dur or not object:get_pos() then + if effect.on_end then effect.on_end(object) end + EF[name][object] = nil + if effect.after_end then effect.after_end(object) end + if object:is_player() then + meta = object:get_meta() + meta:set_string("mcl_potions:_EF_"..name, "") + potions_set_hud(object) + else + local ent = object:get_luaentity() + if ent then + ent._mcl_potions["_EF_"..name] = nil + end + end + elseif object:is_player() then + if vals.dur == math.huge then + object:hud_change(icon_ids[object:get_player_name()][vals.hud_index].timestamp, + "text", "∞") + else + local dur = math.round(vals.dur-vals.timer) + object:hud_change(icon_ids[object:get_player_name()][vals.hud_index].timestamp, + "text", math.floor(dur/60)..string.format(":%02d",math.floor(dur % 60))) + end + else + local ent = object:get_luaentity() + if ent then + ent._mcl_potions["_EF_"..name] = EF[name][object] + end + end end - end - - -- Check for withering players - for player, vals in pairs(EF.withering) do - - is_player = player:is_player() - entity = player:get_luaentity() - - EF.withering[player].timer = EF.withering[player].timer + dtime - EF.withering[player].hit_timer = (EF.withering[player].hit_timer or 0) + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#000000") end - - if EF.withering[player].hit_timer >= EF.withering[player].step then - if is_player or entity then mcl_util.deal_damage(player, 1, {type = "magic"}) end - if EF.withering[player] then EF.withering[player].hit_timer = 0 end - end - - if EF.withering[player] and EF.withering[player].timer >= EF.withering[player].dur then - EF.withering[player] = nil - if is_player then - meta = player:get_meta() - meta:set_string("_is_withering", minetest.serialize(EF.withering[player])) - potions_set_hud(player) - end - end - - end - - -- Check for poisoned players - for player, vals in pairs(EF.poisoned) do - - is_player = player:is_player() - entity = player:get_luaentity() - - EF.poisoned[player].timer = EF.poisoned[player].timer + dtime - EF.poisoned[player].hit_timer = (EF.poisoned[player].hit_timer or 0) + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#4E9331") end - - if EF.poisoned[player].hit_timer >= EF.poisoned[player].step then - if mcl_util.get_hp(player) - 1 > 0 then - mcl_util.deal_damage(player, 1, {type = "magic"}) - end - EF.poisoned[player].hit_timer = 0 - end - - if EF.poisoned[player] and EF.poisoned[player].timer >= EF.poisoned[player].dur then - EF.poisoned[player] = nil - if is_player then - meta = player:get_meta() - meta:set_string("_is_poisoned", minetest.serialize(EF.poisoned[player])) - potions_set_hud(player) - end - end - - end - - -- Check for regenerating players - for player, vals in pairs(EF.regenerating) do - - is_player = player:is_player() - entity = player:get_luaentity() - - EF.regenerating[player].timer = EF.regenerating[player].timer + dtime - EF.regenerating[player].heal_timer = (EF.regenerating[player].heal_timer or 0) + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#CD5CAB") end - - if EF.regenerating[player].heal_timer >= EF.regenerating[player].step then - - if is_player then - player:set_hp(math.min(player:get_properties().hp_max or 20, player:get_hp() + 1), { type = "set_hp", other = "regeneration" }) - EF.regenerating[player].heal_timer = 0 - elseif entity and entity.is_mob then - entity.health = math.min(entity.hp_max, entity.health + 1) - EF.regenerating[player].heal_timer = 0 - else -- stop regenerating if not a player or mob - EF.regenerating[player] = nil - end - - end - - if EF.regenerating[player] and EF.regenerating[player].timer >= EF.regenerating[player].dur then - EF.regenerating[player] = nil - if is_player then - meta = player:get_meta() - meta:set_string("_is_regenerating", minetest.serialize(EF.regenerating[player])) - potions_set_hud(player) - end - end - - end - - -- Check for water breathing players - for player, vals in pairs(EF.water_breathing) do - - if player:is_player() then - - EF.water_breathing[player].timer = EF.water_breathing[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#2E5299") end - - if player:get_breath() then - hb.hide_hudbar(player, "breath") - if player:get_breath() < 10 then player:set_breath(10) end - end - - if EF.water_breathing[player].timer >= EF.water_breathing[player].dur then - meta = player:get_meta() - meta:set_string("_is_water_breathing", minetest.serialize(EF.water_breathing[player])) - EF.water_breathing[player] = nil - end - potions_set_hud(player) - - else - EF.water_breathing[player] = nil - end - - end - - -- Check for leaping players - for player, vals in pairs(EF.leaping) do - - if player:is_player() then - - EF.leaping[player].timer = EF.leaping[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#22FF4C") end - - if EF.leaping[player].timer >= EF.leaping[player].dur then - playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") - EF.leaping[player] = nil - meta = player:get_meta() - meta:set_string("_is_leaping", minetest.serialize(EF.leaping[player])) - end - potions_set_hud(player) - - else - EF.leaping[player] = nil - end - - end - - -- Check for swift players - for player, vals in pairs(EF.swift) do - - if player:is_player() then - - EF.swift[player].timer = EF.swift[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#7CAFC6") end - - if EF.swift[player].timer >= EF.swift[player].dur then - playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") - EF.swift[player] = nil - meta = player:get_meta() - meta:set_string("_is_swift", minetest.serialize(EF.swift[player])) - end - potions_set_hud(player) - - else - EF.swift[player] = nil - end - - end - - -- Check for Night Vision equipped players - for player, vals in pairs(EF.night_vision) do - - if player:is_player() then - - EF.night_vision[player].timer = EF.night_vision[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#1F1FA1") end - - if EF.night_vision[player].timer >= EF.night_vision[player].dur then - EF.night_vision[player] = nil - meta = player:get_meta() - meta:set_string("_is_cat", minetest.serialize(EF.night_vision[player])) - meta:set_int("night_vision", 0) - end - mcl_weather.skycolor.update_sky_color({player}) - potions_set_hud(player) - - else - EF.night_vision[player] = nil - end - - end - - -- Check for Fire Proof players - for player, vals in pairs(EF.fire_proof) do - - if player:is_player() then - - player = player or player:get_luaentity() - - EF.fire_proof[player].timer = EF.fire_proof[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#E49A3A") end - - if EF.fire_proof[player].timer >= EF.fire_proof[player].dur then - EF.fire_proof[player] = nil - meta = player:get_meta() - meta:set_string("_is_fire_proof", minetest.serialize(EF.fire_proof[player])) - end - potions_set_hud(player) - - else - EF.fire_proof[player] = nil - end - - end - - -- Check for Weak players - for player, vals in pairs(EF.weak) do - - if player:is_player() then - - EF.weak[player].timer = EF.weak[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#484D48") end - - if EF.weak[player].timer >= EF.weak[player].dur then - EF.weak[player] = nil - meta = player:get_meta() - meta:set_string("_is_weak", minetest.serialize(EF.weak[player])) - end - - else - EF.weak[player] = nil - end - - end - - -- Check for Strong players - for player, vals in pairs(EF.strong) do - - if player:is_player() then - - EF.strong[player].timer = EF.strong[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#932423") end - - if EF.strong[player].timer >= EF.strong[player].dur then - EF.strong[player] = nil - meta = player:get_meta() - meta:set_string("_is_strong", minetest.serialize(EF.strong[player])) - end - - else - EF.strong[player] = nil - end - - end - - -- Check for Bad Omen - for player, vals in pairs(EF.bad_omen) do - - is_player = player:is_player() - - EF.bad_omen[player].timer = EF.bad_omen[player].timer + dtime - - if player:get_pos() then mcl_potions._add_spawner(player, "#0b6138") end - - if EF.bad_omen[player] and EF.bad_omen[player].timer >= EF.bad_omen[player].dur then - EF.bad_omen[player] = nil - if is_player then - meta = player:get_meta() - meta:set_string("_has_bad_omen", minetest.serialize(EF.bad_omen[player])) - potions_set_hud(player) - end - end - - end - end) --- Prevent damage to player with Fire Resistance enabled -mcl_damage.register_modifier(function(obj, damage, reason) - if EF.fire_proof[obj] and not reason.flags.bypasses_magic and reason.flags.is_fire then - return 0 - end -end, -50) - - -- ███████╗███████╗███████╗███████╗░█████╗░████████╗ -- ██╔════╝██╔════╝██╔════╝██╔════╝██╔══██╗╚══██╔══╝ @@ -427,169 +1389,244 @@ end, -50) -- ███████╗╚█████╔╝██║░░██║██████╔╝██╔╝░░░██████╔╝██║░░██║░░╚██╔╝░░███████╗ -- ╚══════╝░╚════╝░╚═╝░░╚═╝╚═════╝░╚═╝░░░░╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░╚══════╝ -function mcl_potions._clear_cached_player_data(player) - EF.invisible[player] = nil - EF.poisoned[player] = nil - EF.regenerating[player] = nil - EF.strong[player] = nil - EF.weak[player] = nil - EF.water_breathing[player] = nil - EF.leaping[player] = nil - EF.swift[player] = nil - EF.night_vision[player] = nil - EF.fire_proof[player] = nil - EF.bad_omen[player] = nil - EF.withering[player] = nil +function mcl_potions._reset_haste_fatigue_item_meta(player) + local inv = player:get_inventory() + if not inv then return end + local lists = inv:get_lists() + for _, list in pairs(lists) do + for _, item in pairs(list) do + local meta = item:get_meta() + meta:set_string("mcl_potions:haste", "") + meta:set_string("mcl_potions:fatigue", "") + meta:set_tool_capabilities() + mcl_enchanting.update_groupcaps(item) + end + end + inv:set_lists(lists) +end +mcl_gamemode.register_on_gamemode_change(mcl_potions._reset_haste_fatigue_item_meta) - meta = player:get_meta() +function mcl_potions._clear_cached_effect_data(object) + for name, effect in pairs(EF) do + effect[object] = nil + end + if not object:is_player() then return end + local meta = object:get_meta() meta:set_int("night_vision", 0) end -function mcl_potions._reset_player_effects(player, set_hud) - - if not player:is_player() then - return +function mcl_potions._reset_effects(object, set_hud) + local set_hud = set_hud + if not object:is_player() then + set_hud = false end - mcl_potions.make_invisible(player, false) + local removed_effects = {} + for name, effect in pairs(registered_effects) do + if EF[name][object] and effect.on_end then effect.on_end(object) end + if effect.after_end then table.insert(removed_effects, effect.after_end) end + end - playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") + mcl_potions._clear_cached_effect_data(object) - playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") - - mcl_weather.skycolor.update_sky_color({player}) - - mcl_potions._clear_cached_player_data(player) + for i=1, #removed_effects do + removed_effects[i](object) + end if set_hud ~= false then - potions_set_hud(player) + potions_set_hud(object) end end function mcl_potions._save_player_effects(player) - if not player:is_player() then return end - meta = player:get_meta() - - meta:set_string("_is_invisible", minetest.serialize(EF.invisible[player])) - meta:set_string("_is_poisoned", minetest.serialize(EF.poisoned[player])) - meta:set_string("_is_regenerating", minetest.serialize(EF.regenerating[player])) - meta:set_string("_is_strong", minetest.serialize(EF.strong[player])) - meta:set_string("_is_weak", minetest.serialize(EF.weak[player])) - meta:set_string("_is_water_breathing", minetest.serialize(EF.water_breathing[player])) - meta:set_string("_is_leaping", minetest.serialize(EF.leaping[player])) - meta:set_string("_is_swift", minetest.serialize(EF.swift[player])) - meta:set_string("_is_cat", minetest.serialize(EF.night_vision[player])) - meta:set_string("_is_fire_proof", minetest.serialize(EF.fire_proof[player])) - meta:set_string("_has_bad_omen", minetest.serialize(EF.bad_omen[player])) - meta:set_string("_is_withering", minetest.serialize(EF.withering[player])) + local meta = player:get_meta() + for name, effect in pairs(registered_effects) do + if effect.on_save_effect and EF[name][player] then effect.on_save_effect(player) end + meta:set_string("mcl_potions:_EF_"..name, minetest.serialize(EF[name][player])) + end end function mcl_potions._load_player_effects(player) - if not player:is_player() then return end - meta = player:get_meta() + local meta = player:get_meta() - if minetest.deserialize(meta:get_string("_is_invisible")) then - EF.invisible[player] = minetest.deserialize(meta:get_string("_is_invisible")) - mcl_potions.make_invisible(player, true) + -- handle legacy meta strings + local legacy_invisible = minetest.deserialize(meta:get_string("_is_invisible")) + local legacy_poisoned = minetest.deserialize(meta:get_string("_is_poisoned")) + local legacy_regenerating = minetest.deserialize(meta:get_string("_is_regenerating")) + local legacy_strong = minetest.deserialize(meta:get_string("_is_strong")) + local legacy_weak = minetest.deserialize(meta:get_string("_is_weak")) + local legacy_water_breathing = minetest.deserialize(meta:get_string("_is_water_breathing")) + local legacy_leaping = minetest.deserialize(meta:get_string("_is_leaping")) + local legacy_swift = minetest.deserialize(meta:get_string("_is_swift")) + local legacy_night_vision = minetest.deserialize(meta:get_string("_is_cat")) + local legacy_fireproof = minetest.deserialize(meta:get_string("_is_fire_proof")) + local legacy_bad_omen = minetest.deserialize(meta:get_string("_has_bad_omen")) + local legacy_withering = minetest.deserialize(meta:get_string("_is_withering")) + if legacy_invisible then + EF.invisibility[player] = legacy_invisible + meta:set_string("_is_invisible", "") + end + if legacy_poisoned then + EF.poison[player] = legacy_poisoned + meta:set_string("_is_poisoned", "") + end + if legacy_regenerating then + EF.regeneration[player] = legacy_regenerating + meta:set_string("_is_regenerating", "") + end + if legacy_strong then + EF.strength[player] = legacy_strong + meta:set_string("_is_strong", "") + end + if legacy_weak then + EF.weakness[player] = legacy_weak + meta:set_string("_is_weak", "") + end + if legacy_water_breathing then + EF.water_breathing[player] = legacy_water_breating + meta:set_string("_is_water_breating", "") + end + if legacy_leaping then + EF.leaping[player] = legacy_leaping + meta:set_string("_is_leaping", "") + end + if legacy_swift then + EF.swiftness[player] = legacy_swift + meta:set_string("_is_swift", "") + end + if legacy_night_vision then + EF.night_vision[player] = legacy_night_vision + meta:set_string("_is_cat", "") + end + if legacy_fireproof then + EF.fire_resistance[player] = legacy_fireproof + meta:set_string("_is_fire_proof", "") + end + if legacy_bad_omen then + EF.bad_omen[player] = legacy_bad_omen + meta:set_string("_has_bad_omen", "") + end + if legacy_withering then + EF.withering[player] = legacy_withering + meta:set_string("_is_withering", "") end - if minetest.deserialize(meta:get_string("_is_poisoned")) then - EF.poisoned[player] = minetest.deserialize(meta:get_string("_is_poisoned")) + -- new API effects + on_load for loaded legacy effects + for name, effect in pairs(registered_effects) do + local loaded = minetest.deserialize(meta:get_string("mcl_potions:_EF_"..name)) + if loaded then + EF[name][player] = loaded + if effect.on_load then + effect.on_load(player, EF[name][player].factor) + end + end end - - if minetest.deserialize(meta:get_string("_is_regenerating")) then - EF.regenerating[player] = minetest.deserialize(meta:get_string("_is_regenerating")) - end - - if minetest.deserialize(meta:get_string("_is_strong")) then - EF.strong[player] = minetest.deserialize(meta:get_string("_is_strong")) - end - - if minetest.deserialize(meta:get_string("_is_weak")) then - EF.weak[player] = minetest.deserialize(meta:get_string("_is_weak")) - end - - if minetest.deserialize(meta:get_string("_is_water_breathing")) then - EF.water_breathing[player] = minetest.deserialize(meta:get_string("_is_water_breathing")) - end - - if minetest.deserialize(meta:get_string("_is_leaping")) then - EF.leaping[player] = minetest.deserialize(meta:get_string("_is_leaping")) - end - - if minetest.deserialize(meta:get_string("_is_swift")) then - EF.swift[player] = minetest.deserialize(meta:get_string("_is_swift")) - end - - if minetest.deserialize(meta:get_string("_is_cat")) then - EF.night_vision[player] = minetest.deserialize(meta:get_string("_is_cat")) - end - - if minetest.deserialize(meta:get_string("_is_fire_proof")) then - EF.fire_proof[player] = minetest.deserialize(meta:get_string("_is_fire_proof")) - end - - if minetest.deserialize(meta:get_string("_has_bad_omen")) then - EF.bad_omen[player] = minetest.deserialize(meta:get_string("_has_bad_omen")) - end - - if minetest.deserialize(meta:get_string("_is_withering")) then - EF.withering[player] = minetest.deserialize(meta:get_string("_is_withering")) - end - end --- Returns true if player has given effect -function mcl_potions.player_has_effect(player, effect_name) +function mcl_potions._load_entity_effects(entity) + if not entity or not entity._mcl_potions or entity._mcl_potions == {} then + return + end + local object = entity.object + if not object or not object:get_pos() then return end + for name, effect in pairs(registered_effects) do + local loaded = entity._mcl_potions["_EF_"..name] + if loaded then + EF[name][object] = loaded + if effect.on_load then + effect.on_load(object, EF[name][object].factor) + end + end + end +end + +-- Returns true if object has given effect +function mcl_potions.has_effect(object, effect_name) if not EF[effect_name] then return false end - return EF[effect_name][player] ~= nil + return EF[effect_name][object] ~= nil end -function mcl_potions.player_get_effect(player, effect_name) - if not EF[effect_name] or not EF[effect_name][player] then +function mcl_potions.get_effect(object, effect_name) + if not EF[effect_name] or not EF[effect_name][object] then return false end - return EF[effect_name][player] + return EF[effect_name][object] end -function mcl_potions.player_clear_effect(player,effect) - EF[effect][player] = nil - potions_set_icons(player) +function mcl_potions.get_effect_level(object, effect_name) + if not EF[effect_name] then return end + local effect = EF[effect_name][object] + if not effect then return 0 end + if not registered_effects[effect_name].uses_factor then return 1 end + return registered_effects[effect_name].factor_to_level(effect.factor) +end + +function mcl_potions.get_total_haste(object) + local accum_factor = 1 + for name, def in pairs(item_speed_effects) do + if EF[name][object] and not EF[name][object].blocked then + local factor = EF[name][object].factor + if def.factor_is_positive then factor = factor + 1 end + if factor > 1 then accum_factor = accum_factor * factor end + end + end + return accum_factor - 1 +end + +function mcl_potions.get_total_fatigue(object) + local accum_factor = 1 + for name, def in pairs(item_speed_effects) do + if EF[name][object] and not EF[name][object].blocked then + local factor = EF[name][object].factor + if def.factor_is_positive then factor = factor + 1 end + if factor <= 0 then return 0 end + if factor < 1 then accum_factor = accum_factor * factor end + end + end + return accum_factor +end + +function mcl_potions.clear_effect(object, effect) + if not EF[effect] then + minetest.log("warning", "[mcl_potions] Tried to remove an effect that is not registered: " .. dump(effect)) + return false + end + local def = registered_effects[effect] + if EF[effect][object] then + if def.on_end then def.on_end(object) end + EF[effect][object] = nil + if def.after_end then def.after_end(object) end + end + if not object:is_player() then return end + potions_set_hud(object) end minetest.register_on_leaveplayer( function(player) mcl_potions._save_player_effects(player) - mcl_potions._clear_cached_player_data(player) -- clearout the buffer to prevent looking for a player not there + mcl_potions._clear_cached_effect_data(player) -- clear the buffer to prevent looking for a player not there icon_ids[player:get_player_name()] = nil end) minetest.register_on_dieplayer( function(player) - mcl_potions._reset_player_effects(player) + mcl_potions._reset_effects(player) potions_set_hud(player) end) minetest.register_on_joinplayer( function(player) - mcl_potions._reset_player_effects(player, false) -- make sure there are no wierd holdover effects + mcl_potions._reset_effects(player, false) -- make sure there are no weird holdover effects mcl_potions._load_player_effects(player) + mcl_potions._reset_haste_fatigue_item_meta(player) potions_init_icons(player) - -- .after required because player:hud_change doesn't work when called - -- in same tick as player:hud_add - -- (see ) - -- FIXME: Remove minetest.after - minetest.after(3, function(player) - if player and player:is_player() then - potions_set_hud(player) - end - end, player) + potions_set_hud(player) end) minetest.register_on_shutdown(function() @@ -597,10 +1634,8 @@ minetest.register_on_shutdown(function() for _,player in pairs(minetest.get_connected_players()) do mcl_potions._save_player_effects(player) end - end) - -- ░██████╗██╗░░░██╗██████╗░██████╗░░█████╗░██████╗░████████╗██╗███╗░░██╗░██████╗░ -- ██╔════╝██║░░░██║██╔══██╗██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██║████╗░██║██╔════╝░ -- ╚█████╗░██║░░░██║██████╔╝██████╔╝██║░░██║██████╔╝░░░██║░░░██║██╔██╗██║██║░░██╗░ @@ -649,16 +1684,16 @@ function mcl_potions.make_invisible(obj_ref, hide) else if hide then local luaentity = obj_ref:get_luaentity() - EF.invisible[obj_ref].old_size = luaentity.visual_size + EF.invisibility[obj_ref].old_size = luaentity.visual_size obj_ref:set_properties({ visual_size = { x = 0, y = 0 } }) else - obj_ref:set_properties({ visual_size = EF.invisible[obj_ref].old_size }) + obj_ref:set_properties({ visual_size = EF.invisibility[obj_ref].old_size }) end end end -function mcl_potions._use_potion(item, obj, color) +function mcl_potions._use_potion(obj, color) local d = 0.1 local pos = obj:get_pos() minetest.sound_play("mcl_potions_drinking", {pos = pos, max_hear_distance = 6, gain = 1}) @@ -727,14 +1762,88 @@ end -- ██║░░░░░╚██████╔╝██║░╚███║╚█████╔╝░░░██║░░░██║╚█████╔╝██║░╚███║██████╔╝ -- ╚═╝░░░░░░╚═════╝░╚═╝░░╚══╝░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░ +local registered_res_predicates = {} +-- API +-- This is supposed to add custom resistance functions independent of effects +-- E.g. some entity could be resistant to all (or some) effects under specific conditions +-- predicate - function(object, effect_name) - return true if resists effect +function mcl_potions.register_generic_resistance_predicate(predicate) + if type(predicate) == "function" then + table.insert(registered_res_predicates, predicate) + else + error("Attempted to register non-function as a predicate") + end +end -function mcl_potions.healing_func(player, hp) +local function target_valid(object, name) + if not object or object:get_hp() <= 0 then return false end - if not player or player:get_hp() <= 0 then return false end + local entity = object:get_luaentity() + if entity and entity.is_boss then return false end - local obj = player:get_luaentity() + for i=1, #registered_res_predicates do + if registered_res_predicates[i](object, name) then return false end + end - if obj and obj.harmed_by_heal then hp = -hp end + if not (registered_effects[name].res_condition + and registered_effects[name].res_condition(object)) then return true end +end + +function mcl_potions.give_effect(name, object, factor, duration, no_particles) + local edef = registered_effects[name] + if not edef or not target_valid(object, name) then return false end + if not EF[name][object] then + local vals = {dur = duration, timer = 0, no_particles = no_particles} + if edef.uses_factor then vals.factor = factor end + if edef.on_hit_timer then + if edef.timer_uses_factor then vals.step = factor + else vals.step = edef.hit_timer_step end + end + if duration == "INF" then + vals.dur = math.huge + end + EF[name][object] = vals + if edef.on_start then edef.on_start(object, factor) end + else + local present = EF[name][object] + present.no_particles = no_particles + if not edef.uses_factor or (edef.uses_factor and + (not edef.inv_factor and factor >= present.factor + or edef.inv_factor and factor <= present.factor)) then + present.dur = math.max(duration, present.dur - present.timer) + present.timer = 0 + if edef.uses_factor then + present.factor = factor + if edef.timer_uses_factor then present.step = factor end + if edef.on_start then edef.on_start(object, factor) end + end + if duration == "INF" then + present.dur = math.huge + end + else + return false + end + end + + if object:is_player() then potions_set_hud(object) end + + return true +end + +function mcl_potions.give_effect_by_level(name, object, level, duration, no_particles) + if level == 0 then return false end + if not registered_effects[name].uses_factor then + return mcl_potions.give_effect(name, object, 0, duration, no_particles) + end + local factor = registered_effects[name].level_to_factor(level) + return mcl_potions.give_effect(name, object, factor, duration, no_particles) +end + +function mcl_potions.healing_func(object, hp) + if not object or object:get_hp() <= 0 then return false end + local ent = object:get_luaentity() + + if ent and ent.harmed_by_heal then hp = -hp end if hp > 0 then -- at least 1 HP @@ -742,10 +1851,10 @@ function mcl_potions.healing_func(player, hp) hp = 1 end - if obj and obj.is_mob then - obj.health = math.max(obj.health + hp, obj.hp_max) - elseif player:is_player() then - player:set_hp(math.min(player:get_hp() + hp, player:get_properties().hp_max), { type = "set_hp", other = "healing" }) + if ent and ent.is_mob then + ent.health = math.min(ent.health + hp, ent.hp_max) + elseif object:is_player() then + object:set_hp(math.min(object:get_hp() + hp, object:get_properties().hp_max), { type = "set_hp", other = "healing" }) end elseif hp < 0 then @@ -753,330 +1862,57 @@ function mcl_potions.healing_func(player, hp) hp = -1 end - mcl_util.deal_damage(player, -hp, {type = "magic"}) + mcl_util.deal_damage(object, -hp, {type = "magic"}) end - end -function mcl_potions.swiftness_func(player, factor, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - if not player:get_meta() then - return false - end - - if not EF.swift[player] then - - EF.swift[player] = {dur = duration, timer = 0, is_slow = factor < 1} - playerphysics.add_physics_factor(player, "speed", "mcl_potions:swiftness", factor) - - else - - local victim = EF.swift[player] - - playerphysics.add_physics_factor(player, "speed", "mcl_potions:swiftness", factor) - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - victim.is_slow = factor < 1 - - end - - if player:is_player() then - potions_set_icons(player) - end - +function mcl_potions.strength_func(object, factor, duration) + return mcl_potions.give_effect("strength", object, factor, duration) +end +function mcl_potions.leaping_func(object, factor, duration) + return mcl_potions.give_effect("leaping", object, factor, duration) +end +function mcl_potions.weakness_func(object, factor, duration) + return mcl_potions.give_effect("weakness", object, factor, duration) +end +function mcl_potions.swiftness_func(object, factor, duration) + return mcl_potions.give_effect("swiftness", object, factor, duration) +end +function mcl_potions.slowness_func(object, factor, duration) + return mcl_potions.give_effect("slowness", object, factor, duration) end -function mcl_potions.leaping_func(player, factor, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - if not player:get_meta() then - return false - end - - if not EF.leaping[player] then - - EF.leaping[player] = {dur = duration, timer = 0} - playerphysics.add_physics_factor(player, "jump", "mcl_potions:leaping", factor) - - else - - local victim = EF.leaping[player] - - playerphysics.add_physics_factor(player, "jump", "mcl_potions:leaping", factor) - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_icons(player) - end - +function mcl_potions.withering_func(object, factor, duration) + return mcl_potions.give_effect("withering", object, factor, duration) end -function mcl_potions.weakness_func(player, factor, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - if not EF.weak[player] then - - EF.weak[player] = {dur = duration, timer = 0, factor = factor} - - else - - local victim = EF.weak[player] - - victim.factor = factor - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_icons(player) - end - +function mcl_potions.poison_func(object, factor, duration) + return mcl_potions.give_effect("poison", object, factor, duration) end -function mcl_potions.strength_func(player, factor, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - if not EF.strong[player] then - - EF.strong[player] = {dur = duration, timer = 0, factor = factor} - - else - - local victim = EF.strong[player] - - victim.factor = factor - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_icons(player) - end - +function mcl_potions.regeneration_func(object, factor, duration) + return mcl_potions.give_effect("regeneration", object, factor, duration) end -function mcl_potions.withering_func(player, factor, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and (entity.is_boss or string.find(entity.name, "wither")) then return false end - - if not EF.withering[player] then - - EF.withering[player] = {step = factor, dur = duration, timer = 0} - - else - - local victim = EF.withering[player] - - victim.step = math.min(victim.step, factor) - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_hud(player) - end +function mcl_potions.invisiblility_func(object, null, duration) + return mcl_potions.give_effect("invisibility", object, null, duration) +end +function mcl_potions.water_breathing_func(object, null, duration) + return mcl_potions.give_effect("water_breathing", object, null, duration) end -function mcl_potions.poison_func(player, factor, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and (entity.is_boss or entity.harmed_by_heal or string.find(entity.name, "spider")) then return false end - - if not EF.poisoned[player] then - - EF.poisoned[player] = {step = factor, dur = duration, timer = 0} - - else - - local victim = EF.poisoned[player] - - victim.step = math.min(victim.step, factor) - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_hud(player) - end - +function mcl_potions.fire_resistance_func(object, null, duration) + return mcl_potions.give_effect("fire_resistance", object, null, duration) end -function mcl_potions.regeneration_func(player, factor, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and (entity.is_boss or entity.harmed_by_heal) then return false end - - if not EF.regenerating[player] then - - EF.regenerating[player] = {step = factor, dur = duration, timer = 0} - - else - - local victim = EF.regenerating[player] - - victim.step = math.min(victim.step, factor) - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_hud(player) - end - -end - - -function mcl_potions.invisiblility_func(player, null, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - if not EF.invisible[player] then - - EF.invisible[player] = {dur = duration, timer = 0} - mcl_potions.make_invisible(player, true) - - else - - local victim = EF.invisible[player] - - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_icons(player) - end - -end - -function mcl_potions.water_breathing_func(player, null, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - if not EF.water_breathing[player] then - - EF.water_breathing[player] = {dur = duration, timer = 0} - - else - - local victim = EF.water_breathing[player] - - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_icons(player) - end - -end - - -function mcl_potions.fire_resistance_func(player, null, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - if not EF.fire_proof[player] then - - EF.fire_proof[player] = {dur = duration, timer = 0} - - else - - local victim = EF.fire_proof[player] - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - if player:is_player() then - potions_set_icons(player) - end - -end - - -function mcl_potions.night_vision_func(player, null, duration) - - if not player or player:get_hp() <= 0 then return false end - - local entity = player:get_luaentity() - if entity and entity.is_boss then return false end - - meta = player:get_meta() - if not EF.night_vision[player] then - - EF.night_vision[player] = {dur = duration, timer = 0} - - else - - local victim = EF.night_vision[player] - - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - - end - - is_player = player:is_player() - if is_player then - meta:set_int("night_vision", 1) - else - return -- Do not attempt to set night_vision on mobs - end - mcl_weather.skycolor.update_sky_color({player}) - - if player:is_player() then - potions_set_icons(player) - end - +function mcl_potions.night_vision_func(object, null, duration) + return mcl_potions.give_effect("night_vision", object, null, duration) end function mcl_potions._extinguish_nearby_fire(pos, radius) @@ -1130,17 +1966,6 @@ function mcl_potions._extinguish_nearby_fire(pos, radius) return exting end -function mcl_potions.bad_omen_func(player, factor, duration) - if not EF.bad_omen[player] then - EF.bad_omen[player] = {dur = duration, timer = 0, factor = factor} - else - local victim = EF.bad_omen[player] - victim.dur = math.max(duration, victim.dur - victim.timer) - victim.timer = 0 - victim.factor = factor - end - - if player:is_player() then - potions_set_icons(player) - end +function mcl_potions.bad_omen_func(object, factor, duration) + mcl_potions.give_effect("bad_omen", object, factor, duration) end diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 8e4c53cad..446f6ef16 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -8,14 +8,18 @@ mcl_potions = {} -- duration effects of glowstone are a time factor of 1/2 -- splash potion duration effects are reduced by a factor of 3/4 -mcl_potions.II_FACTOR = 2 +mcl_potions.POTENT_FACTOR = 2 mcl_potions.PLUS_FACTOR = 8/3 +mcl_potions.INV_FACTOR = 0.50 mcl_potions.DURATION = 180 -mcl_potions.DURATION_PLUS = mcl_potions.DURATION * mcl_potions.PLUS_FACTOR -mcl_potions.DURATION_2 = mcl_potions.DURATION / mcl_potions.II_FACTOR +mcl_potions.DURATION_INV = mcl_potions.DURATION * mcl_potions.INV_FACTOR +mcl_potions.DURATION_POISON = 45 + +mcl_potions.II_FACTOR = mcl_potions.POTENT_FACTOR -- TODO remove at some point +mcl_potions.DURATION_PLUS = mcl_potions.DURATION * mcl_potions.PLUS_FACTOR -- TODO remove at some point +mcl_potions.DURATION_2 = mcl_potions.DURATION / mcl_potions.II_FACTOR -- TODO remove at some point -mcl_potions.INV_FACTOR = 0.50 mcl_potions.SPLASH_FACTOR = 0.75 mcl_potions.LINGERING_FACTOR = 0.25 @@ -25,6 +29,7 @@ dofile(modpath .. "/splash.lua") dofile(modpath .. "/lingering.lua") dofile(modpath .. "/tipped_arrow.lua") dofile(modpath .. "/potions.lua") +local potions = mcl_potions.registered_potions minetest.register_craftitem("mcl_potions:fermented_spider_eye", { description = S("Fermented Spider Eye"), @@ -332,9 +337,28 @@ minetest.register_craft({ }) + +local output_table = { } + +-- API +-- registers a potion that can be combined with multiple ingredients for different outcomes +-- out_table contains the recipes for those outcomes +function mcl_potions.register_ingredient_potion(input, out_table) + if output_table[input] then + error("Attempt to register the same ingredient twice!") + end + if type(input) ~= "string" then + error("Invalid argument! input must be a string") + end + if type(out_table) ~= "table" then + error("Invalid argument! out_table must be a table") + end + output_table[input] = out_table +end + local water_table = { ["mcl_nether:nether_wart_item"] = "mcl_potions:awkward", - -- ["mcl_potions:fermented_spider_eye"] = "mcl_potions:weakness", + ["mcl_potions:fermented_spider_eye"] = "mcl_potions:weakness", ["mcl_potions:speckled_melon"] = "mcl_potions:mundane", ["mcl_core:sugar"] = "mcl_potions:mundane", ["mcl_mobitems:magma_cream"] = "mcl_potions:mundane", @@ -346,134 +370,270 @@ local water_table = { ["mcl_nether:glowstone_dust"] = "mcl_potions:thick", ["mcl_mobitems:gunpowder"] = "mcl_potions:water_splash" } +-- API +-- register a potion recipe brewed from water +function mcl_potions.register_water_brew(ingr, potion) + if water_table[ingr] then + error("Attempt to register the same ingredient twice!") + end + if type(ingr) ~= "string" then + error("Invalid argument! ingr must be a string") + end + if type(potion) ~= "string" then + error("Invalid argument! potion must be a string") + end + water_table[ingr] = potion +end +mcl_potions.register_ingredient_potion("mcl_potions:river_water", water_table) +mcl_potions.register_ingredient_potion("mcl_potions:water", water_table) local awkward_table = { ["mcl_potions:speckled_melon"] = "mcl_potions:healing", ["mcl_farming:carrot_item_gold"] = "mcl_potions:night_vision", ["mcl_core:sugar"] = "mcl_potions:swiftness", ["mcl_mobitems:magma_cream"] = "mcl_potions:fire_resistance", - -- ["mcl_mobitems:blaze_powder"] = "mcl_potions:strength", + ["mcl_mobitems:blaze_powder"] = "mcl_potions:strength", ["mcl_fishing:pufferfish_raw"] = "mcl_potions:water_breathing", ["mcl_mobitems:ghast_tear"] = "mcl_potions:regeneration", ["mcl_mobitems:spider_eye"] = "mcl_potions:poison", ["mcl_flowers:wither_rose"] = "mcl_potions:withering", ["mcl_mobitems:rabbit_foot"] = "mcl_potions:leaping", + + ["mcl_flowers:fourleaf_clover"] = "mcl_potions:luck", + ["mcl_farming:potato_item_poison"] = "mcl_potions:nausea", + ["mcl_mobitems:spectre_membrane"] = "mcl_potions:slow_falling", + ["mcl_core:apple_gold"] = "mcl_potions:resistance", + ["mcl_mobitems:aery_charge"] = "mcl_potions:haste", + ["mcl_mobitems:crystalline_drop"] = "mcl_potions:absorption", + ["mcl_mobitems:earthen_ash"] = "mcl_potions:stone_cloak", + ["mcl_mobitems:shiny_ice_crystal"] = "mcl_potions:frost", + + -- TODO darkness - sculk? } +-- API +-- register a potion recipe brewed from awkward potion +function mcl_potions.register_awkward_brew(ingr, potion) + if awkward_table[ingr] then + error("Attempt to register the same ingredient twice!") + end + if type(ingr) ~= "string" then + error("Invalid argument! ingr must be a string") + end + if type(potion) ~= "string" then + error("Invalid argument! potion must be a string") + end + awkward_table[ingr] = potion +end +mcl_potions.register_ingredient_potion("mcl_potions:awkward", awkward_table) -local output_table = { - ["mcl_potions:river_water"] = water_table, - ["mcl_potions:water"] = water_table, - ["mcl_potions:awkward"] = awkward_table, +local mundane_table = { + ["mcl_potions:fermented_spider_eye"] = "mcl_potions:weakness", } - - -local enhancement_table = {} -local extension_table = {} -local potions = {} - -for i, potion in ipairs({"healing","harming","swiftness","slowness", - "leaping","poison","regeneration","invisibility","fire_resistance", - -- "weakness","strength", - "water_breathing","night_vision", "withering"}) do - - table.insert(potions, potion) - - if potion ~= "invisibility" and potion ~= "night_vision" and potion ~= "weakness" and potion ~= "water_breathing" and potion ~= "fire_resistance" then - enhancement_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_2" - enhancement_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_2_splash" - table.insert(potions, potion.."_2") +-- API +-- register a potion recipe brewed from mundane potion +function mcl_potions.register_mundane_brew(ingr, potion) + if mundane_table[ingr] then + error("Attempt to register the same ingredient twice!") end - - if potion ~= "healing" and potion ~= "harming" then - extension_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_plus_splash" - extension_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_plus" - table.insert(potions, potion.."_plus") + if type(ingr) ~= "string" then + error("Invalid argument! ingr must be a string") end - + if type(potion) ~= "string" then + error("Invalid argument! potion must be a string") + end + mundane_table[ingr] = potion end +mcl_potions.register_ingredient_potion("mcl_potions:mundane", mundane_table) -for i, potion in ipairs({"awkward", "mundane", "thick", "water"}) do - table.insert(potions, potion) +local thick_table = { + ["mcl_crimson:shroomlight"] = "mcl_potions:glowing", + ["mcl_mobitems:nether_star"] = "mcl_potions:ominous", + ["mcl_mobitems:ink_sac"] = "mcl_potions:blindness", + ["mcl_farming:carrot_item_gold"] = "mcl_potions:saturation", +} +-- API +-- register a potion recipe brewed from thick potion +function mcl_potions.register_thick_brew(ingr, potion) + if thick_table[ingr] then + error("Attempt to register the same ingredient twice!") + end + if type(ingr) ~= "string" then + error("Invalid argument! ingr must be a string") + end + if type(potion) ~= "string" then + error("Invalid argument! potion must be a string") + end + thick_table[ingr] = potion end +mcl_potions.register_ingredient_potion("mcl_potions:thick", thick_table) +local mod_table = { } + +-- API +-- registers a brewing recipe altering the potion using a table +-- this is supposed to substitute one item with another +function mcl_potions.register_table_modifier(ingr, modifier) + if mod_table[ingr] then + error("Attempt to register the same ingredient twice!") + end + if type(ingr) ~= "string" then + error("Invalid argument! ingr must be a string") + end + if type(modifier) ~= "table" then + error("Invalid argument! modifier must be a table") + end + mod_table[ingr] = modifier +end + local inversion_table = { ["mcl_potions:healing"] = "mcl_potions:harming", - ["mcl_potions:healing_2"] = "mcl_potions:harming_2", ["mcl_potions:swiftness"] = "mcl_potions:slowness", - ["mcl_potions:swiftness_plus"] = "mcl_potions:slowness_plus", ["mcl_potions:leaping"] = "mcl_potions:slowness", - ["mcl_potions:leaping_plus"] = "mcl_potions:slowness_plus", ["mcl_potions:night_vision"] = "mcl_potions:invisibility", - ["mcl_potions:night_vision_plus"] = "mcl_potions:invisibility_plus", ["mcl_potions:poison"] = "mcl_potions:harming", - ["mcl_potions:poison_2"] = "mcl_potions:harming_2", - ["mcl_potions:healing_splash"] = "mcl_potions:harming_splash", - ["mcl_potions:healing_2_splash"] = "mcl_potions:harming_2_splash", - ["mcl_potions:swiftness_splash"] = "mcl_potions:slowness_splash", - ["mcl_potions:swiftness_plus_splash"] = "mcl_potions:slowness_plus_splash", - ["mcl_potions:leaping_splash"] = "mcl_potions:slowness_splash", - ["mcl_potions:leaping_plus_splash"] = "mcl_potions:slowness_plus_splash", - ["mcl_potions:night_vision_splash"] = "mcl_potions:invisibility_splash", - ["mcl_potions:night_vision_plus_splash"] = "mcl_potions:invisibility_plus_splash", - ["mcl_potions:poison_splash"] = "mcl_potions:harming_splash", - ["mcl_potions:poison_2_splash"] = "mcl_potions:harming_2_splash", + ["mcl_potions:luck"] = "mcl_potions:bad_luck", + ["mcl_potions:haste"] = "mcl_potions:fatigue", + ["mcl_potions:saturation"] = "mcl_potions:food_poisoning", + ["mcl_potions:slow_falling"] = "mcl_potions:levitation", + ["mcl_potions:absorption"] = "mcl_potions:health_boost", + ["mcl_potions:glowing"] = "mcl_potions:darkness", -- TODO remove after adding a direct recipe? } - +-- API +function mcl_potions.register_inversion_recipe(input, output) + if inversion_table[input] then + error("Attempt to register the same input twice!") + end + if type(input) ~= "string" then + error("Invalid argument! input must be a string") + end + if type(output) ~= "string" then + error("Invalid argument! output must be a string") + end + inversion_table[input] = output +end +local function fill_inversion_table() -- autofills with splash and lingering inversion recipes + local filling_table = { } + for input, output in pairs(inversion_table) do + if potions[input].has_splash and potions[output].has_splash then + filling_table[input.."_splash"] = output .. "_splash" + if potions[input].has_lingering and potions[output].has_lingering then + filling_table[input.."_lingering"] = output .. "_lingering" + end + end + end + table.update(inversion_table, filling_table) + mcl_potions.register_table_modifier("mcl_potions:fermented_spider_eye", inversion_table) +end +minetest.register_on_mods_loaded(fill_inversion_table) local splash_table = {} local lingering_table = {} +for potion, def in pairs(potions) do + if def.has_splash then + splash_table[potion] = potion.."_splash" + if def.has_lingering then + lingering_table[potion.."_splash"] = potion.."_lingering" + end + end +end +mcl_potions.register_table_modifier("mcl_mobitems:gunpowder", splash_table) +mcl_potions.register_table_modifier("mcl_potions:dragon_breath", lingering_table) -for i, potion in ipairs(potions) do - splash_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_splash" - lingering_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_lingering" + +local meta_mod_table = { } + +-- API +-- registers a brewing recipe altering the potion using a function +-- this is supposed to be a recipe that changes metadata only +function mcl_potions.register_meta_modifier(ingr, mod_func) + if meta_mod_table[ingr] then + error("Attempt to register the same ingredient twice!") + end + if type(ingr) ~= "string" then + error("Invalid argument! ingr must be a string") + end + if type(mod_func) ~= "function" then + error("Invalid argument! mod_func must be a function") + end + meta_mod_table[ingr] = mod_func end +local function extend_dur(potionstack) + local def = potions[potionstack:get_name()] + if not def then return false end + if not def.has_plus then return false end -- bail out if can't be extended + local potionstack = ItemStack(potionstack) + local meta = potionstack:get_meta() + local potent = meta:get_int("mcl_potions:potion_potent") + local plus = meta:get_int("mcl_potions:potion_plus") + if plus == 0 then + if potent ~= 0 then + meta:set_int("mcl_potions:potion_potent", 0) + end + meta:set_int("mcl_potions:potion_plus", def._default_extend_level) + tt.reload_itemstack_description(potionstack) + return potionstack + end + return false +end +mcl_potions.register_meta_modifier("mesecons:wire_00000000_off", extend_dur) -local mod_table = { - ["mesecons:wire_00000000_off"] = extension_table, - ["mcl_potions:fermented_spider_eye"] = inversion_table, - ["mcl_nether:glowstone_dust"] = enhancement_table, - ["mcl_mobitems:gunpowder"] = splash_table, - ["mcl_potions:dragon_breath"] = lingering_table, -} +local function enhance_pow(potionstack) + local def = potions[potionstack:get_name()] + if not def then return false end + if not def.has_potent then return false end -- bail out if has no potent variant + local potionstack = ItemStack(potionstack) + local meta = potionstack:get_meta() + local potent = meta:get_int("mcl_potions:potion_potent") + local plus = meta:get_int("mcl_potions:potion_plus") + if potent == 0 then + if plus ~= 0 then + meta:set_int("mcl_potions:potion_plus", 0) + end + meta:set_int("mcl_potions:potion_potent", def._default_potent_level-1) + tt.reload_itemstack_description(potionstack) + return potionstack + end + return false +end +mcl_potions.register_meta_modifier("mcl_nether:glowstone_dust", enhance_pow) --- Compare two ingredients for compatable alchemy + +-- Find an alchemical recipe for given ingredient and potion +-- returns outcome function mcl_potions.get_alchemy(ingr, pot) - if output_table[pot] then + local brew_selector = output_table[pot:get_name()] + if brew_selector and brew_selector[ingr] then + local meta = pot:get_meta():to_table() + local alchemy = ItemStack(brew_selector[ingr]) + local metaref = alchemy:get_meta() + metaref:from_table(meta) + tt.reload_itemstack_description(alchemy) + return alchemy + end - local brew_table = output_table[pot] - - if brew_table[ingr] then - return brew_table[ingr] + brew_selector = mod_table[ingr] + if brew_selector then + local brew = brew_selector[pot:get_name()] + if brew then + local meta = pot:get_meta():to_table() + local alchemy = ItemStack(brew) + local metaref = alchemy:get_meta() + metaref:from_table(meta) + tt.reload_itemstack_description(alchemy) + return alchemy end end - if mod_table[ingr] then - - local brew_table = mod_table[ingr] - - if brew_table[pot] then - return brew_table[pot] - end - + if meta_mod_table[ingr] then + local brew_func = meta_mod_table[ingr] + if brew_func then return brew_func(pot) end end return false end -mcl_mobs.effect_functions["poison"] = mcl_potions.poison_func -mcl_mobs.effect_functions["regeneration"] = mcl_potions.regeneration_func -mcl_mobs.effect_functions["invisibility"] = mcl_potions.invisiblility_func -mcl_mobs.effect_functions["fire_resistance"] = mcl_potions.fire_resistance_func -mcl_mobs.effect_functions["night_vision"] = mcl_potions.night_vision_func -mcl_mobs.effect_functions["water_breathing"] = mcl_potions.water_breathing_func -mcl_mobs.effect_functions["leaping"] = mcl_potions.leaping_func -mcl_mobs.effect_functions["swiftness"] = mcl_potions.swiftness_func -mcl_mobs.effect_functions["heal"] = mcl_potions.healing_func -mcl_mobs.effect_functions["bad_omen"] = mcl_potions.bad_omen_func -mcl_mobs.effect_functions["withering"] = mcl_potions.withering_func - -- give withering to players in a wither rose local etime = 0 minetest.register_globalstep(function(dtime) @@ -488,10 +648,6 @@ minetest.register_globalstep(function(dtime) end) mcl_wip.register_wip_item("mcl_potions:night_vision") -mcl_wip.register_wip_item("mcl_potions:night_vision_plus") mcl_wip.register_wip_item("mcl_potions:night_vision_splash") -mcl_wip.register_wip_item("mcl_potions:night_vision_plus_splash") mcl_wip.register_wip_item("mcl_potions:night_vision_lingering") -mcl_wip.register_wip_item("mcl_potions:night_vision_plus_lingering") mcl_wip.register_wip_item("mcl_potions:night_vision_arrow") -mcl_wip.register_wip_item("mcl_potions:night_vision_plus_arrow") diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 46d94cad3..20ed84850 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -11,8 +11,8 @@ end local lingering_effect_at = {} -local function add_lingering_effect(pos, color, def, is_water, instant) - lingering_effect_at[pos] = {color = color, timer = 30, def = def, is_water = is_water} +local function add_lingering_effect(pos, color, def, is_water, potency, plus) + lingering_effect_at[pos] = {color = color, timer = 30, def = def, is_water = is_water, potency = potency, plus = plus} end local function linger_particles(pos, d, texture, color) @@ -55,23 +55,56 @@ minetest.register_globalstep(function(dtime) end linger_particles(pos, d, texture, vals.color) - -- Extinguish fire if water bottle - if vals.is_water then - if mcl_potions._extinguish_nearby_fire(pos, d) then - vals.timer = vals.timer - 3.25 - end +-- -- Extinguish fire if water bottle +-- if vals.is_water then +-- if mcl_potions._extinguish_nearby_fire(pos, d) then +-- vals.timer = vals.timer - 3.25 +-- end +-- end + + if vals.def.while_lingering and vals.def.while_lingering(pos, d, vals.potency+1) then + vals.timer = vals.timer - 3.25 end -- Affect players and mobs for _, obj in pairs(minetest.get_objects_inside_radius(pos, d)) do local entity = obj:get_luaentity() - if obj:is_player() or entity.is_mob then + if obj:is_player() or entity and entity.is_mob then + local applied = false + if vals.def._effect_list then + local ef_level + local dur + for name, details in pairs(vals.def._effect_list) do + if details.uses_level then + ef_level = details.level + details.level_scaling * (vals.potency) + else + ef_level = details.level + end + if details.dur_variable then + dur = details.dur * math.pow(mcl_potions.PLUS_FACTOR, vals.plus) + if vals.potency>0 and details.uses_level then + dur = dur / math.pow(mcl_potions.POTENT_FACTOR, vals.potency) + end + dur = dur * mcl_potions.LINGERING_FACTOR + else + dur = details.dur + end + if details.effect_stacks then + ef_level = ef_level + mcl_potions.get_effect_level(obj, name) + end + if mcl_potions.give_effect_by_level(name, obj, ef_level, dur) then + applied = true + end + end + end - vals.def.potion_fun(obj) - -- TODO: Apply timer penalty only if the potion effect was acutally applied - vals.timer = vals.timer - 3.25 + if vals.def.custom_effect + and vals.def.custom_effect(obj, (vals.potency+1) * mcl_potions.LINGERING_FACTOR, plus) then + applied = true + end + if applied then vals.timer = vals.timer - 3.25 end end end @@ -87,31 +120,44 @@ end) function mcl_potions.register_lingering(name, descr, color, def) - local id = "mcl_potions:"..name.."_lingering" - local longdesc = def.longdesc + local longdesc = def._longdesc if not def.no_effect then - longdesc = S("A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.") + longdesc = S("A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect or set of effects, possibly repeatedly.") if def.longdesc then - longdesc = longdesc .. "\n" .. def.longdesc + longdesc = longdesc .. "\n" .. def._longdesc end end + local groups = {brewitem=1, bottle=1, ling_potion=1, _mcl_potion=1} + if def.nocreative then groups.not_in_creative_inventory = 1 end minetest.register_craftitem(id, { description = descr, - _tt_help = def.tt, + _tt_help = def._tt, + _dynamic_tt = def._dynamic_tt, _doc_items_longdesc = longdesc, _doc_items_usagehelp = S("Use the “Punch” key to throw it."), + stack_max = def.stack_max, + _effect_list = def._effect_list, + uses_level = def.uses_level, + has_potent = def.has_potent, + has_plus = def.has_plus, + _default_potent_level = def._default_potent_level, + _default_extend_level = def._default_extend_level, inventory_image = lingering_image(color), - groups = {brewitem=1, not_in_creative_inventory=0, bottle=1}, + groups = groups, on_use = function(item, placer, pointed_thing) local velocity = 10 local dir = placer:get_look_dir(); local pos = placer:getpos(); minetest.sound_play("mcl_throwing_throw", {pos = pos, gain = 0.4, max_hear_distance = 16}, true) local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") - obj:setvelocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) - obj:setacceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) - obj:get_luaentity()._thrower = placer:get_player_name() + obj:set_velocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) + obj:set_acceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) + local ent = obj:get_luaentity() + ent._thrower = placer:get_player_name() + ent._potency = item:get_meta():get_int("mcl_potions:potion_potent") + ent._plus = item:get_meta():get_int("mcl_potions:potion_plus") + ent._effect_list = def._effect_list if not minetest.is_creative_enabled(placer:get_player_name()) then item:take_item() end @@ -126,6 +172,10 @@ function mcl_potions.register_lingering(name, descr, color, def) local velocity = 22 obj:set_velocity({x=dropdir.x*velocity,y=dropdir.y*velocity,z=dropdir.z*velocity}) obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3}) + local ent = obj:get_luaentity() + ent._potency = stack:get_meta():get_int("mcl_potions:potion_potent") + ent._plus = stack:get_meta():get_int("mcl_potions:potion_plus") + ent._effect_list = def._effect_list end }) @@ -148,7 +198,9 @@ function mcl_potions.register_lingering(name, descr, color, def) end if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) - add_lingering_effect(pos, color, def, name == "water") + local potency = self._potency or 0 + local plus = self._plus or 0 + add_lingering_effect(pos, color, def, name == "water", potency, plus) local texture if name == "water" then texture = "mcl_particles_droplet_bottle.png" @@ -160,9 +212,7 @@ function mcl_potions.register_lingering(name, descr, color, def) end end linger_particles(pos, d, texture, color) - if name == "water" then - mcl_potions._extinguish_nearby_fire(pos, d) - end + if def.on_splash then def.on_splash(pos, potency+1) end self.object:remove() end end, diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr index 3122ff3fe..a9106e92a 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr @@ -1,27 +1,283 @@ # textdomain: mcl_potions - []= [] +Invisibility=Invisibilité +body is invisible=le corps est invisible + +Poison=Poison +-1 HP / @1 s=-1 PV / @1 s + +Regeneration=Régénération ++1 HP / @1 s=+1 PV / @1 s + +Strength=Force ++@1% melee damage=+@1% dégâts de mêlée + +Weakness=Faiblesse +-@1% melee damage=-@1% dégâts de mêlée + +Water Breathing=Respiration aquatique +limitless breathing under water=respiration illimitée sous l'eau + +Dolphin's Grace=Grâce du dauphin +swimming gracefully=nage gracieuse + +Leaping=Saut ++@1% jumping power=+@1% puissance de saut +-@1% jumping power=-@1% puissance de saut + +Slow Falling=Chute lente +decreases gravity effects=diminue les effets de la gravité + +Swiftness=Rapidité ++@1% running speed=+@1% vitesse de course + +Slowness=Lenteur +-@1% running speed=-@1% vitesse de course + +Levitation=Lévitation +moves body upwards at @1 nodes/s=déplace le corps vers le haut à @1 nœuds/s + +Night Vision=Vision nocturne +improved vision during the night=améliore la vision durant la nuit + +Darkness=Obscurité +surrounded by darkness=entouré d'obscurité +not seeing anything beyond @1 nodes=ne vois rien au-delà de @1 nœuds + +Glowing=Surbrillance +more visible at all times=plus visible en permanence + +Health Boost=Bonus de santé +HP increased by @1=PV augmentés de @1 + +Absorption=Absorption +absorbs up to @1 incoming damage=absorbe jusqu'à @1 dégâts reçus + +Fire Resistance=Résistance au feu +resistance to fire damage=resistance aux dégâts du feu + +Resistance=Résistance +resist @1% of incoming damage=résiste à @1% des dégâts reçus + +Luck=Chance + +Bad Luck=Malchance + +Bad Omen=Mauvais présage +danger is imminent=un danger est imminent + +Hero of the Village=Héros du village + +Withering=Dépérissement +-1 HP / @1 s, can kill=-1 PV / @1 s, peut tuer + +Frost=Gel +-1 HP / 1 s, can kill, -@1% running speed=-1 PV / @1 s, peut tuer, -@1% vitesse de course + +Blindness=Cécité +impaired sight=déficience visuelle + +Nausea=Nausée +not feeling very well...=ne se sent pas très bien +frequency: @1 / 1 s=fréquence : @1 / 1 s + +Food Poisoning=Intoxication alimentaire +exhausts by @1 per second=s'épuise de @1 par seconde + +Saturation=Saturation +saturates by @1 per second=sature de @1 par seconde + +Haste=Célérité ++@1% mining and attack speed=+@1% de vitesse d'attaque et de minage + +Fatigue=Fatigue +-@1% mining and attack speed=-@1% de vitesse d'attaque et de minage + +Conduit Power=Force de conduit ++@1% mining and attack speed in water=+@1% de vitesse d'attaque et de minage sous l'eau + + +|heal|list|clear|remove |INF [] [] [NOPART]=|heal|list|clear|remove |INF [] [] [NOPART] + +Add a status effect to yourself. Arguments: : name of status effect. Passing "list" as effect name lists available effects. Passing "heal" as effect name heals (or harms) by amount designed by the next parameter. Passing "clear" as effect name removes all effects. Passing "remove" as effect name removes the effect named by the next parameter. : duration in seconds. Passing "INF" as duration makes the effect infinite. (: amount of healing when the effect is "heal", passing a negative value subtracts health. : name of a status effect to be removed when using "remove" as the previous parameter.) : effect power determinant, bigger level results in more powerful effect for effects that depend on the level (no changes for other effects), defaults to 1, pass F to use low-level factor instead. : effect strength modifier, can mean different things depending on the effect, no changes for effects that do not depend on level/factor. NOPART at the end means no particles will be shown for this effect.=Ajoute un effet de statut à vous-même. Arguments : : nom de l'effet de statut. Utiliser "list" comme nom d'effet liste les effets disponibles. Utiliser "heal" comme nom d'effet soigne (ou blesse) d'un nombre défini par le paramètre suivant. Utiliser "clear" comme nom d'effet enleve tous les effets. Utiliser "remove" comme nom d'effet enlève l'effet nommé dans le paramètre suivant. : durée en secondes. Utiliser "INF" comme durée rends l'effet infini. ( : quantité de soin lorsque l'effet est "heal", utiliser une valeur négative enlève de la santé. : nom de l'effet de statut à enlever lors de l'utilisation de "remove" comme paramètre précédent.) : détermine la puissance de l'effet, un niveau plus élevé se traduit par un effet plus puissant pour les effets qui dépendent du niveau (aucun changement pour les autres effets), défaut à 1, utiliser F pour utiliser un facteur de bas niveau à la place. : effet modificateur de force, peut avoir différentes significations en fonction de l'effet, pas de changement pour les effets qui ne dépendent pas du niveau/facteur. NOPART à la fin signifie qu'aucune particule ne sera affichée pour cet effet. + +Missing effect parameter!=Paramètre d'effet manquant ! +Missing or invalid heal amount parameter!=Paramètre de quantité de soin manquant ou invalide ! +Player @1 healed by @2 HP.=Joueur @1 soigné de @2 PV. +Player @1 harmed by @2 HP.=Joueur @1 blessé de @2 PV. +Effects cleared for player @1=Effets effacés pour le joueur @1 +Removed effect @1 from player @2=Effet @1 enlevé pour le joueur @2 +@1 is not an available status effect.=@1 n'est pas un effet de statut disponible. +Missing or invalid duration parameter!=Paramètre de durée manquant ou invalide ! +Invalid level parameter!=Paramètre de niveau invalide ! +Missing or invalid factor parameter when level is F!=Paramètre de facteur manquant ou invalide quand le niveau est F! + +@1 effect given to player @2 for @3 seconds with factor of @4.=Effet @1 donné au joueur @2 pour @3 seconds avec un facteur de @4. +@1 effect given to player @2 for @3 seconds.=Effet @1 donné au joueur @2 pour @3 seconds. +Giving effect @1 to player @2 failed.=L'attribution de l'effet @1 au joueur @2 a échoué. +@1 effect on level @2 given to player @3 for @4 seconds.=Effet @1 de niveau @2 donné au joueur @3 pendant @4 secondes. + + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect or a set of status effects.=Une potion jetable qui se brisera à l'impact, où elle donne à tous les joueurs et créatures proches un effet de statut ou un ensemble d'effets de statut. +Use the “Punch” key to throw it.=Utilisez la touche "Frapper" pour la lancer. + + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect or set of effects, possibly repeatedly.=Une potion jetable qui se brisera à l'impact, où elle crée un nuage magique qui persiste pendant un moment. Tout joueur ou mob à l'intérieur du nuage recevra l'effet de la potion ou un ensemble d'effets, peut-être à plusieurs reprises. + + +This particular arrow is tipped and will give an effect when it hits a player or mob.=Cette flèche particulière est enchantée et donnera un effet lorsqu'elle touche un joueur ou un mob. + + +Use the “Place” key to drink it.=Utilisez la touche "Utiliser" pour la boire. +Drinking a potion gives you a particular effect or set of effects.=Boire une potion vous donne un effet particulier ou un ensemble d'effets. + +@1 Potion @2=@1 potion @2 +@1 Potion=Potion @1 +Potion @1=Potion @1 +Strange Potion=Potion étrange + +Splash @1=@1 jetable +Lingering @1=@1 persistante +@1 Arrow @2=@1 flèche @2 +@1 Arrow=Flèche @1 +Arrow @1=Flèche @1 +Strange Tipped Arrow=Flèche à pointe étrange + +Mighty=puissante +of Trolling=de trollage + +Dragon's Breath=Souffle du dragon +This item is used in brewing and can be combined with splash potions to create lingering potions.=Cet objet est utilisé dans le brassage et peut être combiné avec des potions jetables pour créer des potions persistantes. + +Awkward=étrange +No effect=Aucun effet +Has an awkward taste and is used for brewing potions.=A un goût étrange et est utilisée pour préparer des potions. + +Mundane=banale +Has a terrible taste and is not really useful for brewing potions.=A un goût terrible et n'est pas vraiment utile pour préparer des potions. + +Thick=épaisse +Has a bitter taste and may be useful for brewing potions.=A un goût amer et peut être utile pour préparer des potions. + +of Healing=de guérison ++@1 HP=+@1 PV +Instantly heals.=Guérit instantanément + +of Harming=de dégâts +-@1 HP=-@1 PV +Instantly deals damage.=Inflige des dégâts instantanément. + +of Night Vision=de vision nocturne +Increases the perceived brightness of light under a dark sky.=Augmente la luminosité de la lumière perçue sous un ciel sombre. + +of Swiftness=de rapidité +Increases walking speed.=Augmente la vitesse de marche. + +of Slowness=de lenteur +Decreases walking speed.=Diminue la vitesse de marche. + +of Leaping=de saut +Increases jump strength.=Augmente la force de saut. + +of Withering=de dépérissement +Applies the withering effect which deals damage at a regular interval and can kill.=Applique l'effet de dépérissement qui inflige des dégâts à intervalles réguliers et peut tuer. + +of Poison=de poison +Applies the poison effect which deals damage at a regular interval.=Applique l'effet de poison qui inflige des dégâts à intervalles réguliers. + +of Regeneration=de régénération +Regenerates health over time.=Régénère la santé au fil du temps. + +of Invisibility=d'invisibilité +Grants invisibility.=Confère l'invisibilité. + +of Water Breathing=de respiration aquatique +Grants limitless breath underwater.=Confère une respiration illimitée sous l'eau. + +of Fire Resistance=de résistance au feu +Grants immunity to damage from heat sources like fire.=Confère une immunité aux dégâts causés par des sources de chaleur comme le feu. + +of Strength=de force +Increases attack power.=Augmente la puissance d'attaque. + +of Weakness=de faiblesse +Decreases attack power.=Diminue la puissance d'attaque. + +of Slow Falling=de chute lente +Instead of falling, you descend gracefully.=Au lieu de tomber, vous descendez avec grâce. + +of Levitation=de lévitation +Floats body slowly upwards.=Le corps flotte lentement vers le haut. + +of Darkness=d'obscurité +Surrounds with darkness.=Entoure d'obscurité. + +of Glowing=de surbrillance +Highlights for others to see.=Mise en valeur pour que les autres voient. + +of Health Boost=de bonus de santé +Increases health.=Augmente la santé. + +of Absorption=d'absorption +Absorbs some incoming damage.=Absorbe les dégâts reçus. + +of Resistance=de résistance +Decreases damage taken.=Diminue les dégâts subis. + +of Stone Cloak=de manteau de pierre +Decreases damage taken at the cost of speed.=Diminue les dégâts subis au détriment de la vitesse. + +of Luck=de chance +Increases luck.=Augmente la chance. + +of Bad Luck=de malchance +Decreases luck.=Diminue la chance. + +of Frost=de gel +Freezes...=Gèle... + +of Blindness=de cécité +Impairs sight.=Altére la vue. + +of Nausea=de nausée +Disintegrates senses.=Désintègre les sens. + +of Food Poisoning=d'intoxication alimentaire +Moves bowels too fast.=Déplace les intestins trop rapidement. + +of Saturation=de saturation +Satisfies hunger.=Satisfait la faim. + +of Haste=de célérité +Increases digging and attack speed.=Augmente la vitesse de creusage et d'attaque. + +of Fatigue=de fatigue +Decreases digging and attack speed.=Diminue la vitesse de creusage et d'attaque. + +Ominous=funeste +Attracts danger.=Attire le danger. + +Unknown Potion=Potion inconnue +Right-click to identify=Clic droit pour identifier +Unknown Tipped Arrow=Flèche à pointe inconnue -Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)=Ajoutez-vous un effet de statut. Arguments: : nom de l'effet de statut, par ex. poison. : durée en secondes. : multiplicateur de force d'effet (1 @= 100%) -Missing effect parameter!=Paramètre d'effet manquant! -Missing or invalid duration parameter!=Paramètre durée manquant ou invalide! -Invalid factor parameter!=Paramètre facteur invalide! -@1 is not an available status effect.=@1 n'est pas un effet disponible. Fermented Spider Eye=Oeil d'araignée fermenté +Try different combinations to create potions.=Essayez différentes combinaisons pour créer des potions. + Glass Bottle=Bouteille en verre Liquid container=Récipient de liquide -A glass bottle is used as a container for liquids and can be used to collect water directly.=Une bouteille en verre est utilisée comme récipient pour les liquides et peut être utilisée pour collecter l'eau directement. +A glass bottle is used as a container for liquids and can be used to collect water directly.=Une bouteille en verre est utilisée comme récipient pour les liquides et peut être utilisée pour recueillir l'eau directement. -To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Pour collecter l'eau, poser la sur un chaudron avec de l'eau (qui enlève un niveau d'eau) ou toute source d'eau (qui n'enlève pas d'eau). +To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Pour récolter l'eau, utilisez la sur un chaudron avec de l'eau (qui enlève un niveau d'eau) ou toute source d'eau (qui n'enlève pas d'eau). Water Bottle=Bouteille d'eau -Water bottles can be used to fill cauldrons. Drinking water has no effect.=Les bouteilles d'eau peuvent être utilisées pour remplir les chaudrons. L'eau potable n'a aucun effet. +Water bottles can be used to fill cauldrons. Drinking water has no effect.=Les bouteilles d'eau peuvent être utilisées pour remplir les chaudrons. Boire l'eau n'a aucun effet. Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Utilisez la touche "Utiliser" pour boire. Placez cet article sur un chaudron pour verser l'eau dans le chaudron. River Water Bottle=Bouteille d'eau de rivière -River water bottles can be used to fill cauldrons. Drinking it has no effect.=Les bouteilles d'eau de rivière peuvent être utilisées pour remplir les chaudrons. Le boire n'a aucun effet. +River water bottles can be used to fill cauldrons. Drinking it has no effect.=Les bouteilles d'eau de rivière peuvent être utilisées pour remplir les chaudrons. La boire n'a aucun effet. Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Utilisez la touche "Utiliser" pour boire. Placez cet objet sur un chaudron pour verser l'eau de la rivière dans le chaudron. @@ -37,79 +293,3 @@ A throwable water bottle that will shatter on impact, where it creates a cloud o Glistering Melon=Melon étincelant This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Ce melon brillant est plein de minuscules pépites d'or et serait bien dans un cadre d'objet. Il n'est pas comestible et n'est utile à rien d'autre. - -A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.=Une potion jetable qui se brisera à l'impact, où elle crée un nuage magique qui persiste pendant un moment. Tout joueur ou mob à l'intérieur du nuage recevra l'effet de la potion, peut-être à plusieurs reprises. - -Use the “Punch” key to throw it.=Utilisez la touche "Frapper" pour le lancer. -Use the “Place” key to drink it.=Utilisez la touche "Utiliser" pour le boire. -Drinking a potion gives you a particular effect.=Boire une potion vous donne un effet particulier. -1 HP/@1s | @2=1 PV/@1s | @2 -@1 HP=@1 PV -@1 Potion=Potion @1 -Splash @1 Potion=Potion @1 jetable -Lingering @1 Potion=Potion @1 persistante -Arrow of @1=Flêche de @1 - II= II - IV= IV -@1 Potion@2=@1 Potion@2 -Splash @1@2 Potion=Potion @1@2 jetable -Lingering @1@2 Potion=Potion @1@2 persistante -Arrow of @1@2=Flêche de @1@2 -@1 + Potion=@1 + Potion -Splash @1 + Potion=Potion @1 + jetable -Lingering @1 + Potion=Potion @1 + persistante -Arrow of @1 +=Flêche de @1 + -Awkward Potion=Potion étrange -Awkward Splash Potion=Potion étrange jetable -Awkward Lingering Potion=Potion étrange persistante -Has an awkward taste and is used for brewing potions.=A un goût étrange et est utilisé pour préparer des potions. -Mundane Potion=Potion banale -Mundane Splash Potion=Potion banale jetable -Mundane Lingering Potion=Potion banale persistante -Has a terrible taste and is not useful for brewing potions.=A un goût terrible et n'est pas utile pour préparer des potions. -Thick Potion=Potion épaisse -Thick Splash Potion=Potion épaisse jetable -Thick Lingering Potion=Potion épaisse persistante -Has a bitter taste and is not useful for brewing potions.=A un goût amer et n'est pas utile pour préparer des potions. -Dragon's Breath=Souffle du dragon - -This item is used in brewing and can be combined with splash potions to create lingering potions.=Cet objet est utilisé dans le brassage et peut être combiné avec des potions d'éclaboussures pour créer des potions persistantes. - -Healing=Guérison -+4 HP=+4 PV -+8 HP=+8 PV -Instantly heals.=Guérit instantanément. -Harming=Dégâts --6 HP=-6 PV --12 HP=-12 PV -Instantly deals damage.=Donne des dégâts instantanément. -Night Vision=Vision Nocturne -Increases the perceived brightness of light under a dark sky.=Augmente la luminosité perçue de la lumière sous un ciel sombre. -Swiftness=Rapidité -Increases walking speed.=Augmente la vitesse de marche. -Slowness=Lenteur -Decreases walking speed.=Diminue la vitesse de marche. -Leaping=Saut -Increases jump strength.=Augmente la force de saut. -Poison=Poison -Applies the poison effect which deals damage at a regular interval.=Applique l'effet de poison qui inflige des dégâts à intervalle régulier. -Regeneration=Régénération -Regenerates health over time.=Régénère la santé au fil du temps. -Invisibility=Invisibilité -Grants invisibility.=Accorde l'invisibilité. -Water Breathing=Respiration aquatique -Grants limitless breath underwater.=Donne une respiration illimitée sous l'eau. -Fire Resistance=Résistance au feu -Grants immunity to damage from heat sources like fire.=Confère une immunité aux dégâts causés par des sources de chaleur comme le feu. -Weakness=Faiblesse -Weakness +=Faiblesse + -Strength=Force -Strength II=Force II -Strength +=Force + -Try different combinations to create potions.=Essayez différentes combinaisons pour créer des potions. -No effect=Aucun effet - -A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Une potion jetable qui se brisera à l'impact, où elle donne à tous les joueurs et créatures proches un effet de statut. - -This particular arrow is tipped and will give an effect when it hits a player or mob.=Cette flèche particulière est enchantée et donnera un effet lorsqu'elle touche un joueur ou un mob. - diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.pl.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.pl.tr index abf61d4d3..db835bd9e 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.pl.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.pl.tr @@ -1,115 +1,294 @@ # textdomain: mcl_potions - []= [] +Invisibility=Niewidzialność +body is invisible=ciało jest niewidzialne + +Poison=Trucizna +-1 HP / @1 s=-1 PŻ / @1 s + +Regeneration=Regeneracja ++1 HP / @1 s=+1 PŻ / @1 s + +Strength=Siła ++@1% melee damage=+@1% obrażeń w walce wręcz + +Weakness=Osłabienie +-@1% melee damage=-@1% obrażeń w walce wręcz + +Water Breathing=Oddychanie pod Wodą +limitless breathing under water=nieograniczone oddychanie pod wodą + +Dolphin's Grace=Gracja Delfina +swimming gracefully=pływanie z gracją + +Leaping=Zwiększony Skok ++@1% jumping power=+@1% siły skoku +-@1% jumping power=-@1% siły skoku + +Slow Falling=Powolne Opadanie +decreases gravity effects=zmniejsza skutki grawitacji + +Swiftness=Szybkość ++@1% running speed=+@1% prędkości w biegu + +Slowness=Spowolnienie +-@1% running speed=-@1% prędkości w biegu + +Levitation=Lewitacja +moves body upwards at @1 nodes/s=porusza ciało w górę z prędkością @1 bloków/s + +Night Vision=Noktowizja +improved vision during the night=poprawione widzenie w nocy + +Darkness=Ciemność +surrounded by darkness=otoczony ciemnością +not seeing anything beyond @1 nodes=nie widzi nic poza @1 blokami + +Glowing=Blask +more visible at all times=bardziej widoczny przez cały czas + +Health Boost=Zwiększone Zdrowie +HP increased by @1=PŻ zwiększone o @1 + +Absorption=Absorpcja +absorbs up to @1 incoming damage=pochłania do @1 otrzymywanych obrażeń + +Fire Resistance=Odporność na Ogień +resistance to fire damage=odporność na szkody od ognia + +Resistance=Odporność +resist @1% of incoming damage=zmniejsza otrzymywane obrażenia o @1% + +Luck=Szczęście + +Bad Luck=Pech + +Bad Omen=Zły Omen +danger is imminent=zagrożenie jest blisko + +Hero of the Village=Bohater Wioski + +Withering=Obumieranie +-1 HP / @1 s, can kill=-1 PŻ / @1 s, może zabić + +Frost=Mróz +-1 HP / 1 s, can kill, -@1% running speed=-1 PŻ / 1 s, może zabić, -@1% prędkości w biegu + +Blindness=Ślepota +impaired sight=upośledzony wzrok + +Nausea=Nudności +not feeling very well...=nie czuje się zbyt dobrze +frequency: @1 / 1 s=częstotliwość: @1 / 1 s + +Food Poisoning=Zatrucie Pokarmowe +exhausts by @1 per second=wyczerpuje o @1 na sekundę + +Saturation=Nasycenie +saturates by @1 per second=nasyca o @1 na sekundę + +Haste=Pośpiech ++@1% mining and attack speed=+@1% prędkości kopania i ataku + +Fatigue=Zmęczenie +-@1% mining and attack speed=-@1% prędkości kopania i ataku + +Conduit Power=Moc Przewodni ++@1% mining and attack speed in water=+@1% prędkości kopania i ataku w wodzie + + +|heal|list|clear|remove |INF [] [] [NOPART]=|heal|list|clear|remove |INF [] [] [NOPART] + +Add a status effect to yourself. Arguments: : name of status effect. Passing "list" as effect name lists available effects. Passing "heal" as effect name heals (or harms) by amount designed by the next parameter. Passing "clear" as effect name removes all effects. Passing "remove" as effect name removes the effect named by the next parameter. : duration in seconds. Passing "INF" as duration makes the effect infinite. (: amount of healing when the effect is "heal", passing a negative value subtracts health. : name of a status effect to be removed when using "remove" as the previous parameter.) : effect power determinant, bigger level results in more powerful effect for effects that depend on the level (no changes for other effects), defaults to 1, pass F to use low-level factor instead. : effect strength modifier, can mean different things depending on the effect, no changes for effects that do not depend on level/factor. NOPART at the end means no particles will be shown for this effect.=Nadaj efekt statusu dla samego siebie. Argumenty: : nazwa efektu statusu (po angielsku). Przekazanie "list" jako nazwa efektu wypisuje dostępne nazwy efektów. Przekazanie "heal" jako nazwa efektu leczy (albo krzywdzi) o ilość określoną następnym parametrem. Przekazanie "clear" jako nazwy efektu usuwa wszystkie efekty. Przekazanie "remove" jako nazwy efektu usuwa efekt określony następnym parametrem. : czas trwania w sekundach. Przekazanie "INF" jako czas trwania czyni efekt nieskończonym. (: ilość leczenia kiedy ID-efektu to "heal", przekazanie liczby ujemnej zabiera zdrowie. : nazwa efektu statusu do usunięcia używając "remove" jako poprzedniego parametru.) : wyznacznik siły efektu, wyższy poziom skutkuje potężniejszym efektem prze efektach zależnych od poziomu (brak zmiany przy pozostałych), domyślnie 1, przekaż F żeby użyć niskopoziomowego współczynnika zamiast poziomu. : modyfikator siły efektu, może oznaczać różne rzeczy dla różnych efektów, nie wpływa na efekty, które nie zależą od poziomu/współczynnika. NOPART na końcu oznacza, że cząsteczki nie będą wyświetlane wokół ciebie dla tego efektu. + +Missing effect parameter!=Brakujący ID efektu! +Missing or invalid heal amount parameter!=Brakująca lub niewłaściwa ilość leczenia! +Player @1 healed by @2 HP.=Gracz @1 wyleczony o @2 PŻ. +Player @1 harmed by @2 HP.=Gracz @1 skrzywdzony o @2 PŻ. +Effects cleared for player @1=Efekty wyczyszczone dla gracza @1 +Removed effect @1 from player @2=Usunięto efekt @1 z gracza @2 +@1 is not an available status effect.=@1 nie jest dostępnym efektem. +Missing or invalid duration parameter!=Brakujący lub niewłaściwy czas trwania! +Invalid level parameter!=Niewłaściwy parametr poziomu! +Missing or invalid factor parameter when level is F!=Brakujący lub niewłaściwy współczynnik kiedy poziom to F! + +@1 effect given to player @2 for @3 seconds with factor of @4.=Efekt @1 nadany dla gracza @2 na @3 sekund ze współczynnikiem @4. +@1 effect given to player @2 for @3 seconds.=Efekt @1 nadany dla gracza @2 na #3 sekund. +Giving effect @1 to player @2 failed.=Nadawanie efektu @1 dla gracza @2 nie powiodło się. +@1 effect on level @2 given to player @3 for @4 seconds.=Efekt @1 na poziomie @2 nadany dla gracza @3 na @4 sekund. + + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect or a set of status effects.=Mikstura, którą można rzucić, a rozbije się przy uderzeniu, wystawiając wszystkich pobliskich graczy i moby na skutki jej działania. +Use the “Punch” key to throw it.=Użyj przycisku "Uderz" by rzucić. + + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect or set of effects, possibly repeatedly.=Mikstura, którą można rzucić, a roztrzaska się przy uderzeniu, tworząc magiczne opary pozostające przez chwilę na ziemi. Jakikolwiek gracz lub mob wewnątrz oparów będzie wystawiony na skutki mikstury, być może wielokrotnie. + + +This particular arrow is tipped and will give an effect when it hits a player or mob.=Czubek tej strzały jest zanurzony w miksturze, co wystawi jej cel na skutki jej działania. + + +Use the “Place” key to drink it.=Użyj przycisku "Postaw" by wypić. +Drinking a potion gives you a particular effect or set of effects.=Wypicie mikstury wywoła u ciebie określone skutki. + +@1 Potion @2=@1 Mikstura @2 +@1 Potion=@1 Mikstura +Potion @1=Mikstura @1 +Strange Potion=Dziwna Mikstura + +Splash @1=Miotana @1 +Lingering @1=Trwała @1 +@1 Arrow @2=@1 Strzała @2 +@1 Arrow=@1 Strzała +Arrow @1=Strzała @1 +Strange Tipped Arrow=Strzała z Dziwnym Grotem + +Mighty=Potężna +of Trolling=Trollowania + +Dragon's Breath=Oddech Smoka +This item is used in brewing and can be combined with splash potions to create lingering potions.=Ten przedmiot jest używany przy warzeniu i może zostać dodany do miotanych mikstur, aby uczynić je trwałymi. + +Awkward=Klarowna +No effect=Brak efektu +Has an awkward taste and is used for brewing potions.=Ma dziwny smak i jest używana do warzenia mikstur. + +Mundane=Mdła +Has a terrible taste and is not really useful for brewing potions.=Ma ohydny smak i nie jest zbyt użyteczna przy warzeniu mikstur. + +Thick=Gęsta +Has a bitter taste and may be useful for brewing potions.=Ma cierpki smak i może być użyteczna przy warzeniu mikstur. + +of Healing=Leczenia ++@1 HP=+@1 PŻ +Instantly heals.=Natychmiast leczy. + +of Harming=Krzywdy +-@1 HP=-@1 PŻ +Instantly deals damage.=Natychmiast zadaje obrażenia. + +of Night Vision=Noktowizji +Increases the perceived brightness of light under a dark sky.=Zwiększa postrzeganą jasność przy ciemnym niebie. + +of Swiftness=Szybkości +Increases walking speed.=Zwiększa prędkość ruchu. + +of Slowness=Spowolnienia +Decreases walking speed.=Zmniejsza prędkość ruchu. + +of Leaping=Zwiększonego Skoku +Increases jump strength.=Zwiększa siłę skoku. + +of Withering=Obumierania +Applies the withering effect which deals damage at a regular interval and can kill.=Zadaje efekt obumierania, zadający obrażenia w regularnych odstępach czasu i mogący zabić. + +of Poison=Trucizny +Applies the poison effect which deals damage at a regular interval.=Zadaje efekt trucizny, zadający obrażenia w regularnych odstępach czasu. + +of Regeneration=Regeneracji +Regenerates health over time.=Regeneruje życie z upływem czasu. + +of Invisibility=Niewidzialności +Grants invisibility.=Daje niewidzialność. + +of Water Breathing=Oddychania pod Wodą +Grants limitless breath underwater.=Daje nieograniczony oddech pod wodą. + +of Fire Resistance=Odporności na Ogień +Grants immunity to damage from heat sources like fire.=Daje odporność na obrażenia od źródeł ciepła takich jak ogień. + +of Strength=Siły +Increases attack power.=Zwiększa siłę ataku. + +of Weakness=Osłabienia +Decreases attack power.=Zmniejsza siłę ataku. + +of Slow Falling=Powolnego Opadania +Instead of falling, you descend gracefully.=Zamiast spadać, zstępujesz delikatnie. + +of Levitation=Lewitacji +Floats body slowly upwards.=Ciało powoli dryfuje w górę. + +of Darkness=Ciemności +Surrounds with darkness.=Otacza ciemnością. + +of Glowing=Blasku +Highlights for others to see.=Podświetla dla innych do dostrzeżenia. + +of Health Boost=Zwiększonego Zdrowia +Increases health.=Zwiększa zdrowie. + +of Absorption=Absorpcji +Absorbs some incoming damage.=Pochłania trochę otrzymywanych obrażeń. + +of Resistance=Odporności +Decreases damage taken.=Zmniejsza otrzymywane obrażenia. + +of Stone Cloak=Kamiennego Płaszcza +Decreases damage taken at the cost of speed.=Zmniejsza otrzymywane obrażenia kosztem prędkości. + +of Luck=Szczęścia +Increases luck.=Zwiększa szczęście. + +of Bad Luck=Pecha +Decreases luck.=Zmniejsza szczęście. + +of Frost=Mrozu +Freezes...=Zamraża... + +of Blindness=Ślepoty +Impairs sight.=Upośledza wzrok. + +of Nausea=Nudności +Disintegrates senses.=Dezintegruje zmysły. + +of Food Poisoning=Zatrucia Pokarmowego +Moves bowels too fast.=Porusza jelitami zbyt szybko. + +of Saturation=Nasycenia +Satisfies hunger.=Zaspokaja głód. + +of Haste=Pośpiechu +Increases digging and attack speed.=Zwiększa prędkość kopania i ataku. + +of Fatigue=Zmęczenia +Decreases digging and attack speed.=Zmniejsza prędkość kopania i ataku. + +Ominous=Złowieszcza +Attracts danger.=Przyciąga zagrożenie. + +Unknown Potion=Nieznana Mikstura +Right-click to identify=Kliknij prawym przyciskiem myszy, aby zidentyfikować +Unknown Tipped Arrow=Strzała z Nieznanym Grotem -Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)=Dodaj status na siebie. Argumenty: : nazwa efektu statusu, np. trucizna. : czas trwania w sekundach. : czynnik siły efektu (1 @= 100%) -Missing effect parameter!=Brak parametru efektu! -Missing or invalid duration parameter!=Brak lub nieprawidłowy parametr czasu trwania! -Invalid factor parameter!=Nieprawidłowy parametr czynnika! -@1 is not an available status effect.=@1 nie jest dostępnym efektem statusu. Fermented Spider Eye=Fermentowane oko pająka +Try different combinations to create potions.=Wypróbuj różne kombinacje, by stworzyć mikstury. + Glass Bottle=Szklana butelka -Liquid container=Pojemnik na płyn +Liquid container=Zbiornik na ciecz A glass bottle is used as a container for liquids and can be used to collect water directly.=Szklana butelka jest używana jako pojemnik na płyny i może być wykorzystana bezpośrednio do pozyskiwania wody. - To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Aby pozyskać wodę użyj jej na kotle z wodą (co usunie jeden poziom wody) lub jakimkolwiek źródle wody (co nie usunie wody). Water Bottle=Butelka wody -Water bottles can be used to fill cauldrons. Drinking water has no effect.=Butelka wody może być wykorzystana do napełniania kotłów. Picie wody nie ma żadnych efektów. +Water bottles can be used to fill cauldrons. Drinking water has no effect.=Butelka wody może być wykorzystana do napełniania kotłów. Picie wody nie ma żadnych skutków. Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Użyj przycisku do stawiania aby pić. Postaw ten przedmiot na kotle aby wylać wodę do kotła. River Water Bottle=Butelka wody rzecznej -River water bottles can be used to fill cauldrons. Drinking it has no effect.=Butelka wody rzecznej może być wykorzystana do napełniania kotłów. Picie jej nie ma żadnego efektu. +River water bottles can be used to fill cauldrons. Drinking it has no effect.=Butelka wody rzecznej może być wykorzystana do napełniania kotłów. Picie jej nie ma żadnego skutku. Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Użyj przycisku do stawiania aby pić. Postaw ten przedmiot na kotle aby wylać wodę rzeczną do kotła. Splash Water Bottle=Miotana butelka wody Extinguishes fire and hurts some mobs=Gasi ogień i rani niektóre moby -A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.=Butelka wody którą można rzucać i roztrzaska się przy uderzeniu, gdzie ugasi ogień i rani moby podatne na wodę. +A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.=Butelka wody, którą można rzucić, a roztrzaska się przy uderzeniu, gdzie ugasi ogień i zrani moby podatne na wodę. Lingering Water Bottle=Trwała miotana butelka wody -A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.=Butelka wody którą można rzucać i roztrzaska się przy uderzeniu tworząc opary wody pozostające przez chwilę na ziemi. Opary te gaszą ogień i ranią moby podatne na wodę. +A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.=Butelka wody którą można rzucić, a roztrzaska się przy uderzeniu, tworząc opary wody pozostające przez chwilę na ziemi. Opary te gaszą ogień i ranią moby podatne na wodę. Glistering Melon=Błyszczący arbuz This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Ten błyszczący arbuz jest pełen tycich odłamków złota i wygląda ładnie w ramkach na przedmioty. Nie jest jadalny ani użyteczny do innych rzeczy. - -A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.=Mikstura którą można rzucać i roztrzaska się przy uderzeniu tworząc magiczne opary pozostające przez chwilę na ziemi. Jakikolwiek gracz lub mob wewnątrz oparów będzie wystawiony na efekt mikstury. - -Use the “Punch” key to throw it.=Użyj przycisku "Uderz" by rzucić. -Use the “Place” key to drink it.=Użyj przycisku "Postaw" by wypić. -Drinking a potion gives you a particular effect.=Wypicie mikstury sprawi, że będziesz wystawiona na jej efekty. -1 HP/@1s | @2=1 HP/@1s | @2 -@1 HP=@1 HP -@1 Potion=Mikstura @1 -Splash @1 Potion=Miotana mikstura @1 -Lingering @1 Potion=Trwała miotana mikstura @1 -Arrow of @1=Strzała @1 - II= II - IV= IV -@1 Potion@2=Mikstura @1@2 -Splash @1@2 Potion=Miotana mikstura @1@2 -Lingering @1@2 Potion=Trwała miotana mikstura @1@2 -Arrow of @1@2=Strzała @1@2 -@1 + Potion=Mikstura @1 + -Splash @1 + Potion=Miotana mikstura @1 + -Lingering @1 + Potion=Trwała miotana mikstura @1 + -Arrow of @1 +=Strzała @1 + -Awkward Potion=Klarowna mikstura -Awkward Splash Potion=Klarowna miotana mikstura -Awkward Lingering Potion=Klarowna trwała miotana mikstura -Has an awkward taste and is used for brewing potions.=Ma dziwny smak i jest użyteczna przy warzenia mikstur. -Mundane Potion=Mdła mikstura -Mundane Splash Potion=Mdła miotana mikstura -Mundane Lingering Potion=Mdła trwała miotana mikstura -Has a terrible taste and is not useful for brewing potions.=Ma ohydny smak i nie jest użyteczna przy warzenia mikstur. -Thick Potion=Gęsta mikstura -Thick Splash Potion=Gęsta miotana mikstura -Thick Lingering Potion=Gęsta trwała miotana mikstura -Has a bitter taste and is not useful for brewing potions.=Ma cierpki smak i nie jest użyteczna przy warzenia mikstur. -Dragon's Breath=Oddech smoka - -This item is used in brewing and can be combined with splash potions to create lingering potions.=Ten przedmiot jest używany przy warzeniu i może zostać dodany do miotanych mikstur aby uczynić je trwałymi. - -Healing=leczenia -+4 HP=+4 HP -+8 HP=+8 HP -Instantly heals.=Natychmiastowo leczy. -Harming=obrażeń --6 HP=-6 HP --12 HP=-12 HP -Instantly deals damage.=Natychmiastowo zadaje obrażenia. -Night Vision=widzenia w ciemności -Increases the perceived brightness of light under a dark sky.=Zwiększa postrzeganą jasność przy ciemnym niebie. -Swiftness=prędkości -Increases walking speed.=Zwiększa prędkość poruszania. -Slowness=spowolnienia -Decreases walking speed.=Zmniejsza prędkość poruszania. -Leaping=skakania -Increases jump strength.=Zwiększa siłę skoku. -Poison=trucizny -Applies the poison effect which deals damage at a regular interval.=Aplikuje efekt trucizny zadający obrażenia w regularnych odstępach czasu. -Regeneration=regeneracji -Regenerates health over time.=Regeneruje życie przez pewien czas. -Invisibility=niewidzialności -Grants invisibility.=Sprawia, że cel jest niewidzialny. -Water Breathing=oddychania pod wodą -Grants limitless breath underwater.=Sprawia, że cel może oddychać pod wodą. -Fire Resistance=odporności na ogień -Grants immunity to damage from heat sources like fire.=Sprawia, że cel jest odporny na obrażenia od źródeł ciepła takich jak ogień. -Weakness=słabości -Weakness +=słabości + -Strength=siły -Strength II=siły II -Strength +=siły + -Try different combinations to create potions.=Spróbuj innej kombinacji aby stworzyć miksturę. -No effect=Brak efektu - -A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Mikstura, którą można rzucić i rozbije się przy uderzeniu wystawiając wszystkich pobliskich graczy i moby na efekt jej działania. - -This particular arrow is tipped and will give an effect when it hits a player or mob.=Czubek tej strzały jest zanurzony w miksturze co wystawi jej cel na efekt jej działania. - diff --git a/mods/ITEMS/mcl_potions/locale/template.txt b/mods/ITEMS/mcl_potions/locale/template.txt index 1420dabee..39cd18f31 100644 --- a/mods/ITEMS/mcl_potions/locale/template.txt +++ b/mods/ITEMS/mcl_potions/locale/template.txt @@ -1,13 +1,269 @@ # textdomain: mcl_potions - []= +Invisibility= +body is invisible= -Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)= +Poison= +-1 HP / @1 s= + +Regeneration= ++1 HP / @1 s= + +Strength= ++@1% melee damage= + +Weakness= +-@1% melee damage= + +Water Breathing= +limitless breathing under water= + +Dolphin's Grace= +swimming gracefully= + +Leaping= ++@1% jumping power= +-@1% jumping power= + +Slow Falling= +decreases gravity effects= + +Swiftness= ++@1% running speed= + +Slowness= +-@1% running speed= + +Levitation= +moves body upwards at @1 nodes/s= + +Night Vision= +improved vision during the night= + +Darkness= +surrounded by darkness= +not seeing anything beyond @1 nodes= + +Glowing= +more visible at all times= + +Health Boost= +HP increased by @1= + +Absorption= +absorbs up to @1 incoming damage= + +Fire Resistance= +resistance to fire damage= + +Resistance= +resist @1% of incoming damage= + +Luck= + +Bad Luck= + +Bad Omen= +danger is imminent= + +Hero of the Village= + +Withering= +-1 HP / @1 s, can kill= + +Frost= +-1 HP / 1 s, can kill, -@1% running speed= + +Blindness= +impaired sight= + +Nausea= +not feeling very well...= +frequency: @1 / 1 s= + +Food Poisoning= +exhausts by @1 per second= + +Saturation= +saturates by @1 per second= + +Haste= ++@1% mining and attack speed= + +Fatigue= +-@1% mining and attack speed= + +Conduit Power= ++@1% mining and attack speed in water= + + +|heal|list|clear|remove |INF [] [] [NOPART]= + +Add a status effect to yourself. Arguments: : name of status effect. Passing "list" as effect name lists available effects. Passing "heal" as effect name heals (or harms) by amount designed by the next parameter. Passing "clear" as effect name removes all effects. Passing "remove" as effect name removes the effect named by the next parameter. : duration in seconds. Passing "INF" as duration makes the effect infinite. (: amount of healing when the effect is "heal", passing a negative value subtracts health. : name of a status effect to be removed when using "remove" as the previous parameter.) : effect power determinant, bigger level results in more powerful effect for effects that depend on the level (no changes for other effects), defaults to 1, pass F to use low-level factor instead. : effect strength modifier, can mean different things depending on the effect, no changes for effects that do not depend on level/factor. NOPART at the end means no particles will be shown for this effect.= Missing effect parameter!= -Missing or invalid duration parameter!= -Invalid factor parameter!= +Missing or invalid heal amount parameter!= +Player @1 healed by @2 HP.= +Player @1 harmed by @2 HP.= +Effects cleared for player @1= +Removed effect @1 from player @2= @1 is not an available status effect.= +Missing or invalid duration parameter!= +Invalid level parameter!= +Missing or invalid factor parameter when level is F!= + +@1 effect given to player @2 for @3 seconds with factor of @4.= +@1 effect given to player @2 for @3 seconds.= +Giving effect @1 to player @2 failed.= +@1 effect on level @2 given to player @3 for @4 seconds.= + + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect or a set of status effects.= +Use the “Punch” key to throw it.= + + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect or set of effects, possibly repeatedly.= + + +This particular arrow is tipped and will give an effect when it hits a player or mob.= + + +Use the “Place” key to drink it.= +Drinking a potion gives you a particular effect or set of effects.= + +@1 Potion @2= +@1 Potion= +Potion @1= +Strange Potion= + +Splash @1= +Lingering @1= +@1 Arrow @2= +@1 Arrow= +Arrow @1= +Strange Tipped Arrow= + +Mighty= +of Trolling= + +Dragon's Breath= +This item is used in brewing and can be combined with splash potions to create lingering potions.= + +Awkward= +No effect= +Has an awkward taste and is used for brewing potions.= + +Mundane= +Has a terrible taste and is not really useful for brewing potions.= + +Thick= +Has a bitter taste and may be useful for brewing potions.= + +of Healing= ++@1 HP= +Instantly heals.= + +of Harming= +-@1 HP= +Instantly deals damage.= + +of Night Vision= +Increases the perceived brightness of light under a dark sky.= + +of Swiftness= +Increases walking speed.= + +of Slowness= +Decreases walking speed.= + +of Leaping= +Increases jump strength.= + +of Withering= +Applies the withering effect which deals damage at a regular interval and can kill.= + +of Poison= +Applies the poison effect which deals damage at a regular interval.= + +of Regeneration= +Regenerates health over time.= + +of Invisibility= +Grants invisibility.= + +of Water Breathing= +Grants limitless breath underwater.= + +of Fire Resistance= +Grants immunity to damage from heat sources like fire.= + +of Strength= +Increases attack power.= + +of Weakness= +Decreases attack power.= + +of Slow Falling= +Instead of falling, you descend gracefully.= + +of Levitation= +Floats body slowly upwards.= + +of Darkness= +Surrounds with darkness.= + +of Glowing= +Highlights for others to see.= + +of Health Boost= +Increases health.= + +of Absorption= +Absorbs some incoming damage.= + +of Resistance= +Decreases damage taken.= + +of Stone Cloak= +Decreases damage taken at the cost of speed.= + +of Luck= +Increases luck.= + +of Bad Luck= +Decreases luck.= + +of Frost= +Freezes...= + +of Blindness= +Impairs sight.= + +of Nausea= +Disintegrates senses.= + +of Food Poisoning= +Moves bowels too fast.= + +of Saturation= +Satisfies hunger.= + +of Haste= +Increases digging and attack speed.= + +of Fatigue= +Decreases digging and attack speed.= + +Ominous= +Attracts danger.= + +Unknown Potion= +Right-click to identify= +Unknown Tipped Arrow= + + Fermented Spider Eye= +Try different combinations to create potions.= + Glass Bottle= Liquid container= @@ -37,79 +293,3 @@ A throwable water bottle that will shatter on impact, where it creates a cloud o Glistering Melon= This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.= - -A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= - -Use the “Punch” key to throw it.= -Use the “Place” key to drink it.= -Drinking a potion gives you a particular effect.= -1 HP/@1s | @2= -@1 HP= -@1 Potion= -Splash @1 Potion= -Lingering @1 Potion= -Arrow of @1= - II= - IV= -@1 Potion@2= -Splash @1@2 Potion= -Lingering @1@2 Potion= -Arrow of @1@2= -@1 + Potion= -Splash @1 + Potion= -Lingering @1 + Potion= -Arrow of @1 += -Awkward Potion= -Awkward Splash Potion= -Awkward Lingering Potion= -Has an awkward taste and is used for brewing potions.= -Mundane Potion= -Mundane Splash Potion= -Mundane Lingering Potion= -Has a terrible taste and is not useful for brewing potions.= -Thick Potion= -Thick Splash Potion= -Thick Lingering Potion= -Has a bitter taste and is not useful for brewing potions.= -Dragon's Breath= - -This item is used in brewing and can be combined with splash potions to create lingering potions.= - -Healing= -+4 HP= -+8 HP= -Instantly heals.= -Harming= --6 HP= --12 HP= -Instantly deals damage.= -Night Vision= -Increases the perceived brightness of light under a dark sky.= -Swiftness= -Increases walking speed.= -Slowness= -Decreases walking speed.= -Leaping= -Increases jump strength.= -Poison= -Applies the poison effect which deals damage at a regular interval.= -Regeneration= -Regenerates health over time.= -Invisibility= -Grants invisibility.= -Water Breathing= -Grants limitless breath underwater.= -Fire Resistance= -Grants immunity to damage from heat sources like fire.= -Weakness= -Weakness += -Strength= -Strength II= -Strength += -Try different combinations to create potions.= -No effect= - -A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= - -This particular arrow is tipped and will give an effect when it hits a player or mob.= - diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index fd9240b92..c8de4353e 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -1,5 +1,8 @@ local S = minetest.get_translator(minetest.get_current_modname()) ---local brewhelp = S("Try different combinations to create potions.") + +mcl_potions.registered_potions = {} +-- shorthand +local registered_potions = mcl_potions.registered_potions local function potion_image(colorstring, opacity) if not opacity then @@ -9,7 +12,7 @@ local function potion_image(colorstring, opacity) end local how_to_drink = S("Use the “Place” key to drink it.") -local potion_intro = S("Drinking a potion gives you a particular effect.") +local potion_intro = S("Drinking a potion gives you a particular effect or set of effects.") local function time_string(dur) if not dur then @@ -45,365 +48,297 @@ end -- ╚═╝░░░░░░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░ -function return_on_use(def, effect, dur) - return function (itemstack, user, pointed_thing) +local function generate_on_use(effects, color, on_use, custom_effect) + return function(itemstack, user, pointed_thing) if pointed_thing.type == "node" then if user and not user:get_player_control().sneak then - -- Use pointed node's on_rightclick function first, if present local node = minetest.get_node(pointed_thing.under) - 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 - return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack) or itemstack - end + 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 end end elseif pointed_thing.type == "object" then return itemstack end - --def.on_use(user, effect, dur) -- Will do effect immediately but not reduce item count until eating delay ends which makes it exploitable by deliberately not finishing delay - -- Wrapper for handling mcl_hunger delayed eating - local name = user:get_player_name() - mcl_hunger.eat_internal[name]._custom_itemstack = itemstack -- Used as comparison to make sure the custom wrapper executes only when the same item is eaten - mcl_hunger.eat_internal[name]._custom_var = { + local player_name = user:get_player_name() + mcl_hunger.eat_internal[player_name]._custom_itemstack = itemstack -- Used as comparison to make sure the custom wrapper executes only when the same item is eaten + mcl_hunger.eat_internal[player_name]._custom_var = { user = user, - effect = effect, - dur = dur, + effects = effects, + on_use = on_use, + custom_effect = custom_effect, } - mcl_hunger.eat_internal[name]._custom_func = def.on_use - mcl_hunger.eat_internal[name]._custom_wrapper = function(name) + mcl_hunger.eat_internal[player_name]._custom_func = function(itemstack, user, effects, on_use, custom_effect) + local potency = itemstack:get_meta():get_int("mcl_potions:potion_potent") + local plus = itemstack:get_meta():get_int("mcl_potions:potion_plus") + local ef_level + local dur + for name, details in pairs(effects) do + if details.uses_level then + ef_level = details.level + details.level_scaling * (potency) + else + ef_level = details.level + end + if details.dur_variable then + dur = details.dur * math.pow(mcl_potions.PLUS_FACTOR, plus) + if potency>0 and details.uses_level then + dur = dur / math.pow(mcl_potions.POTENT_FACTOR, potency) + end + else + dur = details.dur + end + if details.effect_stacks then + ef_level = ef_level + mcl_potions.get_effect_level(user, name) + end + mcl_potions.give_effect_by_level(name, user, ef_level, dur) + end - mcl_hunger.eat_internal[name]._custom_func( - mcl_hunger.eat_internal[name]._custom_var.user, - mcl_hunger.eat_internal[name]._custom_var.effect, - mcl_hunger.eat_internal[name]._custom_var.dur + if on_use then on_use(user, potency+1) end + if custom_effect then custom_effect(user, potency+1, plus) end + end + mcl_hunger.eat_internal[player_name]._custom_wrapper = function(player_name) + mcl_hunger.eat_internal[player_name]._custom_func( + mcl_hunger.eat_internal[player_name]._custom_itemstack, + mcl_hunger.eat_internal[player_name]._custom_var.user, + mcl_hunger.eat_internal[player_name]._custom_var.effects, + mcl_hunger.eat_internal[player_name]._custom_var.on_use, + mcl_hunger.eat_internal[player_name]._custom_var.custom_effect ) end - local old_name, old_count = itemstack:get_name(), itemstack:get_count() itemstack = minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - if old_name ~= itemstack:get_name() or old_count ~= itemstack:get_count() then - mcl_potions._use_potion(itemstack, user, def.color) - end + if itemstack then mcl_potions._use_potion(user, color) end + return itemstack end end - -local function register_potion(def) - - local dur = mcl_potions.DURATION - - if def.is_inv then - dur = dur * mcl_potions.INV_FACTOR +-- API - registers a potion +-- required parameters in def: +-- name - string - potion name in code +-- optional parameters in def: +-- desc_prefix - translated string - part of visible potion name, comes before the word "Potion" +-- desc_suffix - translated string - part of visible potion name, comes after the word "Potion" +-- _tt - translated string - custom tooltip text +-- _dynamic_tt - function(level) - returns custom tooltip text dependent on potion level +-- _longdesc - translated string - text for in-game documentation +-- stack_max - int - max stack size - defaults to 1 +-- image - string - name of a custom texture of the potion icon +-- color - string - colorstring for potion icon when image is not defined - defaults to #0000FF +-- groups - table - item groups definition for the regular potion, not splash or lingering - +-- - must contain _mcl_potion=1 for tooltip to include dynamic_tt and effects +-- - defaults to {brewitem=1, food=3, can_eat_when_full=1, _mcl_potion=1} +-- nocreative - bool - adds a not_in_creative_inventory=1 group - defaults to false +-- _effect_list - table - all the effects dealt by the potion in the format of tables +-- -- the name of each sub-table should be a name of a registered effect, and fields can be the following: +-- -- -- uses_level - bool - whether the level of the potion affects the level of the effect - +-- -- -- - defaults to the uses_factor field of the effect definition +-- -- -- level - int - used as the effect level if uses_level is false and for lvl1 potions - defaults to 1 +-- -- -- level_scaling - int - used as the number of effect levels added per potion level - defaults to 1 - +-- -- -- - this has no effect if uses_level is false +-- -- -- dur - float - duration of the effect in seconds - defaults to mcl_potions.DURATION +-- -- -- dur_variable - bool - whether variants of the potion should have the length of this effect changed - +-- -- -- - defaults to true +-- -- -- - if at least one effect has this set to true, the potion has a "plus" variant +-- -- -- effect_stacks - bool - whether the effect stacks - defaults to false +-- uses_level - bool - whether the potion should come at different levels - +-- - defaults to true if uses_level is true for at least one effect, else false +-- drinkable - bool - defaults to true +-- has_splash - bool - defaults to true +-- has_lingering - bool - defaults to true +-- has_arrow - bool - defaults to false +-- has_potent - bool - whether there is a potent (e.g. II) variant - defaults to the value of uses_level +-- default_potent_level - int - potion level used for the default potent variant - defaults to 2 +-- default_extend_level - int - extention level (amount of +) used for the default extended variant - defaults to 1 +-- custom_on_use - function(user, level) - called when the potion is drunk, returns true on success +-- custom_effect - function(object, level, plus) - called when the potion effects are applied, returns true on success +-- custom_splash_effect - function(pos, level) - called when the splash potion explodes, returns true on success +-- custom_linger_effect - function(pos, radius, level) - called on the lingering potion step, returns true on success +function mcl_potions.register_potion(def) + local modname = minetest.get_current_modname() + local name = def.name + if name == nil then + error("Unable to register potion: name is nil") end - if def.name == "poison" or def.name == "regeneration" or def.name == "withering" then - dur = 45 + if type(name) ~= "string" then + error("Unable to register potion: name is not a string") end - - local on_use = nil - - if def.on_use then - on_use = return_on_use(def, def.effect, dur) - end - - local function get_tt(tt, effect, dur) - local _tt - if effect and def.is_dur then - _tt = perc_string(effect).." | "..time_string(dur) - if def.name == "poison" or def.name == "regeneration" or def.name == "withering" then - _tt = S("1 HP/@1s | @2", effect, time_string(dur)) - end - elseif def.name == "healing" or def.name == "harming" then - _tt = S("@1 HP", effect) - else - _tt = tt or time_string(dur) or S("No effect") - end - return _tt - end - - local function get_splash_fun(effect, sp_dur) - if def.is_dur then - return function(player, redx) def.on_use(player, effect, sp_dur*redx) end - elseif def.effect then - return function(player, redx) def.on_use(player, effect*redx, sp_dur) end - end - -- covers case of no effect (water, awkward, mundane) - return function() end - end - - local function get_lingering_fun(effect, ling_dur) - if def.is_dur then - return function(player) def.on_use(player, effect, ling_dur) end - elseif def.effect then - return function(player) def.on_use(player, effect*0.5, ling_dur) end - end - -- covers case of no effect (water, awkward, mundane) - return function() end - end - - local function get_arrow_fun(effect, dur) - if def.is_dur then - return function(player) def.on_use(player, effect, dur) end - elseif def.effect then - return function(player) def.on_use(player, effect, dur) end - end - -- covers case of no effect (water, awkward, mundane) - return function() end - end - - local desc - if not def.no_potion then - if def.description_potion then - desc = def.description_potion - else - desc = S("@1 Potion", def.description) - end + local pdef = {} + if def.desc_prefix and def.desc_suffix then + pdef.description = S("@1 Potion @2", def.desc_prefix, def.desc_suffix) + elseif def.desc_prefix then + pdef.description = S("@1 Potion", def.desc_prefix) + elseif def.desc_suffix then + pdef.description = S("Potion @1", def.desc_suffix) else - desc = def.description + pdef.description = S("Strange Potion") end + pdef._tt_help = def._tt + pdef._dynamic_tt = def._dynamic_tt local potion_longdesc = def._longdesc - if not def.no_effect then + if def._effect_list then potion_longdesc = potion_intro .. "\n" .. def._longdesc end - local potion_usagehelp - local basic_potion_tt - if def.name ~= "dragon_breath" then - potion_usagehelp = how_to_drink - basic_potion_tt = get_tt(def._tt, def.effect, dur) - end + pdef._doc_items_longdesc = potion_longdesc + if def.drinkable ~= false then pdef._doc_items_usagehelp = how_to_drink end + pdef.stack_max = def.stack_max or 1 + local color = def.color or "#0000FF" + pdef.inventory_image = def.image or potion_image(color) + pdef.wield_image = pdef.inventory_image + pdef.groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, _mcl_potion=1} + if def.nocreative then pdef.groups.not_in_creative_inventory = 1 end - minetest.register_craftitem("mcl_potions:"..def.name, { - description = desc, - _tt_help = basic_potion_tt, - _doc_items_longdesc = potion_longdesc, - _doc_items_usagehelp = potion_usagehelp, - stack_max = def.stack_max or 1, - inventory_image = def.image or potion_image(def.color), - wield_image = def.image or potion_image(def.color), - groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, bottle=1}, - on_place = on_use, - on_secondary_use = on_use, - }) - - -- Register Splash and Lingering - local splash_dur = dur * mcl_potions.SPLASH_FACTOR - local ling_dur = dur * mcl_potions.LINGERING_FACTOR - - local splash_def = { - tt = get_tt(def._tt, def.effect, splash_dur), - longdesc = def._longdesc, - potion_fun = get_splash_fun(def.effect, splash_dur), - no_effect = def.no_effect, - instant = def.instant, - } - - local ling_def - if def.name == "healing" or def.name == "harming" then - ling_def = { - tt = get_tt(def._tt, def.effect*mcl_potions.LINGERING_FACTOR, ling_dur), - longdesc = def._longdesc, - potion_fun = get_lingering_fun(def.effect*mcl_potions.LINGERING_FACTOR, ling_dur), - no_effect = def.no_effect, - instant = def.instant, - } - else - ling_def = { - tt = get_tt(def._tt, def.effect, ling_dur), - longdesc = def._longdesc, - potion_fun = get_lingering_fun(def.effect, ling_dur), - no_effect = def.no_effect, - instant = def.instant, - } - end - - local arrow_def = { - tt = get_tt(def._tt, def.effect, dur/8.), - longdesc = def._longdesc, - potion_fun = get_arrow_fun(def.effect, dur/8.), - no_effect = def.no_effect, - instant = def.instant, - } - - if def.color and not def.no_throwable then - local desc - if def.description_splash then - desc = def.description_splash - else - desc = S("Splash @1 Potion", def.description) - end - mcl_potions.register_splash(def.name, desc, def.color, splash_def) - if def.description_lingering then - desc = def.description_lingering - else - desc = S("Lingering @1 Potion", def.description) - end - mcl_potions.register_lingering(def.name, desc, def.color, ling_def) - if not def.no_arrow then - mcl_potions.register_arrow(def.name, S("Arrow of @1", def.description), def.color, arrow_def) - end - end - - if def.is_II then - - local desc_mod = S(" II") - - local effect_II - if def.name == "healing" or def.name == "harming" then - effect_II = def.effect*mcl_potions.II_FACTOR - elseif def.name == "poison" or def.name == "regeneration" then - effect_II = 1.2 - elseif def.name == "withering" then - effect_II = 2 - else - effect_II = def.effect^mcl_potions.II_FACTOR - end - - local dur_2 = dur / mcl_potions.II_FACTOR - if def.name == "poison" then dur_2 = dur_2 - 1 end - - if def.name == "slowness" then - dur_2 = 20 - effect_II = 0.40 - desc_mod = S(" IV") - end - - on_use = return_on_use(def, effect_II, dur_2) - - minetest.register_craftitem("mcl_potions:"..def.name.."_2", { - description = S("@1 Potion@2", def.description, desc_mod), - _tt_help = get_tt(def._tt_2, effect_II, dur_2), - _doc_items_longdesc = potion_longdesc, - _doc_items_usagehelp = potion_usagehelp, - stack_max = def.stack_max or 1, - inventory_image = def.image or potion_image(def.color), - wield_image = def.image or potion_image(def.color), - groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, bottle=1}, - on_place = on_use, - on_secondary_use = on_use, - }) - - -- Register Splash and Lingering - local splash_dur_2 = dur_2 * mcl_potions.SPLASH_FACTOR - local ling_dur_2 = dur_2 * mcl_potions.LINGERING_FACTOR - - local splash_def_2 - if def.name == "healing" then - splash_def_2 = { - tt = get_tt(def._tt_2, 7, splash_dur_2), - longdesc = def._longdesc, - potion_fun = get_splash_fun(7, splash_dur_2), - no_effect = def.no_effect, - instant = def.instant, - } - else - splash_def_2 = { - tt = get_tt(def._tt_2, effect_II, splash_dur_2), - longdesc = def._longdesc, - potion_fun = get_splash_fun(effect_II, splash_dur_2), - no_effect = def.no_effect, - instant = def.instant, - } - end - - - local ling_def_2 - if def.name == "healing" or def.name == "harming" then - ling_def_2 = { - tt = get_tt(def._tt_2, effect_II*mcl_potions.LINGERING_FACTOR, ling_dur_2), - longdesc = def._longdesc, - potion_fun = get_lingering_fun(effect_II*mcl_potions.LINGERING_FACTOR, ling_dur_2), - no_effect = def.no_effect, - instant = def.instant, - } - else - ling_def_2 = { - tt = get_tt(def._tt_2, effect_II, ling_dur_2), - longdesc = def._longdesc, - potion_fun = get_lingering_fun(effect_II, ling_dur_2), - no_effect = def.no_effect, - instant = def.instant, - } - end - - local arrow_def_2 = { - tt = get_tt(def._tt_2, effect_II, dur_2/8.), - longdesc = def._longdesc, - potion_fun = get_arrow_fun(effect_II, dur_2/8.), - no_effect = def.no_effect, - instant = def.instant, - } - - if def.color and not def.no_throwable then - mcl_potions.register_splash(def.name.."_2", S("Splash @1@2 Potion", def.description, desc_mod), def.color, splash_def_2) - mcl_potions.register_lingering(def.name.."_2", S("Lingering @1@2 Potion", def.description, desc_mod), def.color, ling_def_2) - if not def.no_arrow then - mcl_potions.register_arrow(def.name.."_2", S("Arrow of @1@2", def.description, desc_mod), def.color, arrow_def_2) + pdef._effect_list = {} + local effect + local uses_level = false + local has_plus = false + if def._effect_list then + for name, details in pairs(def._effect_list) do + effect = mcl_potions.registered_effects[name] + if effect then + local ulvl + if details.uses_level ~= nil then ulvl = details.uses_level + else ulvl = effect.uses_factor end + if ulvl then uses_level = true end + local durvar = true + if details.dur_variable ~= nil then durvar = details.dur_variable end + if durvar then has_plus = true end + pdef._effect_list[name] = { + uses_level = ulvl, + level = details.level or 1, + level_scaling = details.level_scaling or 1, + dur = details.dur or mcl_potions.DURATION, + dur_variable = durvar, + effect_stacks = details.effect_stacks and true or false + } + else + error("Unable to register potion: effect not registered") end end + end + if def.uses_level ~= nil then uses_level = def.uses_level end + pdef.uses_level = uses_level + if def.has_potent ~= nil then pdef.has_potent = def.has_potent + else pdef.has_potent = uses_level end + pdef._default_potent_level = def.default_potent_level or 2 + pdef._default_extend_level = def.default_extend_level or 1 + pdef.has_plus = has_plus + local on_use + if def.drinkable ~= false then + on_use = generate_on_use(pdef._effect_list, color, def.custom_on_use, def.custom_effect) + end + pdef.on_place = on_use + pdef.on_secondary_use = on_use + local internal_def = table.copy(pdef) + minetest.register_craftitem(modname..":"..name, pdef) + + if def.has_splash or def.has_splash == nil then + local splash_desc = S("Splash @1", pdef.description) + local sdef = {} + sdef._tt = def._tt + sdef._dynamic_tt = def._dynamic_tt + sdef._longdesc = def._longdesc + sdef.nocreative = def.nocreative + sdef.stack_max = pdef.stack_max + sdef._effect_list = pdef._effect_list + sdef.uses_level = uses_level + sdef.has_potent = pdef.has_potent + sdef.has_plus = has_plus + sdef._default_potent_level = pdef._default_potent_level + sdef._default_extend_level = pdef._default_extend_level + sdef.custom_effect = def.custom_effect + sdef.on_splash = def.custom_splash_effect + if not def._effect_list then sdef.instant = true end + mcl_potions.register_splash(name, splash_desc, color, sdef) + internal_def.has_splash = true end - if def.is_plus then - - local dur_pl = dur * mcl_potions.PLUS_FACTOR - if def.name == "poison" or def.name == "regeneration" or def.name == "withering" then - dur_pl = 90 - end - - on_use = return_on_use(def, def.effect, dur_pl) - - minetest.register_craftitem("mcl_potions:"..def.name.."_plus", { - description = S("@1 + Potion", def.description), - _tt_help = get_tt(def._tt_plus, def.effect, dur_pl), - _doc_items_longdesc = potion_longdesc, - _doc_items_usagehelp = potion_usagehelp, - stack_max = 1, - inventory_image = def.image or potion_image(def.color), - wield_image = def.image or potion_image(def.color), - groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, bottle=1}, - on_place = on_use, - on_secondary_use = on_use, - }) - - -- Register Splash - local splash_dur_pl = dur_pl * mcl_potions.SPLASH_FACTOR - local ling_dur_pl = dur_pl * mcl_potions.LINGERING_FACTOR - - local splash_def_pl = { - tt = get_tt(def._tt_plus, def.effect, splash_dur_pl), - longdesc = def._longdesc, - potion_fun = get_splash_fun(def.effect, splash_dur_pl), - no_effect = def.no_effect, - instant = def.instant, - } - local ling_def_pl = { - tt = get_tt(def._tt_plus, def.effect, ling_dur_pl), - longdesc = def._longdesc, - potion_fun = get_lingering_fun(def.effect, ling_dur_pl), - no_effect = def.no_effect, - instant = def.instant, - } - local arrow_def_pl = { - tt = get_tt(def._tt_pl, def.effect, dur_pl/8.), - longdesc = def._longdesc, - potion_fun = get_arrow_fun(def.effect, dur_pl/8.), - no_effect = def.no_effect, - instant = def.instant, - } - if def.color and not def.no_throwable then - mcl_potions.register_splash(def.name.."_plus", S("Splash @1 + Potion", def.description), def.color, splash_def_pl) - mcl_potions.register_lingering(def.name.."_plus", S("Lingering @1 + Potion", def.description), def.color, ling_def_pl) - if not def.no_arrow then - mcl_potions.register_arrow(def.name.."_plus", S("Arrow of @1 +", def.description), def.color, arrow_def_pl) - end - end - + if def.has_lingering or def.has_lingering == nil then + local ling_desc = S("Lingering @1", pdef.description) + local ldef = {} + ldef._tt = def._tt + ldef._dynamic_tt = def._dynamic_tt + ldef._longdesc = def._longdesc + ldef.nocreative = def.nocreative + ldef.stack_max = pdef.stack_max + ldef._effect_list = pdef._effect_list + ldef.uses_level = uses_level + ldef.has_potent = pdef.has_potent + ldef.has_plus = has_plus + ldef._default_potent_level = pdef._default_potent_level + ldef._default_extend_level = pdef._default_extend_level + ldef.custom_effect = def.custom_effect + ldef.on_splash = def.custom_splash_effect + ldef.while_lingering = def.custom_linger_effect + if not def._effect_list then ldef.instant = true end + mcl_potions.register_lingering(name, ling_desc, color, ldef) + internal_def.has_lingering = true end + if def.has_arrow then + local arr_desc + if def.desc_prefix and def.desc_suffix then + arr_desc = S("@1 Arrow @2", def.desc_prefix, def.desc_suffix) + elseif def.desc_prefix then + arr_desc = S("@1 Arrow", def.desc_prefix) + elseif def.desc_suffix then + arr_desc = S("Arrow @1", def.desc_suffix) + else + arr_desc = S("Strange Tipped Arrow") + end + local adef = {} + adef._tt = def._tt + adef._dynamic_tt = def._dynamic_tt + adef._longdesc = def._longdesc + adef.nocreative = def.nocreative + adef._effect_list = pdef._effect_list + adef.uses_level = uses_level + adef.has_potent = pdef.has_potent + adef.has_plus = has_plus + adef._default_potent_level = pdef._default_potent_level + adef._default_extend_level = pdef._default_extend_level + adef.custom_effect = def.custom_effect + if not def._effect_list then adef.instant = true end + mcl_potions.register_arrow(name, arr_desc, color, adef) + internal_def.has_arrow = true + end + + mcl_potions.registered_potions[modname..":"..name] = internal_def end +mcl_potions.register_potion({ + name = "trolling", + desc_prefix = S("Mighty"), + desc_suffix = S("of Trolling"), + _tt = "trololo", + _dynamic_tt = function(level) + return "trolololoooololo" + end, + _longdesc = "Trolololololo", + stack_max = 2, + color = "#00AA00", + nocreative = true, + _effect_list = { + night_vision = {}, + strength = {}, + swiftness = { + uses_level = false, + level = 2, + }, + poison = { + dur = 10, + }, + }, + default_potent_level = 5, + default_extend_level = 3, + custom_splash_effect = mcl_potions._extinguish_nearby_fire, + has_arrow = true, +}) + + -- ██████╗░░█████╗░████████╗██╗░█████╗░███╗░░██╗ -- ██╔══██╗██╔══██╗╚══██╔══╝██║██╔══██╗████╗░██║ @@ -420,344 +355,525 @@ end -- ╚═════╝░╚══════╝╚═╝░░░░░╚═╝╚═╝░░╚══╝╚═╝░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░ -local awkward_def = { - name = "awkward", - description_potion = S("Awkward Potion"), - description_splash = S("Awkward Splash Potion"), - description_lingering = S("Awkward Lingering Potion"), - no_arrow = true, - no_effect = true, - _tt = S("No effect"), - _longdesc = S("Has an awkward taste and is used for brewing potions."), - color = "#0000FF", - groups = {brewitem=1, food=3, can_eat_when_full=1, bottle=1}, - on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), -} - -local mundane_def = { - name = "mundane", - description_potion = S("Mundane Potion"), - description_splash = S("Mundane Splash Potion"), - description_lingering = S("Mundane Lingering Potion"), - no_arrow = true, - no_effect = true, - _tt = S("No effect"), - _longdesc = S("Has a terrible taste and is not useful for brewing potions."), - color = "#0000FF", - on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), -} - -local thick_def = { - name = "thick", - description_potion = S("Thick Potion"), - description_splash = S("Thick Splash Potion"), - description_lingering = S("Thick Lingering Potion"), - no_arrow = true, - no_effect = true, - _tt = S("No effect"), - _longdesc = S("Has a bitter taste and is not useful for brewing potions."), - color = "#0000FF", - on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), -} - -local dragon_breath_def = { - name = "dragon_breath", +minetest.register_craftitem("mcl_potions:dragon_breath", { description = S("Dragon's Breath"), - no_arrow = true, - no_potion = true, - no_throwable = true, - no_effect = true, _longdesc = S("This item is used in brewing and can be combined with splash potions to create lingering potions."), image = "mcl_potions_dragon_breath.png", groups = { brewitem = 1, bottle = 1 }, - on_use = nil, stack_max = 64, -} +}) -local healing_def = { +mcl_potions.register_potion({ + name = "awkward", + desc_prefix = S("Awkward"), + _tt = S("No effect"), + _longdesc = S("Has an awkward taste and is used for brewing potions."), + color = "#0000FF", +}) + +mcl_potions.register_potion({ + name = "mundane", + desc_prefix = S("Mundane"), + _tt = S("No effect"), + _longdesc = S("Has a terrible taste and is not really useful for brewing potions."), + color = "#0000FF", +}) + +mcl_potions.register_potion({ + name = "thick", + desc_prefix = S("Thick"), + _tt = S("No effect"), + _longdesc = S("Has a bitter taste and may be useful for brewing potions."), + color = "#0000FF", +}) + +mcl_potions.register_potion({ name = "healing", - description = S("Healing"), - _tt = S("+4 HP"), - _tt_2 = S("+8 HP"), + desc_suffix = S("of Healing"), + _dynamic_tt = function(level) + return S("+@1 HP", 4 * level) + end, _longdesc = S("Instantly heals."), color = "#F82423", - effect = 4, - instant = true, - on_use = mcl_potions.healing_func, - is_II = true, -} + uses_level = true, + has_arrow = true, + custom_effect = function(object, level) + return mcl_potions.healing_func(object, 4 * level) + end, +}) - -local harming_def = { +mcl_potions.register_potion({ name = "harming", - description = S("Harming"), - _tt = S("-6 HP"), - _tt_II = S("-12 HP"), + desc_suffix = S("of Harming"), + _dynamic_tt = function(level) + return S("-@1 HP", 6 * level) + end, _longdesc = S("Instantly deals damage."), color = "#430A09", - effect = -6, - instant = true, - on_use = mcl_potions.healing_func, - is_II = true, - is_inv = true, -} + uses_level = true, + has_arrow = true, + custom_effect = function(object, level) + return mcl_potions.healing_func(object, -6 * level) + end, +}) -local night_vision_def = { +mcl_potions.register_potion({ name = "night_vision", - description = S("Night Vision"), + desc_suffix = S("of Night Vision"), _tt = nil, _longdesc = S("Increases the perceived brightness of light under a dark sky."), color = "#1F1FA1", - effect = nil, - is_dur = true, - on_use = mcl_potions.night_vision_func, - is_plus = true, -} + _effect_list = { + night_vision = {}, + }, + has_arrow = true, +}) -local swiftness_def = { +mcl_potions.register_potion({ name = "swiftness", - description = S("Swiftness"), + desc_suffix = S("of Swiftness"), _tt = nil, _longdesc = S("Increases walking speed."), color = "#7CAFC6", - effect = 1.2, - is_dur = true, - on_use = mcl_potions.swiftness_func, - is_II = true, - is_plus = true, -} + _effect_list = { + swiftness = {}, + }, + has_arrow = true, +}) -local slowness_def = { +mcl_potions.register_potion({ name = "slowness", - description = S("Slowness"), + desc_suffix = S("of Slowness"), _tt = nil, _longdesc = S("Decreases walking speed."), color = "#5A6C81", - effect = 0.85, - is_dur = true, - on_use = mcl_potions.swiftness_func, - is_II = true, - is_plus = true, - is_inv = true, -} + _effect_list = { + slowness = {dur=mcl_potions.DURATION_INV}, + }, + default_potent_level = 4, + has_arrow = true, +}) -local leaping_def = { +mcl_potions.register_potion({ name = "leaping", - description = S("Leaping"), + desc_suffix = S("of Leaping"), _tt = nil, _longdesc = S("Increases jump strength."), color = "#22FF4C", - effect = 1.15, - is_dur = true, - on_use = mcl_potions.leaping_func, - is_II = true, - is_plus = true, -} + _effect_list = { + leaping = {}, + }, + has_arrow = true, +}) -local withering_def = { +mcl_potions.register_potion({ name = "withering", - description = S("Withering"), + desc_suffix = S("of Withering"), _tt = nil, _longdesc = S("Applies the withering effect which deals damage at a regular interval and can kill."), - color = "#000000", - effect = 4, - is_dur = true, - on_use = mcl_potions.withering_func, - is_II = true, - is_plus = true, - is_inv = true, -} + color = "#292929", + _effect_list = { + withering = {dur=mcl_potions.DURATION_POISON}, + }, + has_arrow = true, +}) -local poison_def = { +mcl_potions.register_potion({ name = "poison", - description = S("Poison"), + desc_suffix = S("of Poison"), _tt = nil, _longdesc = S("Applies the poison effect which deals damage at a regular interval."), color = "#4E9331", - effect = 2.5, - is_dur = true, - on_use = mcl_potions.poison_func, - is_II = true, - is_plus = true, - is_inv = true, -} + _effect_list = { + poison = {dur=mcl_potions.DURATION_POISON}, + }, + has_arrow = true, +}) -local regeneration_def = { +mcl_potions.register_potion({ name = "regeneration", - description = S("Regeneration"), + desc_suffix = S("of Regeneration"), _tt = nil, _longdesc = S("Regenerates health over time."), color = "#CD5CAB", - effect = 2.5, - is_dur = true, - on_use = mcl_potions.regeneration_func, - is_II = true, - is_plus = true, -} + _effect_list = { + regeneration = {dur=mcl_potions.DURATION_POISON}, + }, + has_arrow = true, +}) -local invisibility_def = { +mcl_potions.register_potion({ name = "invisibility", - description = S("Invisibility"), + desc_suffix = S("of Invisibility"), _tt = nil, _longdesc = S("Grants invisibility."), color = "#7F8392", - is_dur = true, - on_use = mcl_potions.invisiblility_func, - is_plus = true, -} + _effect_list = { + invisibility = {}, + }, + has_arrow = true, +}) -local water_breathing_def = { +mcl_potions.register_potion({ name = "water_breathing", - description = S("Water Breathing"), + desc_suffix = S("of Water Breathing"), _tt = nil, _longdesc = S("Grants limitless breath underwater."), color = "#2E5299", - is_dur = true, - on_use = mcl_potions.water_breathing_func, - is_plus = true, -} + _effect_list = { + water_breathing = {}, + }, + has_arrow = true, +}) -local fire_resistance_def = { +mcl_potions.register_potion({ name = "fire_resistance", - description = S("Fire Resistance"), + desc_suffix = S("of Fire Resistance"), _tt = nil, _longdesc = S("Grants immunity to damage from heat sources like fire."), color = "#E49A3A", - is_dur = true, - on_use = mcl_potions.fire_resistance_func, - is_plus = true, + _effect_list = { + fire_resistance = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "strength", + desc_suffix = S("of Strength"), + _tt = nil, + _longdesc = S("Increases attack power."), + color = "#932423", + _effect_list = { + strength = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "weakness", + desc_suffix = S("of Weakness"), + _tt = nil, + _longdesc = S("Decreases attack power."), + color = "#484D48", + _effect_list = { + weakness = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "slow_falling", + desc_suffix = S("of Slow Falling"), + _tt = nil, + _longdesc = S("Instead of falling, you descend gracefully."), + color = "#ACCCFF", + _effect_list = { + slow_falling = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "levitation", + desc_suffix = S("of Levitation"), + _tt = nil, + _longdesc = S("Floats body slowly upwards."), + color = "#420E7E", + _effect_list = { + levitation = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "darkness", + desc_suffix = S("of Darkness"), + _tt = nil, + _longdesc = S("Surrounds with darkness."), + color = "#000000", + _effect_list = { + darkness = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "glowing", + desc_suffix = S("of Glowing"), + _tt = nil, + _longdesc = S("Highlights for others to see."), + color = "#FFFF77", + _effect_list = { + glowing = {}, + }, + has_arrow = false, -- TODO add a spectral arrow instead (in mcl_bows?) +}) + +mcl_potions.register_potion({ + name = "health_boost", + desc_suffix = S("of Health Boost"), + _tt = nil, + _longdesc = S("Increases health."), + color = "#BE1919", + _effect_list = { + health_boost = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "absorption", + desc_suffix = S("of Absorption"), + _tt = nil, + _longdesc = S("Absorbs some incoming damage."), + color = "#B59500", + _effect_list = { + absorption = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "resistance", + desc_suffix = S("of Resistance"), + _tt = nil, + _longdesc = S("Decreases damage taken."), + color = "#2552A5", + _effect_list = { + resistance = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "stone_cloak", + desc_suffix = S("of Stone Cloak"), + _tt = nil, + _longdesc = S("Decreases damage taken at the cost of speed."), + color = "#255235", + _effect_list = { + resistance = { + level = 3, + dur = 20, + }, + slowness = { + level = 4, + level_scaling = 2, + dur = 20, + }, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "luck", + desc_suffix = S("of Luck"), + _tt = nil, + _longdesc = S("Increases luck."), + color = "#7BFF42", + _effect_list = { + luck = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "bad_luck", + desc_suffix = S("of Bad Luck"), + _tt = nil, + _longdesc = S("Decreases luck."), + color = "#887343", + _effect_list = { + bad_luck = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "frost", + desc_suffix = S("of Frost"), + _tt = nil, + _longdesc = S("Freezes..."), + color = "#5B7DAA", + _effect_list = { + frost = { + dur = mcl_potions.DURATION_POISON, + effect_stacks = true, + }, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "blindness", + desc_suffix = S("of Blindness"), + _tt = nil, + _longdesc = S("Impairs sight."), + color = "#586868", + _effect_list = { + blindness = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "nausea", + desc_suffix = S("of Nausea"), + _tt = nil, + _longdesc = S("Disintegrates senses."), + color = "#715C7F", + _effect_list = { + nausea = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "food_poisoning", + desc_suffix = S("of Food Poisoning"), + _tt = nil, + _longdesc = S("Moves bowels too fast."), + color = "#83A061", + _effect_list = { + food_poisoning = { + dur = mcl_potions.DURATION_POISON, + effect_stacks = true, + }, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "saturation", + desc_suffix = S("of Saturation"), + _tt = nil, + _longdesc = S("Satisfies hunger."), + color = "#CEAE29", + _effect_list = { + saturation = {dur=mcl_potions.DURATION_POISON}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "haste", + desc_suffix = S("of Haste"), + _tt = nil, + _longdesc = S("Increases digging and attack speed."), + color = "#FFFF00", + _effect_list = { + haste = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "fatigue", + desc_suffix = S("of Fatigue"), + _tt = nil, + _longdesc = S("Decreases digging and attack speed."), + color = "#64643D", + _effect_list = { + fatigue = {}, + }, + has_arrow = true, +}) + +mcl_potions.register_potion({ + name = "ominous", + desc_prefix = S("Ominous"), + _tt = nil, + _longdesc = S("Attracts danger."), + image = table.concat({ + "(mcl_potions_potion_overlay.png^[colorize:red:100)", + "^mcl_potions_splash_overlay.png^[colorize:black:100", + "^mcl_potions_potion_bottle.png", + }), + _effect_list = { + bad_omen = {dur = 6000}, + }, + has_splash = false, + has_lingering = false, +}) + + + + +-- COMPAT CODE +local function replace_legacy_potion(itemstack) + local name = itemstack:get_name() + local suffix = "" + local bare_name = name:match("^(.+)_splash$") + if bare_name then + suffix = "_splash" + else + bare_name = name:match("^(.+)_lingering$") + if bare_name then + suffix = "_lingering" + else + bare_name = name:match("^(.+)_arrow$") + if bare_name then + suffix = "_arrow" + else + bare_name = name + end + end + end + local new_name = bare_name:match("^(.+)_plus$") + local new_stack + if new_name then + new_stack = ItemStack(new_name..suffix) + new_stack:get_meta():set_int("mcl_potions:potion_plus", + registered_potions[new_name]._default_extend_level) + new_stack:set_count(itemstack:get_count()) + tt.reload_itemstack_description(new_stack) + end + new_name = bare_name:match("^(.+)_2$") + if new_name then + new_stack = ItemStack(new_name..suffix) + new_stack:get_meta():set_int("mcl_potions:potion_potent", + registered_potions[new_name]._default_potent_level-1) + new_stack:set_count(itemstack:get_count()) + tt.reload_itemstack_description(new_stack) + end + return new_stack +end +local compat = "mcl_potions:compat_potion" +local compat_arrow = "mcl_potions:compat_arrow" +minetest.register_craftitem(compat, { + description = S("Unknown Potion"), + _tt_help = S("Right-click to identify"), + image = "mcl_potions_potion_overlay.png^[colorize:#00F:127^mcl_potions_potion_bottle.png^vl_unknown.png", + on_secondary_use = replace_legacy_potion, + on_place = replace_legacy_potion, +}) +minetest.register_craftitem(compat_arrow, { + description = S("Unknown Tipped Arrow"), + _tt_help = S("Right-click to identify"), + image = "mcl_bows_arrow_inv.png^(mcl_potions_arrow_inv.png^[colorize:#FFF:100)^vl_unknown.png", + on_secondary_use = replace_legacy_potion, + on_place = replace_legacy_potion, +}) + +local old_potions_plus = { + "fire_resistance", "water_breathing", "invisibility", "regeneration", "poison", + "withering", "leaping", "slowness", "swiftness", "night_vision" +} +local old_potions_2 = { + "healing", "harming", "swiftness", "slowness", "leaping", + "withering", "poison", "regeneration" } - - -local defs = { awkward_def, mundane_def, thick_def, dragon_breath_def, - healing_def, harming_def, night_vision_def, swiftness_def, - slowness_def, leaping_def, withering_def, poison_def, regeneration_def, - invisibility_def, water_breathing_def, fire_resistance_def} - -for _, def in ipairs(defs) do - register_potion(def) +for _, name in pairs(old_potions_2) do + minetest.register_alias("mcl_potions:" .. name .. "_2", compat) + minetest.register_alias("mcl_potions:" .. name .. "_2_splash", compat) + minetest.register_alias("mcl_potions:" .. name .. "_2_lingering", compat) + minetest.register_alias("mcl_potions:" .. name .. "_2_arrow", compat_arrow) +end +for _, name in pairs(old_potions_plus) do + minetest.register_alias("mcl_potions:" .. name .. "_plus", compat) + minetest.register_alias("mcl_potions:" .. name .. "_plus_splash", compat) + minetest.register_alias("mcl_potions:" .. name .. "_plus_lingering", compat) + minetest.register_alias("mcl_potions:" .. name .. "_plus_arrow", compat_arrow) end - - - - --- minetest.register_craftitem("mcl_potions:weakness", { --- description = S("Weakness"), --- _tt_help = TODO, --- _doc_items_longdesc = brewhelp, --- wield_image = potion_image("#484D48"), --- inventory_image = potion_image("#484D48"), --- groups = { brewitem=1, food=3, can_eat_when_full=1 }, --- stack_max = 1, --- --- on_place = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION*mcl_potions.INV_FACTOR) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#484D48") --- return itemstack --- end, --- --- on_secondary_use = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION*mcl_potions.INV_FACTOR) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#484D48") --- return itemstack --- end --- }) --- --- minetest.register_craftitem("mcl_potions:weakness_plus", { --- description = S("Weakness +"), --- _tt_help = TODO, --- _doc_items_longdesc = brewhelp, --- wield_image = potion_image("#484D48"), --- inventory_image = potion_image("#484D48"), --- groups = { brewitem=1, food=3, can_eat_when_full=1 }, --- stack_max = 1, --- --- on_place = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#484D48") --- return itemstack --- end, --- --- on_secondary_use = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, -4, mcl_potions.DURATION_2*mcl_potions.INV_FACTOR) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#484D48") --- return itemstack --- end --- }) --- --- minetest.register_craftitem("mcl_potions:strength", { --- description = S("Strength"), --- _tt_help = TODO, --- _doc_items_longdesc = brewhelp, --- wield_image = potion_image("#932423"), --- inventory_image = potion_image("#932423"), --- groups = { brewitem=1, food=3, can_eat_when_full=1 }, --- stack_max = 1, --- --- on_place = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#932423") --- return itemstack --- end, --- --- on_secondary_use = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#932423") --- return itemstack --- end --- }) --- --- minetest.register_craftitem("mcl_potions:strength_2", { --- description = S("Strength II"), --- _tt_help = TODO, --- _doc_items_longdesc = brewhelp, --- wield_image = potion_image("#932423"), --- inventory_image = potion_image("#932423"), --- groups = { brewitem=1, food=3, can_eat_when_full=1 }, --- stack_max = 1, --- --- on_place = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, 6, mcl_potions.DURATION_2) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#932423") --- return itemstack --- end, --- --- on_secondary_use = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, 6, mcl_potions.DURATION_2) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#932423") --- return itemstack --- end --- }) --- --- minetest.register_craftitem("mcl_potions:strength_plus", { --- description = S("Strength +"), --- _tt_help = TODO, --- _doc_items_longdesc = brewhelp, --- wield_image = potion_image("#932423"), --- inventory_image = potion_image("#932423"), --- groups = { brewitem=1, food=3, can_eat_when_full=1 }, --- stack_max = 1, --- --- on_place = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION_PLUS) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#932423") --- return itemstack --- end, --- --- on_secondary_use = function(itemstack, user, pointed_thing) --- mcl_potions.weakness_func(user, 3, mcl_potions.DURATION_PLUS) --- minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) --- mcl_potions._use_potion(itemstack, user, "#932423") --- return itemstack --- end --- }) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 0b8aedeab..591bb30e4 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -13,20 +13,30 @@ end function mcl_potions.register_splash(name, descr, color, def) local id = "mcl_potions:"..name.."_splash" - local longdesc = def.longdesc + local longdesc = def._longdesc if not def.no_effect then - longdesc = S("A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.") - if def.longdesc then - longdesc = longdesc .. "\n" .. def.longdesc + longdesc = S("A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect or a set of status effects.") + if def._longdesc then + longdesc = longdesc .. "\n" .. def._longdesc end end + local groups = {brewitem=1, bottle=1, splash_potion=1, _mcl_potion=1} + if def.nocreative then groups.not_in_creative_inventory = 1 end minetest.register_craftitem(id, { description = descr, - _tt_help = def.tt, + _tt_help = def._tt, + _dynamic_tt = def._dynamic_tt, _doc_items_longdesc = longdesc, _doc_items_usagehelp = S("Use the “Punch” key to throw it."), + stack_max = def.stack_max, + _effect_list = def._effect_list, + uses_level = def.uses_level, + has_potent = def.has_potent, + has_plus = def.has_plus, + _default_potent_level = def._default_potent_level, + _default_extend_level = def._default_extend_level, inventory_image = splash_image(color), - groups = {brewitem=1, not_in_creative_inventory=0, bottle=1}, + groups = groups, on_use = function(item, placer, pointed_thing) local velocity = 10 local dir = placer:get_look_dir(); @@ -35,7 +45,11 @@ function mcl_potions.register_splash(name, descr, color, def) local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") obj:set_velocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) obj:set_acceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) - obj:get_luaentity()._thrower = placer:get_player_name() + local ent = obj:get_luaentity() + ent._thrower = placer:get_player_name() + ent._potency = item:get_meta():get_int("mcl_potions:potion_potent") + ent._plus = item:get_meta():get_int("mcl_potions:potion_plus") + ent._effect_list = def._effect_list if not minetest.is_creative_enabled(placer:get_player_name()) then item:take_item() end @@ -50,6 +64,10 @@ function mcl_potions.register_splash(name, descr, color, def) local velocity = 22 obj:set_velocity({x=dropdir.x*velocity,y=dropdir.y*velocity,z=dropdir.z*velocity}) obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3}) + local ent = obj:get_luaentity() + ent._potency = stack:get_meta():get_int("mcl_potions:potion_potent") + ent._plus = stack:get_meta():get_int("mcl_potions:potion_plus") + ent._effect_list = def._effect_list end }) @@ -103,10 +121,10 @@ function mcl_potions.register_splash(name, descr, color, def) texture = texture.."^[colorize:"..color..":127" }) - if name == "water" then - mcl_potions._extinguish_nearby_fire(pos) - end - self.object:remove() + local potency = self._potency or 0 + local plus = self._plus or 0 + + if def.on_splash then def.on_splash(pos, potency+1) end for _,obj in pairs(minetest.get_objects_inside_radius(pos, 4)) do local entity = obj:get_luaentity() @@ -114,13 +132,47 @@ function mcl_potions.register_splash(name, descr, color, def) local pos2 = obj:get_pos() local rad = math.floor(math.sqrt((pos2.x-pos.x)^2 + (pos2.y-pos.y)^2 + (pos2.z-pos.z)^2)) - if rad > 0 then - def.potion_fun(obj, redux_map[rad]) - else - def.potion_fun(obj, 1) + + if def._effect_list then + local ef_level + local dur + for name, details in pairs(def._effect_list) do + if details.uses_level then + ef_level = details.level + details.level_scaling * (potency) + else + ef_level = details.level + end + if details.dur_variable then + dur = details.dur * math.pow(mcl_potions.PLUS_FACTOR, plus) + if potency>0 and details.uses_level then + dur = dur / math.pow(mcl_potions.POTENT_FACTOR, potency) + end + dur = dur * mcl_potions.SPLASH_FACTOR + else + dur = details.dur + end + if details.effect_stacks then + ef_level = ef_level + mcl_potions.get_effect_level(obj, name) + end + if rad > 0 then + mcl_potions.give_effect_by_level(name, obj, ef_level, redux_map[rad]*dur) + else + mcl_potions.give_effect_by_level(name, obj, ef_level, dur) + end + end + end + + if def.custom_effect then + local power = (potency+1) * mcl_potions.SPLASH_FACTOR + if rad > 0 then + def.custom_effect(obj, redux_map[rad] * power, plus) + else + def.custom_effect(obj, power, plus) + end end end end + self.object:remove() end end, diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 53a37705e..1833e7169 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -37,16 +37,26 @@ local arrow_tt = minetest.registered_items["mcl_bows:arrow"]._tt_help or "" function mcl_potions.register_arrow(name, desc, color, def) - local longdesc = def.longdesc or "" + local longdesc = def._longdesc or "" + local tt = def._tt or "" + local groups = {ammo=1, ammo_bow=1, brewitem=1, _mcl_potion=1} + if def.nocreative then groups.not_in_creative_inventory = 1 end minetest.register_craftitem("mcl_potions:"..name.."_arrow", { description = desc, - _tt_help = arrow_tt .. "\n" .. def.tt, + _tt_help = arrow_tt .. "\n" .. tt, + _dynamic_tt = def._dynamic_tt, _doc_items_longdesc = arrow_longdesc .. "\n" .. S("This particular arrow is tipped and will give an effect when it hits a player or mob.") .. "\n" .. longdesc, _doc_items_usagehelp = how_to_shoot, + _effect_list = def._effect_list, + uses_level = def.uses_level, + has_potent = def.has_potent, + has_plus = def.has_plus, + _default_potent_level = def._default_potent_level, + _default_extend_level = def._default_extend_level, inventory_image = "mcl_bows_arrow_inv.png^(mcl_potions_arrow_inv.png^[colorize:"..color..":100)", - groups = { ammo=1, ammo_bow=1, brewitem=1}, + groups = groups, _on_dispense = function(itemstack, dispenserpos, droppos, dropnode, dropdir) -- Shoot arrow local shootpos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51)) @@ -264,21 +274,72 @@ function mcl_potions.register_arrow(name, desc, color, def) end end + local potency = self._potency or 0 + local plus = self._plus or 0 + -- Punch target object but avoid hurting enderman. if lua then - if lua.name ~= "mobs_mc:enderman" then + if lua.name ~= "mobs_mc:rover" then obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=self._damage}, }, nil) - def.potion_fun(obj) + if def._effect_list then + local ef_level + local dur + for name, details in pairs(def._effect_list) do + if details.uses_level then + ef_level = details.level + details.level_scaling * (potency) + else + ef_level = details.level + end + if details.dur_variable then + dur = details.dur * math.pow(mcl_potions.PLUS_FACTOR, plus) + if potency>0 and details.uses_level then + dur = dur / math.pow(mcl_potions.POTENT_FACTOR, potency) + end + else + dur = details.dur + end + dur = dur * mcl_potions.SPLASH_FACTOR + if details.effect_stacks then + ef_level = ef_level + mcl_potions.get_effect_level(obj, name) + end + mcl_potions.give_effect_by_level(name, obj, ef_level, dur) + end + end + if def.custom_effect then def.custom_effect(obj, potency+1, plus) end end else obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=self._damage}, }, nil) - def.potion_fun(obj) + if def._effect_list then + local ef_level + local dur + for name, details in pairs(def._effect_list) do + if details.uses_level then + ef_level = details.level + details.level_scaling * (potency) + else + ef_level = details.level + end + if details.dur_variable then + dur = details.dur * math.pow(mcl_potions.PLUS_FACTOR, plus) + if potency>0 and details.uses_level then + dur = dur / math.pow(mcl_potions.POTENT_FACTOR, potency) + end + else + dur = details.dur + end + dur = dur * mcl_potions.SPLASH_FACTOR + if details.effect_stacks then + ef_level = ef_level + mcl_potions.get_effect_level(obj, name) + end + mcl_potions.give_effect_by_level(name, obj, ef_level, dur) + end + end + if def.custom_effect then def.custom_effect(obj, potency+1, plus) end end if is_player then diff --git a/mods/ITEMS/mcl_signs/README.txt b/mods/ITEMS/mcl_signs/README.txt index e4fbead8a..4f7825b79 100644 --- a/mods/ITEMS/mcl_signs/README.txt +++ b/mods/ITEMS/mcl_signs/README.txt @@ -1,8 +1,8 @@ --- -# Mineclone2-Signs +# VoxeLibre Signs --- -A reworking of MineClone 2's mcl_signs to be colorable and made to glow. Requires Minetest and Mineclone2. +A reworking of VoxeLibre's mcl_signs to be colorable and made to glow. Requires Minetest and VoxeLibre. --- Created by Michieal (FaerRaven) @ DateTime: 10/14/22 4:05 PM @@ -23,7 +23,7 @@ License of code and font: MIT License Font source: 04.jp.org, some modifications and additions were made (added support for Latin-1 Supplement) Original font license text states: “YOU MAY USE THEM AS YOU LIKE” (in about.gif file distributed with the font) -License of textures: See README.md in top directory of MineClone 2, with the exception of the following: +License of textures: See README.md in top directory of VoxeLibre, with the exception of the following: default_sign.png, default_sign_dark.png, default_sign_greyscale.png, mcl_signs_sign_dark.png, mcl_signs_sign_greyscale.png are licensed as follows: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (https://creativecommons.org/licenses/by-sa/4.0/). @@ -36,9 +36,9 @@ Models author: 22i. Source: https://github.com/22i/amc -Mineclone 2 source code: -https://git.minetest.land/MineClone2/MineClone2 +VoxeLibre source code: +https://git.minetest.land/VoxeLibre/VoxeLibre --- NOTE: This MODule requires Glow Squids in order for all features to work 100% correctly. Glow Squids are currently -in review by the MineClone 2 Team, and should be available soon after this initial release of the new signs. \ No newline at end of file +in review by the VoxeLibre Team, and should be available soon after this initial release of the new signs. diff --git a/mods/ITEMS/mcl_signs/SIGNS_API_DOC.txt b/mods/ITEMS/mcl_signs/SIGNS_API_DOC.txt index e98741137..e5a3878f0 100644 --- a/mods/ITEMS/mcl_signs/SIGNS_API_DOC.txt +++ b/mods/ITEMS/mcl_signs/SIGNS_API_DOC.txt @@ -115,8 +115,8 @@ they get your sign (x3). automatically exist as part of the signs' package. You won't have to change any of your code, it'll just be more functional. :) -* if you have suggestions, comments, etc., please contact me on MineClone 2's Discord server. +* if you have suggestions, comments, etc., please contact me on VoxeLibre's Discord server. And that... is all there is to it! --- written by Michieal. \ No newline at end of file +-- written by Michieal. diff --git a/mods/ITEMS/mcl_smoker/README.md b/mods/ITEMS/mcl_smoker/README.md index 895a8dd81..cfe244e59 100644 --- a/mods/ITEMS/mcl_smoker/README.md +++ b/mods/ITEMS/mcl_smoker/README.md @@ -1,5 +1,5 @@ -Smoker for MineClone 2. -Heavily based on Minetest Game (default/furnace.lua) and the MineClone 2 Furnaces. +Smoker for VoxeLibre. +Heavily based on Minetest Game (default/furnace.lua) and the VoxeLibre Furnaces. License of source code ---------------------- @@ -10,4 +10,4 @@ MCl 2 Furances modified by PrairieWind. License of media ---------------- -See the main MineClone 2 README.md file. +See the main VoxeLibre README.md file. diff --git a/mods/ITEMS/mcl_sponges/locale/mcl_sponges.fr.tr b/mods/ITEMS/mcl_sponges/locale/mcl_sponges.fr.tr index 58dd74bee..34cbd8578 100644 --- a/mods/ITEMS/mcl_sponges/locale/mcl_sponges.fr.tr +++ b/mods/ITEMS/mcl_sponges/locale/mcl_sponges.fr.tr @@ -2,9 +2,9 @@ Sponge=Éponge Sponges are blocks which remove water around them when they are placed or come in contact with water, turning it into a wet sponge.=Les éponges sont des blocs qui éliminent l'eau autour d'eux lorsqu'ils sont placés ou entrent en contact avec l'eau, la transformant en une éponge humide. Waterlogged Sponge=Éponge gorgée d'eau -A waterlogged sponge can be dried in the furnace to turn it into (dry) sponge. When there's an empty bucket in the fuel slot of a furnace, the water will pour into the bucket.=Une éponge gorgée d'eau peut être séchée dans le four pour la transformer en éponge (sèche). Lorsqu'il y a un seau vide dans la fente de combustible d'un four, l'eau se déversera dans le seau. +A waterlogged sponge can be dried in the furnace to turn it into (dry) sponge. When there's an empty bucket in the fuel slot of a furnace, the water will pour into the bucket.=Une éponge gorgée d'eau peut être séchée dans le four pour la transformer en éponge (sèche). Lorsqu'il y a un seau vide dans la fente de combustible du four, l'eau se déversera dans le seau. Riverwaterlogged Sponge=Éponge gorgée d'eau de rivière -This is a sponge soaking wet with river water. It can be dried in the furnace to turn it into (dry) sponge. When there's an empty bucket in the fuel slot of the furnace, the river water will pour into the bucket.=Il s'agit d'une éponge trempée d'eau de rivière. Elle peut être séché dans le four pour le transformer en éponge (sèche). Lorsqu'il y a un seau vide dans la fente de combustible du four, l'eau de la rivière se déversera dans le seau. +This is a sponge soaking wet with river water. It can be dried in the furnace to turn it into (dry) sponge. When there's an empty bucket in the fuel slot of the furnace, the river water will pour into the bucket.=Il s'agit d'une éponge trempée d'eau de rivière. Elle peut être séchée dans le four pour la transformer en éponge (sèche). Lorsqu'il y a un seau vide dans la fente de combustible du four, l'eau de la rivière se déversera dans le seau. A sponge becomes riverwaterlogged (instead of waterlogged) if it sucks up more river water than (normal) water.=Une éponge devient gorgée d'eau de rivière (au lieu d'être gorgée d'eau) si elle aspire plus d'eau de rivière que d'eau (normale). Removes water on contact=Élimine l'eau au contact -Can be dried in furnace=Peut être séché au four +Can be dried in furnace=Peut être séchée au four diff --git a/mods/ITEMS/mcl_stairs/README.txt b/mods/ITEMS/mcl_stairs/README.txt index 9607b5d00..0c6ad9b20 100644 --- a/mods/ITEMS/mcl_stairs/README.txt +++ b/mods/ITEMS/mcl_stairs/README.txt @@ -1,4 +1,4 @@ -MineClone 2 mod: mcl_stairs +VoxeLibre mod: mcl_stairs ========================= Forked from stairs mod in Minetest Game 0.4.16. See license.txt for license information. diff --git a/mods/ITEMS/mcl_starting_inventory/README.txt b/mods/ITEMS/mcl_starting_inventory/README.txt index 126504b04..5f350b268 100644 --- a/mods/ITEMS/mcl_starting_inventory/README.txt +++ b/mods/ITEMS/mcl_starting_inventory/README.txt @@ -1,4 +1,4 @@ -Mcl_starting_inventory, adapted for Mineclone 2 by Michieal. +Mcl_starting_inventory, adapted for VoxeLibre by Michieal. Based on: Minetest Game mod: give_initial_stuff diff --git a/mods/ITEMS/mcl_stonecutter/README.md b/mods/ITEMS/mcl_stonecutter/README.md index 7fd31aa97..a0c89a8ec 100644 --- a/mods/ITEMS/mcl_stonecutter/README.md +++ b/mods/ITEMS/mcl_stonecutter/README.md @@ -18,7 +18,7 @@ Adds the stonecutter block. Used to cut stone like materials into stairs, slabs, License of code --------------- -See the main MineClone 2 README.md file. +See the main VoxeLibre README.md file. Author: PrairieWind, ChrisPHP, cora, Herowl, AFCMS License of media diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 9284d2a9c..0b2f6f166 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -66,13 +66,15 @@ function mcl_stonecutter.register_recipe(input, output, count) local fallthrough = mcl_stonecutter.registered_recipes[output] if fallthrough then for o, c in pairs(fallthrough) do - mcl_stonecutter.register_recipe(input, o, c * count) + if not mcl_stonecutter.registered_recipes[input][o] then + mcl_stonecutter.register_recipe(input, o, c * count) + end end end for i, recipes in pairs(mcl_stonecutter.registered_recipes) do for name, c in pairs(recipes) do - if name == input then + if name == input and not mcl_stonecutter.registered_recipes[i][output] then mcl_stonecutter.register_recipe(i, output, c * count) end end diff --git a/mods/ITEMS/mcl_sus_stew/README.md b/mods/ITEMS/mcl_sus_stew/README.md index 374d80b92..ce9bb1b42 100644 --- a/mods/ITEMS/mcl_sus_stew/README.md +++ b/mods/ITEMS/mcl_sus_stew/README.md @@ -1,3 +1,3 @@ # mcl_sus_stew -This Mod adds Suspicious Stews for Mineclone \ No newline at end of file +This Mod adds Suspicious Stews to VoxeLibre diff --git a/mods/ITEMS/mcl_sus_stew/init.lua b/mods/ITEMS/mcl_sus_stew/init.lua index d34dbbf00..8a88027ae 100644 --- a/mods/ITEMS/mcl_sus_stew/init.lua +++ b/mods/ITEMS/mcl_sus_stew/init.lua @@ -7,41 +7,63 @@ local eat = minetest.item_eat(6, "mcl_core:bowl") --6 hunger points, player rece local flower_effect = { [ "mcl_flowers:allium" ] = "fire_resistance", + [ "mcl_flowers:azure_bluet" ] = "blindness", [ "mcl_flowers:lily_of_the_valley" ] = "poison", - [ "mcl_flowers:blue_orchid" ] = "hunger", - [ "mcl_flowers:dandelion" ] = "hunger", + [ "mcl_flowers:blue_orchid" ] = "saturation", + [ "mcl_flowers:dandelion" ] = "saturation", [ "mcl_flowers:cornflower" ] = "jump", [ "mcl_flowers:oxeye_daisy" ] = "regeneration", - [ "mcl_flowers:poppy" ] = "night_vision" + [ "mcl_flowers:poppy" ] = "night_vision", + [ "mcl_flowers:wither_rose" ] = "withering", + [ "mcl_flowers:tulip_orange" ] = "weakness", + [ "mcl_flowers:tulip_pink" ] = "weakness", + [ "mcl_flowers:tulip_red" ] = "weakness", + [ "mcl_flowers:tulip_white" ] = "weakness", } local effects = { [ "fire_resistance" ] = function(itemstack, placer, pointed_thing) - mcl_potions.fire_resistance_func(placer, 1, 4) - return eat(itemstack, placer, pointed_thing) - end, - [ "poison" ] = function(itemstack, placer, pointed_thing) - mcl_potions.poison_func(placer, 1, 12) + mcl_potions.give_effect("fire_resistance", placer, 1, 4) return eat(itemstack, placer, pointed_thing) end, - [ "hunger" ] = function(itemstack, placer, pointed_thing, player) - mcl_hunger.item_eat(6, "mcl_core:bowl", 3.5, 0, 100) + [ "blindness" ] = function(itemstack, placer, pointed_thing) + mcl_potions.give_effect("blindness", placer, 1, 8) + return eat(itemstack, placer, pointed_thing) + end, + + [ "poison" ] = function(itemstack, placer, pointed_thing) + mcl_potions.give_effect_by_level("poison", placer, 1, 12) + return eat(itemstack, placer, pointed_thing) + end, + + [ "saturation" ] = function(itemstack, placer, pointed_thing, player) + mcl_potions.give_effect_by_level("saturation", placer, 1, 0.5) return eat(itemstack, placer, pointed_thing) end, ["jump"] = function(itemstack, placer, pointed_thing) - mcl_potions.leaping_func(placer, 1, 6) + mcl_potions.give_effect_by_level("leaping", placer, 1, 6) return eat(itemstack, placer, pointed_thing) end, ["regeneration"] = function(itemstack, placer, pointed_thing) - mcl_potions.regeneration_func(placer, 1, 8) + mcl_potions.give_effect_by_level("regeneration", placer, 1, 8) + return eat(itemstack, placer, pointed_thing) + end, + + ["withering"] = function(itemstack, placer, pointed_thing) + mcl_potions.give_effect_by_level("withering", placer, 1, 8) + return eat(itemstack, placer, pointed_thing) + end, + + ["weakness"] = function(itemstack, placer, pointed_thing) + mcl_potions.give_effect_by_level("weakness", placer, 1, 9) return eat(itemstack, placer, pointed_thing) end, ["night_vision"] = function(itemstack, placer, pointed_thing) - mcl_potions.night_vision_func(placer, 1, 5) + mcl_potions.give_effect("night_vision", placer, 1, 5) return eat(itemstack, placer, pointed_thing) end, } diff --git a/mods/ITEMS/mcl_throwing/README.md b/mods/ITEMS/mcl_throwing/README.md index a1ad06a8e..fe5069536 100644 --- a/mods/ITEMS/mcl_throwing/README.md +++ b/mods/ITEMS/mcl_throwing/README.md @@ -1,6 +1,6 @@ # `mcl_throwing` -It's a MineClone 2 mod containing throwable items like snowballs. +It's a VoxeLibre mod containing throwable items like snowballs. ## License of code @@ -29,4 +29,4 @@ It's a MineClone 2 mod containing throwable items like snowballs. - Source: - Original title: `Arrow002.wav` (file was edited) -- Everything else: See MineClone 2 license infos +- Everything else: See VoxeLibre license infos diff --git a/mods/ITEMS/mcl_throwing/register.lua b/mods/ITEMS/mcl_throwing/register.lua index 43dedd33b..3a91a18b9 100644 --- a/mods/ITEMS/mcl_throwing/register.lua +++ b/mods/ITEMS/mcl_throwing/register.lua @@ -293,7 +293,7 @@ minetest.register_craftitem("mcl_throwing:snowball", { _doc_items_longdesc = S("Snowballs can be thrown or launched from a dispenser for fun. Hitting something with a snowball does nothing."), _doc_items_usagehelp = how_to_throw, inventory_image = "mcl_throwing_snowball.png", - stack_max = 16, + stack_max = 64, groups = { weapon_ranged = 1 }, on_use = mcl_throwing.get_player_throw_function("mcl_throwing:snowball_entity"), _on_dispense = mcl_throwing.dispense_function, @@ -306,7 +306,7 @@ minetest.register_craftitem("mcl_throwing:egg", { _doc_items_longdesc = S("Eggs can be thrown or launched from a dispenser and breaks on impact. There is a small chance that 1 or even 4 chicks will pop out of the egg."), _doc_items_usagehelp = how_to_throw, inventory_image = "mcl_throwing_egg.png", - stack_max = 16, + stack_max = 64, on_use = mcl_throwing.get_player_throw_function("mcl_throwing:egg_entity"), _on_dispense = mcl_throwing.dispense_function, groups = { craftitem = 1 }, diff --git a/mods/ITEMS/mcl_tnt/README.txt b/mods/ITEMS/mcl_tnt/README.txt index 5b1c10798..9528b7993 100644 --- a/mods/ITEMS/mcl_tnt/README.txt +++ b/mods/ITEMS/mcl_tnt/README.txt @@ -1,5 +1,5 @@ === TNT mod for Minetest === -by PilzAdam. HEAVILY modified for MineClone 2. +by PilzAdam. HEAVILY modified for VoxeLibre. Introduction: This mod adds TNT. TNT is a tool to help the player in mining. diff --git a/mods/ITEMS/mcl_tools/README.md b/mods/ITEMS/mcl_tools/README.md index 8089da923..5a3b5bda3 100644 --- a/mods/ITEMS/mcl_tools/README.md +++ b/mods/ITEMS/mcl_tools/README.md @@ -1,4 +1,4 @@ -This mod adds tools for MineClone 2. +This mod adds tools for VoxeLibre. ## Credits @@ -7,4 +7,4 @@ This mod adds tools for MineClone 2. * Source: Other files: -See main MineClone 2 README. +See main VoxeLibre README. diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index a91bd8ce4..4e159343b 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -186,6 +186,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing) local wear = mcl_autogroup.get_wear(toolname, "shovely") if wear then itemstack:add_wear(wear) + tt.reload_itemstack_description(itemstack) -- update tooltip end end minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above, max_hear_distance = 16}, true) @@ -209,6 +210,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing) local wear = mcl_autogroup.get_wear(toolname, "shovely") if wear then itemstack:add_wear(wear) + tt.reload_itemstack_description(itemstack) -- update tooltip end end minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above, max_hear_distance = 16}, true) @@ -240,6 +242,7 @@ if minetest.get_modpath("mcl_farming") then local wear = mcl_autogroup.get_wear(toolname, "shearsy") if wear then itemstack:add_wear(wear) + tt.reload_itemstack_description(itemstack) -- update tooltip end end @@ -423,6 +426,7 @@ local function make_stripped_trunk(itemstack, placer, pointed_thing) local wear = mcl_autogroup.get_wear(toolname, "axey") if wear then itemstack:add_wear(wear) + tt.reload_itemstack_description(itemstack) -- update tooltip end end end diff --git a/mods/ITEMS/mcl_torches/README.txt b/mods/ITEMS/mcl_torches/README.txt index a1dd8eb77..e1e03dcac 100644 --- a/mods/ITEMS/mcl_torches/README.txt +++ b/mods/ITEMS/mcl_torches/README.txt @@ -20,7 +20,7 @@ nodes. Conversion from the wallmounted style is done through an LBM. Torches is meant for minetest-0.4.14, and does not directly support older minetest releases. You'll need a recent git, or nightly build. -Changes for MineClone: +Changes for VoxeLibre: ~~~~~~~~~~~~~~~~~~~~~~ - Torch does not generate light when wielding - Torch drops when near water diff --git a/mods/ITEMS/mcl_walls/API.md b/mods/ITEMS/mcl_walls/API.md index 5c21ce98d..63621ade1 100644 --- a/mods/ITEMS/mcl_walls/API.md +++ b/mods/ITEMS/mcl_walls/API.md @@ -1,6 +1,6 @@ -# API for MineClone 2 walls +# API for VoxeLibre walls -This API allows you to add more walls (like the cobblestone wall) to MineClone 2. +This API allows you to add more walls (like the cobblestone wall) to VoxeLibre. ## `mcl_walls.register_wall(nodename, description, craft_material, tiles, invtex, groups, sounds, hardness, blast_resistance)` diff --git a/mods/ITEMS/mcl_wool/locale/mcl_wool.fr.tr b/mods/ITEMS/mcl_wool/locale/mcl_wool.fr.tr index 6b93eab08..fc89dd1ff 100644 --- a/mods/ITEMS/mcl_wool/locale/mcl_wool.fr.tr +++ b/mods/ITEMS/mcl_wool/locale/mcl_wool.fr.tr @@ -1,37 +1,37 @@ # textdomain: mcl_wool Wool=Laine Carpet=Tapis -White Wool=Laine Blanche -White Carpet=Tapis Blanc -Grey Wool=Laine Grise -Grey Carpet=Tapis Gris -Light Grey Wool=Laine Gris Clair -Light Grey Carpet=Tapis Gris Clair -Black Wool=Laine Noire -Black Carpet=Tapis Noir -Red Wool=Laine Rouge -Red Carpet=Tapis Rouge -Yellow Wool=Laine Jaune -Yellow Carpet=Tapis Jaune -Green Wool=Laine Verte -Green Carpet=Tapis Vert -Cyan Wool=Lain Cyan -Cyan Carpet=Tapis Cyan -Blue Wool=Laine Bleue -Blue Carpet=Tapis Bleu -Magenta Wool=Laine Magenta -Magenta Carpet=Tapis Magenta -Orange Wool=Laine Orange -Orange Carpet=Tapis Orange -Purple Wool=Laine Violette -Purple Carpet=Tapis Violet -Brown Wool=Laine Marron -Brown Carpet=Tapis Marron -Pink Wool=Laine Rose -Pink Carpet=Tapis Rose -Lime Wool=Laine Vert Clair -Lime Carpet=Tapis Vert Clair -Light Blue Wool=Laine Bleu Clair -Light Blue Carpet=Tapis Bleu Clair +White Wool=Laine blanche +White Carpet=Tapis blanc +Grey Wool=Laine grise +Grey Carpet=Tapis gris +Light Grey Wool=Laine gris clair +Light Grey Carpet=Tapis gris clair +Black Wool=Laine noire +Black Carpet=Tapis noir +Red Wool=Laine rouge +Red Carpet=Tapis rouge +Yellow Wool=Laine jaune +Yellow Carpet=Tapis jaune +Green Wool=Laine verte +Green Carpet=Tapis vert +Cyan Wool=Lain cyan +Cyan Carpet=Tapis cyan +Blue Wool=Laine bleue +Blue Carpet=Tapis bleu +Magenta Wool=Laine magenta +Magenta Carpet=Tapis magenta +Orange Wool=Laine orange +Orange Carpet=Tapis orange +Purple Wool=Laine violette +Purple Carpet=Tapis violet +Brown Wool=Laine marron +Brown Carpet=Tapis marron +Pink Wool=Laine rose +Pink Carpet=Tapis rose +Lime Wool=Laine vert clair +Lime Carpet=Tapis vert clair +Light Blue Wool=Laine bleu clair +Light Blue Carpet=Tapis bleu clair Wool is a decorative block which comes in many different colors.=La laine est un bloc décoratif disponible en différentes couleurs. Carpets are thin floor covers which come in many different colors.=Les tapis sont des revêtements de sol minces qui viennent dans de nombreuses couleurs différentes. diff --git a/mods/ITEMS/screwdriver/API.md b/mods/ITEMS/screwdriver/API.md index 0c17ee683..c5371cf01 100644 --- a/mods/ITEMS/screwdriver/API.md +++ b/mods/ITEMS/screwdriver/API.md @@ -17,11 +17,11 @@ To use it, add the `on_rotate` function to the node definition. it but to indicate that changed have already been made (so the screwdriver will wear out) * use `on_rotate = false` to always disallow rotation * use `on_rotate = screwdriver.rotate_simple` to allow only face rotation - * use `on_rotate = screwdriver.rotate_3way` (MineClone 2 extension) for pillar-like nodes that should only have 3 possible orientations) + * use `on_rotate = screwdriver.rotate_3way` (VoxeLibre extension) for pillar-like nodes that should only have 3 possible orientations) -`after_rotate(pos)` (MineClone 2 extension) +`after_rotate(pos)` (VoxeLibre extension) Called after the rotation has been completed diff --git a/mods/ITEMS/screwdriver/README.md b/mods/ITEMS/screwdriver/README.md index 7237c8471..0e315ba1f 100644 --- a/mods/ITEMS/screwdriver/README.md +++ b/mods/ITEMS/screwdriver/README.md @@ -1,4 +1,4 @@ -MineClone 2 mod: screwdriver +VoxeLibre mod: screwdriver ============================ See license.txt for license information. diff --git a/mods/MAPGEN/mcl_end_island/init.lua b/mods/MAPGEN/mcl_end_island/init.lua index 434c3c6ef..46c841beb 100644 --- a/mods/MAPGEN/mcl_end_island/init.lua +++ b/mods/MAPGEN/mcl_end_island/init.lua @@ -34,7 +34,7 @@ end, function(minp,maxp,blockseed) table.shuffle(nn) if nn and #nn > 0 then for i=1,pr:next(1,math.min(5,#nn)) do - minetest.add_entity(vector.offset(nn[i],0,1,0),"mobs_mc:enderman") + minetest.add_entity(vector.offset(nn[i],0,1,0),"mobs_mc:rover") end end end, 15, true) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index c3eef6a26..dfea4f3ce 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -358,7 +358,7 @@ local function world_structure(vm, data, data2, emin, emax, area, minp, maxp, bl -- [[ THE NETHER: mcl_vars.mg_nether_min mcl_vars.mg_nether_max ]] - -- The Air on the Nether roof, https://git.minetest.land/MineClone2/MineClone2/issues/1186 + -- The Air on the Nether roof, https://git.minetest.land/VoxeLibre/VoxeLibre/issues/1186 lvm_used = set_layers(data, area, c_air , nil, mcl_vars.mg_nether_max +1, mcl_vars.mg_nether_max + 128 , minp, maxp, lvm_used, pr) -- The Void above the Nether below the End: lvm_used = set_layers(data, area, c_void , nil, mcl_vars.mg_nether_max + 128 +1, mcl_vars.mg_end_min -1, minp, maxp, lvm_used, pr) diff --git a/mods/MAPGEN/mcl_villages/README.txt b/mods/MAPGEN/mcl_villages/README.txt index b266a131a..4a4927051 100644 --- a/mods/MAPGEN/mcl_villages/README.txt +++ b/mods/MAPGEN/mcl_villages/README.txt @@ -1,6 +1,6 @@ MCL_Villages: ============================ -A fork of Rochambeau's "Settlements" mod converted for use in MineClone2. +A fork of Rochambeau's "Settlements" mod converted for use in VoxeLibre. -------------- Using the mod: @@ -16,7 +16,7 @@ MCL2 Credits: Code forked from: https://github.com/MysticTempest/settlements/tree/mcl_villages Commit: e24b4be ================================================================================ -Basic conversion of Settlements mod for compatibility with MineClone2, plus new schematics: MysticTempest +Basic conversion of Settlements mod for compatibility with VoxeLibre, plus new schematics: MysticTempest Seed-based Village Generation, multi-threading, bugfixes: kay27 @@ -40,6 +40,6 @@ Credits: -------------- This mod is based on "ruins" by BlockMen -Completely new schematics for MineClone2: +Completely new schematics for VoxeLibre: MysticTempest - CC-BY-SA 4.0 diff --git a/mods/MAPGEN/tsm_railcorridors/README.md b/mods/MAPGEN/tsm_railcorridors/README.md index de9df489e..3b839573c 100644 --- a/mods/MAPGEN/tsm_railcorridors/README.md +++ b/mods/MAPGEN/tsm_railcorridors/README.md @@ -1,5 +1,5 @@ # Railway corridors [`tsm_railcorridors`] -MineClone 2 adaption. NO TREASURER SUPPORT! +VoxeLibre adaption. NO TREASURER SUPPORT! * Current version 0.14.0 diff --git a/mods/PLAYER/mcl_criticals/init.lua b/mods/PLAYER/mcl_criticals/init.lua index 3e292d165..d30647004 100644 --- a/mods/PLAYER/mcl_criticals/init.lua +++ b/mods/PLAYER/mcl_criticals/init.lua @@ -23,7 +23,32 @@ mcl_damage.register_modifier(function(obj, damage, reason) texture = "mcl_particles_crit.png^[colorize:#bc7a57:127", }) minetest.sound_play("mcl_criticals_hit", {object = obj}) - return damage * math.random(1.5, 2.5) + local crit_mod + local CRIT_MIN = 1.5 + local CRIT_DIFF = 1 + if hitter:is_player() then + local luck = mcl_luck.get_luck(hitter:get_player_name()) + if luck ~= 0 then + local a, d + if luck > 0 then + d = -0.5 + a = d - math.abs(luck) + elseif luck < 0 then + a = -0.5 + d = a - math.abs(luck) + else + minetest.log("warning", "[mcl_criticals] luck is not a number") -- this technically can't happen, but want to catch such cases + end + if a then + local x = math.random() + crit_mod = CRIT_DIFF * (a * x) / (d - luck * x) + CRIT_MIN + end + end + end + if not crit_mod then + crit_mod = math.random(CRIT_MIN, CRIT_MIN + CRIT_DIFF) + end + return damage * crit_mod end end end, -100) diff --git a/mods/PLAYER/mcl_criticals/mod.conf b/mods/PLAYER/mcl_criticals/mod.conf index 5b0b91330..0ae588aa6 100644 --- a/mods/PLAYER/mcl_criticals/mod.conf +++ b/mods/PLAYER/mcl_criticals/mod.conf @@ -1,2 +1,2 @@ name = mcl_criticals -depends = mcl_damage +depends = mcl_damage, mcl_luck diff --git a/mods/PLAYER/mcl_fovapi/init.lua b/mods/PLAYER/mcl_fovapi/init.lua index 92815d833..43dcfe403 100644 --- a/mods/PLAYER/mcl_fovapi/init.lua +++ b/mods/PLAYER/mcl_fovapi/init.lua @@ -75,7 +75,7 @@ minetest.register_on_respawnplayer(function(player) mcl_fovapi.remove_all_modifiers(player) end) -function mcl_fovapi.apply_modifier(player, modifier_name) +function mcl_fovapi.apply_modifier(player, modifier_name, time_override) if not player or not modifier_name then return end @@ -106,13 +106,14 @@ function mcl_fovapi.apply_modifier(player, modifier_name) minetest.log("FOV::Modifier applied to player:" .. player_name .. " modifier: " .. modifier_name) end + local time = time_override or modifier.time -- modifier apply code. if modifier.exclusive == true then -- if exclusive, reset the player's fov, and apply the new fov. if modifier.is_multiplier then player:set_fov(0, false, 0) end - player:set_fov(modifier.fov_factor, modifier.is_multiplier, modifier.time) + player:set_fov(modifier.fov_factor, modifier.is_multiplier, time) else -- not exclusive? let's apply it in the mix. local fov_factor, is_mult = player:get_fov() @@ -126,15 +127,15 @@ function mcl_fovapi.apply_modifier(player, modifier_name) fov_factor = (fov_factor + modifier.fov_factor) / 2 end if modifier.is_multiplier and is_mult then - player:set_fov(fov_factor, true, modifier.time) + player:set_fov(fov_factor, true, time) else - player:set_fov(fov_factor, false, modifier.time) + player:set_fov(fov_factor, false, time) end end end -function mcl_fovapi.remove_modifier(player, modifier_name) +function mcl_fovapi.remove_modifier(player, modifier_name, time_override) if not player or not modifier_name then return end @@ -159,9 +160,10 @@ function mcl_fovapi.remove_modifier(player, modifier_name) applied[k] = mcl_fovapi.registered_modifiers[k] end + local time = time_override or modifier.reset_time local elem = next if elem(applied) == nil then - player:set_fov(0, false, modifier.reset_time) + player:set_fov(0, false, time) return end local exc = false @@ -191,7 +193,7 @@ function mcl_fovapi.remove_modifier(player, modifier_name) fov_factor = fov_factor * x.fov_factor end end - player:set_fov(fov_factor, not non_multiplier_added, modifier.reset_time) + player:set_fov(fov_factor, not non_multiplier_added, time) end if mcl_fovapi.registered_modifiers[modifier_name].on_end then diff --git a/mods/PLAYER/mcl_hunger/API.md b/mods/PLAYER/mcl_hunger/API.md index 57d158c48..85f2dc580 100644 --- a/mods/PLAYER/mcl_hunger/API.md +++ b/mods/PLAYER/mcl_hunger/API.md @@ -3,7 +3,7 @@ This API information is not complete yet. The mod API is still pretty much unofficial; this mod is mostly seen as standalone for now. -This may change in the future development of MineClone 2. Hopefully. +This may change in the future development of VoxeLibre. Hopefully. ## Mod state The hunger mechanic is disabled when damage is disabled diff --git a/mods/PLAYER/mcl_hunger/README.md b/mods/PLAYER/mcl_hunger/README.md index 47a7fce8c..f72b7f0cf 100644 --- a/mods/PLAYER/mcl_hunger/README.md +++ b/mods/PLAYER/mcl_hunger/README.md @@ -1,4 +1,4 @@ -# Hunger for MineClone 2 [`mcl_hunger`] +# Hunger for VoxeLibre [`mcl_hunger`] * Forked from `hbhunger`, version: 0.5.2 @@ -39,7 +39,7 @@ This mod is free software. * License: [LGPL v2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) * Author: by Wuzzy (2015-2016) -* Forked from `hbhunger` for MineClone 2. `hbhunger` in turn was forked from the “Better HUD +* Forked from `hbhunger` for VoxeLibre. `hbhunger` in turn was forked from the “Better HUD (and hunger)” mod by BlockMen (2013-2015), most code comes from this mod. ### Textures and sounds diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index de6369359..2c29e1939 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -99,42 +99,6 @@ function mcl_hunger.reset_bars_poison_hunger(player) end end --- Poison player -local function poisonp(tick, time, time_left, damage, exhaustion, name) - if not mcl_hunger.active then - return - end - local player = minetest.get_player_by_name(name) - -- First check if player is still there - if not player then - return - end - -- Abort if food poisonings have been stopped - if mcl_hunger.poison_hunger[name] == 0 then - return - end - time_left = time_left + tick - if time_left < time then - minetest.after(tick, poisonp, tick, time, time_left, damage, exhaustion, name) - else - if exhaustion > 0 then - mcl_hunger.poison_hunger [name] = mcl_hunger.poison_hunger[name] - 1 - end - if mcl_hunger.poison_hunger[name] <= 0 then - mcl_hunger.reset_bars_poison_hunger(player) - end - end - - -- Deal damage and exhaust player - -- TODO: Introduce fatal poison at higher difficulties - if player:get_hp()-damage > 0 then - mcl_util.deal_damage(player, damage, {type = "hunger"}) - end - - mcl_hunger.exhaust(name, exhaustion) - -end - local poisonrandomizer = PseudoRandom(os.time()) function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poison, exhaust, poisonchance, sound) @@ -186,15 +150,8 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso do_poison = true end if do_poison then - -- Set food poison bars - if exhaust and exhaust > 0 then - hb.change_hudbar(user, "hunger", nil, nil, "mcl_hunger_icon_foodpoison.png", nil, "mcl_hunger_bar_foodpoison.png") - if mcl_hunger.debug then - hb.change_hudbar(user, "exhaustion", nil, nil, nil, nil, "mcl_hunger_bar_foodpoison.png") - end - mcl_hunger.poison_hunger[name] = mcl_hunger.poison_hunger[name] + 1 - end - poisonp(1, poisontime, 0, poison, exhaust, user:get_player_name()) + local level = mcl_potions.get_effect_level(user, "food_poisoning") + mcl_potions.give_effect_by_level("food_poisoning", user, level+exhaust, poisontime) end end diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 45606cd61..03cd2a0a3 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -247,13 +247,13 @@ minetest.register_globalstep(function(dtime) food_tick_timer = 0 -- let hunger work always - if player_health > 0 and player_health <= 20 then + if player_health > 0 then --mcl_hunger.exhaust(player_name, mcl_hunger.EXHAUST_HUNGER) -- later for hunger status effect mcl_hunger.update_exhaustion_hud(player) end if food_level >= 18 then -- slow regeneration - if player_health > 0 and player_health < 20 then + if player_health > 0 and player_health < player:get_properties().hp_max then player:set_hp(player_health+1) mcl_hunger.exhaust(player_name, mcl_hunger.EXHAUST_REGEN) mcl_hunger.update_exhaustion_hud(player) @@ -270,7 +270,7 @@ minetest.register_globalstep(function(dtime) end elseif food_tick_timer > max_tick_timer and food_level == 20 and food_saturation_level > 0 then -- fast regeneration - if player_health > 0 and player_health < 20 then + if player_health > 0 and player_health < player:get_properties().hp_max then food_tick_timer = 0 player:set_hp(player_health+1) mcl_hunger.exhaust(player_name, mcl_hunger.EXHAUST_REGEN) diff --git a/mods/PLAYER/mcl_hunger/register_foods.lua b/mods/PLAYER/mcl_hunger/register_foods.lua index a68dde1c1..ee33e9332 100644 --- a/mods/PLAYER/mcl_hunger/register_foods.lua +++ b/mods/PLAYER/mcl_hunger/register_foods.lua @@ -1,7 +1,7 @@ -- Apply food poisoning effect as long there are no real status effect. --- TODO: Remove this when food poisoning a status effect in mcl_potions. +-- TODO: Sanitize this now that Food Poisoning is now an effect in mcl_potions -- Normal poison damage is set to 0 because it's handled elsewhere. -mcl_hunger.register_food("mcl_mobitems:rotten_flesh", 4, "", 30, 0, 100, 80) -mcl_hunger.register_food("mcl_mobitems:chicken", 2, "", 30, 0, 100, 30) -mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 15, 0, 300) +mcl_hunger.register_food("mcl_mobitems:rotten_flesh", 4, "", 30, 0, 1, 80) +mcl_hunger.register_food("mcl_mobitems:chicken", 2, "", 30, 0, 1, 30) +mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 15, 0, 3) diff --git a/mods/PLAYER/mcl_luck/init.lua b/mods/PLAYER/mcl_luck/init.lua new file mode 100644 index 000000000..275cea52f --- /dev/null +++ b/mods/PLAYER/mcl_luck/init.lua @@ -0,0 +1,33 @@ +mcl_luck = {} + +-- table indexed by player name +-- each entry for each player contains list of modifiers applied to the player +-- modifiers are listed by their name (defined when applying them) +-- all modifiers are dynamic (they are removed when the player leaves game and on server shutdown) +local applied_luck = {} + +function mcl_luck.apply_luck_modifier(player_name, modifier_name, amount) + applied_luck[player_name][modifier_name] = amount +end + +function mcl_luck.remove_luck_modifier(player_name, modifier_name) + applied_luck[player_name][modifier_name] = nil +end + +function mcl_luck.get_luck(player_name) + local luck = 0 + for _, amount in pairs(applied_luck[player_name]) do + luck = luck + amount + end + return luck +end + +minetest.register_on_joinplayer(function(player) + local player_name = player:get_player_name() + applied_luck[player_name] = {} +end) + +minetest.register_on_leaveplayer(function(player) + local player_name = player:get_player_name() + applied_luck[player_name] = nil +end) diff --git a/mods/PLAYER/mcl_luck/mod.conf b/mods/PLAYER/mcl_luck/mod.conf new file mode 100644 index 000000000..395c888bb --- /dev/null +++ b/mods/PLAYER/mcl_luck/mod.conf @@ -0,0 +1,3 @@ +name = mcl_luck +author = Herowl +description = An API for handling luck, it can be polled by random events. diff --git a/mods/PLAYER/mcl_meshhand/README.md b/mods/PLAYER/mcl_meshhand/README.md index 2c796ff32..89d53f484 100644 --- a/mods/PLAYER/mcl_meshhand/README.md +++ b/mods/PLAYER/mcl_meshhand/README.md @@ -1,4 +1,4 @@ -Mesh hand mod for MineClone 2. +Mesh hand mod for VoxeLibre. This mod uses a better-looking mesh for the wieldhand and applies the player skin texture to it. diff --git a/mods/PLAYER/mcl_meshhand/init.lua b/mods/PLAYER/mcl_meshhand/init.lua index c42ff8081..44eb3e2b9 100644 --- a/mods/PLAYER/mcl_meshhand/init.lua +++ b/mods/PLAYER/mcl_meshhand/init.lua @@ -76,13 +76,16 @@ else end function mcl_meshhand.update_player(player) + local hand if mcl_skins_enabled then local node_id = mcl_skins.get_node_id_by_player(player) - player:get_inventory():set_stack("hand", 1, "mcl_meshhand:" .. node_id) + hand = ItemStack("mcl_meshhand:" .. node_id) else local creative = minetest.is_creative_enabled(player:get_player_name()) - player:get_inventory():set_stack("hand", 1, "mcl_meshhand:hand" .. (creative and "_crea" or "_surv")) + hand = ItemStack("mcl_meshhand:hand" .. (creative and "_crea" or "_surv")) end + if not mcl_potions then player:get_inventory():set_stack("hand", 1, hand) end + player:get_inventory():set_stack("hand", 1, mcl_potions.hf_update_internal(hand, player)) end minetest.register_on_joinplayer(function(player) diff --git a/mods/PLAYER/mcl_player/README.txt b/mods/PLAYER/mcl_player/README.txt index 637a25684..91d919a9e 100644 --- a/mods/PLAYER/mcl_player/README.txt +++ b/mods/PLAYER/mcl_player/README.txt @@ -1,4 +1,4 @@ -MineClone 2 mod: mcl_player +VoxeLibre mod: mcl_player ========================== Adds the 3D player model, taken from Minetest Game 0.4.16. @@ -21,4 +21,4 @@ Authors of media files MirceaKitsune (CC BY-SA 3.0): character.b3d -Textures: See main MineClone 2 README.md file. +Textures: See main VoxeLibre README.md file. diff --git a/mods/PLAYER/mcl_playerinfo/README.md b/mods/PLAYER/mcl_playerinfo/README.md index fe5ac0a42..42bed0b78 100644 --- a/mods/PLAYER/mcl_playerinfo/README.md +++ b/mods/PLAYER/mcl_playerinfo/README.md @@ -1,4 +1,4 @@ -# PlayerInfo mod for MineClone 2 +# PlayerInfo mod for VoxeLibre This is a helper mod for other mod to query the nodes around the player. diff --git a/mods/PLAYER/mcl_playerplus/README.md b/mods/PLAYER/mcl_playerplus/README.md index e51d086fb..40801bfdd 100644 --- a/mods/PLAYER/mcl_playerplus/README.md +++ b/mods/PLAYER/mcl_playerplus/README.md @@ -1,4 +1,4 @@ -# PlayerPlus mod for MineClone 2 +# PlayerPlus mod for VoxeLibre ## Features diff --git a/mods/PLAYER/mcl_skins/README.md b/mods/PLAYER/mcl_skins/README.md index 4a5d150db..b381c31a9 100644 --- a/mods/PLAYER/mcl_skins/README.md +++ b/mods/PLAYER/mcl_skins/README.md @@ -1,9 +1,9 @@ -# Mineclone Skins +# VoxeLibre Skins This mod allows advanced skin customization. Use the /skin command to open the skin configuration screen. -To include custom skins in MineClone2, please download the [mcl_custom_skins](https://codeberg.org/MineClone2/mcl_custom_skins) mod. +To include custom skins in VoxeLibre, please download the [mcl_custom_skins](https://codeberg.org/MineClone2/mcl_custom_skins) mod. ## License Code under MIT license diff --git a/mods/PLAYER/mcl_skins/textures/README.txt b/mods/PLAYER/mcl_skins/textures/README.txt index 8b50278d3..381d8d6dc 100644 --- a/mods/PLAYER/mcl_skins/textures/README.txt +++ b/mods/PLAYER/mcl_skins/textures/README.txt @@ -1,3 +1,3 @@ To add custom skins to the game, please use the mcl_custom_skins mod. Download it from https://git.minetest.land/mineclone2/mcl_custom_skins -Support for adding custom skins to mcl_skins will be removed in a future MineClone2 release. +Support for adding custom skins to mcl_skins will be removed in a future VoxeLibre release. diff --git a/mods/PLAYER/mcl_sprint/README.md b/mods/PLAYER/mcl_sprint/README.md index f9f45d442..671e04b71 100644 --- a/mods/PLAYER/mcl_sprint/README.md +++ b/mods/PLAYER/mcl_sprint/README.md @@ -1,4 +1,4 @@ -# Sprint Mod for MineClone 2 +# Sprint Mod for VoxeLibre Forked from [sprint] by GunshipPenguin ## Description diff --git a/releasenotes/0_87-the_prismatic_release.md b/releasenotes/0_87-the_prismatic_release.md new file mode 100644 index 000000000..79668b9e5 --- /dev/null +++ b/releasenotes/0_87-the_prismatic_release.md @@ -0,0 +1,168 @@ +## 0.87 – The Prismatic release + +### Contributors +#### New Developers +* rudzik8 +* teknomunk + +#### New Contributors +* PrWalterB +* michaljmalinowski +* nixnoxus +* Potiron +* Tuxilio +* Impulse +* Doods +* SOS-Games +* Bram +* qoheniac + +### Game rename +Based on months of collecting suggestions, analysis and vetting of possible names, community voting and discussion between developers, the rename of the game has reached its conclusion! The project has been renamed to **VoxeLibre**. + +Along with this, a documentation update has been conducted by Herowl, teknomunk and rudzik8. Make sure to check out the updated Contributing Guidelines! + +### Potions and Effects redo +After more than half a year of work, it is finally here! The whole system has been rewritten from the ground up by Herowl. New effects, potions and brewing recipes have been added. Potion tooltips have been reworked. In the HUD you can now see more information about what effects you have at the moment, including level and duration. Beacon has also received more effects and is now quite functional. + +A few new items to be used as brewing ingredients have been added. For now you can obtain them from fishing and trading with villagers. Those items will be made obtainable from other sources and will get more uses, hopefully in the next release. The functionality of some effects is not complete and they are also not obtainable yet (hero of the village and conduit power). + +Some of the old potions and tipped arrows don't work with the new API and have to be converted. To avoid constant rechecking of all inventories, they have been bound to placeholder definitions. What this means is that if you notice weird potions or arrows marked with question marks, you will have to right-click them to run the conversion. A small price to pay for less lag, right? + +Improved support of mobs by the effects and potions, including effects being properly saved on mobs. Despite that, some effects still don't work with mobs, because the mobs' code doesn't support them properly: + +* the following effects don't work with mobs at all: water breathing, dolphin's grace, leaping, swiftness, slowness, slow falling, night vision, darkness, frost, health boost, absorption, fire resistance, resistance, luck, bad luck, blindness, nausea, food poisoning, saturation, haste, fatigue, conduit power +* the following effects should work with mobs: invisibility, regeneration, poison, withering, strength, weakness, levitation, glowing +* the following effects have no effect on mobs (but can be applied with the API): bad omen, hero of the village + +While not everything is available in game, a great API (documented in the module) has been exposed for modders, allowing adding new effects and potions. Potions can now have all sorts of custom effects and multiple effects at once. Effects and potions can now have indefinitely many levels and potentially infinite duration, available with the `/effect` command and the modding API. Effects can still (and even more so than before!) be fine-tuned with factors and abnormal levels, which can sometimes give unexpected results, but it's all left up to modders. + +### Nether Portals rewrite +Another large rework! Thanks to emptyshore, portals to (and from) the Nether now work better than ever, connecting properly to each other. They shouldn't cause unwelcome surprises either, stranding you where you never expected to go, and shouldn't teleport you up into the skies. + +### Mob spawning system +An update by Bakawun improved the mob spawning, optimizing it and making the randomness work better, as well as properly taking into account set spawn chances. This update also changed the mob spawn chances and ratios. + +Another improvement to the system was made by teknomunk, who wrote a new system for spawn position calculation. This enables overhead spawning, among other things allowing for some mob farms to work. + +Also, light and height checking of Slimes has been fixed by Codiac, so they should no longer spawn in large numbers in inappropriate places. + +### Mob improvements +Not only did mob spawning get improved, but mobs themselves did too. + +Rover is a new mob, replacing the enderman. Along with this rework by Herowl and teknomunk, node picking code was refactored and generalized, paving the way for more mobs visibly holding actual items in the future. + +Stalker is another new mob, replacing the creeper. This rework completed by Herowl contains a new camouflage mechanic and otherwise a new look at a well-known concept. + +Ghast received a great update by Bakawun and Herowl. Its hitbox should now work properly, and deflecting the fireballs should work properly again too. Also the achievement for killing a Ghast with a ghast fireball should now be granted properly. + +Sounds for Hoglin/Zoglin, Piglin and skeletons have been updated by Bakawun and should now be used properly. + +Strider received a few fixes by nixnoxus. Breeding, attracting and riding should now work. + +### Eating animation +Eating is no longer instant in survival mode, but delayed instead with the new system designed by Eliy21. + +To signify it properly, Herowl added an animation visible in the first-person mode. + +### New blocks +* Colored End Rod variants by Herowl. +* Colored Redstone Lamps by Herowl. +* Glazed Terracotta Pillars by Potiron. +* Compressed Cobblestone by SmokeyDope. +* Clovers and Four-leaf Clovers by Herowl. +* Hollow logs by JoseDouglas26 and Herowl + +### Capes +Thanks to the changes by chmodsayshello and rudzik8, you can now pick a cape in the character skin customization UI. Thanks for the "Minetest" cape texture to QwertyDragon. + +### Colored leather armor +Leather armor can now be colored (and washed) thanks to AFCMS and Herowl. Aside of the crafting recipes, this added a command and a modding API for this. + +### Cherry blossom particles +The particles of the cherry blossom, which fall from the cherry leaves, have been vastly improved by Wbjitscool and Herowl. Plant some cherry trees and behold the new animation and the wind direction changing 3 times a game day. + +### Signs text editing +Now you can edit the text on signs by right-clicking ("place") on a sign placed in the world, all thanks to Araca. + +### Tool durability tooltips +Yet another feature from Araca, tooltips for tools (and weapons) will now display how much durability they have remaining. Now you have more precise info than just the wearbar! + +### Creative inventory fixes +Items can't be moved around in the creative inventory, tabs there have proper tooltips and searching works on Android with Minetest 5.8+ – all thanks to rudzik8. + +### Help UI – Mobs section +A "Mobs" section added to the Help UI by SOS-Games. Translations may be missing. + +### Texture pack converter +One of our tools, the Python script allowing conversion of Minecraft resource packs (texture-wise) to the Minetest format to work with our game, has received a great update by Impulse and Doods. It should now work with packs from newer versions, but keep in mind that not everything can be automated and the packs may still require some manual fixes (and additions, if you want to cover all of our own features that have no equivalents in Minecraft). + +### New Translation +* Occitan by PrWalterB + +### Translation updates +* Spanish by megustanlosfrijoles +* French by syl +* Polish by Herowl +* German by Tuxilio, Herowl and qoheniac +* Syntax fixes in translation files by megustanlosfrijoles + +### Other changes +* Melon and pumpkin generation – by michaljmalinowski +* Golden rails accelerate carts properly – by nixnoxus +* Elytra Animation works again – by MrRar +* Mobs aggro disabled when damage is disabled – by emptyshore +* Fortune enchantment on hoes works – by JoseDouglas26 +* Typo in pumpkin.lua fixed – by SmokeyDope +* Node rotation at placement improvements – by JoseDouglas26 +* Nylium reverting to netherrack – by JoseDouglas26 +* Hunger debug setting exposed properly – by SmokeyDope +* Nether vine placement fixes – by SmokeyDope +* Survival inventory tabs API fixes – by Impulse +* Cactus damaging mobs – by Eliy21 +* Sweet berry bush slowdown decreased – by Eliy21 +* Fixed scaffolding placement replacing other blocks without a trace – by JoseDouglas26 +* Nodes fireproofing and missing plank recipes added – by Doods +* End Rods now use a proper mesh model – by Herowl +* Piglin bartering improvements – by nixnoxus +* Hopper item movement improved – by teknomunk +* Partial item stack pickup – by teknomunk +* Bone meal node protection check – by CyberMango +* Undeclared variable usage fixed – by nixnoxus +* Biome check when spawning override (API, Skyblock support) – by AncientMariner +* Reimported tga_encoder as subtree (this allows support of some mods) – by Herowl +* Bed placement and destruction fixes – by teknomunk +* Item tooltip shouldn't be modified needlessly (this fixes some bugs causing items to not stack properly) – by Herowl +* Beds now properly ignore players in other dimensions – by nixnoxus +* Stray pixels in leather cap texture removed – by SmokeyDope +* Allow lecterns to be placed on sides of blocks – by JoseDouglas26 +* Fix warnings – by JoseDouglas26 +* Experience from trading – by nixnoxus +* Boats easier to destroy with punching – by Eliy21 +* Horse and Donkey animation fix – by Bakawun +* Villagers won't eat shulker boxes (independent of their food content) anymore – by teknomunk +* Beds now properly ignore players in the wrong dimensions when counting – by nixnoxus +* Shears now wear properly when harvesting comb from a beehive – by teknomunk +* Improved compatibility with mapgen mods – by Bram +* Item frame attachment fixed – by rudzik8 +* Stray pixels in sweet berry textures removed – by rudzik8 +* Warning related to milk bucket fixed – by teknomunk +* Seed is now logged when entering a world – by Nicu +* Startup warnings from mcl_stonecutter fixed – by Herowl +* Sleeping GUI improved – by Nicu +* Description capitalization fix – by syl + +### Special thanks +* To emptyshore, for the in-depth research and testing of the Mob Spawning System rework, as well as his aforementioned Nether Portals system rework. + +### Crash fixes +* Damage animation related crash – by Herowl +* Shields-related crash – by Impulse +* Elytra-related crash – by Herowl +* Damage animation and player invulnerability related crash – by Eliy21 +* Rocket explosion related crash – by Herowl +* New game load crash – by AncientMariner +* XP orbs related crash – by teknomunk +* Ghast fireball related crash – by Araca +* Crash related to server restart while a player is dead – by teknomunk +* Crashes related to the new effects API - by teknomunk and Herowl diff --git a/textures/mcl_cherry_blossom_particle.png b/textures/mcl_cherry_blossom_particle.png deleted file mode 100644 index eabdb097c..000000000 Binary files a/textures/mcl_cherry_blossom_particle.png and /dev/null differ diff --git a/textures/mcl_cherry_blossom_particle_1.png b/textures/mcl_cherry_blossom_particle_1.png new file mode 100644 index 000000000..0b789e071 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_1.png differ diff --git a/textures/mcl_cherry_blossom_particle_10.png b/textures/mcl_cherry_blossom_particle_10.png new file mode 100644 index 000000000..a040a3922 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_10.png differ diff --git a/textures/mcl_cherry_blossom_particle_11.png b/textures/mcl_cherry_blossom_particle_11.png new file mode 100644 index 000000000..a86531ff6 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_11.png differ diff --git a/textures/mcl_cherry_blossom_particle_12.png b/textures/mcl_cherry_blossom_particle_12.png new file mode 100644 index 000000000..462798e6d Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_12.png differ diff --git a/textures/mcl_cherry_blossom_particle_2.png b/textures/mcl_cherry_blossom_particle_2.png new file mode 100644 index 000000000..e646513e0 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_2.png differ diff --git a/textures/mcl_cherry_blossom_particle_3.png b/textures/mcl_cherry_blossom_particle_3.png new file mode 100644 index 000000000..391355f83 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_3.png differ diff --git a/textures/mcl_cherry_blossom_particle_4.png b/textures/mcl_cherry_blossom_particle_4.png new file mode 100644 index 000000000..f0440ff1c Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_4.png differ diff --git a/textures/mcl_cherry_blossom_particle_5.png b/textures/mcl_cherry_blossom_particle_5.png new file mode 100644 index 000000000..a56829576 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_5.png differ diff --git a/textures/mcl_cherry_blossom_particle_6.png b/textures/mcl_cherry_blossom_particle_6.png new file mode 100644 index 000000000..9f7def63b Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_6.png differ diff --git a/textures/mcl_cherry_blossom_particle_7.png b/textures/mcl_cherry_blossom_particle_7.png new file mode 100644 index 000000000..bce32f796 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_7.png differ diff --git a/textures/mcl_cherry_blossom_particle_8.png b/textures/mcl_cherry_blossom_particle_8.png new file mode 100644 index 000000000..b7965c74e Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_8.png differ diff --git a/textures/mcl_cherry_blossom_particle_9.png b/textures/mcl_cherry_blossom_particle_9.png new file mode 100644 index 000000000..00817db16 Binary files /dev/null and b/textures/mcl_cherry_blossom_particle_9.png differ diff --git a/textures/mcl_heads_stalker.png b/textures/mcl_heads_stalker.png new file mode 100644 index 000000000..79978bb45 Binary files /dev/null and b/textures/mcl_heads_stalker.png differ diff --git a/textures/mcl_potions_blindness_hud.png b/textures/mcl_potions_blindness_hud.png new file mode 100644 index 000000000..ac5be885b Binary files /dev/null and b/textures/mcl_potions_blindness_hud.png differ diff --git a/textures/mcl_potions_effect_absorption.png b/textures/mcl_potions_effect_absorption.png new file mode 100644 index 000000000..114f64e2d Binary files /dev/null and b/textures/mcl_potions_effect_absorption.png differ diff --git a/textures/mcl_potions_effect_bad_luck.png b/textures/mcl_potions_effect_bad_luck.png new file mode 100644 index 000000000..f950d489f Binary files /dev/null and b/textures/mcl_potions_effect_bad_luck.png differ diff --git a/textures/mcl_potions_effect_bad_omen.png b/textures/mcl_potions_effect_bad_omen.png index 4293aed22..e652e6c5c 100644 Binary files a/textures/mcl_potions_effect_bad_omen.png and b/textures/mcl_potions_effect_bad_omen.png differ diff --git a/textures/mcl_potions_effect_blindness.png b/textures/mcl_potions_effect_blindness.png new file mode 100644 index 000000000..b7f7d7340 Binary files /dev/null and b/textures/mcl_potions_effect_blindness.png differ diff --git a/textures/mcl_potions_effect_conduit_power.png b/textures/mcl_potions_effect_conduit_power.png new file mode 100644 index 000000000..a25536907 Binary files /dev/null and b/textures/mcl_potions_effect_conduit_power.png differ diff --git a/textures/mcl_potions_effect_darkness.png b/textures/mcl_potions_effect_darkness.png new file mode 100644 index 000000000..fc72daeb0 Binary files /dev/null and b/textures/mcl_potions_effect_darkness.png differ diff --git a/textures/mcl_potions_effect_dolphin_grace.png b/textures/mcl_potions_effect_dolphin_grace.png new file mode 100644 index 000000000..ac640819d Binary files /dev/null and b/textures/mcl_potions_effect_dolphin_grace.png differ diff --git a/textures/mcl_potions_effect_fatigue.png b/textures/mcl_potions_effect_fatigue.png new file mode 100644 index 000000000..13b724c2a Binary files /dev/null and b/textures/mcl_potions_effect_fatigue.png differ diff --git a/textures/mcl_potions_effect_fire_proof.png b/textures/mcl_potions_effect_fire_proof.png deleted file mode 100644 index effbefaa4..000000000 Binary files a/textures/mcl_potions_effect_fire_proof.png and /dev/null differ diff --git a/textures/mcl_potions_effect_fire_resistance.png b/textures/mcl_potions_effect_fire_resistance.png new file mode 100644 index 000000000..3be85391d Binary files /dev/null and b/textures/mcl_potions_effect_fire_resistance.png differ diff --git a/textures/mcl_potions_effect_food_poisoning.png b/textures/mcl_potions_effect_food_poisoning.png index f29be56a5..8fb969e6e 100644 Binary files a/textures/mcl_potions_effect_food_poisoning.png and b/textures/mcl_potions_effect_food_poisoning.png differ diff --git a/textures/mcl_potions_effect_frost.png b/textures/mcl_potions_effect_frost.png new file mode 100644 index 000000000..6a008d25c Binary files /dev/null and b/textures/mcl_potions_effect_frost.png differ diff --git a/textures/mcl_potions_effect_glowing.png b/textures/mcl_potions_effect_glowing.png new file mode 100644 index 000000000..83cd8b969 Binary files /dev/null and b/textures/mcl_potions_effect_glowing.png differ diff --git a/textures/mcl_potions_effect_haste.png b/textures/mcl_potions_effect_haste.png new file mode 100644 index 000000000..54dd34740 Binary files /dev/null and b/textures/mcl_potions_effect_haste.png differ diff --git a/textures/mcl_potions_effect_health_boost.png b/textures/mcl_potions_effect_health_boost.png new file mode 100644 index 000000000..a20ae5ccc Binary files /dev/null and b/textures/mcl_potions_effect_health_boost.png differ diff --git a/textures/mcl_potions_effect_hero_of_village.png b/textures/mcl_potions_effect_hero_of_village.png new file mode 100644 index 000000000..c0462a40f Binary files /dev/null and b/textures/mcl_potions_effect_hero_of_village.png differ diff --git a/textures/mcl_potions_effect_invisibility.png b/textures/mcl_potions_effect_invisibility.png new file mode 100644 index 000000000..138111efa Binary files /dev/null and b/textures/mcl_potions_effect_invisibility.png differ diff --git a/textures/mcl_potions_effect_invisible.png b/textures/mcl_potions_effect_invisible.png deleted file mode 100644 index db0afb575..000000000 Binary files a/textures/mcl_potions_effect_invisible.png and /dev/null differ diff --git a/textures/mcl_potions_effect_leaping.png b/textures/mcl_potions_effect_leaping.png index 8fbf25ae8..3b9d5500e 100644 Binary files a/textures/mcl_potions_effect_leaping.png and b/textures/mcl_potions_effect_leaping.png differ diff --git a/textures/mcl_potions_effect_levitation.png b/textures/mcl_potions_effect_levitation.png new file mode 100644 index 000000000..ca8b6db1d Binary files /dev/null and b/textures/mcl_potions_effect_levitation.png differ diff --git a/textures/mcl_potions_effect_luck.png b/textures/mcl_potions_effect_luck.png new file mode 100644 index 000000000..46df46a03 Binary files /dev/null and b/textures/mcl_potions_effect_luck.png differ diff --git a/textures/mcl_potions_effect_nausea.png b/textures/mcl_potions_effect_nausea.png new file mode 100644 index 000000000..1b291ee49 Binary files /dev/null and b/textures/mcl_potions_effect_nausea.png differ diff --git a/textures/mcl_potions_effect_night_vision.png b/textures/mcl_potions_effect_night_vision.png index f4263968a..e5d7f1a2d 100644 Binary files a/textures/mcl_potions_effect_night_vision.png and b/textures/mcl_potions_effect_night_vision.png differ diff --git a/textures/mcl_potions_effect_poison.png b/textures/mcl_potions_effect_poison.png new file mode 100644 index 000000000..014b4314c Binary files /dev/null and b/textures/mcl_potions_effect_poison.png differ diff --git a/textures/mcl_potions_effect_poisoned.png b/textures/mcl_potions_effect_poisoned.png deleted file mode 100644 index 9d8cd5815..000000000 Binary files a/textures/mcl_potions_effect_poisoned.png and /dev/null differ diff --git a/textures/mcl_potions_effect_regenerating.png b/textures/mcl_potions_effect_regenerating.png deleted file mode 100644 index dfb82bba9..000000000 Binary files a/textures/mcl_potions_effect_regenerating.png and /dev/null differ diff --git a/textures/mcl_potions_effect_regeneration.png b/textures/mcl_potions_effect_regeneration.png new file mode 100644 index 000000000..1c5b7d502 Binary files /dev/null and b/textures/mcl_potions_effect_regeneration.png differ diff --git a/textures/mcl_potions_effect_resistance.png b/textures/mcl_potions_effect_resistance.png new file mode 100644 index 000000000..e81acfd45 Binary files /dev/null and b/textures/mcl_potions_effect_resistance.png differ diff --git a/textures/mcl_potions_effect_saturation.png b/textures/mcl_potions_effect_saturation.png new file mode 100644 index 000000000..13bbd41e8 Binary files /dev/null and b/textures/mcl_potions_effect_saturation.png differ diff --git a/textures/mcl_potions_effect_slow.png b/textures/mcl_potions_effect_slow.png deleted file mode 100644 index 464d270a9..000000000 Binary files a/textures/mcl_potions_effect_slow.png and /dev/null differ diff --git a/textures/mcl_potions_effect_slow_falling.png b/textures/mcl_potions_effect_slow_falling.png new file mode 100644 index 000000000..5e82afc91 Binary files /dev/null and b/textures/mcl_potions_effect_slow_falling.png differ diff --git a/textures/mcl_potions_effect_slowness.png b/textures/mcl_potions_effect_slowness.png new file mode 100644 index 000000000..eafff9d35 Binary files /dev/null and b/textures/mcl_potions_effect_slowness.png differ diff --git a/textures/mcl_potions_effect_strength.png b/textures/mcl_potions_effect_strength.png new file mode 100644 index 000000000..54da79ed0 Binary files /dev/null and b/textures/mcl_potions_effect_strength.png differ diff --git a/textures/mcl_potions_effect_strong.png b/textures/mcl_potions_effect_strong.png deleted file mode 100644 index 515b5777a..000000000 Binary files a/textures/mcl_potions_effect_strong.png and /dev/null differ diff --git a/textures/mcl_potions_effect_swift.png b/textures/mcl_potions_effect_swift.png deleted file mode 100644 index cf9e4b95c..000000000 Binary files a/textures/mcl_potions_effect_swift.png and /dev/null differ diff --git a/textures/mcl_potions_effect_swiftness.png b/textures/mcl_potions_effect_swiftness.png new file mode 100644 index 000000000..cf5d6b4d9 Binary files /dev/null and b/textures/mcl_potions_effect_swiftness.png differ diff --git a/textures/mcl_potions_effect_water_breathing.png b/textures/mcl_potions_effect_water_breathing.png index 3ced75eba..80a1054f7 100644 Binary files a/textures/mcl_potions_effect_water_breathing.png and b/textures/mcl_potions_effect_water_breathing.png differ diff --git a/textures/mcl_potions_effect_weak.png b/textures/mcl_potions_effect_weak.png deleted file mode 100644 index 398c161ab..000000000 Binary files a/textures/mcl_potions_effect_weak.png and /dev/null differ diff --git a/textures/mcl_potions_effect_weakness.png b/textures/mcl_potions_effect_weakness.png new file mode 100644 index 000000000..62c2e3e12 Binary files /dev/null and b/textures/mcl_potions_effect_weakness.png differ diff --git a/textures/mcl_potions_frost_hud.png b/textures/mcl_potions_frost_hud.png new file mode 100644 index 000000000..282c713f1 Binary files /dev/null and b/textures/mcl_potions_frost_hud.png differ diff --git a/textures/mcl_potions_glow_waypoint.png b/textures/mcl_potions_glow_waypoint.png new file mode 100644 index 000000000..1e5afedfb Binary files /dev/null and b/textures/mcl_potions_glow_waypoint.png differ diff --git a/textures/mcl_potions_icon_absorb.png b/textures/mcl_potions_icon_absorb.png new file mode 100644 index 000000000..f1f671f6b Binary files /dev/null and b/textures/mcl_potions_icon_absorb.png differ diff --git a/textures/mcl_potions_icon_frost.png b/textures/mcl_potions_icon_frost.png new file mode 100644 index 000000000..f9edd0d7c Binary files /dev/null and b/textures/mcl_potions_icon_frost.png differ diff --git a/textures/mcl_potions_icon_regen_frost.png b/textures/mcl_potions_icon_regen_frost.png new file mode 100644 index 000000000..0a604ec55 Binary files /dev/null and b/textures/mcl_potions_icon_regen_frost.png differ diff --git a/textures/mineclone2_icon.png b/textures/mineclone2_icon.png deleted file mode 100644 index d2a1554a6..000000000 Binary files a/textures/mineclone2_icon.png and /dev/null differ diff --git a/textures/mineclone2_logo.png b/textures/mineclone2_logo.png deleted file mode 100644 index d3e01733d..000000000 Binary files a/textures/mineclone2_logo.png and /dev/null differ diff --git a/textures/vl_mobitems_aery_charge.png b/textures/vl_mobitems_aery_charge.png new file mode 100644 index 000000000..51608d922 Binary files /dev/null and b/textures/vl_mobitems_aery_charge.png differ diff --git a/textures/vl_mobitems_crystalline_drop.png b/textures/vl_mobitems_crystalline_drop.png new file mode 100644 index 000000000..42ecb6d6d Binary files /dev/null and b/textures/vl_mobitems_crystalline_drop.png differ diff --git a/textures/vl_mobitems_earthen_ash.png b/textures/vl_mobitems_earthen_ash.png new file mode 100644 index 000000000..63fd28bbf Binary files /dev/null and b/textures/vl_mobitems_earthen_ash.png differ diff --git a/textures/vl_mobitems_ice_crystal.png b/textures/vl_mobitems_ice_crystal.png new file mode 100644 index 000000000..a3138545f Binary files /dev/null and b/textures/vl_mobitems_ice_crystal.png differ diff --git a/textures/vl_mobitems_spectre_membrane.png b/textures/vl_mobitems_spectre_membrane.png new file mode 100644 index 000000000..0819e7532 Binary files /dev/null and b/textures/vl_mobitems_spectre_membrane.png differ diff --git a/textures/vl_mobs_rover.png b/textures/vl_mobs_rover.png new file mode 100644 index 000000000..6bda2ca0f Binary files /dev/null and b/textures/vl_mobs_rover.png differ diff --git a/textures/vl_mobs_rover_face.png b/textures/vl_mobs_rover_face.png new file mode 100644 index 000000000..d4b6bba9a Binary files /dev/null and b/textures/vl_mobs_rover_face.png differ diff --git a/textures/vl_mobs_rover_face_angry.png b/textures/vl_mobs_rover_face_angry.png new file mode 100644 index 000000000..a6ea6dd27 Binary files /dev/null and b/textures/vl_mobs_rover_face_angry.png differ diff --git a/textures/vl_mobs_stalker_overlay.png b/textures/vl_mobs_stalker_overlay.png new file mode 100644 index 000000000..9a9897665 Binary files /dev/null and b/textures/vl_mobs_stalker_overlay.png differ diff --git a/textures/vl_mobs_stalker_overlay_angry.png b/textures/vl_mobs_stalker_overlay_angry.png new file mode 100644 index 000000000..473ad7b7f Binary files /dev/null and b/textures/vl_mobs_stalker_overlay_angry.png differ diff --git a/textures/vl_stalker_default.png b/textures/vl_stalker_default.png new file mode 100644 index 000000000..fbffb4cdf Binary files /dev/null and b/textures/vl_stalker_default.png differ diff --git a/textures/vl_stalker_overloaded_aura.png b/textures/vl_stalker_overloaded_aura.png new file mode 100644 index 000000000..8deb059d2 Binary files /dev/null and b/textures/vl_stalker_overloaded_aura.png differ diff --git a/textures/vl_unknown.png b/textures/vl_unknown.png new file mode 100644 index 000000000..279a4cdb0 Binary files /dev/null and b/textures/vl_unknown.png differ diff --git a/textures/voxelibre_icon.png b/textures/voxelibre_icon.png new file mode 100644 index 000000000..433532678 Binary files /dev/null and b/textures/voxelibre_icon.png differ diff --git a/textures/voxelibre_logo.png b/textures/voxelibre_logo.png new file mode 100644 index 000000000..69aa42d5b Binary files /dev/null and b/textures/voxelibre_logo.png differ diff --git a/tools/README.md b/tools/README.md index 4dc378bc1..7ff016bf9 100644 --- a/tools/README.md +++ b/tools/README.md @@ -1,10 +1,10 @@ -# MineClone 2 Tools -This directory is for tools and scripts for MineClone 2. +# VoxeLibre Tools +This directory is for tools and scripts for VoxeLibre. Currently, the only tool is Texture Converter. ## Texture Converter (EXPERIMENTAL) This is a Python script which converts a resource pack for Minecraft to -a texture pack for Minetest so it can be used with MineClone 2. +a texture pack for Minetest so it can be used with VoxeLibre. **WARNING**: This script is currently incomplete, not all textures will be converted. Some texture conversions are even buggy! @@ -14,7 +14,7 @@ will be required afterwards. Modes of operation: - Can create a Minetest texture pack (default) -- Can update the MineClone 2 textures +- Can update the VoxeLibre textures Requirements: - Know how to use the console @@ -29,7 +29,7 @@ Usage: any other Minetest texture pack ## Luacheck Globals Generators -This is a Python script which list every single global tables in mineclone2 source code. +This is a Python script which list every single global tables in VoxeLibre source code. It outputs a list to be used in luacheck conf files. Modes of operation: diff --git a/tools/Texture_Converter.py b/tools/Texture_Converter.py index a0eef8565..df882b681 100755 --- a/tools/Texture_Converter.py +++ b/tools/Texture_Converter.py @@ -11,7 +11,7 @@ from libtextureconverter.common import convert_resource_packs def main(): make_texture_pack = True - parser = argparse.ArgumentParser(description=f"This is the official MineClone 2 Texture Converter. This will convert textures from Minecraft resource packs to a Minetest texture pack. Supported Minecraft version: {SUPPORTED_MINECRAFT_VERSION} (Java Edition)") + parser = argparse.ArgumentParser(description=f"This is the official VoxeLibre Texture Converter. This will convert textures from Minecraft resource packs to a Minetest texture pack. Supported Minecraft version: {SUPPORTED_MINECRAFT_VERSION} (Java Edition)") parser.add_argument("-i", "--input", help="Directory of Minecraft resource pack to convert") parser.add_argument("-o", "--output", default=working_dir, help="Directory in which to put the resulting Minetest texture pack") parser.add_argument("-p", "--pixel-size", type=int, help="Size (in pixels) of the original textures") diff --git a/tools/colors.txt b/tools/colors.txt index de20aa49a..86f56c422 100644 --- a/tools/colors.txt +++ b/tools/colors.txt @@ -715,9 +715,9 @@ mcl_furnaces:furnace_active 149 139 133 mcl_grindstone:grindstone 216 216 216 # mcl_heads -mcl_heads:creeper22_5 94 115 69 -mcl_heads:creeper45 94 115 69 -mcl_heads:creeper67_5 94 115 69 +mcl_heads:stalker22_5 94 115 69 +mcl_heads:stalker45 94 115 69 +mcl_heads:stalker67_5 94 115 69 mcl_heads:skeleton22_5 126 126 126 mcl_heads:skeleton45 126 126 126 mcl_heads:skeleton67_5 126 126 126 diff --git a/tools/create_luacheck.py b/tools/create_luacheck.py index d3ee5d038..b10ff1717 100755 --- a/tools/create_luacheck.py +++ b/tools/create_luacheck.py @@ -2,7 +2,7 @@ import os import re from pathlib import Path -# Just run this script from mineclone2 directory to get a list of every global vars to use in luacheck configuration files +# Just run this script from voxelibre directory to get a list of every global vars to use in luacheck configuration files path = "./mods/" diff --git a/tools/dicts/polish.dic b/tools/dicts/polish.dic index 952ae57eb..81603e446 100644 --- a/tools/dicts/polish.dic +++ b/tools/dicts/polish.dic @@ -2,9 +2,9 @@ 1f Badlandach biomeinfo -creeper -Creeper -creepera +stalker +Stalker +stalkera czerwienit czerwienitem czerwienitowych diff --git a/tools/generate_ingame_credits.lua b/tools/generate_ingame_credits.lua index a484322c0..cfcc637f7 100755 --- a/tools/generate_ingame_credits.lua +++ b/tools/generate_ingame_credits.lua @@ -4,7 +4,7 @@ local colors = { ["Creator of MineClone"] = "0x0A9400", - ["Creator of MineClone2"] = "0xFBF837", + ["Creator of VoxeLibre"] = "0xFBF837", ["Maintainers"] = "0xFF51D5", ["Developers"] = "0xF84355", ["Past Developers"] = "0xF84355",