Compare commits
11 Commits
master
...
zombie_tex
Author | SHA1 | Date |
---|---|---|
SmokeyDope | 46fb387f37 | |
SmokeyDope | 12babc813c | |
SmokeyDope | 326f364a3b | |
SmokeyDope | e1faedf574 | |
SmokeyDope | 2c708225f5 | |
SmokeyDope | e23e6605fc | |
SmokeyDope | 967d4849ca | |
SmokeyDope | 89ed52df12 | |
SmokeyDope | 555c8a8e04 | |
SmokeyDope | ee85453c3e | |
SmokeyDope | faaab71c2f |
|
@ -13,19 +13,18 @@ labels:
|
|||
Thanks for taking the time to fill out this bug report!
|
||||
|
||||
Please follow our contributing guidelines first:
|
||||
https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
|
||||
|
||||
By submitting this issue, you agree to follow our Code of Conduct:
|
||||
https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CODE_OF_CONDUCT.md
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md
|
||||
-->
|
||||
|
||||
<!--
|
||||
What version of VoxeLibre are you using? We do not provide support for outdated versions of VoxeLibre.
|
||||
"/ver" command will output the version you're running.
|
||||
What version of MineClone2 are you using? We do not provide support for outdated versions of MineClone2.
|
||||
Current latest version is listed here, at the top:
|
||||
https://git.minetest.land/VoxeLibre/VoxeLibre/tags
|
||||
https://git.minetest.land/MineClone2/MineClone2/tags
|
||||
-->
|
||||
VoxeLibre version:
|
||||
MineClone2 version:
|
||||
|
||||
### What happened?
|
||||
Report about the bug! Please send large log snippets as an attachement file.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
|
||||
name: "Feature request"
|
||||
about: "File a feature request"
|
||||
about: "File a feature request not in Minecraft"
|
||||
labels:
|
||||
|
||||
- "non-Minecraft feature"
|
||||
|
@ -10,17 +10,17 @@ labels:
|
|||
---
|
||||
|
||||
<!--
|
||||
Got a new feature request? Explain to us why we should consider your idea.
|
||||
Got a new non-Minecraft feature request? Explain to us why we should consider your idea.
|
||||
|
||||
Please follow our contributing guidelines first:
|
||||
https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
|
||||
|
||||
By submitting this issue, you agree to follow our Code of Conduct:
|
||||
https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CODE_OF_CONDUCT.md
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md
|
||||
-->
|
||||
|
||||
### Feature
|
||||
Tell us about your requested feature!
|
||||
Tell us about your requested feature not in Minecraft!
|
||||
|
||||
### Why
|
||||
Tell us why should we implement it!
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
|
||||
name: "Missing Feature request"
|
||||
about: "File a missing feature request in Minecraft but not in MineClone2"
|
||||
labels:
|
||||
|
||||
- "missing feature"
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Thanks for taking the time to fill out this missing feature request!
|
||||
|
||||
Please follow our contributing guidelines first:
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
|
||||
|
||||
By submitting this issue, you agree to follow our Code of Conduct:
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md
|
||||
-->
|
||||
|
||||
### 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?
|
|
@ -8,13 +8,13 @@ labels:
|
|||
|
||||
<!--
|
||||
Please follow our contributing guidelines first:
|
||||
https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CONTRIBUTING.md#how-you-can-help-as-a-programmer
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#how-you-can-help-as-a-programmer
|
||||
|
||||
By submitting this pull request, you agree to follow our Code of Conduct:
|
||||
https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CODE_OF_CONDUCT.md
|
||||
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md
|
||||
-->
|
||||
|
||||
Tell us about your pull request! Reference related issues, if necessary.
|
||||
Tell us about your pull request! Reference related issues, if necessary
|
||||
|
||||
### Testing
|
||||
Tell us how to test your changes!
|
||||
|
|
14
API.md
|
@ -1,10 +1,10 @@
|
|||
# API
|
||||
## Groups
|
||||
VoxeLibre makes very extensive use of groups. Making sure your items and objects have the correct group memberships is very important.
|
||||
MineClone 2 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 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.
|
||||
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.
|
||||
|
||||
## 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. 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/`
|
||||
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/`
|
||||
|
||||
### Items
|
||||
* Doors: `ITEMS/mcl_doors`
|
||||
|
@ -46,7 +46,8 @@ A lot of things are possible by using one of the APIs in the mods. Many of them
|
|||
### Mobs
|
||||
* Mobs: `ENTITIES/mcl_mobs`
|
||||
|
||||
VoxeLibre uses its own mobs framework, which is a fork of Mobs Redo [`mobs`] by TenPlus1.
|
||||
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.
|
||||
|
||||
You can add your own mobs, spawn eggs and spawning rules with this mod.
|
||||
API documnetation is included in `ENTITIES/mcl_mobs/api.txt`.
|
||||
|
@ -54,7 +55,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 VoxeLibre.
|
||||
If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in MineClone 2,
|
||||
chances are good that it works out of the box.
|
||||
|
||||
### Help
|
||||
|
@ -67,7 +68,6 @@ 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 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!
|
||||
The following APIs may be subject to change in future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk!
|
||||
|
||||
* Panes (like glass panes and iron bars): `ITEMS/xpanes`
|
||||
* `_on_ignite` callback: `ITEMS/mcl_fire`
|
||||
|
|
159
CONTRIBUTING.md
|
@ -1,47 +1,48 @@
|
|||
# Contributing to VoxeLibre
|
||||
So you want to contribute to VoxeLibre?
|
||||
# Contributing to MineClone2
|
||||
So you want to contribute to MineClone2?
|
||||
Wow, thank you! :-)
|
||||
|
||||
VoxeLibre is maintained by AncientMariner and Herowl. If you have any
|
||||
MineClone2 is maintained by AncientMariner and Nicu. If you have any
|
||||
problems or questions, contact us on Discord/Matrix (See Links section below).
|
||||
|
||||
You can help with VoxeLibre's development in many different ways,
|
||||
You can help with MineClone2's development in many different ways,
|
||||
whether you're a programmer or not.
|
||||
|
||||
## VoxeLibre's development target is to...
|
||||
- Create a stable, peformant, moddable, free/libre game inspired by Minecraft
|
||||
## MineClone2's development target is to...
|
||||
- Create a stable, peformant, moddable, free/libre game based on 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/VoxeLibre/VoxeLibre)
|
||||
* [Mesehub](https://git.minetest.land/MineClone2/MineClone2)
|
||||
* [Discord](https://discord.gg/xE4z8EEpDC)
|
||||
* [YouTube](https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A)
|
||||
* [Matrix](https://app.element.io/#/room/#voxelibre:matrix.org)
|
||||
* [Reddit](https://www.reddit.com/r/VoxeLibre/)
|
||||
* [IRC](https://web.libera.chat/#mineclone2)
|
||||
* [Matrix](https://app.element.io/#/room/#mc2:matrix.org)
|
||||
* [Reddit](https://www.reddit.com/r/MineClone2/)
|
||||
* [Minetest forums](https://forum.minetest.net/viewtopic.php?f=50&t=16407)
|
||||
* [ContentDB](https://content.minetest.net/packages/wuzzy/mineclone2/)
|
||||
* [OpenCollective](https://opencollective.com/mineclone2)
|
||||
|
||||
## Using git
|
||||
VoxeLibre is developed using the version control system
|
||||
MineClone2 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
|
||||
VoxeLibre, git is not required. However, git is a tool that will be
|
||||
MineClone2, 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/VoxeLibre/VoxeLibre/wiki/
|
||||
https://git.minetest.land/MineClone2/MineClone2/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/VoxeLibre/VoxeLibre/issues),
|
||||
[Issue tracker](https://git.minetest.land/MineClone2/MineClone2/issues),
|
||||
you can report a bug or request a feature.
|
||||
|
||||
### Rules about both bugs and feature requests
|
||||
|
@ -59,7 +60,8 @@ 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 or Matrix space.
|
||||
an issue, feel free to ask on the Discord / Matrix server or the IRC
|
||||
channel.
|
||||
|
||||
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)
|
||||
|
@ -73,7 +75,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 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 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 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.
|
||||
|
@ -82,14 +84,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 VoxeLibre development. It's better
|
||||
slightest, and may very well disrupt MineClone2 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 VoxeLibre
|
||||
* Ensure the requested feature has not been implemented in MineClone2
|
||||
latest or development versions.
|
||||
|
||||
### Testing code
|
||||
If you want to help us with speeding up VoxeLibre development and
|
||||
If you want to help us with speeding up MineClone2 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
|
||||
|
@ -101,21 +103,20 @@ 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:
|
||||
<https://git.minetest.land/VoxeLibre/VoxeLibre/pulls>. Note that pull
|
||||
<https://git.minetest.land/MineClone2/MineClone2/pulls>. 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. The wiki has an article with instructions
|
||||
on how to test Pull Requests:
|
||||
<https://git.minetest.land/VoxeLibre/VoxeLibre/wiki/Testing-Pull-Requests>.
|
||||
can have a look at the PR.
|
||||
|
||||
### Contributing assets
|
||||
Due to license problems, VoxeLibre cannot use Minecraft's assets,
|
||||
Due to license problems, MineClone2 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 and/or Matrix space.
|
||||
It's also a good idea to join the Discord server
|
||||
(or alternatively IRC or Matrix).
|
||||
|
||||
#### Textures
|
||||
For textures we prefer original art, but in the absence of that will accept
|
||||
|
@ -127,9 +128,9 @@ If you want to make such contributions, join our Discord server. Demands
|
|||
for textures will be communicated there.
|
||||
|
||||
#### Sounds
|
||||
VoxeLibre currently does not have a consistent way to handle sounds.
|
||||
MineClone2 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, VoxeLibre does not play
|
||||
resource pack or minetest_game. Unfortunately, MineClone2 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
|
||||
|
@ -139,7 +140,7 @@ changes made by the contributor. Use the README files in the mod to
|
|||
communicate this information.
|
||||
|
||||
#### 3D Models
|
||||
Many of the 3D Models in VoxeLibre come from
|
||||
Most of the 3D Models in MineClone2 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
|
||||
|
@ -153,13 +154,13 @@ also be credited in the Contributors section.
|
|||
### Contributing Translations
|
||||
|
||||
#### Workflow
|
||||
To add/update support for your language to VoxeLibre, you should take
|
||||
To add/update support for your language to MineClone2, 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 or Matrix - they will credit you appropriately.
|
||||
via E-Mail, Discord, IRC or Matrix - they will credit you appropriately.
|
||||
|
||||
#### Things to note
|
||||
You can use the script at `tools/check_translate_files.py` to compare
|
||||
|
@ -177,7 +178,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 VoxeLibre's code
|
||||
If you own a server, a great way to help us improve MineClone2'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.
|
||||
|
@ -202,23 +203,18 @@ 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) 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).
|
||||
You can help pay for our infrastructure (Mesehub) 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 VoxeLibre development is done using pull requests.
|
||||
(Almost) all the MineClone2 development is done using pull requests.
|
||||
|
||||
### Recommended workflow
|
||||
* Fork the repository (in case you have not already)
|
||||
|
@ -241,11 +237,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 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
|
||||
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
|
||||
better, or assist you use development tools.
|
||||
|
||||
### Maintain your own code, even if already got merged
|
||||
|
@ -254,52 +250,40 @@ 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 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).
|
||||
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)
|
||||
|
||||
### Guidelines
|
||||
|
||||
#### Git Guidelines
|
||||
* 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
|
||||
* 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
|
||||
* 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 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
|
||||
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)
|
||||
* 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 (or substantially changed mods
|
||||
that are included from the outside) start with `vl_`, e.g.
|
||||
`vl_hollow_logs`, . Keep in mind Minetest
|
||||
* 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
|
||||
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.
|
||||
|
||||
|
@ -373,21 +357,17 @@ end
|
|||
|
||||
### Developer status
|
||||
Active and trusted contributors are often granted write access to the
|
||||
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.
|
||||
MineClone2 repository as a contributor. Those that have demonstrated the right
|
||||
technical skills and behaviours may be granted developer access. These are the
|
||||
most trusted contributors who will contribute to ensure coding standards and
|
||||
processes are followed.
|
||||
|
||||
#### Developer responsibilities
|
||||
- If you have developer/contributor privileges you can just open a new branch
|
||||
in the VL repository (which is preferred). From that you create a pull request.
|
||||
in the mcl2 repository (which is preferred). From that you create a pull request.
|
||||
This way other people can review your changes and make sure they work
|
||||
before they get merged.
|
||||
- If you do not (yet) have contributor or developer privs you do your work on a branch
|
||||
- If you do not (yet) have developer privs you do your work on a branch
|
||||
on your private repository e.g. using the "fork" function on mesehub.
|
||||
- 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
|
||||
|
@ -410,14 +390,14 @@ merged.
|
|||
- Resolving conflicts and problems within the community
|
||||
|
||||
#### Current maintainers
|
||||
* AncientMariner - responsible for gameplay review, publishing releases
|
||||
* Herowl - responsible for gameplay review, publishing releases,
|
||||
* AncientMariner - 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 VoxeLibre to make sure it still runs
|
||||
* Launch MineClone2 to make sure it still runs
|
||||
* Update the version number in README.md
|
||||
* Use `git tag <version number>` to tag the latest commit with the
|
||||
version number
|
||||
|
@ -435,5 +415,6 @@ become part of a free/libre software.
|
|||
|
||||
### Crediting
|
||||
Contributors, Developers and Maintainers will be credited in
|
||||
`CREDITS.md`. There are also Discord roles for Contributors,
|
||||
`CREDITS.md`. If you make your first time contribution, please add
|
||||
yourself to this file. There are also Discord roles for Contributors,
|
||||
Developers and Maintainers.
|
||||
|
|
24
CREDITS.md
|
@ -3,7 +3,7 @@
|
|||
## Creator of MineClone
|
||||
* davedevils
|
||||
|
||||
## Creator of VoxeLibre
|
||||
## Creator of MineClone2
|
||||
* Wuzzy
|
||||
|
||||
## Maintainers
|
||||
|
@ -20,10 +20,10 @@
|
|||
* epCode
|
||||
* chmodsayshello
|
||||
* MrRar
|
||||
* FossFanatic
|
||||
* SmokeyDope
|
||||
* Faerraven / Michieal
|
||||
* rudzik8
|
||||
* teknomunk
|
||||
* Codiac
|
||||
|
||||
## Past Developers
|
||||
* jordan4ibanez
|
||||
|
@ -34,11 +34,10 @@
|
|||
* NO11
|
||||
* SumianVoice
|
||||
* PrairieWind
|
||||
* FossFanatic
|
||||
* Codiac
|
||||
|
||||
## Contributors
|
||||
* RandomLegoBrick
|
||||
* rudzik8
|
||||
* Code-Sploit
|
||||
* aligator
|
||||
* Rootyjr
|
||||
|
@ -130,23 +129,12 @@
|
|||
* Bakawun
|
||||
* JoseDouglas26
|
||||
* Zasco
|
||||
* PrWalterB
|
||||
* michaljmalinowski
|
||||
* nixnoxus
|
||||
* Potiron
|
||||
* Tuxilio
|
||||
* Impulse
|
||||
* Doods
|
||||
* SOS-Games
|
||||
* Bram
|
||||
* qoheniac
|
||||
* WillConker
|
||||
|
||||
## 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 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)
|
||||
* Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)
|
||||
* Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)
|
||||
* Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0)
|
||||
|
||||
## Original Mod Authors
|
||||
|
|
|
@ -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 <http://minecraft.gamepedia.com/Breaking> to learn how digging times work in Minecraft, as VoxeLibre is based on the same system.
|
||||
Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times work in Minecraft, as MineClone 2 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 likely 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 lilely only be added when they are needed for a concrete use case.
|
||||
|
||||
### Declarative groups
|
||||
These groups are used mostly for informational purposes
|
||||
|
|
|
@ -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,18 +6,16 @@ How to play:
|
|||
- Navigate to https://www.minetest.net/ to download the client.
|
||||
- Once installed, open and select the "Content" tab
|
||||
|
||||
#### Install VoxeLibre from ContentDB
|
||||
#### Install MineClone2 from ContentDB
|
||||
- Click "Browse Online Content" and filter by Games (select "Games" from the dropdown box)
|
||||
- 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
|
||||
- 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
|
||||
- Click "Back to Main Menu"
|
||||
|
||||
#### Create new world and play
|
||||
- Click "Start Game" tab
|
||||
- At the bottom click the VoxeLibre icon (the stone & sandstone ball with the letters VL)
|
||||
- At the bottom click the MineClone2 icon (the 2 dirt with grass blocks)
|
||||
- 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!
|
||||
- Click "Play Game" and enjoy!
|
17
LEGAL.md
|
@ -1,14 +1,14 @@
|
|||
# Legal information
|
||||
This is a game inspired by Minecraft with unique content.
|
||||
This is a fan game, not developed or endorsed by Mojang AB.
|
||||
|
||||
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
|
||||
VoxeLibre (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others)
|
||||
is inspired by Minecraft.
|
||||
MineClone 2 (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others)
|
||||
is an imitation of Minecraft.
|
||||
|
||||
VoxeLibre is free software: you can redistribute it and/or modify
|
||||
MineClone 2 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 VoxeLibre (GNU GPLv3) or the mod's license.
|
||||
license of MineClone 2 (GNU GPLv3) or the mod's license.
|
||||
|
||||
VoxeLibre is a direct continuation of the discontinued MineClone
|
||||
MineClone 2 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 VoxeLibre and the author is Wuzzy.
|
||||
of MineClone 2 and the author is Wuzzy.
|
||||
|
||||
## License of media (textures and sounds)
|
||||
No non-free licenses are used anywhere.
|
||||
|
@ -46,9 +46,6 @@ Armor trim models were created by Aeonix_Aeon
|
|||
Source: <https://www.curseforge.com/minecraft/texture-packs/ozocraft-remix>
|
||||
License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
|
||||
|
||||
Charcoal block texture was created by [blitzdoughnuts](https://gitlab.com/ApplemunchFromDaDead), based on the Pixel Perfection coal block.
|
||||
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
|
||||
|
||||
The main menu images are released under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
|
||||
All other files, unless mentioned otherwise, fall under:
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# Models in Minetest/VoxeLibre
|
||||
# Models in Minetest/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.
|
||||
Models are an important part of all entities & unique nodes in Mineclone2. They provide a 3 dimensional map of an object for which textures are then applied to. This document is for modders, it quickly highlights some important information for the software needed to open models in Mineclone2.
|
||||
|
||||
## Minetest Wiki
|
||||
|
||||
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)
|
||||
For more detailed information on actually using blender to create and modify models for Minetest/Mineclone2, please visit the Minetest wiki's page on using Blender [Here](https://wiki.minetest.net/Using_Blender)
|
||||
|
||||
## Recommended software
|
||||
|
||||
|
|
51
README.md
|
@ -1,6 +1,6 @@
|
|||
# VoxeLibre
|
||||
A game inspired by Minecraft for Minetest. Forked from MineClone by davedevils.
|
||||
Developed by many people, see CREDITS.md for a complete list.
|
||||
# MineClone2
|
||||
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
|
||||
Developed by many people. Not developed or endorsed by Mojang AB.
|
||||
|
||||
### Gameplay
|
||||
You start in a randomly-generated world made entirely of cubes. You can explore
|
||||
|
@ -64,44 +64,47 @@ Use the `/giveme` chat command to obtain them. See the in-game help for
|
|||
an explanation.
|
||||
|
||||
## Installation
|
||||
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.
|
||||
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.
|
||||
|
||||
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
|
||||
To install MineClone2 (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 VoxeLibre repository is hosted at Mesehub. To contribute or report issues, head there.
|
||||
The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there.
|
||||
|
||||
* Mesehub: <https://git.minetest.land/VoxeLibre/VoxeLibre>
|
||||
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
|
||||
* Discord: <https://discord.gg/xE4z8EEpDC>
|
||||
* YouTube: <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
|
||||
* ContentDB: <https://content.minetest.net/packages/wuzzy/mineclone2/>
|
||||
* OpenCollective: <https://opencollective.com/voxelibre>
|
||||
* Mastodon: <https://fosstodon.org/@VoxeLibre>
|
||||
* Lemmy: <https://lemm.ee/c/voxelibre>
|
||||
* Matrix space: <https://app.element.io/#/room/#voxelibre:matrix.org>
|
||||
* OpenCollective: <https://opencollective.com/mineclone2>
|
||||
* Mastodon: <https://fosstodon.org/@MineClone2>
|
||||
* Lemmy: <https://lemmy.world/c/mineclone2>
|
||||
* Matrix space: <https://app.element.io/#/room/#mcl2:matrix.org>
|
||||
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
* Reddit: <https://www.reddit.com/r/VoxeLibre/>
|
||||
* Reddit: <https://www.reddit.com/r/MineClone2/>
|
||||
* IRC (barely used): <https://web.libera.chat/#mineclone2>
|
||||
|
||||
## Target
|
||||
- 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.
|
||||
- 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.
|
||||
|
||||
## 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 VoxeLibre in production, the master branch is usually relatively stable.
|
||||
If you want to use the development version of MineClone2 in production, the master branch is usually relatively stable.
|
||||
|
||||
The following main features are available:
|
||||
|
||||
|
@ -184,7 +187,7 @@ Technical differences from Minecraft:
|
|||
* Different engine (Minetest)
|
||||
* Different easter eggs
|
||||
|
||||
… and finally, VoxeLibre is free software (“free” as in “freedom”)!
|
||||
… and finally, MineClone2 is free software (“free” as in “freedom”)!
|
||||
|
||||
## Other readme files
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
# 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.
|
||||
# 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.
|
||||
|
||||
### 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
|
||||
|
@ -22,7 +21,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
|
||||
* Placez les 4 planches de bois dans la grille 2x2 et **fabriquez un établi**
|
||||
* Placer 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 !
|
||||
|
@ -31,10 +30,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 un bloc similaire avec la houe pour créer des terres agricoles
|
||||
* Placez des graines sur des terres agricoles et regardez les pousser
|
||||
* 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
|
||||
* Récoltez les plantes une fois matûres
|
||||
* Les terres agricoles proches de l'eau deviennent humides et accélèrent la croissance
|
||||
* Les terres agricoles proche de l'eau deviennent humides et accélèrent la croissance
|
||||
|
||||
### Four
|
||||
* Fabriquez un four
|
||||
|
@ -47,7 +46,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`
|
||||
|
||||
|
@ -55,35 +54,33 @@ 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 VoxeLibre dans les versions développement de Minetest.
|
||||
Il n'y a pas de support de MineClone2 dans les versions développement de Minetest.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Liens utiles
|
||||
Le dépôt de VoxeLibre est hébergé sur Mesehub. Pour contribuer ou signaler des problèmes, allez là-bas.
|
||||
## Liens utiles
|
||||
Le dépôt de MineClone2 est hébergé sur Mesehub. Pour contribuer ou signaler des problèmes, allez là-bas.
|
||||
|
||||
* Mesehub : <https://git.minetest.land/VoxeLibre/VoxeLibre>
|
||||
* Mesehub : <https://git.minetest.land/MineClone2/MineClone2>
|
||||
* Discord : <https://discord.gg/xE4z8EEpDC>
|
||||
* YouTube : <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
|
||||
* IRC : <https://web.libera.chat/#mineclone2>
|
||||
* Matrix : <https://app.element.io/#/room/#mc2:matrix.org>
|
||||
* Reddit : <https://www.reddit.com/r/MineClone2/>
|
||||
* Forums Minetest : <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
* ContentDB : <https://content.minetest.net/packages/wuzzy/mineclone2/>
|
||||
* OpenCollective : <https://opencollective.com/mineclone2>
|
||||
* Mastodon : <https://fosstodon.org/@VoxeLibre>
|
||||
* Lemmy : <https://lemm.ee/c/voxelibre>
|
||||
* Espace Matrix : <https://app.element.io/#/room/#voxelibre:matrix.org>
|
||||
* Forums Minetest : <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
* Reddit : <https://www.reddit.com/r/VoxeLibre/>
|
||||
* IRC (peu utilisé) : <https://web.libera.chat/#mineclone2>
|
||||
|
||||
## Objectif
|
||||
* 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.
|
||||
* 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.
|
||||
|
||||
## 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 VoxeLibre en production, la branche master est habituellement relativement stable.
|
||||
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.
|
||||
|
||||
Les principales fonctionnalités suivantes sont disponibles :
|
||||
|
||||
|
@ -111,12 +108,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
|
||||
|
@ -125,7 +122,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 :
|
||||
|
@ -165,7 +162,7 @@ Différences techniques avec Minecraft :
|
|||
* Un moteur de jeu différent (Minetest)
|
||||
* Des bonus cachés différents
|
||||
|
||||
...et enfin VoxeLibre est un logiciel libre !
|
||||
...et enfin MineClone2 est un logiciel libre !
|
||||
|
||||
## Autres fichiers readme
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# VoxeLibre
|
||||
# MineClone2
|
||||
Неофициальная игра в стиле Minecraft для Minetest. Форк MineClone от davedevils.
|
||||
Разработана многими людьми. Не разработана и не одобрена Mojang AB.
|
||||
|
||||
|
@ -67,13 +67,13 @@
|
|||
## Установка
|
||||
Эта игра требует [Minetest](http://minetest.net) для запуска (версия 5.4.1 или
|
||||
выше). Вам нужно сперва установить Minetest. Только стабильные версии поддерживаются
|
||||
официально. Не поддерживается запуск VoxeLibre на разрабатываемых версиях Minetest.
|
||||
официально. Не поддерживается запуск MineClone2 на разрабатываемых версиях Minetest.
|
||||
|
||||
Чтобы установить VoxeLibre (если вы этого еще не сделали), переместите эту папку в
|
||||
Чтобы установить MineClone2 (если вы этого еще не сделали), переместите эту папку в
|
||||
“games” в папке данных Minetest. Смотрите справку Minetest, чтобы узнать больше.
|
||||
|
||||
## Полезные ссылки
|
||||
Репозиторий VoxeLibre хранится на Mesehub. Зайдите туда, чтобы оставить запрос или
|
||||
Репозиторий MineClone2 хранится на Mesehub. Зайдите туда, чтобы оставить запрос или
|
||||
поучаствовать в разработке.
|
||||
|
||||
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
|
||||
|
@ -102,7 +102,7 @@ Edition** уже реализовано и доработка имеющегос
|
|||
Игра сейчас на стадии **бета**. Она играбельна, но еще не имеет всех возможностей.
|
||||
Обратная совместимость целиком не гарантируется, обновление вашего мира может повлечь
|
||||
за собой небольшие ошибки. Если вы хотите использовать разрабатываемую версию
|
||||
VoxeLibre, то ветка master обычно относительно стабильна.
|
||||
Mineclone2, то ветка master обычно относительно стабильна.
|
||||
|
||||
Следущие возможности уже доступны:
|
||||
|
||||
|
@ -182,7 +182,7 @@ VoxeLibre, то ветка master обычно относительно стаб
|
|||
* Другой движок (Minetest)
|
||||
* Другие пасхалки
|
||||
|
||||
… и наконец, VoxeLibre это свободное программное обеспечение!
|
||||
… и наконец, MineClone2 это свободное программное обеспечение!
|
||||
|
||||
## Другие readme файлы
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
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
|
||||
# MineClone 2
|
||||
一個非官方的Minetest遊戲,遊玩方式和Minecraft類似。由davedevils從MineClone分拆。
|
||||
由許多人開發。並非由Mojang Studios開發。<!-- "Mojang AB"'s Name changed at 2020/05, main README should change too -->
|
||||
|
||||
|
@ -85,11 +83,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**
|
||||
* VoxeLibre還包括Minetest支持的Optifine功能。
|
||||
* MineClone2還包括Minetest支持的Optifine功能。
|
||||
* 後期Minecraft版本的功能可能會偷偷加入,但它們的優先級較低。
|
||||
* 總的來說,Minecraft的目標是在Minetest目前允許的情況下進行克隆。
|
||||
* 克隆Minecraft是最優先的。
|
||||
* VoxeLibre將使用不同的圖形和聲音,但風格相似。
|
||||
* MineClone2將使用不同的圖形和聲音,但風格相似。
|
||||
* 克隆界面沒有優先權。只會被粗略地模仿。
|
||||
* 在Minetest中發現的局限性將在開發過程中被記錄和報告。
|
||||
|
||||
|
@ -175,7 +173,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release
|
|||
* 不同的聲音(各種來源)
|
||||
* 不同的引擎(Minetest)
|
||||
|
||||
...最後,VoxeLibre是自由軟件!
|
||||
...最後,MineClone2是自由軟件!
|
||||
|
||||
## 錯誤報告
|
||||
請在此處報告所有錯誤和缺少的功能:
|
||||
|
@ -192,7 +190,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`: VoxeLibre需要改进,Minetest中缺失的功能列表。
|
||||
* `MISSING_ENGINE_FEATURES.md`: MineClone2需要改进,Minetest中缺失的功能列表。
|
||||
* `API.md`: 關於MineClone2的API
|
||||
|
||||
## 參與者
|
||||
|
@ -237,7 +235,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 <tanakinci2002@gmail.com>:VoxeLibre標志
|
||||
* yutyo <tanakinci2002@gmail.com>:MineClone2標志
|
||||
* 其他:GUI圖片
|
||||
|
||||
### 翻譯
|
||||
|
@ -256,7 +254,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release
|
|||
|
||||
### 特殊感謝
|
||||
|
||||
* Wuzzy,感謝他啟動和維護VoxeLibre多年。
|
||||
* Wuzzy,感謝他啟動和維護MineClone2多年。
|
||||
* celeron55,創建Minetest。
|
||||
* Minetest的社區提供了大量的mods選擇,其中一些最終被納入MineClone 2。
|
||||
* Jordach,為《Big Freaking Dig》的唱片機音樂合輯而來
|
||||
|
|
184
RELEASE.md
|
@ -1,167 +1,89 @@
|
|||
## Standard Release
|
||||
### Standard Release
|
||||
|
||||
### Before releasing
|
||||
# File to document release steps with a view to evolving into a script
|
||||
|
||||
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.
|
||||
# Update CREDITS.md
|
||||
# Update version in game.conf
|
||||
|
||||
### 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 commit -m "Updated release credits and set version for v0.87"
|
||||
|
||||
#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
|
||||
```
|
||||
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"
|
||||
```
|
||||
7. **Tag and push to the tag:**
|
||||
```
|
||||
git tag 0.87.0
|
||||
git push origin 0.87.0
|
||||
```
|
||||
8. Update version in game.conf to the next version with -SNAPSHOT suffix:
|
||||
```
|
||||
git commit -m "Post-release set version 0.88.0-SNAPSHOT"
|
||||
```
|
||||
9. Push the above to a new branch, and make the release PR. Merge to finalize release process.
|
||||
|
||||
### Release via ContentDB
|
||||
# Update version in game.conf to the next version with -SNAPSHOT suffix
|
||||
|
||||
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.
|
||||
`git commit -m "Post-release set version 0.84.0-SNAPSHOT"`
|
||||
|
||||
### After releasing
|
||||
### Hotfix Release
|
||||
|
||||
...inform people.
|
||||
##### Prepare release branch
|
||||
|
||||
* 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*)
|
||||
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:
|
||||
|
||||
* Create release branch from the last release tag, push it:
|
||||
|
||||
## Hotfix Release
|
||||
|
||||
### Before releasing
|
||||
|
||||
First, determine if the current state of the master branch is fine for the Hotfix.
|
||||
In general, Hotfixes shouldn't contain new features to minimize the risk of regressions.
|
||||
|
||||
* If it hasn't been long since the release, and the only PRs merged so far are bugfixes and/or documentation changes,
|
||||
it is certainly fine to use it as a base for the release.
|
||||
* If there are some features merged, but they are aimed at fixing/alleviating important issues with the last released version, it may still be fine.
|
||||
* If there are some simple QoL features merged that are irrelevant to the last release, it may still be fine to use it as a base for the Hotfix.
|
||||
* If there are major features or large overhauls merged, it *most probably* is **not** fine to use as a base for the Hotfix.
|
||||
|
||||
If you decided that the current state of the master branch can be used as the Hotfix version, make sure that all the PRs merged since the last release
|
||||
are in the Hotfix milestone and you are working on a clean branch based on the master branch, up-to-date with the one on the repo.
|
||||
In this case, **skip** the following section.
|
||||
|
||||
### Prepare release branch
|
||||
|
||||
If you decided that the current state of the master branch shouldn't be used as the Hotfix version, you must prepare a release branch.
|
||||
|
||||
1. Create release branch from the last release tag, push it:
|
||||
```
|
||||
git checkout -b release/0.82.1 0.82.0
|
||||
|
||||
git push origin release/0.82.1
|
||||
```
|
||||
2. Cherry-pick the relevant commits from the master branch, or merge them from other (PR) branches.
|
||||
3. Make sure your local copy of the branch contains all the relevant changes, **do not rebase**.
|
||||
|
||||
### Release process
|
||||
##### Prepare feature branch and fix
|
||||
|
||||
1. Update CREDITS.md if it is needed
|
||||
2. Update version in game.conf
|
||||
3. If you've changed CREDITS.md, run the script:
|
||||
```
|
||||
lua tools/generate_ingame_credits.lua
|
||||
```
|
||||
4. Make a commit for the above:
|
||||
```
|
||||
git add game.conf
|
||||
git commit -m "Set version for hotfix v0.87.1"
|
||||
```
|
||||
or, if credits got updated:
|
||||
```
|
||||
git add CREDITS.md
|
||||
git add mods/HUD/mcl_credits/people.lua
|
||||
git add game.conf
|
||||
git commit -m "Updated release credits and set version for hotfix v0.87.1"
|
||||
```
|
||||
5. Add a section in the last releasnotes, like this:
|
||||
```
|
||||
## 0.87.1 hotfix
|
||||
```
|
||||
and describe the changes there
|
||||
* Create feature branch from that release branch (can review it to check only fix is there, nothing else, and use to also merge into master separately)
|
||||
|
||||
`git checkout -b hotfix_bug_1_branch`
|
||||
|
||||
* 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
|
||||
|
||||
* 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):
|
||||
|
||||
* Update version in game.conf to hotfix version and commit it. Example: version=0.82.1
|
||||
|
||||
* Tag it, push tag and branch:
|
||||
|
||||
6. Make a commit for the releasenotes changes:
|
||||
```
|
||||
git add releasenotes/0_87-the_prismatic_release.md
|
||||
git commit -m "Update release notes for hotfix v0.87.1"
|
||||
```
|
||||
7. **Tag and push to the tag:**
|
||||
```
|
||||
git tag 0.87.1
|
||||
git push origin 0.87.1
|
||||
```
|
||||
8. If you are skipping some changes from the master branch (and thus are using a prepared master branch from the previous section),
|
||||
push to the remote and skip the next two steps:
|
||||
```
|
||||
git tag 0.82.1
|
||||
|
||||
git push origin 0.82.1
|
||||
|
||||
git push origin release/0.82.1
|
||||
```
|
||||
9. If you're releasing master branch, update version in game.conf to the next version with -SNAPSHOT suffix:
|
||||
```
|
||||
git commit -m "Post-hotfix reset version 0.88.0-SNAPSHOT"
|
||||
```
|
||||
10. If you're releasing master branch, push the above to a new branch, and make the release PR. Merge to finalize release process.
|
||||
|
||||
Note: If you have to do more than 1 hotfix release, can do it on the same release branch.
|
||||
|
||||
### Release via ContentDB
|
||||
|
||||
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.1"
|
||||
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. Hotfix is now live.
|
||||
* 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.
|
||||
|
||||
### After releasing
|
||||
##### Inform people
|
||||
|
||||
...inform people.
|
||||
|
||||
* 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 and release notes, and describe briefly what the hotfix does.
|
||||
* Add a Matrix announcement post and @room with content like above.
|
||||
* 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/linux_gaming
|
||||
* r/opensourcegames
|
||||
* r/opensource
|
||||
* r/freesoftware
|
||||
* r/linuxmasterrace
|
||||
* r/VoxeLibre
|
||||
* r/MineClone2 (*for now*)
|
||||
* r/MineClone2
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Making Textures In VoxeLibre
|
||||
# Making Textures In Mineclone2
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Minetest Wiki
|
||||
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.
|
||||
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.
|
||||
|
||||
## 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
title = TheDarkProject
|
||||
title = MineClone 2
|
||||
description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more.
|
||||
disallowed_mapgens = v6
|
||||
version=0.88.0-SNAPSHOT
|
||||
version=0.87.0-SNAPSHOT
|
||||
|
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 82 KiB |
BIN
menu/header.png
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 82 KiB |
BIN
menu/icon.png
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 51 KiB |
BIN
menu/theme.ogg
|
@ -16,7 +16,7 @@ information.
|
|||
How the mod is used
|
||||
===================
|
||||
|
||||
In VoxeLibre, all diggable nodes have the hardness set in the custom field
|
||||
In MineClone 2, 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:
|
||||
|
@ -117,6 +117,10 @@ end
|
|||
-- Array of unique hardness values for each group which affects dig time.
|
||||
local hardness_values = get_hardness_values_for_groups()
|
||||
|
||||
-- Map indexed by hardness values which return the index of that value in
|
||||
-- hardness_value. Used for quick lookup.
|
||||
local hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
|
||||
|
||||
--[[local function compute_creativetimes(group)
|
||||
local creativetimes = {}
|
||||
|
||||
|
@ -182,7 +186,6 @@ local function add_groupcaps(toolname, groupcaps, groupcaps_def, efficiency)
|
|||
local mult = capsdef.speed or 1
|
||||
local uses = capsdef.uses
|
||||
local def = mcl_autogroup.registered_diggroups[g]
|
||||
assert(def, toolname .. " has unknown diggroup '" .. dump(g) .. "'")
|
||||
local max_level = def.levels and #def.levels or 1
|
||||
|
||||
assert(capsdef.level, toolname .. ' is missing level for ' .. g)
|
||||
|
@ -310,13 +313,6 @@ function mcl_autogroup.get_wear(toolname, diggroup)
|
|||
end
|
||||
|
||||
local function overwrite()
|
||||
-- Refresh, now that all groups are known.
|
||||
hardness_values = get_hardness_values_for_groups()
|
||||
|
||||
-- Map indexed by hardness values which return the index of that value in
|
||||
-- hardness_value. Used for quick lookup.
|
||||
local hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
|
||||
|
||||
for nname, ndef in pairs(minetest.registered_nodes) do
|
||||
local newgroups = table.copy(ndef.groups)
|
||||
if (nname ~= "ignore" and ndef.diggable) then
|
||||
|
@ -378,5 +374,4 @@ local function overwrite()
|
|||
end
|
||||
end
|
||||
|
||||
-- Make sure all tools and groups are registered
|
||||
minetest.register_on_mods_loaded(overwrite)
|
||||
overwrite()
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
name = _mcl_autogroup
|
||||
depends = mcl_autogroup
|
||||
author = ryvnf
|
||||
description = VoxeLibre core mod which automatically adds groups to all items. Very important for digging times.
|
||||
description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times.
|
||||
|
|
|
@ -2,33 +2,33 @@
|
|||
Simple flow functions.
|
||||
|
||||
## flowlib.is_touching(realpos, nodepos, radius)
|
||||
Return true if a sphere of `radius` at `realpos` collide with node at `nodepos`.
|
||||
Return true if a sphere of <radius> at <realpos> collide with node at <nodepos>.
|
||||
* realpos: position
|
||||
* nodepos: position
|
||||
* radius: number
|
||||
|
||||
## flowlib.is_water(pos)
|
||||
Return true if node at `pos` is water, false otherwise.
|
||||
Return true if node at <pos> is water, false overwise.
|
||||
* pos: position
|
||||
|
||||
## flowlib.node_is_water(node)
|
||||
Return true if `node` is water, false otherwise.
|
||||
Return true if <node> is water, false overwise.
|
||||
* node: node
|
||||
|
||||
## flowlib.is_lava(pos)
|
||||
Return true if node at `pos` is lava, false otherwise.
|
||||
Return true if node at <pos> is lava, false overwise.
|
||||
* pos: position
|
||||
|
||||
## flowlib.node_is_lava(node)
|
||||
Return true if `node` is lava, false otherwise.
|
||||
Return true if <node> is lava, false overwise.
|
||||
* node: node
|
||||
|
||||
## flowlib.is_liquid(pos)
|
||||
Return true if node at `pos` is liquid, false otherwise.
|
||||
Return true if node at <pos> is liquid, false overwise.
|
||||
* pos: position
|
||||
|
||||
## flowlib.node_is_liquid(node)
|
||||
Return true if `node` is liquid, false otherwise.
|
||||
Return true if <node> is liquid, false overwise.
|
||||
* node: node
|
||||
|
||||
## flowlib.quick_flow(pos, node)
|
||||
|
@ -37,9 +37,9 @@ Return direction where the water is flowing (to be use to push mobs, items...).
|
|||
* node: node
|
||||
|
||||
## flowlib.move_centre(pos, realpos, node, radius)
|
||||
Return the pos of the nearest not water block near from `pos` in a sphere of `radius` at `realpos`.
|
||||
WARNING: This function is never used in VL, use at your own risk. The informations described here may be wrong.
|
||||
Return the pos of the nearest not water block near from <pos> in a sphere of <radius> at <realpos>.
|
||||
WARNING: This function is never used in mcl2, use at your own risk. The informations described here may be wrong.
|
||||
* pos: position
|
||||
* realpos: position, position of the entity
|
||||
* node: node
|
||||
* radius: number
|
||||
* radius: number
|
|
@ -1,5 +1,5 @@
|
|||
-- Overrides the builtin minetest.check_single_for_falling.
|
||||
-- We need to do this in order to handle nodes in VoxeLibre specific groups
|
||||
-- We need to do this in order to handle nodes in mineclone specific groups
|
||||
-- "supported_node" and "attached_node_facedir".
|
||||
--
|
||||
-- Nodes in group "supported_node" can be placed on any node that does not
|
||||
|
@ -94,16 +94,5 @@ 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
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# mcl_autogroup
|
||||
This mod emulates digging times from MC.
|
||||
This mod emulate digging times from mc.
|
||||
|
||||
## mcl_autogroup.can_harvest(nodename, toolname, player)
|
||||
Return true if `nodename` can be dig with `toolname` by <player>.
|
||||
Return true if <nodename> can be dig with <toolname> by <player>.
|
||||
* nodename: string, valid nodename
|
||||
* toolname: (optional) string, valid toolname
|
||||
* player: (optinal) ObjectRef, valid player
|
||||
|
@ -14,7 +14,7 @@ WARNING: This function can only be called after mod initialization.
|
|||
* efficiency: (optional) integer, the efficiency level the tool is enchanted with (default 0)
|
||||
|
||||
## mcl_autogroup.get_wear(toolname, diggroup)
|
||||
Return the max wear of `toolname` with `diggroup`
|
||||
Return the max wear of <toolname> with <diggroup>
|
||||
WARNING: This function can only be called after mod initialization.
|
||||
* toolname: string, name of the tool used
|
||||
* diggroup: string, the name of the diggroup the tool is used on
|
||||
|
@ -25,4 +25,4 @@ WARNING: This function can only be called after mod initialization.
|
|||
* level: (optional) string, if specified it is an array containing the names of the different digging levels the digging group supports
|
||||
|
||||
## mcl_autogroup.registered_diggroups
|
||||
List of registered diggroups, indexed by name.
|
||||
List of registered diggroups, indexed by name.
|
|
@ -1,3 +1,3 @@
|
|||
name = mcl_autogroup
|
||||
author = ryvnf
|
||||
description = VoxeLibre core mod which automatically adds groups to all items. Very important for digging times.
|
||||
description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# mcl_colors
|
||||
Mod providing global table containing legacy Minecraft colors to be used in mods.
|
||||
Mod providing global table containing legacity minecraft colors to be used in mods.
|
||||
|
||||
## mcl_colors.*
|
||||
Colors by upper name, in hex value.
|
||||
|
|
|
@ -6,10 +6,10 @@ WARNING: Not using it inside your mods may cause strange bugs (using the native
|
|||
|
||||
## Callbacks
|
||||
|
||||
To modify the amount of damage dealt by something:
|
||||
To modify the amount of damage made by something:
|
||||
|
||||
```lua
|
||||
--obj: an ObjectRef
|
||||
mcl_damage.register_modifier(function(obj, damage, reason)
|
||||
end, 0)
|
||||
```
|
||||
```
|
|
@ -1,13 +1,9 @@
|
|||
# mcl_events
|
||||
## mcl_events
|
||||
### Registering Events
|
||||
`mlc_events.register_event("name",def)`
|
||||
|
||||
## Registering Events
|
||||
|
||||
`mcl_events.register_event("name", def)`
|
||||
|
||||
### Event Definition
|
||||
|
||||
```
|
||||
{
|
||||
#### Event Definition
|
||||
{
|
||||
stage = 0,
|
||||
max_stage = 1,
|
||||
percent = 100,
|
||||
|
@ -26,8 +22,6 @@
|
|||
cond_complete = function(event) end,
|
||||
--return true if event finished successfully
|
||||
}
|
||||
```
|
||||
|
||||
## Debugging
|
||||
|
||||
* /event_start `event` -- starts the given event at the current player coordinates
|
||||
### Debugging
|
||||
* /event_start <event> -- starts the given event at the current player coordinates
|
||||
|
|
|
@ -3,13 +3,13 @@ This mod provide helper functions to create explosions.
|
|||
|
||||
## mcl_explosions.explode(pos, strength, info, puncher)
|
||||
* pos: position, initial position of the explosion
|
||||
* strength: number, radius of the explosion
|
||||
* strenght: number, radius of the explosion
|
||||
* info: table, explosion informations:
|
||||
* drop_chance: number, if specified becomes the drop chance of all nodes in the explosion (default: 1.0 / strength)
|
||||
* max_blast_resistance: int, if specified the explosion will treat all non-indestructible nodes as having a blast resistance of no more than this value
|
||||
* sound: bool, if true, the explosion will play a sound (default: true)
|
||||
* particles: bool, if true, the explosion will create particles (default: true)
|
||||
* fire: bool, if true, 1/3 of nodes become fire (default: false)
|
||||
* fire: bool, if true, 1/3 nodes become fire (default: false)
|
||||
* griefing: bool, if true, the explosion will destroy nodes (default: true)
|
||||
* grief_protected: bool, if true, the explosion will also destroy nodes which have been protected (default: false)
|
||||
* puncher: (optional) entity, will be used as source for damage done by the explosion
|
||||
* puncher: (optional) entity, will be used as source for damage done by the explosion
|
|
@ -1,8 +1,8 @@
|
|||
--[[
|
||||
Explosion API mod for Minetest (adapted to VoxeLibre)
|
||||
Explosion API mod for Minetest (adapted to MineClone 2)
|
||||
|
||||
This mod is based on the Minetest explosion API mod, but has been changed
|
||||
to have the same explosion mechanics as Minecraft and work with VoxeLibre
|
||||
to have the same explosion mechanics as Minecraft and work with MineClone.
|
||||
The computation-intensive parts of the mod has been optimized to allow for
|
||||
larger explosions and faster world updating.
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
-- 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
|
||||
|
@ -39,7 +37,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/VoxeLibre/VoxeLibre/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/MineClone2/MineClone2/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
|
||||
|
@ -185,7 +183,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 VoxeLibre-style dungeons
|
||||
-- Use MineClone 2-style dungeons
|
||||
mcl_vars.mg_dungeons = true
|
||||
|
||||
-- Set default stack sizes
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
name = mcl_init
|
||||
author = Wuzzy
|
||||
description = Initialization mod of VoxeLibre. Defines some common shared variables and sets up initial default settings which have to be set at the beginning.
|
||||
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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Oxidization API for VoxeLibre
|
||||
# Oxidization API for MineClone 2
|
||||
This mods adds the oxidization api, so that modders can easily use the same features that copper uses.
|
||||
|
||||
## API
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_oxidation
|
||||
title = Oxidation API for VoxeLibre
|
||||
title = Oxidation API for MineClone 2
|
||||
author = PrairieWind, N011, Michael
|
||||
description = API to allow oxidizing different nodes.
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
name = mcl_particles
|
||||
author = Wuzzy
|
||||
description = Contains particle images of MineClone 2. No code.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
name = mcl_sounds
|
||||
author = Wuzzy
|
||||
description = This mod contains the core sounds of VoxeLibre as well as helper function for mods to access them.
|
||||
description = This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them.
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
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
|
||||
|
@ -48,20 +46,6 @@ function table.pairs_by_keys(t, f)
|
|||
return iter
|
||||
end
|
||||
|
||||
-- Removes one element randomly selected from the array section of the table and
|
||||
-- returns it, or nil if there are no elements in the array section of the table
|
||||
function table.remove_random_element(table)
|
||||
local count = #table
|
||||
if count == 0 then return nil end
|
||||
|
||||
local idx = math.random(count)
|
||||
local res = table[idx]
|
||||
table[idx] = table[count]
|
||||
table[count] = nil
|
||||
count = count - 1
|
||||
return res
|
||||
end
|
||||
|
||||
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_default", false)
|
||||
local LOG_MODULE = "[MCL2]"
|
||||
function mcl_util.mcl_log(message, module, bypass_default_logger)
|
||||
|
@ -129,7 +113,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/VoxeLibre/VoxeLibre/issues/1392
|
||||
-- https://git.minetest.land/MineClone2/MineClone2/issues/1392
|
||||
function mcl_util.get_natural_light (pos, time)
|
||||
local status, retVal = pcall(minetest.get_natural_light, pos, time)
|
||||
if status then
|
||||
|
@ -452,11 +436,10 @@ 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 and def_under.name ~= itemstack:get_name() then
|
||||
if def_under.buildable_to then
|
||||
place_pos = pointed_thing.under
|
||||
elseif def_above.buildable_to and def_above.name ~= itemstack:get_name() then
|
||||
elseif def_above.buildable_to then
|
||||
place_pos = pointed_thing.above
|
||||
pointed_thing.under = pointed_thing.above
|
||||
else
|
||||
return itemstack
|
||||
end
|
||||
|
@ -551,7 +534,6 @@ 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)
|
||||
|
@ -1117,39 +1099,3 @@ function mcl_util.is_it_christmas()
|
|||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_util.to_bool(val)
|
||||
if not val then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
if not vector.in_area then
|
||||
-- backport from minetest 5.8, can be removed when the minimum version is 5.8
|
||||
vector.in_area = function(pos, min, max)
|
||||
return (pos.x >= min.x) and (pos.x <= max.x) and
|
||||
(pos.y >= min.y) and (pos.y <= max.y) and
|
||||
(pos.z >= min.z) and (pos.z <= max.z)
|
||||
end
|
||||
end
|
||||
|
||||
-- Traces along a line of nodes vertically to find the next possition that isn't an allowed node
|
||||
---@param pos The position to start tracing from
|
||||
---@param dir The direction to trace in. 1 is up, -1 is down, all other values are not allowed.
|
||||
---@param allowed_nodes A set of node names to trace along.
|
||||
---@param limit The maximum number of steps to make. Defaults to 16 if nil or missing
|
||||
---@return Three return values:
|
||||
--- the position of the next node that isn't allowed or nil if no such node was found,
|
||||
--- the distance from the start where that node was found,
|
||||
--- the node table if a node was found
|
||||
function mcl_util.trace_nodes(pos, dir, allowed_nodes, limit)
|
||||
if (dir ~= -1) and (dir ~= 1) then return nil, 0, nil end
|
||||
limit = limit or 16
|
||||
|
||||
for i = 1,limit do
|
||||
pos = vector.offset(pos, 0, dir, 0)
|
||||
local node = minetest.get_node(pos)
|
||||
if not allowed_nodes[node.name] then return pos, i, node end
|
||||
end
|
||||
|
||||
return nil, limit, nil
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_util
|
||||
author = Wuzzy
|
||||
description = Helper functions for VoxeLibre.
|
||||
description = Helper functions for MineClone 2.
|
||||
depends = mcl_init
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
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
|
|
@ -5,21 +5,20 @@ This mod provides utility functions about positions and dimensions.
|
|||
This function returns:
|
||||
|
||||
* true, true: if pos is in deep void (deadly)
|
||||
* true, false: if the pos is in void (non-deadly)
|
||||
* false, false: otherwise
|
||||
* true, false: if the pos is in void (non deadly)
|
||||
* false, false: owerwise
|
||||
|
||||
Params:
|
||||
|
||||
* pos: position
|
||||
|
||||
## mcl_worlds.y_to_layer(y)
|
||||
This function is used to calculate the Minetest y layer and dimension of the given y Minecraft layer.
|
||||
This function is used to calculate the minetest y layer and dimension of the given <y> minecraft layer.
|
||||
Mainly used for ore generation.
|
||||
Takes a Y coordinate as input and returns:
|
||||
|
||||
* The corresponding Minecraft layer (can be `nil` if void)
|
||||
* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if y is in the void
|
||||
Takes an Y coordinate as input and returns:
|
||||
|
||||
* The corresponding Minecraft layer (can be nil if void)
|
||||
* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if <y> is in the void
|
||||
If the Y coordinate is not located in any dimension, it will return: nil, "void"
|
||||
|
||||
Params:
|
||||
|
@ -27,44 +26,43 @@ Params:
|
|||
* y: int
|
||||
|
||||
## mcl_worlds.pos_to_dimension(pos)
|
||||
This function return the Minecraft dimension of pos ("overworld", "nether" or "end") or "void" if y is in the void.
|
||||
This function return the Minecraft dimension of <pos> ("overworld", "nether" or "end") or "void" if <y> is in the void.
|
||||
|
||||
* 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 VoxeLibre.
|
||||
Takes a Minecraft layer and a “dimension” name and returns the corresponding Y coordinate for MineClone 2.
|
||||
mc_dimension can be "overworld", "nether", "end" (default: "overworld").
|
||||
|
||||
* layer: int
|
||||
* mc_dimension: string
|
||||
|
||||
## mcl_worlds.has_weather(pos)
|
||||
Returns true if pos can have weather, false otherwise.
|
||||
Returns true if <pos> can have weather, false owerwise.
|
||||
Weather can be only in the overworld.
|
||||
|
||||
* pos: position
|
||||
|
||||
## mcl_worlds.has_dust(pos)
|
||||
Returns true if pos can have nether dust, false otherwise.
|
||||
Returns true if <pos> can have nether dust, false owerwise.
|
||||
Nether dust can be only in the nether.
|
||||
|
||||
* pos: position
|
||||
|
||||
## mcl_worlds.compass_works(pos)
|
||||
Returns true if compasses are working at pos, false otherwise.
|
||||
In MC, you cant use compass in the nether and the end.
|
||||
Returns true if compasses are working at <pos>, false owerwise.
|
||||
In mc, you cant use compass in the nether and the end.
|
||||
|
||||
* pos: position
|
||||
|
||||
## mcl_worlds.compass_works(pos)
|
||||
Returns true if clock are working at pos, false otherwise.
|
||||
In MC, you cant use clock in the nether and the end.
|
||||
Returns true if clock are working at <pos>, false owerwise.
|
||||
In mc, you cant use clock in the nether and the end.
|
||||
|
||||
* pos: position
|
||||
|
||||
## mcl_worlds.register_on_dimension_change(function(player, dimension, last_dimension))
|
||||
Register a callback function func(player, dimension).
|
||||
|
||||
It will be called whenever a player changes between dimensions.
|
||||
The void counts as dimension.
|
||||
|
||||
|
@ -77,7 +75,7 @@ The void counts as dimension.
|
|||
Table containing all function registered with mcl_worlds.register_on_dimension_change()
|
||||
|
||||
## mcl_worlds.dimension_change(player, dimension)
|
||||
Notify this mod of a dimension change of player to dimension
|
||||
Notify this mod of a dimension change of <player> to <dimension>
|
||||
|
||||
* player: player, player who changed the dimension
|
||||
* dimension: string, new dimension ("overworld", "nether", "end", "void")
|
||||
|
|
|
@ -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
|
||||
-- VoxeLibre
|
||||
-- MineClone 2.
|
||||
-- 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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# tga_encoder
|
||||
A TGA Encoder written in Lua without the use of external Libraries.
|
||||
|
||||
Created by fleckenstein for VoxeLibre, then improved by erlehmann.
|
||||
Created by fleckenstein for MineClone2, then improved by erlehmann.
|
||||
|
||||
May be used as a Minetest mod.
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ License of boat model:
|
|||
GNU GPLv3 <https://www.gnu.org/licenses/gpl-3.0.html>
|
||||
|
||||
## Textures
|
||||
See the main VoxeLibre README.md file to learn more.
|
||||
See the main MineClone 2 README.md file to learn more.
|
||||
|
||||
## Code
|
||||
Code based on Minetest Game, licensed under the MIT License (MIT).
|
||||
|
|
|
@ -168,7 +168,7 @@ end
|
|||
|
||||
|
||||
function boat.on_activate(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({fleshy = 125})
|
||||
self.object:set_armor_groups({fleshy = 100})
|
||||
local data = minetest.deserialize(staticdata)
|
||||
if type(data) == "table" then
|
||||
self._v = data.v
|
||||
|
|
|
@ -10,14 +10,3 @@ Rightclick on a water source to place the boat. Rightclick the boat to enter it.
|
|||
Spruce Boat=Fichtenboot
|
||||
Water vehicle=Wasserfahrzeug
|
||||
Sneak to dismount=Zum Aussteigen schleichen
|
||||
Obsidian Boat=Obsidianboot
|
||||
Mangrove Boat=
|
||||
Cherry Boat=Kirschholzboot
|
||||
Oak Chest Boat=Eichentruhenboot
|
||||
Spruce Chest Boat=
|
||||
Birch Chest Boat=Birkentruhenboot
|
||||
Jungle Chest Boat=Dschungeltruhenboot
|
||||
Acacia Chest Boat=
|
||||
Dark Oak Chest Boat=
|
||||
Mangrove Chest Boat=
|
||||
Cherry Chest Boat=
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_burning
|
||||
description = Burning Objects for VoxeLibre
|
||||
description = Burning Objects for MineClone2
|
||||
author = Fleckenstein
|
||||
depends = mcl_weather
|
||||
depends = mcl_weather
|
|
@ -1,6 +1,6 @@
|
|||
# mcl_dripping
|
||||
|
||||
Dripping Mod by kddekadenz, modified for VoxeLibre by Wuzzy, NO11 and AFCM
|
||||
Dripping Mod by kddekadenz, modified for MineClone 2 by Wuzzy, NO11 and AFCM
|
||||
|
||||
## Manual
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ local function make_drop(pos, liquid, sound, interval, texture)
|
|||
pt.expirationtime = t
|
||||
|
||||
pt.texture = "[combine:2x2:" ..
|
||||
math.random(-14, 0) .. "," .. math.random(-14, 0) .. "=" .. texture
|
||||
-math.random(1, 16) .. "," .. -math.random(1, 16) .. "=" .. texture
|
||||
|
||||
minetest.add_particle(pt)
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ local pool = {}
|
|||
|
||||
local tick = false
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
pool[player:get_player_name()] = 0
|
||||
end)
|
||||
|
@ -127,7 +130,6 @@ 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)
|
||||
|
@ -136,7 +138,6 @@ local function try_object_pickup(player, inv, object, checkpos)
|
|||
-- Destroy entity
|
||||
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
|
||||
le.target = checkpos
|
||||
le.itemstring = ""
|
||||
le._removed = true
|
||||
|
||||
-- Stop the object
|
||||
|
@ -171,17 +172,17 @@ minetest.register_globalstep(function(_)
|
|||
|
||||
local pos = player:get_pos()
|
||||
|
||||
if tick == true and (pool[name] or 0) > 0 then
|
||||
if tick == true and pool[name] > 0 then
|
||||
minetest.sound_play("item_drop_pickup", {
|
||||
pos = pos,
|
||||
gain = 0.3,
|
||||
max_hear_distance = 16,
|
||||
pitch = math.random(70, 110) / 100
|
||||
})
|
||||
if (pool[name] or 0) > 6 then
|
||||
if pool[name] > 6 then
|
||||
pool[name] = 6
|
||||
else
|
||||
pool[name] = (pool[name] or 1) - 1
|
||||
pool[name] = pool[name] - 1
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -321,7 +322,6 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
if tool and nodedef._mcl_fortune_drop and enchantments.fortune then
|
||||
local fortune_level = enchantments.fortune
|
||||
local fortune_drop = nodedef._mcl_fortune_drop
|
||||
local simple_drop = nodedef._mcl_fortune_drop.drop_without_fortune
|
||||
if fortune_drop.discrete_uniform_distribution then
|
||||
local min_count = fortune_drop.min_count
|
||||
local max_count = fortune_drop.max_count + fortune_level * (fortune_drop.factor or 1)
|
||||
|
@ -337,12 +337,6 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
local drop = get_fortune_drops(fortune_drop, fortune_level)
|
||||
drops = get_drops(drop, tool:get_name(), dug_node.param2, nodedef.paramtype2)
|
||||
end
|
||||
|
||||
if simple_drop then
|
||||
for _, item in pairs(simple_drop) do
|
||||
table.insert(drops, item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if digger and mcl_experience.throw_xp and not silk_touch_drop then
|
||||
|
@ -457,7 +451,6 @@ function minetest.node_dig(pos, node, digger)
|
|||
end
|
||||
end
|
||||
end
|
||||
tt.reload_itemstack_description(wielded) -- update tooltip
|
||||
digger:set_wielded_item(wielded)
|
||||
end
|
||||
|
||||
|
@ -965,7 +958,6 @@ minetest.register_entity(":__builtin:item", {
|
|||
self.random_velocity = 0
|
||||
self:set_item(own_stack:to_string())
|
||||
|
||||
entity.itemstring = ""
|
||||
entity._removed = true
|
||||
object:remove()
|
||||
return true
|
||||
|
|
|
@ -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: VoxeLibre Edition
|
||||
-- API for Mobs Redo: MineClone 2 Edition (MRM)
|
||||
|
||||
local PATHFINDING = "gowp"
|
||||
local CRASH_WARN_FREQUENCY = 60
|
||||
|
@ -18,7 +18,7 @@ mcl_mobs.invis = {}
|
|||
local remove_far = true
|
||||
|
||||
local mobs_debug = minetest.settings:get_bool("mobs_debug", false) -- Shows helpful debug info above each mob
|
||||
local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn", false)
|
||||
local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true)
|
||||
|
||||
local MAPGEN_LIMIT = mcl_vars.mapgen_limit
|
||||
local MAPGEN_MOB_LIMIT = MAPGEN_LIMIT - 90
|
||||
|
@ -96,23 +96,15 @@ function mob_class:get_staticdata()
|
|||
|
||||
local tmp = {}
|
||||
|
||||
for tag, stat in pairs(self) do
|
||||
for _,stat in pairs(self) do
|
||||
|
||||
local t = type(stat)
|
||||
|
||||
if t ~= "function"
|
||||
and t ~= "nil"
|
||||
and t ~= "userdata"
|
||||
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
|
||||
and _ ~= "_cmi_components" then
|
||||
tmp[_] = self[_]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -150,11 +142,6 @@ function mob_class:mob_activate(staticdata, def, dtime)
|
|||
local tmp = minetest.deserialize(staticdata)
|
||||
|
||||
if tmp then
|
||||
-- Patch incorrectly converted mobs
|
||||
if tmp.base_mesh ~= minetest.registered_entities[self.name].mesh then
|
||||
mcl_mobs.strip_staticdata(tmp)
|
||||
end
|
||||
|
||||
for _,stat in pairs(tmp) do
|
||||
self[_] = stat
|
||||
end
|
||||
|
@ -319,10 +306,7 @@ 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
|
||||
|
@ -388,7 +372,7 @@ end
|
|||
|
||||
|
||||
|
||||
local function on_step_work(self, dtime, moveresult)
|
||||
local function on_step_work (self, dtime)
|
||||
local pos = self.object:get_pos()
|
||||
if not pos then return end
|
||||
|
||||
|
@ -402,7 +386,7 @@ local function on_step_work(self, dtime, moveresult)
|
|||
-- Do we abandon out of here now?
|
||||
end
|
||||
|
||||
if self:falling(pos, moveresult) then return end
|
||||
if self:falling(pos) then return end
|
||||
if self:step_damage (dtime, pos) then return end
|
||||
|
||||
if self.state == "die" then return end
|
||||
|
@ -489,7 +473,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 VoxeLibre dev team for investigation. (Search for: --- Bug report start)")
|
||||
minetest.log("A game crashing bug was prevented. Please provide debug.log information to MineClone2 dev team for investigation. (Search for: --- Bug report start)")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -502,11 +486,11 @@ end
|
|||
|
||||
|
||||
-- main mob function
|
||||
function mob_class:on_step(dtime, moveresult)
|
||||
function mob_class:on_step(dtime)
|
||||
if not DEVELOPMENT then
|
||||
-- Removed as bundled Lua (5.1 doesn't support xpcall)
|
||||
--local status, retVal = xpcall(on_step_work, on_step_error_handler, self, dtime)
|
||||
local status, retVal = pcall(on_step_work, self, dtime, moveresult)
|
||||
local status, retVal = pcall(on_step_work, self, dtime)
|
||||
if status then
|
||||
return retVal
|
||||
else
|
||||
|
@ -521,7 +505,7 @@ function mob_class:on_step(dtime, moveresult)
|
|||
log_error (dump(retVal), dump(pos), dump(self))
|
||||
end
|
||||
else
|
||||
return on_step_work (self, dtime, moveresult)
|
||||
return on_step_work (self, dtime)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
Mobs Redo: VoxeLibre Edition
|
||||
Mobs Redo: MineClone 2 Edition
|
||||
API documentation
|
||||
==============================
|
||||
|
||||
|
@ -231,7 +231,7 @@ functions needed for the mob to work properly which contains the following:
|
|||
|
||||
|
||||
|
||||
VoxeLibre extensions:
|
||||
MineClone 2 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
|
||||
|
||||
|
||||
VoxeLibre extensions
|
||||
MineClone 2 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 VoxeLibre.
|
||||
Mobs cannot be captured in MineClone 2.
|
||||
|
||||
In Mobs Redo, this is generally called inside the on_rightclick section of the mob
|
||||
api code, it provides a chance of capturing the mob. See Mobs Redo documentation
|
||||
|
@ -671,13 +671,6 @@ 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
|
||||
--------------------------
|
||||
|
|
|
@ -78,7 +78,6 @@ 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
|
||||
|
||||
|
@ -274,7 +273,7 @@ function mob_class:check_breeding()
|
|||
return
|
||||
end
|
||||
|
||||
mcl_experience.throw_xp(pos, math.random(1, 7) + (parent1._luck or 0) + (parent2._luck or 0))
|
||||
mcl_experience.throw_xp(pos, math.random(1, 7))
|
||||
|
||||
-- custom breed function
|
||||
if parent1.on_breed then
|
||||
|
@ -285,7 +284,6 @@ function mob_class:check_breeding()
|
|||
end
|
||||
|
||||
local child = mcl_mobs.spawn_child(pos, parent1.name)
|
||||
if not child then return end
|
||||
|
||||
local ent_c = child:get_luaentity()
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ 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()
|
||||
|
@ -532,8 +534,6 @@ 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,13 +605,6 @@ 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
|
||||
|
@ -653,7 +646,6 @@ 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())
|
||||
|
@ -802,37 +794,34 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
end
|
||||
|
||||
-- alert others to the attack
|
||||
local alert_pos = hitter:get_pos()
|
||||
if alert_pos then
|
||||
local objs = minetest.get_objects_inside_radius(alert_pos, self.view_range)
|
||||
local obj = nil
|
||||
local objs = minetest.get_objects_inside_radius(hitter:get_pos(), self.view_range)
|
||||
local obj = nil
|
||||
|
||||
for n = 1, #objs do
|
||||
for n = 1, #objs do
|
||||
|
||||
obj = objs[n]:get_luaentity()
|
||||
obj = objs[n]:get_luaentity()
|
||||
|
||||
if obj then
|
||||
-- only alert members of same mob or friends
|
||||
if obj.group_attack
|
||||
and obj.state ~= "attack"
|
||||
and obj.owner ~= name then
|
||||
if obj.name == self.name then
|
||||
obj:do_attack(hitter)
|
||||
elseif type(obj.group_attack) == "table" then
|
||||
for i=1, #obj.group_attack do
|
||||
if obj.group_attack[i] == self.name then
|
||||
obj._aggro = true
|
||||
obj:do_attack(hitter)
|
||||
break
|
||||
end
|
||||
if obj then
|
||||
-- only alert members of same mob or friends
|
||||
if obj.group_attack
|
||||
and obj.state ~= "attack"
|
||||
and obj.owner ~= name then
|
||||
if obj.name == self.name then
|
||||
obj:do_attack(hitter)
|
||||
elseif type(obj.group_attack) == "table" then
|
||||
for i=1, #obj.group_attack do
|
||||
if obj.group_attack[i] == self.name then
|
||||
obj._aggro = true
|
||||
obj:do_attack(hitter)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- have owned mobs attack player threat
|
||||
if obj.owner == name and obj.owner_loyal then
|
||||
obj:do_attack(self.object)
|
||||
end
|
||||
-- have owned mobs attack player threat
|
||||
if obj.owner == name and obj.owner_loyal then
|
||||
obj:do_attack(self.object)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -968,7 +957,6 @@ 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
|
||||
|
@ -1154,8 +1142,9 @@ function mob_class:do_states_attack (dtime)
|
|||
damage_groups = {fleshy = self.damage}
|
||||
}, nil)
|
||||
if self.dealt_effect then
|
||||
mcl_potions.give_effect_by_level(self.dealt_effect.name, self.attack,
|
||||
self.dealt_effect.level, self.dealt_effect.dur)
|
||||
mcl_mobs.effect_functions[self.dealt_effect.name](
|
||||
self.attack, self.dealt_effect.factor, self.dealt_effect.dur
|
||||
)
|
||||
end
|
||||
end
|
||||
else
|
||||
|
|
|
@ -5,7 +5,6 @@ local validate_vector = mcl_util.validate_vector
|
|||
local active_particlespawners = {}
|
||||
local disable_blood = minetest.settings:get_bool("mobs_disable_blood")
|
||||
local DEFAULT_FALL_SPEED = -9.81*1.5
|
||||
local PI_THIRD = math.pi / 3 -- 60 degrees
|
||||
|
||||
local PATHFINDING = "gowp"
|
||||
|
||||
|
@ -295,66 +294,86 @@ function mcl_mobs:set_animation(self, anim)
|
|||
self:set_animation(anim)
|
||||
end
|
||||
|
||||
local function who_are_you_looking_at (self, dtime)
|
||||
if self.order == "sleep" then
|
||||
self._locked_object = nil
|
||||
return
|
||||
end
|
||||
local function dir_to_pitch(dir)
|
||||
--local dir2 = vector.normalize(dir)
|
||||
local xz = math.abs(dir.x) + math.abs(dir.z)
|
||||
return -math.atan2(-dir.y, xz)
|
||||
end
|
||||
|
||||
local function who_are_you_looking_at (self, dtime)
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
local stop_look_at_player_chance = math.random(833/self.curiosity)
|
||||
-- was 10000 - div by 12 for avg entities as outside loop
|
||||
local stop_look_at_player = math.random() * 833 <= self.curiosity
|
||||
|
||||
local stop_look_at_player = stop_look_at_player_chance == 1
|
||||
|
||||
if self.attack then
|
||||
self._locked_object = not self.target_time_lost and self.attack or nil
|
||||
if not self.target_time_lost then
|
||||
self._locked_object = self.attack
|
||||
else
|
||||
self._locked_object = nil
|
||||
end
|
||||
elseif self.following then
|
||||
self._locked_object = self.following
|
||||
elseif self._locked_object then
|
||||
if stop_look_at_player then self._locked_object = nil end
|
||||
if stop_look_at_player then
|
||||
--minetest.log("Stop look: ".. self.name)
|
||||
self._locked_object = nil
|
||||
end
|
||||
elseif not self._locked_object then
|
||||
if mcl_util.check_dtime_timer(self, dtime, "step_look_for_someone", 0.2) then
|
||||
local pos = self.object:get_pos()
|
||||
--minetest.log("Change look check: ".. self.name)
|
||||
|
||||
-- For the wither this was 20/60=0.33, so probably need to rebalance and divide rates.
|
||||
-- but frequency of check isn't good as it is costly. Making others too infrequent requires testing
|
||||
local chance = 150/self.curiosity
|
||||
|
||||
if chance < 1 then chance = 1 end
|
||||
local look_at_player_chance = math.random(chance)
|
||||
|
||||
-- was 5000 but called in loop based on entities. so div by 12 as estimate avg of entities found,
|
||||
-- then div by 20 as less freq lookup
|
||||
|
||||
local look_at_player = look_at_player_chance == 1
|
||||
|
||||
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 8)) do
|
||||
if obj:is_player() and vector.distance(pos, obj:get_pos()) < 4 then
|
||||
if obj:is_player() and vector.distance(pos,obj:get_pos()) < 4 then
|
||||
--minetest.log("Change look to player: ".. self.name)
|
||||
self._locked_object = obj
|
||||
break
|
||||
elseif obj:is_player() or (obj:get_luaentity() and self ~= obj:get_luaentity() and obj:get_luaentity().name == self.name) then
|
||||
-- For the wither this was 20/60=0.33, so probably need to rebalance and divide rates.
|
||||
-- but frequency of check isn't good as it is costly. Making others too infrequent requires testing
|
||||
-- was 5000 but called in loop based on entities. so div by 12 as estimate avg of entities found,
|
||||
-- then div by 20 as less freq lookup
|
||||
if math.random() * 150 <= self.curiosity then
|
||||
elseif obj:is_player() or (obj:get_luaentity() and obj:get_luaentity().name == self.name and self ~= obj:get_luaentity()) then
|
||||
if look_at_player then
|
||||
--minetest.log("Change look to mob: ".. self.name)
|
||||
self._locked_object = obj
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function mob_class:check_head_swivel(dtime)
|
||||
if not self.head_swivel or type(self.head_swivel) ~= "string" then return end
|
||||
|
||||
who_are_you_looking_at(self, dtime)
|
||||
|
||||
local newr, oldp, oldr = vector.zero(), nil, nil
|
||||
if self.object.get_bone_override then -- minetest >= 5.9
|
||||
local ov = self.object:get_bone_override(self.head_swivel)
|
||||
oldp, oldr = ov.position.vec, ov.rotation.vec
|
||||
else -- minetest < 5.9
|
||||
oldp, oldr = self.object:get_bone_position(self.head_swivel)
|
||||
oldr = vector.apply(oldr, math.rad) -- old API uses radians
|
||||
end
|
||||
who_are_you_looking_at (self, dtime)
|
||||
|
||||
local locked_object = self._locked_object
|
||||
if locked_object and (locked_object:is_player() or locked_object:get_luaentity()) and locked_object:get_hp() > 0 then
|
||||
local final_rotation = vector.zero()
|
||||
local oldp,oldr = self.object:get_bone_position(self.head_swivel)
|
||||
|
||||
if self._locked_object and (self._locked_object:is_player() or self._locked_object:get_luaentity()) and self._locked_object:get_hp() > 0 then
|
||||
local _locked_object_eye_height = 1.5
|
||||
if locked_object:is_player() then
|
||||
_locked_object_eye_height = locked_object:get_properties().eye_height
|
||||
elseif locked_object:get_luaentity() then
|
||||
_locked_object_eye_height = locked_object:get_luaentity().head_eye_height
|
||||
if self._locked_object:get_luaentity() then
|
||||
_locked_object_eye_height = self._locked_object:get_luaentity().head_eye_height
|
||||
end
|
||||
if self._locked_object:is_player() then
|
||||
_locked_object_eye_height = self._locked_object:get_properties().eye_height
|
||||
end
|
||||
if _locked_object_eye_height then
|
||||
|
||||
local self_rot = self.object:get_rotation()
|
||||
-- If a mob is attached, should we really be messing with what they are looking at?
|
||||
-- Should this be excluded?
|
||||
|
@ -362,48 +381,40 @@ function mob_class:check_head_swivel(dtime)
|
|||
self_rot = self.object:get_attach():get_rotation()
|
||||
end
|
||||
|
||||
local ps = self.object:get_pos()
|
||||
ps.y = ps.y + self.head_eye_height * .7
|
||||
local pt = locked_object:get_pos()
|
||||
pt.y = pt.y + _locked_object_eye_height
|
||||
local dir = vector.direction(ps, pt)
|
||||
local mob_yaw = self_rot.y + math.atan2(dir.x, dir.z) + self.head_yaw_offset
|
||||
local mob_pitch = math.asin(-dir.y) * self.head_pitch_multiplier
|
||||
local player_pos = self._locked_object:get_pos()
|
||||
local direction_player = vector.direction(vector.add(self.object:get_pos(), vector.new(0, self.head_eye_height*.7, 0)), vector.add(player_pos, vector.new(0, _locked_object_eye_height, 0)))
|
||||
local mob_yaw = math.deg(-(-(self_rot.y)-(-minetest.dir_to_yaw(direction_player))))+self.head_yaw_offset
|
||||
local mob_pitch = math.deg(-dir_to_pitch(direction_player))*self.head_pitch_multiplier
|
||||
|
||||
if (mob_yaw < -PI_THIRD or mob_yaw > PI_THIRD) and not (self.attack and self.state == "attack" and not self.runaway) then
|
||||
newr = vector.multiply(oldr, 0.9)
|
||||
if (mob_yaw < -60 or mob_yaw > 60) and not (self.attack and self.state == "attack" and not self.runaway) then
|
||||
final_rotation = vector.multiply(oldr, 0.9)
|
||||
elseif self.attack and self.state == "attack" and not self.runaway then
|
||||
if self.head_yaw == "y" then
|
||||
newr = vector.new(mob_pitch, mob_yaw, 0)
|
||||
final_rotation = vector.new(mob_pitch, mob_yaw, 0)
|
||||
elseif self.head_yaw == "z" then
|
||||
newr = vector.new(mob_pitch, 0, -mob_yaw)
|
||||
final_rotation = vector.new(mob_pitch, 0, -mob_yaw)
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
if self.head_yaw == "y" then
|
||||
newr = vector.new((mob_pitch-oldr.x)*.3+oldr.x, (mob_yaw-oldr.y)*.3+oldr.y, 0)
|
||||
final_rotation = vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, ((mob_yaw-oldr.y)*.3)+oldr.y, 0)
|
||||
elseif self.head_yaw == "z" then
|
||||
newr = vector.new((mob_pitch-oldr.x)*.3+oldr.x, 0, ((mob_yaw-oldr.y)*.3+oldr.y)*-3)
|
||||
final_rotation = vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, 0, -(((mob_yaw-oldr.y)*.3)+oldr.y)*3)
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif not locked_object and math.abs(oldr.y) > 0.05 and math.abs(oldr.x) < 0.05 then
|
||||
newr = vector.multiply(oldr, 0.9)
|
||||
end
|
||||
|
||||
-- 0.02 is about 1.14 degrees tolerance, to update less often
|
||||
local newp = vector.new(0, self.bone_eye_height, self.horizontal_head_height)
|
||||
if math.abs(oldr.x-newr.x) + math.abs(oldr.y-newr.y) + math.abs(oldr.z-newr.z) < 0.02 and vector.equals(oldp, newp) then return end
|
||||
if self.object.get_bone_override then -- minetest >= 5.9
|
||||
self.object:set_bone_override(self.head_swivel, {
|
||||
position = { vec = newp, absolute = true },
|
||||
rotation = { vec = newr, absolute = true } })
|
||||
else -- minetest < 5.9
|
||||
-- old API uses degrees not radians
|
||||
self.object:set_bone_position(self.head_swivel, newp, vector.apply(newr, math.deg))
|
||||
elseif not self._locked_object and math.abs(oldr.y) > 3 and math.abs(oldr.x) < 3 then
|
||||
final_rotation = vector.multiply(oldr, 0.9)
|
||||
else
|
||||
--final_rotation = vector.new(0,0,0)
|
||||
end
|
||||
|
||||
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horizontal_head_height), final_rotation)
|
||||
end
|
||||
|
||||
|
||||
|
||||
function mob_class:set_animation_speed()
|
||||
local v = self.object:get_velocity()
|
||||
if v then
|
||||
|
|
|
@ -141,7 +141,7 @@ function mcl_mobs.register_mob(name, def)
|
|||
local final_def = {
|
||||
use_texture_alpha = def.use_texture_alpha,
|
||||
head_swivel = def.head_swivel or nil, -- bool to activate this function
|
||||
head_yaw_offset = math.rad(def.head_yaw_offset or 0), -- for wonkey model bones
|
||||
head_yaw_offset = def.head_yaw_offset or 0, -- for wonkey model bones
|
||||
head_pitch_multiplier = def.head_pitch_multiplier or 1, --for inverted pitch
|
||||
bone_eye_height = def.bone_eye_height or 1.4, -- head bone offset
|
||||
head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player
|
||||
|
@ -314,7 +314,6 @@ 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,
|
||||
|
@ -325,7 +324,6 @@ 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
|
||||
|
@ -343,37 +341,6 @@ function mcl_mobs.register_mob(name, def)
|
|||
end -- END mcl_mobs.register_mob function
|
||||
|
||||
|
||||
local STRIP_FIELDS = { "mesh", "base_size", "textures", "base_mesh", "base_texture" }
|
||||
function mcl_mobs.strip_staticdata(unpacked_staticdata)
|
||||
-- Strip select fields from the staticdata to prevent conversion issues
|
||||
for i = 1,#STRIP_FIELDS do
|
||||
unpacked_staticdata[STRIP_FIELDS[i]] = nil
|
||||
end
|
||||
end
|
||||
function mcl_mobs.register_conversion(old_name, new_name)
|
||||
minetest.register_entity(old_name, {
|
||||
on_activate = function(self, staticdata, dtime)
|
||||
local unpacked_staticdata = minetest.deserialize(staticdata)
|
||||
mcl_mobs.strip_staticdata(unpacked_staticdata)
|
||||
staticdata = minetest.serialize(unpacked_staticdata)
|
||||
|
||||
local old_object = self.object
|
||||
if not old_object then return end
|
||||
|
||||
local pos = old_object:get_pos()
|
||||
if not pos then return end
|
||||
old_object:remove()
|
||||
|
||||
local new_object = minetest.add_entity(pos, new_name, staticdata)
|
||||
if not new_object then return end
|
||||
|
||||
local hook = (new_object:get_luaentity() or {})._on_after_convert
|
||||
if hook then hook(new_object) end
|
||||
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"
|
||||
return function(projectile, object)
|
||||
|
@ -407,7 +374,7 @@ function mcl_mobs.register_arrow(name, def)
|
|||
rotate = def.rotate,
|
||||
on_punch = def.on_punch or function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)
|
||||
local vel = self.object:get_velocity():length()
|
||||
self.object:set_velocity(dir * vel)
|
||||
self.object:set_velocity({x=dir.x * vel, y=dir.y * vel, z=dir.z * vel})
|
||||
self._puncher = puncher
|
||||
end,
|
||||
collisionbox = def.collisionbox or {0, 0, 0, 0, 0, 0},
|
||||
|
@ -528,7 +495,7 @@ end
|
|||
-- Note: This also introduces the “spawn_egg” group:
|
||||
-- * spawn_egg=1: Spawn egg (generic mob, no metadata)
|
||||
-- * spawn_egg=2: Spawn egg (captured/tamed mob, metadata)
|
||||
function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, addegg, no_creative)
|
||||
function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addegg, no_creative)
|
||||
|
||||
local grp = {spawn_egg = 1}
|
||||
|
||||
|
@ -539,7 +506,7 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad
|
|||
|
||||
local invimg = "(spawn_egg.png^[multiply:" .. background_color ..")^(spawn_egg_overlay.png^[multiply:" .. overlay_color .. ")"
|
||||
if old_spawn_icons then
|
||||
local mobname = mob_id:gsub("mobs_mc:","")
|
||||
local mobname = mob:gsub("mobs_mc:","")
|
||||
local fn = "mobs_mc_spawn_icon_"..mobname..".png"
|
||||
if mcl_util.file_exists(minetest.get_modpath("mobs_mc").."/textures/"..fn) then
|
||||
invimg = fn
|
||||
|
@ -551,7 +518,7 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad
|
|||
end
|
||||
|
||||
-- register old stackable mob egg
|
||||
minetest.register_craftitem(mob_id, {
|
||||
minetest.register_craftitem(mob, {
|
||||
|
||||
description = desc,
|
||||
inventory_image = invimg,
|
||||
|
@ -561,6 +528,7 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad
|
|||
_doc_items_usagehelp = S("Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns."),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
local pos = pointed_thing.above
|
||||
|
||||
-- am I clicking on something with existing on_rightclick function?
|
||||
|
@ -570,12 +538,11 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad
|
|||
return def.on_rightclick(pointed_thing.under, under, placer, itemstack)
|
||||
end
|
||||
|
||||
local mob_name = itemstack:get_name()
|
||||
|
||||
if pos and within_limits(pos, 0) and not minetest.is_protected(pos, placer:get_player_name()) then
|
||||
local name = placer:get_player_name()
|
||||
local privs = minetest.get_player_privs(name)
|
||||
|
||||
|
||||
if under.name == "mcl_mobspawners:spawner" then
|
||||
if minetest.is_protected(pointed_thing.under, name) then
|
||||
minetest.record_protection_violation(pointed_thing.under, name)
|
||||
|
@ -592,35 +559,26 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad
|
|||
--minetest.log("min light: " .. mob_light_lvl[1])
|
||||
--minetest.log("max light: " .. mob_light_lvl[2])
|
||||
|
||||
-- Handle egg conversion
|
||||
local convert_to = (minetest.registered_entities[mob_name] or {})._convert_to
|
||||
if convert_to then mob_name = convert_to end
|
||||
|
||||
mcl_mobspawners.setup_spawner(pointed_thing.under, mob_name, mob_light_lvl[1], mob_light_lvl[2])
|
||||
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name(), mob_light_lvl[1], mob_light_lvl[2])
|
||||
if not minetest.is_creative_enabled(name) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
if not minetest.registered_entities[mob_name] then
|
||||
if not minetest.registered_entities[mob] then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
if minetest.settings:get_bool("only_peaceful_mobs", false)
|
||||
and minetest.registered_entities[mob_name].type == "monster" then
|
||||
and minetest.registered_entities[mob].type == "monster" then
|
||||
minetest.chat_send_player(name, S("Only peaceful mobs allowed!"))
|
||||
return itemstack
|
||||
end
|
||||
|
||||
pos.y = pos.y - 1
|
||||
local mob = mcl_mobs.spawn(pos, mob_name)
|
||||
if not mob then
|
||||
pos.y = pos.y + 1
|
||||
mob = mcl_mobs.spawn(pos, mob_name)
|
||||
if not mob then return end
|
||||
end
|
||||
pos.y = pos.y - 0.5
|
||||
|
||||
local mob = minetest.add_entity(pos, mob)
|
||||
local entityname = itemstack:get_name()
|
||||
minetest.log("action", "Player " ..name.." spawned "..entityname.." at "..minetest.pos_to_string(pos))
|
||||
local ent = mob:get_luaentity()
|
||||
|
@ -651,4 +609,5 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad
|
|||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
||||
|
|
|
@ -87,8 +87,7 @@ function mob_class:check_item_pickup()
|
|||
end
|
||||
if self.pick_up then
|
||||
for k,v in pairs(self.pick_up) do
|
||||
local itemstack = ItemStack(l.itemstring)
|
||||
if not player_near(p) and self.on_pick_up and itemstack:get_name():find(v) then
|
||||
if not player_near(p) and self.on_pick_up and l.itemstring:find(v) then
|
||||
local r = self.on_pick_up(self,l)
|
||||
if r and r.is_empty and not r:is_empty() then
|
||||
l.itemstring = r:to_string()
|
||||
|
|
|
@ -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, mcl_luck
|
||||
depends = mcl_particles
|
||||
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience, mcl_sculk
|
||||
|
|
|
@ -258,18 +258,6 @@ function mcl_mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
-- Stop!
|
||||
local s = get_sign(entity.v)
|
||||
|
||||
entity.v = entity.v - 0.02 * s
|
||||
|
||||
if s ~= get_sign(entity.v) then
|
||||
|
||||
entity.object:set_velocity({x = 0, y = 0, z = 0})
|
||||
entity.v = 0
|
||||
return
|
||||
end
|
||||
|
||||
-- if not moving then set animation and return
|
||||
if entity.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
|
||||
|
||||
|
@ -285,6 +273,18 @@ function mcl_mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||
mcl_mobs:set_animation(entity, moving_anim)
|
||||
end
|
||||
|
||||
-- Stop!
|
||||
local s = get_sign(entity.v)
|
||||
|
||||
entity.v = entity.v - 0.02 * s
|
||||
|
||||
if s ~= get_sign(entity.v) then
|
||||
|
||||
entity.object:set_velocity({x = 0, y = 0, z = 0})
|
||||
entity.v = 0
|
||||
return
|
||||
end
|
||||
|
||||
-- enforce speed limit forward and reverse
|
||||
local max_spd = entity.max_speed_reverse
|
||||
|
||||
|
|
|
@ -362,7 +362,7 @@ function mob_class:env_danger_movement_checks(player_in_active_range)
|
|||
self.state = "stand"
|
||||
self:set_animation( "stand")
|
||||
end
|
||||
yaw = yaw + math.random() - 0.5
|
||||
yaw = yaw + math.random(-0.5, 0.5)
|
||||
yaw = self:set_yaw( yaw, 8)
|
||||
return
|
||||
end
|
||||
|
@ -788,9 +788,9 @@ function mob_class:flop()
|
|||
if self.object:get_velocity().y < 0.1 then
|
||||
self:mob_sound("flop")
|
||||
self.object:set_velocity({
|
||||
x = (math.random()-0.5) * 2 * FLOP_HOR_SPEED,
|
||||
x = math.random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED),
|
||||
y = FLOP_HEIGHT,
|
||||
z = (math.random()-0.5) * 2 * FLOP_HOR_SPEED,
|
||||
z = math.random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED),
|
||||
})
|
||||
end
|
||||
end
|
||||
|
@ -920,7 +920,7 @@ function mob_class:do_states_walk()
|
|||
|
||||
-- Randomly turn
|
||||
if math.random(1, 100) <= 30 then
|
||||
yaw = yaw + math.random() - 0.5
|
||||
yaw = yaw + math.random(-0.5, 0.5)
|
||||
yaw = self:set_yaw( yaw, 8)
|
||||
end
|
||||
end
|
||||
|
@ -929,7 +929,7 @@ function mob_class:do_states_walk()
|
|||
|
||||
-- otherwise randomly turn
|
||||
elseif math.random(1, 100) <= 30 then
|
||||
yaw = yaw + math.random() - 0.5
|
||||
yaw = yaw + math.random(-0.5, 0.5)
|
||||
yaw = self:set_yaw( yaw, 8)
|
||||
end
|
||||
|
||||
|
@ -989,7 +989,7 @@ function mob_class:do_states_stand(player_in_active_range)
|
|||
|
||||
if lp.x > s.x then yaw = yaw +math.pi end
|
||||
else
|
||||
yaw = yaw + math.random() - 0.5
|
||||
yaw = yaw + math.random(-0.5, 0.5)
|
||||
end
|
||||
|
||||
yaw = self:set_yaw( yaw, 8)
|
||||
|
|
|
@ -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.give_effect_by_level("withering", self.object, 2, 2)
|
||||
mcl_potions.withering_func(self.object, 1, 2)
|
||||
end
|
||||
|
||||
local nodef = minetest.registered_nodes[self.standing_in]
|
||||
|
@ -692,10 +692,14 @@ function mob_class:do_env_damage()
|
|||
local nodef3 = minetest.registered_nodes[self.standing_under]
|
||||
|
||||
-- rain
|
||||
if self.rain_damage > 0 and mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||
self.health = self.health - self.rain_damage
|
||||
if self:check_for_death("rain", {type = "environment", pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
if self.rain_damage > 0 then
|
||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||
self.health = self.health - self.rain_damage
|
||||
|
||||
if self:check_for_death("rain", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -703,10 +707,14 @@ function mob_class:do_env_damage()
|
|||
|
||||
-- water damage
|
||||
if self.water_damage > 0 and nodef.groups.water then
|
||||
self.health = self.health - self.water_damage
|
||||
mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png", nil, nil, 1, nil)
|
||||
if self:check_for_death("water", {type = "environment", pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
if self.water_damage ~= 0 then
|
||||
self.health = self.health - self.water_damage
|
||||
mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png", nil, nil, 1, nil)
|
||||
|
||||
if self:check_for_death("water", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
elseif self.lava_damage > 0 and (nodef.groups.lava) then
|
||||
-- lava damage
|
||||
|
@ -722,69 +730,91 @@ function mob_class:do_env_damage()
|
|||
end
|
||||
elseif self.fire_damage > 0 and (nodef2.groups.fire) then
|
||||
-- magma damage
|
||||
self.health = self.health - self.fire_damage
|
||||
if self:check_for_death("fire", {type = "environment", pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
if self.fire_damage ~= 0 then
|
||||
self.health = self.health - self.fire_damage
|
||||
|
||||
if self:check_for_death("fire", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
elseif self.fire_damage > 0 and (nodef.groups.fire) then
|
||||
-- fire damage
|
||||
self.health = self.health - self.fire_damage
|
||||
mcl_mobs.effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil)
|
||||
mcl_burning.set_on_fire(self.object, 5)
|
||||
if self:check_for_death("fire", {type = "environment", pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
if self.fire_damage ~= 0 then
|
||||
self.health = self.health - self.fire_damage
|
||||
mcl_mobs.effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil)
|
||||
mcl_burning.set_on_fire(self.object, 5)
|
||||
|
||||
if self:check_for_death("fire", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
elseif nodef.damage_per_second ~= 0 and not nodef.groups.lava and not nodef.groups.fire then
|
||||
-- damage_per_second node check
|
||||
self.health = self.health - nodef.damage_per_second
|
||||
mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png")
|
||||
if self:check_for_death("dps", {type = "environment", pos = pos, node = self.standing_in}) then
|
||||
|
||||
if self:check_for_death("dps", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- Cactus damage
|
||||
if self.standing_on == "mcl_core:cactus" or self.standing_in == "mcl_core:cactus" or self.standing_under == "mcl_core:cactus" then
|
||||
self:damage_mob("cactus", 2)
|
||||
if self:check_for_death("cactus", {type = "environment", pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
local near = minetest.find_node_near(pos, 1, "mcl_core:cactus", true)
|
||||
if not near and near ~= nil then
|
||||
near = find_node_near({x=pos.x, y=pos.y-1, z=pos.z}, 1, "mcl_core:cactus", true)
|
||||
end
|
||||
if near then
|
||||
-- is mob touching the cactus?
|
||||
local dist = vector.distance(pos, near)
|
||||
local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near)
|
||||
local large_mob = false
|
||||
local medium_mob = false
|
||||
if self.name == "mobs_mc:ender_dragon" or
|
||||
self.name == "mobs_mc:ghast" or
|
||||
self.name == "mobs_mc:guardian_elder" or
|
||||
self.name == "mobs_mc:slime_big" or
|
||||
self.name == "mobs_mc:magma_cube_big" or
|
||||
self.name == "mobs_mc:wither" then
|
||||
|
||||
large_mob = true
|
||||
elseif self.name == "mobs_mc:hoglin" or
|
||||
self.name == "mobs_mc:zoglin" or
|
||||
self.name == "mobs_mc:horse" or
|
||||
self.name == "mobs_mc:skeleton_horse" or
|
||||
self.name == "mobs_mc:zombie_horse" or
|
||||
self.name == "mobs_mc:donkey" or
|
||||
self.name == "mobs_mc:mule" or
|
||||
self.name == "mobs_mc:iron_golem" or
|
||||
self.name == "mobs_mc:polar_bear" or
|
||||
self.name == "mobs_mc:spider" or
|
||||
self.name == "mobs_mc:cave_spider" or
|
||||
self.name == "mobs_mc:strider" then
|
||||
|
||||
medium_mob = true
|
||||
end
|
||||
else
|
||||
local near = minetest.find_node_near(pos, 1, "mcl_core:cactus")
|
||||
if near then
|
||||
-- is mob touching the cactus?
|
||||
local dist = vector.distance(pos, near)
|
||||
local threshold = 1.04 -- small mobs
|
||||
-- medium mobs
|
||||
if self.name == "mobs_mc:spider" or
|
||||
self.name == "mobs_mc:iron_golem" or
|
||||
self.name == "mobs_mc:horse" or
|
||||
self.name == "mobs_mc:donkey" or
|
||||
self.name == "mobs_mc:mule" or
|
||||
self.name == "mobs_mc:polar_bear" or
|
||||
self.name == "mobs_mc:cave_spider" or
|
||||
self.name == "mobs_mc:skeleton_horse" or
|
||||
self.name == "mobs_mc:zombie_horse" or
|
||||
self.name == "mobs_mc:strider" or
|
||||
self.name == "mobs_mc:hoglin" or
|
||||
self.name == "mobs_mc:zoglin" then
|
||||
threshold = 1.165
|
||||
elseif self.name == "mobs_mc:slime_big" or
|
||||
self.name == "mobs_mc:magma_cube_big" or
|
||||
self.name == "mobs_mc:ghast" or
|
||||
self.name == "mobs_mc:guardian_elder" or
|
||||
self.name == "mobs_mc:wither" or
|
||||
self.name == "mobs_mc:ender_dragon" then
|
||||
threshold = 1.25
|
||||
end
|
||||
if dist < threshold then
|
||||
if (not large_mob and not medium_mob and (dist < 1.03 or dist_feet < 1.6)) or (medium_mob and (dist < 1.165 or dist_feet < 1.73)) or (large_mob and (dist < 1.25 or dist_feet < 1.9)) then
|
||||
if self.health ~= 0 then
|
||||
self:damage_mob("cactus", 2)
|
||||
if self:check_for_death("cactus", {type = "environment", pos = pos, node = self.standing_in}) then
|
||||
|
||||
if self:check_for_death("cactus", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- is mob standing on the cactus?
|
||||
if self.standing_on == "mcl_core:cactus" or self.standing_in == "mcl_core:cactus" or self.standing_under == "mcl_core:cactus" then
|
||||
self:damage_mob("cactus", 2)
|
||||
|
||||
if self:check_for_death("cactus", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- Drowning damage
|
||||
if self.breath_max ~= -1 then
|
||||
|
@ -927,7 +957,8 @@ end
|
|||
|
||||
-- falling and fall damage
|
||||
-- returns true if mob died
|
||||
function mob_class:falling(pos, moveresult)
|
||||
function mob_class:falling(pos)
|
||||
|
||||
if self.fly and self.state ~= "die" then
|
||||
return
|
||||
end
|
||||
|
@ -950,13 +981,7 @@ function mob_class:falling(pos, moveresult)
|
|||
new_acceleration = vector.new(0, DEFAULT_FALL_SPEED, 0)
|
||||
elseif v.y <= 0 and v.y > self.fall_speed then
|
||||
-- fall downwards at set speed
|
||||
if moveresult and moveresult.touching_ground then
|
||||
-- when touching ground, retain a minimal gravity to keep the touching_ground flag
|
||||
-- but also to not get upwards acceleration with large dtime when on bouncy ground
|
||||
new_acceleration = vector.new(0, self.fall_speed * 0.01, 0)
|
||||
else
|
||||
new_acceleration = vector.new(0, self.fall_speed, 0)
|
||||
end
|
||||
new_acceleration = vector.new(0, self.fall_speed, 0)
|
||||
else
|
||||
-- stop accelerating once max fall speed hit
|
||||
new_acceleration =vector.zero()
|
||||
|
|
|
@ -1,74 +1,74 @@
|
|||
|
||||
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: <https://freesound.org/people/Planman/sounds/208111/>
|
||||
|
||||
------------
|
||||
|
||||
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: 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: <https://freesound.org/people/Planman/sounds/208111/>
|
||||
|
||||
------------
|
||||
|
||||
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
|
||||
|
|
|
@ -10,22 +10,19 @@ local overworld_sky_threshold = tonumber(minetest.settings:get("mcl_mobs_overwor
|
|||
local overworld_passive_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_passive_threshold")) or 7
|
||||
|
||||
local get_node = minetest.get_node
|
||||
local get_item_group = minetest.get_item_group
|
||||
local get_node_light = minetest.get_node_light
|
||||
local find_nodes_in_area_under_air = minetest.find_nodes_in_area_under_air
|
||||
local mt_get_biome_name = minetest.get_biome_name
|
||||
local get_objects_inside_radius = minetest.get_objects_inside_radius
|
||||
local get_connected_players = minetest.get_connected_players
|
||||
local registered_nodes = minetest.registered_nodes
|
||||
|
||||
local math_min = math.min
|
||||
local math_max = math.max
|
||||
local math_random = math.random
|
||||
local math_floor = math.floor
|
||||
local math_ceil = math.ceil
|
||||
local math_cos = math.cos
|
||||
local math_sin = math.sin
|
||||
local math_sqrt = math.sqrt
|
||||
local math_abs = math.abs
|
||||
local math_round = function(x) return (x > 0) and math_floor(x + 0.5) or math_ceil(x - 0.5) end
|
||||
|
||||
local vector_distance = vector.distance
|
||||
local vector_new = vector.new
|
||||
|
@ -35,15 +32,19 @@ local table_copy = table.copy
|
|||
local table_remove = table.remove
|
||||
local pairs = pairs
|
||||
|
||||
local logging = minetest.settings:get_bool("mcl_logging_mobs_spawn", false)
|
||||
local function mcl_log(message, property)
|
||||
if property then message = message .. ": " .. dump(property) end
|
||||
mcl_util.mcl_log(message, "[Mobs spawn]", true)
|
||||
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_mobs_spawning", false)
|
||||
local function mcl_log (message, property)
|
||||
if LOGGING_ON then
|
||||
if property then
|
||||
message = message .. ": " .. dump(property)
|
||||
end
|
||||
mcl_util.mcl_log (message, "[Mobs spawn]", true)
|
||||
end
|
||||
end
|
||||
if not logging then mcl_log = function() end end
|
||||
|
||||
local dbg_spawn_attempts = 0
|
||||
local dbg_spawn_succ = 0
|
||||
local dbg_spawn_counts = {}
|
||||
|
||||
local remove_far = true
|
||||
|
||||
|
@ -52,10 +53,8 @@ local FIND_SPAWN_POS_RETRIES = 16
|
|||
local FIND_SPAWN_POS_RETRIES_SUCCESS_RESPIN = 8
|
||||
|
||||
local MOB_SPAWN_ZONE_INNER = 24
|
||||
local MOB_SPAWN_ZONE_INNER_SQ = MOB_SPAWN_ZONE_INNER^2 -- squared
|
||||
local MOB_SPAWN_ZONE_MIDDLE = 32
|
||||
local MOB_SPAWN_ZONE_OUTER = 128
|
||||
local MOB_SPAWN_ZONE_OUTER_SQ = MOB_SPAWN_ZONE_OUTER^2 -- squared
|
||||
|
||||
-- range for mob count
|
||||
local MOB_CAP_INNER_RADIUS = 32
|
||||
|
@ -95,6 +94,170 @@ mcl_log("Percentage of hostile spawns are group: " .. hostile_group_percentage_s
|
|||
--do mobs spawn?
|
||||
local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false
|
||||
local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false
|
||||
local logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true)
|
||||
|
||||
-- THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs
|
||||
-- Also used for missing parameter
|
||||
-- Please update the list when adding new biomes!
|
||||
|
||||
local list_of_all_biomes = {
|
||||
|
||||
-- underground:
|
||||
|
||||
"FlowerForest_underground",
|
||||
"JungleEdge_underground",
|
||||
"ColdTaiga_underground",
|
||||
"IcePlains_underground",
|
||||
"IcePlainsSpikes_underground",
|
||||
"MegaTaiga_underground",
|
||||
"Taiga_underground",
|
||||
"ExtremeHills+_underground",
|
||||
"JungleM_underground",
|
||||
"ExtremeHillsM_underground",
|
||||
"JungleEdgeM_underground",
|
||||
"MangroveSwamp_underground",
|
||||
|
||||
-- ocean:
|
||||
|
||||
"RoofedForest_ocean",
|
||||
"JungleEdgeM_ocean",
|
||||
"BirchForestM_ocean",
|
||||
"BirchForest_ocean",
|
||||
"IcePlains_deep_ocean",
|
||||
"Jungle_deep_ocean",
|
||||
"Savanna_ocean",
|
||||
"MesaPlateauF_ocean",
|
||||
"ExtremeHillsM_deep_ocean",
|
||||
"Savanna_deep_ocean",
|
||||
"SunflowerPlains_ocean",
|
||||
"Swampland_deep_ocean",
|
||||
"Swampland_ocean",
|
||||
"MegaSpruceTaiga_deep_ocean",
|
||||
"ExtremeHillsM_ocean",
|
||||
"JungleEdgeM_deep_ocean",
|
||||
"SunflowerPlains_deep_ocean",
|
||||
"BirchForest_deep_ocean",
|
||||
"IcePlainsSpikes_ocean",
|
||||
"Mesa_ocean",
|
||||
"StoneBeach_ocean",
|
||||
"Plains_deep_ocean",
|
||||
"JungleEdge_deep_ocean",
|
||||
"SavannaM_deep_ocean",
|
||||
"Desert_deep_ocean",
|
||||
"Mesa_deep_ocean",
|
||||
"ColdTaiga_deep_ocean",
|
||||
"Plains_ocean",
|
||||
"MesaPlateauFM_ocean",
|
||||
"Forest_deep_ocean",
|
||||
"JungleM_deep_ocean",
|
||||
"FlowerForest_deep_ocean",
|
||||
"MushroomIsland_ocean",
|
||||
"MegaTaiga_ocean",
|
||||
"StoneBeach_deep_ocean",
|
||||
"IcePlainsSpikes_deep_ocean",
|
||||
"ColdTaiga_ocean",
|
||||
"SavannaM_ocean",
|
||||
"MesaPlateauF_deep_ocean",
|
||||
"MesaBryce_deep_ocean",
|
||||
"ExtremeHills+_deep_ocean",
|
||||
"ExtremeHills_ocean",
|
||||
"MushroomIsland_deep_ocean",
|
||||
"Forest_ocean",
|
||||
"MegaTaiga_deep_ocean",
|
||||
"JungleEdge_ocean",
|
||||
"MesaBryce_ocean",
|
||||
"MegaSpruceTaiga_ocean",
|
||||
"ExtremeHills+_ocean",
|
||||
"Jungle_ocean",
|
||||
"RoofedForest_deep_ocean",
|
||||
"IcePlains_ocean",
|
||||
"FlowerForest_ocean",
|
||||
"ExtremeHills_deep_ocean",
|
||||
"MesaPlateauFM_deep_ocean",
|
||||
"Desert_ocean",
|
||||
"Taiga_ocean",
|
||||
"BirchForestM_deep_ocean",
|
||||
"Taiga_deep_ocean",
|
||||
"JungleM_ocean",
|
||||
"MangroveSwamp_ocean",
|
||||
"MangroveSwamp_deep_ocean",
|
||||
|
||||
-- water or beach?
|
||||
|
||||
"MesaPlateauFM_sandlevel",
|
||||
"MesaPlateauF_sandlevel",
|
||||
"MesaBryce_sandlevel",
|
||||
"Mesa_sandlevel",
|
||||
|
||||
-- beach:
|
||||
|
||||
"FlowerForest_beach",
|
||||
"Forest_beach",
|
||||
"StoneBeach",
|
||||
"ColdTaiga_beach_water",
|
||||
"Taiga_beach",
|
||||
"Savanna_beach",
|
||||
"Plains_beach",
|
||||
"ExtremeHills_beach",
|
||||
"ColdTaiga_beach",
|
||||
"Swampland_shore",
|
||||
"MushroomIslandShore",
|
||||
"JungleM_shore",
|
||||
"Jungle_shore",
|
||||
"BambooJungleM_shore",
|
||||
"BambooJungle_shore",
|
||||
"MangroveSwamp_shore",
|
||||
|
||||
-- dimension biome:
|
||||
|
||||
"Nether",
|
||||
"BasaltDelta",
|
||||
"CrimsonForest",
|
||||
"WarpedForest",
|
||||
"SoulsandValley",
|
||||
"End",
|
||||
|
||||
-- Overworld regular:
|
||||
|
||||
"Mesa",
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"ExtremeHillsM",
|
||||
"ExtremeHills+_snowtop",
|
||||
"Jungle",
|
||||
"Savanna",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"Desert",
|
||||
"ColdTaiga",
|
||||
"MushroomIsland",
|
||||
"IcePlainsSpikes",
|
||||
"SunflowerPlains",
|
||||
"IcePlains",
|
||||
"RoofedForest",
|
||||
"ExtremeHills+_snowtop",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"JungleEdgeM",
|
||||
"JungleM",
|
||||
"BirchForestM",
|
||||
"MesaPlateauF",
|
||||
"MesaPlateauFM",
|
||||
"MesaPlateauF_grasstop",
|
||||
"MesaBryce",
|
||||
"JungleEdge",
|
||||
"SavannaM",
|
||||
"MangroveSwamp",
|
||||
"BambooJungle",
|
||||
"BambooJungleEdge",
|
||||
"BambooJungleEdgeM",
|
||||
"BambooJungleM",
|
||||
}
|
||||
|
||||
-- count how many mobs are in an area
|
||||
local function count_mobs(pos,r,mob_type)
|
||||
|
@ -123,7 +286,11 @@ local function count_mobs_total(mob_type)
|
|||
end
|
||||
|
||||
local function count_mobs_add_entry (mobs_list, mob_cat)
|
||||
mobs_list[mob_cat] = (mobs_list[mob_cat] or 0) + 1
|
||||
if mobs_list[mob_cat] then
|
||||
mobs_list[mob_cat] = mobs_list[mob_cat] + 1
|
||||
else
|
||||
mobs_list[mob_cat] = 1
|
||||
end
|
||||
end
|
||||
|
||||
--categorise_by can be name or type or spawn_class
|
||||
|
@ -282,7 +449,7 @@ function mcl_mobs:spawn_setup(def)
|
|||
|
||||
local dimension = def.dimension or "overworld"
|
||||
local type_of_spawning = def.type_of_spawning or "ground"
|
||||
local biomes = def.biomes or nil
|
||||
local biomes = def.biomes or list_of_all_biomes
|
||||
local min_light = def.min_light or 0
|
||||
local max_light = def.max_light or (minetest.LIGHT_MAX + 1)
|
||||
local chance = def.chance or 1000
|
||||
|
@ -397,9 +564,6 @@ 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)
|
||||
|
||||
|
@ -431,91 +595,35 @@ 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
|
||||
|
||||
local two_pi = 2 * math.pi
|
||||
local function get_next_mob_spawn_pos(pos)
|
||||
-- Select a distance such that distances closer to the player are selected much more often than
|
||||
-- those further away from the player. This does produce a concentration at INNER (24 blocks)
|
||||
local distance = math_random()^2 * (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 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
|
||||
|
||||
-- Choose a random direction. Rejection sampling is simple and fast (1-2 tries usually)
|
||||
local xoff, yoff, zoff, dd
|
||||
repeat
|
||||
xoff, yoff, zoff = math_random() * 2 - 1, math_random() * 2 - 1, math_random() * 2 - 1
|
||||
dd = xoff*xoff + yoff*yoff + zoff*zoff
|
||||
until (dd <= 1 and dd >= 1e-6) -- outside of uniform ball, retry
|
||||
dd = distance / math_sqrt(dd) -- distance scaling factor
|
||||
xoff, yoff, zoff = xoff * dd, yoff * dd, zoff * dd
|
||||
local goal_pos = vector.offset(pos, xoff, yoff, zoff)
|
||||
-- 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
|
||||
|
||||
if not (math_abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math_abs(goal_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 d2 = xoff*xoff + zoff*zoff -- squared distance in x,z plane only
|
||||
local y1 = math_sqrt(MOB_SPAWN_ZONE_OUTER_SQ - d2) -- absolue value of distance to outer sphere
|
||||
|
||||
local y_min, y_max
|
||||
if d2 >= MOB_SPAWN_ZONE_INNER_SQ 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 y2 = math_sqrt(MOB_SPAWN_ZONE_INNER_SQ - d2)
|
||||
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
|
||||
-- Limit total range of check to 32 nodes (maximum of 3 map blocks)
|
||||
y_min = math_max(math_floor(y_min), goal_pos.y - 16)
|
||||
y_max = math_min(math_ceil(y_max), goal_pos.y + 16)
|
||||
|
||||
-- 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)]
|
||||
local function decypher_limits(posy)
|
||||
posy = math_floor(posy)
|
||||
return posy - MOB_SPAWN_ZONE_MIDDLE, posy + MOB_SPAWN_ZONE_MIDDLE
|
||||
end
|
||||
|
||||
--a simple helper function for mob_spawn
|
||||
local function biome_check(biome_list, biome_goal)
|
||||
if not biome_goal then return false end
|
||||
for _, data in pairs(biome_list) do
|
||||
if data == biome_goal then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -530,8 +638,8 @@ local function get_water_spawn(p)
|
|||
end
|
||||
end
|
||||
|
||||
local function has_room(self, pos)
|
||||
local cb = self.spawnbox or self.collisionbox
|
||||
local function has_room(self,pos)
|
||||
local cb = self.collisionbox
|
||||
local nodes = {}
|
||||
if self.fly_in then
|
||||
local t = type(self.fly_in)
|
||||
|
@ -542,74 +650,18 @@ local function has_room(self, pos)
|
|||
end
|
||||
end
|
||||
table.insert(nodes,"air")
|
||||
|
||||
-- Calculate area to check for room
|
||||
local cb_height = cb[5] - cb[2]
|
||||
local p1 = vector.new(
|
||||
math.round(pos.x + cb[1]),
|
||||
math.floor(pos.y),
|
||||
math.round(pos.z + cb[3]))
|
||||
local p2 = vector.new(
|
||||
math.round(pos.x + cb[4]),
|
||||
math.ceil(p1.y + cb_height) - 1,
|
||||
math.round(pos.z + cb[6]))
|
||||
|
||||
-- Check if the entire spawn volume is free
|
||||
local dx = p2.x - p1.x + 1
|
||||
local dy = p2.y - p1.y + 1
|
||||
local dz = p2.z - p1.z + 1
|
||||
local found_nodes = minetest.find_nodes_in_area(p1,p2,nodes) or 0
|
||||
local n = #found_nodes
|
||||
if n == dx * dy * dz then
|
||||
return true
|
||||
local x = cb[4] - cb[1]
|
||||
local y = cb[5] - cb[2]
|
||||
local z = cb[6] - cb[3]
|
||||
local r = math.ceil(x * y * z)
|
||||
local p1 = vector.offset(pos,cb[1],cb[2],cb[3])
|
||||
local p2 = vector.offset(pos,cb[4],cb[5],cb[6])
|
||||
local n = #minetest.find_nodes_in_area(p1,p2,nodes) or 0
|
||||
if r > n then
|
||||
minetest.log("warning","[mcl_mobs] No room for mob "..self.name.." at "..minetest.pos_to_string(vector.round(pos)))
|
||||
return false
|
||||
end
|
||||
|
||||
-- If we don't have an implementation of get_node_boxes, we can't check for sub-node space
|
||||
if not minetest.get_node_boxes then return false end
|
||||
|
||||
-- Check if it's possible for a sub-node space check to succeed
|
||||
local needed_in_bottom_section = dx * ( dy - 1) * dz
|
||||
if n < needed_in_bottom_section then return false end
|
||||
|
||||
-- Make sure the entire volume except for the top level is free before checking the top layer
|
||||
if dy > 1 then
|
||||
-- Remove nodes in the top layer from the count
|
||||
for i = 1,#found_nodes do
|
||||
if found_nodes[i].y == p2.y then
|
||||
n = n - 1
|
||||
end
|
||||
end
|
||||
|
||||
-- If the entire volume except the top layer isn't air (or nodes) then we can't spawn this mob here
|
||||
if n < needed_in_bottom_section then return false end
|
||||
end
|
||||
|
||||
-- Check the top layer to see if we have enough space to spawn in
|
||||
local top_layer_height = 1
|
||||
local processed = {}
|
||||
for x = p1.x,p2.x do
|
||||
for z = p1.z,p2.z do
|
||||
local test_pos = vector.new(x,p2.y,z)
|
||||
local node = minetest.get_node(test_pos) or { name = "ignore" }
|
||||
local cache_name = string.format("%s-%d", node.name, node.param2)
|
||||
if not processed[cache_name] then
|
||||
-- Calculate node bounding box and select the lowest y value
|
||||
local boxes = minetest.get_node_boxes("collision_box", test_pos, node)
|
||||
for i = 1,#boxes do
|
||||
local box = boxes[i]
|
||||
local y_test = box[2] + 0.5
|
||||
if y_test < top_layer_height then top_layer_height = y_test end
|
||||
|
||||
local y_test = box[5] + 0.5
|
||||
if y_test < top_layer_height then top_layer_height = y_test end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if top_layer_height + dy - 1 >= cb_height then return true end
|
||||
|
||||
-- We don't have room
|
||||
return false
|
||||
return true
|
||||
end
|
||||
|
||||
mcl_mobs.custom_biomecheck = nil
|
||||
|
@ -618,92 +670,119 @@ function mcl_mobs.register_custom_biomecheck(custom_biomecheck)
|
|||
mcl_mobs.custom_biomecheck = custom_biomecheck
|
||||
end
|
||||
|
||||
|
||||
local function get_biome_name(pos)
|
||||
if mcl_mobs.custom_biomecheck then return mcl_mobs.custom_biomecheck(pos) end
|
||||
local gotten_biome = minetest.get_biome_data(pos)
|
||||
return gotten_biome and mt_get_biome_name(gotten_biome.biome)
|
||||
if mcl_mobs.custom_biomecheck then
|
||||
return mcl_mobs.custom_biomecheck (pos)
|
||||
else
|
||||
local gotten_biome = minetest.get_biome_data(pos)
|
||||
|
||||
if not gotten_biome then
|
||||
return
|
||||
end
|
||||
|
||||
gotten_biome = mt_get_biome_name(gotten_biome.biome)
|
||||
--minetest.log ("biome: " .. dump(gotten_biome))
|
||||
|
||||
return gotten_biome
|
||||
end
|
||||
end
|
||||
|
||||
local function spawn_check(pos, spawn_def)
|
||||
if not spawn_def or not pos then return end
|
||||
|
||||
dbg_spawn_attempts = dbg_spawn_attempts + 1
|
||||
|
||||
local dimension = mcl_worlds.pos_to_dimension(pos)
|
||||
if spawn_def.dimension ~= dimension then return end -- wrong dimension
|
||||
-- find ground node below spawn position
|
||||
local node_name = get_node(pos).name
|
||||
local node_def = registered_nodes[node_name]
|
||||
if node_def and not node_def.groups.solid then -- try node one below instead
|
||||
pos.y = pos.y - 1
|
||||
node_name = get_node(pos).name
|
||||
node_def = registered_nodes[node_name]
|
||||
end
|
||||
if not node_def or not node_def.groups then return end
|
||||
-- do not spawn on bedrock
|
||||
if node_name == "mcl_core:bedrock" then return end
|
||||
pos.y = pos.y + 1
|
||||
-- check spawn height
|
||||
if pos.y < spawn_def.min_height or pos.y > spawn_def.max_height then return end
|
||||
mcl_log("spawn_check#1 position checks passed")
|
||||
|
||||
-- do not spawn ground mobs on leaves
|
||||
if spawn_def.type_of_spawning == "ground" and (not node_def.groups.solid or node_def.groups.leaves) then return end
|
||||
-- water mobs only on water
|
||||
if spawn_def.type_of_spawning == "water" and not node_def.groups.water then return end
|
||||
-- lava mobs only on lava
|
||||
if spawn_def.type_of_spawning == "lava" and not node_def.groups.lava then return end
|
||||
-- farm animals on grass only
|
||||
if is_farm_animal(spawn_def.name) and not node_def.groups.grass_block then return end
|
||||
|
||||
---- More expensive calls:
|
||||
-- check the biome
|
||||
if spawn_def.biomes and not biome_check(spawn_def.biomes, get_biome_name(pos)) then return end
|
||||
-- check if there is enough room
|
||||
local mob_def = minetest.registered_entities[spawn_def.name]
|
||||
if not has_room(mob_def,pos) then return end
|
||||
-- additional checks (slime etc.)
|
||||
if spawn_def.check_position and not spawn_def.check_position(pos) then return end
|
||||
if spawn_protected and minetest.is_protected(pos, "") then return end
|
||||
mcl_log("spawn_check#2 advanced checks passed")
|
||||
local mob_type = mob_def.type
|
||||
local gotten_node = get_node(pos).name
|
||||
if not gotten_node then return end
|
||||
|
||||
-- check light thresholds
|
||||
local gotten_light = get_node_light(pos)
|
||||
-- old lighting
|
||||
if not modern_lighting then return gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light end
|
||||
local biome_name = get_biome_name(pos)
|
||||
if not biome_name then return end
|
||||
|
||||
local sky_light = minetest.get_natural_light(pos)
|
||||
local art_light = minetest.get_artificial_light(get_node(pos).param1)
|
||||
if mob_def.spawn_check then
|
||||
return mob_def.spawn_check(pos, gotten_light, art_light, sky_light)
|
||||
local is_ground = minetest.get_item_group(gotten_node,"solid") ~= 0
|
||||
if not is_ground then
|
||||
pos.y = pos.y - 1
|
||||
gotten_node = get_node(pos).name
|
||||
is_ground = minetest.get_item_group(gotten_node,"solid") ~= 0
|
||||
end
|
||||
if mob_def.type == "monster" then
|
||||
if dimension == "nether" then
|
||||
if art_light <= nether_threshold then
|
||||
return true
|
||||
end
|
||||
elseif dimension == "end" then
|
||||
if art_light <= end_threshold then
|
||||
return true
|
||||
end
|
||||
elseif dimension == "overworld" then
|
||||
if art_light <= overworld_threshold and sky_light <= overworld_sky_threshold then
|
||||
return true
|
||||
pos.y = pos.y + 1
|
||||
local is_water = get_item_group(gotten_node, "water") ~= 0
|
||||
local is_lava = get_item_group(gotten_node, "lava") ~= 0
|
||||
local is_leaf = get_item_group(gotten_node, "leaves") ~= 0
|
||||
local is_bedrock = gotten_node == "mcl_core:bedrock"
|
||||
local is_grass = minetest.get_item_group(gotten_node,"grass_block") ~= 0
|
||||
|
||||
if pos.y >= spawn_def.min_height
|
||||
and pos.y <= spawn_def.max_height
|
||||
and spawn_def.dimension == dimension
|
||||
and biome_check(spawn_def.biomes, biome_name) then
|
||||
|
||||
mcl_log("Spawn level 1 check - Passed")
|
||||
if (is_ground or spawn_def.type_of_spawning ~= "ground")
|
||||
and (spawn_def.type_of_spawning ~= "ground" or not is_leaf)
|
||||
and (not is_farm_animal(spawn_def.name) or is_grass)
|
||||
and (spawn_def.type_of_spawning ~= "water" or is_water)
|
||||
and not is_bedrock
|
||||
and has_room(mob_def,pos)
|
||||
and (spawn_def.check_position and spawn_def.check_position(pos) or spawn_def.check_position == nil)
|
||||
and ( not spawn_protected or not minetest.is_protected(pos, "") ) then
|
||||
|
||||
mcl_log("Spawn level 2 check - Passed")
|
||||
local gotten_light = get_node_light(pos)
|
||||
|
||||
if modern_lighting then
|
||||
local my_node = get_node(pos)
|
||||
local sky_light = minetest.get_natural_light(pos)
|
||||
local art_light = minetest.get_artificial_light(my_node.param1)
|
||||
|
||||
if mob_def.spawn_check then
|
||||
return mob_def.spawn_check(pos, gotten_light, art_light, sky_light)
|
||||
elseif mob_type == "monster" then
|
||||
if dimension == "nether" then
|
||||
if art_light <= nether_threshold then
|
||||
return true
|
||||
end
|
||||
elseif dimension == "end" then
|
||||
if art_light <= end_threshold then
|
||||
return true
|
||||
end
|
||||
elseif dimension == "overworld" then
|
||||
if art_light <= overworld_threshold and sky_light <= overworld_sky_threshold then
|
||||
return true
|
||||
end
|
||||
end
|
||||
else
|
||||
-- passive threshold is apparently the same in all dimensions ...
|
||||
if gotten_light > overworld_passive_threshold then
|
||||
return true
|
||||
end
|
||||
end
|
||||
else
|
||||
if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
-- passive threshold is apparently the same in all dimensions ...
|
||||
return gotten_light > overworld_passive_threshold
|
||||
return false
|
||||
end
|
||||
|
||||
function mcl_mobs.spawn(pos,id)
|
||||
if not pos or not id then return false end
|
||||
local def = minetest.registered_entities[id] or minetest.registered_entities["mobs_mc:"..id] or minetest.registered_entities["extra_mobs:"..id]
|
||||
if not def or not def.is_mob or (def.can_spawn and not def.can_spawn(pos)) then return false end
|
||||
if not has_room(def, pos) then return false end
|
||||
if not def or (def.can_spawn and not def.can_spawn(pos)) or not def.is_mob then
|
||||
return false
|
||||
end
|
||||
if not dbg_spawn_counts[def.name] then
|
||||
dbg_spawn_counts[def.name] = 1
|
||||
else
|
||||
dbg_spawn_counts[def.name] = dbg_spawn_counts[def.name] + 1
|
||||
end
|
||||
return minetest.add_entity(pos, def.name)
|
||||
end
|
||||
|
||||
|
||||
local function spawn_group(p,mob,spawn_on,amount_to_spawn)
|
||||
local nn= minetest.find_nodes_in_area_under_air(vector.offset(p,-5,-3,-5),vector.offset(p,5,3,5),spawn_on)
|
||||
local o
|
||||
|
@ -820,7 +899,7 @@ if mobs_spawn then
|
|||
mob_total_wide = 0
|
||||
end
|
||||
|
||||
local cap_space_wide = math_max(type_cap - mob_total_wide, 0)
|
||||
local cap_space_wide = math.max(type_cap - mob_total_wide, 0)
|
||||
|
||||
mcl_log("mob_type", mob_type)
|
||||
mcl_log("cap_space_wide", cap_space_wide)
|
||||
|
@ -828,10 +907,10 @@ if mobs_spawn then
|
|||
local cap_space_available = 0
|
||||
if mob_type == "hostile" then
|
||||
mcl_log("cap_space_global", cap_space_hostile)
|
||||
cap_space_available = math_min(cap_space_hostile, cap_space_wide)
|
||||
cap_space_available = math.min(cap_space_hostile, cap_space_wide)
|
||||
else
|
||||
mcl_log("cap_space_global", cap_space_non_hostile)
|
||||
cap_space_available = math_min(cap_space_non_hostile, cap_space_wide)
|
||||
cap_space_available = math.min(cap_space_non_hostile, cap_space_wide)
|
||||
end
|
||||
|
||||
local mob_total_close = mob_counts_close[mob_type]
|
||||
|
@ -840,8 +919,8 @@ if mobs_spawn then
|
|||
mob_total_close = 0
|
||||
end
|
||||
|
||||
local cap_space_close = math_max(close_zone_cap - mob_total_close, 0)
|
||||
cap_space_available = math_min(cap_space_available, cap_space_close)
|
||||
local cap_space_close = math.max(close_zone_cap - mob_total_close, 0)
|
||||
cap_space_available = math.min(cap_space_available, cap_space_close)
|
||||
|
||||
mcl_log("cap_space_close", cap_space_close)
|
||||
mcl_log("cap_space_available", cap_space_available)
|
||||
|
@ -859,16 +938,42 @@ if mobs_spawn then
|
|||
|
||||
local function find_spawning_position(pos, max_times)
|
||||
local spawning_position
|
||||
local max_loops = max_times or 1
|
||||
|
||||
local max_loops = 1
|
||||
if max_times then max_loops = max_times end
|
||||
|
||||
local y_min, y_max = decypher_limits(pos.y)
|
||||
|
||||
--mcl_log("mapgen_limit: " .. SPAWN_MAPGEN_LIMIT)
|
||||
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
|
||||
local i = 0
|
||||
repeat
|
||||
local goal_pos = get_next_mob_spawn_pos(pos)
|
||||
|
||||
end
|
||||
return nil
|
||||
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
|
||||
|
||||
local cumulative_chance = nil
|
||||
|
@ -968,7 +1073,7 @@ if mobs_spawn then
|
|||
|
||||
local amount_to_spawn = math.random(group_min, spawn_in_group)
|
||||
mcl_log("Spawning quantity: " .. amount_to_spawn)
|
||||
amount_to_spawn = math_min(amount_to_spawn, cap_space_available)
|
||||
amount_to_spawn = math.min(amount_to_spawn, cap_space_available)
|
||||
mcl_log("throttled spawning quantity: " .. amount_to_spawn)
|
||||
|
||||
if logging then
|
||||
|
@ -1019,8 +1124,8 @@ if mobs_spawn then
|
|||
local players = get_connected_players()
|
||||
local total_mobs, total_non_hostile, total_hostile = count_mobs_total_cap()
|
||||
|
||||
local cap_space_hostile = math_max(mob_cap.global_hostile - total_hostile, 0)
|
||||
local cap_space_non_hostile = math_max(mob_cap.global_non_hostile - total_non_hostile, 0)
|
||||
local cap_space_hostile = math.max(mob_cap.global_hostile - total_hostile, 0)
|
||||
local cap_space_non_hostile = math.max(mob_cap.global_non_hostile - total_non_hostile, 0)
|
||||
mcl_log("global cap_space_hostile", cap_space_hostile)
|
||||
mcl_log("global cap_space_non_hostile", cap_space_non_hostile)
|
||||
|
||||
|
@ -1094,9 +1199,11 @@ function mob_class:check_despawn(pos, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
minetest.register_chatcommand("mobstats",{
|
||||
privs = { debug = true },
|
||||
func = function(n,param)
|
||||
--minetest.chat_send_player(n,dump(dbg_spawn_counts))
|
||||
local pos = minetest.get_player_by_name(n):get_pos()
|
||||
minetest.chat_send_player(n,"mobs: within 32 radius of player/total loaded :"..count_mobs(pos,MOB_CAP_INNER_RADIUS) .. "/" .. count_mobs_total())
|
||||
minetest.chat_send_player(n,"spawning attempts since server start:" .. dbg_spawn_succ .. "/" .. dbg_spawn_attempts)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_wither_spawning
|
||||
description = Wither Spawning for VoxeLibre
|
||||
description = Wither Spawning for MineClone2
|
||||
author = Fleckenstein
|
||||
depends = mobs_mc, mcl_heads
|
||||
|
|
|
@ -33,11 +33,11 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers
|
|||
* Husk
|
||||
* Skeleton
|
||||
* Stray
|
||||
* Stalker
|
||||
* Creeper
|
||||
* Slime
|
||||
* Spider
|
||||
* Cave Spider
|
||||
* Rover
|
||||
* Enderman
|
||||
* Zombie Villager
|
||||
* Zombie Piglin
|
||||
* Wither Skeleton
|
||||
|
|
|
@ -72,24 +72,18 @@ local axolotl = {
|
|||
fly = true,
|
||||
fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" },
|
||||
breathes_in_water = true,
|
||||
jump = false, -- would get them out of the water too often
|
||||
jump = true,
|
||||
damage = 2,
|
||||
reach = 2,
|
||||
attack_type = "dogfight",
|
||||
attack_animals = true,
|
||||
specific_attack = {
|
||||
"mobs_mc:cod",
|
||||
"mobs_mc:glow_squid",
|
||||
"mobs_mc:salmon",
|
||||
"mobs_mc:tropical_fish",
|
||||
"mobs_mc:squid",
|
||||
"mobs_mc:zombie", -- todo: only drowned?
|
||||
"mobs_mc:baby_zombie",
|
||||
"mobs_mc:husk",
|
||||
"mobs_mc:baby_husk",
|
||||
"mobs_mc:guardian_elder",
|
||||
"mobs_mc:guardian",
|
||||
},
|
||||
"extra_mobs_cod",
|
||||
"extra_mobs_glow_squid",
|
||||
"extra_mobs_salmon",
|
||||
"extra_mobs_tropical_fish",
|
||||
"mobs_mc_squid"
|
||||
},
|
||||
runaway = true,
|
||||
}
|
||||
|
||||
|
|
|
@ -95,8 +95,8 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
|
|||
end
|
||||
local pos = self.object:get_pos()
|
||||
minetest.add_particle({
|
||||
pos = {x=pos.x+(math.random()*0.7-0.35)*math.random(),y=pos.y+0.7+math.random()*0.5,z=pos.z+(math.random()*0.7-0.35)*math.random()},
|
||||
velocity = {x=0, y=1, z=0},
|
||||
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2},
|
||||
velocity = {x=0, y=math.random(1,1), z=0},
|
||||
expirationtime = math.random(),
|
||||
size = math.random(1, 4),
|
||||
collisiondetection = true,
|
||||
|
@ -110,8 +110,8 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
|
|||
},
|
||||
})
|
||||
minetest.add_particle({
|
||||
pos = {x=pos.x+(math.random()*0.7-0.35)*math.random(),y=pos.y+0.7+math.random()*0.5,z=pos.z+(math.random()*0.7-0.35)*math.random()},
|
||||
velocity = {x=0, y=1, z=0},
|
||||
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2},
|
||||
velocity = {x=0, y=math.random(1,1), z=0},
|
||||
expirationtime = math.random(),
|
||||
size = math.random(1, 4),
|
||||
collisiondetection = true,
|
||||
|
@ -125,8 +125,8 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
|
|||
},
|
||||
})
|
||||
minetest.add_particle({
|
||||
pos = {x=pos.x+(math.random()*0.7-0.35)*math.random(),y=pos.y+0.7+math.random()*0.5,z=pos.z+(math.random()*0.7-0.35)*math.random()},
|
||||
velocity = {x=0, y=1, z=0},
|
||||
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2},
|
||||
velocity = {x=0, y=math.random(1,1), z=0},
|
||||
expirationtime = math.random(),
|
||||
size = math.random(1, 4),
|
||||
collisiondetection = true,
|
||||
|
|
|
@ -84,7 +84,7 @@ local cod = {
|
|||
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
|
||||
if minetest.get_item_group(self.standing_in, "water") ~= 0 then
|
||||
if self.object:get_velocity().y < 5 then
|
||||
self.object:add_velocity({ x = 0 , y = math.random()*.014-.007, z = 0 })
|
||||
self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 })
|
||||
end
|
||||
end
|
||||
--]]
|
||||
|
|
|
@ -122,7 +122,6 @@ 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
|
||||
|
|
|
@ -3,66 +3,14 @@
|
|||
local S = minetest.get_translator("mobs_mc")
|
||||
|
||||
--###################
|
||||
--################### STALKER
|
||||
--################### CREEPER
|
||||
--###################
|
||||
|
||||
|
||||
local function get_texture(self, prev)
|
||||
local standing_on = minetest.registered_nodes[self.standing_on]
|
||||
-- TODO: we do not have access to param2 here (color palette index) yet
|
||||
local texture
|
||||
local texture_suff = ""
|
||||
if standing_on and (standing_on.walkable or standing_on.groups.liquid) then
|
||||
local tiles = standing_on.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(standing_on.color)
|
||||
end
|
||||
if color then
|
||||
texture_suff = "^[multiply:" .. color .. "^[hsl:0:0:20"
|
||||
end
|
||||
end
|
||||
end
|
||||
if not texture or texture == "" then
|
||||
-- try to keep last texture when, e.g., falling
|
||||
if prev and (not (not self.attack)) == (string.find(prev, "vl_mobs_stalker_overlay_angry.png") ~= nil) then
|
||||
return prev
|
||||
end
|
||||
texture = "vl_stalker_default.png"
|
||||
else
|
||||
texture = texture:gsub("([\\^:\\[])", "\\%1") -- escape texture modifiers
|
||||
texture = "(vl_stalker_default.png^[combine:16x24:0,0=(" .. texture .. "):0,16=(" .. texture .. ")" .. texture_suff .. ")"
|
||||
end
|
||||
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:stalker", {
|
||||
description = S("Stalker"),
|
||||
mcl_mobs.register_mob("mobs_mc:creeper", {
|
||||
description = S("Creeper"),
|
||||
type = "monster",
|
||||
spawn_class = "hostile",
|
||||
spawn_in_group = 1,
|
||||
|
@ -73,16 +21,16 @@ mcl_mobs.register_mob("mobs_mc:stalker", {
|
|||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3},
|
||||
pathfinding = 1,
|
||||
visual = "mesh",
|
||||
mesh = "vl_stalker.b3d",
|
||||
-- head_swivel = "Head_Control",
|
||||
mesh = "mobs_mc_creeper.b3d",
|
||||
head_swivel = "Head_Control",
|
||||
bone_eye_height = 2.35,
|
||||
head_eye_height = 1.8;
|
||||
curiosity = 2,
|
||||
textures = {
|
||||
{get_texture({}),
|
||||
{"mobs_mc_creeper.png",
|
||||
"mobs_mc_empty.png"},
|
||||
},
|
||||
visual_size = {x=2, y=2},
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {
|
||||
attack = "tnt_ignite",
|
||||
death = "mobs_mc_creeper_death",
|
||||
|
@ -108,8 +56,8 @@ mcl_mobs.register_mob("mobs_mc:stalker", {
|
|||
allow_fuse_reset = true,
|
||||
stop_to_explode = true,
|
||||
|
||||
-- Force-ignite stalker with flint and steel and explode after 1.5 seconds.
|
||||
-- TODO: Make stalker flash after doing this as well.
|
||||
-- Force-ignite creeper with flint and steel and explode after 1.5 seconds.
|
||||
-- TODO: Make creeper flash after doing this as well.
|
||||
-- TODO: Test and debug this code.
|
||||
on_rightclick = function(self, clicker)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
|
@ -138,11 +86,6 @@ mcl_mobs.register_mob("mobs_mc:stalker", {
|
|||
self:boom(mcl_util.get_object_center(self.object), self.explosion_strength)
|
||||
end
|
||||
end
|
||||
local new_texture = get_texture(self, self._stalker_texture)
|
||||
if self._stalker_texture ~= new_texture then
|
||||
self.object:set_properties({textures={new_texture, "mobs_mc_empty.png"}})
|
||||
self._stalker_texture = new_texture
|
||||
end
|
||||
end,
|
||||
on_die = function(self, pos, cmi_cause)
|
||||
-- Drop a random music disc when killed by skeleton or stray
|
||||
|
@ -165,42 +108,35 @@ mcl_mobs.register_mob("mobs_mc:stalker", {
|
|||
looting = "common",},
|
||||
|
||||
-- Head
|
||||
-- TODO: Only drop if killed by charged stalker
|
||||
{name = "mcl_heads:stalker",
|
||||
-- TODO: Only drop if killed by charged creeper
|
||||
{name = "mcl_heads:creeper",
|
||||
chance = 200, -- 0.5%
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 30,
|
||||
speed_run = 60,
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
run_start = 24,
|
||||
run_end = 49,
|
||||
fuse_start = 49,
|
||||
fuse_end = 80,
|
||||
hurt_start = 110,
|
||||
hurt_end = 139,
|
||||
death_start = 140,
|
||||
death_end = 189,
|
||||
look_start = 50,
|
||||
look_end = 108,
|
||||
},
|
||||
floats = 1,
|
||||
fear_height = 4,
|
||||
view_range = 16,
|
||||
})
|
||||
|
||||
_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"),
|
||||
mcl_mobs.register_mob("mobs_mc:creeper_charged", {
|
||||
description = S("Charged Creeper"),
|
||||
type = "monster",
|
||||
spawn_class = "hostile",
|
||||
hp_min = 20,
|
||||
|
@ -210,16 +146,15 @@ mcl_mobs.register_mob("mobs_mc:stalker_overloaded", {
|
|||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3},
|
||||
pathfinding = 1,
|
||||
visual = "mesh",
|
||||
mesh = "vl_stalker.b3d",
|
||||
mesh = "mobs_mc_creeper.b3d",
|
||||
|
||||
--BOOM
|
||||
|
||||
textures = {
|
||||
{get_texture({}),
|
||||
AURA},
|
||||
{"mobs_mc_creeper.png",
|
||||
"mobs_mc_creeper_charge.png"},
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
visual_size = {x=2, y=2},
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {
|
||||
attack = "tnt_ignite",
|
||||
death = "mobs_mc_creeper_death",
|
||||
|
@ -243,8 +178,8 @@ mcl_mobs.register_mob("mobs_mc:stalker_overloaded", {
|
|||
allow_fuse_reset = true,
|
||||
stop_to_explode = true,
|
||||
|
||||
-- Force-ignite stalker with flint and steel and explode after 1.5 seconds.
|
||||
-- TODO: Make stalker flash after doing this as well.
|
||||
-- Force-ignite creeper with flint and steel and explode after 1.5 seconds.
|
||||
-- TODO: Make creeper flash after doing this as well.
|
||||
-- TODO: Test and debug this code.
|
||||
on_rightclick = function(self, clicker)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
|
@ -273,9 +208,6 @@ mcl_mobs.register_mob("mobs_mc:stalker_overloaded", {
|
|||
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
|
||||
|
@ -290,7 +222,7 @@ mcl_mobs.register_mob("mobs_mc:stalker_overloaded", {
|
|||
end
|
||||
end,
|
||||
on_lightning_strike = function(self, pos, pos2, objects)
|
||||
mcl_util.replace_mob(self.object, "mobs_mc:stalker_overloaded")
|
||||
mcl_util.replace_mob(self.object, "mobs_mc:creeper_charged")
|
||||
return true
|
||||
end,
|
||||
maxdrops = 2,
|
||||
|
@ -302,23 +234,27 @@ mcl_mobs.register_mob("mobs_mc:stalker_overloaded", {
|
|||
looting = "common",},
|
||||
|
||||
-- Head
|
||||
-- TODO: Only drop if killed by overloaded stalker
|
||||
{name = "mcl_heads:stalker",
|
||||
-- TODO: Only drop if killed by charged creeper
|
||||
{name = "mcl_heads:creeper",
|
||||
chance = 200, -- 0.5%
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 30,
|
||||
speed_run = 60,
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
run_start = 24,
|
||||
run_end = 49,
|
||||
fuse_start = 49,
|
||||
fuse_end = 80,
|
||||
hurt_start = 110,
|
||||
hurt_end = 139,
|
||||
death_start = 140,
|
||||
death_end = 189,
|
||||
look_start = 50,
|
||||
look_end = 108,
|
||||
},
|
||||
floats = 1,
|
||||
fear_height = 4,
|
||||
|
@ -326,25 +262,10 @@ mcl_mobs.register_mob("mobs_mc:stalker_overloaded", {
|
|||
--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:stalker",
|
||||
"mobs_mc:creeper",
|
||||
"overworld",
|
||||
"ground",
|
||||
{
|
||||
|
@ -492,6 +413,4 @@ mcl_vars.mg_overworld_min,
|
|||
mcl_vars.mg_overworld_max)
|
||||
|
||||
-- spawn eggs
|
||||
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)
|
||||
mcl_mobs.register_egg("mobs_mc:creeper", S("Creeper"), "#0da70a", "#000000", 0)
|
|
@ -81,16 +81,16 @@ local dolphin = {
|
|||
reach = 2,
|
||||
damage = 2.5,
|
||||
attack_type = "dogfight",
|
||||
--[[ this is supposed to make them jump out the water but doesn't appear to work very well
|
||||
do_custom = function(self,dtime)
|
||||
--[[ this is supposed to make them jump out the water but doesn't appear to work very well
|
||||
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
|
||||
if minetest.get_item_group(self.standing_in, "water") ~= 0 then
|
||||
if self.object:get_velocity().y < 5 then
|
||||
self.object:add_velocity({ x = 0 , y = math.random()*.014-.007, z = 0 })
|
||||
self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 })
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end,
|
||||
--]]
|
||||
}
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:dolphin", dolphin)
|
||||
|
|
|
@ -4,17 +4,21 @@
|
|||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
|
||||
local BEAM_CHECK_FREQUENCY = 1
|
||||
local BEAM_CHECK_FREQUENCY = 2
|
||||
local POS_CHECK_FREQUENCY = 15
|
||||
local HEAL_INTERVAL = 1
|
||||
local HEAL_AMOUNT = 2
|
||||
local HEAL_AMMOUNT = 37
|
||||
|
||||
local function heal(self)
|
||||
local o = self.object
|
||||
self.health = math.min(self.hp_max,self.health + HEAL_AMMOUNT)
|
||||
end
|
||||
local function check_beam(self)
|
||||
for _, obj in ipairs(minetest.get_objects_inside_radius(self.object:get_pos(), 80)) do
|
||||
local luaentity = obj:get_luaentity()
|
||||
if luaentity and luaentity.name == "mcl_end:crystal" then
|
||||
if luaentity.beam then
|
||||
if luaentity.beam == self.beam then
|
||||
heal(self)
|
||||
break
|
||||
end
|
||||
else
|
||||
|
@ -102,6 +106,7 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", {
|
|||
},
|
||||
ignores_nametag = true,
|
||||
do_custom = function(self,dtime)
|
||||
mcl_bossbars.update_boss(self.object, "Ender Dragon", "light_purple")
|
||||
if self._pos_timer == nil or self._pos_timer > POS_CHECK_FREQUENCY then
|
||||
self._pos_timer = 0
|
||||
check_pos(self)
|
||||
|
@ -110,20 +115,8 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", {
|
|||
self._beam_timer = 0
|
||||
check_beam(self)
|
||||
end
|
||||
|
||||
self._beam_timer = self._beam_timer + dtime
|
||||
self._pos_timer = self._pos_timer + dtime
|
||||
|
||||
if self.beam ~= nil then
|
||||
-- heal
|
||||
self._heal_timer = (self._heal_timer or 0) + dtime
|
||||
if self._heal_timer > HEAL_INTERVAL then
|
||||
self.health = math.min(self.hp_max,self.health + HEAL_AMOUNT)
|
||||
self._heal_timer = self._heal_timer - HEAL_INTERVAL
|
||||
end
|
||||
end
|
||||
|
||||
mcl_bossbars.update_boss(self.object, "Ender Dragon", "light_purple")
|
||||
end,
|
||||
on_die = function(self, pos, cmi_cause)
|
||||
if self._portal_pos then
|
||||
|
|
|
@ -31,9 +31,20 @@ 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)
|
||||
self.object:remove()
|
||||
if self and self.object then
|
||||
if not self.object:get_attach() then
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end,
|
||||
glow = 50,
|
||||
})
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
|
@ -55,8 +66,142 @@ 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_rover_animation = function(animation_type)
|
||||
local select_enderman_animation = function(animation_type)
|
||||
-- Enderman holds a block
|
||||
if animation_type == "block" then
|
||||
return {
|
||||
|
@ -109,8 +254,8 @@ local psdefs = {{
|
|||
texture = "mcl_portals_particle"..math.random(1, 5)..".png",
|
||||
}}
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:rover", {
|
||||
description = S("Rover"),
|
||||
mcl_mobs.register_mob("mobs_mc:enderman", {
|
||||
description = S("Enderman"),
|
||||
type = "monster",
|
||||
spawn_class = "passive",
|
||||
can_despawn = true,
|
||||
|
@ -122,11 +267,23 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
xp_max = 5,
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 2.89, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "vl_rover.b3d",
|
||||
textures = { "vl_mobs_rover.png^vl_mobs_rover_face.png" },
|
||||
glow = 100,
|
||||
visual_size = {x=10, y=10},
|
||||
mesh = "mobs_mc_enderman.b3d",
|
||||
textures = create_enderman_textures(),
|
||||
visual_size = {x=3, y=3},
|
||||
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",
|
||||
|
@ -135,8 +292,8 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
random = {name="mobs_mc_enderman_random", gain=0.5},
|
||||
distance = 16,
|
||||
},
|
||||
walk_velocity = 2,
|
||||
run_velocity = 4,
|
||||
walk_velocity = 0.2,
|
||||
run_velocity = 3.4,
|
||||
damage = 7,
|
||||
reach = 2,
|
||||
particlespawners = psdefs,
|
||||
|
@ -147,7 +304,7 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
max = 1,
|
||||
looting = "common"},
|
||||
},
|
||||
animation = select_rover_animation("normal"),
|
||||
animation = select_enderman_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
|
||||
|
@ -191,7 +348,6 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
|
||||
-- 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()
|
||||
|
@ -202,7 +358,6 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
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
|
||||
|
@ -334,17 +489,38 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
minetest.remove_node(take_pos)
|
||||
local dug = minetest.get_node_or_nil(take_pos)
|
||||
if dug and dug.name == "air" then
|
||||
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._taken_node = node.name
|
||||
self.persistent = true
|
||||
local def = minetest.registered_nodes[self._taken_node]
|
||||
self.animation = select_rover_animation("block")
|
||||
-- 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"
|
||||
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")
|
||||
self:set_animation(self.animation.current)
|
||||
if def and def.sounds and def.sounds.dug then
|
||||
if def.sounds and def.sounds.dug then
|
||||
minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16}, true)
|
||||
end
|
||||
end
|
||||
|
@ -366,14 +542,12 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
local def = minetest.registered_nodes[self._taken_node]
|
||||
-- Update animation accordingly (removes visible block)
|
||||
self.persistent = false
|
||||
self.animation = select_rover_animation("normal")
|
||||
self.animation = select_enderman_animation("normal")
|
||||
self:set_animation(self.animation.current)
|
||||
if def and def.sounds and def.sounds.place then
|
||||
if def.sounds and def.sounds.place then
|
||||
minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16}, true)
|
||||
end
|
||||
self._node_obj:remove()
|
||||
self._node_obj = nil
|
||||
self._taken_node = nil
|
||||
self._taken_node = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -471,41 +645,16 @@ mcl_mobs.register_mob("mobs_mc:rover", {
|
|||
--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:rover",
|
||||
"mobs_mc:enderman",
|
||||
"end",
|
||||
"ground",
|
||||
{
|
||||
|
@ -525,7 +674,7 @@ mcl_vars.mg_end_min,
|
|||
mcl_vars.mg_end_max)
|
||||
-- Overworld spawn
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:rover",
|
||||
"mobs_mc:enderman",
|
||||
"overworld",
|
||||
"ground",
|
||||
{
|
||||
|
@ -674,7 +823,7 @@ mcl_vars.mg_overworld_max)
|
|||
|
||||
-- Nether spawn (rare)
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:rover",
|
||||
"mobs_mc:enderman",
|
||||
"nether",
|
||||
"ground",
|
||||
{
|
||||
|
@ -691,7 +840,7 @@ mcl_vars.mg_nether_max)
|
|||
|
||||
-- Warped Forest spawn (common)
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:rover",
|
||||
"mobs_mc:enderman",
|
||||
"nether",
|
||||
"ground",
|
||||
{
|
||||
|
@ -706,5 +855,4 @@ mcl_vars.mg_nether_min,
|
|||
mcl_vars.mg_nether_max)
|
||||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:rover", S("Rover"), "#252525", "#151515", 0)
|
||||
minetest.register_alias("mobs_mc:enderman", "mobs_mc:rover")
|
||||
mcl_mobs.register_egg("mobs_mc:enderman", S("Enderman"), "#252525", "#151515", 0)
|
|
@ -126,14 +126,13 @@ mcl_mobs.register_arrow("mobs_mc:fireball", {
|
|||
end,
|
||||
|
||||
hit_mob = function(self, mob)
|
||||
local name = mob:get_luaentity().name
|
||||
mob:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 6},
|
||||
}, nil)
|
||||
mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1, true)
|
||||
local ent = mob:get_luaentity()
|
||||
if (not ent or ent.health <= 0) and self._puncher and name == "mobs_mc:ghast" then
|
||||
if not ent or ent.health <= 0 then
|
||||
awards.unlock(self._puncher:get_player_name(), "mcl:fireball_redir_serv")
|
||||
end
|
||||
end,
|
||||
|
|
|
@ -99,7 +99,9 @@ mcl_mobs.register_mob("mobs_mc:guardian", {
|
|||
view_range = 16,
|
||||
})
|
||||
|
||||
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)
|
||||
-- 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: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)
|
||||
|
|
|
@ -105,14 +105,11 @@ 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,
|
||||
},
|
||||
})
|
||||
|
||||
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)
|
||||
-- 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)
|
||||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "#ceccba", "#747693", 0)
|
||||
|
|
|
@ -122,10 +122,10 @@ local horse = {
|
|||
stand_speed = 25,
|
||||
stand_start = 0,
|
||||
stand_end = 0,
|
||||
walk_speed = 100,
|
||||
walk_speed = 25,
|
||||
walk_start = 0,
|
||||
walk_end = 40,
|
||||
run_speed = 200,
|
||||
run_speed = 60,
|
||||
run_start = 0,
|
||||
run_end = 40,
|
||||
},
|
||||
|
@ -543,6 +543,11 @@ donkey.description = S("Donkey")
|
|||
donkey.textures = {{"blank.png", "mobs_mc_donkey.png", "blank.png"}}
|
||||
donkey.spawn_in_group = 3
|
||||
donkey.spawn_in_group_min = 1
|
||||
donkey.animation = {
|
||||
speed_normal = 25,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
}
|
||||
donkey.sounds = {
|
||||
random = "mobs_mc_donkey_random",
|
||||
damage = "mobs_mc_donkey_hurt",
|
||||
|
|
|
@ -124,7 +124,9 @@ 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
|
||||
|
@ -132,12 +134,10 @@ 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)
|
||||
|
|
|
@ -83,8 +83,8 @@ mcl_mobs.register_mob("mobs_mc:iron_golem", {
|
|||
stand_speed = 15, walk_speed = 15, run_speed = 25, punch_speed = 15,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 40, run_end = 80,
|
||||
punch_start = 80, punch_end = 90,
|
||||
run_start = 0, run_end = 40,
|
||||
punch_start = 40, punch_end = 50,
|
||||
},
|
||||
jump = true,
|
||||
do_custom = function(self, dtime)
|
||||
|
|
|
@ -5,7 +5,7 @@ Blaze=Lohe
|
|||
Chicken=Huhn
|
||||
Cow=Kuh
|
||||
Mooshroom=Pilzkuh
|
||||
Stalker=Stalker
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Enderdrache
|
||||
Enderman=Enderman
|
||||
Endermite=Endermilbe
|
||||
|
|
|
@ -6,7 +6,7 @@ Blaze=Blaze
|
|||
Chicken=Kylling
|
||||
Cow=Ko
|
||||
Mooshroom=Svamp
|
||||
Stalker=Stalker
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Enderdrage
|
||||
Enderman=Enderman
|
||||
Endermite=Endermide
|
||||
|
@ -67,4 +67,4 @@ Cod=Torsk
|
|||
Salmon=Laks
|
||||
Dolphin=Delfin
|
||||
Pillager=Plyndrer
|
||||
Tropical fish=Tropisk fisk
|
||||
Tropical fish=Tropisk fisk
|
|
@ -5,7 +5,7 @@ Chicken=Pollo
|
|||
Cod=Bacalao
|
||||
Cow=Vaca
|
||||
Mooshroom=Champivaca
|
||||
Stalker=Stalker
|
||||
Creeper=Creeper
|
||||
Dolphin=Delfín
|
||||
Ender Dragon=Ender Dragon
|
||||
Enderman=Enderman
|
||||
|
|
|
@ -6,7 +6,7 @@ Blaze=Blaze
|
|||
Chicken=Poulet
|
||||
Cow=Vache
|
||||
Mooshroom=Champimeuh
|
||||
Stalker=Stalker
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Ender Dragon
|
||||
Enderman=Enderman
|
||||
Endermite=Endermite
|
||||
|
|
|
@ -6,7 +6,7 @@ Blaze=Flamor
|
|||
Chicken=Polet
|
||||
Cow=Vacha
|
||||
Mooshroom=Vachairòla
|
||||
Stalker=Stalker
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Dragon de Finuèit
|
||||
Enderman=Finuèairi
|
||||
Endermite=Finuèibau
|
||||
|
|
|
@ -6,7 +6,7 @@ Blaze=Blaze
|
|||
Chicken=Galinha
|
||||
Cow=Vaca
|
||||
Mooshroom=Coguvaca
|
||||
Stalker=Stalker
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Dragão do Fim
|
||||
Enderman=Enderman
|
||||
Endermite=Endermite
|
||||
|
|
|
@ -6,7 +6,7 @@ Blaze=Ифрит
|
|||
Chicken=Курица
|
||||
Cow=Корова
|
||||
Mooshroom=Грибная корова
|
||||
Stalker=Сталкер
|
||||
Creeper=Крипер
|
||||
Ender Dragon=Дракон Края
|
||||
Enderman=Эндермен
|
||||
Endermite=Эндермит
|
||||
|
|
|
@ -6,7 +6,7 @@ Blaze=
|
|||
Chicken=
|
||||
Cow=
|
||||
Mooshroom=
|
||||
Stalker=
|
||||
Creeper=
|
||||
Ender Dragon=
|
||||
Enderman=
|
||||
Endermite=
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name = mobs_mc
|
||||
author = maikerumine
|
||||
description = Adds Minecraft-like monsters and animals.
|
||||
depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip, mcl_core, mcl_util, mcl_entity_invs
|
||||
depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip, mcl_core, mcl_util
|
||||
optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, doc_items, mcl_worlds
|
||||
|
|
|
@ -360,7 +360,7 @@ piglin_brute.xp_min = 20
|
|||
piglin_brute.xp_max = 20
|
||||
piglin_brute.hp_min = 50
|
||||
piglin_brute.hp_max = 50
|
||||
piglin_brute.fire_resistant = false
|
||||
piglin_brute.fire_resistant = 1
|
||||
piglin_brute.do_custom = function()
|
||||
return
|
||||
end
|
||||
|
@ -371,8 +371,8 @@ piglin_brute.on_rightclick = function()
|
|||
return
|
||||
end
|
||||
piglin_brute.attacks_monsters = true
|
||||
piglin_brute.lava_damage = 4
|
||||
piglin_brute.fire_damage = 2
|
||||
piglin_brute.lava_damage = 0
|
||||
piglin_brute.fire_damage = 0
|
||||
piglin_brute.attack_animals = true
|
||||
piglin_brute.mesh = "extra_mobs_sword_piglin.b3d"
|
||||
piglin_brute.textures = {"extra_mobs_piglin_brute.png", "default_tool_goldaxe.png", "extra_mobs_trans.png"}
|
||||
|
|
|
@ -52,7 +52,7 @@ local salmon = {
|
|||
makes_footstep_sound = false,
|
||||
swim = true,
|
||||
fly = true,
|
||||
fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" },
|
||||
fly_in = "mcl_core:water_source",
|
||||
breathes_in_water = true,
|
||||
jump = false,
|
||||
view_range = 16,
|
||||
|
|
|
@ -249,7 +249,6 @@ 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
|
||||
|
|
|
@ -73,7 +73,7 @@ local skeleton = {
|
|||
looting = "common",},
|
||||
|
||||
-- Head
|
||||
-- TODO: Only drop if killed by charged stalker
|
||||
-- TODO: Only drop if killed by charged creeper
|
||||
{name = "mcl_heads:skeleton",
|
||||
chance = 200, -- 0.5% chance
|
||||
min = 1,
|
||||
|
@ -103,7 +103,6 @@ local skeleton = {
|
|||
return true
|
||||
end,
|
||||
ignited_by_sunlight = true,
|
||||
floats = 0,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
attack_type = "dogshoot",
|
||||
|
@ -114,8 +113,7 @@ 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)
|
||||
local arrow = self.arrow:match("^(.+)_entity$")
|
||||
mcl_bows.shoot_arrow(arrow, pos, dir, self.object:get_yaw(), self.object, nil, dmg)
|
||||
mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
|
||||
end
|
||||
end,
|
||||
shoot_interval = 2,
|
||||
|
@ -142,10 +140,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:frost_arrow",
|
||||
name = "mcl_potions:slowness_arrow",
|
||||
chance = 2,
|
||||
min = 1,
|
||||
max = 1,
|
||||
|
@ -154,20 +152,13 @@ table.insert(stray.drops, {
|
|||
local chance = 0.5
|
||||
for i = 1, lvl do
|
||||
if chance > 1 then
|
||||
return 1 -- TODO verify this logic, I think this is not how chance works
|
||||
return 1
|
||||
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)
|
||||
|
||||
|
|
|
@ -94,12 +94,11 @@ mcl_mobs.register_mob("mobs_mc:witherskeleton", {
|
|||
dogshoot_switch = 1,
|
||||
dogshoot_count_max =0.5,
|
||||
fear_height = 4,
|
||||
floats = 0,
|
||||
harmed_by_heal = true,
|
||||
fire_resistant = true,
|
||||
dealt_effect = {
|
||||
name = "withering",
|
||||
level = 1,
|
||||
factor = 1,
|
||||
dur = 10,
|
||||
},
|
||||
})
|
||||
|
|