forked from VoxeLibre/VoxeLibre
Compare commits
1 Commits
master
...
mobs_armor
Author | SHA1 | Date |
---|---|---|
Mikita Wiśniewski | 28ab4f8046 |
|
@ -4,5 +4,4 @@
|
|||
*.blend2
|
||||
*.blend3
|
||||
/.idea/
|
||||
*.xcf
|
||||
.Rproj.user
|
||||
*.xcf
|
24
.luacheckrc
24
.luacheckrc
|
@ -1,12 +1,10 @@
|
|||
---@diagnostic disable
|
||||
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
max_line_length = false
|
||||
redefined = false
|
||||
|
||||
globals = {
|
||||
"minetest", "core",
|
||||
"minetest", "core",
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
|
@ -42,16 +40,16 @@ read_globals = {
|
|||
"factorial"
|
||||
}
|
||||
},
|
||||
------
|
||||
--MODS
|
||||
------
|
||||
------
|
||||
--MODS
|
||||
------
|
||||
|
||||
--GENERAL
|
||||
"default",
|
||||
--GENERAL
|
||||
"default",
|
||||
|
||||
--ENTITIES
|
||||
"cmi",
|
||||
--ENTITIES
|
||||
"cmi",
|
||||
|
||||
--HUD
|
||||
"sfinv", "sfinv_buttons", "unified_inventory", "cmsg", "inventory_plus",
|
||||
}
|
||||
--HUD
|
||||
"sfinv", "sfinv_buttons", "unified_inventory", "cmsg", "inventory_plus",
|
||||
}
|
22
.luarc.json
22
.luarc.json
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"runtime.version": "LuaJIT",
|
||||
"diagnostics": { "disable": ["lowercase-global"] },
|
||||
"diagnostics.globals": [
|
||||
"minetest",
|
||||
"dump",
|
||||
"dump2",
|
||||
"Raycast",
|
||||
"Settings",
|
||||
"PseudoRandom",
|
||||
"PerlinNoise",
|
||||
"VoxelManip",
|
||||
"SecureRandom",
|
||||
"VoxelArea",
|
||||
"PerlinNoiseMap",
|
||||
"PcgRandom",
|
||||
"ItemStack",
|
||||
"AreaStore",
|
||||
"vector"
|
||||
],
|
||||
"workspace.ignoreDir": [".luacheckrc"]
|
||||
}
|
|
@ -9,9 +9,10 @@ You can help with MineClone2's development in many different ways,
|
|||
whether you're a programmer or not.
|
||||
|
||||
## MineClone2's development target is to...
|
||||
- Create a stable, peformant, moddable, free/libre game based on Minecraft
|
||||
using the Minetest engine, usable in both singleplayer and multiplayer.
|
||||
- Currently, a lot of features are already implemented.
|
||||
- Crucially, create a stable, moddable, free/libre clone of Minecraft
|
||||
based on the Minetest engine with polished features, usable in both
|
||||
singleplayer and multiplayer. Currently, a lot of Minecraft features
|
||||
are already implemented.
|
||||
Polishing existing features is always welcome.
|
||||
|
||||
## Links
|
||||
|
@ -119,11 +120,11 @@ 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
|
||||
Pixel Perfection texture pack contributions. Be warned many of the newer
|
||||
textures in it are copies or slight modifications of the original MC textures
|
||||
so great caution needs to be taken when using any textures coming from
|
||||
Minecraft texture packs.
|
||||
For textures we use the Pixel Perfection texture pack. For older Minecraft
|
||||
features that is mostly enough but a lot of the newer textures in it are
|
||||
copies or slight modifications of the original MC textures so great caution
|
||||
needs to be taken when using any textures coming from Minecraft texture
|
||||
packs.
|
||||
If you want to make such contributions, join our Discord server. Demands
|
||||
for textures will be communicated there.
|
||||
|
||||
|
@ -134,10 +135,7 @@ 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
|
||||
play these sounds in game. All sounds should be released under an open
|
||||
source license with clear information on the source, licencing and any
|
||||
changes made by the contributor. Use the README files in the mod to
|
||||
communicate this information.
|
||||
play these sounds in game.
|
||||
|
||||
#### 3D Models
|
||||
Most of the 3D Models in MineClone2 come from
|
||||
|
@ -147,9 +145,9 @@ Blender on demand. Many of the models have to be patched, some new
|
|||
animations have to be added etc.
|
||||
|
||||
#### Crediting
|
||||
Asset contributions will be credited in their mods and their own respective
|
||||
sections in CREDITS.md. If you have commited the results yourself, you will
|
||||
also be credited in the Contributors section.
|
||||
Asset contributions will be credited in their own respective sections in
|
||||
CREDITS.md. If you have commited the results yourself, you will also be
|
||||
credited in the Contributors section.
|
||||
|
||||
### Contributing Translations
|
||||
|
||||
|
@ -184,12 +182,7 @@ information about the game's performance and let us know places to
|
|||
investigate optimization issues. This way we can make the game faster.
|
||||
|
||||
#### Using Minetest's profiler
|
||||
We frequently will use profiling to optimise our code. We recommend use of
|
||||
the JIT profiler (RIP Jude) to fully understand performance impact:
|
||||
|
||||
https://content.minetest.net/packages/jwmhjwmh/jitprofiler/
|
||||
|
||||
Minetest also has a built in profiler. Simply set `profiler.load = true` in
|
||||
Minetest has a built in profiler. Simply set `profiler.load = true` in
|
||||
your configuration file and restart the server. After running the server
|
||||
for some time, just run `/profiler save` in chat - then you will find a
|
||||
file in the world directory containing the results. Open a new issue and
|
||||
|
@ -220,14 +213,10 @@ they have made their donation Incognito).
|
|||
* Fork the repository (in case you have not already)
|
||||
* Do your change in a new branch
|
||||
* Create a pull request to get your changes merged into master
|
||||
* It is important that conflicts are resolved prior to merging the pull
|
||||
* Keep your pull request up to date by regularly merging upstream. It is
|
||||
imperative that conflicts are resolved prior to merging the pull
|
||||
request.
|
||||
* We update our branches via rebasing. Please avoid merging master into
|
||||
your branch unless it's the only way you can resolve a conflict. We can
|
||||
rebase branches from the GUI if the user has not merged master into the
|
||||
branch.
|
||||
* After the pull request got merged, you can delete the branch if the
|
||||
merger hasn't done this already.
|
||||
* After the pull request got merged, you can delete the branch
|
||||
|
||||
### Discuss first
|
||||
If you feel like a problem needs to fixed or you want to make a new
|
||||
|
@ -273,7 +262,9 @@ excessive git bureaucracy commits in master)
|
|||
* Submodules should only be used if a) upstream is highly reliable and
|
||||
b) it is 100% certain that no mcl2 specific changes to the code will be
|
||||
needed (this has never been the case before, hence mcl2 is submodule free so far)
|
||||
* Commit messages should be descriptive
|
||||
* Commit messages should be descriptive and never contain mcl2 specific
|
||||
issueids - there are other projects who might use commits from mcl2 and
|
||||
it will confuse their issue trackers.
|
||||
* Try to group your submissions best as you can:
|
||||
* Try to 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.
|
||||
|
@ -357,24 +348,18 @@ end
|
|||
|
||||
### Developer status
|
||||
Active and trusted contributors are often granted write access to the
|
||||
MineClone2 repository as a contributor. Those that have demonstrated the right
|
||||
technical skills and behaviours may be granted developer access. These are the
|
||||
most trusted contributors who will contribute to ensure coding standards and
|
||||
processes are followed.
|
||||
MineClone2 repository.
|
||||
|
||||
#### Developer responsibilities
|
||||
- If you have developer/contributor privileges you can just open a new branch
|
||||
in the mcl2 repository (which is preferred). From that you create a pull request.
|
||||
- If you have developer privileges you can just open a new branch 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 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
|
||||
and could result in merge conflicts for a larger older branch, or needs
|
||||
art/licencing reviewing. A PR needs at least one approval (by someone else other
|
||||
than the author).
|
||||
- The maintainers are usually relatively quick to react to new submissions.
|
||||
- Any developer is welcome to review, test and merge PRs. A PR needs
|
||||
at least one approval (by someone else than the author) but the maintainers
|
||||
are usually relatively quick to react to new submissions.
|
||||
|
||||
### Maintainer status
|
||||
Maintainers carry the main responsibility for the project.
|
||||
|
|
115
CREDITS.md
115
CREDITS.md
|
@ -6,44 +6,40 @@
|
|||
## Creator of MineClone2
|
||||
* Wuzzy
|
||||
|
||||
|
||||
## Maintainers
|
||||
* AncientMariner
|
||||
* Herowl
|
||||
* Nicu
|
||||
|
||||
## Previous Maintainers
|
||||
* Fleckenstein
|
||||
* jordan4ibanez
|
||||
* cora
|
||||
* Nicu
|
||||
|
||||
## Developers
|
||||
* bzoss
|
||||
* AFCMS
|
||||
* epCode
|
||||
* ryvnf
|
||||
* iliekprogrammar
|
||||
* MysticTempest
|
||||
* Rootyjr
|
||||
* aligator
|
||||
* Code-Sploit
|
||||
* NO11
|
||||
* kabou
|
||||
* rudzik8
|
||||
* chmodsayshello
|
||||
* PrairieWind
|
||||
* RandomLegoBrick
|
||||
* SumianVoice
|
||||
* MrRar
|
||||
* talamh
|
||||
* Faerraven / Michieal
|
||||
* FossFanatic
|
||||
* SmokeyDope
|
||||
* Faerraven / Michieal
|
||||
* Codiac
|
||||
|
||||
## Past Developers
|
||||
* jordan4ibanez
|
||||
* iliekprogrammar
|
||||
* kabou
|
||||
* kay27
|
||||
* MysticTempest
|
||||
* NO11
|
||||
* SumianVoice
|
||||
* PrairieWind
|
||||
|
||||
## Contributors
|
||||
* RandomLegoBrick
|
||||
* rudzik8
|
||||
* Code-Sploit
|
||||
* aligator
|
||||
* Rootyjr
|
||||
* ryvnf
|
||||
* bzoss
|
||||
* talamh
|
||||
* Laurent Rocher
|
||||
* HimbeerserverDE
|
||||
* TechDudie
|
||||
|
@ -72,10 +68,6 @@
|
|||
* Marcin Serwin
|
||||
* erlehmann
|
||||
* E
|
||||
* n_to
|
||||
* debiankaios
|
||||
* Gustavo6046 / wallabra
|
||||
* CableGuy67
|
||||
* Benjamin Schötz
|
||||
* Doloment
|
||||
* Sydney Gems
|
||||
|
@ -109,33 +101,25 @@
|
|||
* gldrk
|
||||
* atomdmac
|
||||
* emptyshore
|
||||
* FlamingRCCars
|
||||
* uqers
|
||||
* Niterux
|
||||
* appgurueu
|
||||
* seventeenthShulker
|
||||
* DinoNuggies4665
|
||||
* basxto
|
||||
* Morik666
|
||||
* Eliy21
|
||||
* mdk
|
||||
* Alessandra Lozoya
|
||||
* VanicGame
|
||||
* ThePython10110
|
||||
* Araca
|
||||
* Montandalar
|
||||
* mim
|
||||
* Dark
|
||||
* Bakawun
|
||||
* JoseDouglas26
|
||||
* Zasco
|
||||
|
||||
## Music
|
||||
* Jordach for the jukebox music compilation from Big Freaking Dig
|
||||
* Dark Reaven Music (https://soundcloud.com/dark-reaven-music) for the main menu theme (Calmed Cube) and Traitor (horizonchris96), which is licensed under https://creativecommons.org/licenses/by-sa/3.0/
|
||||
* Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)
|
||||
* Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)
|
||||
* 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)
|
||||
## MineClone5
|
||||
* kay27
|
||||
* Debiankaios
|
||||
* epCode
|
||||
* NO11
|
||||
* j45
|
||||
* chmodsayshello
|
||||
* 3raven
|
||||
* PrairieWind
|
||||
* Gustavo6046 / wallabra
|
||||
* CableGuy67
|
||||
* MrRar
|
||||
|
||||
## Mineclonia
|
||||
* erlehmann
|
||||
* Li0n
|
||||
* E
|
||||
* n_to
|
||||
|
||||
## Original Mod Authors
|
||||
* Wuzzy
|
||||
|
@ -167,20 +151,14 @@
|
|||
* 4Evergreen4
|
||||
* jordan4ibanez
|
||||
* paramat
|
||||
* debian044 / debian44
|
||||
* chmodsayshello
|
||||
* cora
|
||||
* Faerraven / Michieal
|
||||
* PrairieWind
|
||||
* ChrisPHP
|
||||
|
||||
## 3D Models
|
||||
* 22i
|
||||
* tobyplowy
|
||||
* epCode
|
||||
* Faerraven / Michieal
|
||||
* SumianVoice
|
||||
* thunder1035
|
||||
|
||||
## Textures
|
||||
* XSSheep
|
||||
|
@ -196,12 +174,6 @@
|
|||
* cora
|
||||
* Faerraven / Michieal
|
||||
* Nicu
|
||||
* Exhale
|
||||
* Aeonix_Aeon
|
||||
* Wbjitscool
|
||||
* SmokeyDope
|
||||
* thunder1035
|
||||
* Herowl
|
||||
|
||||
## Translations
|
||||
* Wuzzy
|
||||
|
@ -218,13 +190,6 @@
|
|||
* SakuraRiu
|
||||
* anarquimico
|
||||
* syl
|
||||
* Temak
|
||||
* megustanlosfrijoles
|
||||
* kbundg
|
||||
* Isaac Dennis
|
||||
* ADLON
|
||||
* Sab Pyrope
|
||||
* JoseDouglas26
|
||||
|
||||
## Funders
|
||||
* 40W
|
||||
|
@ -232,6 +197,12 @@
|
|||
* Cora
|
||||
|
||||
## Special thanks
|
||||
* The Minetest team for making and supporting an engine, and distribution infrastructure that makes this all possible
|
||||
* celeron55 for creating Minetest
|
||||
* Jordach for the jukebox music compilation from Big Freaking Dig
|
||||
* wsor for working tirelessly in the shadows for the good of all of us, particularly helping with solving contentDB and copyright issues.
|
||||
* The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game
|
||||
* Notch and Jeb for being the major forces behind Minecraft
|
||||
* Dark Reaven Music (https://soundcloud.com/dark-reaven-music) for the main menu theme (Calmed Cube) and Traitor (horizonchris96), which is licensed under https://creativecommons.org/licenses/by-sa/3.0/
|
||||
* Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)
|
||||
* Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)
|
||||
* Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0)
|
||||
|
|
12
GROUPS.md
12
GROUPS.md
|
@ -170,8 +170,16 @@ These groups are used mostly for informational purposes
|
|||
* `ammo_bow=1`: Item is used as ammo for bows
|
||||
* `non_combat_armor=1`: Item can be equipped as armor, but is not made for combat (e.g. zombie head, pumpkin)
|
||||
* `container`: Node is a container which physically stores items within and has at least 1 inventory
|
||||
* `container=1`: Container type, which does not allow hoppers to transfer items
|
||||
* `container=2`: Items can be placed and taken freely. Can have inventory with list name `"main"` or define `_mcl_hoppers_on_try_pull`, `_mcl_hoppers_on_try_push`, `_mcl_hoppers_on_after_pull`, `_mcl_hoppers_on_after_push` to play along hoppers nicely.
|
||||
* `container=2`: Has one inventory with list name `"main"`. Items can be placed and taken freely
|
||||
* `container=3`: Same as `container=2`, but shulker boxes can not be inserted
|
||||
* `container=4`: Furnace-like, has lists `"src"`, `"fuel"` and `"dst"`.
|
||||
It is expected that this also reacts on `on_timer`;
|
||||
the node timer must be started from other mods when they add into `"src"` or `"fuel"`
|
||||
* `container=5`: Left part of a 2-part horizontal connected container. Both parts have a `"main"` inventory
|
||||
list. Both inventories are considered to belong together. This is used for large chests.
|
||||
* `container=6`: Same as above, but for the right part.
|
||||
* `container=7`: Has inventory list "`main`", no movement allowed
|
||||
* `container=1`: Other/unspecified container type
|
||||
* `spawn_egg=1`: Spawn egg
|
||||
|
||||
* `pressure_plate=1`: Pressure plate (off)
|
||||
|
|
10
LEGAL.md
10
LEGAL.md
|
@ -5,7 +5,7 @@ Copying is an act of love. Please copy and share! <3
|
|||
Here's the detailed legalese for those who need it:
|
||||
|
||||
## License of source code
|
||||
MineClone 2 (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others)
|
||||
MineClone 2 (by kay27, EliasFleckenstein, Wuzzy, davedevils and countless others)
|
||||
is an imitation of Minecraft.
|
||||
|
||||
MineClone 2 is free software: you can redistribute it and/or modify
|
||||
|
@ -38,15 +38,11 @@ No non-free licenses are used anywhere.
|
|||
The textures, unless otherwise noted, are based on the Pixel Perfection resource pack for Minecraft 1.11,
|
||||
authored by XSSheep. Most textures are verbatim copies, while some textures have been changed or redone
|
||||
from scratch.
|
||||
The glazed terracotta textures have been created by [MysticTempest](https://github.com/MysticTempest).
|
||||
The glazed terracotta textures have been created by (MysticTempest)[https://github.com/MysticTempest].
|
||||
Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/>
|
||||
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
|
||||
|
||||
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/)
|
||||
|
||||
The main menu images are released under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
The main menu images are release under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
|
||||
All other files, unless mentioned otherwise, fall under:
|
||||
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
|
|
23
MODELS.md
23
MODELS.md
|
@ -1,14 +1,13 @@
|
|||
# Models in Minetest/Mineclone2
|
||||
#Models in Minetest/Mineclone2
|
||||
|
||||
Models are an important part of all entities & unique nodes in Mineclone2. They provide a 3 dimensional map of an object for which textures are then applied to. This document is for modders, it quickly highlights some important information for the software needed to open models in Mineclone2.
|
||||
|
||||
## Minetest Wiki
|
||||
|
||||
For more detailed information on actually using blender to create and modify models for Minetest/Mineclone2, please visit the Minetest wiki's page on using Blender [Here](https://wiki.minetest.net/Using_Blender)
|
||||
|
||||
## Recommended software
|
||||
##Recommended software
|
||||
|
||||
### Blender
|
||||
###Blender
|
||||
|
||||
Blender is a very popular and free modeling software supported on Windows, MacOS, and most Linux distributions. It is recommended to use Blender to create and modify 3D models within the minetest engine.
|
||||
|
||||
|
@ -20,16 +19,14 @@ Blitz 3D (.b3d) Is one of the main animated model formats used for entities in t
|
|||
|
||||
The most up to date version of this Blender plugin can be downloaded [Here](https://github.com/GreenXenith/io_scene_b3d/releases/tag/f189786)
|
||||
|
||||
## Types of model formats
|
||||
|
||||
### Animated, skinned models
|
||||
##Types of model formats
|
||||
|
||||
###Animated, skinned models
|
||||
* Blitz 3D files (.b3d)
|
||||
|
||||
* Microsoft DirectX (.x) (binary & text, compression is not supported)
|
||||
|
||||
### Static meshes
|
||||
|
||||
###Static meshes
|
||||
* Wavefront OBJ (.obj)
|
||||
|
||||
Note: The sometimes accompanying .mtl files are not supported and can safely be deleted.
|
||||
|
@ -48,18 +45,16 @@ Note: Do not use .b3d and .x files for static meshes at the moment, Minetest cur
|
|||
|
||||
Note: Any formats not mentioned above but known to work in the past were removed in 5.5.0 and aren't supported anymore.
|
||||
|
||||
## Pros & Cons of .b3d vs .x
|
||||
|
||||
### B3D
|
||||
##Pros & Cons of .b3d vs .x
|
||||
|
||||
###B3D
|
||||
* [+] Binary format means a small size
|
||||
|
||||
* [-] Difficult to postprocess after exporting
|
||||
|
||||
* [-] Difficult to debug problems
|
||||
|
||||
### X (text version)
|
||||
|
||||
###X (text version)
|
||||
* [+] Can be parsed easily with lua scripts
|
||||
|
||||
* [+] Can be easily generated by scripts
|
||||
|
|
42
README.md
42
README.md
|
@ -27,7 +27,7 @@ Or you can play in “creative mode” in which you can build almost anything in
|
|||
## How to play (quick start)
|
||||
### Getting started
|
||||
* **Punch a tree** trunk until it breaks and collect wood
|
||||
* Place the **wood into the 2×2 grid** (your “crafting grid” in your inventory menu) and craft 4 wood planks
|
||||
* Place the **wood into the 2×2 grid** (your “crafting grid” in your inventory menu and craft 4 wood planks
|
||||
* Place the 4 wood planks in a 2×2 shape in the crafting grid to **make a crafting table**
|
||||
* **Rightclick the crafting table** for a 3×3 crafting grid to craft more complex things
|
||||
* Use the **crafting guide** (book icon) to learn all the possible crafting recipes
|
||||
|
@ -37,15 +37,15 @@ Or you can play in “creative mode” in which you can build almost anything in
|
|||
|
||||
### Farming
|
||||
* Find seeds
|
||||
* Craft a hoe
|
||||
* Rightclick dirt or a similar block with a hoe to create farmland
|
||||
* Craft hoe
|
||||
* Rightclick dirt or similar block with hoe to create farmland
|
||||
* Place seeds on farmland and watch them grow
|
||||
* Collect plants when fully grown
|
||||
* Collect plant when fully grown
|
||||
* If near water, farmland becomes wet and speeds up growth
|
||||
|
||||
### Furnace
|
||||
* Craft a furnace
|
||||
* The furnace allows you to obtain more items
|
||||
* Craft furnace
|
||||
* Furnace allows you to obtain more items
|
||||
* Upper slot must contain a smeltable item (example: iron ore)
|
||||
* Lower slot must contain a fuel item (example: coal)
|
||||
* See tooltips in crafting guide to learn about fuels and smeltable items
|
||||
|
@ -79,32 +79,34 @@ The MineClone2 repository is hosted at Mesehub. To contribute or report issues,
|
|||
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
|
||||
* Discord: <https://discord.gg/xE4z8EEpDC>
|
||||
* YouTube: <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
|
||||
* IRC: <https://web.libera.chat/#mineclone2>
|
||||
* Matrix: <https://app.element.io/#/room/#mc2:matrix.org>
|
||||
* Reddit: <https://www.reddit.com/r/MineClone2/>
|
||||
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
* ContentDB: <https://content.minetest.net/packages/wuzzy/mineclone2/>
|
||||
* OpenCollective: <https://opencollective.com/mineclone2>
|
||||
* Mastodon: <https://fosstodon.org/@MineClone2>
|
||||
* Lemmy: <https://lemmy.world/c/mineclone2>
|
||||
* Matrix space: <https://app.element.io/#/room/#mcl2:matrix.org>
|
||||
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
* Reddit: <https://www.reddit.com/r/MineClone2/>
|
||||
* IRC (barely used): <https://web.libera.chat/#mineclone2>
|
||||
|
||||
## Target
|
||||
- Create a stable, moddable, free/libre game based on Minecraft
|
||||
on the Minetest engine with polished features, usable in both
|
||||
- Crucially, create a stable, moddable, free/libre clone of Minecraft
|
||||
based 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
|
||||
- With lessened priority yet strictly, 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.
|
||||
by the Minetest Engine). This means features in parity with the listed
|
||||
Minecraft experiences are prioritized over those that don't fulfill this
|
||||
scope.
|
||||
- Optionally, create a performant experience that will run relatively
|
||||
well on really low spec computers. Unfortunately, due to Minecraft's
|
||||
mechanisms and Minetest engine's limitations along with a very small
|
||||
playerbase on low spec computers, optimizations are hard to investigate.
|
||||
|
||||
## Completion status
|
||||
This game is currently in **beta** stage.
|
||||
It is playable, but not yet feature-complete.
|
||||
Backwards-compability is not entirely guaranteed, updating your world might cause small bugs.
|
||||
If you want to use the development version of MineClone2 in production, the master branch is usually relatively stable.
|
||||
If you want to use the development version of MineClone2 in production, the master branch is usually relatively stable. The testing branch often features some experimental PRs and should be considered less stable.
|
||||
|
||||
The following main features are available:
|
||||
|
||||
|
@ -162,7 +164,7 @@ Bonus features (not found in Minecraft):
|
|||
* Built-in crafting guide which shows you crafting and smelting recipes
|
||||
* In-game help system containing extensive help about gameplay basics, blocks, items and more
|
||||
* Temporary crafting recipes. They only exist to make some otherwise unaccessible items available when you're not in creative mode. These recipes will be removed as development goes on an more features become available
|
||||
* Saplings in chests in [mapgen v6](https://wiki.minetest.net/Map_generator#v6)
|
||||
* Saplings in chests in mapgen v6
|
||||
* Fully moddable (thanks to Minetest's powerful Lua API)
|
||||
* New blocks and items:
|
||||
* Lookup tool, shows you the help for whatever it touches
|
||||
|
|
|
@ -137,7 +137,7 @@ Fonctionnalités bonus (absentes de Minecraft) :
|
|||
* Guide d'artisanat intégré au jeu qui montre les recettes d'artisanat et de cuisson
|
||||
* Système d'aide intégré au jeu contenant des informations à propos des techniques de base, blocs, objets et plus
|
||||
* Recettes d'artisanat temporaires. Elles existent uniquement pour rendre des objets accessibles qui ne le seraient pas autrement sauf en mode créatif. Elles seront retirées au cours de l'avancement du développement et de l'ajout de nouvelles fonctionnalités.
|
||||
* Pousses dans les coffres en [mapgen v6](https://wiki.minetest.net/Map_generator#v6)
|
||||
* Pousses dans les coffres en mapgen v6
|
||||
* Entièrement moddable (grâce la puissante API Lua de Minetest)
|
||||
* Nouveaux blocs et objets :
|
||||
* Outil de recherche, montre l'aide de ce qu'il touche
|
||||
|
|
|
@ -1,193 +0,0 @@
|
|||
# MineClone2
|
||||
Неофициальная игра в стиле Minecraft для Minetest. Форк MineClone от davedevils.
|
||||
Разработана многими людьми. Не разработана и не одобрена Mojang AB.
|
||||
|
||||
### Игровой процесс
|
||||
Вы начинаете в случайно сгенерированном мире созданном целиком из кубов. Вы можете
|
||||
исследовать мир, выкопать и поставить почти каждый блок в мире, чтобы создавать новые
|
||||
структуры. Вы можете играть в “режиме выживания” в котором вам придется бороться с
|
||||
монстрами и голодом за выживание и медленно проходить через различные аспекты игры,
|
||||
такие как копание, фермерство, постройка механизмов и так далее. Или вы можете играть
|
||||
в “творческом режиме” в котором вы сразу можете строить что угодно.
|
||||
|
||||
#### Итоги геймплея
|
||||
|
||||
* Геймплей в стиле песочницы, без целей
|
||||
* Выживайте: сражайтесь с враждебными монстрами и голодом
|
||||
* Добывайте руды и прочие ценные предметы
|
||||
* Магия: получайте опыт и зачаруйте ваше снаряжение
|
||||
* Создавайте из собранных блоков величественные постройки ограниченные только воображением
|
||||
* Собирайте цветы и другие красители, чтобы раскрасить ваш мир
|
||||
* Найдите семена и заведите ферму
|
||||
* Найдите или создайте один из сотен предметов
|
||||
* Проложите рельсы и повеселитесь с вагонетками
|
||||
* Постройте сложные механизмы со схемами из редстоуна
|
||||
* В творческом режиме вы можете свободно строить всё без лимитов
|
||||
|
||||
## Как играть (быстрый старт)
|
||||
### Начнем
|
||||
|
||||
* **Бейте по стволу дерева** пока оно не сломается и соберите древесину
|
||||
* Поставьте **древесину в сетку 2×2** (“сетка крафта” в вашем инвентаре) и скрафтите 4 доски
|
||||
* Разложите 4 доски в форме 2×2 в сетке крафта, чтобы **сделать верстак**
|
||||
* **Правым кликом по верстаку**, чтобы открыть сетку крафта 3×3 для более сложных предметов
|
||||
* Используйте **книгу рецептов** (иконка книги), чтобы узнать все возможные рецепты крафтов
|
||||
* **Скрафтите деревянную кирку**, чтобы вы могли копать камень
|
||||
* Разные инструменты добывают разные виды блоков. Опробуйте их все!
|
||||
* Продолжайте играть как пожелаете. Повеселитесь!
|
||||
|
||||
### Фермерство
|
||||
* Найдите семена
|
||||
* Скрафтите мотыгу
|
||||
* Правой кнопкой мотыгой по земле или похожему блоку, чтобы создать грядку
|
||||
* Посадите семена на грядку и ждите пока они вырастут
|
||||
* Соберите растение когда оно полностью созреет
|
||||
* Рядом с водой грядка становится влажной и растения растут быстрее
|
||||
|
||||
### Переплавка
|
||||
* Скрафтите печь
|
||||
* Печь позволит вам получить больше предметов
|
||||
* Верхний слот должен содержать переплавляемый предмет (например: железную руду)
|
||||
* Нижний слот должен содержать топливо (например: уголь)
|
||||
* Смотрите книгу рецептов, чтобы узнать о других переплавляемых предметах и топливе
|
||||
|
||||
### Дополнительная помощь
|
||||
Больше информации о геймплее, блоках, предметах и многое другое можно найти во
|
||||
внутриигровой справке. Вы можете перейти в неё через ваш инвентарь.
|
||||
|
||||
### Особые предметы
|
||||
Следующие предметы интересны для творческого режима и для строителей приключенческих
|
||||
карт. Их нельзя получить в игре или через творческий инвентарь.
|
||||
|
||||
* Барьер: `mcl_core:barrier`
|
||||
|
||||
Используйте чат-команду `/giveme`, чтобы получить их.
|
||||
Смотрите справку для дальнейшей информации.
|
||||
|
||||
## Установка
|
||||
Эта игра требует [Minetest](http://minetest.net) для запуска (версия 5.4.1 или
|
||||
выше). Вам нужно сперва установить Minetest. Только стабильные версии поддерживаются
|
||||
официально. Не поддерживается запуск MineClone2 на разрабатываемых версиях Minetest.
|
||||
|
||||
Чтобы установить MineClone2 (если вы этого еще не сделали), переместите эту папку в
|
||||
“games” в папке данных Minetest. Смотрите справку Minetest, чтобы узнать больше.
|
||||
|
||||
## Полезные ссылки
|
||||
Репозиторий MineClone2 хранится на Mesehub. Зайдите туда, чтобы оставить запрос или
|
||||
поучаствовать в разработке.
|
||||
|
||||
* 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/mineclone2>
|
||||
* Mastodon: <https://fosstodon.org/@MineClone2>
|
||||
* Lemmy: <https://lemmy.world/c/mineclone2>
|
||||
* Matrix space: <https://app.element.io/#/room/#mcl2:matrix.org>
|
||||
* Форум Minetest: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
* Reddit: <https://www.reddit.com/r/MineClone2/>
|
||||
* IRC (едва используется): <https://web.libera.chat/#mineclone2>
|
||||
|
||||
## Цели
|
||||
- Создать стабильную, модифицируемую, бесплатную и свободную игру основанную на
|
||||
Minecraft на движке Minetest с проработанными возможностями для одиночной игры и
|
||||
для мультиплеера. На данный момент множество возможностей **Minecraft Java
|
||||
Edition** уже реализовано и доработка имеющегося контента в приоритете над
|
||||
добавлением нового.
|
||||
- Реализовать возможности на уровне **текущей версии Minecraft + OptiFine** (OptiFine
|
||||
настолько, насколько это поддерживается движком Minetest).
|
||||
- Добиться производительности для запуска на действительно слабых компьютерах.
|
||||
|
||||
## Готовность
|
||||
Игра сейчас на стадии **бета**. Она играбельна, но еще не имеет всех возможностей.
|
||||
Обратная совместимость целиком не гарантируется, обновление вашего мира может повлечь
|
||||
за собой небольшие ошибки. Если вы хотите использовать разрабатываемую версию
|
||||
Mineclone2, то ветка master обычно относительно стабильна.
|
||||
|
||||
Следущие возможности уже доступны:
|
||||
|
||||
* Инструменты, оружие, броня
|
||||
* Система крафта: сетка 2×2, верстак (сетка 3×3) и книга рецептов
|
||||
* Сундуки, большие сундуки, эндер-сундуки, ящики шалкера
|
||||
* Печи и воронки
|
||||
* Система голода
|
||||
* Большинство монстров и животных
|
||||
* Все руды из Minecraft
|
||||
* Большинство блоков из Верхнего мира
|
||||
* Вода и лава
|
||||
* Погода
|
||||
* 28 биомов + 5 биомов в Незере
|
||||
* Незер, пылающий подземный мир в другом измерении
|
||||
* Схемы из редстоуна (частично)
|
||||
* Вагонетки (частично)
|
||||
* Статусные эффекты (частично)
|
||||
* Опыт
|
||||
* Зачарование
|
||||
* Зельеварение, зелья, смоченные стрелы (частично)
|
||||
* Лодки
|
||||
* Огонь
|
||||
* Строительные блоки: ступени, плиты, двери, люки, заборы, калитки, стены
|
||||
* Часы
|
||||
* Компас
|
||||
* Губки
|
||||
* Блоки слизи
|
||||
* Растения и саженцы
|
||||
* Красители
|
||||
* Флаги
|
||||
* Декоративные блоки: стекло, окрашенное стекло, стеклянные панели, железные решетки, цветная керамика, головы и многое другое
|
||||
* Рамки для предметов
|
||||
* Прогрыватели
|
||||
* Кровати
|
||||
* Меню инвентаря
|
||||
* Творческий инвентарь
|
||||
* Фермерство
|
||||
* Книги с пером
|
||||
* Команды
|
||||
* Деревни
|
||||
* Измерение Края
|
||||
* И многое другое!
|
||||
|
||||
Следующие возможности еще не завершены:
|
||||
|
||||
* Некоторые монстры и животные
|
||||
* Предметы связанные с редстоуном
|
||||
* Некоторые вагонетки (с сундуком и с воронкой уже работают)
|
||||
* Пара нетривиальных блоков и предметов
|
||||
|
||||
Бонусные возможности (нет в Minecraft-е):
|
||||
|
||||
* Встроенный гайд для крафта покажет вам рецепты крафта и переплавки
|
||||
* Внутриигровая справка содержит всестороннюю информацию об основах игры, блоках, предметах и прочее
|
||||
* Временные рецепты крафта. Они существуют, чтобы получить доступ к ранее недоступным предметам вне творческого режима. Они будут удалены как только разработка позволит им стать доступными
|
||||
* Саженцы в сундуках в [mapgen v6](https://wiki.minetest.net/Map_generator#v6)
|
||||
* Полностью модифицируема (благодаря мощному Lua API в Minetest)
|
||||
* Новые блоки и предметы:
|
||||
* Инструмент просмотра покажет справку о том чего коснется
|
||||
* Больше ступеней и плит
|
||||
* Калитки и заборы из адских кирпичей
|
||||
* Замены структур - малые верии структур из Minecraft пока большие структуры не будут сделаны:
|
||||
* Лесная хижина (Особняк)
|
||||
* Форт Незера (Крепости)
|
||||
|
||||
Технические отличия от Minecraft:
|
||||
|
||||
* Лимит высоты - 31000 блоков (намного больше чем в Minecraft)
|
||||
* Горизонтальный размер мира - 62000×62000 блоков (намного меньше чем в Minecraft, но всё еще очень большой)
|
||||
* Всё еще не завершен и содержит много багов
|
||||
* Недостающие блоки, предметы, мобы
|
||||
* Некоторые предметы с другими названиями, чтобы лучше их различать
|
||||
* Другая музыка для проигрывателей
|
||||
* Другие текстуры (Pixel Perfection)
|
||||
* Другие звуки (разные источники)
|
||||
* Другой движок (Minetest)
|
||||
* Другие пасхалки
|
||||
|
||||
… и наконец, MineClone2 это свободное программное обеспечение!
|
||||
|
||||
## Другие readme файлы
|
||||
|
||||
* `LICENSE.txt`: текст лицензии GPLv3
|
||||
* `CONTRIBUTING.md`: информация для тех кто хочет поучаствовать в разработке
|
||||
* `API.md`: для моддеров Minetest кто хочет изменить эту игру
|
||||
* `LEGAL.md`: юридическая информация
|
||||
* `CREDITS.md`: список участников проекта
|
30
RELEASE.md
30
RELEASE.md
|
@ -1,11 +1,10 @@
|
|||
### Standard Release
|
||||
|
||||
# File to document release steps with a view to evolving into a script
|
||||
#File to document release steps with a view to evolving into a script
|
||||
|
||||
# Update CREDITS.md
|
||||
# Update version in game.conf
|
||||
#Update CREDITS.md
|
||||
#Update version in game.conf
|
||||
|
||||
```
|
||||
lua tools/generate_ingame_credits.lua
|
||||
|
||||
git add CREDITS.md
|
||||
|
@ -19,11 +18,10 @@ git commit -m "Pre-release update credits and set version 0.83.0"
|
|||
git tag 0.83.0
|
||||
|
||||
git push origin 0.83.0
|
||||
```
|
||||
|
||||
# Update version in game.conf to the next version with -SNAPSHOT suffix
|
||||
#Update version in game.conf to the next version with -SNAPSHOT suffix
|
||||
|
||||
`git commit -m "Post-release set version 0.84.0-SNAPSHOT"`
|
||||
git commit -m "Post-release set version 0.84.0-SNAPSHOT"
|
||||
|
||||
### Hotfix Release
|
||||
|
||||
|
@ -34,17 +32,15 @@ To mitigate this, you just release the last release, and the relevant bug fix. F
|
|||
|
||||
* Create release branch from the last release tag, push it:
|
||||
|
||||
```
|
||||
git checkout -b release/0.82.1 0.82.0
|
||||
|
||||
git push origin release/0.82.1
|
||||
```
|
||||
|
||||
##### Prepare feature branch and fix
|
||||
|
||||
* Create feature branch from that release branch (can review it to check only fix is there, nothing else, and use to also merge into master separately)
|
||||
|
||||
`git checkout -b hotfix_bug_1_branch`
|
||||
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)
|
||||
|
@ -57,13 +53,11 @@ git push origin release/0.82.1
|
|||
|
||||
* Tag it, push tag and branch:
|
||||
|
||||
```
|
||||
git tag 0.82.1
|
||||
|
||||
git push origin 0.82.1
|
||||
|
||||
git push origin release/0.82.1
|
||||
```
|
||||
|
||||
Note: If you have to do more than 1 hotfix release, can do it on the same release branch.
|
||||
|
||||
|
@ -77,13 +71,5 @@ Note: If you have to do more than 1 hotfix release, can do it on the same releas
|
|||
|
||||
##### Inform people
|
||||
|
||||
* Upload video to YouTube
|
||||
* Add a comment to the forum post with the release number and change log. Maintainer will update main post with code link.
|
||||
* Add a Discord announcement post and @everyone with link to video, forum post and release notes.
|
||||
* Share the news on reddit + Lemmy. Good subs to share with:
|
||||
* r/linux_gaming
|
||||
* r/opensourcegames
|
||||
* r/opensource
|
||||
* r/freesoftware
|
||||
* r/linuxmasterrace
|
||||
* r/MineClone2
|
||||
* Add a comment to the forum post with the release number and what is involved, and maintainer will update main post.
|
||||
* Add a comment in Discord announcement
|
|
@ -12,13 +12,13 @@ GIMP Tutorials has an excellent guide to making pixel art in GIMP. If you would
|
|||
|
||||
### GIMP
|
||||
|
||||
GIMP (GNU Image Manipulation Program) is a very popular and free image editing software supported on Windows, MacOS, and most Linux distributions. It is recommended to use GIMP to create and modify textures within the minetest engine.
|
||||
GIMP (Gnu Image Manipulation Program) is a very popular and free image editing software supported on Windows, MacOS, and most Linux distributions. It is recommended to use GIMP to create and modify textures within the minetest engine.
|
||||
|
||||
Download GIMP [here](http://gimp.org/)
|
||||
|
||||
# Getting Started
|
||||
## Creating a new file
|
||||
the first thing to do is open GIMP and create a new file to work in by opening the File menu and choosing "New".
|
||||
the first thing to do is open GIMP and create a new file to work in by opening the File menu and choosing New.
|
||||
|
||||
Choose width of 16 and height of 16 for the image size. While higher resolution textures are possible, The default size is 16x16. It is recommended you use this size as well, as it is universally supported on all systems.
|
||||
|
||||
|
@ -50,7 +50,7 @@ For those running a GNU/linux distribution, you most likely have the 'optipng' c
|
|||
|
||||
First, Open up the terminal in the directory where your exported texture is located (or navigate to the directory with the 'cd your/directory/path/to/textures'), then run this command
|
||||
```
|
||||
optipng -o7 -zm1-9 -nc -clobber -strip all *.png
|
||||
optipng -o7 -zm1-9 -nc -clobber *.png
|
||||
```
|
||||
This will further optimize all the textures in the directory.
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
A survival sandbox game. Survive, gather, hunt, mine, build, explore, and do much more.
|
||||
A survival sandbox game. Survive, gather, hunt, mine, build, explore, and do much more. Faithful clone of Minecraft 1.12. This is a work in progress! Expect bugs!
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
title = MineClone 2
|
||||
description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more.
|
||||
disallowed_mapgens = v6
|
||||
version=0.87.0-SNAPSHOT
|
||||
version=0.84.0-SNAPSHOT
|
|
@ -215,10 +215,6 @@ function mcl_autogroup.can_harvest(nodename, toolname, player)
|
|||
return true
|
||||
end
|
||||
|
||||
if minetest.get_item_group(nodename, "dig_immediate_piston") >= 1 then
|
||||
return true
|
||||
end
|
||||
|
||||
-- Check if it can be dug by tool
|
||||
local tdef = minetest.registered_tools[toolname]
|
||||
if tdef and tdef._mcl_diggroups then
|
||||
|
|
|
@ -31,7 +31,6 @@ local known_controls = {
|
|||
aux1 = true,
|
||||
down = true,
|
||||
up = true,
|
||||
zoom = true,
|
||||
}
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
|
|
|
@ -96,8 +96,8 @@ function mcl_damage.finish_reason(mcl_reason)
|
|||
end
|
||||
|
||||
function mcl_damage.from_mt(mt_reason)
|
||||
if mt_reason._mcl_cached_reason then
|
||||
return mt_reason._mcl_cached_reason
|
||||
if mt_reason._mcl_chached_reason then
|
||||
return mt_reason._mcl_chached_reason
|
||||
end
|
||||
|
||||
local mcl_reason
|
||||
|
|
|
@ -352,23 +352,6 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Punch End Crystals to make them explode
|
||||
if ent and ent.name == "mcl_end:crystal" then
|
||||
if direct then
|
||||
local puncher = direct:get_luaentity()
|
||||
if puncher and puncher.name == "mcl_end:crystal" then
|
||||
ent.object:punch(direct, 1.0, { -- End Crystal nearby, trigger it.
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 1},
|
||||
}, nil, nil)
|
||||
else
|
||||
ent.object:remove() -- Direct Exists, but it is not an end crystal, remove crystal.
|
||||
end
|
||||
else
|
||||
ent.object:remove() -- Node exploded the end crystal, remove it.
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local airs, fires = {}, {}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
# textdomain:mcl_explosions
|
||||
@1 was caught in an explosion.=@1 est mort dans une explosion
|
|
@ -1,2 +0,0 @@
|
|||
# textdomain:mcl_explosions
|
||||
@1 was caught in an explosion.=@1 foi pego(a) em uma explosão.
|
|
@ -1,2 +0,0 @@
|
|||
# textdomain:mcl_explosions
|
||||
@1 was caught in an explosion.=@1 попал(а) под взрыв.
|
|
@ -1,2 +0,0 @@
|
|||
# textdomain:mcl_explosions
|
||||
@1 was caught in an explosion.=
|
|
@ -1,14 +0,0 @@
|
|||
# Oxidization API for MineClone 2
|
||||
This mods adds the oxidization api, so that modders can easily use the same features that copper uses.
|
||||
|
||||
## API
|
||||
To take advantage of the actual oxidization, put `oxidizable = 1` into the list of groups for the oxidizable node.
|
||||
You would also need to put `_mcl_oxidized_variant = itemstring of node this node will oxidize into` into the node definition.
|
||||
For example, a copper block oxidizes into exposed copper, so the defintion would be `_mcl_oxidized_variant = "mcl_copper:block_exposed"`.
|
||||
|
||||
To utilize the ability to wax the block for protection from oxidization, put `mcl_waxed_variant = item string of waxed variant of node` into the node definition table.
|
||||
For example, Copper Blocks have the definition arguement of `_mcl_waxed_variant = "mcl_copper:waxed_block"`.
|
||||
|
||||
For waxed nodes, scraping is easy. Start by putting `waxed = 1` into the list of groups of the waxed node.
|
||||
Next put `_mcl_stripped_variant = item string of the unwaxed variant of the node` into the defintion table.
|
||||
Waxed Copper Blocks can be scrapped into normal Copper Blocks because of the definition `_mcl_stripped_variant = "mcl_copper:block"`.
|
|
@ -1,12 +0,0 @@
|
|||
minetest.register_abm({
|
||||
label = "Oxidatize Nodes",
|
||||
nodenames = { "group:oxidizable" },
|
||||
interval = 500,
|
||||
chance = 3,
|
||||
action = function(pos, node)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if def and def._mcl_oxidized_variant then
|
||||
minetest.set_node(pos, { name = def._mcl_oxidized_variant, param2 = node.param2 })
|
||||
end
|
||||
end,
|
||||
})
|
|
@ -1,4 +0,0 @@
|
|||
name = mcl_oxidation
|
||||
title = Oxidation API for MineClone 2
|
||||
author = PrairieWind, N011, Michael
|
||||
description = API to allow oxidizing different nodes.
|
|
@ -22,30 +22,6 @@ function table.update_nil(t, ...)
|
|||
return t
|
||||
end
|
||||
|
||||
---Works the same as `pairs`, but order returned by keys
|
||||
---
|
||||
---Taken from https://www.lua.org/pil/19.3.html
|
||||
---@generic T: table, K, V, C
|
||||
---@param t T
|
||||
---@param f? fun(a: C, b: C):boolean
|
||||
---@return fun():K, V
|
||||
function table.pairs_by_keys(t, f)
|
||||
local a = {}
|
||||
for n in pairs(t) do table.insert(a, n) end
|
||||
table.sort(a, f)
|
||||
|
||||
local i = 0 -- iterator variable
|
||||
local function iter() -- iterator function
|
||||
i = i + 1
|
||||
if a[i] == nil then
|
||||
return nil
|
||||
else
|
||||
return a[i], t[a[i]]
|
||||
end
|
||||
end
|
||||
return iter
|
||||
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)
|
||||
|
@ -58,10 +34,8 @@ function mcl_util.mcl_log(message, module, bypass_default_logger)
|
|||
end
|
||||
end
|
||||
|
||||
local player_timers = {}
|
||||
|
||||
-- This is a dtime timer than can be used in on_step functions so it works every x seconds
|
||||
-- self - Object you want to store timer data on. E.g. mob or a minecart, or player_name
|
||||
-- self - Object you want to store timer data on. E.g. mob or a minecart
|
||||
-- dtime - The time since last run of on_step, should be passed in to function
|
||||
-- timer_name - This is the name of the timer and also the key to store the data. No spaces + lowercase.
|
||||
-- threshold - The time before it returns successful. 0.2 if you want to run it 5 times a second.
|
||||
|
@ -69,14 +43,6 @@ function mcl_util.check_dtime_timer(self, dtime, timer_name, threshold)
|
|||
if not self or not threshold or not dtime then return end
|
||||
if not timer_name or timer_name == "" then return end
|
||||
|
||||
if type(self) == "string" then
|
||||
local player_name = self
|
||||
if not player_timers[player_name] then
|
||||
player_timers[player_name] = {}
|
||||
end
|
||||
self = player_timers[player_name]
|
||||
end
|
||||
|
||||
if not self._timers then
|
||||
self._timers = {}
|
||||
end
|
||||
|
@ -98,18 +64,6 @@ function mcl_util.check_dtime_timer(self, dtime, timer_name, threshold)
|
|||
return false
|
||||
end
|
||||
|
||||
-- While we should always favour the new minetest vector functions such as vector.new or vector.offset which validate on
|
||||
-- creation. There may be cases where state gets corrupted and we may have to check the vector is valid if created the
|
||||
-- old way. This allows us to do this as a tactical solution until old style vectors are completely removed.
|
||||
function mcl_util.validate_vector (vect)
|
||||
if vect then
|
||||
if tonumber(vect.x) and tonumber(vect.y) and tonumber(vect.z) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
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:
|
||||
|
@ -160,7 +114,7 @@ function mcl_util.rotate_axis_and_place(itemstack, placer, pointed_thing, infini
|
|||
return
|
||||
end
|
||||
local undef = minetest.registered_nodes[unode.name]
|
||||
if undef and undef.on_rightclick and not invert_wall then
|
||||
if undef and undef.on_rightclick then
|
||||
undef.on_rightclick(pointed_thing.under, unode, placer,
|
||||
itemstack, pointed_thing)
|
||||
return
|
||||
|
@ -198,11 +152,25 @@ function mcl_util.rotate_axis_and_place(itemstack, placer, pointed_thing, infini
|
|||
|
||||
local p2
|
||||
if is_y then
|
||||
p2 = 0
|
||||
if invert_wall then
|
||||
if fdir == 3 or fdir == 1 then
|
||||
p2 = 12
|
||||
else
|
||||
p2 = 6
|
||||
end
|
||||
end
|
||||
elseif is_x then
|
||||
p2 = 12
|
||||
if invert_wall then
|
||||
p2 = 0
|
||||
else
|
||||
p2 = 12
|
||||
end
|
||||
elseif is_z then
|
||||
p2 = 6
|
||||
if invert_wall then
|
||||
p2 = 0
|
||||
else
|
||||
p2 = 6
|
||||
end
|
||||
end
|
||||
minetest.set_node(pos, {name = wield_name, param2 = p2})
|
||||
|
||||
|
@ -251,25 +219,34 @@ function mcl_util.get_double_container_neighbor_pos(pos, param2, side)
|
|||
end
|
||||
end
|
||||
|
||||
--- Selects item stack to transfer from
|
||||
---@param src_inventory InvRef Source innentory to pull from
|
||||
---@param src_list string Name of source inventory list to pull from
|
||||
---@param dst_inventory InvRef Destination inventory to push to
|
||||
---@param dst_list string Name of destination inventory list to push to
|
||||
---@param condition? fun(stack: ItemStack) Condition which items are allowed to be transfered.
|
||||
---@return integer Item stack number to be transfered
|
||||
function mcl_util.select_stack(src_inventory, src_list, dst_inventory, dst_list, condition)
|
||||
local src_size = src_inventory:get_size(src_list)
|
||||
-- Iterates through all items in the given inventory and
|
||||
-- returns the slot of the first item which matches a condition.
|
||||
-- Returns nil if no item was found.
|
||||
--- source_inventory: Inventory to take the item from
|
||||
--- source_list: List name of the source inventory from which to take the item
|
||||
--- destination_inventory: Put item into this inventory
|
||||
--- destination_list: List name of the destination inventory to which to put the item into
|
||||
--- condition: Function which takes an itemstack and returns true if it matches the desired item condition.
|
||||
--- If set to nil, the slot of the first item stack will be taken unconditionally.
|
||||
-- dst_inventory and dst_list can also be nil if condition is nil.
|
||||
function mcl_util.get_eligible_transfer_item_slot(src_inventory, src_list, dst_inventory, dst_list, condition)
|
||||
local size = src_inventory:get_size(src_list)
|
||||
local stack
|
||||
for i = 1, src_size do
|
||||
for i = 1, size do
|
||||
stack = src_inventory:get_stack(src_list, i)
|
||||
if not stack:is_empty() and dst_inventory:room_for_item(dst_list, stack) and ((condition == nil or condition(stack))) then
|
||||
if not stack:is_empty() and (condition == nil or condition(stack, src_inventory, src_list, dst_inventory, dst_list)) then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Returns true if itemstack is a shulker box
|
||||
local function is_not_shulker_box(itemstack)
|
||||
local g = minetest.get_item_group(itemstack:get_name(), "shulker_box")
|
||||
return g == 0 or g == nil
|
||||
end
|
||||
|
||||
-- Moves a single item from one inventory to another.
|
||||
--- source_inventory: Inventory to take the item from
|
||||
--- source_list: List name of the source inventory from which to take the item
|
||||
|
@ -280,6 +257,13 @@ end
|
|||
-- Returns true on success and false on failure
|
||||
-- Possible failures: No item in source slot, destination inventory full
|
||||
function mcl_util.move_item(source_inventory, source_list, source_stack_id, destination_inventory, destination_list)
|
||||
if source_stack_id == -1 then
|
||||
source_stack_id = mcl_util.get_first_occupied_inventory_slot(source_inventory, source_list)
|
||||
if source_stack_id == nil then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
if not source_inventory:is_empty(source_list) then
|
||||
local stack = source_inventory:get_stack(source_list, source_stack_id)
|
||||
if not stack:is_empty() then
|
||||
|
@ -297,75 +281,150 @@ function mcl_util.move_item(source_inventory, source_list, source_stack_id, dest
|
|||
return false
|
||||
end
|
||||
|
||||
--- Try pushing item from hopper inventory to destination inventory
|
||||
---@param pos Vector
|
||||
---@param dst_pos Vector
|
||||
function mcl_util.hopper_push(pos, dst_pos)
|
||||
local hop_inv = minetest.get_meta(pos):get_inventory()
|
||||
local hop_list = 'main'
|
||||
-- Moves a single item from one container node into another. Performs a variety of high-level
|
||||
-- checks to prevent invalid transfers such as shulker boxes into shulker boxes
|
||||
--- source_pos: Position ({x,y,z}) of the node to take the item from
|
||||
--- destination_pos: Position ({x,y,z}) of the node to put the item into
|
||||
--- source_list (optional): List name of the source inventory from which to take the item. Default is normally "main"; "dst" for furnace
|
||||
--- source_stack_id (optional): The inventory position ID of the source inventory to take the item from (-1 for slot of the first valid item; -1 is default)
|
||||
--- destination_list (optional): List name of the destination inventory. Default is normally "main"; "src" for furnace
|
||||
-- Returns true on success and false on failure.
|
||||
function mcl_util.move_item_container(source_pos, destination_pos, source_list, source_stack_id, destination_list)
|
||||
local dpos = table.copy(destination_pos)
|
||||
local spos = table.copy(source_pos)
|
||||
local snode = minetest.get_node(spos)
|
||||
local dnode = minetest.get_node(dpos)
|
||||
|
||||
-- Get node pos' for item transfer
|
||||
local dst = minetest.get_node(dst_pos)
|
||||
if not minetest.registered_nodes[dst.name] then return end
|
||||
local dst_type = minetest.get_item_group(dst.name, "container")
|
||||
if dst_type ~= 2 then return end
|
||||
local dst_def = minetest.registered_nodes[dst.name]
|
||||
local dctype = minetest.get_item_group(dnode.name, "container")
|
||||
local sctype = minetest.get_item_group(snode.name, "container")
|
||||
|
||||
local dst_list = 'main'
|
||||
local dst_inv, stack_id
|
||||
|
||||
if dst_def._mcl_hoppers_on_try_push then
|
||||
dst_inv, dst_list, stack_id = dst_def._mcl_hoppers_on_try_push(dst_pos, pos, hop_inv, hop_list)
|
||||
else
|
||||
local dst_meta = minetest.get_meta(dst_pos)
|
||||
dst_inv = dst_meta:get_inventory()
|
||||
stack_id = mcl_util.select_stack(hop_inv, hop_list, dst_inv, dst_list)
|
||||
-- Container type 7 does not allow any movement
|
||||
if sctype == 7 then
|
||||
return false
|
||||
end
|
||||
|
||||
if stack_id ~= nil then
|
||||
local ok = mcl_util.move_item(hop_inv, hop_list, stack_id, dst_inv, dst_list)
|
||||
if dst_def._mcl_hoppers_on_after_push then
|
||||
dst_def._mcl_hoppers_on_after_push(dst_pos)
|
||||
-- Normalize double container by forcing to always use the left segment first
|
||||
local function normalize_double_container(pos, node, ctype)
|
||||
if ctype == 6 then
|
||||
pos = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right")
|
||||
if not pos then
|
||||
return false
|
||||
end
|
||||
node = minetest.get_node(pos)
|
||||
ctype = minetest.get_item_group(node.name, "container")
|
||||
-- The left segment seems incorrect? We better bail out!
|
||||
if ctype ~= 5 then
|
||||
return false
|
||||
end
|
||||
end
|
||||
if ok then
|
||||
return true
|
||||
return pos, node, ctype
|
||||
end
|
||||
|
||||
spos, snode, sctype = normalize_double_container(spos, snode, sctype)
|
||||
dpos, dnode, dctype = normalize_double_container(dpos, dnode, dctype)
|
||||
if not spos or not dpos then return false end
|
||||
|
||||
local smeta = minetest.get_meta(spos)
|
||||
local dmeta = minetest.get_meta(dpos)
|
||||
|
||||
local sinv = smeta:get_inventory()
|
||||
local dinv = dmeta:get_inventory()
|
||||
|
||||
-- Default source lists
|
||||
if not source_list then
|
||||
-- Main inventory for most container types
|
||||
if sctype == 2 or sctype == 3 or sctype == 5 or sctype == 6 or sctype == 7 then
|
||||
source_list = "main"
|
||||
-- Furnace: output
|
||||
elseif sctype == 4 then
|
||||
source_list = "dst"
|
||||
-- Unknown source container type. Bail out
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- Automatically select stack slot ID if set to automatic
|
||||
if not source_stack_id then
|
||||
source_stack_id = -1
|
||||
end
|
||||
if source_stack_id == -1 then
|
||||
local cond = nil
|
||||
-- Prevent shulker box inception
|
||||
if dctype == 3 then
|
||||
cond = is_not_shulker_box
|
||||
end
|
||||
source_stack_id = mcl_util.get_eligible_transfer_item_slot(sinv, source_list, dinv, dpos, cond)
|
||||
if not source_stack_id then
|
||||
-- Try again if source is a double container
|
||||
if sctype == 5 then
|
||||
spos = mcl_util.get_double_container_neighbor_pos(spos, snode.param2, "left")
|
||||
smeta = minetest.get_meta(spos)
|
||||
sinv = smeta:get_inventory()
|
||||
|
||||
source_stack_id = mcl_util.get_eligible_transfer_item_slot(sinv, source_list, dinv, dpos, cond)
|
||||
if not source_stack_id then
|
||||
return false
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Abort transfer if shulker box wants to go into shulker box
|
||||
if dctype == 3 then
|
||||
local stack = sinv:get_stack(source_list, source_stack_id)
|
||||
if stack and minetest.get_item_group(stack:get_name(), "shulker_box") == 1 then
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- Container type 7 does not allow any placement
|
||||
if dctype == 7 then
|
||||
return false
|
||||
end
|
||||
|
||||
-- If it's a container, put it into the container
|
||||
if dctype ~= 0 then
|
||||
-- Automatically select a destination list if omitted
|
||||
if not destination_list then
|
||||
-- Main inventory for most container types
|
||||
if dctype == 2 or dctype == 3 or dctype == 5 or dctype == 6 or dctype == 7 then
|
||||
destination_list = "main"
|
||||
-- Furnace source slot
|
||||
elseif dctype == 4 then
|
||||
destination_list = "src"
|
||||
end
|
||||
end
|
||||
if destination_list then
|
||||
-- Move item
|
||||
local ok = mcl_util.move_item(sinv, source_list, source_stack_id, dinv, destination_list)
|
||||
|
||||
-- Try transfer to neighbor node if transfer failed and double container
|
||||
if not ok and dctype == 5 then
|
||||
dpos = mcl_util.get_double_container_neighbor_pos(dpos, dnode.param2, "left")
|
||||
dmeta = minetest.get_meta(dpos)
|
||||
dinv = dmeta:get_inventory()
|
||||
|
||||
ok = mcl_util.move_item(sinv, source_list, source_stack_id, dinv, destination_list)
|
||||
end
|
||||
|
||||
-- Update furnace
|
||||
if ok and dctype == 4 then
|
||||
-- Start furnace's timer function, it will sort out whether furnace can burn or not.
|
||||
minetest.get_node_timer(dpos):start(1.0)
|
||||
end
|
||||
|
||||
return ok
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Try pulling from source inventory to hopper inventory
|
||||
---@param pos Vector
|
||||
---@param src_pos Vector
|
||||
function mcl_util.hopper_pull(pos, src_pos)
|
||||
local hop_inv = minetest.get_meta(pos):get_inventory()
|
||||
local hop_list = 'main'
|
||||
|
||||
-- Get node pos' for item transfer
|
||||
local src = minetest.get_node(src_pos)
|
||||
if not minetest.registered_nodes[src.name] then return end
|
||||
local src_type = minetest.get_item_group(src.name, "container")
|
||||
if src_type ~= 2 then return end
|
||||
local src_def = minetest.registered_nodes[src.name]
|
||||
|
||||
local src_list = 'main'
|
||||
local src_inv, stack_id
|
||||
|
||||
if src_def._mcl_hoppers_on_try_pull then
|
||||
src_inv, src_list, stack_id = src_def._mcl_hoppers_on_try_pull(src_pos, pos, hop_inv, hop_list)
|
||||
else
|
||||
local src_meta = minetest.get_meta(src_pos)
|
||||
src_inv = src_meta:get_inventory()
|
||||
stack_id = mcl_util.select_stack(src_inv, src_list, hop_inv, hop_list)
|
||||
end
|
||||
|
||||
if stack_id ~= nil then
|
||||
local ok = mcl_util.move_item(src_inv, src_list, stack_id, hop_inv, hop_list)
|
||||
if src_def._mcl_hoppers_on_after_pull then
|
||||
src_def._mcl_hoppers_on_after_pull(src_pos)
|
||||
end
|
||||
end
|
||||
-- Returns the ID of the first non-empty slot in the given inventory list
|
||||
-- or nil, if inventory is empty.
|
||||
function mcl_util.get_first_occupied_inventory_slot(inventory, listname)
|
||||
return mcl_util.get_eligible_transfer_item_slot(inventory, listname)
|
||||
end
|
||||
|
||||
local function drop_item_stack(pos, stack)
|
||||
|
@ -543,7 +602,7 @@ function mcl_util.deal_damage(target, damage, mcl_reason)
|
|||
end
|
||||
return
|
||||
end
|
||||
elseif not target:is_player() then return end
|
||||
end
|
||||
|
||||
local is_immortal = target:get_armor_groups().immortal or 0
|
||||
if is_immortal>0 then
|
||||
|
@ -1032,62 +1091,3 @@ function mcl_util.get_colorwallmounted_rotation(pos)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
---Move items from one inventory list to another, drop items that do not fit in provided pos and direction.
|
||||
---@param src_inv mt.InvRef
|
||||
---@param src_listname string
|
||||
---@param out_inv mt.InvRef
|
||||
---@param out_listname string
|
||||
---@param pos mt.Vector Position to throw items at
|
||||
---@param dir? mt.Vector Direction to throw items in
|
||||
---@param insta_collect? boolean Enable instant collection, let players collect dropped items instantly. Default `false`
|
||||
function mcl_util.move_list(src_inv, src_listname, out_inv, out_listname, pos, dir, insta_collect)
|
||||
local src_list = src_inv:get_list(src_listname)
|
||||
|
||||
if not src_list then return end
|
||||
for i, stack in ipairs(src_list) do
|
||||
if out_inv:room_for_item(out_listname, stack) then
|
||||
out_inv:add_item(out_listname, stack)
|
||||
else
|
||||
local p = vector.copy(pos)
|
||||
p.x = p.x + (math.random(1, 3) * 0.2)
|
||||
p.z = p.z + (math.random(1, 3) * 0.2)
|
||||
|
||||
local obj = minetest.add_item(p, stack)
|
||||
if obj then
|
||||
if dir then
|
||||
local v = vector.copy(dir)
|
||||
v.x = v.x * 4
|
||||
v.y = v.y * 4 + 2
|
||||
v.z = v.z * 4
|
||||
obj:set_velocity(v)
|
||||
mcl_util.mcl_log("item velocity calculated "..vector.to_string(v), "[mcl_util]")
|
||||
end
|
||||
if not insta_collect then
|
||||
obj:get_luaentity()._insta_collect = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
stack:clear()
|
||||
src_inv:set_stack(src_listname, i, stack)
|
||||
end
|
||||
end
|
||||
|
||||
---Move items from a player's inventory list to its main inventory list, drop items that do not fit in front of him.
|
||||
---@param player mt.PlayerObjectRef
|
||||
---@param src_listname string
|
||||
function mcl_util.move_player_list(player, src_listname)
|
||||
mcl_util.move_list(player:get_inventory(), src_listname, player:get_inventory(), "main",
|
||||
vector.offset(player:get_pos(), 0, 1.2, 0),
|
||||
player:get_look_dir(), false)
|
||||
end
|
||||
|
||||
function mcl_util.is_it_christmas()
|
||||
local date = os.date("*t")
|
||||
if date.month == 12 and date.day >= 24 or date.month == 1 and date.day <= 7 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -62,13 +62,8 @@ end
|
|||
local function set_double_attach(boat)
|
||||
boat._driver:set_attach(boat.object, "",
|
||||
{x = 0, y = 0.42, z = 0.8}, {x = 0, y = 0, z = 0})
|
||||
if boat._passenger:is_player() then
|
||||
boat._passenger:set_attach(boat.object, "",
|
||||
{x = 0, y = 0.42, z = -6.2}, {x = 0, y = 0, z = 0})
|
||||
else
|
||||
boat._passenger:set_attach(boat.object, "",
|
||||
{x = 0, y = 0.42, z = -4.5}, {x = 0, y = 270, z = 0})
|
||||
end
|
||||
boat._passenger:set_attach(boat.object, "",
|
||||
{x = 0, y = 0.42, z = -2.2}, {x = 0, y = 0, z = 0})
|
||||
end
|
||||
local function set_choat_attach(boat)
|
||||
boat._driver:set_attach(boat.object, "",
|
||||
|
@ -160,7 +155,7 @@ local boat = {
|
|||
minetest.register_on_respawnplayer(detach_object)
|
||||
|
||||
function boat.on_rightclick(self, clicker)
|
||||
if self._passenger or not clicker or clicker:get_attach() or (self.name == "mcl_boats:chest_boat" and self._driver) then
|
||||
if self._passenger or not clicker or clicker:get_attach() then
|
||||
return
|
||||
end
|
||||
attach_object(self, clicker)
|
||||
|
@ -442,9 +437,9 @@ cboat.selectionbox = {-0.7, -0.15, -0.7, 0.7, 0.75, 0.7}
|
|||
minetest.register_entity("mcl_boats:chest_boat", cboat)
|
||||
mcl_entity_invs.register_inv("mcl_boats:chest_boat","Boat",27)
|
||||
|
||||
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak", "boat_obsidian", "boat_mangrove", "boat_cherry", "chest_boat", "chest_boat_spruce", "chest_boat_birch", "chest_boat_jungle", "chest_boat_acacia", "chest_boat_dark_oak", "chest_boat_mangrove", "chest_boat_cherry" }
|
||||
local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat"), S("Obsidian Boat"), S("Mangrove Boat"), S("Cherry Boat"), S("Oak Chest Boat"), S("Spruce Chest Boat"), S("Birch Chest Boat"), S("Jungle Chest Boat"), S("Acacia Chest Boat"), S("Dark Oak Chest Boat"), S("Mangrove Chest Boat"), S("Cherry Chest Boat") }
|
||||
local craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood", "mcl_core:obsidian", "mcl_mangrove:mangrove_wood", "mcl_cherry_blossom:cherrywood" }
|
||||
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak", "boat_obsidian", "boat_mangrove", "chest_boat", "chest_boat_spruce", "chest_boat_birch", "chest_boat_jungle", "chest_boat_acacia", "chest_boat_dark_oak", "chest_boat_mangrove" }
|
||||
local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat"), S("Obsidian Boat"), S("Mangrove Boat"), S("Oak Chest Boat"), S("Spruce Chest Boat"), S("Birch Chest Boat"), S("Jungle Chest Boat"), S("Acacia Chest Boat"), S("Dark Oak Chest Boat"), S("Mangrove Chest Boat") }
|
||||
local craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood", "mcl_core:obsidian", "mcl_mangrove:mangrove_wood" }
|
||||
|
||||
for b=1, #boat_ids do
|
||||
local itemstring = "mcl_boats:"..boat_ids[b]
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=Akaciebåd
|
||||
Birch Boat=Birkebåd
|
||||
Boat=Båd
|
||||
Boats are used to travel on the surface of water.=Både blier brugt til at rejse på vandoverflader.
|
||||
Dark Oak Boat=Mørk egetræsbåd
|
||||
Jungle Boat=Junglebåd
|
||||
Oak Boat=Egetræsbåd
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Højre-klik på en vand for at placere båden. Højre-klik på båden for at gå ombord. Brug [Left] og [Right] til at styre. [Forwards] for at øge hastigheden, og [Backwards] for at sænke farten eller sejle bagud. Brug [Sneak] for at forlade båden, slå båden for at lave den om til en genstand.
|
||||
Spruce Boat=Granbåd
|
||||
Water vehicle=Vandfartøj
|
||||
Sneak to dismount=Snig for at stige ud
|
||||
Obsidian Boat=Obsidianbåd
|
|
@ -8,6 +8,3 @@ Jungle Boat=Barca de la selva
|
|||
Oak Boat=Barca de roble
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Haga clic derecho en una fuente de agua para colocar el barco. Haga clic derecho en el barco para entrar. Utilice [Izquierda] y [Derecha] para dirigir, [Adelante] para acelerar y [Atrás] para reducir la velocidad o retroceder. Haga clic derecho en el barco nuevamente para dejarlo, golpee el barco para que se caiga como un artículo.
|
||||
Spruce Boat=Barca de abeto
|
||||
Water vehicle=Vehículo acuático
|
||||
Sneak to dismount=Agáchate para bajar
|
||||
Obsidian Boat=Barca de obsidiana
|
||||
|
|
|
@ -11,13 +11,3 @@ Spruce Boat=Bateau en sapin
|
|||
Water vehicle=Véhicule aquatique
|
||||
Sneak to dismount=Se baisser pour descendre
|
||||
Obsidian Boat=Bateau en obsidienne
|
||||
Mangrove Boat=Bateau en palétuvier
|
||||
Cherry Boat=Bateau en cerisier
|
||||
Oak Chest Boat=Bateau en chêne avec coffre
|
||||
Spruce Chest Boat=Bateau en sapin avec coffre
|
||||
Birch Chest Boat=Bateau en bouleau avec coffre
|
||||
Jungle Chest Boat=Bateau en acajou avec coffre
|
||||
Acacia Chest Boat=Bateau en acacia avec coffre
|
||||
Dark Oak Chest Boat=Bateau en chêne noir avec coffre
|
||||
Mangrove Chest Boat=Bateau en palétuvier avec coffre
|
||||
Cherry Chest Boat=Bateau en cerisier avec coffre
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=Barco de Acácia
|
||||
Birch Boat=Barco de Bétula
|
||||
Boat=Barco
|
||||
Boats are used to travel on the surface of water.=Barcos são usados para viajar na superfície da água
|
||||
Dark Oak Boat=Barco de Carvalho Escuro
|
||||
Jungle Boat=Barco de Selva
|
||||
Oak Boat=Barco de Carvalho
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Clique com o botão direito em uma fonte de água para posicionar o barco. Clique com o botão direito no barco para entrar nele. Use [Esquerda] e [Direita] para fazer curva, [Frente] para acelerar e [Trás] para frear e ir para trás. Use [Agachar] para deixar o barco, soque-o para fazê-lo dropar como um item.
|
||||
Spruce Boat=Barco de Pinheiro
|
||||
Water vehicle=Veículo aquático
|
||||
Sneak to dismount=Agache para desmontar
|
||||
Obsidian Boat=Barco de Obsidiana
|
||||
Mangrove Boat=Barco de Mangue
|
||||
Cherry Boat=Barco de Cerejeira
|
||||
Oak Chest Boat=Barco de Carvalho com Baú
|
||||
Spruce Chest Boat=Barco de Pinheiro com Baú
|
||||
Birch Chest Boat=Barco de Bétula com Baú
|
||||
Jungle Chest Boat=Barco de Selva com Baú
|
||||
Acacia Chest Boat=Barco de Acácia com Baú
|
||||
Dark Oak Chest Boat=Barco de Carvalho Escuro com Baú
|
||||
Mangrove Chest Boat=Barco de Mangue com Baú
|
||||
Cherry Chest Boat=Barco de Cerejeira com Baú
|
|
@ -1,23 +1,11 @@
|
|||
# textdomain: mcl_boats
|
||||
Acacia Boat=Акациевая лодка
|
||||
Acacia Boat=Лодка из акации
|
||||
Birch Boat=Берёзовая лодка
|
||||
Boat=Лодка
|
||||
Boats are used to travel on the surface of water.=На лодке можно плыть по водной поверхности.
|
||||
Boats are used to travel on the surface of water.=С помощью лодки можно путешествовать по водной поверхности.
|
||||
Dark Oak Boat=Лодка из тёмного дуба
|
||||
Jungle Boat=Лодка из тропического дерева
|
||||
Jungle Boat=Лодка из дерева джунглей
|
||||
Oak Boat=Дубовая лодка
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Правый клик на воде, чтобы установить лодку. Правый клик по лодке, чтобы сесть в нее. [Влево] и [Вправо] - рулить, [Вперед] - разгоняться, [Назад] - тормозить или плыть назад. Нажмите [Красться] для высадки, бейте по лодке, чтобы забрать её.
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Правый клик по воде спустит лодку на воду. Правый клик по лодке разместит вас в ней. [Влево] и [Вправо] - рулить, [Вперед] - разгоняться, [Назад] - тормозить или плыть назад. Правый клик по лодке, когда вы в ней, позволит выйти из неё. Удар по лодке превратит её обратно в предмет.
|
||||
Spruce Boat=Еловая лодка
|
||||
Water vehicle=Водный транспорт
|
||||
Sneak to dismount=Нажмите [Красться] для высадки
|
||||
Obsidian Boat=Обсидиановая лодка
|
||||
Mangrove Boat=Мангровая лодка
|
||||
Cherry Boat=Вишнёвая лодка
|
||||
Oak Chest Boat=Дубовая лодка с сундуком
|
||||
Spruce Chest Boat=Еловая лодка с сундуком
|
||||
Birch Chest Boat=Берёзовая лодка с сундуком
|
||||
Jungle Chest Boat=Лодка из тропического дерева с сундуком
|
||||
Acacia Chest Boat=Акациевая лодка с сундуком
|
||||
Dark Oak Chest Boat=Лодка из тёмного дуба с сундуком
|
||||
Mangrove Chest Boat=Мангровая лодка с сундуком
|
||||
Cherry Chest Boat=Вишнёвая лодка с сундуком
|
|
@ -10,14 +10,4 @@ Rightclick on a water source to place the boat. Rightclick the boat to enter it.
|
|||
Spruce Boat=
|
||||
Water vehicle=
|
||||
Sneak to dismount=
|
||||
Obsidian Boat=
|
||||
Mangrove Boat=
|
||||
Cherry Boat=
|
||||
Oak Chest Boat=
|
||||
Spruce Chest Boat=
|
||||
Birch Chest Boat=
|
||||
Jungle Chest Boat=
|
||||
Acacia Chest Boat=
|
||||
Dark Oak Chest Boat=
|
||||
Mangrove Chest Boat=
|
||||
Cherry Chest Boat=
|
||||
Obsidian Boat=
|
|
@ -5,12 +5,7 @@ function mcl_burning.get_storage(obj)
|
|||
end
|
||||
|
||||
function mcl_burning.is_burning(obj)
|
||||
local storage = mcl_burning.get_storage(obj)
|
||||
if storage then
|
||||
return mcl_burning.get_storage(obj).burn_time
|
||||
else
|
||||
return false
|
||||
end
|
||||
return mcl_burning.get_storage(obj).burn_time
|
||||
end
|
||||
|
||||
function mcl_burning.is_affected_by_rain(obj)
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
# mcl_dripping
|
||||
|
||||
Dripping Mod by kddekadenz, modified for MineClone 2 by Wuzzy, NO11 and AFCM
|
||||
|
||||
## Manual
|
||||
|
||||
- drops are generated rarely under solid nodes
|
||||
- they will stay some time at the generated block and than they fall down
|
||||
- when they collide with the ground, a sound is played and they are destroyed
|
||||
|
||||
Water and Lava have builtin drops registered.
|
||||
|
||||
## License
|
||||
|
||||
code & sounds: CC0
|
||||
|
||||
## API
|
||||
|
||||
```lua
|
||||
mcl_dripping.register_drop({
|
||||
-- The group the liquid's nodes belong to
|
||||
liquid = "water",
|
||||
-- The texture used (particles will take a random 2x2 area of it)
|
||||
texture = "mcl_core_water_source_animation.png",
|
||||
-- Define particle glow, ranges from `0` to `minetest.LIGHT_MAX`
|
||||
light = 1,
|
||||
-- The nodes (or node group) the particles will spawn under
|
||||
nodes = { "group:opaque", "group:leaves" },
|
||||
-- The sound that will be played then the particle detaches from the roof, see SimpleSoundSpec in lua_api.txt
|
||||
sound = "drippingwater_drip",
|
||||
-- The interval for the ABM to run
|
||||
interval = 60,
|
||||
-- The chance of the ABM
|
||||
chance = 10,
|
||||
})
|
||||
```
|
||||
# mcl_dripping
|
||||
|
||||
Dripping Mod by kddekadenz, modified for MineClone 2 by Wuzzy, NO11 and AFCM
|
||||
|
||||
## Manual
|
||||
|
||||
- drops are generated rarely under solid nodes
|
||||
- they will stay some time at the generated block and than they fall down
|
||||
- when they collide with the ground, a sound is played and they are destroyed
|
||||
|
||||
Water and Lava have builtin drops registered.
|
||||
|
||||
## License
|
||||
|
||||
code & sounds: CC0
|
||||
|
||||
## API
|
||||
|
||||
```lua
|
||||
mcl_dripping.register_drop({
|
||||
-- The group the liquid's nodes belong to
|
||||
liquid = "water",
|
||||
-- The texture used (particles will take a random 2x2 area of it)
|
||||
texture = "default_water_source_animated.png",
|
||||
-- Define particle glow, ranges from `0` to `minetest.LIGHT_MAX`
|
||||
light = 1,
|
||||
-- The nodes (or node group) the particles will spawn under
|
||||
nodes = { "group:opaque", "group:leaves" },
|
||||
-- The sound that will be played then the particle detaches from the roof, see SimpleSoundSpec in lua_api.txt
|
||||
sound = "drippingwater_drip",
|
||||
-- The interval for the ABM to run
|
||||
interval = 60,
|
||||
-- The chance of the ABM
|
||||
chance = 10,
|
||||
})
|
||||
```
|
||||
|
|
|
@ -82,7 +82,7 @@ end
|
|||
|
||||
mcl_dripping.register_drop({
|
||||
liquid = "water",
|
||||
texture = "mcl_core_water_source_animation.png",
|
||||
texture = "default_water_source_animated.png",
|
||||
light = 1,
|
||||
nodes = { "group:opaque", "group:leaves" },
|
||||
sound = "drippingwater_drip",
|
||||
|
@ -92,7 +92,7 @@ mcl_dripping.register_drop({
|
|||
|
||||
mcl_dripping.register_drop({
|
||||
liquid = "lava",
|
||||
texture = "mcl_core_lava_source_animation.png",
|
||||
texture = "default_lava_source_animated.png",
|
||||
light = math.max(7, minetest.registered_nodes["mcl_core:lava_source"].light_source - 3),
|
||||
nodes = { "group:opaque" },
|
||||
sound = "drippingwater_lavadrip",
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 blev smadret af en nedfaldende ambolt.
|
||||
@1 was smashed by a falling block.=@1 blev smadret af en nedfaldende blok.
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 fue aplastado por un yunque.
|
||||
@1 was smashed by a falling block.=@1 fue aplastado por un bloque.
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 a été écrasé par une enclume
|
||||
@1 was smashed by a falling block.=@1 a été écrasé par un bloc
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 foi esmagado(a) por uma bigorna em queda.
|
||||
@1 was smashed by a falling block.=@1 foi esmagado(a) por um bloco em queda.
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=@1 был(а) раздавлен(а) падающей наковальней.
|
||||
@1 was smashed by a falling block.=@1 был(а) раздавлен(а) падающим блоком.
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: mcl_falling_nodes
|
||||
@1 was smashed by a falling anvil.=
|
||||
@1 was smashed by a falling block.=
|
|
@ -362,121 +362,6 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
end
|
||||
end
|
||||
|
||||
-- the following code is pulled from Minetest builtin without changes except for the call order being changed,
|
||||
-- until a comment saying explicitly it's the end of such code
|
||||
-- TODO if this gets a fix in the engine, remove the block of code
|
||||
local function user_name(user)
|
||||
return user and user:get_player_name() or ""
|
||||
end
|
||||
-- Returns a logging function. For empty names, does not log.
|
||||
local function make_log(name)
|
||||
return name ~= "" and minetest.log or function() end
|
||||
end
|
||||
function minetest.node_dig(pos, node, digger)
|
||||
local diggername = user_name(digger)
|
||||
local log = make_log(diggername)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
-- Copy pos because the callback could modify it
|
||||
if def and (not def.diggable or
|
||||
(def.can_dig and not def.can_dig(vector.copy(pos), digger))) then
|
||||
log("info", diggername .. " tried to dig "
|
||||
.. node.name .. " which is not diggable "
|
||||
.. minetest.pos_to_string(pos))
|
||||
return false
|
||||
end
|
||||
|
||||
if minetest.is_protected(pos, diggername) then
|
||||
log("action", diggername
|
||||
.. " tried to dig " .. node.name
|
||||
.. " at protected position "
|
||||
.. minetest.pos_to_string(pos))
|
||||
minetest.record_protection_violation(pos, diggername)
|
||||
return false
|
||||
end
|
||||
|
||||
log('action', diggername .. " digs "
|
||||
.. node.name .. " at " .. minetest.pos_to_string(pos))
|
||||
|
||||
local wielded = digger and digger:get_wielded_item()
|
||||
local drops = minetest.get_node_drops(node, wielded and wielded:get_name())
|
||||
|
||||
-- Check to see if metadata should be preserved.
|
||||
if def and def.preserve_metadata then
|
||||
local oldmeta = minetest.get_meta(pos):to_table().fields
|
||||
-- Copy pos and node because the callback can modify them.
|
||||
local pos_copy = vector.copy(pos)
|
||||
local node_copy = {name=node.name, param1=node.param1, param2=node.param2}
|
||||
local drop_stacks = {}
|
||||
for k, v in pairs(drops) do
|
||||
drop_stacks[k] = ItemStack(v)
|
||||
end
|
||||
drops = drop_stacks
|
||||
def.preserve_metadata(pos_copy, node_copy, oldmeta, drops)
|
||||
end
|
||||
|
||||
-- Handle drops
|
||||
minetest.handle_node_drops(pos, drops, digger)
|
||||
|
||||
if wielded then
|
||||
local wdef = wielded:get_definition()
|
||||
local tp = wielded:get_tool_capabilities()
|
||||
local dp = minetest.get_dig_params(def and def.groups, tp, wielded:get_wear())
|
||||
if wdef and wdef.after_use then
|
||||
wielded = wdef.after_use(wielded, digger, node, dp) or wielded
|
||||
else
|
||||
-- Wear out tool
|
||||
if not minetest.is_creative_enabled(diggername) then
|
||||
wielded:add_wear(dp.wear)
|
||||
if wielded:get_count() == 0 and wdef.sound and wdef.sound.breaks then
|
||||
minetest.sound_play(wdef.sound.breaks, {
|
||||
pos = pos,
|
||||
gain = 0.5
|
||||
}, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
digger:set_wielded_item(wielded)
|
||||
end
|
||||
|
||||
local oldmetadata = nil
|
||||
if def and def.after_dig_node then
|
||||
oldmetadata = minetest.get_meta(pos):to_table()
|
||||
end
|
||||
|
||||
-- Remove node and update
|
||||
minetest.remove_node(pos)
|
||||
|
||||
-- Play sound if it was done by a player
|
||||
if diggername ~= "" and def and def.sounds and def.sounds.dug then
|
||||
minetest.sound_play(def.sounds.dug, {
|
||||
pos = pos,
|
||||
exclude_player = diggername,
|
||||
}, true)
|
||||
end
|
||||
|
||||
-- Run callback
|
||||
if def and def.after_dig_node then
|
||||
-- Copy pos and node because callback can modify them
|
||||
local pos_copy = vector.copy(pos)
|
||||
local node_copy = {name=node.name, param1=node.param1, param2=node.param2}
|
||||
def.after_dig_node(pos_copy, node_copy, oldmetadata, digger)
|
||||
end
|
||||
|
||||
-- Run script hook
|
||||
for _, callback in ipairs(minetest.registered_on_dignodes) do
|
||||
local origin = minetest.callback_origins[callback]
|
||||
minetest.set_last_run_mod(origin.mod)
|
||||
|
||||
-- Copy pos and node because callback can modify them
|
||||
local pos_copy = vector.copy(pos)
|
||||
local node_copy = {name=node.name, param1=node.param1, param2=node.param2}
|
||||
callback(pos_copy, node_copy, digger)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
-- end of code pulled from Minetest
|
||||
|
||||
-- Drop single items by default
|
||||
function minetest.item_drop(itemstack, dropper, pos)
|
||||
if dropper and dropper:is_player() then
|
||||
|
@ -736,17 +621,13 @@ minetest.register_entity(":__builtin:item", {
|
|||
if speed ~= nil then self.random_velocity = speed end
|
||||
|
||||
local vel = self.object:get_velocity()
|
||||
|
||||
-- There is perhaps a cleverer way of making this physical so it bounces off the wall like swords.
|
||||
local max_vel = 6.5 -- Faster than this and it throws it into the wall / floor and turns black because of clipping.
|
||||
|
||||
if vel and vel.x == 0 and vel.z == 0 and self.random_velocity > 0 then
|
||||
local v = self.random_velocity
|
||||
local x = math.random(5, max_vel) / 10 * v
|
||||
local x = math.random(5, 10) / 10 * v
|
||||
if math.random(0, 10) < 5 then x = -x end
|
||||
local z = math.random(5, max_vel) / 10 * v
|
||||
local z = math.random(5, 10) / 10 * v
|
||||
if math.random(0, 10) < 5 then z = -z end
|
||||
local y = math.random(1, 2)
|
||||
local y = math.random(2, 4)
|
||||
self.object:set_velocity(vector.new(x, y, z))
|
||||
end
|
||||
self.random_velocity = 0
|
||||
|
@ -923,19 +804,11 @@ minetest.register_entity(":__builtin:item", {
|
|||
if total_count > max_count then
|
||||
return false
|
||||
end
|
||||
|
||||
-- Merge the remote stack into this one
|
||||
local self_pos = self.object:get_pos()
|
||||
local pos = object:get_pos()
|
||||
|
||||
--local y = pos.y + ((total_count - count) / max_count) * 0.15
|
||||
local x_diff = (self_pos.x - pos.x) / 2
|
||||
local z_diff = (self_pos.z - pos.z) / 2
|
||||
|
||||
local new_pos = vector.offset(pos, x_diff, 0, z_diff)
|
||||
new_pos.y = math.max(self_pos.y, pos.y) + 0.1
|
||||
|
||||
self.object:move_to(new_pos)
|
||||
-- local pos = object:get_pos()
|
||||
-- pos.y = pos.y + ((total_count - count) / max_count) * 0.15
|
||||
-- self.object:move_to(pos)
|
||||
|
||||
self.age = 0 -- Handle as new entity
|
||||
own_stack:set_count(total_count)
|
||||
|
@ -956,7 +829,6 @@ minetest.register_entity(":__builtin:item", {
|
|||
self.object:set_acceleration(vector.zero())
|
||||
return
|
||||
end
|
||||
|
||||
self.age = self.age + dtime
|
||||
if self._collector_timer then
|
||||
self._collector_timer = self._collector_timer + dtime
|
||||
|
@ -986,9 +858,6 @@ minetest.register_entity(":__builtin:item", {
|
|||
return
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
if self.is_clock then
|
||||
self.object:set_properties({
|
||||
textures = { "mcl_clock:clock_" .. (mcl_worlds.clock_works(p) and mcl_clock.old_time or mcl_clock.random_frame) }
|
||||
|
@ -1038,13 +907,14 @@ minetest.register_entity(":__builtin:item", {
|
|||
local is_on_floor = def and (def.walkable
|
||||
and not def.groups.slippery and v.y == 0)
|
||||
|
||||
if not minetest.registered_nodes[nn] or is_floating or is_on_floor then
|
||||
|
||||
if not minetest.registered_nodes[nn]
|
||||
or is_floating or is_on_floor then
|
||||
local own_stack = ItemStack(self.object:get_luaentity().itemstring)
|
||||
-- Merge with close entities of the same item
|
||||
for _, object in pairs(minetest.get_objects_inside_radius(p, 0.8)) do
|
||||
local obj = object:get_luaentity()
|
||||
if obj and obj.name == "__builtin:item" and obj.physical_state == false then
|
||||
if obj and obj.name == "__builtin:item"
|
||||
and obj.physical_state == false then
|
||||
if self:try_merge_with(own_stack, object, obj) then
|
||||
return
|
||||
end
|
||||
|
|
|
@ -85,93 +85,101 @@ local function hopper_take_item(self, dtime)
|
|||
for k, v in pairs(objs) do
|
||||
local ent = v:get_luaentity()
|
||||
|
||||
if ent and not ent._removed and ent.itemstring and ent.itemstring ~= "" then
|
||||
local taken_items = false
|
||||
if ent._removed or not ent.itemstring or ent.itemstring == "" then
|
||||
--minetest.log("Ignore this item")
|
||||
break
|
||||
end
|
||||
|
||||
mcl_log("ent.name: " .. tostring(ent.name))
|
||||
mcl_log("ent pos: " .. tostring(ent.object:get_pos()))
|
||||
-- Don't forget actual hoppers
|
||||
|
||||
local inv = mcl_entity_invs.load_inv(self, 5)
|
||||
if not inv then return false end
|
||||
local taken_items = false
|
||||
|
||||
local current_itemstack = ItemStack(ent.itemstring)
|
||||
mcl_log("ent.name: " .. tostring(ent.name))
|
||||
mcl_log("ent pos: " .. tostring(ent.object:get_pos()))
|
||||
|
||||
mcl_log("inv. size: " .. self._inv_size)
|
||||
if inv:room_for_item("main", current_itemstack) then
|
||||
mcl_log("Room")
|
||||
inv:add_item("main", current_itemstack)
|
||||
ent.object:get_luaentity().itemstring = ""
|
||||
ent.object:remove()
|
||||
taken_items = true
|
||||
else
|
||||
mcl_log("no Room")
|
||||
end
|
||||
local inv = mcl_entity_invs.load_inv(self, 5)
|
||||
|
||||
if not taken_items then
|
||||
local items_remaining = current_itemstack:get_count()
|
||||
if not inv then
|
||||
mcl_log("No inv")
|
||||
return false
|
||||
end
|
||||
|
||||
-- This will take part of a floating item stack if no slot can hold the full amount
|
||||
for i = 1, self._inv_size, 1 do
|
||||
local stack = inv:get_stack("main", i)
|
||||
local current_itemstack = ItemStack(ent.itemstring)
|
||||
|
||||
mcl_log("i: " .. tostring(i))
|
||||
mcl_log("Items remaining: " .. items_remaining)
|
||||
mcl_log("Name: " .. tostring(stack:get_name()))
|
||||
mcl_log("inv. size: " .. self._inv_size)
|
||||
if inv:room_for_item("main", current_itemstack) then
|
||||
mcl_log("Room")
|
||||
inv:add_item("main", current_itemstack)
|
||||
ent.object:get_luaentity().itemstring = ""
|
||||
ent.object:remove()
|
||||
taken_items = true
|
||||
else
|
||||
mcl_log("no Room")
|
||||
end
|
||||
|
||||
if current_itemstack:get_name() == stack:get_name() then
|
||||
mcl_log("We have a match. Name: " .. tostring(stack:get_name()))
|
||||
if not taken_items then
|
||||
local items_remaining = current_itemstack:get_count()
|
||||
|
||||
local room_for = stack:get_stack_max() - stack:get_count()
|
||||
mcl_log("Room for: " .. tostring(room_for))
|
||||
-- This will take part of a floating item stack if no slot can hold the full amount
|
||||
for i = 1, self._inv_size, 1 do
|
||||
local stack = inv:get_stack("main", i)
|
||||
|
||||
if room_for == 0 then
|
||||
-- Do nothing
|
||||
mcl_log("No room")
|
||||
elseif room_for < items_remaining then
|
||||
mcl_log("We have more items remaining than space")
|
||||
mcl_log("i: " .. tostring(i))
|
||||
mcl_log("Items remaining: " .. items_remaining)
|
||||
mcl_log("Name: " .. tostring(stack:get_name()))
|
||||
|
||||
items_remaining = items_remaining - room_for
|
||||
stack:set_count(stack:get_stack_max())
|
||||
inv:set_stack("main", i, stack)
|
||||
taken_items = true
|
||||
else
|
||||
local new_stack_size = stack:get_count() + items_remaining
|
||||
stack:set_count(new_stack_size)
|
||||
mcl_log("We have more than enough space. Now holds: " .. new_stack_size)
|
||||
if current_itemstack:get_name() == stack:get_name() then
|
||||
mcl_log("We have a match. Name: " .. tostring(stack:get_name()))
|
||||
|
||||
inv:set_stack("main", i, stack)
|
||||
items_remaining = 0
|
||||
local room_for = stack:get_stack_max() - stack:get_count()
|
||||
mcl_log("Room for: " .. tostring(room_for))
|
||||
|
||||
ent.object:get_luaentity().itemstring = ""
|
||||
ent.object:remove()
|
||||
if room_for == 0 then
|
||||
-- Do nothing
|
||||
mcl_log("No room")
|
||||
elseif room_for < items_remaining then
|
||||
mcl_log("We have more items remaining than space")
|
||||
|
||||
taken_items = true
|
||||
break
|
||||
end
|
||||
items_remaining = items_remaining - room_for
|
||||
stack:set_count(stack:get_stack_max())
|
||||
inv:set_stack("main", i, stack)
|
||||
taken_items = true
|
||||
else
|
||||
local new_stack_size = stack:get_count() + items_remaining
|
||||
stack:set_count(new_stack_size)
|
||||
mcl_log("We have more than enough space. Now holds: " .. new_stack_size)
|
||||
|
||||
mcl_log("Count: " .. tostring(stack:get_count()))
|
||||
mcl_log("stack max: " .. tostring(stack:get_stack_max()))
|
||||
--mcl_log("Is it empty: " .. stack:to_string())
|
||||
inv:set_stack("main", i, stack)
|
||||
items_remaining = 0
|
||||
|
||||
ent.object:get_luaentity().itemstring = ""
|
||||
ent.object:remove()
|
||||
|
||||
taken_items = true
|
||||
break
|
||||
end
|
||||
|
||||
if i == self._inv_size and taken_items then
|
||||
mcl_log("We are on last item and still have items left. Set final stack size: " .. items_remaining)
|
||||
current_itemstack:set_count(items_remaining)
|
||||
--mcl_log("Itemstack2: " .. current_itemstack:to_string())
|
||||
ent.itemstring = current_itemstack:to_string()
|
||||
end
|
||||
mcl_log("Count: " .. tostring(stack:get_count()))
|
||||
mcl_log("stack max: " .. tostring(stack:get_stack_max()))
|
||||
--mcl_log("Is it empty: " .. stack:to_string())
|
||||
end
|
||||
|
||||
if i == self._inv_size and taken_items then
|
||||
mcl_log("We are on last item and still have items left. Set final stack size: " .. items_remaining)
|
||||
current_itemstack:set_count(items_remaining)
|
||||
--mcl_log("Itemstack2: " .. current_itemstack:to_string())
|
||||
ent.itemstring = current_itemstack:to_string()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--Add in, and delete
|
||||
if taken_items then
|
||||
mcl_log("Saving")
|
||||
mcl_entity_invs.save_inv(ent)
|
||||
return taken_items
|
||||
else
|
||||
mcl_log("No need to save")
|
||||
end
|
||||
|
||||
--Add in, and delete
|
||||
if taken_items then
|
||||
mcl_log("Saving")
|
||||
mcl_entity_invs.save_inv(ent)
|
||||
return taken_items
|
||||
else
|
||||
mcl_log("No need to save")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -362,10 +370,13 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
|
|||
end
|
||||
end
|
||||
end
|
||||
-- Make room in the minecart after the mob dies
|
||||
elseif self._passenger then
|
||||
local passenger_pos = self._passenger.object:get_pos()
|
||||
if not passenger_pos then
|
||||
self._passenger = nil
|
||||
if math.random(1,20) == 1 then
|
||||
local dead = self._passenger:check_for_death()
|
||||
if dead == true then
|
||||
self._passenger = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=Minevogn
|
||||
Minecarts can be used for a quick transportion on rails.=Minevogne kan bruges til hurtig transport på spor.
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Minevogne kan kun køre på spor, og følger dem altid. Ved et T-kryds uden en vej ligeud drejer de altid til venstre. Farten påvirkes af sportypen.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Du kan placere minevogne på spor. Højre-klik for at stige ombord.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=For at at få minevognen i din oppakning.
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=En minevogn med TNT as et eksplosivt fartøj som kører på spor.
|
||||
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Placér den på spor. Slå den for at flytte den. TNTet bliver antændt med flint og stål eller når minevognen er på et aktiveringsspor.
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=For at få minevognen med TNT i din oppakning skal du slå den mens du holder snigeknappen nede. Du kan ikke gøre dette hvis TNTen er antændt.
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=En minevogn med ovn er et fartøj som kører på spor. Den kan køre af sig selv med brændstof.
|
||||
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Placér den på spor. Hvis du putter kul i den vil ovnen brænde i lang tid, og minevognen vil køre af sig selv. Slå den for at sætte den i bevægelse.
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=For at få minevognen med ovn i din oppakning skal du slå den mens du holder snigeknappen nede.
|
||||
Minecart with Chest=Minevogn med kiste
|
||||
Minecart with Furnace=Minevogn med ovn
|
||||
Minecart with Command Block=Minevogn med kommandoblok
|
||||
Minecart with Hopper=Minevogn med tragt
|
||||
Minecart with TNT=Minevogn med TNT
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Placér dem på jorden for at bygge din jerbane. Sporene kobler sig automatisk sammen med hinanden og laver sving, T-kryds, kryds og skråninger efter behov.
|
||||
Rail=Spor
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Spor kan bruges til at bygge jernbaner til minevogne. Normale spor sænker minevognene en smule på grund af friktionsmodstand.
|
||||
Powered Rail=Strømspor
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Spor kan bruges til at bygge jernbaner til minevogne. Strømspor kan accelerere eller bremse minevogne.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Uden redstonekraft vil sporet bremse minevognen. For at accelerere minevognen skal den bruge redstoneskraft.
|
||||
Activator Rail=Aktiveringsspor
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Spor kan bruges til at bygge jernbaner til minevogne. Aktiveringsspor bruges til at aktivere specielle minevogne.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=For at få dette spor til at aktiere minevogne skal du give det redstonekraft og sende en minevogn over dette sporstykke.
|
||||
Detector Rail=Detektorspor
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Spor kan bruges til at bygge jernbaner til minevogne. Et detektorspor kan opdage en minevogn som kører over det og give kraft til redstonemekanismer.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=For at opdage en minevogn og give redstonekraft skal den forbindes til redstonestøv eller redstonemekanismer og send en hvilkensomhelst minevogn hen over sporet.
|
||||
Track for minecarts=Spor til minevogne.
|
||||
Speed up when powered, slow down when not powered=Accelerérer når der er strøm, sænk hastigheden når der ikke er strøm.
|
||||
Activates minecarts when powered=Aktieverer minevogne når der er strøm.
|
||||
Emits redstone power when a minecart is detected=Udsender redstonekraft når en minevogn bliver opdaget.
|
||||
Vehicle for fast travel on rails=Fartøj til hurtig kørsel på spor.
|
||||
Can be ignited by tools or powered activator rail=Kan antændes med værktøj eller et aktivatorspor med strøm.
|
||||
Sneak to dismount=Snig for at stige af.
|
|
@ -1,36 +0,0 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=Carrinho
|
||||
Minecarts can be used for a quick transportion on rails.=Carrinhos podem ser usados para transporte rápido em trilhos.
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Carrinhos viajam somente em trilhos e sempre seguem os traçados. Em uma junção em T sem linha reta à frente, eles viram à esquerda. A velocidade é afetada pelo tipo do trilho.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Você pode posicionar o carrinho em trilhos. Clique com o botão direito para entrar nele. Soque-o para fazê-lo mover.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=Para obter o carrinho, soque-o enquanto segura pressionada a tecla de agachar.
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=Um carrinho com TNT é um veículo explosivo que viaja nos trilhos.
|
||||
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Posicione-o nos trilhos. Soque-o para movê-lo. A TNT é acesa com um isqueiro ou quando o carrinho está sobre um trilho ativador energizado.
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Para obter o carrinho e a TNT, soque-os enquanto segura pressionada a tecla de agachar. Você não consegue fazer isso se a TNT foi acesa.
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Um carrinho com fornalha é um veículo que viaja nos trilhos. Se move por conta própria com combustível.
|
||||
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Posicione-o nos trilhos. Se você o der um pouco de carvão, a fornalha vai começar a queimar por um longo tempo e o carrinho será capaz de se mover por conta própria. Soque-o para fazê-lo mover.
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=Para obter o carrinho e a fornalha, soque-os enquanto segura pressionada a tecla de agachar.
|
||||
Minecart with Chest=Carrinho com Baú
|
||||
Minecart with Furnace=Carrinho com Fornalha
|
||||
Minecart with Command Block=Carrinho com Bloco de Comandos
|
||||
Minecart with Hopper=Carrinho com Funil
|
||||
Minecart with TNT=Carrinho com TNT
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Posicione-os no chão para construir suas linhas férreas, os trilhos vão conectar-se automaticamente uns nos outros e vão se transformar em curvas, junções em T, cruzamentos e rampas quando necessário.
|
||||
Rail=Trilho
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Trilhos podem ser usados para construir traçados de transporte para carrinhos. Trilhos normais freiam carrinhos gradativamente devido ao atrito.
|
||||
Powered Rail=Trilho Energizador
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Trilhos podem ser usados para construir traçados de transporte para carrinhos. Trilhos energizados são capazes de acelerar e frear carrinhos.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Sem carga de redstone, o trilho vai frear os carrinhos. Para fazer o trilho acelerar os carrinhos, energize-o com uma carga de redstone.
|
||||
Activator Rail=Trilho Ativador
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Trilhos podem ser usados para construir traçados de transporte para carrinhos. Trilhos ativadores são usados para ativar carrinhos especiais.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Para fazer esse trilho ativar os carrinhos, energize-o com uma carga de redstone e envie um carrinho sobre esse pedaço de trilho.
|
||||
Detector Rail=Trilho Detector
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Trilhos podem ser usados para construir traçados de transporte para carrinhos. Um trilho detector é capaz de detectar um carrinho sobre ele e energizar mecanismos de redstone.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Para detectar um carrinho e providenciar carga de redstone, conecte-o em trilhas de redstone ou mecanismos de redstone e envie qualquer carrinho sobre esse trilho.
|
||||
Track for minecarts=Traçado para carrinhos
|
||||
Speed up when powered, slow down when not powered=Acelera quando energizado, desacelera quando não energizado
|
||||
Activates minecarts when powered=Ativa carrinhos quando energizado
|
||||
Emits redstone power when a minecart is detected=Emite carga de redstone quando um carrinho é detectado
|
||||
Vehicle for fast travel on rails=Veículo para viajar rápido em trilhos
|
||||
Can be ignited by tools or powered activator rail=Pode ser aceso por ferramentas ou trilho ativador energizado
|
||||
Sneak to dismount=Agache para desmontar
|
|
@ -1,36 +1,36 @@
|
|||
# textdomain: mcl_minecarts
|
||||
Minecart=Вагонетка
|
||||
Minecarts can be used for a quick transportion on rails.=Вагонетка может быть использована для быстрого перемещения по рельсам.
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Вагонетки едут только по проложенным рельсам. На Т-образной развилке они поворачивают налево. Скорость зависит от типа рельсов.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Вы можете поставить вагонетку на рельсы. Правым кликом сядьте в неё. Ударьте по ней, чтобы она поехала.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=Чтобы забрать вагонетку, ударьте по ней, удерживая клавишу [Красться].
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=Вагонетка с ТНТ это взрывающийся железнодорожный транспорт.
|
||||
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Поместите вагонетку на рельсы. Ударьте по ней, чтобы она поехала. ТНТ активируется, если его поджечь огнивом или когда вагонетка проедет через подключенные активирующие рельсы.
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Чтобы забрать вагонетку с ТНТ, ударьте по ней, удерживая клавишу [Красться]. Если ТНТ подожжён, сделать это нельзя.
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Вагонетка с печью это железнодорожный транспорт. Она может ехать сама за счёт топлива.
|
||||
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Поставьте вагонетку на рельсы. Если добавить в неё угля, то печь будет гореть продолжительное время и вагонетка сможет поехать сама. Ударьте по ней, чтобы она поехала.
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=Чтобы забрать вагонетку с печью, ударьте по ней, удерживая клавишу [Красться].
|
||||
Minecart with Chest=Вагонетка с сундуком
|
||||
Minecart with Furnace=Вагонетка с печью
|
||||
Minecart with Command Block=Вагонетка с командным блоком
|
||||
Minecart with Hopper=Вагонетка с воронкой
|
||||
Minecart with TNT=Вагонетка с ТНТ
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Поместите рельсы на землю, чтобы сделать железную дорогу, рельсы автоматически соединятся между собой и будут образовывать повороты, T-образные развилки, перекрёстки и склоны там, где это потребуется.
|
||||
Minecarts can be used for a quick transportion on rails.=Вагонетки нужны, чтобы быстро перемещаться по рельсам.
|
||||
Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Вагонетки едут строго по проложенному железнодорожному пути. На Т-образной развилке они поворачивают налево. Скорость зависит от типа рельсов.
|
||||
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Вы ставите вагонетку на рельсы. Правым кликом садитесь в неё. Стукаете, чтобы начать движение.
|
||||
To obtain the minecart, punch it while holding down the sneak key.=Чтобы взять вагонетку, стукните её, удерживая клавишу [Красться].
|
||||
A minecart with TNT is an explosive vehicle that travels on rail.=Вагон тротила это подрывной железнодорожный транспорт.
|
||||
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Поместите его на рельсы. Стукните, чтобы он поехал. Тротил воспламеняется, если его поджечь огнивом, либо при попадании на подключенный рельсовый активатор.
|
||||
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Чтобы взять вагон тротила, стукните его, удерживая клавишу [Красться]. Если тротил воспламенён, сделать это нельзя.
|
||||
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Вагон с печью - это железнодорожный транспорт. Он может двигаться за счёт топлива.
|
||||
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Поставьте его на рельсы. Если добавить немного угля, то печь зажжётся на продолжительное время и вагон сможет ехать. Стукните вагон для начала движения.
|
||||
To obtain the minecart and furnace, punch them while holding down the sneak key.=Чтобы взять вагон с печью, стукните его, удерживая клавишу [Красться].
|
||||
Minecart with Chest=Вагон с сундуком
|
||||
Minecart with Furnace=Вагон с печью
|
||||
Minecart with Command Block=Вагон с командным блоком
|
||||
Minecart with Hopper=Вагон с бункером
|
||||
Minecart with TNT=Вагон тротила
|
||||
Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Поместите на землю, чтобы сделать железную дорогу, рельсы автоматически соединятся между собой и будут превращаться в плавный повороты, T-образные развилки, перекрёстки и уклоны там, где это потребуется.
|
||||
Rail=Рельсы
|
||||
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Рельсы используются для строительства железной дороги. Обычные рельсы немного замедляют движение вагонеток из-за трения.
|
||||
Powered Rail=Энергорельсы
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Энергорельсы используются для строительства железной дороги. Энергорельсы могут ускорять и тормозить вагонетки.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Неподключенные энергорельсы замедляют вагонетки. Чтобы энергорельсы ускоряли вагонетки, проведите к ним сигнал редстоуна.
|
||||
Activator Rail=Активирующие рельсы
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Активирующие рельсы используются для строительства железной дороги. Активирующие рельсы активируют некоторые особые вагонетки.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Чтобы эти рельсы активировали вагонетки, подключите активирующие рельсы к сигналу редстоуна и направьте вагонетку через них.
|
||||
Detector Rail=Нажимные рельсы
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Нажимные рельсы используются для строительства железной дороги. Нажимные рельсы реагируют на проезжающие по ним вагонетки и выдают сигнал для механизмов из редстоуна.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Подсоедините к нажимным рельсам редстоун или редстоуновые механизмы, чтобы активировать их когда по рельсам проезжает вагонетка.
|
||||
Powered Rail=Подключаемые рельсы
|
||||
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Рельсы используются для строительства железной дороги. Подключённые рельсы могут разгонять и тормозить вагонетки.
|
||||
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Без энергии редстоуна рельсы будут тормозить вагонетки.
|
||||
Activator Rail=Рельсовый активатор
|
||||
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Рельсы используются для строительства железной дороги. Рельсовый активатор активирует особые вагонетки.
|
||||
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Чтобы этот блок рельсов активировал вагонетку, подключите его к энергии редстоуна и направьте вагонетку через него.
|
||||
Detector Rail=Рельсовый детектор
|
||||
Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Рельсы используются для строительства железной дороги. Рельсовый детектор может обнаруживать вагонетку у себя наверху и подключать механизмы редстоуна.
|
||||
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Чтобы обнаруживать вагонетку и подавать энергию редстоуна, подключите его к дорожке редстоуна или механизму редстоуна, после чего направьте любую вагонетку через него.
|
||||
Track for minecarts=Железная дорога
|
||||
Speed up when powered, slow down when not powered=Если подключены - ускоряют, если нет - тормозят
|
||||
Activates minecarts when powered=Активирует особые вагонетки, если подключены
|
||||
Emits redstone power when a minecart is detected=Подает сигнал редстоуна при обнаружении вагонетки
|
||||
Vehicle for fast travel on rails=Железнодорожный транспорт
|
||||
Can be ignited by tools or powered activator rail=Можно поджечь инструментом или активирующими рельсами
|
||||
Speed up when powered, slow down when not powered=Разгоняет, если подключён, тормозит, если не подключён
|
||||
Activates minecarts when powered=Активирует особые вагонетки, если подключён
|
||||
Emits redstone power when a minecart is detected=Испускает энергию редстоуна при обнаружении вагонетки
|
||||
Vehicle for fast travel on rails=Быстрый железнодорожный транспорт
|
||||
Can be ignited by tools or powered activator rail=Можно воспламенить с помощью инструмента или подключенного рельсового активатора
|
||||
Sneak to dismount=Нажмите [Красться] для высадки
|
||||
|
|
|
@ -78,10 +78,11 @@ function mob_class:get_staticdata()
|
|||
for _,p in pairs(minetest.get_connected_players()) do
|
||||
self:remove_particlespawners(p:get_player_name())
|
||||
end
|
||||
|
||||
-- remove mob when out of range unless tamed
|
||||
if remove_far
|
||||
and self:despawn_allowed()
|
||||
and self.can_despawn
|
||||
and self.remove_ok
|
||||
and ((not self.nametag) or (self.nametag == ""))
|
||||
and self.lifetimer <= 20 then
|
||||
if spawn_logging then
|
||||
minetest.log("action", "[mcl_mobs] Mob "..tostring(self.name).." despawns at "..minetest.pos_to_string(vector.round(self.object:get_pos())) .. " - out of range")
|
||||
|
@ -90,6 +91,7 @@ function mob_class:get_staticdata()
|
|||
return "remove"-- nil
|
||||
end
|
||||
|
||||
self.remove_ok = true
|
||||
self.attack = nil
|
||||
self.following = nil
|
||||
self.state = "stand"
|
||||
|
@ -111,21 +113,6 @@ function mob_class:get_staticdata()
|
|||
return minetest.serialize(tmp)
|
||||
end
|
||||
|
||||
local function valid_texture(self, def_textures)
|
||||
if not self.base_texture then
|
||||
return false
|
||||
end
|
||||
|
||||
if self.texture_selected then
|
||||
if #def_textures < self.texture_selected then
|
||||
self.texture_selected = nil
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function mob_class:mob_activate(staticdata, def, dtime)
|
||||
if not self.object:get_pos() or staticdata == "remove" then
|
||||
mcl_burning.extinguish(self.object)
|
||||
|
@ -148,20 +135,16 @@ function mob_class:mob_activate(staticdata, def, dtime)
|
|||
end
|
||||
|
||||
--If textures in definition change, reload textures
|
||||
if not valid_texture(self, def.textures) then
|
||||
|
||||
if not self.base_texture or (def.textures and table.indexof(def.textures, self.base_texture) == -1) then
|
||||
-- compatiblity with old simple mobs textures
|
||||
if type(def.textures[1]) == "string" then
|
||||
def.textures = {def.textures}
|
||||
end
|
||||
|
||||
if not self.texture_selected then
|
||||
local c = 1
|
||||
if #def.textures > c then c = #def.textures end
|
||||
self.texture_selected = math.random(c)
|
||||
end
|
||||
local c = 1
|
||||
if #def.textures > c then c = #def.textures end
|
||||
|
||||
self.base_texture = def.textures[self.texture_selected]
|
||||
self.base_texture = def.textures[math.random(c)]
|
||||
self.base_mesh = def.mesh
|
||||
self.base_size = self.visual_size
|
||||
self.base_colbox = self.collisionbox
|
||||
|
@ -316,33 +299,46 @@ end
|
|||
|
||||
-- execute current state (stand, walk, run, attacks)
|
||||
-- returns true if mob has died
|
||||
function mob_class:do_states(dtime, player_in_active_range)
|
||||
function mob_class:do_states(dtime)
|
||||
--if self.can_open_doors then check_doors(self) end
|
||||
|
||||
-- knockback timer. set in on_punch
|
||||
if self.pause_timer > 0 then
|
||||
self.pause_timer = self.pause_timer - dtime
|
||||
return
|
||||
end
|
||||
|
||||
self:env_danger_movement_checks(player_in_active_range)
|
||||
|
||||
if self.state == PATHFINDING then
|
||||
if self.state == "stand" then
|
||||
self:do_states_stand()
|
||||
elseif self.state == PATHFINDING then
|
||||
self:check_gowp(dtime)
|
||||
elseif self.state == "walk" then
|
||||
self:do_states_walk()
|
||||
elseif self.state == "runaway" then
|
||||
-- runaway when punched
|
||||
self:do_states_runaway()
|
||||
elseif self.state == "attack" then
|
||||
-- attack routines (explode, dogfight, shoot, dogshoot)
|
||||
if self:do_states_attack(dtime) then
|
||||
return true
|
||||
end
|
||||
else
|
||||
if mcl_util.check_dtime_timer(self, dtime, "onstep_dostates", 1) then
|
||||
if self.state == "stand" then
|
||||
self:do_states_stand(player_in_active_range)
|
||||
elseif self.state == "walk" then
|
||||
self:do_states_walk()
|
||||
elseif self.state == "runaway" then
|
||||
self:do_states_runaway()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function update_timers (self, dtime)
|
||||
-- knockback timer. set in on_punch
|
||||
if self.pause_timer > 0 then
|
||||
self.pause_timer = self.pause_timer - dtime
|
||||
return true
|
||||
end
|
||||
|
||||
-- attack timer. Not anymore, it seems. Used for also occassionally processing mob step too!
|
||||
self.timer = self.timer + dtime
|
||||
|
||||
if self.state ~= "attack" and self.state ~= PATHFINDING then
|
||||
if self.timer < 1 then
|
||||
return true
|
||||
end
|
||||
self.timer = 0
|
||||
end
|
||||
|
||||
-- never go over 100
|
||||
if self.timer > 100 then
|
||||
self.timer = 1
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -370,8 +366,6 @@ function mob_class:outside_limits()
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
local function on_step_work (self, dtime)
|
||||
local pos = self.object:get_pos()
|
||||
if not pos then return end
|
||||
|
@ -387,22 +381,30 @@ local function on_step_work (self, dtime)
|
|||
end
|
||||
|
||||
if self:falling(pos) then return end
|
||||
if self:step_damage (dtime, pos) then return end
|
||||
|
||||
local player_in_active_range = self:player_in_active_range()
|
||||
|
||||
self:check_suspend(player_in_active_range)
|
||||
|
||||
if not self.fire_resistant then
|
||||
mcl_burning.tick(self.object, dtime, self)
|
||||
if not self.object:get_pos() then return end -- mcl_burning.tick may remove object immediately
|
||||
|
||||
if self:check_for_death("fire", {type = "fire"}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if self:env_damage (dtime, pos) then return end
|
||||
|
||||
if self.state == "die" then return end
|
||||
-- End: Death/damage processing
|
||||
|
||||
local player_in_active_range = self:player_in_active_range()
|
||||
self:check_suspend(player_in_active_range)
|
||||
|
||||
self:check_water_flow()
|
||||
self:env_danger_movement_checks (dtime)
|
||||
|
||||
if not self._jumping_cliff then
|
||||
self._can_jump_cliff = self:can_jump_cliff()
|
||||
else
|
||||
self._can_jump_cliff = false
|
||||
end
|
||||
|
||||
-- Follow code is heavy and probably shouldn't run when not in range, but we need to extract the cancel follow stuff
|
||||
self:check_follow()
|
||||
self:flop()
|
||||
|
||||
self:check_smooth_rotation(dtime)
|
||||
|
@ -412,37 +414,46 @@ local function on_step_work (self, dtime)
|
|||
|
||||
self:check_head_swivel(dtime)
|
||||
|
||||
if mcl_util.check_dtime_timer(self, dtime, "onstep_engage", 0.2) then
|
||||
self:check_follow()
|
||||
self:check_runaway_from()
|
||||
self:monster_attack()
|
||||
self:npc_attack()
|
||||
end
|
||||
|
||||
self:check_herd(dtime)
|
||||
|
||||
if self.jump_sound_cooloff > 0 then self.jump_sound_cooloff = self.jump_sound_cooloff - dtime end
|
||||
self:do_jump()
|
||||
end
|
||||
|
||||
if mcl_util.check_dtime_timer(self, dtime, "onstep_occassional", 1) then
|
||||
self:check_runaway_from()
|
||||
self:monster_attack()
|
||||
self:npc_attack()
|
||||
|
||||
if player_in_active_range then
|
||||
self:check_item_pickup()
|
||||
self:set_armor_texture()
|
||||
self:step_opinion_sound(dtime)
|
||||
end
|
||||
|
||||
self:check_breeding()
|
||||
self:check_herd(dtime)
|
||||
end
|
||||
|
||||
self:check_aggro(dtime)
|
||||
|
||||
self:check_particlespawners(dtime)
|
||||
|
||||
if self.do_custom and self.do_custom(self, dtime) == false then return end
|
||||
|
||||
if self:do_states(dtime, player_in_active_range) then return end
|
||||
-- In certain circumstances, we abandon processing of certain functionality
|
||||
local skip_processing = false
|
||||
if update_timers(self, dtime) then
|
||||
skip_processing = true
|
||||
end
|
||||
|
||||
if not skip_processing then
|
||||
self:check_breeding()
|
||||
|
||||
if player_in_active_range then
|
||||
self:check_item_pickup()
|
||||
self:set_armor_texture()
|
||||
|
||||
if self.opinion_sound_cooloff > 0 then
|
||||
self.opinion_sound_cooloff = self.opinion_sound_cooloff - dtime
|
||||
end
|
||||
-- mob plays random sound at times. Should be 120. Zombie and mob farms are ridiculous
|
||||
if math.random(1, 70) == 1 then
|
||||
self:mob_sound("random", true)
|
||||
end
|
||||
end
|
||||
|
||||
self:check_particlespawners(dtime)
|
||||
|
||||
if self:do_states(dtime) then return end
|
||||
end
|
||||
|
||||
if mobs_debug then self:update_tag() end
|
||||
|
||||
|
|
|
@ -262,7 +262,6 @@ functions needed for the mob to work properly which contains the following:
|
|||
'custom_visual_size' will not reset visual_size from the base class on reload
|
||||
'noyaw' If true this mob will not automatically change yaw
|
||||
'particlespawners' Table of particlespawners attached to the mob. This is implemented in a coord safe manner i.e. spawners are only sent to players within the player_transfer_distance (and automatically removed). This enables infinitely lived particlespawners.
|
||||
'attack_frequency' Attack frequency in seconds. If unset, this defaults to 1. Implemented for melee only atm.
|
||||
|
||||
mobs:gopath(self,target,callback_arrived) pathfind a way to target and run callback on arrival
|
||||
|
||||
|
|
|
@ -32,9 +32,6 @@ function mob_class:feed_tame(clicker, feed_count, breed, tame, notake)
|
|||
if not self.follow then
|
||||
return false
|
||||
end
|
||||
if clicker:get_wielded_item():get_definition()._mcl_not_consumable then
|
||||
return false
|
||||
end
|
||||
-- can eat/tame with item in hand
|
||||
if self.nofollow or self:follow_holding(clicker) then
|
||||
local consume_food = false
|
||||
|
@ -77,7 +74,6 @@ function mob_class:feed_tame(clicker, feed_count, breed, tame, notake)
|
|||
if self.food >= feed_count then
|
||||
self.food = 0
|
||||
self.horny = true
|
||||
self.persistent = true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -10,8 +10,6 @@ local stuck_path_timeout = 10 -- how long will mob follow path before giving up
|
|||
|
||||
local enable_pathfinding = true
|
||||
|
||||
local TIME_TO_FORGET_TARGET = 15
|
||||
|
||||
local atann = math.atan
|
||||
local function atan(x)
|
||||
if not x or x ~= x then
|
||||
|
@ -21,8 +19,6 @@ local function atan(x)
|
|||
end
|
||||
end
|
||||
|
||||
mcl_mobs.effect_functions = {}
|
||||
|
||||
|
||||
-- check if daytime and also if mob is docile during daylight hours
|
||||
function mob_class:day_docile()
|
||||
|
@ -384,8 +380,7 @@ function mob_class:monster_attack()
|
|||
-- find specific mob to attack, failing that attack player/npc/animal
|
||||
if specific_attack(self.specific_attack, name)
|
||||
and (type == "player" or ( type == "npc" and self.attack_npcs )
|
||||
or (type == "animal" and self.attack_animals == true)
|
||||
or (self.extra_hostile and not self.attack_exception(player))) then
|
||||
or (type == "animal" and self.attack_animals == true)) then
|
||||
p = player:get_pos()
|
||||
sp = s
|
||||
|
||||
|
@ -403,8 +398,7 @@ function mob_class:monster_attack()
|
|||
end
|
||||
|
||||
-- choose closest player to attack
|
||||
local line_of_sight = self:line_of_sight( sp, p, 2) == true
|
||||
if dist < min_dist and not attacked_p and line_of_sight then
|
||||
if dist < min_dist and not attacked_p and self:line_of_sight( sp, p, 2) == true then
|
||||
min_dist = dist
|
||||
min_player = player
|
||||
end
|
||||
|
@ -516,28 +510,6 @@ end
|
|||
|
||||
-- deal damage and effects when mob punched
|
||||
function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
||||
local is_player = hitter:is_player()
|
||||
local mob_pos = self.object:get_pos()
|
||||
local player_pos = hitter:get_pos()
|
||||
|
||||
if is_player then
|
||||
-- is mob out of reach?
|
||||
if vector.distance(mob_pos, player_pos) > 3 then
|
||||
return
|
||||
end
|
||||
-- is mob protected?
|
||||
if self.protected and minetest.is_protected(mob_pos, hitter:get_player_name()) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local time_now = minetest.get_us_time()
|
||||
local time_diff = time_now - self.invul_timestamp
|
||||
|
||||
-- check for invulnerability time in microseconds (0.5 second)
|
||||
if time_diff <= 500000 and time_diff >= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- custom punch function
|
||||
if self.do_punch then
|
||||
|
@ -554,15 +526,20 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
return
|
||||
end
|
||||
|
||||
local time_now = minetest.get_us_time()
|
||||
local is_player = hitter:is_player()
|
||||
|
||||
if is_player then
|
||||
-- is mob protected?
|
||||
if self.protected and minetest.is_protected(self.object:get_pos(), hitter:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.is_creative_enabled(hitter:get_player_name()) then
|
||||
self.health = 0
|
||||
end
|
||||
|
||||
-- set/update 'drop xp' timestamp if hitted by player
|
||||
self.xp_timestamp = time_now
|
||||
self.xp_timestamp = minetest.get_us_time()
|
||||
end
|
||||
|
||||
|
||||
|
@ -674,9 +651,6 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
-- do damage
|
||||
self.health = self.health - damage
|
||||
|
||||
-- give invulnerability
|
||||
self.invul_timestamp = time_now
|
||||
|
||||
-- skip future functions if dead, except alerting others
|
||||
if self:check_for_death( "hit", {type = "punch", puncher = hitter}) then
|
||||
die = true
|
||||
|
@ -692,10 +666,10 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
if not v then return end
|
||||
local r = 1.4 - math.min(punch_interval, 1.4)
|
||||
local kb = r * (math.abs(v.x)+math.abs(v.z))
|
||||
local up = 2.625
|
||||
local up = 2
|
||||
|
||||
if die==true then
|
||||
kb=kb*1.25
|
||||
kb=kb*2
|
||||
end
|
||||
|
||||
-- if already in air then dont go up anymore when hit
|
||||
|
@ -709,7 +683,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
if tool_capabilities.damage_groups["knockback"] then
|
||||
kb = tool_capabilities.damage_groups["knockback"]
|
||||
else
|
||||
kb = kb * 1.25
|
||||
kb = kb * 1.5
|
||||
end
|
||||
|
||||
|
||||
|
@ -719,19 +693,9 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
end
|
||||
if hitter and is_player then
|
||||
local wielditem = hitter:get_wielded_item()
|
||||
kb = kb + 9 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
||||
-- add player velocity to mob knockback
|
||||
local hv = hitter:get_velocity()
|
||||
local dir_dot = (hv.x * dir.x) + (hv.z * dir.z)
|
||||
local player_mag = math.sqrt((hv.x * hv.x) + (hv.z * hv.z))
|
||||
local mob_mag = math.sqrt((v.x * v.x) + (v.z * v.z))
|
||||
if dir_dot > 0 and mob_mag <= player_mag * 0.625 then
|
||||
kb = kb + ((math.abs(hv.x) + math.abs(hv.z)) * r)
|
||||
end
|
||||
elseif luaentity and luaentity._knockback and die == false then
|
||||
kb = kb + 3 * mcl_enchanting.get_enchantment(wielditem, "knockback")
|
||||
elseif luaentity and luaentity._knockback then
|
||||
kb = kb + luaentity._knockback
|
||||
elseif luaentity and luaentity._knockback and die == true then
|
||||
kb = kb + luaentity._knockback * 0.25
|
||||
end
|
||||
self._kb_turn = true
|
||||
self._turn_to=self.object:get_yaw()-1.57
|
||||
|
@ -846,35 +810,12 @@ function mob_class:check_aggro(dtime)
|
|||
self._check_aggro_timer = self._check_aggro_timer + dtime
|
||||
end
|
||||
|
||||
|
||||
|
||||
local function clear_aggro(self)
|
||||
self.state = "stand"
|
||||
self:set_velocity( 0)
|
||||
self:set_animation( "stand")
|
||||
|
||||
self.attack = nil
|
||||
self._aggro = nil
|
||||
|
||||
self.v_start = false
|
||||
self.timer = 0
|
||||
self.blinktimer = 0
|
||||
self.path.way = nil
|
||||
end
|
||||
|
||||
function mob_class:do_states_attack (dtime)
|
||||
self.timer = self.timer + dtime
|
||||
if self.timer > 100 then
|
||||
self.timer = 1
|
||||
end
|
||||
local yaw = self.object:get_yaw() or 0
|
||||
|
||||
local s = self.object:get_pos()
|
||||
if not s then return end
|
||||
|
||||
local p = self.attack:get_pos() or s
|
||||
|
||||
local yaw = self.object:get_yaw() or 0
|
||||
|
||||
-- stop attacking if player invisible or out of range
|
||||
if not self.attack
|
||||
or not self.attack:get_pos()
|
||||
|
@ -882,53 +823,56 @@ function mob_class:do_states_attack (dtime)
|
|||
or self.attack:get_hp() <= 0
|
||||
or (self.attack:is_player() and mcl_mobs.invis[ self.attack:get_player_name() ]) then
|
||||
|
||||
clear_aggro(self)
|
||||
self.state = "stand"
|
||||
self:set_velocity( 0)
|
||||
self:set_animation( "stand")
|
||||
|
||||
self.attack = nil
|
||||
self._aggro = nil
|
||||
|
||||
self.v_start = false
|
||||
self.timer = 0
|
||||
self.blinktimer = 0
|
||||
self.path.way = nil
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local target_line_of_sight = self:target_visible(s)
|
||||
|
||||
if not target_line_of_sight then
|
||||
if self.target_time_lost then
|
||||
local time_since_seen = os.time() - self.target_time_lost
|
||||
if time_since_seen > TIME_TO_FORGET_TARGET then
|
||||
self.target_time_lost = nil
|
||||
clear_aggro(self)
|
||||
return
|
||||
end
|
||||
else
|
||||
self.target_time_lost = os.time()
|
||||
end
|
||||
else
|
||||
self.target_time_lost = nil
|
||||
end
|
||||
|
||||
-- calculate distance from mob and enemy
|
||||
local dist = vector.distance(p, s)
|
||||
|
||||
if self.attack_type == "explode" then
|
||||
|
||||
if target_line_of_sight then
|
||||
local vec = { x = p.x - s.x, z = p.z - s.z }
|
||||
yaw = (atan(vec.z / vec.x) +math.pi/ 2) - self.rotate
|
||||
if p.x > s.x then yaw = yaw +math.pi end
|
||||
yaw = self:set_yaw( yaw, 0, dtime)
|
||||
end
|
||||
local vec = {
|
||||
x = p.x - s.x,
|
||||
z = p.z - s.z
|
||||
}
|
||||
|
||||
yaw = (atan(vec.z / vec.x) +math.pi/ 2) - self.rotate
|
||||
|
||||
if p.x > s.x then yaw = yaw +math.pi end
|
||||
|
||||
yaw = self:set_yaw( yaw, 0, dtime)
|
||||
|
||||
local node_break_radius = self.explosion_radius or 1
|
||||
local entity_damage_radius = self.explosion_damage_radius
|
||||
or (node_break_radius * 2)
|
||||
|
||||
-- start timer when in reach and line of sight
|
||||
if not self.v_start and dist <= self.reach and target_line_of_sight then
|
||||
if not self.v_start
|
||||
and dist <= self.reach
|
||||
and self:line_of_sight( s, p, 2) then
|
||||
|
||||
self.v_start = true
|
||||
self.timer = 0
|
||||
self.blinktimer = 0
|
||||
self:mob_sound("fuse", nil, false)
|
||||
|
||||
-- stop timer if out of reach or direct line of sight
|
||||
elseif self.allow_fuse_reset and self.v_start
|
||||
and (dist >= self.explosiontimer_reset_radius or not target_line_of_sight) then
|
||||
elseif self.allow_fuse_reset
|
||||
and self.v_start
|
||||
and (dist >= self.explosiontimer_reset_radius
|
||||
or not self:line_of_sight( s, p, 2)) then
|
||||
self.v_start = false
|
||||
self.timer = 0
|
||||
self.blinktimer = 0
|
||||
|
@ -937,10 +881,10 @@ function mob_class:do_states_attack (dtime)
|
|||
end
|
||||
|
||||
-- walk right up to player unless the timer is active
|
||||
if self.v_start and (self.stop_to_explode or dist < self.reach) or not target_line_of_sight then
|
||||
self:set_velocity(0)
|
||||
if self.v_start and (self.stop_to_explode or dist < self.reach) then
|
||||
self:set_velocity( 0)
|
||||
else
|
||||
self:set_velocity(self.run_velocity)
|
||||
self:set_velocity( self.run_velocity)
|
||||
end
|
||||
|
||||
if self.animation and self.animation.run_start then
|
||||
|
@ -950,20 +894,25 @@ function mob_class:do_states_attack (dtime)
|
|||
end
|
||||
|
||||
if self.v_start then
|
||||
|
||||
self.timer = self.timer + dtime
|
||||
self.blinktimer = (self.blinktimer or 0) + dtime
|
||||
|
||||
if self.blinktimer > 0.2 then
|
||||
|
||||
self.blinktimer = 0
|
||||
|
||||
if self.blinkstatus then
|
||||
self:remove_texture_mod("^[brighten")
|
||||
else
|
||||
self:add_texture_mod("^[brighten")
|
||||
end
|
||||
|
||||
self.blinkstatus = not self.blinkstatus
|
||||
end
|
||||
|
||||
if self.timer > self.explosion_timer then
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
if mobs_griefing and not minetest.is_protected(pos, "") then
|
||||
|
@ -1077,45 +1026,54 @@ function mob_class:do_states_attack (dtime)
|
|||
|
||||
-- move towards enemy if beyond mob reach
|
||||
if dist > self.reach then
|
||||
|
||||
-- path finding by rnd
|
||||
if enable_pathfinding and self.pathfinding then
|
||||
if self.pathfinding -- only if mob has pathfinding enabled
|
||||
and enable_pathfinding then
|
||||
|
||||
self:smart_mobs(s, p, dist, dtime)
|
||||
end
|
||||
|
||||
if self:is_at_cliff_or_danger() then
|
||||
|
||||
self:set_velocity( 0)
|
||||
self:set_animation( "stand")
|
||||
local yaw = self.object:get_yaw() or 0
|
||||
yaw = self:set_yaw( yaw + 0.78, 8)
|
||||
else
|
||||
|
||||
if self.path.stuck then
|
||||
self:set_velocity(self.walk_velocity)
|
||||
self:set_velocity( self.walk_velocity)
|
||||
else
|
||||
self:set_velocity(self.run_velocity)
|
||||
self:set_velocity( self.run_velocity)
|
||||
end
|
||||
|
||||
if self.animation and self.animation.run_start then
|
||||
self:set_animation("run")
|
||||
self:set_animation( "run")
|
||||
else
|
||||
self:set_animation("walk")
|
||||
self:set_animation( "walk")
|
||||
end
|
||||
end
|
||||
|
||||
else -- rnd: if inside reach range
|
||||
|
||||
self.path.stuck = false
|
||||
self.path.stuck_timer = 0
|
||||
self.path.following = false -- not stuck anymore
|
||||
|
||||
self:set_velocity( 0)
|
||||
|
||||
local attack_frequency = self.attack_frequency or 1
|
||||
if not self.custom_attack then
|
||||
|
||||
if self.timer > attack_frequency then
|
||||
self.timer = 0
|
||||
if self.timer > 1 then
|
||||
|
||||
if not self.custom_attack then
|
||||
if self.double_melee_attack and math.random(1, 2) == 1 then
|
||||
self:set_animation("punch2")
|
||||
self.timer = 0
|
||||
|
||||
if self.double_melee_attack
|
||||
and math.random(1, 2) == 1 then
|
||||
self:set_animation( "punch2")
|
||||
else
|
||||
self:set_animation("punch")
|
||||
self:set_animation( "punch")
|
||||
end
|
||||
|
||||
local p2 = p
|
||||
|
@ -1125,6 +1083,8 @@ function mob_class:do_states_attack (dtime)
|
|||
s2.y = s2.y + .5
|
||||
|
||||
if self:line_of_sight( p2, s2) == true then
|
||||
|
||||
-- play attack sound
|
||||
self:mob_sound("attack")
|
||||
|
||||
-- punch player (or what player is attached to)
|
||||
|
@ -1136,13 +1096,14 @@ function mob_class:do_states_attack (dtime)
|
|||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = self.damage}
|
||||
}, nil)
|
||||
if self.dealt_effect then
|
||||
mcl_mobs.effect_functions[self.dealt_effect.name](
|
||||
self.attack, self.dealt_effect.factor, self.dealt_effect.dur
|
||||
)
|
||||
end
|
||||
end
|
||||
else
|
||||
end
|
||||
else -- call custom attack every second
|
||||
if self.custom_attack
|
||||
and self.timer > 1 then
|
||||
|
||||
self.timer = 0
|
||||
|
||||
self.custom_attack(self, p)
|
||||
end
|
||||
end
|
||||
|
@ -1168,7 +1129,7 @@ function mob_class:do_states_attack (dtime)
|
|||
|
||||
yaw = self:set_yaw( yaw, 0, dtime)
|
||||
|
||||
local stay_away_from_player = vector.zero()
|
||||
local stay_away_from_player = vector.new(0,0,0)
|
||||
|
||||
--strafe back and fourth
|
||||
|
||||
|
@ -1185,13 +1146,7 @@ function mob_class:do_states_attack (dtime)
|
|||
if math.random(40) == 1 then
|
||||
self.strafe_direction = self.strafe_direction*-1
|
||||
end
|
||||
|
||||
local dir = vector.rotate_around_axis(vector.direction(s, p), vector.new(0,1,0), self.strafe_direction)
|
||||
local dir2 = vector.multiply(dir, 0.3 * self.walk_velocity)
|
||||
|
||||
if dir2 and stay_away_from_player then
|
||||
self.acc = vector.add(dir2, stay_away_from_player)
|
||||
end
|
||||
self.acc = vector.add(vector.multiply(vector.rotate_around_axis(vector.direction(s, p), vector.new(0,1,0), self.strafe_direction), 0.3*self.walk_velocity), stay_away_from_player)
|
||||
else
|
||||
self:set_velocity( 0)
|
||||
end
|
||||
|
@ -1231,9 +1186,6 @@ function mob_class:do_states_attack (dtime)
|
|||
-- important for mcl_shields
|
||||
ent._shooter = self.object
|
||||
ent._saved_shooter_pos = self.object:get_pos()
|
||||
if ent.homing then
|
||||
ent._target = self.attack
|
||||
end
|
||||
end
|
||||
|
||||
local amount = (vec.x * vec.x + vec.y * vec.y + vec.z * vec.z) ^ 0.5
|
||||
|
@ -1250,13 +1202,7 @@ function mob_class:do_states_attack (dtime)
|
|||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
elseif self.attack_type == "custom" and self.attack_state then
|
||||
self.attack_state(self, dtime)
|
||||
end
|
||||
|
||||
if self.on_attack then
|
||||
self.on_attack(self, dtime)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
local math, tonumber, vector, minetest, mcl_mobs = math, tonumber, vector, minetest, mcl_mobs
|
||||
local mob_class = mcl_mobs.mob_class
|
||||
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 PATHFINDING = "gowp"
|
||||
|
||||
local player_transfer_distance = tonumber(minetest.settings:get("player_transfer_distance")) or 128
|
||||
if player_transfer_distance == 0 then player_transfer_distance = math.huge end
|
||||
|
||||
|
||||
local function validate_vector (vect)
|
||||
if vect then
|
||||
if tonumber(vect.x) and tonumber(vect.y) and tonumber(vect.z) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- custom particle effects
|
||||
function mcl_mobs.effect(pos, amount, texture, min_size, max_size, radius, gravity, glow, go_down)
|
||||
|
||||
|
@ -130,19 +136,6 @@ function mob_class:mob_sound(soundname, is_opinion, fixed_pitch)
|
|||
end
|
||||
end
|
||||
|
||||
function mob_class:step_opinion_sound(dtime)
|
||||
if self.state ~= "attack" and self.state ~= PATHFINDING then
|
||||
|
||||
if self.opinion_sound_cooloff > 0 then
|
||||
self.opinion_sound_cooloff = self.opinion_sound_cooloff - dtime
|
||||
end
|
||||
-- mob plays random sound at times. Should be 120. Zombie and mob farms are ridiculous
|
||||
if math.random(1, 70) == 1 then
|
||||
self:mob_sound("random", true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mob_class:add_texture_mod(mod)
|
||||
local full_mod = ""
|
||||
local already_added = false
|
||||
|
@ -261,7 +254,7 @@ function mob_class:set_animation(anim, fixed_frame)
|
|||
|
||||
|
||||
|
||||
if self.fly and self:flight_check() and anim == "walk" then anim = "fly" end
|
||||
if self:flight_check() and self.fly and anim == "walk" then anim = "fly" end
|
||||
|
||||
self._current_animation = self._current_animation or ""
|
||||
|
||||
|
@ -300,7 +293,7 @@ local function dir_to_pitch(dir)
|
|||
return -math.atan2(-dir.y, xz)
|
||||
end
|
||||
|
||||
local function who_are_you_looking_at (self, dtime)
|
||||
local function who_are_you_looking_at (self)
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
local stop_look_at_player_chance = math.random(833/self.curiosity)
|
||||
|
@ -308,26 +301,20 @@ local function who_are_you_looking_at (self, dtime)
|
|||
|
||||
local stop_look_at_player = stop_look_at_player_chance == 1
|
||||
|
||||
if self.attack then
|
||||
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
|
||||
if self.attack or self.following then
|
||||
self._locked_object = self.attack or self.following
|
||||
elseif self._locked_object then
|
||||
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
|
||||
if math.random(1, 30) then
|
||||
--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
|
||||
local chance = 20/self.curiosity
|
||||
|
||||
if chance < 1 then chance = 1 end
|
||||
local look_at_player_chance = math.random(chance)
|
||||
|
@ -359,9 +346,9 @@ 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)
|
||||
who_are_you_looking_at (self)
|
||||
|
||||
local final_rotation = vector.zero()
|
||||
local final_rotation = vector.new(0,0,0)
|
||||
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
|
||||
|
@ -373,11 +360,8 @@ function mob_class:check_head_swivel(dtime)
|
|||
_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?
|
||||
if self.object:get_attach() and self.object:get_attach():get_rotation() then
|
||||
if self.object:get_attach() then
|
||||
self_rot = self.object:get_attach():get_rotation()
|
||||
end
|
||||
|
||||
|
@ -410,7 +394,7 @@ function mob_class:check_head_swivel(dtime)
|
|||
--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)
|
||||
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), final_rotation)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -147,14 +147,13 @@ function mcl_mobs.register_mob(name, def)
|
|||
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
|
||||
curiosity = def.curiosity or 1, -- how often mob will look at player on idle
|
||||
head_yaw = def.head_yaw or "y", -- axis to rotate head on
|
||||
horizontal_head_height = def.horizontal_head_height or 0,
|
||||
horrizonatal_head_height = def.horrizonatal_head_height or 0,
|
||||
wears_armor = def.wears_armor, -- a number value used to index texture slot for armor
|
||||
stepheight = def.stepheight or 0.6,
|
||||
name = name,
|
||||
description = def.description,
|
||||
type = def.type,
|
||||
attack_type = def.attack_type,
|
||||
attack_frequency = def.attack_frequency,
|
||||
fly = def.fly or false,
|
||||
fly_in = def.fly_in or {"air", "__airlike"},
|
||||
owner = def.owner or "",
|
||||
|
@ -171,7 +170,6 @@ function mcl_mobs.register_mob(name, def)
|
|||
xp_min = def.xp_min or 0,
|
||||
xp_max = def.xp_max or 0,
|
||||
xp_timestamp = 0,
|
||||
invul_timestamp = 0,
|
||||
breath_max = def.breath_max or 15,
|
||||
breathes_in_water = def.breathes_in_water or false,
|
||||
physical = true,
|
||||
|
@ -218,7 +216,6 @@ function mcl_mobs.register_mob(name, def)
|
|||
replace_with = def.replace_with,
|
||||
replace_offset = def.replace_offset or 0,
|
||||
on_replace = def.on_replace,
|
||||
replace_delay = def.replace_delay or 0,
|
||||
timer = 0,
|
||||
env_damage_timer = 0,
|
||||
tamed = false,
|
||||
|
@ -288,7 +285,6 @@ function mcl_mobs.register_mob(name, def)
|
|||
spawn_in_group_min = def.spawn_in_group_min,
|
||||
noyaw = def.noyaw or false,
|
||||
particlespawners = def.particlespawners,
|
||||
spawn_check = def.spawn_check,
|
||||
-- End of MCL2 extensions
|
||||
on_spawn = def.on_spawn,
|
||||
on_blast = def.on_blast or function(self,damage)
|
||||
|
@ -299,7 +295,6 @@ function mcl_mobs.register_mob(name, def)
|
|||
return false, true, {}
|
||||
end,
|
||||
do_punch = def.do_punch,
|
||||
deal_damage = def.deal_damage,
|
||||
on_breed = def.on_breed,
|
||||
on_grown = def.on_grown,
|
||||
on_pick_up = def.on_pick_up,
|
||||
|
@ -314,16 +309,8 @@ function mcl_mobs.register_mob(name, def)
|
|||
|
||||
return self:mob_activate(staticdata, def, dtime)
|
||||
end,
|
||||
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,
|
||||
is_boss = def.is_boss,
|
||||
dealt_effect = def.dealt_effect,
|
||||
on_lightning_strike = def.on_lightning_strike,
|
||||
extra_hostile = def.extra_hostile,
|
||||
attack_exception = def.attack_exception or function(p) return false end,
|
||||
|
||||
_spawner = def._spawner,
|
||||
on_lightning_strike = def.on_lightning_strike
|
||||
}
|
||||
minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta))
|
||||
|
||||
|
@ -334,13 +321,6 @@ function mcl_mobs.register_mob(name, def)
|
|||
end -- END mcl_mobs.register_mob function
|
||||
|
||||
|
||||
function mcl_mobs.get_arrow_damage_func(damage, typ)
|
||||
local typ = mcl_damage.types[typ] and typ or "arrow"
|
||||
return function(projectile, object)
|
||||
return mcl_util.deal_damage(object, damage, {type = typ})
|
||||
end
|
||||
end
|
||||
|
||||
-- register arrow for shoot attack
|
||||
function mcl_mobs.register_arrow(name, def)
|
||||
|
||||
|
@ -357,15 +337,13 @@ function mcl_mobs.register_arrow(name, def)
|
|||
hit_node = def.hit_node,
|
||||
hit_mob = def.hit_mob,
|
||||
hit_object = def.hit_object,
|
||||
homing = def.homing,
|
||||
drop = def.drop or false, -- drops arrow as registered item when true
|
||||
collisionbox = {0, 0, 0, 0, 0, 0}, -- remove box around arrows
|
||||
timer = 0,
|
||||
switch = 0,
|
||||
_lifetime = def._lifetime or 150,
|
||||
owner_id = def.owner_id,
|
||||
rotate = def.rotate,
|
||||
on_punch = def.on_punch or function(self)
|
||||
on_punch = function(self)
|
||||
local vel = self.object:get_velocity()
|
||||
self.object:set_velocity({x=vel.x * -1, y=vel.y * -1, z=vel.z * -1})
|
||||
end,
|
||||
|
@ -382,7 +360,7 @@ function mcl_mobs.register_arrow(name, def)
|
|||
local pos = self.object:get_pos()
|
||||
|
||||
if self.switch == 0
|
||||
or self.timer > self._lifetime
|
||||
or self.timer > 150
|
||||
or not within_limits(pos, 0) then
|
||||
mcl_burning.extinguish(self.object)
|
||||
self.object:remove();
|
||||
|
@ -430,17 +408,6 @@ function mcl_mobs.register_arrow(name, def)
|
|||
end
|
||||
end
|
||||
|
||||
if self.homing and self._target then
|
||||
local p = self._target:get_pos()
|
||||
if p then
|
||||
if minetest.line_of_sight(self.object:get_pos(), p) then
|
||||
self.object:set_velocity(vector.direction(self.object:get_pos(), p) * self.velocity)
|
||||
end
|
||||
else
|
||||
self._target = nil
|
||||
end
|
||||
end
|
||||
|
||||
if self.hit_player or self.hit_mob or self.hit_object then
|
||||
|
||||
for _,player in pairs(minetest.get_objects_inside_radius(pos, 1.5)) do
|
||||
|
@ -522,7 +489,7 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
|
|||
on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
local pos = pointed_thing.above
|
||||
|
||||
|
||||
-- am I clicking on something with existing on_rightclick function?
|
||||
local under = minetest.get_node(pointed_thing.under)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
|
@ -589,7 +556,7 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
|
|||
nametag = string.sub(nametag, 1, MAX_MOB_NAME_LENGTH)
|
||||
end
|
||||
ent.nametag = nametag
|
||||
ent:update_tag()
|
||||
update_tag(ent)
|
||||
end
|
||||
|
||||
-- if not in creative then take item
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=Fredelig tilstand aktiveret! Ingen monstre vil spawne.
|
||||
This allows you to place a single mob.=Dette gør dig i stand til at placere et enkelt monster.
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Placér det blot der hvor du ønsker, at monsteret skal komme. Dyr vil spawne tamme, medmindre du holder snige-knappen nede mens du placerer dem. Hvis du placerer denne på et monsterspawn, ændrer du hvilket monster det spawner.
|
||||
You need the “maphack” privilege to change the mob spawner.=Du skal have "maphack" privilegier for at ændre monsterspawneren.
|
||||
Name Tag=Navneskilt
|
||||
A name tag is an item to name a mob.=Et navneskilt bruges til at navngive et monster.
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Før du bruger navneskiltet, skal du vælge navnet ved en ambolt. Derefter kan du bruge navneskiltet til at navngive et monster. Dette opbruger navneskiltet.
|
||||
Only peaceful mobs allowed!=Kun fredelige monstre er tilladt!
|
||||
Give names to mobs=Giv navne til monstre
|
||||
Set name at anvil=Vælg navn ved en ambolt.
|
|
@ -9,5 +9,3 @@ Before you use the name tag, you need to set a name at an anvil. Then you can us
|
|||
Only peaceful mobs allowed!=Seuls les mobs pacifiques sont autorisées!
|
||||
Give names to mobs=Donne des noms aux mobs
|
||||
Set name at anvil=Définir le nom sur l'enclume
|
||||
Removes specified mobs except nametagged and tamed ones. For the second parameter, use nametagged/tamed to select only nametagged/tamed mobs, or a range to specify a maximum distance from the player.=Enlève les mobs spécifiés sauf ceux qui sont nommés et apprivoisés. Pour le deuxième paramètre, utiliser nametagged/tamed pour ne sélectionner que les mobs nommés/apprivoisés, ou une distance pour spécifier la distance maximale par rapport au joueur.
|
||||
Default usage. Clearing hostile mobs. For more options please type: /help clearmobs=Usage par défaut. Enlève les mobs hostiles. Pour plus d'options saisir : /help clearmobs
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=Modo pacífico ativado! Nenhum monstro será gerado.
|
||||
This allows you to place a single mob.=Isso permite você posicionar um único mob.
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Posicione-o onde você deseja que o mob apareça. Animais serão gerados domesticados, a menos que você segure pressionada a tecla de agachar enquanto posiciona. Se você posicionar em um gerador de mobs, você muda o mob que será gerado.
|
||||
You need the “maphack” privilege to change the mob spawner.=Você precisa do privilégio "maphack" para mudar o gerador de mobs.
|
||||
Name Tag=Etiqueta
|
||||
A name tag is an item to name a mob.=Uma etiqueta é um item para nomear um mob.
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Antes de você usar a etiqueta, você precisa determinar um nome em uma bigorna. Assim você pode usar a etiqueta para nomear um mob. Isso consumirá a etiqueta.
|
||||
Only peaceful mobs allowed!=Apenas mobs pacíficos permitidos!
|
||||
Give names to mobs=Dá nome aos mobs
|
||||
Set name at anvil=Determine um nome em uma bigorna
|
||||
Removes specified mobs except nametagged and tamed ones. For the second parameter, use nametagged/tamed to select only nametagged/tamed mobs, or a range to specify a maximum distance from the player.=Remove mobs especifícos exceto os mobs nomeados ou domesticados. Como segundo parâmetro, use nametagged/tamed para selecionar apenas mobs nomeados/domesticados, ou um alcançe para especificar uma distância máxima em relação ao jogador.
|
||||
Default usage. Clearing hostile mobs. For more options please type: /help clearmobs=Uso padrão. Eliminando mobs hostis. Para mais opções por favor digite: /help clearmobs
|
|
@ -1,13 +1,11 @@
|
|||
# textdomain: mcl_mobs
|
||||
Peaceful mode active! No monsters will spawn.=Мирный режим включён! Монстры не будут спауниться.
|
||||
This allows you to place a single mob.=Позволяет вам заспаунить одного моба.
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Используйте предмет там, где вы хотите, чтобы заспаунился моб. Животные будут спауниться уже прирученные, если только вы не удерживаете клавишу [Красться] при размещении. Если использовать на спаунере мобов, изменится создаваемый им моб.
|
||||
You need the “maphack” privilege to change the mob spawner.=Вам нужна привилегия “maphack”, чтобы изменить спаунер мобов.
|
||||
Name Tag=Бирка
|
||||
A name tag is an item to name a mob.=Бирка это предмет, дающий мобу имя.
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Прежде чем использовать бирку, нужно задать ей имя на наковальне. Тогда вы сможете использовать бирку, чтобы дать имя мобу.
|
||||
Peaceful mode active! No monsters will spawn.=Мирный режим включён! Монстры не будут появляться.
|
||||
This allows you to place a single mob.=Позволяет вам разместить одного моба.
|
||||
Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Просто поместите это туда, где хотите, чтобы появился моб. Животные будут появляться уже прирученные, если это не нужно, удерживайте клавишу [Красться] при размещении. Если поместить это на спаунер, появляющийся из него моб будет изменён.
|
||||
You need the “maphack” privilege to change the mob spawner.=Вам нужно обладать привилегией “maphack”, чтобы изменить спаунер моба.
|
||||
Name Tag=Именная бирка
|
||||
A name tag is an item to name a mob.=Именная бирка это предмет, чтобы дать мобу имя.
|
||||
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Прежде чем использовать именную бирку, нужно задать имя на наковальне. Тогда вы сможете использовать бирку, чтобы дать имя мобу.
|
||||
Only peaceful mobs allowed!=Разрешены только мирные мобы!
|
||||
Give names to mobs=Даёт имена мобам
|
||||
Set name at anvil=Задайте имя на наковальне
|
||||
Removes specified mobs except nametagged and tamed ones. For the second parameter, use nametagged/tamed to select only nametagged/tamed mobs, or a range to specify a maximum distance from the player.=Удаляет указанных мобов кроме именованных и прирученных. Для второго параметра используйте nametagged/tamed, чтобы выбрать именованных/прирученных мобов или радиус указывающий максимальную дистанцию от игрока.
|
||||
Default usage. Clearing hostile mobs. For more options please type: /help clearmobs=Параметры по умолчанию. Удаляем враждебных мобов. Для дополнительных опций введите: /help clearmobs
|
||||
Set name at anvil=Задайте имя при помощи наковальни
|
||||
|
|
|
@ -4,12 +4,9 @@ local DEFAULT_FALL_SPEED = -9.81*1.5
|
|||
local FLOP_HEIGHT = 6
|
||||
local FLOP_HOR_SPEED = 1.5
|
||||
|
||||
local CHECK_HERD_FREQUENCY = 4
|
||||
|
||||
local PATHFINDING = "gowp"
|
||||
|
||||
local node_snow = "mcl_core:snow"
|
||||
|
||||
|
||||
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
|
||||
|
||||
local atann = math.atan
|
||||
|
@ -76,67 +73,6 @@ function mob_class:is_node_waterhazard(nodename)
|
|||
return false
|
||||
end
|
||||
|
||||
|
||||
local function raycast_line_of_sight (origin, target)
|
||||
local raycast = minetest.raycast(origin, target, false, true)
|
||||
|
||||
local los_blocked = false
|
||||
|
||||
for hitpoint in raycast do
|
||||
if hitpoint.type == "node" then
|
||||
--TODO type object could block vision, for example chests
|
||||
local node = minetest.get_node(minetest.get_pointed_thing_position(hitpoint))
|
||||
|
||||
if node.name ~= "air" then
|
||||
local nodef = minetest.registered_nodes[node.name]
|
||||
if nodef and nodef.walkable then
|
||||
los_blocked = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return not los_blocked
|
||||
end
|
||||
|
||||
function mob_class:target_visible(origin)
|
||||
if not origin then return end
|
||||
|
||||
if not self.attack then return end
|
||||
local target_pos = self.attack:get_pos()
|
||||
|
||||
if not target_pos then return end
|
||||
|
||||
local origin_eye_pos = vector.offset(origin, 0, self.head_eye_height, 0)
|
||||
|
||||
--minetest.log("origin: " .. dump(origin))
|
||||
--minetest.log("origin_eye_pos: " .. dump(origin_eye_pos))
|
||||
|
||||
local targ_head_height, targ_feet_height
|
||||
if self.attack:is_player() then
|
||||
local cbox = self.object:get_properties().collisionbox
|
||||
targ_head_height = vector.offset(target_pos, 0, cbox[5], 0)
|
||||
targ_feet_height = target_pos -- Cbox would put feet under ground which interferes with ray
|
||||
else
|
||||
targ_head_height = vector.offset(target_pos, 0, self.collisionbox[5], 0)
|
||||
targ_feet_height = vector.offset(target_pos, 0, self.collisionbox[2], 0)
|
||||
end
|
||||
|
||||
--minetest.log("start targ_head_height: " .. dump(targ_head_height))
|
||||
if raycast_line_of_sight (origin_eye_pos, targ_head_height) then
|
||||
return true
|
||||
end
|
||||
|
||||
--minetest.log("Start targ_feet_height: " .. dump(targ_feet_height))
|
||||
if raycast_line_of_sight (origin_eye_pos, targ_feet_height) then
|
||||
return true
|
||||
end
|
||||
|
||||
-- TODO mid way between feet and head
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-- check line of sight (BrunoMine)
|
||||
function mob_class:line_of_sight(pos1, pos2, stepsize)
|
||||
|
||||
|
@ -266,8 +202,12 @@ function mob_class:can_jump_cliff()
|
|||
end
|
||||
|
||||
-- is mob facing a cliff or danger
|
||||
function mob_class:is_at_cliff_or_danger()
|
||||
if self.fear_height == 0 or self._jumping_cliff or self._can_jump_cliff or not self.object:get_luaentity() then -- 0 for no falling protection!
|
||||
function mob_class:is_at_cliff_or_danger(can_jump_cliff)
|
||||
if can_jump_cliff == nil then
|
||||
can_jump_cliff = self:can_jump_cliff()
|
||||
end
|
||||
|
||||
if self.fear_height == 0 or can_jump_cliff or self._jumping_cliff or not self.object:get_luaentity() then -- 0 for no falling protection!
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -279,9 +219,8 @@ function mob_class:is_at_cliff_or_danger()
|
|||
local ypos = pos.y + self.collisionbox[2] -- just above floor
|
||||
|
||||
local free_fall, blocker = minetest.line_of_sight(
|
||||
vector.new(pos.x + dir_x, ypos, pos.z + dir_z),
|
||||
vector.new(pos.x + dir_x, ypos - self.fear_height, pos.z + dir_z))
|
||||
|
||||
{x = pos.x + dir_x, y = ypos, z = pos.z + dir_z},
|
||||
{x = pos.x + dir_x, y = ypos - self.fear_height, z = pos.z + dir_z})
|
||||
if free_fall then
|
||||
return true
|
||||
else
|
||||
|
@ -302,16 +241,12 @@ end
|
|||
|
||||
|
||||
-- copy the 'mob facing cliff_or_danger check' from above, and rework to avoid water
|
||||
function mob_class:is_at_water_danger()
|
||||
if self.water_damage == 0 and self.breath_max == -1 then
|
||||
--minetest.log("Do not need a water check for: " .. self.name)
|
||||
return
|
||||
function mob_class:is_at_water_danger(can_jump_cliff)
|
||||
if can_jump_cliff == nil then
|
||||
can_jump_cliff = self:can_jump_cliff()
|
||||
end
|
||||
|
||||
local in_water_danger = self:is_node_waterhazard(self.standing_in) or self:is_node_waterhazard(self.standing_on)
|
||||
if in_water_danger then return false end -- If you're in trouble, do not stop
|
||||
|
||||
if not self.object:get_luaentity() or self._jumping_cliff or self._can_jump_cliff then
|
||||
if not self.object:get_luaentity() or can_jump_cliff or self._jumping_cliff then
|
||||
return false
|
||||
end
|
||||
local yaw = self.object:get_yaw()
|
||||
|
@ -326,57 +261,51 @@ function mob_class:is_at_water_danger()
|
|||
|
||||
local ypos = pos.y + self.collisionbox[2] -- just above floor
|
||||
|
||||
local los, blocker = minetest.line_of_sight(
|
||||
vector.new(pos.x + dir_x, ypos, pos.z + dir_z),
|
||||
vector.new(pos.x + dir_x, ypos - 3, pos.z + dir_z))
|
||||
|
||||
if not los then
|
||||
local free_fall, blocker = minetest.line_of_sight(
|
||||
{x = pos.x + dir_x, y = ypos, z = pos.z + dir_z},
|
||||
{x = pos.x + dir_x, y = ypos - 3, z = pos.z + dir_z})
|
||||
if free_fall then
|
||||
return true
|
||||
else
|
||||
local bnode = minetest.get_node(blocker)
|
||||
local waterdanger = self:is_node_waterhazard(bnode.name)
|
||||
|
||||
if waterdanger and not in_water_danger then
|
||||
if
|
||||
waterdanger and (self:is_node_waterhazard(self.standing_in) or self:is_node_waterhazard( self.standing_on)) then
|
||||
return false
|
||||
elseif waterdanger and (self:is_node_waterhazard(self.standing_in) or self:is_node_waterhazard(self.standing_on)) == false then
|
||||
return true
|
||||
else
|
||||
local def = minetest.registered_nodes[bnode.name]
|
||||
if def and def.walkable then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function mob_class:env_danger_movement_checks(player_in_active_range)
|
||||
function mob_class:env_danger_movement_checks(dtime)
|
||||
local yaw = 0
|
||||
|
||||
if not player_in_active_range then return end
|
||||
|
||||
if self.state == PATHFINDING
|
||||
or self.state == "attack"
|
||||
or self.state == "stand"
|
||||
or self.state == "runaway" then
|
||||
return
|
||||
end
|
||||
|
||||
if self:is_at_water_danger() then
|
||||
--minetest.log("At water danger for mob, stop?: " .. self.name)
|
||||
if math.random(1, 10) <= 7 then
|
||||
if self.state ~= "stand" then
|
||||
self:set_velocity(0)
|
||||
self.state = "stand"
|
||||
self:set_animation( "stand")
|
||||
end
|
||||
yaw = yaw + math.random(-0.5, 0.5)
|
||||
yaw = self:set_yaw( yaw, 8)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
--[[if self:is_at_cliff_or_danger(can_jump_cliff) then
|
||||
if self.state ~= "stand" then
|
||||
local can_jump_cliff = self:can_jump_cliff()
|
||||
if self.state ~= "attack" and self:is_at_water_danger(can_jump_cliff) then
|
||||
if math.random(1, 10) <= 6 then
|
||||
self:set_velocity(0)
|
||||
self.state = "stand"
|
||||
self:set_animation( "stand")
|
||||
yaw = yaw + math.random(-0.5, 0.5)
|
||||
yaw = self:set_yaw( yaw, 8)
|
||||
end
|
||||
end
|
||||
|
||||
if self:is_at_cliff_or_danger(can_jump_cliff) then
|
||||
self:set_velocity(0)
|
||||
self.state = "stand"
|
||||
self:set_animation( "stand")
|
||||
local yaw = self.object:get_yaw() or 0
|
||||
yaw = self:set_yaw( yaw + 0.78, 8)
|
||||
end--]]
|
||||
end
|
||||
end
|
||||
|
||||
-- jump if facing a solid node (not fences or gates)
|
||||
|
@ -416,11 +345,9 @@ function mob_class:do_jump()
|
|||
jump_c_multiplier = v2/self.walk_velocity/2
|
||||
end
|
||||
|
||||
local yaw_dir = minetest.yaw_to_dir(self.object:get_yaw())
|
||||
|
||||
-- where is front
|
||||
local dir_x = -math.sin(yaw) * (self.collisionbox[4] + 0.5)*jump_c_multiplier+yaw_dir.x
|
||||
local dir_z = math.cos(yaw) * (self.collisionbox[4] + 0.5)*jump_c_multiplier+yaw_dir.z
|
||||
local dir_x = -math.sin(yaw) * (self.collisionbox[4] + 0.5)*jump_c_multiplier+0.6
|
||||
local dir_z = math.cos(yaw) * (self.collisionbox[4] + 0.5)*jump_c_multiplier+0.6
|
||||
|
||||
-- what is in front of mob?
|
||||
nod = node_ok({
|
||||
|
@ -449,7 +376,7 @@ function mob_class:do_jump()
|
|||
end
|
||||
|
||||
local ndef = minetest.registered_nodes[nod.name]
|
||||
if self.walk_chance == 0 or ndef and ndef.walkable or self._can_jump_cliff then
|
||||
if self.walk_chance == 0 or ndef and ndef.walkable or self:can_jump_cliff() then
|
||||
|
||||
if minetest.get_item_group(nod.name, "fence") == 0
|
||||
and minetest.get_item_group(nod.name, "fence_gate") == 0
|
||||
|
@ -459,7 +386,7 @@ function mob_class:do_jump()
|
|||
|
||||
v.y = self.jump_height + 0.1 * 3
|
||||
|
||||
if self._can_jump_cliff then
|
||||
if self:can_jump_cliff() then
|
||||
v=vector.multiply(v, vector.new(2.8,1,2.8))
|
||||
end
|
||||
|
||||
|
@ -543,7 +470,6 @@ end
|
|||
-- find and replace what mob is looking for (grass, wheat etc.)
|
||||
function mob_class:replace_node(pos)
|
||||
|
||||
|
||||
if not self.replace_rate
|
||||
or not self.replace_what
|
||||
or self.child == true
|
||||
|
@ -574,21 +500,18 @@ function mob_class:replace_node(pos)
|
|||
|
||||
local oldnode = {name = what, param2 = node.param2}
|
||||
local newnode = {name = with, param2 = node.param2}
|
||||
local on_replace_return = false
|
||||
local on_replace_return
|
||||
|
||||
if self.on_replace then
|
||||
on_replace_return = self.on_replace(self, pos, oldnode, newnode)
|
||||
end
|
||||
|
||||
|
||||
if on_replace_return ~= false then
|
||||
|
||||
if mobs_griefing then
|
||||
minetest.after(self.replace_delay, function()
|
||||
if self and self.object and self.object:get_velocity() and self.health > 0 then
|
||||
minetest.set_node(pos, newnode)
|
||||
end
|
||||
end)
|
||||
minetest.set_node(pos, newnode)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -698,7 +621,7 @@ function mob_class:check_runaway_from()
|
|||
end
|
||||
|
||||
|
||||
-- follow player if owner or holding item
|
||||
-- follow player if owner or holding item, if fish outta water then flop
|
||||
function mob_class:check_follow()
|
||||
-- find player to follow
|
||||
if (self.follow ~= "" or self.order == "follow") and not self.following
|
||||
|
@ -799,7 +722,7 @@ function mob_class:flop()
|
|||
return
|
||||
elseif self.state == "flop" then
|
||||
self.state = "stand"
|
||||
self.object:set_acceleration(vector.zero())
|
||||
self.object:set_acceleration({x = 0, y = 0, z = 0})
|
||||
self:set_velocity(0)
|
||||
end
|
||||
end
|
||||
|
@ -831,7 +754,7 @@ function mob_class:check_herd(dtime)
|
|||
if self.move_in_group == false then return end
|
||||
|
||||
check_herd_timer = check_herd_timer + dtime
|
||||
if check_herd_timer < CHECK_HERD_FREQUENCY then return end
|
||||
if check_herd_timer < 4 then return end
|
||||
check_herd_timer = 0
|
||||
for _,o in pairs(minetest.get_objects_inside_radius(pos,self.view_range)) do
|
||||
local l = o:get_luaentity()
|
||||
|
@ -962,7 +885,7 @@ function mob_class:do_states_walk()
|
|||
end
|
||||
end
|
||||
|
||||
function mob_class:do_states_stand(player_in_active_range)
|
||||
function mob_class:do_states_stand()
|
||||
local yaw = self.object:get_yaw() or 0
|
||||
|
||||
if math.random(1, 4) == 1 then
|
||||
|
@ -1006,16 +929,14 @@ function mob_class:do_states_stand(player_in_active_range)
|
|||
if self.order == "stand" or self.order == "sleep" or self.order == "work" then
|
||||
|
||||
else
|
||||
if player_in_active_range then
|
||||
if self.walk_chance ~= 0
|
||||
and self.facing_fence ~= true
|
||||
and math.random(1, 100) <= self.walk_chance
|
||||
and self:is_at_cliff_or_danger() == false then
|
||||
if self.walk_chance ~= 0
|
||||
and self.facing_fence ~= true
|
||||
and math.random(1, 100) <= self.walk_chance
|
||||
and self:is_at_cliff_or_danger() == false then
|
||||
|
||||
self:set_velocity(self.walk_velocity)
|
||||
self.state = "walk"
|
||||
self:set_animation( "walk")
|
||||
end
|
||||
self:set_velocity(self.walk_velocity)
|
||||
self.state = "walk"
|
||||
self:set_animation( "walk")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs
|
||||
local mob_class = mcl_mobs.mob_class
|
||||
local validate_vector = mcl_util.validate_vector
|
||||
|
||||
local ENTITY_CRAMMING_MAX = 24
|
||||
local CRAMMING_DAMAGE = 3
|
||||
|
@ -185,7 +184,7 @@ function mob_class:collision()
|
|||
end
|
||||
|
||||
function mob_class:check_death_and_slow_mob()
|
||||
local d = 0.7
|
||||
local d = 0.85
|
||||
local dying = self:check_dying()
|
||||
if dying then d = 0.92 end
|
||||
|
||||
|
@ -199,8 +198,6 @@ end
|
|||
|
||||
-- move mob in facing direction
|
||||
function mob_class:set_velocity(v)
|
||||
if not v then return end
|
||||
|
||||
local c_x, c_y = 0, 0
|
||||
|
||||
-- can mob be pushed, if so calculate direction
|
||||
|
@ -210,15 +207,18 @@ function mob_class:set_velocity(v)
|
|||
|
||||
-- halt mob if it has been ordered to stay
|
||||
if self.order == "stand" or self.order == "sit" then
|
||||
self.acc = vector.zero()
|
||||
return
|
||||
self.acc=vector.new(0,0,0)
|
||||
return
|
||||
end
|
||||
|
||||
local yaw = (self.object:get_yaw() or 0) + self.rotate
|
||||
local vv = self.object:get_velocity()
|
||||
|
||||
if vv and yaw then
|
||||
self.acc = vector.new(((math.sin(yaw) * -v) + c_x) * .4, 0, ((math.cos(yaw) * v) + c_y) * .4)
|
||||
if vv then
|
||||
self.acc={
|
||||
x = ((math.sin(yaw) * -v) + c_x)*.27,
|
||||
y = 0,
|
||||
z = ((math.cos(yaw) * v) + c_y)*.27,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -328,9 +328,9 @@ function mob_class:set_yaw(yaw, delay, dtime)
|
|||
end
|
||||
|
||||
if math.deg(yaw) > 360 then
|
||||
yaw=math.rad(math.deg(yaw)%360)
|
||||
yaw=yaw%360
|
||||
elseif math.deg(yaw) < 0 then
|
||||
yaw=math.rad(((360*5)-math.deg(yaw))%360)
|
||||
yaw=((360*5)-yaw)%360
|
||||
end
|
||||
|
||||
--calculate the shortest way to turn to find our target
|
||||
|
@ -354,9 +354,9 @@ function mob_class:set_yaw(yaw, delay, dtime)
|
|||
ddtime = dtime
|
||||
end
|
||||
|
||||
if math.abs(target_shortest_path_nums) > 10 then
|
||||
if math.abs(target_shortest_path_nums) > 5 then
|
||||
self.object:set_yaw(self.object:get_yaw()+(target_shortest_path*(3.6*ddtime)))
|
||||
if validate_vector(self.acc) then
|
||||
if self.acc then
|
||||
self.acc=vector.rotate_around_axis(self.acc,vector.new(0,1,0), target_shortest_path*(3.6*ddtime))
|
||||
end
|
||||
end
|
||||
|
@ -676,20 +676,13 @@ function mob_class:do_env_damage()
|
|||
self.standing_in = node_ok(pos, "air").name
|
||||
self.standing_on = node_ok(pos2, "air").name
|
||||
|
||||
local pos3 = vector.offset(pos, 0, 1, 0)
|
||||
self.standing_under = node_ok(pos3, "air").name
|
||||
|
||||
-- don't fall when on ignore, just stand still
|
||||
if self.standing_in == "ignore" then
|
||||
self.object:set_velocity({x = 0, y = 0, z = 0})
|
||||
-- wither rose effect
|
||||
elseif self.standing_in == "mcl_flowers:wither_rose" then
|
||||
mcl_potions.withering_func(self.object, 1, 2)
|
||||
end
|
||||
|
||||
local nodef = minetest.registered_nodes[self.standing_in]
|
||||
local nodef2 = minetest.registered_nodes[self.standing_on]
|
||||
local nodef3 = minetest.registered_nodes[self.standing_under]
|
||||
|
||||
-- rain
|
||||
if self.rain_damage > 0 then
|
||||
|
@ -769,7 +762,7 @@ function mob_class:do_env_damage()
|
|||
if minetest.get_item_group(self.standing_in, "water") == 0 then
|
||||
drowning = true
|
||||
end
|
||||
elseif nodef.drowning > 0 and nodef3.drowning > 0 then
|
||||
elseif nodef.drowning > 0 then
|
||||
drowning = true
|
||||
end
|
||||
|
||||
|
@ -828,19 +821,11 @@ function mob_class:do_env_damage()
|
|||
return self:check_for_death("unknown", {type = "unknown"})
|
||||
end
|
||||
|
||||
function mob_class:step_damage (dtime, pos)
|
||||
if not self.fire_resistant then
|
||||
mcl_burning.tick(self.object, dtime, self)
|
||||
if not self.object:get_pos() then return true end -- mcl_burning.tick may remove object immediately
|
||||
|
||||
if self:check_for_death("fire", {type = "fire"}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function mob_class:env_damage (dtime, pos)
|
||||
-- environmental damage timer (every 1 second)
|
||||
self.env_damage_timer = self.env_damage_timer + dtime
|
||||
|
||||
|
||||
if self.env_damage_timer > 1 then
|
||||
self.env_damage_timer = 0
|
||||
|
||||
|
@ -919,36 +904,47 @@ function mob_class:falling(pos)
|
|||
-- floating in water (or falling)
|
||||
local v = self.object:get_velocity()
|
||||
if v then
|
||||
local new_acceleration
|
||||
|
||||
if v.y > 0 then
|
||||
-- apply gravity when moving up
|
||||
new_acceleration = vector.new(0, DEFAULT_FALL_SPEED, 0)
|
||||
self.object:set_acceleration({
|
||||
x = 0,
|
||||
y = DEFAULT_FALL_SPEED,
|
||||
z = 0
|
||||
})
|
||||
|
||||
elseif v.y <= 0 and v.y > self.fall_speed then
|
||||
-- fall downwards at set speed
|
||||
new_acceleration = vector.new(0, self.fall_speed, 0)
|
||||
self.object:set_acceleration({
|
||||
x = 0,
|
||||
y = self.fall_speed,
|
||||
z = 0
|
||||
})
|
||||
else
|
||||
-- stop accelerating once max fall speed hit
|
||||
new_acceleration =vector.zero()
|
||||
self.object:set_acceleration({x = 0, y = 0, z = 0})
|
||||
end
|
||||
|
||||
self.object:set_acceleration(new_acceleration)
|
||||
end
|
||||
|
||||
local acc = self.object:get_acceleration()
|
||||
|
||||
local registered_node = minetest.registered_nodes[node_ok(pos).name]
|
||||
|
||||
if registered_node.groups.lava then
|
||||
if minetest.registered_nodes[node_ok(pos).name].groups.lava then
|
||||
if acc and self.floats_on_lava == 1 then
|
||||
self.object:set_acceleration(vector.new(0, -self.fall_speed / (math.max(1, v.y) ^ 2), 0))
|
||||
self.object:set_acceleration({
|
||||
x = 0,
|
||||
y = -self.fall_speed / (math.max(1, v.y) ^ 2),
|
||||
z = 0
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- in water then float up
|
||||
if registered_node.groups.water then
|
||||
if acc and self.floats == 1 and minetest.registered_nodes[node_ok(vector.offset(pos,0,self.collisionbox[5] -0.25,0)).name].groups.water then
|
||||
self.object:set_acceleration(vector.new(0, -self.fall_speed / (math.max(1, v.y) ^ 2), 0))
|
||||
if minetest.registered_nodes[node_ok(pos).name].groups.water then
|
||||
if acc and self.floats == 1 then
|
||||
self.object:set_acceleration({
|
||||
x = 0,
|
||||
y = -self.fall_speed / (math.max(1, v.y) ^ 2),
|
||||
z = 0
|
||||
})
|
||||
end
|
||||
else
|
||||
-- fall damage onto solid ground
|
||||
|
@ -1035,6 +1031,9 @@ function mob_class:check_suspend(player_in_active_range)
|
|||
self.object:set_acceleration(vector.zero())
|
||||
self.object:set_velocity(vector.zero())
|
||||
end
|
||||
if acc.y == 0 and node_under == "air" then
|
||||
self:falling(pos)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -2,13 +2,6 @@
|
|||
local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs
|
||||
local mob_class = mcl_mobs.mob_class
|
||||
|
||||
local modern_lighting = minetest.settings:get_bool("mcl_mobs_modern_lighting", true)
|
||||
local nether_threshold = tonumber(minetest.settings:get("mcl_mobs_nether_threshold")) or 11
|
||||
local end_threshold = tonumber(minetest.settings:get("mcl_mobs_end_threshold")) or 0
|
||||
local overworld_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_threshold")) or 0
|
||||
local overworld_sky_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_sky_threshold")) or 7
|
||||
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
|
||||
|
@ -34,11 +27,8 @@ local table_remove = table.remove
|
|||
local pairs = pairs
|
||||
|
||||
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_mobs_spawning", false)
|
||||
local function mcl_log (message, property)
|
||||
local function mcl_log (message)
|
||||
if LOGGING_ON then
|
||||
if property then
|
||||
message = message .. ": " .. dump(property)
|
||||
end
|
||||
mcl_util.mcl_log (message, "[Mobs spawn]", true)
|
||||
end
|
||||
end
|
||||
|
@ -62,25 +52,21 @@ local MOB_CAP_INNER_RADIUS = 32
|
|||
local aoc_range = 136
|
||||
|
||||
local MISSING_CAP_DEFAULT = 15
|
||||
local MOBS_CAP_CLOSE = 10
|
||||
local MOBS_CAP_CLOSE = 5
|
||||
|
||||
local SPAWN_MAPGEN_LIMIT = mcl_vars.mapgen_limit - 150
|
||||
|
||||
local mob_cap = {
|
||||
hostile = tonumber(minetest.settings:get("mcl_mob_cap_monster")) or 70,
|
||||
passive = tonumber(minetest.settings:get("mcl_mob_cap_animal")) or 10,
|
||||
passive = tonumber(minetest.settings:get("mcl_mob_cap_animal")) or 13,
|
||||
ambient = tonumber(minetest.settings:get("mcl_mob_cap_ambient")) or 15,
|
||||
water = tonumber(minetest.settings:get("mcl_mob_cap_water")) or 8,
|
||||
water_ambient = tonumber(minetest.settings:get("mcl_mob_cap_water_ambient")) or 20,
|
||||
water_underground = tonumber(minetest.settings:get("mcl_mob_cap_water_underground")) or 5,
|
||||
axolotl = tonumber(minetest.settings:get("mcl_mob_cap_axolotl")) or 2, -- TODO should be 5 when lush caves added
|
||||
water_ambient = tonumber(minetest.settings:get("mcl_mob_cap_water_ambient")) or 20, --currently unused
|
||||
player = tonumber(minetest.settings:get("mcl_mob_cap_player")) or 75,
|
||||
global_hostile = tonumber(minetest.settings:get("mcl_mob_cap_hostile")) or 300,
|
||||
global_non_hostile = tonumber(minetest.settings:get("mcl_mob_cap_non_hostile")) or 300,
|
||||
total = tonumber(minetest.settings:get("mcl_mob_cap_total")) or 500,
|
||||
}
|
||||
|
||||
local peaceful_percentage_spawned = tonumber(minetest.settings:get("mcl_mob_peaceful_percentage_spawned")) or 30
|
||||
local peaceful_percentage_spawned = tonumber(minetest.settings:get("mcl_mob_peaceful_percentage_spawned")) or 35
|
||||
local peaceful_group_percentage_spawned = tonumber(minetest.settings:get("mcl_mob_peaceful_group_percentage_spawned")) or 15
|
||||
local hostile_group_percentage_spawned = tonumber(minetest.settings:get("mcl_mob_hostile_group_percentage_spawned")) or 20
|
||||
|
||||
|
@ -354,32 +340,15 @@ local function count_mobs_all(categorise_by, pos)
|
|||
end
|
||||
|
||||
local function count_mobs_total_cap(mob_type)
|
||||
local total = 0
|
||||
local num = 0
|
||||
local hostile = 0
|
||||
local non_hostile = 0
|
||||
for _,l in pairs(minetest.luaentities) do
|
||||
if l.is_mob then
|
||||
total = total + 1
|
||||
local nametagged = l.nametag and l.nametag ~= ""
|
||||
if ( mob_type == nil or l.type == mob_type ) and not nametagged then
|
||||
if l.spawn_class == "hostile" then
|
||||
hostile = hostile + 1
|
||||
else
|
||||
non_hostile = non_hostile + 1
|
||||
end
|
||||
if ( mob_type == nil or l.type == mob_type ) and l.can_despawn and not l.nametag then
|
||||
num = num + 1
|
||||
else
|
||||
mcl_log("l.name", l.name)
|
||||
mcl_log("l.nametag", l.nametag)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
mcl_log("Total mobs", total)
|
||||
mcl_log("hostile", hostile)
|
||||
mcl_log("non_hostile", non_hostile)
|
||||
return num, non_hostile, hostile
|
||||
return num
|
||||
end
|
||||
|
||||
local function output_mob_stats(mob_counts, total_mobs, chat_display)
|
||||
|
@ -716,6 +685,9 @@ local function spawn_check(pos, spawn_def)
|
|||
and spawn_def.dimension == dimension
|
||||
and biome_check(spawn_def.biomes, gotten_biome) then
|
||||
|
||||
--mcl_log("Level 1 spawn check passed")
|
||||
--minetest.log("Mob: " .. mob_def.name)
|
||||
|
||||
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)
|
||||
|
@ -725,41 +697,20 @@ local function spawn_check(pos, spawn_def)
|
|||
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("Level 2 spawn 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
|
||||
if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
|
||||
--mcl_log("Level 3 spawn check passed")
|
||||
return true
|
||||
else
|
||||
if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
|
||||
return true
|
||||
end
|
||||
mcl_log("Spawn check level 3 failed")
|
||||
end
|
||||
else
|
||||
mcl_log("Spawn check level 2 failed")
|
||||
end
|
||||
else
|
||||
mcl_log("Spawn check level 1 failed")
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
@ -880,7 +831,7 @@ if mobs_spawn then
|
|||
-- Get pos to spawn, x and z are randomised, y is range
|
||||
|
||||
|
||||
local function mob_cap_space (pos, mob_type, mob_counts_close, mob_counts_wide, cap_space_hostile, cap_space_non_hostile)
|
||||
local function mob_cap_space (pos, mob_type, mob_counts_close, mob_counts_wide)
|
||||
|
||||
-- Some mob examples
|
||||
--type = "monster", spawn_class = "hostile",
|
||||
|
@ -896,18 +847,9 @@ if mobs_spawn then
|
|||
mob_total_wide = 0
|
||||
end
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
else
|
||||
mcl_log("cap_space_global", cap_space_non_hostile)
|
||||
cap_space_available = math.min(cap_space_non_hostile, cap_space_wide)
|
||||
local cap_space_wide = type_cap - mob_total_wide
|
||||
if cap_space_wide < 1 then
|
||||
cap_space_wide = 0
|
||||
end
|
||||
|
||||
local mob_total_close = mob_counts_close[mob_type]
|
||||
|
@ -916,11 +858,12 @@ 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 = close_zone_cap - mob_total_close
|
||||
if cap_space_close < 1 then
|
||||
cap_space_close = 0
|
||||
end
|
||||
|
||||
mcl_log("cap_space_close", cap_space_close)
|
||||
mcl_log("cap_space_available", cap_space_available)
|
||||
--mcl_log("spawn_class: " .. spawn_class)
|
||||
|
||||
if false and mob_type == "water" then
|
||||
mcl_log("mob_type: " .. mob_type .. " and pos: " .. minetest.pos_to_string(pos))
|
||||
|
@ -930,7 +873,7 @@ if mobs_spawn then
|
|||
mcl_log("cap_space_close: " .. cap_space_close)
|
||||
end
|
||||
|
||||
return cap_space_available
|
||||
return cap_space_wide, cap_space_close
|
||||
end
|
||||
|
||||
local function find_spawning_position(pos, max_times)
|
||||
|
@ -941,7 +884,7 @@ if mobs_spawn then
|
|||
|
||||
local y_min, y_max = decypher_limits(pos.y)
|
||||
|
||||
--mcl_log("mapgen_limit: " .. SPAWN_MAPGEN_LIMIT)
|
||||
mcl_log("mapgen_limit: " .. SPAWN_MAPGEN_LIMIT)
|
||||
local i = 0
|
||||
repeat
|
||||
local goal_pos = get_next_mob_spawn_pos(pos)
|
||||
|
@ -973,7 +916,7 @@ if mobs_spawn then
|
|||
return spawning_position
|
||||
end
|
||||
|
||||
local function spawn_a_mob(pos, cap_space_hostile, cap_space_non_hostile)
|
||||
local function spawn_a_mob(pos)
|
||||
--create a disconnected clone of the spawn dictionary, prevents memory leak
|
||||
local mob_library_worker_table = table_copy(spawn_dictionary)
|
||||
|
||||
|
@ -1011,18 +954,22 @@ if mobs_spawn then
|
|||
if mob_def and mob_def.name and minetest.registered_entities[mob_def.name] then
|
||||
|
||||
local mob_def_ent = minetest.registered_entities[mob_def.name]
|
||||
--local mob_type = mob_def_ent.type
|
||||
local mob_spawn_class = mob_def_ent.spawn_class
|
||||
|
||||
local cap_space_available = mob_cap_space (spawning_position, mob_spawn_class, mob_counts_close, mob_counts_wide, cap_space_hostile, cap_space_non_hostile)
|
||||
--mcl_log("mob_spawn_class: " .. mob_spawn_class)
|
||||
|
||||
if cap_space_available > 0 then
|
||||
local cap_space_wide, cap_space_close = mob_cap_space (spawning_position, mob_spawn_class, mob_counts_close, mob_counts_wide)
|
||||
|
||||
|
||||
if cap_space_close > 0 and cap_space_wide > 0 then
|
||||
--mcl_log("Cap space available")
|
||||
|
||||
-- Spawn caps for animals and water creatures fill up rapidly. Need to throttle this somewhat
|
||||
-- for performance and for early game challenge. We don't want to reduce hostiles though.
|
||||
local spawn_hostile = (mob_spawn_class == "hostile")
|
||||
local spawn_passive = (mob_spawn_class ~= "hostile") and math.random(100) < peaceful_percentage_spawned
|
||||
|
||||
-- or not hostile
|
||||
--mcl_log("Spawn_passive: " .. tostring(spawn_passive))
|
||||
--mcl_log("Spawn_hostile: " .. tostring(spawn_hostile))
|
||||
|
||||
|
@ -1053,10 +1000,13 @@ if mobs_spawn then
|
|||
local group_min = mob_def_ent.spawn_in_group_min or 1
|
||||
if not group_min then group_min = 1 end
|
||||
|
||||
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)
|
||||
mcl_log("throttled spawning quantity: " .. amount_to_spawn)
|
||||
local amount_to_spawn = math.random(group_min,spawn_in_group)
|
||||
|
||||
if amount_to_spawn > cap_space_wide then
|
||||
mcl_log("Spawning quantity: " .. amount_to_spawn)
|
||||
mcl_log("Throttle amount to cap space: " .. cap_space_wide)
|
||||
amount_to_spawn = cap_space_wide
|
||||
end
|
||||
|
||||
if logging then
|
||||
minetest.log("action", "[mcl_mobs] A group of " ..amount_to_spawn .. " " .. mob_def.name .. " mob spawns on " ..minetest.get_node(vector.offset(spawning_position,0,-1,0)).name .." at " .. minetest.pos_to_string(spawning_position, 1))
|
||||
|
@ -1071,7 +1021,7 @@ if mobs_spawn then
|
|||
|
||||
if spawned then
|
||||
--mcl_log("We have spawned")
|
||||
mob_counts_close, mob_counts_wide, total_mobs = count_mobs_all("spawn_class", pos)
|
||||
mob_counts_close, mob_counts_wide, total_mobs = count_mobs_all("type", pos)
|
||||
local new_spawning_position = find_spawning_position(pos, FIND_SPAWN_POS_RETRIES_SUCCESS_RESPIN)
|
||||
if new_spawning_position then
|
||||
mcl_log("Setting new spawning position")
|
||||
|
@ -1084,7 +1034,7 @@ if mobs_spawn then
|
|||
--mcl_log("Spawn check failed")
|
||||
end
|
||||
else
|
||||
--mcl_log("Cap space full")
|
||||
mcl_log("Cap space full")
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1104,13 +1054,7 @@ if mobs_spawn then
|
|||
timer = 0
|
||||
|
||||
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)
|
||||
mcl_log("global cap_space_hostile", cap_space_hostile)
|
||||
mcl_log("global cap_space_non_hostile", cap_space_non_hostile)
|
||||
|
||||
local total_mobs = count_mobs_total_cap()
|
||||
if total_mobs > mob_cap.total or total_mobs > #players * mob_cap.player then
|
||||
minetest.log("action","[mcl_mobs] global mob cap reached. no cycle spawning.")
|
||||
return
|
||||
|
@ -1121,49 +1065,21 @@ if mobs_spawn then
|
|||
local dimension = mcl_worlds.pos_to_dimension(pos)
|
||||
-- ignore void and unloaded area
|
||||
if dimension ~= "void" and dimension ~= "default" then
|
||||
spawn_a_mob(pos, cap_space_hostile, cap_space_non_hostile)
|
||||
spawn_a_mob(pos)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function despawn_allowed(self)
|
||||
local nametag = self.nametag and self.nametag ~= ""
|
||||
local not_busy = self.state ~= "attack" and self.following == nil
|
||||
if self.can_despawn == true then
|
||||
if not nametag and not_busy and not self.tamed == true and not self.persistent == true then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function mob_class:despawn_allowed()
|
||||
despawn_allowed(self)
|
||||
end
|
||||
|
||||
|
||||
assert(despawn_allowed({can_despawn=false}) == false, "despawn_allowed - can_despawn false failed")
|
||||
assert(despawn_allowed({can_despawn=true}) == true, "despawn_allowed - can_despawn true failed")
|
||||
|
||||
assert(despawn_allowed({can_despawn=true, nametag=""}) == true, "despawn_allowed - blank nametag failed")
|
||||
assert(despawn_allowed({can_despawn=true, nametag=nil}) == true, "despawn_allowed - nil nametag failed")
|
||||
assert(despawn_allowed({can_despawn=true, nametag="bob"}) == false, "despawn_allowed - nametag failed")
|
||||
|
||||
assert(despawn_allowed({can_despawn=true, state="attack"}) == false, "despawn_allowed - attack state failed")
|
||||
assert(despawn_allowed({can_despawn=true, following="blah"}) == false, "despawn_allowed - following state failed")
|
||||
|
||||
assert(despawn_allowed({can_despawn=true, tamed=false}) == true, "despawn_allowed - not tamed")
|
||||
assert(despawn_allowed({can_despawn=true, tamed=true}) == false, "despawn_allowed - tamed")
|
||||
|
||||
assert(despawn_allowed({can_despawn=true, persistent=true}) == false, "despawn_allowed - persistent")
|
||||
assert(despawn_allowed({can_despawn=true, persistent=false}) == true, "despawn_allowed - not persistent")
|
||||
|
||||
function mob_class:check_despawn(pos, dtime)
|
||||
self.lifetimer = self.lifetimer - dtime
|
||||
|
||||
-- Despawning: when lifetimer expires, remove mob
|
||||
if remove_far and despawn_allowed(self) then
|
||||
if remove_far
|
||||
and self.can_despawn == true
|
||||
and ((not self.nametag) or (self.nametag == ""))
|
||||
and self.state ~= "attack"
|
||||
and self.following == nil then
|
||||
if self.despawn_immediately or self.lifetimer <= 0 then
|
||||
if logging then
|
||||
minetest.log("action", "[mcl_mobs] Mob "..self.name.." despawns at "..minetest.pos_to_string(pos, 1) .. " lifetimer ran out")
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
# textdomain:mcl_paintings
|
||||
Painting=Maleri
|
|
@ -1,2 +0,0 @@
|
|||
# textdomain:mcl_paintings
|
||||
Painting=Cuadro
|
|
@ -1,2 +0,0 @@
|
|||
# textdomain:mcl_paintings
|
||||
Painting=Pintura
|
|
@ -1,2 +1,2 @@
|
|||
# textdomain:mcl_paintings
|
||||
Painting=Картина
|
||||
Painting=Рисование
|
||||
|
|
|
@ -2,9 +2,6 @@ local dim = {"x", "z"}
|
|||
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
local anti_troll = minetest.settings:get_bool("wither_anti_troll_measures", false)
|
||||
local peaceful = minetest.settings:get_bool("only_peaceful_mobs", false)
|
||||
|
||||
local function load_schem(filename)
|
||||
local file = io.open(modpath .. "/schems/" .. filename, "r")
|
||||
local data = minetest.deserialize(file:read())
|
||||
|
@ -12,14 +9,6 @@ local function load_schem(filename)
|
|||
return data
|
||||
end
|
||||
|
||||
local wboss_overworld = 0
|
||||
local wboss_nether = 0
|
||||
local wboss_end = 0
|
||||
|
||||
local LIM_OVERWORLD = tonumber(minetest.settings:get("wither_cap_overworld")) or 3
|
||||
local LIM_NETHER = tonumber(minetest.settings:get("wither_cap_nether")) or 10
|
||||
local LIM_END = tonumber(minetest.settings:get("wither_cap_end")) or 5
|
||||
|
||||
local wither_spawn_schems = {}
|
||||
|
||||
for _, d in pairs(dim) do
|
||||
|
@ -27,13 +16,8 @@ for _, d in pairs(dim) do
|
|||
end
|
||||
|
||||
local function check_schem(pos, schem)
|
||||
local cn_name
|
||||
for _, n in pairs(schem) do
|
||||
cn_name = minetest.get_node(vector.add(pos, n)).name
|
||||
if string.find(cn_name, "mcl_heads:wither_skeleton") then
|
||||
cn_name = "mcl_heads:wither_skeleton"
|
||||
end
|
||||
if cn_name ~= n.name then
|
||||
if minetest.get_node(vector.add(pos, n)).name ~= n.name then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
@ -46,32 +30,14 @@ local function remove_schem(pos, schem)
|
|||
end
|
||||
end
|
||||
|
||||
local function check_limit(pos)
|
||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||
if dim == "overworld" and wboss_overworld >= LIM_OVERWORLD then return false
|
||||
elseif dim == "end" and wboss_end >= LIM_END then return false
|
||||
elseif wboss_nether >= LIM_NETHER then return false
|
||||
else return true end
|
||||
end
|
||||
|
||||
local function wither_spawn(pos, player)
|
||||
if peaceful then return end
|
||||
local function wither_spawn(pos)
|
||||
for _, d in pairs(dim) do
|
||||
for i = 0, 2 do
|
||||
local p = vector.add(pos, {x = 0, y = -2, z = 0, [d] = -i})
|
||||
local schem = wither_spawn_schems[d]
|
||||
if check_schem(p, schem) and (not anti_troll or check_limit(pos)) then
|
||||
if check_schem(p, schem) then
|
||||
remove_schem(p, schem)
|
||||
local wither = minetest.add_entity(vector.add(p, {x = 0, y = 1, z = 0, [d] = 1}), "mobs_mc:wither")
|
||||
if not wither then return end
|
||||
local wither_ent = wither:get_luaentity()
|
||||
wither_ent._spawner = player:get_player_name()
|
||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||
if dim == "overworld" then
|
||||
wboss_overworld = wboss_overworld + 1
|
||||
elseif dim == "end" then
|
||||
wboss_end = wboss_end + 1
|
||||
else wboss_nether = wboss_nether + 1 end
|
||||
minetest.add_entity(vector.add(p, {x = 0, y = 1, z = 0, [d] = 1}), "mobs_mc:wither")
|
||||
local objects = minetest.get_objects_inside_radius(pos, 20)
|
||||
for _, players in ipairs(objects) do
|
||||
if players:is_player() then
|
||||
|
@ -88,19 +54,7 @@ local old_on_place = wither_head.on_place
|
|||
function wither_head.on_place(itemstack, placer, pointed)
|
||||
local n = minetest.get_node(vector.offset(pointed.above,0,-1,0))
|
||||
if n and n.name == "mcl_nether:soul_sand" then
|
||||
minetest.after(0, wither_spawn, pointed.above, placer)
|
||||
minetest.after(0, wither_spawn, pointed.above)
|
||||
end
|
||||
return old_on_place(itemstack, placer, pointed)
|
||||
end
|
||||
|
||||
if anti_troll then
|
||||
-- pull wither counts per dimension
|
||||
minetest.register_globalstep(function(dtime)
|
||||
wboss_overworld = mobs_mc.wither_count_overworld
|
||||
wboss_nether = mobs_mc.wither_count_nether
|
||||
wboss_end = mobs_mc.wither_count_end
|
||||
mobs_mc.wither_count_overworld = 0
|
||||
mobs_mc.wither_count_nether = 0
|
||||
mobs_mc.wither_count_end = 0
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -191,10 +191,9 @@ Origin of those models:
|
|||
* [Spennnyyy](https://freesound.org/people/Spennnyyy/) (CC0)
|
||||
* `mcl_totems_totem.ogg`
|
||||
* Source: <https://freesound.org/people/Spennnyyy/sounds/323502/>
|
||||
* [Baŝto](https://opengameart.org/users/ba%C5%9Dto) (remixer) and [kantouth](https://freesound.org/people/kantouth/) (original author)
|
||||
* [Baŝto](https://opengameart.org/users/ba%C5%9Dto)
|
||||
* `mobs_mc_skeleton_random.*.ogg` (CC BY 3.0)
|
||||
* Source: <https://opengameart.org/content/walking-skeleton>
|
||||
* Based on: <https://freesound.org/people/kantouth/sounds/115113/>
|
||||
* [spookymodem](https://freesound.org/people/spookymodem/)
|
||||
* `mobs_mc_skeleton_death.ogg` (CC0)
|
||||
* <https://freesound.org/people/spookymodem/sounds/202091/>
|
||||
|
@ -305,10 +304,7 @@ Origin of those models:
|
|||
* `mobs_mc_rabbit_random.*.ogg` (CC0)
|
||||
* Changes were made.
|
||||
* Source: <https://freesound.org/people/Alshred/>
|
||||
* [epCode]
|
||||
* `extra_mobs_hoglin*.ogg` (LGPL 3.0)
|
||||
* Source: <https://git.minetest.land/epCode/extra_mobs/src/branch/master/sounds>
|
||||
|
||||
Note: Many of these sounds have been more or less modified to fit the game.
|
||||
|
||||
Sounds not mentioned here are licensed under CC0.
|
||||
Sounds not mentioned hre are licensed under CC0.
|
||||
|
|
|
@ -39,7 +39,7 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers
|
|||
* Cave Spider
|
||||
* Enderman
|
||||
* Zombie Villager
|
||||
* Zombie Piglin
|
||||
* Zombie Pigman
|
||||
* Wither Skeleton
|
||||
* Magma Cube
|
||||
* Blaze
|
||||
|
|
|
@ -2,7 +2,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||
|
||||
local axolotl = {
|
||||
type = "animal",
|
||||
spawn_class = "axolotl",
|
||||
spawn_class = "water",
|
||||
can_despawn = true,
|
||||
passive = false,
|
||||
hp_min = 14,
|
||||
|
@ -13,7 +13,7 @@ local axolotl = {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = -1,
|
||||
head_eye_height = -0.5,
|
||||
horizontal_head_height = 0,
|
||||
horrizonatal_head_height = 0,
|
||||
curiosity = 10,
|
||||
head_yaw="z",
|
||||
|
||||
|
@ -78,6 +78,7 @@ local axolotl = {
|
|||
attack_animals = true,
|
||||
specific_attack = {
|
||||
"extra_mobs_cod",
|
||||
"mobs_mc:sheep",
|
||||
"extra_mobs_glow_squid",
|
||||
"extra_mobs_salmon",
|
||||
"extra_mobs_tropical_fish",
|
||||
|
|
|
@ -2,18 +2,6 @@
|
|||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
|
||||
local function spawn_check(pos, environmental_light, artificial_light, sky_light)
|
||||
local date = os.date("*t")
|
||||
local maxlight
|
||||
if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then
|
||||
maxlight = 6
|
||||
else
|
||||
maxlight = 3
|
||||
end
|
||||
|
||||
return artificial_light <= maxlight
|
||||
end
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:bat", {
|
||||
description = S("Bat"),
|
||||
type = "animal",
|
||||
|
@ -62,7 +50,6 @@ mcl_mobs.register_mob("mobs_mc:bat", {
|
|||
jump = false,
|
||||
fly = true,
|
||||
makes_footstep_sound = false,
|
||||
spawn_check = spawn_check,
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -11,9 +11,6 @@ local mod_target = minetest.get_modpath("mcl_target")
|
|||
--################### BLAZE
|
||||
--###################
|
||||
|
||||
local function spawn_check(pos, environmental_light, artificial_light, sky_light)
|
||||
return artificial_light <= 11
|
||||
end
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:blaze", {
|
||||
description = S("Blaze"),
|
||||
|
@ -140,7 +137,6 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
|
|||
},
|
||||
})
|
||||
end,
|
||||
spawn_check = spawn_check,
|
||||
})
|
||||
|
||||
mcl_mobs:spawn_specific(
|
||||
|
|
|
@ -23,7 +23,7 @@ mcl_mobs.register_mob("mobs_mc:chicken", {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = 4,
|
||||
head_eye_height = 1.5,
|
||||
horizontal_head_height = -.3,
|
||||
horrizonatal_head_height = -.3,
|
||||
curiosity = 10,
|
||||
head_yaw="z",
|
||||
visual_size = {x=1,y=1},
|
||||
|
|
|
@ -31,7 +31,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||
|
||||
local cod = {
|
||||
type = "animal",
|
||||
spawn_class = "water_ambient",
|
||||
spawn_class = "water",
|
||||
can_despawn = true,
|
||||
passive = true,
|
||||
hp_min = 3,
|
||||
|
|
|
@ -24,7 +24,7 @@ local cow_def = {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = 10,
|
||||
head_eye_height = 1.1,
|
||||
horizontal_head_height=-1.8,
|
||||
horrizonatal_head_height=-1.8,
|
||||
curiosity = 2,
|
||||
head_yaw="z",
|
||||
makes_footstep_sound = true,
|
||||
|
@ -105,7 +105,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
|
|||
end
|
||||
local item = clicker:get_wielded_item()
|
||||
-- Use shears to get mushrooms and turn mooshroom into cow
|
||||
if minetest.get_item_group(item:get_name(), "shears") > 0 then
|
||||
if item:get_name() == "mcl_tools:shears" then
|
||||
local pos = self.object:get_pos()
|
||||
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ local S = minetest.get_translator("mobs_mc")
|
|||
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:creeper", {
|
||||
description = S("Creeper"),
|
||||
type = "monster",
|
||||
spawn_class = "hostile",
|
||||
spawn_in_group = 1,
|
||||
|
@ -24,7 +23,6 @@ mcl_mobs.register_mob("mobs_mc:creeper", {
|
|||
mesh = "mobs_mc_creeper.b3d",
|
||||
head_swivel = "Head_Control",
|
||||
bone_eye_height = 2.35,
|
||||
head_eye_height = 1.8;
|
||||
curiosity = 2,
|
||||
textures = {
|
||||
{"mobs_mc_creeper.png",
|
||||
|
@ -50,7 +48,7 @@ mcl_mobs.register_mob("mobs_mc:creeper", {
|
|||
explosion_strength = 3,
|
||||
explosion_radius = 3.5,
|
||||
explosion_damage_radius = 3.5,
|
||||
explosiontimer_reset_radius = 3,
|
||||
explosiontimer_reset_radius = 6,
|
||||
reach = 3,
|
||||
explosion_timer = 1.5,
|
||||
allow_fuse_reset = true,
|
||||
|
@ -172,7 +170,7 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", {
|
|||
explosion_strength = 6,
|
||||
explosion_radius = 8,
|
||||
explosion_damage_radius = 8,
|
||||
explosiontimer_reset_radius = 3,
|
||||
explosiontimer_reset_radius = 6,
|
||||
reach = 3,
|
||||
explosion_timer = 1.5,
|
||||
allow_fuse_reset = true,
|
||||
|
|
|
@ -127,7 +127,7 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", {
|
|||
minetest.set_node(vector.add(self._portal_pos, vector.new(0, 5, 0)), {name = "mcl_end:dragon_egg"})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Free The End Advancement
|
||||
for _,players in pairs(minetest.get_objects_inside_radius(pos,64)) do
|
||||
if players:is_player() then
|
||||
|
@ -136,7 +136,6 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", {
|
|||
end
|
||||
end,
|
||||
fire_resistant = true,
|
||||
is_boss = true,
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -24,12 +24,6 @@
|
|||
-- added rain damage.
|
||||
-- fixed the grass_with_dirt issue.
|
||||
|
||||
-- How freqeuntly to take and place blocks, in seconds
|
||||
local take_frequency_min = 235
|
||||
local take_frequency_max = 245
|
||||
local place_frequency_min = 235
|
||||
local place_frequency_max = 245
|
||||
|
||||
minetest.register_entity("mobs_mc:ender_eyes", {
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_spider.b3d",
|
||||
|
@ -66,6 +60,13 @@ end
|
|||
|
||||
local pr = PseudoRandom(os.time()*(-334))
|
||||
|
||||
-- How freqeuntly to take and place blocks, in seconds
|
||||
local take_frequency_min = 235
|
||||
local take_frequency_max = 245
|
||||
local place_frequency_min = 235
|
||||
local place_frequency_max = 245
|
||||
|
||||
|
||||
-- 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
|
||||
|
@ -490,7 +491,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
|||
local dug = minetest.get_node_or_nil(take_pos)
|
||||
if dug and dug.name == "air" then
|
||||
self._taken_node = node.name
|
||||
self.persistent = true
|
||||
self.can_despawn = false
|
||||
local def = minetest.registered_nodes[self._taken_node]
|
||||
-- Update animation and texture accordingly (adds visibly carried block)
|
||||
local block_type
|
||||
|
@ -541,7 +542,7 @@ mcl_mobs.register_mob("mobs_mc:enderman", {
|
|||
if success then
|
||||
local def = minetest.registered_nodes[self._taken_node]
|
||||
-- Update animation accordingly (removes visible block)
|
||||
self.persistent = false
|
||||
self.can_despawn = true
|
||||
self.animation = select_enderman_animation("normal")
|
||||
self:set_animation(self.animation.current)
|
||||
if def.sounds and def.sounds.place then
|
||||
|
|
|
@ -31,7 +31,7 @@ end
|
|||
|
||||
mcl_mobs.register_mob("mobs_mc:glow_squid", {
|
||||
type = "animal",
|
||||
spawn_class = "water_underground",
|
||||
spawn_class = "water",
|
||||
can_despawn = true,
|
||||
passive = true,
|
||||
hp_min = 10,
|
||||
|
|
|
@ -10,7 +10,6 @@ local S = minetest.get_translator("mobs_mc")
|
|||
--###################
|
||||
|
||||
local hoglin = {
|
||||
description = S("Hoglin"),
|
||||
type = "monster",
|
||||
passive = false,
|
||||
spawn_class = "hostile",
|
||||
|
@ -20,9 +19,8 @@ local hoglin = {
|
|||
xp_max = 9,
|
||||
armor = {fleshy = 90},
|
||||
attack_type = "dogfight",
|
||||
attack_frequency = 3;
|
||||
damage = 4,
|
||||
reach = 1.9,
|
||||
reach = 3,
|
||||
collisionbox = {-.6, -0.01, -.6, .6, 1.4, .6},
|
||||
visual = "mesh",
|
||||
mesh = "extra_mobs_hoglin.b3d",
|
||||
|
@ -31,9 +29,8 @@ local hoglin = {
|
|||
} },
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {
|
||||
random = "extra_mobs_hoglin.1",
|
||||
random = "extra_mobs_hoglin",
|
||||
damage = "extra_mobs_hoglin_hurt",
|
||||
death = "extra_mobs_hoglin_hurt",
|
||||
distance = 16,
|
||||
},
|
||||
jump = true,
|
||||
|
@ -66,7 +63,7 @@ local hoglin = {
|
|||
punch_end = 32,
|
||||
},
|
||||
fear_height = 4,
|
||||
view_range = 16,
|
||||
view_range = 32,
|
||||
floats = 0,
|
||||
custom_attack = function(self)
|
||||
if self.state == "attack" and self.reach > vector.distance(self.object:get_pos(), self.attack:get_pos()) then
|
||||
|
@ -90,15 +87,8 @@ local hoglin = {
|
|||
mcl_mobs.register_mob("mobs_mc:hoglin", hoglin)
|
||||
|
||||
local zoglin = table.copy(hoglin)
|
||||
zoglin.description = S("Zoglin")
|
||||
zoglin.fire_resistant = 1
|
||||
zoglin.textures = {"extra_mobs_zoglin.png"}
|
||||
sounds = {
|
||||
random = "extra_mobs_hoglin.2",
|
||||
damage = "extra_mobs_hoglin_hurt",
|
||||
death = "extra_mobs_hoglin_hurt",
|
||||
distance = 16,
|
||||
}
|
||||
zoglin.do_custom = function()
|
||||
return
|
||||
end
|
||||
|
@ -110,7 +100,6 @@ mcl_mobs.register_mob("mobs_mc:zoglin", zoglin)
|
|||
-- Baby hoglin.
|
||||
|
||||
local baby_hoglin = table.copy(hoglin)
|
||||
baby_hoglin.description = S("Baby hoglin")
|
||||
baby_hoglin.collisionbox = {-.3, -0.01, -.3, .3, 0.94, .3}
|
||||
baby_hoglin.xp_min = 20
|
||||
baby_hoglin.xp_max = 20
|
||||
|
|
|
@ -44,6 +44,18 @@ local function get_drops(self)
|
|||
max = 2,
|
||||
looting = "common",
|
||||
})
|
||||
if self._saddle then
|
||||
table.insert(self.drops,{name = "mcl_mobitems:saddle",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,})
|
||||
end
|
||||
if self._chest then
|
||||
table.insert(self.drops,{name = "mcl_chests:chest",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,})
|
||||
end
|
||||
end
|
||||
|
||||
-- Helper functions to determine equipment rules
|
||||
|
@ -233,18 +245,10 @@ local horse = {
|
|||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed
|
||||
-- drop saddle when horse is killed while riding
|
||||
if self._saddle then
|
||||
minetest.add_item(pos, "mcl_mobitems:saddle")
|
||||
end
|
||||
-- drop chest when mule/donkey is killed
|
||||
if self._chest then
|
||||
minetest.add_item(pos, "mcl_chests:chest")
|
||||
end
|
||||
-- drop armor when horse is killed
|
||||
if self._wearing_armor then
|
||||
minetest.add_item(pos, self._horse_armor)
|
||||
end
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
mcl_mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
|
@ -397,7 +401,6 @@ local horse = {
|
|||
-- Put on armor and take armor from player's inventory
|
||||
local armor = minetest.get_item_group(iname, "horse_armor")
|
||||
self._horse_armor = iname
|
||||
self._wearing_armor = true
|
||||
local w = clicker:get_wielded_item()
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
w:take_item()
|
||||
|
|
|
@ -139,6 +139,7 @@ dofile(path .. "/silverfish.lua") -- maikerumine Mesh and animation by toby109tt
|
|||
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 .. "/zombie.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/zombiepig.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)
|
||||
dofile(path .. "/vex.lua") -- KrupnoPavel
|
||||
|
@ -152,7 +153,7 @@ dofile(path .. "/dolphin.lua")
|
|||
|
||||
dofile(path .. "/glow_squid.lua")
|
||||
|
||||
dofile(path .. "/piglin.lua") -- "mobs_mc_zombie_pigman.b3d" Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/piglin.lua")
|
||||
dofile(path .. "/hoglin+zoglin.lua")
|
||||
|
||||
dofile(path .. "/strider.lua")
|
||||
|
|
|
@ -4,14 +4,12 @@
|
|||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("mobs_mc")
|
||||
local allow_nav_hacks = minetest.settings:get_bool("mcl_mob_allow_nav_hacks ",false)
|
||||
|
||||
--###################
|
||||
--################### IRON GOLEM
|
||||
--###################
|
||||
|
||||
local walk_dist = 40
|
||||
local tele_dist = 80
|
||||
local etime = 0
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:iron_golem", {
|
||||
description = S("Iron Golem"),
|
||||
|
@ -87,23 +85,11 @@ mcl_mobs.register_mob("mobs_mc:iron_golem", {
|
|||
punch_start = 40, punch_end = 50,
|
||||
},
|
||||
jump = true,
|
||||
do_custom = function(self, dtime)
|
||||
self.home_timer = (self.home_timer or 0) + dtime
|
||||
|
||||
if self.home_timer > 10 then
|
||||
self.home_timer = 0
|
||||
if self._home and self.state ~= "attack" then
|
||||
local dist = vector.distance(self._home,self.object:get_pos())
|
||||
if allow_nav_hacks and dist >= tele_dist then
|
||||
self.object:set_pos(self._home)
|
||||
self.state = "stand"
|
||||
self.order = "follow"
|
||||
elseif dist >= walk_dist then
|
||||
self:gopath(self._home, function(self)
|
||||
self.state = "stand"
|
||||
self.order = "follow"
|
||||
end)
|
||||
end
|
||||
on_step = function(self,dtime)
|
||||
etime = etime + dtime
|
||||
if etime > 10 then
|
||||
if self._home and vector.distance(self._home,self.object:get_pos()) > 50 then
|
||||
self:gopath(self._home)
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
|
|
@ -62,7 +62,7 @@ mcl_mobs.register_mob("mobs_mc:llama", {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = 11,
|
||||
head_eye_height = 3,
|
||||
horizontal_head_height=0,
|
||||
horrizonatal_head_height=0,
|
||||
curiosity = 60,
|
||||
head_yaw = "z",
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ Wither=Wither
|
|||
Wolf=Wolf
|
||||
Husk=Wüstenzombie
|
||||
Zombie=Zombie
|
||||
Zombie Piglin=Schweinezombie
|
||||
Zombie Pigman=Schweinezombie
|
||||
Farmer=Bauer
|
||||
Fisherman=Fischer
|
||||
Fletcher=Pfeilmacher
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
# textdomain: mobs_mc
|
||||
Agent=Agent
|
||||
Axolotl=Salamander
|
||||
Bat=Flagermus
|
||||
Blaze=Blaze
|
||||
Chicken=Kylling
|
||||
Cow=Ko
|
||||
Mooshroom=Svamp
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Enderdrage
|
||||
Enderman=Enderman
|
||||
Endermite=Endermide
|
||||
Ghast=Ghast
|
||||
Elder Guardian=Gammel beskytter
|
||||
Guardian=Beskytter
|
||||
Horse=Hest
|
||||
Skeleton Horse=Skelethest
|
||||
Zombie Horse=Zombiehest
|
||||
Donkey=Æsel
|
||||
Mule=Muldyr
|
||||
Iron Golem=Jerngolem
|
||||
Llama=Lama
|
||||
Ocelot=Ozelot
|
||||
Parrot=Papegøje
|
||||
Pig=Gris
|
||||
Polar Bear=Isbjørn
|
||||
Rabbit=Kanin
|
||||
Killer Bunny=Dræberkanin
|
||||
Sheep=Får
|
||||
Shulker=Shulker
|
||||
Silverfish=Sølvfisk
|
||||
Skeleton=Skelet
|
||||
Stray=Omstrejfer
|
||||
Wither Skeleton=Wither-skelet
|
||||
Magma Cube=Magmakube
|
||||
Slime=Slimklump
|
||||
Snow Golem=Snegolem
|
||||
Spider=Edderkop
|
||||
Cave Spider=Huleedderkop
|
||||
Squid=Blæksprutte
|
||||
Vex=Vex
|
||||
Evoker=Fremkalder
|
||||
Illusioner=Illusionist
|
||||
Villager=Landsbyboer
|
||||
Vindicator=Hævner
|
||||
Zombie Villager=Zombie landsbyboer
|
||||
Witch=Heks
|
||||
Wither=Wither
|
||||
Wolf=Ulv
|
||||
Husk=Udtørretskal
|
||||
Zombie=Zombie
|
||||
Zombie Pigman=Zombificeret piglin
|
||||
Farmer=Landmand
|
||||
Fisherman=Fisker
|
||||
Fletcher=Pilemager
|
||||
Shepherd=Fårehyrde
|
||||
Librarian=Bibliotikar
|
||||
Cartographer=Kartograf
|
||||
Armorer=Rustningesmed
|
||||
Leatherworker=Læderarbejder
|
||||
Butcher=Slagter
|
||||
Weapon Smith=Våbensmed
|
||||
Tool Smith=Værktøjssmed
|
||||
Cleric=Gejstlig
|
||||
Nitwit=Tåbe
|
||||
Cod=Torsk
|
||||
Salmon=Laks
|
||||
Dolphin=Delfin
|
||||
Pillager=Plyndrer
|
||||
Tropical fish=Tropisk fisk
|
|
@ -54,21 +54,5 @@ Baby Husk=Bebé Zombi Momificado
|
|||
Baby Zombie=Bebé Zombi
|
||||
Husk=Zombi Momificado
|
||||
Zombie=Zombi
|
||||
Baby Zombie Piglin=Bebé Hombrecerdo Zombi
|
||||
Zombie Piglin=Hombrecerdo Zombi
|
||||
Cartographer=Cartógrafo
|
||||
Armorer=Escudero
|
||||
Leatherworker=Peletero
|
||||
Butcher=Carnicero
|
||||
Weapon Smith=Armero
|
||||
Tool Smith=Herrero
|
||||
Cleric=Clérigo
|
||||
Nitwit=Holgazán
|
||||
Cod=Bacalao
|
||||
Salmon=Salmón
|
||||
Dolphin=Delfín
|
||||
Pillager=Saqueador
|
||||
Tropical fish=Pez tropical
|
||||
Hoglin=Hoglin
|
||||
Strider=Lavagante
|
||||
Glow Squid=Calamar luminoso
|
||||
Baby Zombie Pigman=Bebé Hombrecerdo Zombi
|
||||
Zombie Pigman=Hombrecerdo Zombi
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# textdomain: mobs_mc
|
||||
Agent=Agent
|
||||
Axolotl=Axolotl
|
||||
Bat=Chauve-souris
|
||||
Blaze=Blaze
|
||||
Chicken=Poulet
|
||||
|
@ -21,7 +20,6 @@ Mule=Mule
|
|||
Iron Golem=Golem de fer
|
||||
Llama=Lama
|
||||
Ocelot=Ocelot
|
||||
Cat=Chat
|
||||
Parrot=Perroquet
|
||||
Pig=Cochon
|
||||
Polar Bear=Ours blanc
|
||||
|
@ -49,15 +47,8 @@ Witch=Sorcière
|
|||
Wither=Wither
|
||||
Wolf=Loup
|
||||
Husk=Zombie Momifié
|
||||
Baby Husk=Bébé Zombie Momifié
|
||||
Zombie=Zombie
|
||||
Baby Zombie=Bébé Zombie
|
||||
Piglin=Piglin
|
||||
Baby Piglin=Bébé Piglin
|
||||
Zombie Piglin=Piglin Zombie
|
||||
Baby Zombie Piglin=Bébé Piglin Zombie
|
||||
Sword Piglin=Piglin avec une épée
|
||||
Piglin Brute=Piglin Barbare
|
||||
Zombie Pigman=Zombie Cochon
|
||||
Farmer=Fermier
|
||||
Fisherman=Pêcheur
|
||||
Fletcher=Archer
|
||||
|
@ -75,9 +66,4 @@ Cod=Morue
|
|||
Salmon=Saumon
|
||||
Dolphin=Dauphin
|
||||
Pillager=Pilleur
|
||||
Tropical fish=Poisson tropical
|
||||
Hoglin=Hoglin
|
||||
Baby hoglin=Bébé Hoglin
|
||||
Zoglin=Zoglin
|
||||
Strider=Arpenteur
|
||||
Glow Squid=Poulpe Brillant
|
||||
Tropical fish=Poisson tropical
|
|
@ -49,7 +49,7 @@ Wither=ウィザー
|
|||
Wolf=オオカミ
|
||||
Husk=ハスク
|
||||
Zombie=ゾンビ
|
||||
Zombie Piglin=ゾンビピッグマン
|
||||
Zombie Pigman=ゾンビピッグマン
|
||||
Farmer=農民
|
||||
Fisherman=漁師
|
||||
Fletcher=矢師
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
# textdomain: mobs_mc
|
||||
Agent=Agente
|
||||
Axolotl=Axolote
|
||||
Bat=Morcego
|
||||
Blaze=Blaze
|
||||
Chicken=Galinha
|
||||
Cow=Vaca
|
||||
Mooshroom=Coguvaca
|
||||
Creeper=Creeper
|
||||
Ender Dragon=Dragão do Fim
|
||||
Enderman=Enderman
|
||||
Endermite=Endermite
|
||||
Ghast=Ghast
|
||||
Elder Guardian=Guardião Ancião
|
||||
Guardian=Guardião
|
||||
Horse=Cavalo
|
||||
Skeleton Horse=Cavalo Esqueleto
|
||||
Zombie Horse=Cavalo Zumbi
|
||||
Donkey=Burro
|
||||
Mule=Mula
|
||||
Iron Golem=Golem de Ferro
|
||||
Llama=Lhama
|
||||
Ocelot=Jaguatirica
|
||||
Cat=Gato
|
||||
Parrot=Papagaio
|
||||
Pig=Porco
|
||||
Polar Bear=Urso Polar
|
||||
Rabbit=Coelho
|
||||
Killer Bunny=Coelho Assassino
|
||||
Sheep=Ovelha
|
||||
Shulker=Shulker
|
||||
Silverfish=Traça
|
||||
Skeleton=Esqueleto
|
||||
Stray=Esqueleto Errante
|
||||
Wither Skeleton=Esqueleto Wither
|
||||
Magma Cube=Cubo de Magma
|
||||
Slime=Slime
|
||||
Snow Golem=Golem de Neve
|
||||
Spider=Aranha
|
||||
Cave Spider=Aranha de Caverna
|
||||
Squid=Lula
|
||||
Vex=Vex
|
||||
Evoker=Invocador
|
||||
Illusioner=Ilusionista
|
||||
Villager=Aldeão
|
||||
Vindicator=Vingador
|
||||
Zombie Villager=Aldeão Zumbi
|
||||
Witch=Bruxa
|
||||
Wither=Wither
|
||||
Wolf=Lobo
|
||||
Husk=Zumbi-Múmia
|
||||
Baby Husk=Zumbi-Múmia Bebê
|
||||
Zombie=Zumbi
|
||||
Baby Zombie=Zumbi Bebê
|
||||
Piglin=Piglin
|
||||
Baby Piglin=Piglin Bebê
|
||||
Zombie Piglin=Piglin Zumbi
|
||||
Baby Zombie Piglin=Piglin Zumbi Bebê
|
||||
Sword Piglin=Piglin Espadachim
|
||||
Piglin Brute=Piglin Barbáro
|
||||
Farmer=Fazendeiro
|
||||
Fisherman=Pescador
|
||||
Fletcher=Flecheiro
|
||||
Shepherd=Pastor
|
||||
Librarian=Bibliotecário
|
||||
Cartographer=Cartógrafo
|
||||
Armorer=Armoreiro
|
||||
Leatherworker=Coureiro
|
||||
Butcher=Açougueiro
|
||||
Weapon Smith=Armeiro
|
||||
Tool Smith=Ferramenteiro
|
||||
Cleric=Clérigo
|
||||
Nitwit=Palerma
|
||||
Cod=Bacalhau
|
||||
Salmon=Salmão
|
||||
Dolphin=Golfinho
|
||||
Pillager=Saqueador
|
||||
Tropical fish=Peixe Tropical
|
||||
Hoglin=Hoglin
|
||||
Baby hoglin=Hoglin Bebê
|
||||
Zoglin=Zoglin
|
||||
Strider=Lavagante
|
||||
Glow Squid=Lula Brilhante
|
|
@ -1,27 +1,25 @@
|
|||
# textdomain: mobs_mc
|
||||
Agent=Агент
|
||||
Axolotl=Аксолотль
|
||||
Bat=Летучая мышь
|
||||
Blaze=Ифрит
|
||||
Chicken=Курица
|
||||
Cow=Корова
|
||||
Mooshroom=Грибная корова
|
||||
Mooshroom=Гриб
|
||||
Creeper=Крипер
|
||||
Ender Dragon=Дракон Края
|
||||
Ender Dragon=Дракон Предела
|
||||
Enderman=Эндермен
|
||||
Endermite=Эндермит
|
||||
Ghast=Гаст
|
||||
Elder Guardian=Древний страж
|
||||
Guardian=Страж
|
||||
Horse=Лошадь
|
||||
Skeleton Horse=Лошадь-скелет
|
||||
Zombie Horse=Лошадь-зомби
|
||||
Skeleton Horse=Скелет лошади
|
||||
Zombie Horse=Зомби-лошадь
|
||||
Donkey=Ослик
|
||||
Mule=Мул
|
||||
Iron Golem=Железный голем
|
||||
Llama=Лама
|
||||
Ocelot=Оцелот
|
||||
Cat=Кошка
|
||||
Parrot=Попугай
|
||||
Pig=Свинья
|
||||
Polar Bear=Полярный медведь
|
||||
|
@ -34,13 +32,13 @@ Skeleton=Скелет
|
|||
Stray=Странник
|
||||
Wither Skeleton=Скелет-иссушитель
|
||||
Magma Cube=Лавовый куб
|
||||
Slime=Слизень
|
||||
Slime=Слизняк
|
||||
Snow Golem=Снежный голем
|
||||
Spider=Паук
|
||||
Cave Spider=Пещерный паук
|
||||
Squid=Спрут
|
||||
Squid=Кальмар
|
||||
Vex=Досаждатель
|
||||
Evoker=Вызыватель
|
||||
Evoker=Маг
|
||||
Illusioner=Иллюзор
|
||||
Villager=Житель
|
||||
Vindicator=Поборник
|
||||
|
@ -49,15 +47,8 @@ Witch=Ведьма
|
|||
Wither=Иссушитель
|
||||
Wolf=Волк
|
||||
Husk=Кадавр
|
||||
Baby Husk=Кадавр-ребёнок
|
||||
Zombie=Зомби
|
||||
Baby Zombie=Зомби-ребёнок
|
||||
Piglin=Пиглин
|
||||
Baby Piglin=Пиглин-ребёнок
|
||||
Zombie Piglin=Зомби-пиглин
|
||||
Baby Zombie Piglin=Зомби-пиглин-ребёнок
|
||||
Sword Piglin=Пиглин-мечник
|
||||
Piglin Brute=Жестокий пиглин
|
||||
Zombie Pigman=Зомби-свиночеловек
|
||||
Farmer=Фермер
|
||||
Fisherman=Рыбак
|
||||
Fletcher=Лучник
|
||||
|
@ -71,13 +62,3 @@ Weapon Smith=Оружейник
|
|||
Tool Smith=Инструментальщик
|
||||
Cleric=Церковник
|
||||
Nitwit=Нищий
|
||||
Cod=Треска
|
||||
Salmon=Лосось
|
||||
Dolphin=Дельфин
|
||||
Pillager=Разбойник
|
||||
Tropical fish=Тропическая рыба
|
||||
Hoglin=Хоглин
|
||||
Baby hoglin=Детёныш хоглина
|
||||
Zoglin=Зоглин
|
||||
Strider=Страйдер
|
||||
Glow Squid=Светящийся спрут
|
||||
|
|
|
@ -21,7 +21,6 @@ Mule=
|
|||
Iron Golem=
|
||||
Llama=
|
||||
Ocelot=
|
||||
Cat=
|
||||
Parrot=
|
||||
Pig=
|
||||
Polar Bear=
|
||||
|
@ -49,15 +48,8 @@ Witch=
|
|||
Wither=
|
||||
Wolf=
|
||||
Husk=
|
||||
Baby Husk=
|
||||
Zombie=
|
||||
Baby Zombie=
|
||||
Piglin=
|
||||
Baby Piglin=
|
||||
Zombie Piglin=
|
||||
Baby Zombie Piglin=
|
||||
Sword Piglin=
|
||||
Piglin Brute=
|
||||
Zombie Pigman=
|
||||
Farmer=
|
||||
Fisherman=
|
||||
Fletcher=
|
||||
|
@ -75,9 +67,4 @@ Cod=
|
|||
Salmon=
|
||||
Dolphin=
|
||||
Pillager=
|
||||
Tropical fish=
|
||||
Hoglin=
|
||||
Baby hoglin=
|
||||
Zoglin=
|
||||
Strider=
|
||||
Glow Squid=
|
||||
Tropical fish=
|
|
@ -2,4 +2,4 @@ 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
|
||||
optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, doc_items, mcl_worlds
|
||||
optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, doc_items
|
||||
|
|
Binary file not shown.
|
@ -39,7 +39,7 @@ local ocelot = {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = 6.2,
|
||||
head_eye_height = 0.4,
|
||||
horizontal_head_height=-0,
|
||||
horrizonatal_head_height=-0,
|
||||
head_yaw="z",
|
||||
curiosity = 4,
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
|
||||
|
|
|
@ -137,7 +137,7 @@ mcl_mobs.register_mob("mobs_mc:parrot", {
|
|||
xp_max = 3,
|
||||
head_swivel = "head.control",
|
||||
bone_eye_height = 1.1,
|
||||
horizontal_head_height=0,
|
||||
horrizonatal_head_height=0,
|
||||
curiosity = 10,
|
||||
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
|
||||
visual = "mesh",
|
||||
|
|
|
@ -22,7 +22,7 @@ mcl_mobs.register_mob("mobs_mc:pig", {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = 7.5,
|
||||
head_eye_height = 0.8,
|
||||
horizontal_head_height=-1,
|
||||
horrizonatal_head_height=-1,
|
||||
curiosity = 3,
|
||||
head_yaw="z",
|
||||
makes_footstep_sound = true,
|
||||
|
@ -82,7 +82,7 @@ mcl_mobs.register_mob("mobs_mc:pig", {
|
|||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver and self.driver:get_wielded_item():get_name() == "mcl_mobitems:carrot_on_a_stick" then
|
||||
if self.driver then
|
||||
|
||||
mcl_mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
|
@ -149,14 +149,18 @@ mcl_mobs.register_mob("mobs_mc:pig", {
|
|||
return
|
||||
end
|
||||
|
||||
-- Should make pig go faster when right clicked with carrot on a stick.
|
||||
-- FIXME: needs work on the going faster part.
|
||||
--[[if self.driver and clicker == self.driver and self.driver:get_wielded_item():get_name() == "mcl_mobitems:carrot_on_a_stick" then
|
||||
if not self.v3 then
|
||||
self.v3 = 0
|
||||
self.max_speed_forward = 100
|
||||
self.accel = 10
|
||||
end
|
||||
-- Mount or detach player
|
||||
local name = clicker:get_player_name()
|
||||
if self.driver and clicker == self.driver then
|
||||
-- Detach if already attached
|
||||
mcl_mobs.detach(clicker, {x=1, y=0, z=0})
|
||||
return
|
||||
|
||||
elseif not self.driver and self.saddle == "yes" and wielditem:get_name() == "mcl_mobitems:carrot_on_a_stick" then
|
||||
-- Ride pig if it has a saddle and player uses a carrot on a stick
|
||||
|
||||
mcl_mobs.attach(self, clicker)
|
||||
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
|
||||
local inv = self.driver:get_inventory()
|
||||
|
@ -173,19 +177,6 @@ mcl_mobs.register_mob("mobs_mc:pig", {
|
|||
end
|
||||
inv:set_stack("main",self.driver:get_wield_index(), wielditem)
|
||||
end
|
||||
end]]
|
||||
|
||||
-- Mount or detach player
|
||||
local name = clicker:get_player_name()
|
||||
if self.driver and clicker == self.driver then -- and self.driver:get_wielded_item():get_name() ~= "mcl_mobitems:carrot_on_a_stick" then -- Note: This is for when the ability to make the pig go faster is implemented
|
||||
-- Detach if already attached
|
||||
mcl_mobs.detach(clicker, {x=1, y=0, z=0})
|
||||
return
|
||||
|
||||
elseif not self.driver and self.saddle == "yes" then
|
||||
-- Ride pig if it has a saddle
|
||||
|
||||
mcl_mobs.attach(self, clicker)
|
||||
return
|
||||
|
||||
-- Capture pig
|
||||
|
@ -204,18 +195,6 @@ mcl_mobs.register_mob("mobs_mc:pig", {
|
|||
return false
|
||||
end
|
||||
end,
|
||||
|
||||
after_activate = function(self, staticdata, def, dtime)
|
||||
if self.saddle == "yes" then -- Make saddle load upon rejoin
|
||||
self.base_texture = {
|
||||
"mobs_mc_pig.png", -- base
|
||||
"mobs_mc_pig_saddle.png", -- saddle
|
||||
}
|
||||
self.object:set_properties({
|
||||
textures = self.base_texture
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
mcl_mobs:spawn_specific(
|
||||
|
|
|
@ -25,10 +25,7 @@ function mobs_mc.player_wears_gold(player)
|
|||
for i=1, 6 do
|
||||
local stack = player:get_inventory():get_stack("armor", i)
|
||||
local item = stack:get_name()
|
||||
if string.find(item, "mcl_armor:chestplate_gold")
|
||||
or string.find(item, "mcl_armor:leggings_gold")
|
||||
or string.find(item, "mcl_armor:helmet_gold")
|
||||
or string.find(item, "mcl_armor:boots_gold") then
|
||||
if item == "mcl_armor:chestplate_gold" or item == "mcl_armor:leggings_gold" or item == "mcl_armor:helmet_gold" or item == "mcl_armor:boots_gold" then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
@ -38,11 +35,9 @@ end
|
|||
--################### piglin
|
||||
--###################
|
||||
local piglin = {
|
||||
description = S("Piglin"),
|
||||
type = "monster",
|
||||
passive = false,
|
||||
spawn_class = "hostile",
|
||||
group_attack = {"mobs_mc:piglin", "mobs_mc:sword_piglin", "mobs_mc:piglin_brute"},
|
||||
hp_min = 16,
|
||||
hp_max = 16,
|
||||
xp_min = 9,
|
||||
|
@ -61,10 +56,8 @@ local piglin = {
|
|||
} },
|
||||
visual_size = {x=1, y=1},
|
||||
sounds = {
|
||||
random = "mobs_mc_zombiepig_random",
|
||||
war_cry = "mobs_mc_zombiepig_war_cry", death = "mobs_mc_zombiepig_death",
|
||||
damage = "mobs_mc_zombiepig_hurt.2",
|
||||
death = "mobs_mc_zombiepig_death.2",
|
||||
random = "extra_mobs_piglin",
|
||||
damage = "extra_mobs_piglin_hurt",
|
||||
distance = 16,
|
||||
},
|
||||
jump = true,
|
||||
|
@ -185,7 +178,6 @@ mcl_mobs.register_mob("mobs_mc:piglin", piglin)
|
|||
|
||||
|
||||
local sword_piglin = table.copy(piglin)
|
||||
sword_piglin.description = S("Sword Piglin")
|
||||
sword_piglin.mesh = "extra_mobs_sword_piglin.b3d"
|
||||
sword_piglin.textures = {"extra_mobs_piglin.png", "default_tool_goldsword.png"}
|
||||
sword_piglin.on_spawn = function(self)
|
||||
|
@ -214,132 +206,43 @@ sword_piglin.animation = {
|
|||
punch_start = 189,
|
||||
punch_end = 198,
|
||||
}
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:sword_piglin", sword_piglin)
|
||||
|
||||
|
||||
-- Zombified Piglin --
|
||||
|
||||
|
||||
local function spawn_check(pos, environmental_light, artificial_light, sky_light)
|
||||
return artificial_light <= 11
|
||||
local zombified_piglin = table.copy(piglin)
|
||||
zombified_piglin.fire_resistant = 1
|
||||
zombified_piglin.do_custom = function()
|
||||
return
|
||||
end
|
||||
|
||||
local zombified_piglin = {
|
||||
description = S("Zombie Piglin"),
|
||||
-- type="animal", passive=false: This combination is needed for a neutral mob which becomes hostile, if attacked
|
||||
type = "animal",
|
||||
passive = false,
|
||||
spawn_class = "passive",
|
||||
hp_min = 20,
|
||||
hp_max = 20,
|
||||
xp_min = 6,
|
||||
xp_max = 6,
|
||||
armor = {undead = 90, fleshy = 90},
|
||||
attack_type = "dogfight",
|
||||
group_attack = {"mobs_mc:zombified_piglin", "mobs_mc:baby_zombified_piglin"},
|
||||
damage = 9,
|
||||
reach = 2,
|
||||
head_swivel = "head.control",
|
||||
bone_eye_height = 2.4,
|
||||
head_eye_height = 1.4,
|
||||
curiosity = 15,
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3}, -- same
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_zombie_pigman.b3d",
|
||||
textures = { {
|
||||
"blank.png", --baby
|
||||
"default_tool_goldsword.png", --sword
|
||||
"mobs_mc_zombie_pigman.png", --pigman
|
||||
} },
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {
|
||||
random = "mobs_mc_zombiepig_random",
|
||||
war_cry = "mobs_mc_zombiepig_war_cry",
|
||||
death = "mobs_mc_zombiepig_death",
|
||||
damage = "mobs_mc_zombiepig_hurt",
|
||||
distance = 16,
|
||||
},
|
||||
jump = true,
|
||||
makes_footstep_sound = true,
|
||||
spawn_check = spawn_check,
|
||||
walk_velocity = .8,
|
||||
run_velocity = 2.6,
|
||||
pathfinding = 1,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:rotten_flesh",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,
|
||||
looting = "common"},
|
||||
{name = "mcl_core:gold_nugget",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,
|
||||
looting = "common"},
|
||||
{name = "mcl_core:gold_ingot",
|
||||
chance = 40, -- 2.5%
|
||||
min = 1,
|
||||
max = 1,
|
||||
looting = "rare"},
|
||||
{name = "mcl_tools:sword_gold",
|
||||
chance = 100 / 8.5,
|
||||
min = 1,
|
||||
max = 1,
|
||||
looting = "rare"},
|
||||
},
|
||||
animation = {
|
||||
stand_speed = 25,
|
||||
walk_speed = 25,
|
||||
run_speed = 50,
|
||||
stand_start = 40,
|
||||
stand_end = 80,
|
||||
walk_start = 0,
|
||||
walk_end = 40,
|
||||
run_start = 0,
|
||||
run_end = 40,
|
||||
punch_start = 90,
|
||||
punch_end = 130,
|
||||
},
|
||||
lava_damage = 0,
|
||||
fire_damage = 0,
|
||||
fear_height = 4,
|
||||
view_range = 16,
|
||||
harmed_by_heal = true,
|
||||
fire_damage_resistant = true,
|
||||
zombified_piglin.on_spawn = function()
|
||||
return
|
||||
end
|
||||
zombified_piglin.on_rightclick = function()
|
||||
return
|
||||
end
|
||||
zombified_piglin.lava_damage = 0
|
||||
zombified_piglin.fire_damage = 0
|
||||
zombified_piglin.attack_animals = true
|
||||
zombified_piglin.mesh = "extra_mobs_sword_piglin.b3d"
|
||||
zombified_piglin.textures = {"extra_mobs_zombified_piglin.png", "default_tool_goldsword.png", "extra_mobs_trans.png"}
|
||||
zombified_piglin.attack_type = "dogfight"
|
||||
zombified_piglin.animation = {
|
||||
stand_speed = 30,
|
||||
walk_speed = 30,
|
||||
punch_speed = 45,
|
||||
run_speed = 30,
|
||||
stand_start = 0,
|
||||
stand_end = 79,
|
||||
walk_start = 168,
|
||||
walk_end = 187,
|
||||
run_start = 440,
|
||||
run_end = 459,
|
||||
punch_start = 189,
|
||||
punch_end = 198,
|
||||
}
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:zombified_piglin", zombified_piglin)
|
||||
|
||||
local baby_zombified_piglin = table.copy(zombified_piglin)
|
||||
baby_zombified_piglin.description = S("Baby Zombie Piglin")
|
||||
baby_zombified_piglin.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
|
||||
baby_zombified_piglin.xp_min = 13
|
||||
baby_zombified_piglin.xp_max = 13
|
||||
baby_zombified_piglin.textures = {
|
||||
{
|
||||
"mobs_mc_zombie_pigman.png", --baby
|
||||
"default_tool_goldsword.png", --sword
|
||||
"mobs_mc_zombie_pigman.png", --pigman
|
||||
}
|
||||
}
|
||||
baby_zombified_piglin.walk_velocity = 1.2
|
||||
baby_zombified_piglin.run_velocity = 2.4
|
||||
baby_zombified_piglin.light_damage = 0
|
||||
baby_zombified_piglin.child = 1
|
||||
|
||||
mcl_mobs.register_mob("mobs_mc:baby_zombified_piglin", baby_zombified_piglin)
|
||||
|
||||
-- Compatibility code. These were removed, and now are called zombie piglins. They don't spawn.
|
||||
-- This is only to catch old cases. Maybe could be an alias?
|
||||
mcl_mobs.register_mob("mobs_mc:pigman", zombified_piglin)
|
||||
mcl_mobs.register_mob("mobs_mc:baby_pigman", baby_zombified_piglin)
|
||||
|
||||
|
||||
-- Piglin Brute --
|
||||
|
||||
local piglin_brute = table.copy(piglin)
|
||||
piglin_brute.description = S("Piglin Brute")
|
||||
piglin_brute.xp_min = 20
|
||||
piglin_brute.xp_max = 20
|
||||
piglin_brute.hp_min = 50
|
||||
|
@ -376,17 +279,11 @@ piglin_brute.animation = {
|
|||
punch_end = 198,
|
||||
}
|
||||
piglin_brute.can_despawn = false
|
||||
|
||||
piglin_brute.drops = {
|
||||
{name = "mcl_tools:axe_gold",
|
||||
chance = 8.5,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
}
|
||||
piglin_brute.group_attack = { "mobs_mc:piglin", "mobs_mc:piglin_brute" }
|
||||
mcl_mobs.register_mob("mobs_mc:piglin_brute", piglin_brute)
|
||||
|
||||
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:piglin","overworld",0,7)
|
||||
-- Regular spawning in the Nether
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:piglin",
|
||||
|
@ -403,15 +300,15 @@ minetest.LIGHT_MAX+1,
|
|||
3,
|
||||
mcl_vars.mg_lava_nether_max,
|
||||
mcl_vars.mg_nether_max)
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:sword_piglin","overworld",0,7)
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:sword_piglin",
|
||||
"nether",
|
||||
"ground",
|
||||
{
|
||||
"Nether",
|
||||
"CrimsonForest"
|
||||
},
|
||||
"Nether",
|
||||
"CrimsonForest"
|
||||
},
|
||||
0,
|
||||
minetest.LIGHT_MAX+1,
|
||||
30,
|
||||
|
@ -419,45 +316,7 @@ minetest.LIGHT_MAX+1,
|
|||
3,
|
||||
mcl_vars.mg_lava_nether_max,
|
||||
mcl_vars.mg_nether_max)
|
||||
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:zombified_piglin",
|
||||
"nether",
|
||||
"ground",
|
||||
{
|
||||
"Nether",
|
||||
"CrimsonForest",
|
||||
},
|
||||
0,
|
||||
minetest.LIGHT_MAX+1,
|
||||
30,
|
||||
6000,
|
||||
3,
|
||||
mcl_vars.mg_nether_min,
|
||||
mcl_vars.mg_nether_max)
|
||||
|
||||
-- Baby zombie is 20 times less likely than regular zombies
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:baby_zombified_piglin",
|
||||
"nether",
|
||||
"ground",
|
||||
{
|
||||
"Nether",
|
||||
"CrimsonForest",
|
||||
},
|
||||
0,
|
||||
minetest.LIGHT_MAX+1,
|
||||
30,
|
||||
100000,
|
||||
4,
|
||||
mcl_vars.mg_nether_min,
|
||||
mcl_vars.mg_nether_max)
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:piglin","overworld",0,7)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:sword_piglin","overworld",0,7)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:piglin_brute","overworld",0,7)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:zombified_piglin","overworld",0,minetest.LIGHT_MAX+1)
|
||||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:piglin", S("Piglin"), "#7b4a17","#d5c381", 0)
|
||||
mcl_mobs.register_egg("mobs_mc:piglin_brute", S("Piglin Brute"), "#562b0c","#ddc89d", 0)
|
||||
mcl_mobs.register_egg("mobs_mc:zombified_piglin", S("Zombie Piglin"), "#ea9393", "#4c7129", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:piglin_brute","overworld",0,7)
|
||||
|
|
|
@ -27,7 +27,7 @@ mcl_mobs.register_mob("mobs_mc:polar_bear", {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = 2.6,
|
||||
head_eye_height = 1,
|
||||
horizontal_head_height = 0,
|
||||
horrizonatal_head_height = 0,
|
||||
curiosity = 20,
|
||||
head_yaw="z",
|
||||
visual_size = {x=3.0, y=3.0},
|
||||
|
|
|
@ -18,7 +18,7 @@ local rabbit = {
|
|||
head_swivel = "head.control",
|
||||
bone_eye_height = 2,
|
||||
head_eye_height = 0.5,
|
||||
horizontal_head_height = -.3,
|
||||
horrizonatal_head_height = -.3,
|
||||
curiosity = 20,
|
||||
head_yaw="z",
|
||||
visual = "mesh",
|
||||
|
|
|
@ -11,7 +11,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||
|
||||
local salmon = {
|
||||
type = "animal",
|
||||
spawn_class = "water_ambient",
|
||||
spawn_class = "water",
|
||||
can_despawn = true,
|
||||
passive = true,
|
||||
hp_min = 3,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue