1
0
Fork 0

Compare commits

...

695 Commits

Author SHA1 Message Date
docnite 1aa0d716f5 Changed main menu music and some small chages in mcl_music 2024-11-17 20:53:25 +03:00
marro 4dc5d0939c Whitespace fix in translation (#4701)
Reviewed-on: VoxeLibre/VoxeLibre#4701
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: marro <marronclement0403@gmail.com>
Co-committed-by: marro <marronclement0403@gmail.com>
2024-11-11 03:49:43 +01:00
the-real-herowl 32b334322b Merge pull request 'Mobile fixes & improvements (cherry-pick from Mineclonia)' (#4685) from grorp/MineClone2:vl-mobile-fixes-and-improvements into master
Reviewed-on: VoxeLibre/VoxeLibre#4685
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-11-11 01:44:27 +01:00
grorp 88c3c4558b Fix for VoxeLibre 2024-11-10 15:14:56 +01:00
grorp 3954acdfb7 Creative inventory: padding[-0.015,-0.015] on mobile
- less wasted screen space
- matches old layout
2024-11-10 15:14:56 +01:00
grorp 02b354f54a Avoid tab buttons going off-screen with high scaling values 2024-11-10 15:14:56 +01:00
grorp cb624fe1d9 Creative inventory: Make the whole tab button clickable
Previously, only the tab icon was clickable. Clicking next to the icon would
just close the inventory.
The icon is still kept clickable too since that gives a nicer press animation.
I didn't end up using image_button because that resulted in a different image
size and position, even with the exact same coordinates.
2024-11-10 15:14:56 +01:00
grorp bd9ab16762 Add touch_interaction to (cross)bow and spyglass 2024-11-10 15:14:56 +01:00
kno10 fb3c85e289 Improve stalker textures (#4674)
- don't change back to default texture when falling, but rather keep the previous texture
- use a colorized default texture for gaps in the texture

Reviewed-on: VoxeLibre/VoxeLibre#4674
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-11-10 12:02:20 +01:00
kno10 f6f5481f30 Attempt to fix chest minecarts, at least for 5.9 (#4684)
Not using the `RecheckCartHack` on >5.9 seems to help with #4670 - not tested on older minetest; chest minecarts might still be empty there when the block is unloaded in the meantime. For <5.9, maybe it helps to decrease the time interval, 3 seconds seems to fairly long.

This also makes the minecarts random: 40% minecart, 40% chest minecart, 20% tnt minecart.

Reviewed-on: VoxeLibre/VoxeLibre#4684
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-11-10 11:41:19 +01:00
the-real-herowl c428fa576b Merge pull request 'bonemeal API update' (#4221) from teknomunk/MineClone2:bonemeal-2 into master
Reviewed-on: VoxeLibre/VoxeLibre#4221
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-11-10 11:38:08 +01:00
teknomunk a46833eaa4 Fix alias 2024-11-09 20:30:35 -06:00
teknomunk 3514fe211f Implement more bonemeal mod shim, update bonemeal dependencies 2024-11-09 20:30:35 -06:00
teknomunk 94d9e4c881 Address review comments 2024-11-09 20:30:35 -06:00
teknomunk 6b1aa43238 Only show particles if bone meal is consumed, don't continue testing positions if bonemeal was used on the first check position 2024-11-09 20:30:35 -06:00
teknomunk cfdef2435a Show particles regardless of success 2024-11-09 20:30:35 -06:00
teknomunk 49c8ae2fa0 Quick patch to get cherry saplings growing pending inclusing of a proper tree API 2024-11-09 20:30:33 -06:00
teknomunk 6ada1a3477 Remove check with mcl_core.check_vines_supported for twisted and crimson vines 2024-11-09 20:24:02 -06:00
teknomunk 189a2c62ad Address review comments on mcl_util.trace_nodes 2024-11-09 20:24:02 -06:00
teknomunk 981cddddd4 Add growth limits to crimson/twisting vines 2024-11-09 20:24:02 -06:00
teknomunk 66b5a369f1 Add mcl_util.trace_node(), rewrite bamboo growth code to fix bone meal growth 2024-11-09 20:24:02 -06:00
teknomunk 4eda77acd1 Prevent bonemealing grass from making flowers and also bonemealing the block above the grass 2024-11-09 20:24:02 -06:00
teknomunk afc270195a Fix crash when bonemealing weaping and twisting vines, fix weaping vine growth 2024-11-09 20:24:02 -06:00
teknomunk 8f53074b58 Reorder functions to prevent crash 2024-11-09 20:24:02 -06:00
teknomunk 70e8ba9a89 Remove TODO pending future discussions, revert timer change in composter code 2024-11-09 20:24:02 -06:00
teknomunk 6741c5a809 Make composter_progress_chance local, as it is not used anywhere except in mcl_composters 2024-11-09 20:24:02 -06:00
teknomunk d09791db7b Fix typo that prevented bone mealing pumpkin plants 2024-11-09 20:24:02 -06:00
teknomunk 354160e9e6 Check both above and below in pointed_thing for bonemealing (and pass thru the position as .under), make crimson vines and twisting vines compostable by rightclicking on the composter 2024-11-09 20:24:02 -06:00
teknomunk cf1325d466 Fix crash at one more spot 2024-11-09 20:24:02 -06:00
teknomunk 7112369917 Fix crashes when using bonemeal on nether nodes 2024-11-09 20:24:02 -06:00
teknomunk e6e13bdc67 Change _mcl_on_bonemealing to _on_bone_meal, update API.md to reflect this 2024-11-09 20:24:02 -06:00
teknomunk 42d37210c5 Fix mods/ITEMS/mcl_composters/locale/mcl_composters.ru.tr 2024-11-09 20:24:02 -06:00
teknomunk c3a33ea2c2 Update mod authors, remove a TODO 2024-11-09 20:24:02 -06:00
teknomunk 7f6d456a32 Remove bone to bone meal recipe from mcl_dye as it now resides in mcl_bone_meal 2024-11-09 20:24:02 -06:00
teknomunk 44d154f594 Modify backtrace listing to use minetest.log 2024-11-09 20:24:02 -06:00
teknomunk eb6131b037 Fix localization errors 2024-11-09 20:24:02 -06:00
teknomunk 3c2f2593db Only consume bone meal if a _mcl_on_bonemealing callback is defined or the legacy API returns true, convert vines to use new bonemeal API 2024-11-09 20:24:02 -06:00
teknomunk 9e6d49dd38 Fix localization except mcl_composters.ru.tr 2024-11-09 20:24:02 -06:00
teknomunk 4a865fa2df Enable bamboo bonemealing despite rightclick handling strangeness 2024-11-09 20:24:02 -06:00
teknomunk 55b4d3d5ee Rename localization files 2024-11-09 20:24:02 -06:00
teknomunk 09bcf3d22b Add untested bonemeal mod compatibility shim 2024-11-09 20:24:02 -06:00
teknomunk 57678e31bc Move commented out bamboo bone meal code into mods/ITEMS/mcl_bamboo/bamboo_base.lua 2024-11-09 20:24:02 -06:00
teknomunk d5684ca305 Add new API call mcl_bone_meal.use_bone_meal and use this to remove duplicate code, update mcl_farming:sweet_berries to use bonemeal API, add stub for bonemeal mod compatibility 2024-11-09 20:24:02 -06:00
teknomunk a4f1ccd0ee Update mcl_crimson to use bonemealing API 2024-11-09 20:24:02 -06:00
teknomunk 1e0f7618ba Remove bone meal definition in mcl_dye, make textures in mcl_cocoas match master branch 2024-11-09 20:24:02 -06:00
teknomunk f44102c238 Display call stack to assist in removing deprecated function calls 2024-11-09 20:24:02 -06:00
teknomunk 5b1fcf76f6 Fix mod dependencies 2024-11-09 20:24:02 -06:00
kabou f61a7ab4cb Remove color specifications from bone meal.
* The bone meal craftitem definition still had color specifications
  from its past as a dye substitute.  These can be removed now.
* Also remove default stack_max setting.
2024-11-09 20:24:02 -06:00
kabou 4449f74742 Remove color specifications from cocoa beans.
* The cocoa beans craftitem definition still had color specifications
  from its past as a dye substitute.  These can be removed now.
2024-11-09 20:24:02 -06:00
kabou ba1e0e4301 Also generate double grass when bonemealing grass blocks. 2024-11-09 20:24:02 -06:00
kabou 7938fba4a5 Remove expired bone meal API.md from mcl_dye. 2024-11-09 20:24:02 -06:00
kabou 8acddab74f Bonemealing mechanics bugfix.
When applying bonemeal to eg. farm crops, these have a chance to grow in
response to the application of bone meal. When a node can be bonemealed, the
applied bone meal item should always be spent after using it, regardless of
the results.  Currently this does not work correctly, if the result of
bonemealing has no effect on the node, the used bone meal item is not spent.

This commit fixes the behavior of the bone meal item to always be taken when
used on a node that defines a `_mcl_on_bonemealing()` callback.

The nodes that implement the callback imay use the handler's return value
only to signal if the bonemealing was succesful, not to signal if it was at
all possible.  For this reason, some nodes need to be made more strictly
conforming to the API.

* Always take the used bone meal item (if user is not in creative mode),
  regardless of whether the bonemealed node's handler returned `true`.
* Make dispensers spawn particles after succesful bonemealing.
* Trivial comment fix.
* Ripe cocoa pod cannot be bonemealed.
* Update API.md to describe the stricter API semantics.
2024-11-09 20:24:02 -06:00
kabou c2c7df820f Improve mcl_bone_meal fr translations.
* Changed the wording after suggestions by AFCMS.
2024-11-09 20:24:02 -06:00
kabou e5cf4bd225 Add missing es translation to mcl_bone_meal. 2024-11-09 20:24:02 -06:00
kabou 810051c591 Move cocoa beans item to mcl_cocoas.
* Add `mcl_cocoas:coca_beans` craftitem to mcl_cocoas.
* Remove `mcl_dye:brown` craftitem from mcl_dye.
* Move cocoa beans translations from mcl_dye to mcl_cocoas.
* Add `mcl_dye:brown` alias for `mcl_cocoas:cocoa_beans` to
  mcl_dye.
* Abstract cocoa pod node registration into a loop.
* Update chocolate cookies crafting recipe in mcl_farming.
2024-11-09 20:24:02 -06:00
kabou ae56a864d0 Remove stray line from locale template.
* Removed a line from the mcl_bone_meal locale template that had by
  accident put there during the bone meal <-> white dye changes.
2024-11-09 20:24:02 -06:00
kabou 7ddcf3f93f Use better override mechanism.
* Use `minetest.override_item()` instead of re-registering the node with
  ":" prefixed to its name.  Thanks again to wsor for mentioning this.
2024-11-09 20:24:02 -06:00
kabou e8d965e21a Add more particles when bonemealing grass.
* Bonemealing dirt_with_grass spawns new growth over a wide area, so it
  looks better if we spawn a few more extra bone meal particles.
* Update mod.conf depends to mcl_bone_meal.
2024-11-09 20:24:02 -06:00
kabou 8855246dd4 Update to new bone meal API.
* Update to use new mcl_bone_meal API:
* Use new bone meal item and remove related comment.
* Update mod depends in mod.conf
* Spelling fixes: s/bonemeal/bone meal/g
2024-11-09 20:24:02 -06:00
kabou 3889abbaf4 Add mcl_bone_meal.
* New mod mcl_bone_meal, replacing bone meal functionality previously
  held in mcl_dye.
* Improve bonemealing API using callbacks in the nodes that support
  bonemealing.
* Rename bone meal item to `"mcl_bone_meal:bone_meal"` and updated its
  crafting recipe.
* Implement legacy compatibility for older bone meal API.
* Remove all non dye-related bone meal code, texture and translations from
  mcl_dye.
* Add legacy compatibility shims to mcl_dye that refer to mcl_bone_meal.
* Add an alias for "mcl_dye:white" to keep mcl_dye and its API working
  uniterrupted.
* Update mod depends in mcl_dye mod.conf.
2024-11-09 20:24:02 -06:00
kabou f6235e8e92 Add bonemealing callback for fern.
* Adds a _mcl_on_bonemealing callback to fern.
2024-11-09 20:24:02 -06:00
kabou 2190080832 Add bonemealing callback for tall grass.
* Adds a _mcl_on_bonemealing callback to tall grass.
2024-11-09 20:24:02 -06:00
kabou ea1d52baab Add bonemealing callback for double flowers.
* Adds a _mcl_on_bonemealing callback to the double flowers.
2024-11-09 20:24:02 -06:00
kabou fdc7f4634d Add bonemealing callback for dirt with grass.
* Add new file mcl_flowers/bonemeal.lua, containing the bonemealing
  callback for "mcl_core:dirt_with_grass".
* Override "mcl_core:dirt_with_grass" with a _mcl_on_bonemealing handler
  calling a function defined in mcl_flowers. This sidesteps the problem
  that bonemealing a node from mcl_core needs knowledge of mcl_flowers,
  which would create a circular dependency.  H/t to cora for suggesting
  this solution. H/t to wsor for suggesting a solution that also works.
2024-11-09 20:24:02 -06:00
kabou bde0d9b238 Add bonemealing callback to cocoa.
* Adds a _mcl_on_bonemealing callback to the unripe cocoa pods.
2024-11-09 20:24:02 -06:00
teknomunk f644d37332 Keep same selection box size 2024-11-09 20:24:02 -06:00
kabou 17f2d85de9 Refactor beetroots and add bonemealing callback.
* Abstract unripe beetroot plant node registrations into a single
  indexed definition and do the registration in a loop.
* Adds a _mcl_on_bonemealing callback to the unripe melon plants.
2024-11-09 20:24:02 -06:00
kabou d07e8d9536 Add bonemealing callback to melons.
* Adds a _mcl_on_bonemealing callback to the unripe melon plants.
2024-11-09 20:24:02 -06:00
kabou 5d2fa8072a Add bonemealing callback to pumpkins.
* Adds a _mcl_on_bonemealing callback to the unripe pumpkin plants.
2024-11-09 20:24:02 -06:00
kabou 2d8bb12fad Add bonemealing callback to carrots.
* Adds a _mcl_on_bonemealing callback to the unripe carrot plants.
2024-11-09 20:24:02 -06:00
kabou 69032c3222 Add bonemealing callback to potatoes.
* Adds a _mcl_on_bonemealing callback to the unripe potato plants.
2024-11-09 20:24:02 -06:00
kabou 71e6fa9646 Add bonemealing callback to wheat.
* Adds a _mcl_on_bonemealing callback to the unripe wheat node definitions.
2024-11-09 20:24:02 -06:00
kabou 9ea52ce9b3 Add bonemealing callback to small mushrooms.
* Adds a _mcl_on_bonemealing callback to the mushroom node definitions.
2024-11-09 20:24:02 -06:00
kabou 0422635047 Add bonemealing callback to saplings.
* Adds a _mcl_on_bonemealing callback to the sapling node definitions.
2024-11-09 20:24:02 -06:00
kno10 b540e6c77b Improve head swivel code (#4622)
* Utilize the minetest 5.9.0 API that uses radians not degree.
* Simplify computations to make this more efficient, in particular by querying and updating the bone position less frequently.
* Resolves minetest warning `Deprecated call to set_bone_position, use set_bone_override instead` in this location, but other uses remain.
* `mcl_util.set_bone_position` not modified, because it redundantly compares to the previous rotation once more.

Reviewed-on: VoxeLibre/VoxeLibre#4622
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-11-10 02:41:55 +01:00
kno10 d49426d453 Cleanup of mcl_core/functions (#4592)
Cleanup of mods/ITEMS/mcl_core/functions.lua

This improves several further ABMs such as vine growing, and uses the `vector` API instead of tables.

Reviewed-on: VoxeLibre/VoxeLibre#4592
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-11-10 02:32:51 +01:00
the-real-herowl 2b7b7f1872 Merge pull request 'Improve plant growth system, add moisture level' (#4681) from kno10/VoxeLibre:pumpkin-melon-growth-1 into master
Reviewed-on: VoxeLibre/VoxeLibre#4681
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-11-10 02:11:37 +01:00
kno10 b5afa34469 Remove "wet" metadata altogether 2024-11-10 02:11:37 +01:00
kno10 ebf6cf32e8 meta:set_private("wet"), require only walkable nodes 2024-11-10 02:11:37 +01:00
kno10 a8318f6600 simplify catch-up LBM logic 2024-11-10 02:11:37 +01:00
kno10 fa7a7f4e81 more fixes to plant growth 2024-11-10 02:11:37 +01:00
kno10 c097c65262 adjust growth rates again 2024-11-10 02:11:37 +01:00
kno10 220a7b06e6 code review feedback 2024-11-10 02:11:37 +01:00
kno10 540a070c59 always use day light level, more fixes 2024-11-10 02:11:37 +01:00
kno10 78a958db4e Double the odds, to halve the ABM frequencies. 2024-11-10 02:11:37 +01:00
kno10 e9453d6210 Add plant growth speed option, drop average light level
Closes: #4683 by removal
2024-11-10 02:11:37 +01:00
kno10 9376cf92b1 Adjust growth speeds 2024-11-10 02:11:37 +01:00
kno10 c4030115c4 improve moisture logic 2024-11-10 02:11:37 +01:00
kno10 e1ace4ad01 pumpkin/melon growth only tests one neighbor every time 2024-11-10 02:11:37 +01:00
the-real-herowl e3b7847df1 Merge pull request 'Shield improvements and bugfixes (fixes #2756)' (#4582) from shieldy_shields into master
Reviewed-on: VoxeLibre/VoxeLibre#4582
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-11-10 01:34:50 +01:00
Mikita Wiśniewski f86a641dfa Improve shield block code and unhardcode offhand group 2024-11-10 01:34:50 +01:00
Mikita Wiśniewski 084741b733 Fix using shield on unknown nodes and cleanup 2024-11-10 01:34:50 +01:00
Mikita Wiśniewski d5bc0613d8 Make node itemstack check in mcl_shields less hacky 2024-11-10 01:34:50 +01:00
Loveaabb f26c34e65f Bugfix: Shield fails to block arrows 2024-11-10 01:34:50 +01:00
Loveaabb 04e29c5796 Several improvements to the Shield 2024-11-10 01:34:50 +01:00
Elias Åström 45ae170447 Deduplicate shield slowdown removal code 2024-11-10 01:34:50 +01:00
Elias Åström d0d1217dec Remove unused code in mcl_privs 2024-11-10 01:34:50 +01:00
Elias Åström cffc8e0145 Fix loosing interact bug in mcl_shields 2024-11-10 01:34:50 +01:00
the-real-herowl b136cbf9bb Changed bamboo cap drawtype (#4658)
Reviewed-on: VoxeLibre/VoxeLibre#4658
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-11-02 21:04:00 +01:00
the-real-herowl e6d8d840db Merge pull request 'Fix missing protection checks in smithing tables' (#4659) from smithing_table_patch into master
Reviewed-on: VoxeLibre/VoxeLibre#4659
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-11-02 21:00:19 +01:00
Mikita Wiśniewski 78125f425a Fix taking items out of protected smithing tables 2024-11-02 21:00:19 +01:00
cora cb1999414b Fix putting items in protected smithing tables 2024-11-02 21:00:19 +01:00
Mikita Wiśniewski 41b188caea Remove "double drop" mechanics for bamboo (fixes #4514) (#4642)
Reviewed-on: VoxeLibre/VoxeLibre#4642
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-10-27 14:16:06 +01:00
kno10 ae7995d195 Fix axolotl attacking water mobs (#4675)
Also avoid jumping out of the water closes #4644

Reviewed-on: VoxeLibre/VoxeLibre#4675
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
2024-10-27 14:10:11 +01:00
kno10 e293cbe631 Better handling of touching_ground for bouncing on beds (#4689)
Reviewed-on: VoxeLibre/VoxeLibre#4689
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-10-27 14:03:50 +01:00
the-real-herowl fd6cac5f0c Merge pull request 'Fix fog tint in overworld, apply memory leak fix, fix rain->clear clouds' (#4669) from weather-fixes into master
Reviewed-on: VoxeLibre/VoxeLibre#4669
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
2024-10-11 07:14:01 +02:00
teknomunk e864cc19ed Make fog_tint_type = "default" when weather is present to match behavior at 0.87.2 2024-10-09 01:05:20 +02:00
teknomunk 66c3c014a1 Make sure fog tints are preserved during weather is present 2024-10-09 01:05:20 +02:00
teknomunk 7807093b50 Another correction to color interpolation, change day color from layer position 0.15 to 0.50 2024-10-09 01:05:20 +02:00
teknomunk f6c3f4bd16 Correct value clamping 2024-10-09 01:05:20 +02:00
teknomunk 96a03b1923 Remove posibility of nil sky colors in overworld, add line break 2024-10-09 01:05:20 +02:00
teknomunk 2145470f63 Fix clouds during rain->clear weather transition 2024-10-09 01:05:20 +02:00
teknomunk 2ca0ccd8fe Fix fog tint in overworld, apply memory leak fix from rain.lua to snow.lua and thunder.lua 2024-10-09 01:05:20 +02:00
teknomunk 614518c6cd Revert minetest.add_entity() -> mcl_mobs.spawn() from #4445 (#4679)
Reviewed-on: VoxeLibre/VoxeLibre#4679
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-10-08 15:34:30 +02:00
kno10 253a06fa08 Fix mob egg double-spawns (#4657)
If you spawn a mob clicking on a wall, two mobs will be spawned.

To reproduce: face a stack of stones, with a spawn egg click on the side of a stone. It does not happen when you click the top of a node, because spawning below fails and only the second one succeeds.

Reviewed-on: VoxeLibre/VoxeLibre#4657
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
2024-09-30 19:21:40 +02:00
kno10 dcfd31d17a Avoid random jumps when standing due to gravity (fewer villagers on the roofs) (#4547)
Reviewed-on: VoxeLibre/VoxeLibre#4547
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-30 11:22:31 +02:00
teknomunk c34aecfcab Don't make 'ignore' nodes break bamboo or kelp (#4551)
This modifies the behavior of kelp and bamboo so that neither breaks when an unloaded node is encountered.

Reviewed-on: VoxeLibre/VoxeLibre#4551
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-09-29 13:57:52 +02:00
Mikita Wiśniewski 9cb4f51468 Fix invalid global call in mcl_chests LBM (#4667)
Reviewed-on: VoxeLibre/VoxeLibre#4667
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-29 13:34:20 +02:00
kno10 d264ba70d8 Fix growth logic, clean up mcl_farming/shared_functions (#4640)
Reviewed-on: VoxeLibre/VoxeLibre#4640
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-20 14:00:49 +02:00
Mikita Wiśniewski 513413afc7 Use `remove_node` instead of `dig_node` in mcl_core ABMs (fixes #4628) (#4629)
The mycelium ABM has been left untouched because of the potential destructiveness. If we ever find that to be an issue, it can be fixed as part of a bigger PR.

Reviewed-on: VoxeLibre/VoxeLibre#4629
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-19 18:54:39 +02:00
kno10 011be754ca Allow deepslate copper to be mined with stone pickaxe (#4635)
Reviewed-on: VoxeLibre/VoxeLibre#4635
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
2024-09-18 10:11:55 +02:00
teknomunk eea96867c4 Don't add rain skycolor layer if the current layer is already the rain skycolor (#4648)
Fixes #4647 Rain makes the sky black until restart. This also fixes a memory leak caused by rain adding a color layer every time step.

Reviewed-on: VoxeLibre/VoxeLibre#4648
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-09-18 10:10:53 +02:00
the-real-herowl cd2ee49591 Merge pull request 'Make Soul Speed work on Soul Soil' (#4604) from upstream/soul_soil_speed into master
Reviewed-on: VoxeLibre/VoxeLibre#4604
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-18 10:06:03 +02:00
seventeenthShulker de3b34f5ea Update English translation keys with soul soil 2024-09-18 10:06:03 +02:00
seventeenthShulker e2bcd129c1 Use soul_block group for soul speed bonus 2024-09-18 10:06:03 +02:00
seventeenthShulker 79e8452f62 Soul speed works on soul soil too
(needs localization)
2024-09-18 10:06:03 +02:00
the-real-herowl b239549774 Merge pull request 'Correct space check when spawning mobs' (#4445) from fix-has_room into master
Reviewed-on: VoxeLibre/VoxeLibre#4445
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
2024-09-17 11:49:29 +02:00
teknomunk 0b62c827aa Remove has_room debug data 2024-09-16 13:32:06 +02:00
teknomunk 626bdd13d8 Change several places where mobs are created to use mcl_mobs.spawn() instead of minetest.add_entity() 2024-09-16 13:32:06 +02:00
teknomunk 31a3788ce1 Address review comments 2024-09-16 13:32:06 +02:00
teknomunk e65370b845 Fixes 2024-09-16 13:32:06 +02:00
teknomunk 6c50e0a82b Fix volume used for room check during spawn, make mcl_mobs.spawn check for room before adding entity, change iron golems and mob spawners to use mcl_mobs.spawn 2024-09-16 13:32:06 +02:00
teknomunk 8ef08128b1 Add short circuit if sub-node space check isn't possible: 2024-09-16 13:32:06 +02:00
teknomunk 15efd00a29 Replace second call to minetest.find_nodes_in_area with checking top layer for matching nodes, change p2 calculation to use ceil(value) - 1, fix dx*dy*dz calculation 2024-09-16 13:32:06 +02:00
teknomunk fa3df0d8c6 Add check for presence of minetest.get_node_boxes before attempting sub-node space checks 2024-09-16 13:32:06 +02:00
teknomunk c41ce8ba59 Make spiders require 3x1x3 space to spawn 2024-09-16 13:32:06 +02:00
teknomunk 4d58f63485 Implement partial node spawning check 2024-09-16 13:32:06 +02:00
teknomunk fa09b65010 Add most of the code for sub-node accurate spawning volume check (needs a function to calculate bounding box height of nodes) 2024-09-16 13:32:06 +02:00
teknomunk d8d39ffd52 Add spawnbox parameter that overrides collision box for spawn volume checks 2024-09-16 13:32:06 +02:00
teknomunk b6aafedf25 Fix space check function has_room() in mcl_mobs/spawning.lua so it allows spiderproofing 2024-09-16 13:32:06 +02:00
Mikita Wiśniewski 178cb9340d Clean-up `set_string(..., nil)` usage (fixes #4639) (#4641)
Reviewed-on: VoxeLibre/VoxeLibre#4641
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-16 12:12:55 +02:00
kno10 f219e5f4ae Fix structure spawns under water + peaceful spawns (#4607)
- peaceful structure spawns would not run in peaceful mode (e.g., parrots)
- water structure spawns (e.g., guardians) would not run because the code required air above
- small code improvements

Reviewed-on: VoxeLibre/VoxeLibre#4607
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-15 23:15:30 +02:00
kno10 66b7a52d47 Make zombies and skeletons not float (#4512)
Reviewed-on: VoxeLibre/VoxeLibre#4512
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-15 23:14:10 +02:00
WillConker ce5eb8d88d Remove mobs_mc name check from mcl_mobspawners warning (#4501)
Fixes a warning.
Mobs spawners really only need to check the entity `.is_mob` as all mobs should have this set.

Reviewed-on: VoxeLibre/VoxeLibre#4501
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: WillConker <willconker@noreply.git.minetest.land>
Co-committed-by: WillConker <willconker@noreply.git.minetest.land>
2024-09-15 23:08:37 +02:00
the-real-herowl 6eb0d3c9d9 Merge pull request 'SmallJoker's mod load order patches' (#4541) from dependency_paradise into master
Reviewed-on: VoxeLibre/VoxeLibre#4541
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-09-15 22:25:44 +02:00
teknomunk 1707eef672 Fix two additional dependency issues 2024-09-15 22:25:44 +02:00
SmallJoker fb3e9dae84 autogroup: Do node overwrites after all mods have loaded 2024-09-15 22:25:44 +02:00
SmallJoker 7f5b19cda8 Fix missing dependencies for random_mod_load_order 2024-09-15 22:25:44 +02:00
the-real-herowl 7f372d066e Merge pull request 'FIX spawning' (#4636) from kno10/VoxeLibre:fix-spawning-brown-paperbag into master
Reviewed-on: VoxeLibre/VoxeLibre#4636
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-09-15 22:21:23 +02:00
kno10 f9290c6493 drop entirely 2024-09-15 22:21:23 +02:00
kno10 52124bd201 FIX spawning 2024-09-15 22:21:23 +02:00
Mikita Wiśniewski 19d662dee4 Fix some typos in the API documentation (#4630)
Reviewed-on: VoxeLibre/VoxeLibre#4630
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-12 18:13:52 +02:00
the-real-herowl 2be54212b7 Merge pull request 'Performance optimizations of spawning' (#4470) from kno10/VoxeLibre:delay_binome_check into master
Reviewed-on: VoxeLibre/VoxeLibre#4470
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-09-09 20:41:27 +02:00
kno10 7d763b7257 more mob spawn code improvements 2024-09-09 20:33:03 +02:00
kno10 bdd3ae2cd8 avoid spawning ground mobs in shallow water 2024-09-09 20:33:03 +02:00
kno10 2e1df31399 Refactor and clean up spawn checks, optimize. 2024-09-09 20:33:03 +02:00
kno10 382a35bb44 delay biome check when spawning 2024-09-09 20:33:03 +02:00
kno10 0752ed17d8 Improve cacti and cane growth ABM (#4590)
- local functions, as they are not called by anywhere else
- delay water check of reed, first check height
- reduce number of get_node calls (for height 1,2,3 the old code used 4,5,4 calls, the new only 2,3,3)
- cane growth rate is also reduced

This will make the ABM cheaper.

Reviewed-on: VoxeLibre/VoxeLibre#4590
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-09 20:22:04 +02:00
kno10 72c7489976 use vector.new in mcl_dungeons (#4567)
No functional changes, just more vector API, which supposedly is faster?

Reviewed-on: VoxeLibre/VoxeLibre#4567
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-09 20:08:30 +02:00
kno10 71881154e9 use vector.in_area instead of own code in mapgen (#4562)
`between` and `in_cube` duplicate functionality already in minetest `vector`.

Reviewed-on: VoxeLibre/VoxeLibre#4562
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-09 20:05:59 +02:00
kno10 6c38823606 More randomness for slime chunks (#4466)
Use a classic pseudo-random hashing approach, by multiplication of chunk numbers
with large primes that should be more random.
- make slime density (as 1 in N) and maximum light level (default: no limit) configurable
- Allow using a 3d chunking system where y is also used for hashing

This does *not* modify spawn frequency, only the chunk logic.

Reviewed-on: VoxeLibre/VoxeLibre#4466
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-09 19:58:54 +02:00
kno10 dd4898b319 Fix surface pools with deep holes (#4571)
Sometimes, pools would spawn deep underground and then produce deep holes.
I noticed that such pools would be at +48, at the block boundary.
IMHO this may be an error in minetest surface detection.

Nevertheless, here is a workaround: require air above pool spawns.

Also clean up the pool code

Reviewed-on: VoxeLibre/VoxeLibre#4571
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-09 13:25:30 +02:00
JoseDouglas26 38822aba0a Piglin brutes are not immune to fire and lava (#4378)
Thank you again WillConker

Reviewed-on: VoxeLibre/VoxeLibre#4378
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-09-08 14:01:05 +02:00
kno10 d85febdb15 Cactus damage cleanup, drop redundant conditions (#4625)
Reviewed-on: VoxeLibre/VoxeLibre#4625
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-08 05:21:42 +02:00
Mikita Wiśniewski fb4a6b0e7b Fix old angled heads not being converted (#4627)
Reviewed-on: VoxeLibre/VoxeLibre#4627
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-08 04:26:51 +02:00
the-real-herowl dd4f3d21eb Merge pull request 'Alias creeper heads to stalker heads & Refactor mcl_heads (closes #4545)' (#4602) from goodspeed/VoxeLibre:stalker-head into master
Reviewed-on: VoxeLibre/VoxeLibre#4602
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-07 16:08:20 +02:00
William Goodspeed 2f25bc5277 Refactor head's `param2' to degrotate 2024-09-07 15:56:44 +02:00
William Goodspeed 5d0d93db0a Alias creeper heads to stalker heads
This solves the issue of creeper heads in the old version not getting
upgraded with newer VL reported in #4545.
2024-09-07 15:56:44 +02:00
kno10 ebee85db7e Fix incorrect usages of math.random (#4621)
random() does not support float arguments

Reviewed-on: VoxeLibre/VoxeLibre#4621
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-07 14:58:12 +02:00
kno10 593a095a5f Fix "generateImagePart" warning (#4624)
Placing the texture at -16 with width 16 means it is not used. At most -14 may be used (0 indexed, I believe) if you want to retain 2x2 pixels.

Reviewed-on: VoxeLibre/VoxeLibre#4624
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
2024-09-05 09:31:03 +02:00
teknomunk e9bf509c85 Add crash guards against unknown items (#4623)
This adds defensive checks to guard against crashing when digging with an unknown item in hand.

Reviewed-on: VoxeLibre/VoxeLibre#4623
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-08-31 23:41:06 +02:00
kno10 444c491e14 Remove mcl_structures:structblocks (#4619)
As spawning happens via gennotify anyway, we can omit placing a
structblock right away.

This also avoids certain cases of holes in snow cover or water.
Plus, the code is simpler.

Isolated from the big mapgen overhaul, for the main branch.

Reviewed-on: VoxeLibre/VoxeLibre#4619
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-31 21:01:44 +02:00
the-real-herowl 05bfe5513f Merge pull request 'Convert stairs to nodebox and use world-aligned tiling (fixes #4578)' (#4588) from nodebox_stairs into master
Reviewed-on: VoxeLibre/VoxeLibre#4588
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
2024-08-31 19:54:02 +02:00
codiac 562a9d6d98 Convert stairs to nodebox 2024-08-31 19:52:41 +02:00
cora 0e4b8d9c27 Fix some cornerstairs missing textures 2024-08-31 19:52:41 +02:00
the-real-herowl 93165a042b Merge pull request 'Fix Honeycomb Right-click' (#4614) from fix-honeycomb into master
Reviewed-on: VoxeLibre/VoxeLibre#4614
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-08-31 19:43:41 +02:00
teknomunk 3e85736404 Change honeycomb to use same right-click logic recently added to buckets and bottles 2024-08-31 19:37:14 +02:00
teknomunk f10827d0d6 Rework code 2024-08-31 19:37:14 +02:00
teknomunk f9cd2500c0 Don't crash trying to right click unknown nodes while holding honeycomb 2024-08-31 19:37:14 +02:00
teknomunk 64c04a2f0a Fix #4613 2024-08-31 19:37:14 +02:00
kno10 ecfa42d51d Update railcorridors, enable chest minecarts (#4620)
Minecart chests seem to work by now.

Reviewed-on: VoxeLibre/VoxeLibre#4620
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-31 19:36:18 +02:00
kno10 2dadfda76b Drop old (and disabled by default) fallen logs. (#4618)
There are better ones enabled in mods/MAPGEN/mcl_terrain_features/init.lua

Reviewed-on: VoxeLibre/VoxeLibre#4618
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-31 19:35:16 +02:00
the-real-herowl d888e832ae Merge pull request 'Update German Translations' (#4529) from teknomunk/MineClone2:update-german-translations into master
Reviewed-on: VoxeLibre/VoxeLibre#4529
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
2024-08-31 19:25:58 +02:00
teknomunk 8e37f34b93 Fix swapped translations 2024-08-31 09:57:45 -05:00
teknomunk 88be86ab4b Remove stray merge conflict marking, add two additional empty translations to match template.txt 2024-08-31 16:39:43 +02:00
teknomunk 316d5bf197 Address review comments on translations/grammar 2024-08-31 16:39:43 +02:00
teknomunk bc00b8d11b Finish restoring inadvertently removed translations 2024-08-31 16:39:43 +02:00
teknomunk 0743112317 Remove extra line at end of file 2024-08-31 16:39:43 +02:00
teknomunk 0a83c73fe0 Restore inadvertantly removed translations 2024-08-31 16:39:43 +02:00
teknomunk 8a3ef9d4c8 Last three German translations for #4529 2024-08-31 16:39:43 +02:00
teknomunk 757d6761b2 Add German translations for mcl_crimson, update template.txt 2024-08-31 16:39:43 +02:00
teknomunk 15003b1c55 Fix orange->orange(r/s) where needed, synchronize mods/ITEMS/mcl_colorblocks/locale/mcl_colorblocks.de.tr with template.txt 2024-08-31 16:39:43 +02:00
teknomunk 485bce3df6 Add German translations of for part of the item descriptions 2024-08-31 16:39:43 +02:00
teknomunk 66a3fcb33c Add corrections to existing German translations 2024-08-31 16:39:43 +02:00
teknomunk 38585154cd Make German translation of mcl_stairs match template.txt 2024-08-31 16:39:43 +02:00
teknomunk 161655e87c Add German translation for mcl_target 2024-08-31 16:39:43 +02:00
teknomunk b072557a6a Add German translation for Suspicious Stew 2024-08-31 16:39:43 +02:00
teknomunk 157d72b593 Add German translation for mcl_spyglass 2024-08-31 16:39:43 +02:00
teknomunk 76b28a4fc5 Add German translations to mesecons_button 2024-08-31 16:39:43 +02:00
teknomunk 92d823deaf Add German translations for Netherite Scrap/Ingot 2024-08-31 16:39:43 +02:00
teknomunk c65bd27ad8 Add German translation for mcl_lightning_rods 2024-08-31 16:39:43 +02:00
teknomunk 398eb35858 Add German translations for mcl_honey 2024-08-31 16:39:43 +02:00
teknomunk 763902a877 Add German translation for mcl_grindstone 2024-08-31 16:39:43 +02:00
teknomunk 140d9014a0 Add new German translations to mesecons_pressureplates 2024-08-31 16:39:43 +02:00
teknomunk 043dc4487c Add more German translations to mcl_raw_ores 2024-08-31 16:39:43 +02:00
teknomunk cf6ee14e13 Add more German translations to vl_hollow_logs 2024-08-31 16:39:43 +02:00
teknomunk be69fdef8d Add new german translations for mcl_copper 2024-08-31 16:39:43 +02:00
teknomunk 6935bc2a18 Make mcl_copper.de.tr match template.txt 2024-08-31 16:39:43 +02:00
teknomunk 37d6ba392c Add more german translations for bamboo nodes 2024-08-31 16:39:43 +02:00
teknomunk 07bebe6c46 Add the new german translations for crimson/warped 2024-08-31 16:39:43 +02:00
teknomunk 63036c8d41 Update german translation for crimson/warped nodes 2024-08-31 16:39:43 +02:00
teknomunk 45b8d36f73 Add german translations for cherry tree blocks 2024-08-31 16:39:43 +02:00
teknomunk a44d8f43db Add missing trim in translation list 2024-08-31 16:39:43 +02:00
teknomunk 55b5dee827 Convert spaces to tabs 2024-08-31 16:39:43 +02:00
teknomunk adf64e81cd Allow translating trim names, add some German translations of trims 2024-08-31 16:39:43 +02:00
teknomunk 2b44abbceb More translations 2024-08-31 16:39:43 +02:00
teknomunk e9632b5317 Start adding next round of German translations 2024-08-31 16:39:43 +02:00
teknomunk df42751ae6 Add last of this latest round of new German translations provided by Laudrin 2024-08-31 16:39:43 +02:00
teknomunk 576662d719 Add Spectre Membrane to localization template 2024-08-31 16:39:43 +02:00
teknomunk 6b13612318 Fix typo in translated string 2024-08-31 16:39:43 +02:00
teknomunk 8861ad935b More translations entered 2024-08-31 16:39:43 +02:00
teknomunk 66a6d213ba Add more German translations from Laudrin 2024-08-31 16:39:43 +02:00
teknomunk 7fc7758b62 Add translation support to mcl_compressed_blocks 2024-08-31 16:39:43 +02:00
teknomunk 7aa8a4dd11 Last of the translations provided that have existing translation code for translating strings 2024-08-31 16:39:43 +02:00
teknomunk ec56e4ec1b Enter more translations 2024-08-31 16:39:43 +02:00
teknomunk 3193bb5d93 Start installing the German translations from #4333 2024-08-31 16:39:43 +02:00
kno10 573269afab Bug fix in tooltips for unknown items (#4610)
Reviewed-on: VoxeLibre/VoxeLibre#4610
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-31 10:18:12 +02:00
kno10 12214c5bd6 Allow salmon, tropical fish, witch huts in rivers (#4605)
As witch huts use flag "liquid_surface", place_on only can be water. If we want on-shore witch huts, this needs to be solved differently.
Also, probably no witch huts in deep ocean swamp water?

Reviewed-on: VoxeLibre/VoxeLibre#4605
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-31 10:16:43 +02:00
the-real-herowl 6dad5afec5 Merge pull request 'Correct the names of pumpkins and carved pumpkins. Slightly update their descriptions.' (#3828) from fix_pumpkin_names into master
Reviewed-on: VoxeLibre/VoxeLibre#3828
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-08-30 18:27:16 +02:00
the-real-herowl 508811d3b3 Fixed Polish and German translations 2024-08-30 18:26:18 +02:00
SmokeyDope 411cb2b9b9 Correct the names of pumpins and carved pumpkins. Slightly update their descriptions. 2024-08-30 18:26:18 +02:00
kno10 8fd736e0fd Improve cactus drops and spawning (#4581)
- breaking cactus will drop randomly in x=-0.75..+0.75, z=-0.75..+0.75
- breaking cactus will have an initial velocity in this direction
- if a larger cactus break, they break into the same direction
- cactus growth rate reduced 4x, to debuff farm efficiency (will need a larger rebalancing)
- cactus only spawns when there is air surrounding it and above, so it does not immediately break
- slightly increase the frequency of cactus to counter this

The first changes make cactus farms possible.

Reviewed-on: VoxeLibre/VoxeLibre#4581
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-30 18:22:05 +02:00
kno10 d2b96b6142 Queue is not used anywhere (#4608)
Dead code.

Reviewed-on: VoxeLibre/VoxeLibre#4608
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-30 18:20:38 +02:00
the-real-herowl a3cc105fa1 Merge pull request 'Fix Cauldrons' (#4615) from fix-cauldrons into master
Reviewed-on: VoxeLibre/VoxeLibre#4615
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-08-30 16:12:55 +02:00
teknomunk 5b039f1855 Fix getting water back into bottle 2024-08-28 06:30:12 -05:00
teknomunk 7e832dc641 Fix adding water bottles and emptying full cauldrons 2024-08-28 06:17:53 -05:00
the-real-herowl 91cecca135 Merge pull request 'Fix for fortune drops in mcl_farming from MCLA' (#4594) from farming_fortune_fix into master
Reviewed-on: VoxeLibre/VoxeLibre#4594
Reviewed-by: teknomunk <teknomunk@protonmail.com>
2024-08-27 16:28:39 +02:00
JoseDouglas26 95653a0676 ipairs to pairs 2024-08-27 13:11:08 +02:00
JoseDouglas26 b141f7c0a4 new special field to solve drop bug 2024-08-27 13:11:08 +02:00
the-real-herowl cf9bbb0551 Merge pull request 'mcl_weather sky color refactor' (#4338) from teknomunk/MineClone2:skycolor-refactor into master
Reviewed-on: VoxeLibre/VoxeLibre#4338
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-08-19 03:34:59 +02:00
teknomunk aea9e6d182 Update comment according to VoxeLibre/VoxeLibre#4338 (comment) 2024-08-19 03:02:02 +02:00
teknomunk 09307292bc Make sure overworld always gets a sky update regardless of weather, add assert to enforce sky color gets set every update 2024-08-19 03:02:02 +02:00
teknomunk e407e2e290 Force has_mcl_potions to boolean 2024-08-19 03:02:02 +02:00
teknomunk 87a48270f5 Add mcl_util.to_bool 2024-08-19 03:02:02 +02:00
teknomunk 21a88be2b2 Remove boolean coersion 2024-08-19 03:02:02 +02:00
teknomunk 37ff699a23 Add line break 2024-08-19 03:02:02 +02:00
teknomunk 18266137b2 Make sure clouds don't disappear when entering water 2024-08-19 03:02:02 +02:00
teknomunk 3667feddd3 Address review comments 2024-08-19 03:02:02 +02:00
teknomunk dc074ff555 Remove debug logging 2024-08-19 03:02:02 +02:00
teknomunk 0e1a2cbc1e Correct conditions for water-air transition forced skycolor update 2024-08-19 03:02:02 +02:00
teknomunk cb097d9bcd Add minimum time between skycolor updates (default is 250ms, tracked per player) 2024-08-19 03:02:02 +02:00
Wbjitscool cd213b75f7 Update mods/ENVIRONMENT/mcl_weather/skycolor.lua
adds in sunray shader support for Minetest version 5.9.0
2024-08-19 03:02:02 +02:00
teknomunk ef58a9809a Remove empty else block, fix up mg_name and add mapgen check to water.lua 2024-08-19 03:02:02 +02:00
teknomunk 3b01fe20ba Remove debug commented out logging, remove extra zero in 24-hour time 2024-08-19 03:02:02 +02:00
teknomunk d34c804ebf Remove local mod = mcl_weather and replace accesses to variables thru mcl_weather with local variable equivalents 2024-08-19 03:02:02 +02:00
teknomunk 03faa7764d Fix variable name (caused crash) 2024-08-19 03:02:02 +02:00
teknomunk 207c86b813 Fix crash and rearrange code 2024-08-19 03:02:02 +02:00
teknomunk cf4b1dbd1d Remove END function comment 2024-08-19 03:02:02 +02:00
teknomunk 7811e23611 Convert to use mcl_playerinfo 2024-08-19 03:02:02 +02:00
teknomunk 24ff7347b2 Further cleanup 2024-08-19 03:02:02 +02:00
teknomunk 820848fb2e Address review comments 2024-08-19 03:02:02 +02:00
teknomunk f2a638f8e9 Fix random crash in darkness effect in mcl_potions, finish refactoring of mcl_weather.skycolor that also makes darkness effect more reliable 2024-08-19 03:02:02 +02:00
teknomunk 161dd7d379 Start refactor 2024-08-19 03:02:02 +02:00
the-real-herowl d0e8b4141d Merge pull request 'Merge mcla kelp growing' (#4474) from WillConker/VoxeLibre:kelp_make_source into master
Reviewed-on: VoxeLibre/VoxeLibre#4474
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-08-18 21:47:46 +02:00
cora 15fa3ff775 Fix crash when growing kelp into water logged mangrove roots 2024-08-18 19:21:19 +02:00
WillConker 11168f226a Revert "WaterLoggedRootsKelpFix (#3994)"
This reverts commit a425d359f5.
2024-08-18 19:21:19 +02:00
teknomunk 2ad59c6df9 Stop lightning striking positions that don't have rain (#4386)
Stops lighting from being able to strike in locations where rain doesn't occur, but allows lightning in adjacent areas where is allowed.

Reviewed-on: VoxeLibre/VoxeLibre#4386
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-08-18 12:05:35 +02:00
the-real-herowl 948da34755 Readded missing stairs and slabs (#4601)
Also *probably* fixed their blast res and hardness

Reviewed-on: VoxeLibre/VoxeLibre#4601
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-08-18 08:45:49 +02:00
WillConker 406e0e8169 Made soul speed and depth strider speed boosts additive instead of exclusive (#4422)
Reviewed-on: VoxeLibre/VoxeLibre#4422
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: WillConker <waj01@joanes.net>
Co-committed-by: WillConker <waj01@joanes.net>
2024-08-18 06:25:04 +02:00
the-real-herowl 09aba760cf Merge pull request 'Minor fixes on potion behavior on damage disabled servers (closes 4586)' (#4599) from goodspeed/VoxeLibre:potion-hud into master
Reviewed-on: VoxeLibre/VoxeLibre#4599
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-08-18 05:49:44 +02:00
William Goodspeed a6136ad158 Removing absorption bar on damage disabled servers
The absorption effect won't work on damage disabled servers and the
health bar and hunger bar is also hidden leaving the absorption bar
alone which makes it look not good. So not initializing it on those
servers might be a good idea.
2024-08-18 05:48:37 +02:00
William Goodspeed 77bcf6cff3 Allowing `hb.change_bar' called with hudbar uninitialized
Calling `hb.change_bar' with hunger bar on damage disabled server
will crash the server. To not overload other functions to check
`enable_damage' over and over, simply make `hb.change_bar' able to be
called with uninitialized identifiers. #4586
2024-08-18 05:48:37 +02:00
WillConker 293eb6d021 Stop tnt colliding with entities (#4476)
Reviewed-on: VoxeLibre/VoxeLibre#4476
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: WillConker <waj01@joanes.net>
Co-committed-by: WillConker <waj01@joanes.net>
2024-08-18 05:40:25 +02:00
the-real-herowl 1c5f7d05fe Merge pull request 'More hardness and blast resistance fixes' (#3952) from hardness_blast_res_fixes into master
Reviewed-on: VoxeLibre/VoxeLibre#3952
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-08-18 04:52:39 +02:00
seventeenthShulker f8fcd9954f Add back *some* changes that I reverted; and fix typo "Cherry Gate" 2024-08-18 04:47:19 +02:00
seventeenthShulker 8b9666137d All wood-type and nether-type fences now match material's blast resistance 2024-08-18 04:47:19 +02:00
seventeenthShulker b3087118fa Fix Gilded Blackstone blast res. (now 6) 2024-08-18 04:47:19 +02:00
seventeenthShulker b79a19f4d6 Add crimson/warped planks (_hyphae_wood) blast res
Relates to (#4414)
2024-08-18 04:47:19 +02:00
seventeenthShulker b0b5cc1265 Remaining stairs/slabs inherit properties instead of hardcoding
- Fix smooth quartz attributes
- Alternative recipes for (red) sandstone, quartz, purpur slabs/stairs have been added explicitly
2024-08-18 04:47:19 +02:00
seventeenthShulker b237c4642d Revert "Forgot about blackstone"
I left it in from another branch, didn't want to force push.

This reverts commit 58d2f59192073acf9f55406358bf48244e008b9b.

Revert "Walls use `source` parameter for default hardness and blast resistance"
I left it in from another branch, didn't want to force push.

This reverts commit e8944cc145dc59db53a9368d8ae269edf366e742.

Revert "Fix prismarine bricks and dark variant blast res."
I left it in from another branch, didn't want to force push.

This reverts commit 6125d625bc6ce15644cf8b579599f75da5bffd07.

Revert "Un-hardcode blast resistance, hardness for walls,"
I left it in from another branch, didn't want to force push.

This reverts commit 26e873703151bc4bfaf7588ad1e3afa731a05fbd.

Revert "All wood-type and nether-type fences now match material's blast resistance"
I left it in from another branch, didn't want to force push.

This reverts commit a1e20f29162462120fb1c046c2d34f8fcebfb413.
2024-08-18 04:47:19 +02:00
seventeenthShulker 49b2491b70 Fix the other bed node 2024-08-18 04:47:19 +02:00
seventeenthShulker 0408f9c3d8 Update hardness and blast res for value not matching the wiki
- Notably, smooth sandstone (and red) is much more durable than other sandstone variants
- Ender chest isn't actually more explosion resistant than obsidian, hmm
2024-08-18 04:47:12 +02:00
seventeenthShulker cbafdfa585 Make monster eggs' hardness consistent with MC
Change blast resistance to 0.75, add an optional hardness override parameter, because cobble is unique here

(Still instant-minable, this is a separate issue)
2024-08-18 04:46:19 +02:00
seventeenthShulker 2312989503 Fix several hardness and blast resistance values 2024-08-18 04:46:19 +02:00
seventeenthShulker 1471ad7181 Un-hardcode most slabs and stairs 2024-08-18 04:46:19 +02:00
seventeenthShulker 38d7609173 Forgot about blackstone 2024-08-18 04:46:19 +02:00
seventeenthShulker 5bce56cdd6 Walls use `source` parameter for default hardness and blast resistance
If no `source` given, fallbacks are 2 and 6 respectively
2024-08-18 04:46:19 +02:00
seventeenthShulker 7a05c32198 Fix prismarine bricks and dark variant blast res.
Should be 6 like regular prismarine
2024-08-18 04:46:19 +02:00
seventeenthShulker ff386e395f Un-hardcode blast resistance, hardness for walls,
now only based on their material
2024-08-18 04:46:19 +02:00
the-real-herowl a687ef19f6 Merge pull request 'Solving ladder placement issues' (#4596) from goodspeed/VoxeLibre:ladder-logic into master
Reviewed-on: VoxeLibre/VoxeLibre#4596
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-08-18 01:40:42 +02:00
William Goodspeed c03f9abd18 Fix the placement check of ladder
The old code takes the first return val of `minetest.item_place_node'
which is `itemstack'. Therefore, the variable `success' in the old code
is always true. The new code takes the second val which will be nil if
an invalid node placement occured.

This check is necessary since the ladder may be placed in the front of
pointed block while there is a node with hole (slabs, fences etc.) at
the same place resulting an invalid placement and sound played when
it shouldn't be played.
2024-08-17 18:38:01 +02:00
William Goodspeed 9657c9d8bb Make ladder placable on any solid block 2024-08-17 18:38:01 +02:00
blitzdoughnuts 95aadd40b9 Add charcoal blocks as an item (#4589)
Co-authored-by: blitzdoughnuts <NOEMAIL@localhost>
Reviewed-on: VoxeLibre/VoxeLibre#4589
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: blitzdoughnuts <doughnutsblitz@disroot.org>
Co-committed-by: blitzdoughnuts <doughnutsblitz@disroot.org>
2024-08-16 22:28:08 +02:00
THE-NERD2 86e3446407 Update mount.lua to fix horse riding problem (#4580)
Previously, horses would continue to move even after the movement key was released. This was because mcl_mobs.drive was returning before stopping the horse. This commit makes mcl_mobs.drive stop the horse before returning.

Reviewed-on: VoxeLibre/VoxeLibre#4580
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: THE-NERD2 <pdp9729@gmail.com>
Co-committed-by: THE-NERD2 <pdp9729@gmail.com>
2024-08-16 22:21:18 +02:00
William Goodspeed ee4d1efaa5 Turn 8 snow layers stacked together into snow block (fixes #4483) (#4591)
Reviewed-on: VoxeLibre/VoxeLibre#4591
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: goodspeed <goodspeed@mailo.cat>
Co-committed-by: goodspeed <goodspeed@mailo.cat>
2024-08-16 22:03:01 +02:00
kno10 5e6e4967f0 Fix crying obsidian particles (#4583)
LUAs `math.random(a,b)` expects a and b to be integers. `size` was only randomized once.

Reviewed-on: VoxeLibre/VoxeLibre#4583
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-16 22:01:19 +02:00
kno10 df60ec947d Not all mangrove trees were post-processed (#4584)
Mangrove tree variants 4, 5 and bees nest were not post processed with root growth.

Reviewed-on: VoxeLibre/VoxeLibre#4584
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-16 21:58:04 +02:00
kno10 02cb0818a1 When chests explode due to TNT (and likely creepers), the game crashes (#4577)
because of an undefined variable.

Reviewed-on: VoxeLibre/VoxeLibre#4577
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-08-07 13:07:48 +02:00
kno10 77382d930e Typo in setting name, default should be false (#4492)
Reviewed-on: VoxeLibre/VoxeLibre#4492
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
2024-08-03 17:52:51 +02:00
the-real-herowl 5e366a8916 Merge pull request 'Implement water freezing (mostly taken from mcla)' (#4478) from WillConker/VoxeLibre:water_freezing into master
Reviewed-on: VoxeLibre/VoxeLibre#4478
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-08-03 15:13:41 +02:00
WillConker 6c614d8376 Added line breaks in water freezing condition 2024-08-03 14:21:33 +02:00
WillConker a785be59d9 Changed node light check to artificial light so that water can freeze in the day 2024-08-03 14:21:33 +02:00
cora f23014005f Only freeze water under open air
and if light level < 10
2024-08-03 14:21:33 +02:00
cora c2098d777f Prevent water freezing and ice melting ABMs from fighting 2024-08-03 14:21:33 +02:00
cora dc07eea590 Freeze water in cold areas 2024-08-03 14:21:33 +02:00
tacotexmex 3460e27468 Update OpenCollective link (#4465)
Reviewed-on: VoxeLibre/VoxeLibre#4465
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: tacotexmex <tacotexmex@noreply.git.minetest.land>
Co-committed-by: tacotexmex <tacotexmex@noreply.git.minetest.land>
2024-08-03 12:47:37 +02:00
OgelGames 0012bdb71e Clear itemstring when picking up or merging items (#4530)
Prevents possible item duplication with other mods. Matches the behavior of the default `__builtin:item`.

See also https://github.com/mt-mods/pipeworks/issues/130

Reviewed-on: VoxeLibre/VoxeLibre#4530
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: OgelGames <ogelgames@noreply.git.minetest.land>
Co-committed-by: OgelGames <ogelgames@noreply.git.minetest.land>
2024-07-31 03:26:28 +02:00
kno10 b8d7139792 Fix iron golem attack animation (#4542)
C.f. MCLA

Reviewed-on: VoxeLibre/VoxeLibre#4542
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-07-31 03:18:53 +02:00
WillConker cddc1982be Fix first loot pool not being used in shipwrecks or ocean temples (#4523)
Reviewed-on: VoxeLibre/VoxeLibre#4523
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: WillConker <willconker@noreply.git.minetest.land>
Co-committed-by: WillConker <willconker@noreply.git.minetest.land>
2024-07-31 03:00:27 +02:00
kno10 9595b0df59 Inconsistent bed bouncyness, make top match bottom (#4495)
Reviewed-on: VoxeLibre/VoxeLibre#4495
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
2024-07-31 02:58:38 +02:00
WillConker ff21d1eab1 Make eggs spawn chicks when hitting entities (#4484)
Reviewed-on: VoxeLibre/VoxeLibre#4484
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: WillConker <willconker@noreply.git.minetest.land>
Co-committed-by: WillConker <willconker@noreply.git.minetest.land>
2024-07-31 02:57:20 +02:00
WillConker 9d5b46c28a Slow ender dragon regeneration (#4481)
Reviewed-on: VoxeLibre/VoxeLibre#4481
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: WillConker <waj01@joanes.net>
Co-committed-by: WillConker <waj01@joanes.net>
2024-07-31 02:56:33 +02:00
kno10 80a6a6efb0 Choose direction vectors uniformly for spawning (#4467)
The previous code was biased towards placing mobs on top or below the
player, because it chose the theta inclination angle uniformly,
but the sphere is more narrow at the top and bottom.

This code is also simpler.

Reviewed-on: VoxeLibre/VoxeLibre#4467
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-07-31 02:30:29 +02:00
the-real-herowl 32148262e1 Merge pull request 'Grand Chests Refactor (fixes #281)' (#4453) from mcl_chests_redo into master
Reviewed-on: VoxeLibre/VoxeLibre#4453
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-07-31 02:28:18 +02:00
Mikita Wiśniewski 567d112942 Fix deprecated get_metadata() usage
Items are instead written as a serialized string into ItemStackMetaRef, and read from there as well. Old itemstacks get converted to the new format automatically.
2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 347305eaea Fix ender chests rotate crash 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 508bc19f6a Remove nil fields from trapped chest definition 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski c1e9e4b1a2 Fix typos in API.md 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 7bf15642ca Resolve teknomunk's comments 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski f1fa6240bb Fix shift-clicking and a few luacheck warnings 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski c5bc6ff189 Cleanup comments (don't use \=, it's annoying) 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 70e903b716 Simplify double inventory inv logic 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 209b24a2fb Move LBMs out of init.lua and fix API.md 2024-07-31 02:27:26 +02:00
cora ac05f8bad6 Remove unused variables in chests example.lua 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 76cff76d91 Add an introduction text to API.md 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 49b6d09985 Add documentation (README.md, API.md) 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski a66c35a9ea Fix double chests once more (hoppers this time) 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski a28e55160f Make the chest opening/closing sound customizable + fix double chests 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 6bbb6b8dec Add title field for mcl_chests.register_chest 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski b4b5bf8391 Move some groups (api.lua → chests.lua) 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 16dd8694a6 Refactor mcl_chests.register_chest AGAIN + cleanup
Now you can define custom groups for the chests, as shown in the trapped
chests example (now they show up under "Mechanisms" tab in creative!).

I'm a bit suspicious of the new return-wrapped functions, as in *they
might break under some circumstances I didn't observe*. It will require
some heavy testing to make sure nothing crashes in the future.

Also, `on_rightclick` for double chests is something I really want to
return-wrap as well, but failed to do so. 🤷
2024-07-31 02:27:26 +02:00
Jürgen Rühle 7a5ee4e6e2 Better detection of properly serialized data
Remove entity if initialization data is missing. Downgrade message in that case
to a warning.
2024-07-31 02:27:26 +02:00
Jürgen Rühle d0d9600709 Fix invisible chests
Pass chest entity initialization data to on_activate as staticdata so
initialization is atomic, preventing premature deletion of chest entity
by concurrent server steps.
2024-07-31 02:27:26 +02:00
cora 709b73295c Fix meta:set_string being called with nil 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski 1d77017ca9 Refactor mcl_chests.register_chest and clean-up 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski d6d64d8837 Fix long doc strings 2024-07-31 02:27:26 +02:00
Mikita Wiśniewski e771f0e3ff Split ITEMS/mcl_chests/init.lua (fixes #281)
Shulker boxes can now be rotated.

The TODO will now be transferred to PR.
2024-07-31 02:27:26 +02:00
Mikita Wiśniewski b10bfe27ce Clean-up ITEMS/mcl_chests code, part 2
Chest tile management has been reorganized to use postfixes, some slight
formatting fixes applied here and there, and roughly marked down where
the new files should (ideally) begin and end.
2024-07-31 02:27:26 +02:00
Mikita Wiśniewski d5b3a6f658 Clean-up ITEMS/mcl_chests code, part 1
Amongst other changes:
- mcl_chests.register_chest function has been exposed. The API is still
  too terrible to call it quits though, I definitely want all these
  parameters passed to be part of a key-value table.
- Added a TODO list at the top of the file. Don't worry, I'll remove it
  once I'm done. It's more just for my convenience than anything.
2024-07-31 02:27:26 +02:00
JoseDouglas26 f7ee3b59d7 Changes on slab placement checks (#4317)
Fixed slab placement being not allowed when it should be allowed.

Reviewed-on: VoxeLibre/VoxeLibre#4317
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-07-31 00:11:22 +02:00
the-real-herowl 1745b6d400 Merge pull request 'Add persistence to XP Orbs' (#4265) from teknomunk/MineClone2:persist-xp-orbs into master
Reviewed-on: VoxeLibre/VoxeLibre#4265
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-07-31 00:03:05 +02:00
teknomunk bb9ed4498b Address review comments 2024-06-26 06:52:26 -05:00
teknomunk 94981d9c09 Add return for get_staticdata 2024-06-26 12:23:30 +02:00
teknomunk 7ae05d9c06 Add persistence to XP orbs, cleanup xp_to_size 2024-06-26 12:23:30 +02:00
teknomunk 177e8f4b9d Code cleanup 2024-06-26 12:23:30 +02:00
the-real-herowl 026ea5940c Merge pull request 'release/0.87.2' (#4457) from release/0.87.2 into master
Reviewed-on: VoxeLibre/VoxeLibre#4457
2024-06-24 03:43:09 +02:00
the-real-herowl be9fece0d3 Post-hotfix reset version 0.88.0-SNAPSHOT 2024-06-24 03:41:37 +02:00
the-real-herowl 27f8a008c3 Update release notes for hotfix v0.87.2 2024-06-24 03:40:15 +02:00
the-real-herowl 8bbceddbc2 Updated release credits and set version for hotfix v0.87.2 2024-06-24 03:28:19 +02:00
the-real-herowl 6e70c760d6 Fix some formspecs on mobile (#4456)
This should allow renaming items on the anvil when using mobile. This also may improve mobile craftguide experience.

Reviewed-on: VoxeLibre/VoxeLibre#4456
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-24 03:26:02 +02:00
the-real-herowl 53802b270d Merge pull request 'Prevent mob conversion code from crashing' (#4421) from teknomunk/MineClone2:fix-conversion-crash into master
Reviewed-on: VoxeLibre/VoxeLibre#4421
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-06-24 03:07:19 +02:00
teknomunk 3928e12634 Fix two more crashes, stray space 2024-06-24 03:06:26 +02:00
teknomunk 304550d90c Fix parameter name 2024-06-24 03:06:26 +02:00
teknomunk 0a2336ad82 Handle conversion of mobs that were incorrectly converted 2024-06-24 03:06:26 +02:00
teknomunk 75a767a0ab Mob spawner conversion 2024-06-24 03:06:26 +02:00
teknomunk 7e0afd7e21 Remove debug logging 2024-06-24 03:06:26 +02:00
teknomunk 15fa925aae More fields to strip 2024-06-24 03:06:26 +02:00
teknomunk 4935f5fdda Add debug logging 2024-06-24 03:06:26 +02:00
teknomunk 41032ec999 Use correct variable name 2024-06-24 03:06:26 +02:00
teknomunk d64ee18f75 Strip some fields from the mob's staticdata on conversion 2024-06-24 03:06:26 +02:00
teknomunk 1942384fe5 Move object remove after position check 2024-06-24 03:06:26 +02:00
teknomunk 9b50dd6565 Update to use new_object instead of obj 2024-06-24 03:06:26 +02:00
teknomunk a88951ac6a More safety checks 2024-06-24 03:06:26 +02:00
teknomunk bc343769ee Add guard to prevent crash when converting old mobs and the minetest fails to create the new entity 2024-06-24 03:06:26 +02:00
seventeenthShulker 8aa65f85f2 Fix extra 'Stair' in Polished Blackstone Brick nodes (#4450)
Some of the longest block names were erroneous. Farewell, Polished Blackstone Brick Stair Stairs and Polished Blackstone Brick Stair Slab.

Reviewed-on: VoxeLibre/VoxeLibre#4450
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: seventeenthShulker <c545d588-7ff2-49b9-b537-0b3f769083ad@anonaddy.me>
Co-committed-by: seventeenthShulker <c545d588-7ff2-49b9-b537-0b3f769083ad@anonaddy.me>
2024-06-23 23:40:36 +02:00
qoheniac e27e70a91b fix wrong name for diorite stairs (#4359)
Reviewed-on: VoxeLibre/VoxeLibre#4359
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: qoheniac <qoheniac@noreply.git.minetest.land>
Co-committed-by: qoheniac <qoheniac@noreply.git.minetest.land>
2024-06-23 23:39:09 +02:00
JoseDouglas26 744b47088b Fixes flint and steel adding wear when not setting node on fire (#4368)
Reviewed-on: VoxeLibre/VoxeLibre#4368
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-06-16 18:33:19 +02:00
Mikita Wiśniewski 6654c86fb2 Update issue and PR templates (#4440)
Reviewed-on: VoxeLibre/VoxeLibre#4440
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-06-16 18:00:16 +02:00
the-real-herowl 72435933e4 Add defensive check (#4437)
This fixes #4436 and possible other unnoticed crashes by adding a defensive check.

Reviewed-on: VoxeLibre/VoxeLibre#4437
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-15 03:51:03 +02:00
the-real-herowl 35e14dd415 Potion conversion fix (#4426)
Reviewed-on: VoxeLibre/VoxeLibre#4426
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-13 13:22:14 +02:00
the-real-herowl 173f8a0bca Effect loading fixes (#4425)
Reviewed-on: VoxeLibre/VoxeLibre#4425
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-13 13:21:36 +02:00
teknomunk 1f32b47208 Fix crash while fighting whither (#4392)
Reviewed-on: VoxeLibre/VoxeLibre#4392
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-12 14:18:03 +02:00
SmokeyDope bf67fd52e1 Zombie texture improvements (#4260)
Reviewed-on: VoxeLibre/VoxeLibre#4260
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: SmokeyDope <smokey@tilde.team>
Co-committed-by: SmokeyDope <smokey@tilde.team>
2024-06-11 19:38:41 +02:00
WillConker fd4e1484af Fix crash on high levels of frost walker (#4423)
Reviewed-on: VoxeLibre/VoxeLibre#4423
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: WillConker <willconker@noreply.git.minetest.land>
Co-committed-by: WillConker <willconker@noreply.git.minetest.land>
2024-06-11 19:17:12 +02:00
teknomunk 1b0deae026 Fix crash when bonemealing sweet berry bushes (#4419)
Reviewed-on: VoxeLibre/VoxeLibre#4419
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-11 18:47:18 +02:00
teknomunk 313c1f558b Make all hollow logs breakable (#4418)
Reviewed-on: VoxeLibre/VoxeLibre#4418
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-11 18:43:33 +02:00
teknomunk 5cafa97dd1 Fix formspec code that reads strength button field (#4385)
Reviewed-on: VoxeLibre/VoxeLibre#4385
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-11 18:40:44 +02:00
teknomunk ddab68b87c Add instructions on how to eat to basic controls help entry (#4420)
Reviewed-on: VoxeLibre/VoxeLibre#4420
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-10 19:44:30 +00:00
JoseDouglas26 2dafbae64b Hotfix for brewing stands rotation (#4371)
Reviewed-on: VoxeLibre/VoxeLibre#4371
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-06-07 06:10:52 +00:00
the-real-herowl 65d6cb1d83 Merge pull request 'release/0.87.1' (#4357) from release/0.87.1 into master
Reviewed-on: VoxeLibre/VoxeLibre#4357
2024-06-02 02:01:07 +00:00
the-real-herowl acf72be89c Post-hotfix reset version 0.88.0-SNAPSHOT 2024-06-02 04:00:05 +02:00
the-real-herowl 1153a81b65 Update release notes for hotfix v0.87.1 2024-06-02 03:58:50 +02:00
the-real-herowl f423c1ea25 Set version for hotfix v0.87.1 2024-06-02 03:47:02 +02:00
the-real-herowl d8aeb4ce12 Updated hotfix process (#4356)
Reviewed-on: VoxeLibre/VoxeLibre#4356
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-02 01:43:08 +00:00
the-real-herowl 21c182fc0e Fixed creative.lua invalidating iterator in loop (#4354)
Reviewed-on: VoxeLibre/VoxeLibre#4354
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-02 00:33:29 +00:00
teknomunk ca033d0e8d Correctly refresh enchantment tool capabilities in mcl_potions haste/fatigue effects (#4355)
Reviewed-on: VoxeLibre/VoxeLibre#4355
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-01 23:25:42 +00:00
teknomunk beccbacc73 Fix Stalker texture generation (#4343)
This fixes stalker texture generation when the stalker is standing on a node that uses a texture using a texture modifier.

Reviewed-on: VoxeLibre/VoxeLibre#4343
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-01 20:23:38 +00:00
teknomunk ecf12b85cc Fix undefined global warning for variable distance in spawning code (#4348)
Fixes the warning about an undeclared global that occurs the first time a mob attempts to spawn.

Reviewed-on: VoxeLibre/VoxeLibre#4348
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-31 09:54:59 +00:00
the-real-herowl f53bedc131 Merge pull request 'Fix beacon crash' (#4342) from teknomunk/MineClone2:fix-beacon-crash into master
Reviewed-on: VoxeLibre/VoxeLibre#4342
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-05-30 11:19:19 +00:00
the-real-herowl 3e6ec9cf10 Fixed eye of ender crash (#4344)
This makes sure every loaded eye of ender gets its `_luck` parameter set.

Reviewed-on: VoxeLibre/VoxeLibre#4344
2024-05-30 11:17:19 +00:00
teknomunk 6c8771485c Fix variable name 2024-05-30 10:51:45 +00:00
teknomunk f621e3c1de Fix up formspecs on pre-0.87.0 beacons, fix typo 2024-05-30 10:51:45 +00:00
teknomunk 7d0f49a218 Fix typo 2024-05-30 10:51:45 +00:00
teknomunk 468c2bc68f Change to conversion table 2024-05-30 10:51:45 +00:00
teknomunk 2fc3d92550 Convert 'strenght' to 'strength' in beacons and guard against no effect string metadata set, fix whitespace in mcl_beacons/init.lua 2024-05-30 10:51:45 +00:00
teknomunk 95228500a9 Don't crash when name == nil 2024-05-30 10:51:45 +00:00
teknomunk c7e43e31d4 Convert crash to a warning 2024-05-30 10:51:45 +00:00
JoseDouglas26 067ad7b78b Change stack size for snowballs and eggs (#4312)
Reviewed-on: VoxeLibre/VoxeLibre#4312
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-05-30 08:31:15 +00:00
teknomunk add9cbe3bc Fix mob spawner crash (#4337)
This fixes #4336 crash at login about mcl_mobspawners. Also adds an API call, `mcl_mobs.register_conversion` for converting one mob into another and updates rovers and stalkers to use this API call.

Reviewed-on: VoxeLibre/VoxeLibre#4337
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-30 08:29:12 +00:00
teknomunk c4f4e7b6fc Fix crash that occurs when lingering or splash potions are used from a dispenser (#4335)
Reviewed-on: VoxeLibre/VoxeLibre#4335
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-30 08:02:59 +00:00
teknomunk 6394371e4f Update minetest version support information (#4332)
Reviewed-on: VoxeLibre/VoxeLibre#4332
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-30 08:00:47 +00:00
the-real-herowl e097c87e7c Merge pull request 'release_0_87_prismatic' (#4320) from release_0_87_prismatic into master
Reviewed-on: VoxeLibre/VoxeLibre#4320
2024-05-26 16:41:42 +00:00
the-real-herowl 9e0136e3c4 Post-release set version 0.88.0-SNAPSHOT 2024-05-26 18:38:39 +02:00
the-real-herowl b2d93f3265 Add release notes for v0.87 2024-05-26 18:30:19 +02:00
the-real-herowl dfddea76fb Updated release credits and set version for v0.87 2024-05-26 18:30:19 +02:00
the-real-herowl da491b8505 Documented a returned table (effect data) (#4330)
Updated documentation, follow-up to #4130

Reviewed-on: VoxeLibre/VoxeLibre#4330
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-05-26 16:29:27 +00:00
the-real-herowl 18571d072c Further documentation fixes (#4329)
All related to the rename. Also updated a script used while releasing.

Reviewed-on: VoxeLibre/VoxeLibre#4329
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-05-26 15:50:05 +00:00
the-real-herowl cae554bc2b Defensive checks (#4328)
Fixes rare crashes related to some effects

Reviewed-on: VoxeLibre/VoxeLibre#4328
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-05-26 15:32:41 +00:00
teknomunk 8feecf2492 Fix crashes with raids and bad omen effect (#4326)
Reviewed-on: VoxeLibre/VoxeLibre#4326
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-26 15:21:43 +00:00
Mikita Wiśniewski 68e5c19df4 Add new `supported_node_facedir` group and apply it to item frames (#4291)
This change should fix item frames not placing on chests and similar blocks

Reviewed-on: VoxeLibre/VoxeLibre#4291
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-05-26 15:21:14 +00:00
the-real-herowl 54957e6191 Merge pull request 'Update French README' (#4323) from syl/VoxeLibre:readme into master 2024-05-26 17:06:26 +02:00
syl 48482521ca Update French README 2024-05-26 17:05:17 +02:00
syl d086bc5176 Mangrove: Missing upper case (#4324)
Reviewed-on: VoxeLibre/VoxeLibre#4324
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: syl <syl@gresille.org>
Co-committed-by: syl <syl@gresille.org>
2024-05-25 14:42:50 +00:00
the-real-herowl 2bd24120e9 Stalker texture building fix (#4322)
Added a defensive check for stalker texture building.

Reviewed-on: VoxeLibre/VoxeLibre#4322
2024-05-25 11:57:05 +00:00
syl 4d7060cddd French translation for potions (#4321)
Reviewed-on: VoxeLibre/VoxeLibre#4321
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: syl <syl@gresille.org>
Co-committed-by: syl <syl@gresille.org>
2024-05-25 11:18:37 +00:00
Nicu f119259e67 Updated the sleeping formspec for a better look (#4319)
This PR deals with the UI side of #3645 - no logic was changed to prevent the spam related to the `zzZ` button.

The chatbox now only shows in multiplayer, where it belongs. The buttons have also been resized and moved into positions that make them look nicer.

Reviewed-on: VoxeLibre/VoxeLibre#4319
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Nicu <kneekoo@noreply.git.minetest.land>
Co-committed-by: Nicu <kneekoo@noreply.git.minetest.land>
2024-05-24 20:35:13 +00:00
teknomunk 0a14a74860 Fix crash when converting endermen to rovers (#4318)
Fixes a crash that occurs when automatically converting endermen to rovers.

Reviewed-on: VoxeLibre/VoxeLibre#4318
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-24 10:32:19 +00:00
the-real-herowl cb4396d424 Fix stonecutter warnings (#4315)
This fixes faulty fallthrough mechanisms attempting to register the same recipe more than once in some cases. This fixes the warning spam when entering a world, while keeping the warnings for mods that misuse the Stonecutter API.

Reviewed-on: VoxeLibre/VoxeLibre#4315
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-05-24 10:31:27 +00:00
the-real-herowl a499d292f8 Finish renames (#4314)
Fix crash caused by unfinished renaming in #4282

Reviewed-on: VoxeLibre/VoxeLibre#4314
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-05-22 19:18:10 +00:00
the-real-herowl 52d5ec4248 Merge pull request 'Potions API redo' (#4130) from potions_api_redo into master
Reviewed-on: VoxeLibre/VoxeLibre#4130
2024-05-22 19:05:19 +00:00
the-real-herowl 07fac026dd Added a darkness potion recipe 2024-05-22 21:03:43 +02:00
the-real-herowl 0c57469c6b Updated Polish translation 2024-05-22 21:03:43 +02:00
the-real-herowl 018814c362 Added a few mobitems
* one droppable from strays
* the rest will get their mobs in a later update
* added alternative ways to get the items
* added recipes for potions that use these items
2024-05-22 21:03:43 +02:00
the-real-herowl 496360a1c4 Updated Polish translation 2024-05-22 21:03:43 +02:00
the-real-herowl 191dd1b950 Update template.txt 2024-05-22 21:03:43 +02:00
the-real-herowl 551bc99517 Improved compat alias visual 2024-05-22 21:03:43 +02:00
the-real-herowl 651fb74be1 Fix a crash 2024-05-22 21:03:43 +02:00
the-real-herowl 664993ca75 Fixed mob drops not having proper description 2024-05-22 21:03:43 +02:00
the-real-herowl 7a4c1ceba5 Legacy potion conversion extended 2024-05-22 21:03:43 +02:00
the-real-herowl dbea863553 Legacy potions converter 2024-05-22 21:03:43 +02:00
the-real-herowl d306260c7e Guardian fixes 2024-05-22 21:03:43 +02:00
the-real-herowl cafa36d0b4 Add more sus stew effects 2024-05-22 21:03:43 +02:00
the-real-herowl 747bf16a94 Migrated mobs to the new effects API 2024-05-22 21:03:43 +02:00
the-real-herowl 55ce6f0f4b Migrated beacons to the new API
Also added more effects to them
2024-05-22 21:03:43 +02:00
the-real-herowl e36b7f413b Strays now use frost arrows 2024-05-22 21:03:43 +02:00
the-real-herowl dc7b1869b7 Move most of the game to the new API 2024-05-22 21:03:43 +02:00
the-real-herowl bdaff930e0 Documentation update 2024-05-22 21:03:43 +02:00
the-real-herowl a039e056a5 Support delayed drinking with new potions API 2024-05-22 21:03:43 +02:00
the-real-herowl 53d640028e Added effect stacking option to the potions API
Also:
* Frost and Food Poisoning potion now stack their effects
* fixed a crash related to tipped arrows
2024-05-22 21:03:43 +02:00
the-real-herowl 9e9507efeb Plant placement and drop fixes 2024-05-22 21:03:43 +02:00
the-real-herowl 63b2da7aa0 Added on_save_effect support for mobs 2024-05-22 21:03:43 +02:00
the-real-herowl e806d5f3ce Fixed effects still being handled after mob death 2024-05-22 21:03:43 +02:00
the-real-herowl 914e3c6c2a Effects persist on loads for mobs too 2024-05-22 21:03:43 +02:00
the-real-herowl a4eaaad1a9 Remove unused function in mcl_hunger 2024-05-22 21:03:43 +02:00
the-real-herowl 78ae5ddc26 Added some potion recipes
Also:
* changed the duration of saturation and food poisoning potions
* minor code changes
2024-05-22 21:03:43 +02:00
the-real-herowl 8f4d5d2e27 Added the ominous potion 2024-05-22 21:03:43 +02:00
the-real-herowl 70d8dfe558 Improved API mob support
* various API functions now work with mobs properly
* the following effects don't work with mobs at all:
  water breathing, dolphin's grace, leaping, swiftness,
  slowness, slow falling, night vision, darkness, frost,
  health boost, absorption, fire resistance, resistance,
  luck, bad luck, blindness, nausea, hunger, saturation,
  haste, fatigue, conduit power
* the following effects should work with mobs:
  invisibility, regeneration, poison, withering,
  strength, weakness, levitation, glowing
* the following effects have no effect on mobs
  (but can be applied with the API):
  bad omen, hero of the village
2024-05-22 21:03:38 +02:00
the-real-herowl 9b501bfa7e Allowed infinite effect duration 2024-05-22 21:02:25 +02:00
the-real-herowl 75e5ca8d49 Added the option to remove and clear effects...
...with the /effect command.
Also made the API for clearing effects more robust.
2024-05-22 21:02:25 +02:00
the-real-herowl dcbc9d2398 Allowed giving effect without particles
...both with API and the /effect command
2024-05-22 21:02:25 +02:00
the-real-herowl 7c2d74e983 Typos fixed 2024-05-22 21:02:25 +02:00
the-real-herowl 7c1f9805e2 Tooltip and color fixes 2024-05-22 21:02:25 +02:00
the-real-herowl b5367a77a7 Expanded brewing recipe API
Added recipes using thick or mundane potion
2024-05-22 21:02:25 +02:00
the-real-herowl 8cfe96a955 Added potions for new effects
* also added some new brewing recipes
2024-05-22 21:02:25 +02:00
the-real-herowl ced2741686 Added strength and weakness potions
Also fixed potent slowness potion level
Also fixed slowness and swiftness effect descriptions
2024-05-22 21:02:25 +02:00
the-real-herowl a9c2a89f16 New brewing recipes registering API
Also migrated all recipes to the new system
2024-05-22 21:02:25 +02:00
the-real-herowl c4bedb37e0 Brewing fully works with the new system 2024-05-22 21:02:25 +02:00
the-real-herowl f60f50041d Brewing somewhat works with the new API 2024-05-22 21:02:25 +02:00
the-real-herowl 09be413e3f Added glowing effect
Also added on_save_effect callback to run cleanup
2024-05-22 21:02:25 +02:00
the-real-herowl 7ae31790bf Fixed running on_end for effects that aren't ending 2024-05-22 21:02:25 +02:00
the-real-herowl 6dab6158b9 Reserve some more keywords in register_effect() 2024-05-22 21:02:25 +02:00
the-real-herowl 7cd0cfede8 Further (mcl_)luck functionality
* XP from mob breeding impacted by luck
* eye of ender explosion chance impacted by luck
* fishing loot impacted by luck
* melee critical damage impacted by luck
* also fixed 2 scripts marked as "executable"
2024-05-22 21:02:25 +02:00
the-real-herowl 42778a3a6d Made some random rolls affected by mcl_luck
* xp bottle
* bow and crossbow crits
* megacrits added for mcl_bows, achievable only by (mcl_)luck
2024-05-22 21:02:25 +02:00
the-real-herowl b28467d348 Added mcl_luck API
Luck and Bad Luck effects use the mcl_luck API now
The API is unused for now
2024-05-22 21:02:25 +02:00
the-real-herowl c503a5fb8c Added luck and bad luck effects
They're no-op for now
2024-05-22 21:02:25 +02:00
the-real-herowl bbe2964d48 Added some effect descriptions 2024-05-22 21:02:25 +02:00
the-real-herowl 5263740a80 Added conduit power 2024-05-22 21:02:25 +02:00
the-real-herowl ddbc7cd826 Haste and fatigue expanded and improved
* abstracted and refactored some parts of haste and fatigue
* added and exposed new mcl_potions API functions
* fixed haste and fatigue not altering the hand
* mcl_meshhand now calls into mcl_potions when resetting the hand
2024-05-22 21:02:25 +02:00
the-real-herowl 6d7fe91047 Capped fatigue effect on punching
This fixes a crash, too
Also updates toolcaps on gamemode change
2024-05-22 21:02:25 +02:00
the-real-herowl 0c4094596e Improved haste and fatigue effects
* fixed a few crashes related to unusual effect levels
* added haste and fatigue combat functionality
* added some cleanup to avoid hangover unstackable items
* capped the slowdown from fatigue at 5 minutes digging time
* (despite the above, if a tool has a longer time set in definition,
	that still works)
* removed an unused "global" variable
2024-05-22 21:02:25 +02:00
the-real-herowl 1ac81e440c Added haste and fatigue 2024-05-22 21:02:25 +02:00
the-real-herowl bf82241e82 Added dolphin's grace 2024-05-22 21:02:25 +02:00
the-real-herowl 456d205161 Added strength and weakness effects
* also highest effect level displayed in HUD set to 3000
* also improved indicating effects with strange factors in HUD
2024-05-22 21:02:25 +02:00
the-real-herowl 0e33947258 Renamed some functions and variables
* changed names referring to player where it does support mobs
* also added an is_player() check in one function
2024-05-22 21:02:25 +02:00
the-real-herowl 03c73b7820 Improved descriptions 2024-05-22 21:02:25 +02:00
the-real-herowl e039642446 Improved nausea 2024-05-22 21:02:25 +02:00
the-real-herowl b6484a6d15 Added time_override to FOV API
time_override can be used when applying or removing modifiers
2024-05-22 21:02:25 +02:00
the-real-herowl 394b090c83 Improved the darkness effect 2024-05-22 21:02:25 +02:00
the-real-herowl 65b923c43c Added darkness 2024-05-22 21:02:25 +02:00
the-real-herowl aa4ff1827d Added nausea 2024-05-22 21:02:25 +02:00
the-real-herowl 92a77a7dbb Fixed graphical features of some effects
* loading fixed (by adding on_load)
* absorption bar never reaching end fixed
2024-05-22 21:02:25 +02:00
the-real-herowl 31adc45da9 Added blindness effect
(also improved TT descriptions of some effects)
2024-05-22 21:02:25 +02:00
the-real-herowl 5610fa1c4b Added frost effect 2024-05-22 21:02:25 +02:00
the-real-herowl 3f5cea3046 Added HP hudbar look modifier API
(for now in mcl_potions)
2024-05-22 21:02:25 +02:00
the-real-herowl a8054e8112 Add hero of the village effect 2024-05-22 21:02:25 +02:00
the-real-herowl 007500613a Added food poisoning and saturation effects 2024-05-22 21:02:24 +02:00
the-real-herowl fce73ab2bf Added some missing effects and improved API
* added a way to have a damage modifier relying on type instead of flag
* added Slow Falling
* added Levitation
* added Health Boost
* added Absorption
2024-05-22 21:02:24 +02:00
the-real-herowl 08942d3b25 Improved damage mods in effects, resistance effect 2024-05-22 21:02:24 +02:00
the-real-herowl 40580843d5 New effect icons 2024-05-22 21:02:24 +02:00
the-real-herowl a6c9bc8a01 Improved effects HUD and fixes
* Fixed some effects not being replaced correctly with higher levels
* Implemented an old FIXME (MTE 5.3.0 fixed underlying bug)
* Added a way to obtain an approximate level of effect from factor
* Added effect level to HUD under the icon
* Added effect timer to HUD under the icon
2024-05-22 21:02:24 +02:00
the-real-herowl 209299b791 Improved /effect command return messages
Also improved the name of a variable
2024-05-22 21:02:24 +02:00
the-real-herowl b84d36b3ff Registered dragon breath and pruned code
* removed old registration code
* added to the API the `nocreative` field
* registered the bottled dragon's breath as an item
2024-05-22 21:02:24 +02:00
the-real-herowl eac63f93d5 Re-registered potions under new API 2024-05-22 21:02:24 +02:00
the-real-herowl 3663a62374 Added a constant to the API 2024-05-22 21:02:24 +02:00
the-real-herowl a429a462cd Fixed tipped arrow descriptions 2024-05-22 21:02:24 +02:00
the-real-herowl 5a7a533bf6 Added missing effect descriptions 2024-05-22 21:02:24 +02:00
the-real-herowl 0b1cc6ad57 Fixed splash and lingering potions
* descriptions
* scaling
2024-05-22 21:02:24 +02:00
the-real-herowl 93572d71f2 Added support for varied descriptions 2024-05-22 21:02:24 +02:00
the-real-herowl 7d3e2d3dbc Implemented missing potion registering functionality
* improved support for custom (non-status) effects
* added support for splash potions
* added support for lingering potions
* added support for tipped arrows
* removed the old registration
2024-05-22 21:02:24 +02:00
the-real-herowl 83530b4298 Improved potion descriptions
* added support for effect descriptions
* added descriptions for some effects
* fixed a crash
2024-05-22 21:02:24 +02:00
the-real-herowl dc35f43bfa Potions registering API fully works with creative 2024-05-22 21:02:24 +02:00
the-real-herowl a8fcae0f51 Fixed variable definitions ("undeclared global") 2024-05-22 21:02:24 +02:00
the-real-herowl 6d927ab1a1 Creative inventory using new potions API
-creative inventory utilizes the new potions API
-the new fancy tooltips are used there
2024-05-22 21:02:24 +02:00
the-real-herowl ef2ce7e0d7 Added new potion tooltip handling
-potion tooltips are now utilizing the power of the new API
-potion names change based on metadata
-nothing triggers loading the new tooltips beyond the names for now
2024-05-22 21:02:24 +02:00
the-real-herowl 9383b903ef Added new potions registering API
-added comprehensive potions registering API
-new API registers only drinkable potions for now
-new API is compatible with very complex tooltips
-new API can have multiple effects per potion
-no hardcoding for specific potions in the new API
2024-05-22 21:02:24 +02:00
the-real-herowl f1e9c3b563 Translatable effect names and cleanup
-added translatable effect names to the API
-made /effect utilize those descriptions
-cleaned up variables/constants to go with further API changes
2024-05-22 21:02:24 +02:00
the-real-herowl d85e582e8c Arabic-to-Roman converter redo
-rewrote the Arabic-to-Roman number converter
-moved it to mcl_util
2024-05-22 21:02:24 +02:00
the-real-herowl 5827a7638d Reimplemented /effect heal and fixed bugs
-heal subcommand to the /effect reimplemented
-healing_func() from old API standardized, included in new API
-(the last point is due to it being substantially different from others)
-fixed a few bugs, potential crashes
-fixed incorrect withering effect progression
-standardized variable naming
2024-05-22 21:02:24 +02:00
the-real-herowl d1ca0f23f0 Resolved merge conflict 2024-05-22 21:02:24 +02:00
the-real-herowl 5750284e8f Improved /effect command and fixes
-improved the /effect command, allowing to use effect levels
-fixed a bug in level-to-factor conversions
-renamed effect icons to follow the new convention
2024-05-22 21:02:24 +02:00
the-real-herowl 8477d13c79 General effects API overhaul
- added a `register_effect()` function
- added the withering effect
- registered all the old effects under the new API
- unified effect names
- updated the main effect checker to use the new API
- changed some hardcoded values to support the unified effect naming
- added new namespaced metadata effects strings
- added support for legacy effect player metadata
- potions are still using the old effects API
- added glue between old API calls and the new API
- renamed the effect icons to support the unified effect naming
2024-05-22 21:02:24 +02:00
the-real-herowl 753545d714 Merge pull request 'Rover and Stalker' (#4282) from rover_stalker into master
Reviewed-on: VoxeLibre/VoxeLibre#4282
2024-05-22 19:01:14 +00:00
the-real-herowl 48e6ffa935 Improved tool tooltips (#4306)
Co-authored-by: Araca <araca.prod@gmail.com>
Reviewed-on: VoxeLibre/VoxeLibre#4306
2024-05-22 18:55:07 +00:00
teknomunk bbc20d5f06 Fix undefined global warning when using milk bucket (#4287)
Fix undeclared global variable warning when drinking milk and additional code cleanup.

Reviewed-on: VoxeLibre/VoxeLibre#4287
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-22 18:45:18 +00:00
the-real-herowl 221800a4be Merge pull request 'Add overhead mob spawning via spherical spawn volume' (#4220) from teknomunk/MineClone2:spherical-farm-spawning into master
Reviewed-on: VoxeLibre/VoxeLibre#4220
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-05-22 18:40:54 +00:00
teknomunk 0279dde3d0 Limit check to +/- 16 nodes from goal position (maximum 33 nodes, 3 map blocks) 2024-05-22 15:25:38 +00:00
teknomunk 2a014ca79c Change y range calculation to use outer zone distance and not middle to let mobs spawn far away from the player 2024-05-22 15:25:38 +00:00
teknomunk 1bc0a0b411 Implement a continuous distribution function using a piecewise linear function for selecting the distance from the player to spawn mobs with, fix crash when no nodes are found under air at the goal position 2024-05-22 15:25:38 +00:00
teknomunk bd6c8d35c3 Change y_min/y_max calculations 2024-05-22 15:25:38 +00:00
teknomunk 3850fc1a9f Limit y range to the same hemisphere (top/bottom) 2024-05-22 15:25:38 +00:00
teknomunk 74cf14ef0f Close if statement 2024-05-22 15:25:38 +00:00
teknomunk 3a4a8799ea Change mob spawning randomization from polar coordinates to spherical coordinates, move position validation code from find_spawning_position to get_next_mob_spawn_pos, minimize code remaining in find_spawning_position 2024-05-22 15:25:38 +00:00
the-real-herowl a3f6bc1a6f Rename the files 2024-05-22 14:26:18 +02:00
the-real-herowl 691ba9f5b3 Merge pull request 'Documentation update, mostly rename of the game' (#4236) from doc_update into master
Reviewed-on: VoxeLibre/VoxeLibre#4236
2024-05-22 05:26:10 +00:00
Nicu a1a74a2072 Add the world seed to the startup logging (#4295)
In multiplayer, only the server logs this information - the client has no access to it.

Reviewed-on: VoxeLibre/VoxeLibre#4295
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Nicu <kneekoo@noreply.git.minetest.land>
Co-committed-by: Nicu <kneekoo@noreply.git.minetest.land>
2024-05-22 05:23:43 +00:00
Wbjitscool cd66dc28a4 Cherry blossom particles improvement (#4258)
Co-authored-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Reviewed-on: VoxeLibre/VoxeLibre#4258
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Wbjitscool <dwsda121@gmail.com>
Co-committed-by: Wbjitscool <dwsda121@gmail.com>
2024-05-22 05:18:27 +00:00
qoheniac ff4fd24c42 fix typo in German translation (#4308)
Reviewed-on: VoxeLibre/VoxeLibre#4308
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: qoheniac <kalhoefer@protonmail.com>
Co-committed-by: qoheniac <kalhoefer@protonmail.com>
2024-05-20 17:10:24 +00:00
the-real-herowl 841f68ad13 Merge pull request 'Improve blocks translation in French' (#4307) from syl/VoxeLibre:master into master
Reviewed-on: VoxeLibre/VoxeLibre#4307
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-05-19 14:03:47 +00:00
syl 157cf695fc Improve blocks translation in French 2024-05-19 15:10:04 +02:00
the-real-herowl 51eb62f771 Updated release process 2024-05-19 04:01:47 +02:00
the-real-herowl f2c19946ab Small contributing guidelines update 2024-05-19 03:14:40 +02:00
the-real-herowl d22d26b971 New stalker head texture 2024-05-19 03:03:11 +02:00
the-real-herowl af13bd0635 Stalker may be overloaded, but never charged 2024-05-19 02:49:40 +02:00
the-real-herowl 3cf21b3559 Some more corrections 2024-05-19 02:33:21 +02:00
the-real-herowl 4353f0dd99 Updated contributing guidelines 2024-05-19 01:34:43 +02:00
the-real-herowl 1c9594ae27 Updated HOW_TO_PLAY.md 2024-05-19 00:21:16 +02:00
the-real-herowl 18af03b99c Animated charged stalker aura 2024-05-12 07:14:28 +02:00
the-real-herowl 22b6c25458 Convert old mob to the new stalker 2024-05-12 06:47:00 +02:00
the-real-herowl 0dcf38094c Stalker rename (partial) 2024-05-12 06:21:37 +02:00
the-real-herowl 970f6cf377 Stalker model and mechanics implemented 2024-05-12 06:02:15 +02:00
teknomunk 0003c1888d Update Lemmy and Reddit links 2024-05-07 10:58:04 +00:00
teknomunk 412aae9a58 Change VoxeLibre2 to VoxeLibre 2024-05-07 11:38:00 +00:00
teknomunk 98eed36938 Update matrix link, update git link in source code and one module README that has a link to git 2024-05-07 11:38:00 +00:00
Mikita Wiśniewski a23a57c62d Update issue templates 2024-05-07 11:38:00 +00:00
teknomunk 5f6a9f3a0c Update more documentation to use VoxeLibre 2024-05-07 11:38:00 +00:00
teknomunk b37e9818b7 Update API documentation to match updated game name 2024-05-07 11:38:00 +00:00
teknomunk aabd80d54b Change MineClone 2 to VoxeLibre 2024-05-07 11:38:00 +00:00
the-real-herowl 3b202eab34 Another portion of name updates 2024-05-07 11:38:00 +00:00
the-real-herowl ebd9be84fd Update mcl_item_id 2024-05-07 11:38:00 +00:00
the-real-herowl cd8d82aa60 Update credits screen 2024-05-07 11:38:00 +00:00
the-real-herowl 71c0d493ed Update ver_info 2024-05-07 11:38:00 +00:00
the-real-herowl 4b83aaaa77 Renaming throughout docs and comments 2024-05-07 11:38:00 +00:00
the-real-herowl 4264606609 Optipng the header images 2024-05-07 11:38:00 +00:00
the-real-herowl fdb0549d32 Changed the main menu header and icon 2024-05-07 11:38:00 +00:00
the-real-herowl b86c2e338a Documentation update, mostly rename of the game 2024-05-07 11:38:00 +00:00
the-real-herowl d826a587da Compatibility conversion 2024-05-05 22:55:25 +02:00
teknomunk d2a49799ae Change over internal name so that /spawn_mob works 2024-05-05 16:22:19 +00:00
the-real-herowl a36c6481cb Going on with renaming the mob 2024-05-05 21:12:37 +02:00
the-real-herowl fbeb977441 Optimized the new textures 2024-05-05 19:10:18 +00:00
the-real-herowl 1219b09851 Migrated enderman to the new visuals
Also made the node holding use vl_held_item
2024-05-05 19:10:18 +00:00
the-real-herowl b9ec1a4611 Complete migration to vl_held_item 2024-05-05 19:10:18 +00:00
the-real-herowl 25321a5ac7 Move vl_node_entity to vl_held_item 2024-05-05 19:10:18 +00:00
teknomunk 2fc283a42a Create node entity 2024-05-05 19:10:18 +00:00
Mikita Wiśniewski 3b1c55c234 Remove garbage pixels from sweet berry textures (#4281)
Reviewed-on: MineClone2/MineClone2#4281
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-05-05 16:07:47 +00:00
Mikita Wiśniewski 0ef81681ba Make item frames attached to the block they're placed on (fixes #3736) (#4279)
Reviewed-on: MineClone2/MineClone2#4279
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-05-04 11:43:54 +00:00
the-real-herowl efc6ab0bbf Merge pull request 'Hollow logs fixes' (#4268) from hollow_logs into master
Reviewed-on: MineClone2/MineClone2#4268
2024-05-04 10:08:17 +00:00
Bram van den Heuvel 69acc5074b Fix dungeon margin bug (#4276)
Some mapgen settings used to crash the game.

Reviewed-on: MineClone2/MineClone2#4276
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: Bram van den Heuvel <bram.vdh1999@gmail.com>
Co-committed-by: Bram van den Heuvel <bram.vdh1999@gmail.com>
2024-05-03 14:05:51 +00:00
the-real-herowl 7d999535e7 Merge pull request 'Ghast fixes' (#4277) from ghast_fixes into master
Reviewed-on: MineClone2/MineClone2#4277
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-05-03 12:57:32 +00:00
teknomunk 81ca224bb8 Add wear to shears used to harvest comb from a beehive (#4251)
Reviewed-on: MineClone2/MineClone2#4251
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-02 11:52:47 +00:00
nixnoxus 3975449ad2 fix mcl_beds: ignore players in other dimensions than overwold (#4257)
beds ignore players in other dimensions than "overworld" (because players can only sleep in the "overworld")

Reviewed-on: MineClone2/MineClone2#4257
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: nixnoxus <nixnoxus@web.de>
Co-committed-by: nixnoxus <nixnoxus@web.de>
2024-05-02 03:13:27 +00:00
teknomunk 6756658ee9 Fix server crash when server restarts after a player dies but they didn't respawn (#4246)
Ensuring that tables storing player data are initialized before being used.

Reviewed-on: MineClone2/MineClone2#4246
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-02 03:01:43 +00:00
the-real-herowl 4dde321a04 Ghast fireball fixes 2024-05-02 00:18:43 +02:00
Araca cd0509c2e6 Fix crash with ghast achievement fireball_redir_serv (#4179)
Reviewed-on: MineClone2/MineClone2#4179
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: Araca <araca.prod@gmail.com>
Co-committed-by: Araca <araca.prod@gmail.com>
2024-05-01 22:15:56 +00:00
the-real-herowl cc1e01ad78 Made API actually work for outside the mod 2024-05-01 21:59:10 +02:00
the-real-herowl b9428e3438 Definition validation improved 2024-05-01 21:50:05 +02:00
teknomunk 0c372f987d Stop villagers from eating shulker boxes (#4266)
This modifies the logic for mobs picking up items to only match against the item's name and ignore any text in an items metadata.

Reviewed-on: MineClone2/MineClone2#4266
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-05-01 15:44:14 +00:00
Bakawun 22c4daab22 fix walking and running animation for horse donkey and mule (#4053)
no more gliding horses

Co-authored-by: bakawun <bakawun@getnada.com>
Reviewed-on: MineClone2/MineClone2#4053
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: Bakawun <bakawun@noreply.git.minetest.land>
Co-committed-by: Bakawun <bakawun@noreply.git.minetest.land>
2024-05-01 15:40:57 +00:00
nixnoxus 760fe1aa68 more items usable to smelt (#4184)
- group:bee_nest
- group:beehive
- mcl_cartography_table:cartography_table
- mcl_core:deadbush
- mcl_fletching_table:fletching_table
- mcl_lectern:lectern
- mcl_loom:loom
- mcl_mangrove:mangrove_roots
- mcl_smithing_table:table

Reviewed-on: MineClone2/MineClone2#4184
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: nixnoxus <nixnoxus@web.de>
Co-committed-by: nixnoxus <nixnoxus@web.de>
2024-04-30 14:26:10 +00:00
Eliy21 f78ad93fd3 Make destroying boats with punch easier (#4159)
Reviewed-on: MineClone2/MineClone2#4159
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: Eliy21 <eliy21@noreply.git.minetest.land>
Co-committed-by: Eliy21 <eliy21@noreply.git.minetest.land>
2024-04-30 14:24:24 +00:00
the-real-herowl d321b166ea Merge pull request 'trading gives the player experience' (#4210) from nixnoxus/MineClone2:add-trading-xp into master
Reviewed-on: MineClone2/MineClone2#4210
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-04-30 10:47:17 +00:00
JoseDouglas26 18342e44c8 Change lectern wdir check to allow placement on node sides (#4263)
Reviewed-on: MineClone2/MineClone2#4263
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-04-30 10:45:00 +00:00
JoseDouglas26 2430953a81 Set use_texture_alpha for some nodes (#4262)
* Tall flowers with mesh drawtype (sunflower)
* Clovers
* End rod and its colored variants

Reviewed-on: MineClone2/MineClone2#4262
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-04-30 10:41:23 +00:00
the-real-herowl a25e2b8eb3 Spaces to tabs 2024-04-30 03:55:17 +02:00
the-real-herowl ee2998e21b Replaced early returns with error calls 2024-04-30 03:53:49 +02:00
the-real-herowl e0aadc7996 Updated the textures to the new UV map
Also added explicit use_texture_alpha = "clip"
2024-04-30 03:49:38 +02:00
the-real-herowl 9f65c5efb7 New hollow log model (optimized + UV map improved) 2024-04-30 02:56:13 +02:00
the-real-herowl 7ad4ca2dbe Spaces to tabs 2024-04-30 02:29:12 +02:00
JoseDouglas26 1161d5cd36 Hollow logs (#4267)
Reviewed-on: MineClone2/MineClone2#4267
Co-authored-by: JoseDouglas26 <josedouglas20002014@gmail.com>
Co-committed-by: JoseDouglas26 <josedouglas20002014@gmail.com>
2024-04-30 00:24:12 +00:00
SmokeyDope 538c206985 Remove stray pixels in leather cap texture (#4256)
Reviewed-on: MineClone2/MineClone2#4256
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: SmokeyDope <smokey@tilde.team>
Co-committed-by: SmokeyDope <smokey@tilde.team>
2024-04-29 16:14:46 +00:00
Doods 31facbd902 Texture converter add signs (#4238)
Reviewed-on: MineClone2/MineClone2#4238
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Doods <yusufalishabaka@tutanota.com>
Co-committed-by: Doods <yusufalishabaka@tutanota.com>
2024-04-29 15:50:32 +00:00
the-real-herowl 5f70189e08 Don't touch description if tt snippets did nothing (#4264)
This should prevent problems like the ones described in MineClone2/MineClone2#4196 (comment) or MineClone2/MineClone2#4130 (comment)

Reviewed-on: MineClone2/MineClone2#4264
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-04-28 15:04:39 +00:00
the-real-herowl 4e12c6747c Merge pull request 'Fix #4189 - Make hoppers move items if there is space for one item' (#4190) from teknomunk/MineClone2:hopper-changes into master
Reviewed-on: MineClone2/MineClone2#4190
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-27 13:51:34 +00:00
the-real-herowl 1d8fc7abac Merge pull request 'Bed Fixes' (#4253) from teknomunk/MineClone2:bed-fixes into master
Reviewed-on: MineClone2/MineClone2#4253
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-27 12:35:14 +00:00
teknomunk 09c595c363 Fix two hopper clocks 2024-04-27 08:41:09 +00:00
teknomunk 6fbe60f1ac Fix crash with undefined nodes 2024-04-27 08:41:09 +00:00
teknomunk 3705be24d7 Fix 'Undeclared global variable' warning 2024-04-27 08:41:09 +00:00
teknomunk 681075df5a Correct null -> nil 2024-04-27 08:41:09 +00:00
teknomunk 6ecb304946 make hoppers behave the same say regardless of the order the server processes the nodes by following a chain of hoppers to the end and processing back to the starting node and marking all those nodes as processed 2024-04-27 08:41:09 +00:00
teknomunk 034b0142c6 Make sure the inventory slot has at least the number of items requsted in it before selecting it 2024-04-27 08:41:09 +00:00
teknomunk e02d1c0e27 Update to comply with coding guidelines 2024-04-27 08:41:09 +00:00
teknomunk bdcd89e1bf Modify mcl_util.select_stack to allow specifying the number of items that will be moved, modify hopper on_try_push functions to specify only 1 item will be moved at a time, general cleanup of touched code (reduce indent - 1 place, break filter functions out of function call parameter - 4 places) 2024-04-27 08:41:09 +00:00
teknomunk 62ab68637a Stop beds from dropping as items when players in creative mode dig them 2024-04-27 07:17:24 +00:00
teknomunk 0839f35a12 Add additional bed placing attempts 2024-04-27 10:42:20 +00:00
teknomunk 84d6b593b2 Fix bed duplication bug when destroyed by TNT 2024-04-27 10:42:20 +00:00
the-real-herowl 3bcbb99878 Merge pull request 'The Pull Request that Fixed the Creative Inventory' (#4237) from creative_inv_fixes into master
Reviewed-on: MineClone2/MineClone2#4237
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-27 06:19:11 +00:00
the-real-herowl 9e8661ae95 Merge pull request 'Added eating animation' (#4169) from eating_animation into master
Reviewed-on: MineClone2/MineClone2#4169
2024-04-22 01:18:11 +00:00
SOS-Games 4f37c1600f Able to see all mobs in the lookup help menu (#4186)
added a Mobs category that has pages for all mobs

Co-authored-by: SOS-Games <101518564+SOS-Games@users.noreply.github.com>
Reviewed-on: MineClone2/MineClone2#4186
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: SOS-Games <gruberscomplete@gmail.com>
Co-committed-by: SOS-Games <gruberscomplete@gmail.com>
2024-04-21 08:16:15 +00:00
Doods bd4337a2dc Make Editorconfig compliant with the spec. (#4245)
Reviewed-on: MineClone2/MineClone2#4245
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Doods <yusufalishabaka@tutanota.com>
Co-committed-by: Doods <yusufalishabaka@tutanota.com>
2024-04-20 15:23:59 +00:00
MysticTempest 57409973b9 Fix creative inv tabs showing item tooltips. 2024-04-17 16:53:59 +07:00
Mikita Wiśniewski 312ad5b63b Fix creative inventory search not working on Android (fixes #3402) 2024-04-17 16:53:59 +07:00
Mikita Wiśniewski 46ed6a6dda Fix switching items in the creative inventory (fixes #3941) 2024-04-17 16:53:59 +07:00
the-real-herowl 0f20e18e53 Merge pull request 'fix_xp_reload_bug' (#4226) from teknomunk/MineClone2:fix_xp_reload_bug into master
Reviewed-on: MineClone2/MineClone2#4226
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-14 07:10:33 +00:00
the-real-herowl 69d3fa5f85 Merge pull request 'Added a check for the bone meal's applied position.' (#4201) from CyberMango/MineClone2:dev/mango/add_bone_meal_protection_check into master
Reviewed-on: MineClone2/MineClone2#4201
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-14 07:07:21 +00:00
the-real-herowl 5e673b8fee Merge pull request 'Add partial item stack pickup' (#4193) from teknomunk/MineClone2:grouped-item-pickup into master
Reviewed-on: MineClone2/MineClone2#4193
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-14 06:53:37 +00:00
Araca 596c56d31f Add possibility to edit a sign (#4188)
We can edit a sign by right-clicking in it. If in hand you have a color or a glow ink, the behaviour didn't change. Also some refactorization.

Reviewed-on: MineClone2/MineClone2#4188
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Araca <araca.prod@gmail.com>
Co-committed-by: Araca <araca.prod@gmail.com>
2024-04-14 06:50:19 +00:00
the-real-herowl e582c3bb97 Improved look on the mobile device
Now the food doesn't cover the full screen on mobile devices...
...at the cost of stretching at ultrawide or portrait aspect ratios.
2024-04-14 08:34:41 +02:00
the-real-herowl b5b8d4f336 Merge pull request 'more piglin bartering items (and drop stack instead of single items)' (#4181) from nixnoxus/MineClone2:piglin-bartering into master
Reviewed-on: MineClone2/MineClone2#4181
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-04-14 00:01:13 +00:00
Doods c1971b662a Fireproof certain wood nodes & add planks crafting recipes (#4166)
* Make Crimson and Warped Planks, Double Slab Planks, Fences, Fence Gates, Doors, Trapdoors, Pressure Plates, Wood, Bark, Stripped Wood, Stripped Bark, and Stairs Immune to fire by removing them from the 'flammable', 'fire_encouragement', and 'fire_flammability' groups.
* Add crafting recipes which allow Cherry, Mangrove, Crimson, and Warped planks to be crafted from Wood, Bark, Stripped Wood, and Stripped Bark variants, to make them consistent with with all other planks.

Reviewed-on: MineClone2/MineClone2#4166
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Doods <yusufalishabaka@tutanota.com>
Co-committed-by: Doods <yusufalishabaka@tutanota.com>
2024-04-13 23:52:46 +00:00
nixnoxus a86e8e2c8e fix strider breeding & increase riding speed (#4096)
- Striders follow `mcl_crimson:warped_fungus`
- Striders can be bred with `mcl_crimson:warped_fungus`
- Riding speed increased to 2 m/s
- Warning fixed

Reviewed-on: MineClone2/MineClone2#4096
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: nixnoxus <nixnoxus@web.de>
Co-committed-by: nixnoxus <nixnoxus@web.de>
2024-04-13 23:38:46 +00:00
Doods a3db7bd504 Fix texture converter for sandstone (#4233)
Reviewed-on: MineClone2/MineClone2#4233
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Doods <yusufalishabaka@tutanota.com>
Co-committed-by: Doods <yusufalishabaka@tutanota.com>
2024-04-08 19:02:43 +00:00
ancientmarinerdev ac4aff12ea Enable custom biome check in spawning. This allows mods to overide the check in singlenode and other mapgens that do not support biome API. (#4217)
Some older mapgens do not support the MT biome API. Singlenode and I think v6 also. This allows mods to overide the biomecheck in mob spawning to return valid biomenames and customise this.

Reviewed-on: MineClone2/MineClone2#4217
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: ancientmarinerdev <ancientmariner_dev@proton.me>
Co-committed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
2024-04-01 15:40:14 +00:00
emptyshore 003288bc80 Update comments in the nether portals script (#4227)
Co-authored-by: Mateusz Uzdowski <mateusz@silverstripe.com>
Reviewed-on: MineClone2/MineClone2#4227
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: emptyshore <emptyshore@noreply.git.minetest.land>
Co-committed-by: emptyshore <emptyshore@noreply.git.minetest.land>
2024-04-01 00:30:06 +00:00
teknomunk 13ce4f9092 Additional cleanup, impelemnt partial item stack pickup 2024-03-31 02:32:24 +00:00
teknomunk 0a294c55a1 Move object pickup code to try_object_pickup(...) and refactor to remove most indentation for readability 2024-03-31 02:32:24 +00:00
teknomunk 44bb07507d Cleanup comment, whitespace for readability 2024-03-31 02:28:46 +00:00
cora 3509b85a3e Fix possible crash due to engine bug reloading XP orbs 2024-03-31 02:28:46 +00:00
emptyshore 55653fe37b Nether portals rewrite (#4128)
See MineClone2/MineClone2#4120

Co-authored-by: Mateusz Uzdowski <mateusz@silverstripe.com>
Reviewed-on: MineClone2/MineClone2#4128
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: emptyshore <emptyshore@noreply.git.minetest.land>
Co-committed-by: emptyshore <emptyshore@noreply.git.minetest.land>
2024-03-31 02:20:23 +00:00
the-real-herowl 0170619866 Merge pull request 'Imported the tga_encoder as subtree' (#4222) from tga_encoder_update into master
Reviewed-on: MineClone2/MineClone2#4222
2024-03-27 00:31:39 +00:00
ancientmarinerdev 0b521ef92b Fix - New game load crashes. Add defensive check. (#4216)
Reviewed-on: MineClone2/MineClone2#4216
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: ancientmarinerdev <ancientmariner_dev@proton.me>
Co-committed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
2024-03-27 00:22:22 +00:00
nixnoxus 8931576c50 fix 'WARNING[Main]: Undeclared global variable ' in mcl_colorblocks (#4203)
fix WARNING: Undeclared global variable

Reviewed-on: MineClone2/MineClone2#4203
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: nixnoxus <nixnoxus@web.de>
Co-committed-by: nixnoxus <nixnoxus@web.de>
2024-03-27 00:20:12 +00:00
the-real-herowl c65176af81 Merge pull request 'Added clovers' (#4224) from clovers into master
Reviewed-on: MineClone2/MineClone2#4224
2024-03-27 00:15:32 +00:00
the-real-herowl a71a634168 Merge pull request 'Make end rods use a mesh model' (#4177) from end_rod_model into master
Reviewed-on: MineClone2/MineClone2#4177
2024-03-27 00:14:13 +00:00
the-real-herowl 89e8cf0213 Merge branch 'skeleton_sounds' 2024-03-24 06:38:35 +01:00
nixnoxus 08b41a3b39 accelerate non-moving carts on `mcl_minecarts:golden_rail_on` (#4097)
accelerate a non-moving minecart away from a solid opaque block the powered rail is facing

Reviewed-on: MineClone2/MineClone2#4097
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: nixnoxus <nixnoxus@web.de>
Co-committed-by: nixnoxus <nixnoxus@web.de>
2024-03-24 05:29:44 +00:00
the-real-herowl 26fc0cd4d8 Merge pull request 'update melon and pumpkin biomes' (#4037) from michaljmalinowski/MineClone2:master into master
Reviewed-on: MineClone2/MineClone2#4037
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2024-03-24 05:17:20 +00:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 e50ad7d6de Merge pull request 'Fix a crash with rocket explosion' (#4178) from fix_rocket_crash into master
Reviewed-on: MineClone2/MineClone2#4178
Reviewed-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land>
2024-03-21 00:15:50 +00:00
the-real-herowl 4b6d63739c Fix a crash with rocket explosion
Defensive check
2024-03-20 19:13:44 -05:00
the-real-herowl c6a112d200 Clovers now generate
Also added a way to alter flower rarity
2024-03-20 22:29:03 +01:00
the-real-herowl ade2a1a6a2 Add clovers and four-leaf clovers 2024-03-20 22:18:47 +01:00
the-real-herowl b04493dcb6 Add 'mods/CORE/tga_encoder/' from commit 'aad231f5e406a7c1eaafe6595a64b9c55f230692'
git-subtree-dir: mods/CORE/tga_encoder
git-subtree-mainline: a5740f8edf
git-subtree-split: aad231f5e4
2024-03-19 19:28:16 +01:00
the-real-herowl a5740f8edf Remove old tga_encoder 2024-03-19 19:27:12 +01:00
nixnoxus 9809c627dc trading gives the player experience 2024-03-09 15:06:38 +01:00
syl 21dbc25f13 Improve french translation (#4194)
Made a few improvements in the french translation.
Revert a change (oeil->œil) which make harder to search items by typing theirs names. Because "œ" is not in the AZERTY keyboard.

Reviewed-on: MineClone2/MineClone2#4194
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: syl <syl@gresille.org>
Co-committed-by: syl <syl@gresille.org>
2024-03-07 20:04:02 +00:00
CyberMango 4a22287eb6 Added a check for the bone meal's applied position.
protection the position above as well to prevent growing high grass on
areas in which you are not allowed to place blocks. Because, if you cant
place a block there, why should you be able to grow grass/flowers there?
2024-02-29 13:36:02 +02:00
nixnoxus 497f1dcd80 drop stack instead of items 2024-02-05 00:24:27 +01:00
nixnoxus 01cace413f update bartering items 2024-02-05 00:11:22 +01:00
the-real-herowl 8d5c9996a2 Centered the eating animation 2024-02-02 04:28:20 +01:00
the-real-herowl 1476c7ae59 Make end rods use a mesh model
* merged the 3 textures of the end rod into one
* made a proper image mask for the colored end rods
* (used to be hardcoded & didn't work for higher-res texture packs)
2024-02-02 02:31:57 +01:00
the-real-herowl 13825763b0 Added eating animation 2024-01-29 04:24:39 +01:00
bakawun 49aa32d2ee mobs:skeletons:sounds: fix code review issue and add todo 2024-01-08 09:16:05 +01:00
bakawun a786b66d9e mobs:skeletons: add sounds to skeleton
and stray, fix random sound for wither skeleton
2023-12-18 11:17:25 +01:00
michaljmalinowski 9be5de980e Update mods/MAPGEN/mcl_biomes/init.lua
update melon and pumpkin biomes
2023-11-28 20:26:24 +00:00
Nils Dagsson Moskopp aad231f5e4
Generate test textures with scanline order “top-bottom” 2023-10-16 21:40:51 +02:00
Nils Dagsson Moskopp 10022c93ef
Explicitly state scanline order in test texture script 2023-10-16 21:38:19 +02:00
Nils Dagsson Moskopp 01bcbbf927
Allow encoding with top-bottom scanline order 2023-10-16 21:15:40 +02:00
Nils Dagsson Moskopp 12a33e458f
Add hashbang to script to generate TGA test textures 2023-10-16 20:34:47 +02:00
Nils Dagsson Moskopp 5dcf714cd1
Partially slice 3D rendered donut along its polodial direction 2023-10-16 19:20:30 +02:00
Nils Dagsson Moskopp 0c6d9a4d85
Partially slice 3D rendered donut along its torodial direction 2023-10-16 19:16:29 +02:00
Nils Dagsson Moskopp ef65de54c0
Make 3D rendered donut appear solid 2023-10-16 19:05:56 +02:00
Nils Dagsson Moskopp 4d57ba62bf
Add code to generate TGA type 1 test textures 2023-10-15 20:49:11 +02:00
Nils Dagsson Moskopp 4064333b06
Adjust TGA test texture file names 2023-10-15 20:11:28 +02:00
Nils Dagsson Moskopp e87a8fc332
Add script to generate TGA test textures 2023-10-15 17:02:19 +02:00
Nils Dagsson Moskopp bb68ceb38d
Do not encode images with illegal colormap indexes 2023-09-22 20:06:21 +02:00
Nils Dagsson Moskopp 4dd3833f3b
Move encoding format heuristics from image:save() to image:encode() 2023-09-18 16:45:31 +02:00
Nils Dagsson Moskopp 3029147ed7
Add example code for rendering a 3D shape using a Z-buffer 2023-09-18 15:21:17 +02:00
Nils Dagsson Moskopp 5bf0e79c6f
Add example code to generate TGA logo
The tiny logo is a 12×12 TGA image.
The huge logo is a 1200×1200 TGA image.
2023-08-27 15:12:47 +02:00
Nils Dagsson Moskopp e9862f5f24
Add example code for node colormap generation 2022-07-31 00:24:34 +02:00
Nils Dagsson Moskopp 685bdcb379
Allow encoding with B8G8R8A8 colormap 2022-05-19 18:26:41 +02:00
Nils Dagsson Moskopp 7446a275b5
Remove author from mod.conf
ContentDB sets this field automatically
2022-05-16 22:18:01 +02:00
Nils Dagsson Moskopp 83348bf3ac
Document use cases, image type support, plans 2022-05-16 20:34:33 +02:00
Nils Dagsson Moskopp 45e405982a
Allow encoding with A1R5G5B5 colormap 2022-05-16 18:48:18 +02:00
Nils Dagsson Moskopp e83894fcfa
Treat empty colormap as no colormap 2022-05-16 17:56:53 +02:00
Nils Dagsson Moskopp 9f9b78eed9
Allow color-mapped encoding for RGB images 2022-05-16 17:28:16 +02:00
Nils Dagsson Moskopp ed061e68ff
Allow RLE encoding for RGBA images 2022-05-16 13:16:23 +02:00
Nils Dagsson Moskopp 1f9c446a98
Assert that pixel data is encoded 2022-05-16 03:21:52 +02:00
Nils Dagsson Moskopp 7b94fc026d
Allow to specify color format 2022-05-16 02:48:51 +02:00
Nils Dagsson Moskopp fa23775bf9
Measure pixel_depth in bits everywhere 2022-05-16 01:54:21 +02:00
Nils Dagsson Moskopp 36ee45ebe3
Add RGBA support (only RAW encoding) 2022-05-16 01:39:33 +02:00
Nils Dagsson Moskopp 2112637faf
Use HSP for RGB-to-BW8 conversion 2022-05-15 19:58:19 +02:00
Nils Dagsson Moskopp 5b79bc6fb7
Set default encoding to R8G8B8 RAW
This the most trivial RGB encoding the encoder supports. Setting
it prevents a crash related to BW8 only supporting RAW encoding.
2022-05-15 19:31:24 +02:00
Nils Dagsson Moskopp 759b0a188f
Allow saving R8G8B8 images as BW8 2022-05-15 19:23:26 +02:00
Nils Dagsson Moskopp 376b6404b2
Allow RAW or RLE encoding for true-color images 2022-05-15 15:56:18 +02:00
Nils Dagsson Moskopp 9bd1702d60
Encode image only when saving it to a file 2022-05-15 14:58:12 +02:00
Nils Dagsson Moskopp 5640e19c94
Add fractal example 2022-05-15 03:10:53 +02:00
Nils Dagsson Moskopp 25b7b30945
Allow encoding grayscale images as BW8 2022-05-14 22:41:52 +02:00
Nils Dagsson Moskopp 9af0719df8
Allow encoding RGB images as B8G8R8 2022-05-14 21:56:42 +02:00
Nils Dagsson Moskopp 1b48c3f539
Use raw packets in RLE compression in tga_encoder 2022-05-14 21:52:08 +02:00
Nils Dagsson Moskopp 13552f16f2
Reduce TGA filesize by 25% by using 16-bit colors 2022-05-14 21:52:07 +02:00
Nils Dagsson Moskopp 4f6ea5d035
Add credits to README 2022-05-14 21:52:07 +02:00
Nils Dagsson Moskopp c00b0d50c6
Add usage examples 2022-05-14 21:52:00 +02:00
Nils Dagsson Moskopp adb8e45d67
Fix TGA file writing on Windows
Before this patch, the tga_encoder mod would write corrupted TGA files
on Windows: Bytes that looked like newlines were replaced by a carriage
return and a newline.
2022-05-14 20:21:59 +02:00
Nils Dagsson Moskopp 3f60b5baa6
Speed up TGA encoding by creating fewer strings 2022-05-14 20:21:58 +02:00
Nils Dagsson Moskopp 52e5c955f0
Use RLE compression in tga_encoder 2022-05-14 20:21:58 +02:00
Lizzy Fleckenstein b88579b52e
Add updated tga_encoder 2022-05-14 20:21:58 +02:00
Lizzy Fleckenstein eaa4dc99d7
Initial import 2022-05-14 20:21:52 +02:00
718 changed files with 17065 additions and 10068 deletions

View File

@ -4,7 +4,7 @@ root = true
end_of_line = lf end_of_line = lf
[*.lua] [*.lua]
charset = utf8 charset = utf-8
indent_style = tab indent_style = tab
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true

View File

@ -13,18 +13,19 @@ labels:
Thanks for taking the time to fill out this bug report! Thanks for taking the time to fill out this bug report!
Please follow our contributing guidelines first: Please follow our contributing guidelines first:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
By submitting this issue, you agree to follow our Code of Conduct: By submitting this issue, you agree to follow our Code of Conduct:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CODE_OF_CONDUCT.md
--> -->
<!-- <!--
What version of MineClone2 are you using? We do not provide support for outdated versions of MineClone2. What version of VoxeLibre are you using? We do not provide support for outdated versions of VoxeLibre.
"/ver" command will output the version you're running.
Current latest version is listed here, at the top: Current latest version is listed here, at the top:
https://git.minetest.land/MineClone2/MineClone2/tags https://git.minetest.land/VoxeLibre/VoxeLibre/tags
--> -->
MineClone2 version: VoxeLibre version:
### What happened? ### What happened?
Report about the bug! Please send large log snippets as an attachement file. Report about the bug! Please send large log snippets as an attachement file.

View File

@ -1,7 +1,7 @@
--- ---
name: "Feature request" name: "Feature request"
about: "File a feature request not in Minecraft" about: "File a feature request"
labels: labels:
- "non-Minecraft feature" - "non-Minecraft feature"
@ -10,17 +10,17 @@ labels:
--- ---
<!-- <!--
Got a new non-Minecraft feature request? Explain to us why we should consider your idea. Got a new feature request? Explain to us why we should consider your idea.
Please follow our contributing guidelines first: Please follow our contributing guidelines first:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
By submitting this issue, you agree to follow our Code of Conduct: By submitting this issue, you agree to follow our Code of Conduct:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CODE_OF_CONDUCT.md
--> -->
### Feature ### Feature
Tell us about your requested feature not in Minecraft! Tell us about your requested feature!
### Why ### Why
Tell us why should we implement it! Tell us why should we implement it!

View File

@ -1,25 +0,0 @@
---
name: "Missing Feature request"
about: "File a missing feature request in Minecraft but not in MineClone2"
labels:
- "missing feature"
---
<!--
Thanks for taking the time to fill out this missing feature request!
Please follow our contributing guidelines first:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests
By submitting this issue, you agree to follow our Code of Conduct:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md
-->
### Current feature in Minecraft
Tell us about the feature currently in Minecraft! What is it like on Minecraft?
### Current feature in MineClone2
Tell us about the feature currently in MineClone2! What is different?

View File

@ -8,13 +8,13 @@ labels:
<!-- <!--
Please follow our contributing guidelines first: Please follow our contributing guidelines first:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#how-you-can-help-as-a-programmer https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CONTRIBUTING.md#how-you-can-help-as-a-programmer
By submitting this pull request, you agree to follow our Code of Conduct: By submitting this pull request, you agree to follow our Code of Conduct:
https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CODE_OF_CONDUCT.md
--> -->
Tell us about your pull request! Reference related issues, if necessary Tell us about your pull request! Reference related issues, if necessary.
### Testing ### Testing
Tell us how to test your changes! Tell us how to test your changes!

14
API.md
View File

@ -1,10 +1,10 @@
# API # API
## Groups ## Groups
MineClone 2 makes very extensive use of groups. Making sure your items and objects have the correct group memberships is very important. VoxeLibre makes very extensive use of groups. Making sure your items and objects have the correct group memberships is very important.
Groups are explained in `GROUPS.md`. Groups are explained in `GROUPS.md`.
## Mod naming convention ## Mod naming convention
Mods mods in MineClone 2 follow a simple naming convention: Mods with the prefix “`mcl_`” are specific to MineClone 2, although they may be based on an existing standalone. Mods which lack this prefix are *usually* verbatim copies of a standalone mod. Some modifications may still have been applied, but the APIs are held compatible. Mods mods in VoxeLibre follow a simple naming convention: Mods with the prefix "`vl_`" and “`mcl_`” are specific to VoxeLibre (formerly known as MineClone2), although they may be based on an existing standalone. Mods which lack this prefix are *usually* verbatim copies of a standalone mod. Some modifications may still have been applied, but the APIs are held compatible.
## Adding items ## Adding items
### Special fields ### Special fields
@ -31,7 +31,7 @@ All nodes can have these fields:
Use the `mcl_sounds` mod for the sounds. Use the `mcl_sounds` mod for the sounds.
## APIs ## APIs
A lot of things are possible by using one of the APIs in the mods. Note that not all APIs are documented yet, but it is planned. The following APIs should be more or less stable but keep in mind that MineClone 2 is still unfinished. All directory names are relative to `mods/` A lot of things are possible by using one of the APIs in the mods. Many of them are documented in `API.md` files located in the directories of the specific mods. Some use `.txt` files or have some documentation in the comments along the code. Note that not all APIs are documented yet, but it is planned. The following APIs should be more or less stable but keep in mind that VoxeLibre is still unfinished. All directory names are relative to `mods/`
### Items ### Items
* Doors: `ITEMS/mcl_doors` * Doors: `ITEMS/mcl_doors`
@ -46,8 +46,7 @@ A lot of things are possible by using one of the APIs in the mods. Note that not
### Mobs ### Mobs
* Mobs: `ENTITIES/mcl_mobs` * Mobs: `ENTITIES/mcl_mobs`
MineClone 2 uses its own mobs framework, called “Mobs Redo: MineClone 2 Edition” or “MRM” for short. VoxeLibre uses its own mobs framework, which is a fork of Mobs Redo [`mobs`] by TenPlus1.
This is a fork of Mobs Redo [`mobs`] by TenPlus1.
You can add your own mobs, spawn eggs and spawning rules with this mod. You can add your own mobs, spawn eggs and spawning rules with this mod.
API documnetation is included in `ENTITIES/mcl_mobs/api.txt`. API documnetation is included in `ENTITIES/mcl_mobs/api.txt`.
@ -55,7 +54,7 @@ API documnetation is included in `ENTITIES/mcl_mobs/api.txt`.
This mod includes modificiations from the original Mobs Redo. Some items have been removed or moved to other mods. This mod includes modificiations from the original Mobs Redo. Some items have been removed or moved to other mods.
The API is mostly identical, but a few features have been added. Compability is not really a goal, The API is mostly identical, but a few features have been added. Compability is not really a goal,
but function and attribute names of Mobs Redo 1.41 are kept. but function and attribute names of Mobs Redo 1.41 are kept.
If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in MineClone 2, If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in VoxeLibre.
chances are good that it works out of the box. chances are good that it works out of the box.
### Help ### Help
@ -68,6 +67,7 @@ chances are good that it works out of the box.
### Utility APIs ### Utility APIs
* Change player physics: `PLAYER/playerphysics` * Change player physics: `PLAYER/playerphysics`
* Change player FOV: `PLAYER/mcl_fovapi`
* Select random treasures: `CORE/mcl_loot` * Select random treasures: `CORE/mcl_loot`
* Get flowing direction of liquids: `CORE/flowlib` * Get flowing direction of liquids: `CORE/flowlib`
* `on_walk_over` callback for nodes: `CORE/walkover` * `on_walk_over` callback for nodes: `CORE/walkover`
@ -77,7 +77,7 @@ chances are good that it works out of the box.
* Flowers and flower pots * Flowers and flower pots
### Unstable APIs ### Unstable APIs
The following APIs may be subject to change in future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk! The following APIs may be subject to change in the future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk!
* Panes (like glass panes and iron bars): `ITEMS/xpanes` * Panes (like glass panes and iron bars): `ITEMS/xpanes`
* `_on_ignite` callback: `ITEMS/mcl_fire` * `_on_ignite` callback: `ITEMS/mcl_fire`

View File

@ -1,48 +1,47 @@
# Contributing to MineClone2 # Contributing to VoxeLibre
So you want to contribute to MineClone2? So you want to contribute to VoxeLibre?
Wow, thank you! :-) Wow, thank you! :-)
MineClone2 is maintained by AncientMariner and Nicu. If you have any VoxeLibre is maintained by AncientMariner and Herowl. If you have any
problems or questions, contact us on Discord/Matrix (See Links section below). problems or questions, contact us on Discord/Matrix (See Links section below).
You can help with MineClone2's development in many different ways, You can help with VoxeLibre's development in many different ways,
whether you're a programmer or not. whether you're a programmer or not.
## MineClone2's development target is to... ## VoxeLibre's development target is to...
- Create a stable, peformant, moddable, free/libre game based on Minecraft - Create a stable, peformant, moddable, free/libre game inspired by Minecraft
using the Minetest engine, usable in both singleplayer and multiplayer. using the Minetest engine, usable in both singleplayer and multiplayer.
- Currently, a lot of features are already implemented. - Currently, a lot of features are already implemented.
Polishing existing features is always welcome. Polishing existing features is always welcome.
## Links ## Links
* [Mesehub](https://git.minetest.land/MineClone2/MineClone2) * [Mesehub](https://git.minetest.land/VoxeLibre/VoxeLibre)
* [Discord](https://discord.gg/xE4z8EEpDC) * [Discord](https://discord.gg/xE4z8EEpDC)
* [YouTube](https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A) * [YouTube](https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A)
* [IRC](https://web.libera.chat/#mineclone2) * [Matrix](https://app.element.io/#/room/#voxelibre:matrix.org)
* [Matrix](https://app.element.io/#/room/#mc2:matrix.org) * [Reddit](https://www.reddit.com/r/VoxeLibre/)
* [Reddit](https://www.reddit.com/r/MineClone2/)
* [Minetest forums](https://forum.minetest.net/viewtopic.php?f=50&t=16407) * [Minetest forums](https://forum.minetest.net/viewtopic.php?f=50&t=16407)
* [ContentDB](https://content.minetest.net/packages/wuzzy/mineclone2/) * [ContentDB](https://content.minetest.net/packages/wuzzy/mineclone2/)
* [OpenCollective](https://opencollective.com/mineclone2) * [OpenCollective](https://opencollective.com/mineclone2)
## Using git ## Using git
MineClone2 is developed using the version control system VoxeLibre is developed using the version control system
[git](https://git-scm.com/). If you want to contribute code to the [git](https://git-scm.com/). If you want to contribute code to the
project, it is **highly recommended** that you learn the git basics. project, it is **highly recommended** that you learn the git basics.
For non-programmers and people who do not plan to contribute code to For non-programmers and people who do not plan to contribute code to
MineClone2, git is not required. However, git is a tool that will be VoxeLibre, git is not required. However, git is a tool that will be
referenced frequently because of its usefulness. As such, it is valuable referenced frequently because of its usefulness. As such, it is valuable
in learning how git works and its terminology. It can also help you in learning how git works and its terminology. It can also help you
keeping your game updated, and easily test pull requests. keeping your game updated, and easily test pull requests.
Look at our wiki for some concrete guides: Look at our wiki for some concrete guides:
https://git.minetest.land/MineClone2/MineClone2/wiki/ https://git.minetest.land/VoxeLibre/VoxeLibre/wiki/
## How you can help as a non-programmer ## How you can help as a non-programmer
As someone who does not know how to write programs in Lua or does not As someone who does not know how to write programs in Lua or does not
know how to use the Minetest API, you can still help us out a lot. For know how to use the Minetest API, you can still help us out a lot. For
example, by opening an issue in the example, by opening an issue in the
[Issue tracker](https://git.minetest.land/MineClone2/MineClone2/issues), [Issue tracker](https://git.minetest.land/VoxeLibre/VoxeLibre/issues),
you can report a bug or request a feature. you can report a bug or request a feature.
### Rules about both bugs and feature requests ### Rules about both bugs and feature requests
@ -60,8 +59,7 @@ actually an issue with Minetest itself, and if it is, head to the
[Minetest issue tracker](https://github.com/minetest/minetest/issues) [Minetest issue tracker](https://github.com/minetest/minetest/issues)
instead. instead.
* If you need any help regarding creating a Mesehub account or opening * If you need any help regarding creating a Mesehub account or opening
an issue, feel free to ask on the Discord / Matrix server or the IRC an issue, feel free to ask on the Discord or Matrix space.
channel.
The link to the mesehub registration page is: https://git.minetest.land/user/sign_up The link to the mesehub registration page is: https://git.minetest.land/user/sign_up
(It appears to sometimes get lost on the page itsself) (It appears to sometimes get lost on the page itsself)
@ -75,7 +73,7 @@ in singleplayer, post a screenshot of the message that Minetest showed
when the crash happened (or copy the message into your issue). If you when the crash happened (or copy the message into your issue). If you
are a server admin, you can find error messages in the log file of the are a server admin, you can find error messages in the log file of the
server. server.
* Tell us which MineClone2 and Minetest versions you are using (from Minetest 5.7 type /ver, for previous versions, check the game.conf or README.md file). * Tell us which VoxeLibre and Minetest versions you are using (from Minetest 5.7 type /ver, for previous versions, check the game.conf or README.md file).
* Tell us how to reproduce the problem: What you were doing to trigger * Tell us how to reproduce the problem: What you were doing to trigger
the bug, e.g. before the crash happened or what causes the faulty the bug, e.g. before the crash happened or what causes the faulty
behavior. behavior.
@ -84,14 +82,14 @@ behavior.
* Ensure the requested feature fulfills our development targets and * Ensure the requested feature fulfills our development targets and
goals. goals.
* Begging or excessive attention seeking does not help us in the * Begging or excessive attention seeking does not help us in the
slightest, and may very well disrupt MineClone2 development. It's better slightest, and may very well disrupt VoxeLibre development. It's better
to put that energy into helping or researching the feature in question. to put that energy into helping or researching the feature in question.
After all, we're just volunteers working on our spare time. After all, we're just volunteers working on our spare time.
* Ensure the requested feature has not been implemented in MineClone2 * Ensure the requested feature has not been implemented in VoxeLibre
latest or development versions. latest or development versions.
### Testing code ### Testing code
If you want to help us with speeding up MineClone2 development and If you want to help us with speeding up VoxeLibre development and
making the game more stable, a great way to do that is by testing out making the game more stable, a great way to do that is by testing out
new features from contributors. For most new things that get into the new features from contributors. For most new things that get into the
game, a pull request is created. A pull request is essentially a game, a pull request is created. A pull request is essentially a
@ -103,20 +101,21 @@ tell us if the code works as expected without any issues. Ideally, you
would report issues will pull requests similar to when you were would report issues will pull requests similar to when you were
reporting bugs that are the mainline (See Reporting bugs section). You reporting bugs that are the mainline (See Reporting bugs section). You
can find currently open pull requests here: can find currently open pull requests here:
<https://git.minetest.land/MineClone2/MineClone2/pulls>. Note that pull <https://git.minetest.land/VoxeLibre/VoxeLibre/pulls>. Note that pull
requests that start with a `WIP:` are not done yet and therefore could requests that start with a `WIP:` are not done yet and therefore could
still undergo substantial change. Testing these is still helpful however still undergo substantial change. Testing these is still helpful however
because that is the reason developers put them up as WIP so other people because that is the reason developers put them up as WIP so other people
can have a look at the PR. can have a look at the PR. The wiki has an article with instructions
on how to test Pull Requests:
<https://git.minetest.land/VoxeLibre/VoxeLibre/wiki/Testing-Pull-Requests>.
### Contributing assets ### Contributing assets
Due to license problems, MineClone2 cannot use Minecraft's assets, Due to license problems, VoxeLibre cannot use Minecraft's assets,
therefore we are always looking for asset contributions. therefore we are always looking for asset contributions.
To contribute assets, it can be useful to learn git basics and read To contribute assets, it can be useful to learn git basics and read
the section for Programmers of this document, however this is not required. the section for Programmers of this document, however this is not required.
It's also a good idea to join the Discord server It's also a good idea to join the Discord server and/or Matrix space.
(or alternatively IRC or Matrix).
#### Textures #### Textures
For textures we prefer original art, but in the absence of that will accept For textures we prefer original art, but in the absence of that will accept
@ -128,9 +127,9 @@ If you want to make such contributions, join our Discord server. Demands
for textures will be communicated there. for textures will be communicated there.
#### Sounds #### Sounds
MineClone2 currently does not have a consistent way to handle sounds. VoxeLibre currently does not have a consistent way to handle sounds.
The sounds in the game come from different sources, like the SnowZone The sounds in the game come from different sources, like the SnowZone
resource pack or minetest_game. Unfortunately, MineClone2 does not play resource pack or minetest_game. Unfortunately, VoxeLibre does not play
a sound in every situation you would get one in Minecraft. Any help with a sound in every situation you would get one in Minecraft. Any help with
sounds is greatly appreciated, however if you add new sounds you should sounds is greatly appreciated, however if you add new sounds you should
probably work together with a programmer, to write the code to actually probably work together with a programmer, to write the code to actually
@ -140,7 +139,7 @@ changes made by the contributor. Use the README files in the mod to
communicate this information. communicate this information.
#### 3D Models #### 3D Models
Most of the 3D Models in MineClone2 come from Many of the 3D Models in VoxeLibre come from
[22i's repository](https://github.com/22i/minecraft-voxel-blender-models). [22i's repository](https://github.com/22i/minecraft-voxel-blender-models).
Similar to the textures, we need people that can make 3D Models with Similar to the textures, we need people that can make 3D Models with
Blender on demand. Many of the models have to be patched, some new Blender on demand. Many of the models have to be patched, some new
@ -154,13 +153,13 @@ also be credited in the Contributors section.
### Contributing Translations ### Contributing Translations
#### Workflow #### Workflow
To add/update support for your language to MineClone2, you should take To add/update support for your language to VoxeLibre, you should take
the steps documented in the section for Programmers, add/update the the steps documented in the section for Programmers, add/update the
translation files of the mods that you want to update. You can add translation files of the mods that you want to update. You can add
support for all mods, just some of them or only one mod; you can update support for all mods, just some of them or only one mod; you can update
the translation file entirely or only partly; basically any effort is the translation file entirely or only partly; basically any effort is
valued. If your changes are small, you can also send them to developers valued. If your changes are small, you can also send them to developers
via E-Mail, Discord, IRC or Matrix - they will credit you appropriately. via E-Mail, Discord or Matrix - they will credit you appropriately.
#### Things to note #### Things to note
You can use the script at `tools/check_translate_files.py` to compare You can use the script at `tools/check_translate_files.py` to compare
@ -178,7 +177,7 @@ If you have commited the results yourself, you will also be credited in
the Contributors section. the Contributors section.
### Profiling ### Profiling
If you own a server, a great way to help us improve MineClone2's code If you own a server, a great way to help us improve VoxeLibre's code
is by giving us profiler results. Profiler results give us detailed is by giving us profiler results. Profiler results give us detailed
information about the game's performance and let us know places to information about the game's performance and let us know places to
investigate optimization issues. This way we can make the game faster. investigate optimization issues. This way we can make the game faster.
@ -203,18 +202,23 @@ decisions. Also, note that a lot of discussion takes place on the
Discord server, so it's definitely worth checking it out. Discord server, so it's definitely worth checking it out.
### Funding ### Funding
You can help pay for our infrastructure (Mesehub) by donating to our You can help pay for our infrastructure (Mesehub) and other unforeseen
OpenCollective link (See Links section). expenses (in the last few years, only payments for Mesehub have been done)
by donating to our OpenCollective link (See Links section).
### Crediting ### Crediting
If you opened or have contributed to an issue, you receive the If you opened or have contributed to an issue, you receive the
`Community` role on our Discord (after asking for it). `Community` role on our Discord (after asking for it).
If you have been an author of a PR that got merged or contributed
significantly to art that got merged into the game, you receive the
`Contributor` role on our Discord (after asking for it).
Please note that what counts as "significant" is decided by Maintainers.
OpenCollective Funders are credited in their own section in OpenCollective Funders are credited in their own section in
`CREDITS.md` and receive a special role "Funder" on our discord (unless `CREDITS.md` and receive a special role "Funder" on our discord (unless
they have made their donation Incognito). they have made their donation Incognito).
## How you can help as a programmer ## How you can help as a programmer
(Almost) all the MineClone2 development is done using pull requests. (Almost) all the VoxeLibre development is done using pull requests.
### Recommended workflow ### Recommended workflow
* Fork the repository (in case you have not already) * Fork the repository (in case you have not already)
@ -237,11 +241,11 @@ is no issue on the topic, open one. If there is an issue, tell us that
you'd like to take care of it, to avoid duplicate work. you'd like to take care of it, to avoid duplicate work.
### Don't hesitate to ask for help ### Don't hesitate to ask for help
We appreciate any contributing effort to MineClone2. If you are a We appreciate any contributing effort to VoxeLibre. If you are a
relatively new programmer, you can reach us on Discord, Matrix or IRC relatively new programmer, you can reach us on Discord or Matrix
for questions about git, Lua, Minetest API, MineClone2 codebase or for questions about git, Lua, Minetest API, VoxeLibre codebase or
anything related to MineClone2. We can help you avoid writing code that anything related to VoxeLibre. We can help you avoid writing code that
would be deemed inadequate, or help you become familiar with MineClone2 would be deemed inadequate, or help you become familiar with VoxeLibre
better, or assist you use development tools. better, or assist you use development tools.
### Maintain your own code, even if already got merged ### Maintain your own code, even if already got merged
@ -250,40 +254,52 @@ scenarios by testing every time before merging it, but if your merged
work causes problems, we ask you fix the issues as soon as possible. work causes problems, we ask you fix the issues as soon as possible.
### Changing Gameplay ### Changing Gameplay
Pull Requests that change gameplay have to be properly researched and Pull Requests that change gameplay are always subject to discussion.
need to state their sources. These PRs also need the maintainer's approval Opinions from the community on such PRs are valued, and Maintainer
before they are merged. should approve the concept (which is usually granted) as well as
You can use these sources: the implementation (for which changes are often requested for either
code quality or game design reasons).
* Testing things inside of Minecraft (Attach screenshots / video footage
of the results)
* Looking at [Minestom](https://github.com/Minestom/Minestom) code. An open source Minecraft Server implementation
* [Official Minecraft Wiki](https://minecraft.fandom.com/wiki/Minecraft_Wiki)
(Include a link to the specific page you used)
### Guidelines ### Guidelines
#### Git Guidelines #### Git Guidelines
* Pushing to master is disabled - don't even try it. * Pushing to master is disabled - don't even try it!
* Every change is tracked as a PR. * Every change is tracked as a PR
* All but the tiniest changes require at least one approval from a Developer * All changes require at least one approval from a Developer
* Maintainers may merge PRs without formal approval, but should also
take others' opinions and testing into account
* To update branches we use rebase not merge (so we don't end up with * To update branches we use rebase not merge (so we don't end up with
excessive git bureaucracy commits in master) excessive git bureaucracy commits in master)
* We use merge to add the commits from a PR/branch to master * We use merge to add the commits from a PR/branch to master
* Smaller PRs may be squashed before merging (especially if the commit history
on them isn't valuable), but when in doubt prefer merging
* Manual merging may be done by a Maintainer if there are technical problems
with the branch, with Gitea, or the PR had been merged to from master and
the author can't fix it for whatever reason
* PR from a fork (usually the author has no contributor/developer privileges)
can be retargeted and merged first into a buffer (normal new) branch on the repo
when adopted by a Developer, and only later into master
* Submodules should only be used if a) upstream is highly reliable and * Submodules should only be used if a) upstream is highly reliable and
b) it is 100% certain that no mcl2 specific changes to the code will be b) it is 100% certain that no VL specific changes to the code will be
needed (this has never been the case before, hence mcl2 is submodule free so far) needed (this has never been the case before, hence VL is submodule free so far)
* Subtrees may be used for including outside mods that don't need changes
in the foreseeable future
* Commit messages should be descriptive * Commit messages should be descriptive
* Try to group your submissions best as you can: * Try to group your submissions best as you can:
* Try to keep your PRs small: In some cases things reasonably be can't * Try to keep your PRs small: In some cases things reasonably be can't
split up but in general multiple small PRs are better than a big one. split up but in general multiple small PRs are better than a big one
* Similarly multiple small commits are better than a giant one. (use git commit -p) * Similarly multiple small commits are better than a giant one. (use git commit -p)
#### Code Guidelines #### Code Guidelines
* Each mod must provide `mod.conf`. * Each mod must provide `mod.conf`.
* Mod names are snake case, and newly added mods start with `mcl_`, e.g. * Mod names are snake case, and newly added mods (or substantially changed mods
`mcl_core`, `mcl_farming`, `mcl_monster_eggs`. Keep in mind Minetest that are included from the outside) start with `vl_`, e.g.
`vl_hollow_logs`, . Keep in mind Minetest
does not support capital letters in mod names. does not support capital letters in mod names.
* In the past mods were prefixed with `mcl_`, e.g.
`mcl_core`, `mcl_farming`, `mcl_monster_eggs`. New mods should **never** use this prefix.
* Mods included from outside with no significant changes to the API
(especially those using git-subtree or such) aren't prefixed.
* To export functions, store them inside a global table named like the * To export functions, store them inside a global table named like the
mod, e.g. mod, e.g.
@ -357,17 +373,21 @@ end
### Developer status ### Developer status
Active and trusted contributors are often granted write access to the Active and trusted contributors are often granted write access to the
MineClone2 repository as a contributor. Those that have demonstrated the right VoxeLibre repository as a contributor. This means that they can push
technical skills and behaviours may be granted developer access. These are the directly to the branches of our repo (except for `master`).
most trusted contributors who will contribute to ensure coding standards and Pushing to others' branches without asking is discouraged, open a PR
processes are followed. targeting that branch instead (PRs can target any branch).
Those that have demonstrated the right technical skills and behaviour
may be granted developer access. These are the most trusted contributors
who will contribute to ensure coding standards and processes are followed.
#### Developer responsibilities #### Developer responsibilities
- If you have developer/contributor privileges you can just open a new branch - If you have developer/contributor privileges you can just open a new branch
in the mcl2 repository (which is preferred). From that you create a pull request. in the VL repository (which is preferred). From that you create a pull request.
This way other people can review your changes and make sure they work This way other people can review your changes and make sure they work
before they get merged. before they get merged.
- If you do not (yet) have developer privs you do your work on a branch - If you do not (yet) have contributor or developer privs you do your work on a branch
on your private repository e.g. using the "fork" function on mesehub. on your private repository e.g. using the "fork" function on mesehub.
- Any developer is welcome to review, test and approve PRs. A maintainer may prefer - 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 to merge the PR especially if it is in a similar area to what has been worked on
@ -390,14 +410,14 @@ merged.
- Resolving conflicts and problems within the community - Resolving conflicts and problems within the community
#### Current maintainers #### Current maintainers
* AncientMariner - responsible for gameplay review, publishing releases, * AncientMariner - responsible for gameplay review, publishing releases
* Herowl - responsible for gameplay review, publishing releases,
technical guidelines technical guidelines
* Nicu - responsible for community related issues
#### Release process #### Release process
* Run `tools/generate_ingame_credits.lua` to update the ingame credits * Run `tools/generate_ingame_credits.lua` to update the ingame credits
from `CREDITS.md` and commit the result (if anything changed) from `CREDITS.md` and commit the result (if anything changed)
* Launch MineClone2 to make sure it still runs * Launch VoxeLibre to make sure it still runs
* Update the version number in README.md * Update the version number in README.md
* Use `git tag <version number>` to tag the latest commit with the * Use `git tag <version number>` to tag the latest commit with the
version number version number
@ -415,6 +435,5 @@ become part of a free/libre software.
### Crediting ### Crediting
Contributors, Developers and Maintainers will be credited in Contributors, Developers and Maintainers will be credited in
`CREDITS.md`. If you make your first time contribution, please add `CREDITS.md`. There are also Discord roles for Contributors,
yourself to this file. There are also Discord roles for Contributors,
Developers and Maintainers. Developers and Maintainers.

View File

@ -3,7 +3,7 @@
## Creator of MineClone ## Creator of MineClone
* davedevils * davedevils
## Creator of MineClone2 ## Creator of VoxeLibre
* Wuzzy * Wuzzy
## Maintainers ## Maintainers
@ -20,10 +20,10 @@
* epCode * epCode
* chmodsayshello * chmodsayshello
* MrRar * MrRar
* FossFanatic
* SmokeyDope * SmokeyDope
* Faerraven / Michieal * Faerraven / Michieal
* Codiac * rudzik8
* teknomunk
## Past Developers ## Past Developers
* jordan4ibanez * jordan4ibanez
@ -34,10 +34,11 @@
* NO11 * NO11
* SumianVoice * SumianVoice
* PrairieWind * PrairieWind
* FossFanatic
* Codiac
## Contributors ## Contributors
* RandomLegoBrick * RandomLegoBrick
* rudzik8
* Code-Sploit * Code-Sploit
* aligator * aligator
* Rootyjr * Rootyjr
@ -129,12 +130,23 @@
* Bakawun * Bakawun
* JoseDouglas26 * JoseDouglas26
* Zasco * Zasco
* PrWalterB
* michaljmalinowski
* nixnoxus
* Potiron
* Tuxilio
* Impulse
* Doods
* SOS-Games
* Bram
* qoheniac
* WillConker
## Music ## Music
* Jordach for the jukebox music compilation from Big Freaking Dig * 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/ * 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) * Jester for helping to finely tune VoxeLibre (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)
* Exhale & Tim Unwin for some wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0) * Exhale & Tim Unwin for some wonderful VoxeLibre tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom, Farmer (License CC BY-SA 4.0)
* Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0) * Diminixed for 3 fantastic tracks and remastering and leveling volumes. Songs: Afternoon Lullaby (pianowtune02), Spooled (ambientwip02), Never Grow Up (License CC BY-SA 4.0)
## Original Mod Authors ## Original Mod Authors

View File

@ -25,7 +25,7 @@ The basic digging time groups determine by which tools a node can be dug.
* `handy=1`: Breakable by hand and this node gives it useful drop when dug by hand. All nodes which are breakable by pickaxe, axe, shovel, sword or shears are also automatically breakable by hand, but not neccess * `handy=1`: Breakable by hand and this node gives it useful drop when dug by hand. All nodes which are breakable by pickaxe, axe, shovel, sword or shears are also automatically breakable by hand, but not neccess
* `creative_breakable=1`: Block is breakable by hand in creative mode. This group is implied if the node belongs to any other digging group * `creative_breakable=1`: Block is breakable by hand in creative mode. This group is implied if the node belongs to any other digging group
Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times work in Minecraft, as MineClone 2 is based on the same system. Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times work in Minecraft, as VoxeLibre is based on the same system.
### Groups for interactions ### Groups for interactions
@ -117,7 +117,7 @@ These groups correspond to the Minecraft materials. They classify the block into
* `material_glass=1`: Glass * `material_glass=1`: Glass
Currently, these groups are used for the note block. Currently, these groups are used for the note block.
Note that not all Minecraft materials are used so far. More Minecraft materials will lilely only be added when they are needed for a concrete use case. Note that not all Minecraft materials are used so far. More Minecraft materials will likely only be added when they are needed for a concrete use case.
### Declarative groups ### Declarative groups
These groups are used mostly for informational purposes These groups are used mostly for informational purposes

View File

@ -1,4 +1,4 @@
Survive, farm, build, explore, play with friends, and do much more. Inspired by a well known block game, pushing beyond. Survive, farm, build, explore, play with friends, and do much more. Inspired by a well-known block game, pushing beyond.
How to play: How to play:
@ -6,16 +6,18 @@ How to play:
- Navigate to https://www.minetest.net/ to download the client. - Navigate to https://www.minetest.net/ to download the client.
- Once installed, open and select the "Content" tab - Once installed, open and select the "Content" tab
#### Install MineClone2 from ContentDB #### Install VoxeLibre from ContentDB
- Click "Browse Online Content" and filter by Games (select "Games" from the dropdown box) - Click "Browse Online Content" and filter by Games (select "Games" from the dropdown box)
- Find "MineClone2" (should be first on the list or on the first page) - Find "VoxeLibre" (should be first on the list or on the first page)
- Click the [+] button next to MineClone2 and wait for download to finish - Click the [+] button next to VoxeLibre and wait for download to finish
- Click "Back to Main Menu" - Click "Back to Main Menu"
#### Create new world and play #### Create new world and play
- Click "Start Game" tab - Click "Start Game" tab
- At the bottom click the MineClone2 icon (the 2 dirt with grass blocks) - At the bottom click the VoxeLibre icon (the stone & sandstone ball with the letters VL)
- Click "New", give your world a name - Click "New", give your world a name
- You can leave seed blank or put in a word of your choice - You can leave seed blank or put in a word of your choice
- Pick a mapgen or leave the default (v7, valleys or carpathian mapgens are recommended)
- Pick mapgen options on the right (enabling everything is recommended)
- Select your new world - Select your new world
- Click "Play Game" and enjoy! - Click "Play Game" and enjoy!

View File

@ -1,14 +1,14 @@
# Legal information # Legal information
This is a fan game, not developed or endorsed by Mojang AB. This is a game inspired by Minecraft with unique content.
Copying is an act of love. Please copy and share! <3 Copying is an act of love. Please copy and share! <3
Here's the detailed legalese for those who need it: Here's the detailed legalese for those who need it:
## License of source code ## License of source code
MineClone 2 (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others) VoxeLibre (by Lizzy Fleckenstein, Wuzzy, davedevils and countless others)
is an imitation of Minecraft. is inspired by Minecraft.
MineClone 2 is free software: you can redistribute it and/or modify VoxeLibre is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
@ -22,15 +22,15 @@ details.
In the mods you might find in the read-me or license In the mods you might find in the read-me or license
text files a different license. This counts as dual-licensing. text files a different license. This counts as dual-licensing.
You can choose which license applies to you: Either the You can choose which license applies to you: Either the
license of MineClone 2 (GNU GPLv3) or the mod's license. license of VoxeLibre (GNU GPLv3) or the mod's license.
MineClone 2 is a direct continuation of the discontinued MineClone VoxeLibre is a direct continuation of the discontinued MineClone
project by davedevils. project by davedevils.
Mod credits: Mod credits:
See `README.txt` or `README.md` in each mod directory for information about other authors. See `README.txt` or `README.md` in each mod directory for information about other authors.
For mods that do not have such a file, the license is the source code license For mods that do not have such a file, the license is the source code license
of MineClone 2 and the author is Wuzzy. of VoxeLibre and the author is Wuzzy.
## License of media (textures and sounds) ## License of media (textures and sounds)
No non-free licenses are used anywhere. No non-free licenses are used anywhere.
@ -46,6 +46,9 @@ Armor trim models were created by Aeonix_Aeon
Source: <https://www.curseforge.com/minecraft/texture-packs/ozocraft-remix> Source: <https://www.curseforge.com/minecraft/texture-packs/ozocraft-remix>
License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
Charcoal block texture was created by [blitzdoughnuts](https://gitlab.com/ApplemunchFromDaDead), based on the Pixel Perfection coal block.
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
The main menu images are released under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/) The main menu images are released under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
All other files, unless mentioned otherwise, fall under: All other files, unless mentioned otherwise, fall under:

View File

@ -1,10 +1,10 @@
# Models in Minetest/Mineclone2 # Models in Minetest/VoxeLibre
Models are an important part of all entities & unique nodes in Mineclone2. They provide a 3 dimensional map of an object for which textures are then applied to. This document is for modders, it quickly highlights some important information for the software needed to open models in Mineclone2. Models are an important part of all entities & unique nodes in VoxeLibre. They provide a 3 dimensional map of an object for which textures are then applied to. This document is for modders, it quickly highlights some important information for the software needed to open models in VoxeLibre.
## Minetest Wiki ## Minetest Wiki
For more detailed information on actually using blender to create and modify models for Minetest/Mineclone2, please visit the Minetest wiki's page on using Blender [Here](https://wiki.minetest.net/Using_Blender) For more detailed information on actually using blender to create and modify models for Minetest/VoxeLibre, please visit the Minetest wiki's page on using Blender [Here](https://wiki.minetest.net/Using_Blender)
## Recommended software ## Recommended software

View File

@ -1,6 +1,6 @@
# MineClone2 # VoxeLibre
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. A game inspired by Minecraft for Minetest. Forked from MineClone by davedevils.
Developed by many people. Not developed or endorsed by Mojang AB. Developed by many people, see CREDITS.md for a complete list.
### Gameplay ### Gameplay
You start in a randomly-generated world made entirely of cubes. You can explore You start in a randomly-generated world made entirely of cubes. You can explore
@ -64,47 +64,44 @@ Use the `/giveme` chat command to obtain them. See the in-game help for
an explanation. an explanation.
## Installation ## Installation
This game requires [Minetest](http://minetest.net) to run (version 5.4.1 or To run the game with the best performance and support, we recommend the latest
later). So you need to install Minetest first. Only stable versions of Minetest stable version of [Minetest](http://minetest.net), be we always make an effort
are officially supported. to support one version behind the latest stable version. In some cases, older
There is no support for running MineClone2 in development versions of Minetest. versions might still be good enough but you would be missing out on important
Minetest features that enable important features for our game.
To install MineClone2 (if you haven't already), move this directory into the There is no support for running VoxeLibre in development versions of Minetest.
To install VoxeLibre (if you haven't already), move this directory into the
“games” directory of your Minetest data directory. Consult the help of “games” directory of your Minetest data directory. Consult the help of
Minetest to learn more. Minetest to learn more.
## Useful links ## Useful links
The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there. The VoxeLibre repository is hosted at Mesehub. To contribute or report issues, head there.
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2> * Mesehub: <https://git.minetest.land/VoxeLibre/VoxeLibre>
* Discord: <https://discord.gg/xE4z8EEpDC> * Discord: <https://discord.gg/xE4z8EEpDC>
* YouTube: <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A> * YouTube: <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
* ContentDB: <https://content.minetest.net/packages/wuzzy/mineclone2/> * ContentDB: <https://content.minetest.net/packages/wuzzy/mineclone2/>
* OpenCollective: <https://opencollective.com/mineclone2> * OpenCollective: <https://opencollective.com/voxelibre>
* Mastodon: <https://fosstodon.org/@MineClone2> * Mastodon: <https://fosstodon.org/@VoxeLibre>
* Lemmy: <https://lemmy.world/c/mineclone2> * Lemmy: <https://lemm.ee/c/voxelibre>
* Matrix space: <https://app.element.io/#/room/#mcl2:matrix.org> * Matrix space: <https://app.element.io/#/room/#voxelibre:matrix.org>
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407> * Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
* Reddit: <https://www.reddit.com/r/MineClone2/> * Reddit: <https://www.reddit.com/r/VoxeLibre/>
* IRC (barely used): <https://web.libera.chat/#mineclone2> * IRC (barely used): <https://web.libera.chat/#mineclone2>
## Target ## Target
- Create a stable, moddable, free/libre game based on Minecraft - Create a stable, peformant, moddable, free/libre game inspired by Minecraft
on the Minetest engine with polished features, usable in both using the Minetest engine, usable in both singleplayer and multiplayer.
singleplayer and multiplayer. Currently, a lot of **Minecraft Java - Currently, a lot of features are already implemented.
Edition** features are already implemented and polishing existing Polishing existing features is always welcome.
features are prioritized over new feature requests.
- Implement features targetting
**Current Minecraft versions + OptiFine** (OptiFine only as far as supported
by the Minetest Engine).
- Create a performant experience that will run relatively
well on really low spec computers.
## Completion status ## Completion status
This game is currently in **beta** stage. This game is currently in **beta** stage.
It is playable, but not yet feature-complete. It is playable, but not yet feature-complete.
Backwards-compability is not entirely guaranteed, updating your world might cause small bugs. Backwards-compability is not entirely guaranteed, updating your world might cause small bugs.
If you want to use the development version of MineClone2 in production, the master branch is usually relatively stable. If you want to use the development version of VoxeLibre in production, the master branch is usually relatively stable.
The following main features are available: The following main features are available:
@ -187,7 +184,7 @@ Technical differences from Minecraft:
* Different engine (Minetest) * Different engine (Minetest)
* Different easter eggs * Different easter eggs
… and finally, MineClone2 is free software (“free” as in “freedom”)! … and finally, VoxeLibre is free software (“free” as in “freedom”)!
## Other readme files ## Other readme files

View File

@ -1,7 +1,8 @@
# MineClone2 # VoxeLibre
Un jeu non-officiel similaire à Minecraft pour Minetest. Forké depuis Mineclone par davedevils. Développé par de nombreuses personnes. Pas développé ni supporté par Mojang AB. Un jeu inspiré de Minecraft pour Minetest. Forké depuis Mineclone par davedevils.
Développé par de nombreuses personnes, voir CREDITS.md pour une liste complète.
### Gameplay ### Gameplay
Vous atterissez dans un monde fait entièrement de cubes et généré aléatoirement. Vous pouvez explorer le monde, miner et construire presque n'importe quel bloc pour créer de nouvelles structures. Vous pouvez choisir de jouer en "mode survie" dans lequel vous devez combattre des monstres et la faim et progresser lentement dans différents aspects du jeu, comme l'extraction de minerai, l'agriculture, la construction de machines et ainsi de suite. Ou alors vous pouvez jouer en "mode créatif" où vous pouvez construire à peu près n'importe quoi instantanément. Vous atterissez dans un monde fait entièrement de cubes et généré aléatoirement. Vous pouvez explorer le monde, miner et construire presque n'importe quel bloc pour créer de nouvelles structures. Vous pouvez choisir de jouer en "mode survie" dans lequel vous devez combattre des monstres et la faim et progresser lentement dans différents aspects du jeu, comme l'extraction de minerai, l'agriculture, la construction de machines et ainsi de suite. Ou alors vous pouvez jouer en "mode créatif" où vous pouvez construire à peu près n'importe quoi instantanément.
### Résumé du Gameplay ### Résumé du Gameplay
@ -21,7 +22,7 @@ Vous atterissez dans un monde fait entièrement de cubes et généré aléatoire
### Commencer ### Commencer
* **Frappez un arbre** jusqu'à ce qu'il casse et donne du bois * **Frappez un arbre** jusqu'à ce qu'il casse et donne du bois
* Placez le **bois dans la grille 2x2** (la "grille de fabrication" de votre menu d'inventaire) et fabriquez 4 planches de bois * Placez le **bois dans la grille 2x2** (la "grille de fabrication" de votre menu d'inventaire) et fabriquez 4 planches de bois
* Placer les 4 planches de bois dans la grille 2x2 et **fabriquez un établi** * Placez les 4 planches de bois dans la grille 2x2 et **fabriquez un établi**
* **Faites un clic droit sur l'établi** (icone livre) pour apprendre toutes les recettes possibles * **Faites un clic droit sur l'établi** (icone livre) pour apprendre toutes les recettes possibles
* **Fabriquez une pioche de bois** pour miner la pierre * **Fabriquez une pioche de bois** pour miner la pierre
* Différents outils minent différentes sortes de blocs. Essayez-les ! * Différents outils minent différentes sortes de blocs. Essayez-les !
@ -30,10 +31,10 @@ Vous atterissez dans un monde fait entièrement de cubes et généré aléatoire
### Agriculture ### Agriculture
* Trouvez des graines * Trouvez des graines
* Fabriquez une houe * Fabriquez une houe
* Faites un clic droit sur la terre ou des blocs similaires avec la houe pour créer des terres agricoles * Faites un clic droit sur la terre ou un bloc similaire avec la houe pour créer des terres agricoles
* Placer des graines sur des terres agricoles et regardez les pousser * Placez des graines sur des terres agricoles et regardez les pousser
* Récoltez les plantes une fois matûres * Récoltez les plantes une fois matûres
* Les terres agricoles proche de l'eau deviennent humides et accélèrent la croissance * Les terres agricoles proches de l'eau deviennent humides et accélèrent la croissance
### Four ### Four
* Fabriquez un four * Fabriquez un four
@ -46,7 +47,7 @@ Vous atterissez dans un monde fait entièrement de cubes et généré aléatoire
Plus d'aide à propos du jeu, des blocs, objets et plus encore peuvent être trouvés dans le jeu. Vous pouvez accéder à l'aide depuis le menu inventaire. Plus d'aide à propos du jeu, des blocs, objets et plus encore peuvent être trouvés dans le jeu. Vous pouvez accéder à l'aide depuis le menu inventaire.
### Objets spéciaux ### Objets spéciaux
Les objets suivants sont intéressants pour le mode Créatif et pour les constructeurs de cartes d'aventure. Ils ne peuvent être obtenus dans le jeu ou dans l'inventaire créatif. Les objets suivants sont intéressants pour le mode Créatif et pour les constructeurs de cartes d'aventure. Ils ne peuvent être obtenus dans le jeu ou dans l'inventaire créatif.
* Barrière : `mcl_core:barrier` * Barrière : `mcl_core:barrier`
@ -54,33 +55,35 @@ Utilisez la commande de chat `/giveme` pour les obtenir. Voir l'aide interne au
## Installation ## Installation
Ce jeu nécessite [Minetest](http://minetest.net) pour fonctionner (version 5.4.1 ou plus). Vous devez donc installer Minetest d'abord. Seules les versions stables de Minetest sont officielement supportées. Ce jeu nécessite [Minetest](http://minetest.net) pour fonctionner (version 5.4.1 ou plus). Vous devez donc installer Minetest d'abord. Seules les versions stables de Minetest sont officielement supportées.
Il n'y a pas de support de MineClone2 dans les versions développement de Minetest. Il n'y a pas de support de VoxeLibre dans les versions développement de Minetest.
Pour installer MineClone2 (si ce n'est pas déjà fait), déplacez ce dossier dans le dossier “games” de Minetest. Consultez l'aide de Minetest pour en apprendre plus. Pour installer VoxeLibre (si ce n'est pas déjà fait), déplacez ce dossier dans le dossier “games” de Minetest. Consultez l'aide de Minetest pour en apprendre plus.
## Liens utiles ## Liens utiles
Le dépôt de MineClone2 est hébergé sur Mesehub. Pour contribuer ou signaler des problèmes, allez là-bas. Le dépôt de VoxeLibre est hébergé sur Mesehub. Pour contribuer ou signaler des problèmes, allez là-bas.
* Mesehub : <https://git.minetest.land/MineClone2/MineClone2> * Mesehub : <https://git.minetest.land/VoxeLibre/VoxeLibre>
* Discord : <https://discord.gg/xE4z8EEpDC> * Discord : <https://discord.gg/xE4z8EEpDC>
* YouTube : <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A> * YouTube : <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
* IRC : <https://web.libera.chat/#mineclone2>
* Matrix : <https://app.element.io/#/room/#mc2:matrix.org>
* Reddit : <https://www.reddit.com/r/MineClone2/>
* Forums Minetest : <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
* ContentDB : <https://content.minetest.net/packages/wuzzy/mineclone2/> * ContentDB : <https://content.minetest.net/packages/wuzzy/mineclone2/>
* OpenCollective : <https://opencollective.com/mineclone2> * OpenCollective : <https://opencollective.com/mineclone2>
* Mastodon : <https://fosstodon.org/@VoxeLibre>
* Lemmy : <https://lemm.ee/c/voxelibre>
* Espace Matrix : <https://app.element.io/#/room/#voxelibre:matrix.org>
* Forums Minetest : <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
* Reddit : <https://www.reddit.com/r/VoxeLibre/>
* IRC (peu utilisé) : <https://web.libera.chat/#mineclone2>
## Objectif ## Objectif
* Essentiellement, créer un clone de Minecraft stable, moddable, libre et gratuit basé sur le moteur de jeu Minetest avec des fonctionnalités abouties, utilisable à la fois en mode solo et multijoueur. Actuellement, beaucoup des fonctionnalités de **Minecraft Java Edition** sont déjà implémentées et leur amélioration est prioritaire sur les nouvelles demandes. * Créer un jeu stable, performant, moddable et libre inspiré de Minecraft en utilisant le moteur de jeu Minetest, utilisable à la fois en mode solo et multijoueur.
* Avec une priorité moindre, implémenter les fonctionnalités des versions **Minecraft + OptiFine** (OptiFine autant que supporté par le moteur Minetest). Cela signifie que les fonctionnalités présentes dans les versions listées sont priorisées. * Actuellement, un grand nombre de fonctionnalités sont déjà implémentées.
* Dans l'idéal, créer une expérience performante qui tourne bien sur des ordinateurs à basse performance. Malheureusement, en raison des mécanismes de Minecraft et des limitations du moteur Minetest ainsi que de la petite taille de la communauté de joueurs sur des ordinateurs à basses performances, les optimisations sont difficiles à explorer. L'amélioration des fonctionnalités existantes est toujours la bienvenue.
## Statut de complétion ## Statut de complétion
Ce jeu est actuellement au stade **beta**. Ce jeu est actuellement au stade **beta**.
Il est jouable mais incomplet en fonctionnalités. Il est jouable mais incomplet en fonctionnalités.
La rétro-compatibilité n'est pas entièrement garantie, mettre votre monde à jour peut causer de petits bugs. La rétro-compatibilité n'est pas entièrement garantie, mettre votre monde à jour peut causer de petits bugs.
Si vous voulez utiliser la version de développement de MineClone2 en production, la branche master est habituellement relativement stable. Les branches de test fusionnent souvent des pull requests expérimentales et doivent être considérées comme moins stable. Si vous voulez utiliser la version de développement de VoxeLibre en production, la branche master est habituellement relativement stable.
Les principales fonctionnalités suivantes sont disponibles : Les principales fonctionnalités suivantes sont disponibles :
@ -108,12 +111,12 @@ Les principales fonctionnalités suivantes sont disponibles :
* Horloge * Horloge
* Boussole * Boussole
* Éponge * Éponge
* Bloc de slime * Bloc de slime
* Petites plantes et pousses * Petites plantes et pousses
* Teintures * Teintures
* Bannières * Bannières
* Blocs de décoration : verre, verre teinté, vitres, barres de fer, terre cuites (et couleurs), têtes et plus * Blocs de décoration : verre, verre teinté, vitres, barres de fer, terre cuites (et couleurs), têtes et plus
* Cadres d'objets * Cadres d'objets
* Juke-boxes * Juke-boxes
* Lits * Lits
* Menu d'inventaire * Menu d'inventaire
@ -122,7 +125,7 @@ Les principales fonctionnalités suivantes sont disponibles :
* Livres pour écrire * Livres pour écrire
* Commandes * Commandes
* Villages * Villages
* L'End * L'End
* et plus ! * et plus !
Les fonctionnalités suivantes sont incomplètes : Les fonctionnalités suivantes sont incomplètes :
@ -162,7 +165,7 @@ Différences techniques avec Minecraft :
* Un moteur de jeu différent (Minetest) * Un moteur de jeu différent (Minetest)
* Des bonus cachés différents * Des bonus cachés différents
...et enfin MineClone2 est un logiciel libre ! ...et enfin VoxeLibre est un logiciel libre !
## Autres fichiers readme ## Autres fichiers readme

View File

@ -1,4 +1,4 @@
# MineClone2 # VoxeLibre
Неофициальная игра в стиле Minecraft для Minetest. Форк MineClone от davedevils. Неофициальная игра в стиле Minecraft для Minetest. Форк MineClone от davedevils.
Разработана многими людьми. Не разработана и не одобрена Mojang AB. Разработана многими людьми. Не разработана и не одобрена Mojang AB.
@ -67,13 +67,13 @@
## Установка ## Установка
Эта игра требует [Minetest](http://minetest.net) для запуска (версия 5.4.1 или Эта игра требует [Minetest](http://minetest.net) для запуска (версия 5.4.1 или
выше). Вам нужно сперва установить Minetest. Только стабильные версии поддерживаются выше). Вам нужно сперва установить Minetest. Только стабильные версии поддерживаются
официально. Не поддерживается запуск MineClone2 на разрабатываемых версиях Minetest. официально. Не поддерживается запуск VoxeLibre на разрабатываемых версиях Minetest.
Чтобы установить MineClone2 (если вы этого еще не сделали), переместите эту папку в Чтобы установить VoxeLibre (если вы этого еще не сделали), переместите эту папку в
“games” в папке данных Minetest. Смотрите справку Minetest, чтобы узнать больше. “games” в папке данных Minetest. Смотрите справку Minetest, чтобы узнать больше.
## Полезные ссылки ## Полезные ссылки
Репозиторий MineClone2 хранится на Mesehub. Зайдите туда, чтобы оставить запрос или Репозиторий VoxeLibre хранится на Mesehub. Зайдите туда, чтобы оставить запрос или
поучаствовать в разработке. поучаствовать в разработке.
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2> * Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
@ -102,7 +102,7 @@ Edition** уже реализовано и доработка имеющегос
Игра сейчас на стадии **бета**. Она играбельна, но еще не имеет всех возможностей. Игра сейчас на стадии **бета**. Она играбельна, но еще не имеет всех возможностей.
Обратная совместимость целиком не гарантируется, обновление вашего мира может повлечь Обратная совместимость целиком не гарантируется, обновление вашего мира может повлечь
за собой небольшие ошибки. Если вы хотите использовать разрабатываемую версию за собой небольшие ошибки. Если вы хотите использовать разрабатываемую версию
Mineclone2, то ветка master обычно относительно стабильна. VoxeLibre, то ветка master обычно относительно стабильна.
Следущие возможности уже доступны: Следущие возможности уже доступны:
@ -182,7 +182,7 @@ Mineclone2, то ветка master обычно относительно ста
* Другой движок (Minetest) * Другой движок (Minetest)
* Другие пасхалки * Другие пасхалки
… и наконец, MineClone2 это свободное программное обеспечение! … и наконец, VoxeLibre это свободное программное обеспечение!
## Другие readme файлы ## Другие readme файлы

View File

@ -1,4 +1,6 @@
# MineClone 2 This file is severely out of date. If you can help updating this translation, please reach out to us (contact in README.md - the English version).
# VoxeLibre
一個非官方的Minetest遊戲遊玩方式和Minecraft類似。由davedevils從MineClone分拆。 一個非官方的Minetest遊戲遊玩方式和Minecraft類似。由davedevils從MineClone分拆。
由許多人開發。並非由Mojang Studios開發。<!-- "Mojang AB"'s Name changed at 2020/05, main README should change too --> 由許多人開發。並非由Mojang Studios開發。<!-- "Mojang AB"'s Name changed at 2020/05, main README should change too -->
@ -83,11 +85,11 @@ Minetest to learn more.
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software. The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
* **開發目標:我的世界, Java版, 版本 1.12** * **開發目標:我的世界, Java版, 版本 1.12**
* MineClone2還包括Minetest支持的Optifine功能。 * VoxeLibre還包括Minetest支持的Optifine功能。
* 後期Minecraft版本的功能可能會偷偷加入但它們的優先級較低。 * 後期Minecraft版本的功能可能會偷偷加入但它們的優先級較低。
* 總的來說Minecraft的目標是在Minetest目前允許的情況下進行克隆。 * 總的來說Minecraft的目標是在Minetest目前允許的情況下進行克隆。
* 克隆Minecraft是最優先的。 * 克隆Minecraft是最優先的。
* MineClone2將使用不同的圖形和聲音,但風格相似。 * VoxeLibre將使用不同的圖形和聲音,但風格相似。
* 克隆界面沒有優先權。只會被粗略地模仿。 * 克隆界面沒有優先權。只會被粗略地模仿。
* 在Minetest中發現的局限性將在開發過程中被記錄和報告。 * 在Minetest中發現的局限性將在開發過程中被記錄和報告。
@ -173,7 +175,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release
* 不同的聲音(各種來源) * 不同的聲音(各種來源)
* 不同的引擎Minetest * 不同的引擎Minetest
...最後,MineClone2是自由軟件! ...最後,VoxeLibre是自由軟件!
## 錯誤報告 ## 錯誤報告
請在此處報告所有錯誤和缺少的功能: 請在此處報告所有錯誤和缺少的功能:
@ -190,7 +192,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release
* `LICENSE.txt`GPLv3許可文本 * `LICENSE.txt`GPLv3許可文本
* `CONTRIBUTING.md`: 為那些想參與貢獻的人提供資訊 * `CONTRIBUTING.md`: 為那些想參與貢獻的人提供資訊
* `MISSING_ENGINE_FEATURES.md`: MineClone2需要改进Minetest中缺失的功能列表。 * `MISSING_ENGINE_FEATURES.md`: VoxeLibre需要改进Minetest中缺失的功能列表。
* `API.md`: 關於MineClone2的API * `API.md`: 關於MineClone2的API
## 參與者 ## 參與者
@ -235,7 +237,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release
* [kingoscargames](https://github.com/kingoscargames):現有材質的各種編輯和添加 * [kingoscargames](https://github.com/kingoscargames):現有材質的各種編輯和添加
* [leorockway](https://github.com/leorockway):怪物紋理的一些編輯 * [leorockway](https://github.com/leorockway):怪物紋理的一些編輯
* [xMrVizzy](https://minecraft.curseforge.com/members/xMrVizzy):釉陶(材質以後會被替換) * [xMrVizzy](https://minecraft.curseforge.com/members/xMrVizzy):釉陶(材質以後會被替換)
* yutyo <tanakinci2002@gmail.com>MineClone2標志 * yutyo <tanakinci2002@gmail.com>VoxeLibre標志
* 其他GUI圖片 * 其他GUI圖片
### 翻譯 ### 翻譯
@ -254,7 +256,7 @@ The main goal of **MineClone 2** is to be a clone of Minecraft and to be release
### 特殊感謝 ### 特殊感謝
* Wuzzy感謝他啟動和維護MineClone2多年。 * Wuzzy感謝他啟動和維護VoxeLibre多年。
* celeron55創建Minetest。 * celeron55創建Minetest。
* Minetest的社區提供了大量的mods選擇其中一些最終被納入MineClone 2。 * Minetest的社區提供了大量的mods選擇其中一些最終被納入MineClone 2。
* Jordach為《Big Freaking Dig》的唱片機音樂合輯而來 * Jordach為《Big Freaking Dig》的唱片機音樂合輯而來

View File

@ -1,89 +1,167 @@
### Standard Release ## Standard Release
# File to document release steps with a view to evolving into a script ### Before releasing
# Update CREDITS.md Make sure all PRs in the release milestone are merged and you are working on a clean branch based on the master branch, up-to-date with the one on the repo.
# Update version in game.conf
### Release process
1. Update CREDITS.md
2. Update version in game.conf
3. Run the script:
``` ```
lua tools/generate_ingame_credits.lua lua tools/generate_ingame_credits.lua
```
4. Make a commit for the above:
```
git add CREDITS.md git add CREDITS.md
git add mods/HUD/mcl_credits/people.lua git add mods/HUD/mcl_credits/people.lua
git add game.conf git add game.conf
git commit -m "Updated release credits and set version for v0.87"
#git add RELEASE.md
git commit -m "Pre-release update credits and set version 0.83.0"
git tag 0.83.0
git push origin 0.83.0
``` ```
5. Add release notes to the `releasenotes` folder, named like
# Update version in game.conf to the next version with -SNAPSHOT suffix
`git commit -m "Post-release set version 0.84.0-SNAPSHOT"`
### Hotfix Release
##### Prepare release branch
When hotfixing, you should never release new features. Any new code increases risk of new bugs which has additional testing/release concerns.
To mitigate this, you just release the last release, and the relevant bug fix. For this, we do the following:
* Create release branch from the last release tag, push it:
``` ```
git checkout -b release/0.82.1 0.82.0 0_87-the_prismatic_release.md
git push origin release/0.82.1
``` ```
6. Make a commit for the release notes:
##### 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`
* Fix crash/serious bug and commit
* Push branch and create pr to the release and also the master branch (Do not rebase, to reduce merge conflict risk. Do not delete after first merge or it needs to be repushed)
##### Update version and tag the release
* After all fixes are in release branch, pull it locally (best to avoid a merge conflict as feature branch will need to be merged into master also, which already changed version):
* Update version in game.conf to hotfix version and commit it. Example: version=0.82.1
* Tag it, push tag and branch:
``` ```
git tag 0.82.1 git add releasenotes/0_87-the_prismatic_release.md
git commit -m "Add release notes for v0.87"
git push origin 0.82.1
git push origin release/0.82.1
``` ```
7. **Tag and push to the tag:**
Note: If you have to do more than 1 hotfix release, can do it on the same release branch. ```
git tag 0.87.0
git push origin 0.87.0
```
8. Update version in game.conf to the next version with -SNAPSHOT suffix:
```
git commit -m "Post-release set version 0.88.0-SNAPSHOT"
```
9. Push the above to a new branch, and make the release PR. Merge to finalize release process.
### Release via ContentDB ### Release via ContentDB
* Go to MineClone2 page (https://content.minetest.net/packages/Wuzzy/mineclone2/) 1. Go to VoxeLibre page (https://content.minetest.net/packages/Wuzzy/mineclone2/)
* Click +Release 2. Click [+Release] button
* Enter the release tag number in the title and Git reference box. For example (without quotes): "0.82.1" 3. Enter the release tag number in the title and Git reference box. For example (without quotes): "0.87.0"
* In the minimum minetest version, put the oldest supported version (as of 14/02/2023 it is 5.5), leave the Maximum minetest version blank 4. In the minimum minetest version, put the oldest supported version (as of 19/05/2024 it is 5.6), leave the Maximum minetest version blank
* Click save. Release is now live. 5. Click save. Release is now live.
##### Inform people ### After releasing
* Upload video to YouTube ...inform people.
* 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. * Open a release meta issue on the tracker, unpin and close the issue for the previous release, pin the new one.
* Upload video to YouTube.
* Add a comment to the forum post with the release number and change log. Maintainer will update the main post with code link.
* Add a Discord announcement post and @everyone with link to the release issue, release notes and other content, like video and forum post.
* Add a Matrix announcement post and @room with links like above.
* Share the news on reddit + Lemmy. Good subs to share with: * Share the news on reddit + Lemmy. Good subs to share with:
* r/linux_gaming * r/linux_gaming
* r/opensourcegames * r/opensourcegames
* r/opensource * r/opensource
* r/freesoftware * r/freesoftware
* r/linuxmasterrace * r/linuxmasterrace
* r/MineClone2 * r/VoxeLibre
* r/MineClone2 (*for now*)
## Hotfix Release
### Before releasing
First, determine if the current state of the master branch is fine for the Hotfix.
In general, Hotfixes shouldn't contain new features to minimize the risk of regressions.
* If it hasn't been long since the release, and the only PRs merged so far are bugfixes and/or documentation changes,
it is certainly fine to use it as a base for the release.
* If there are some features merged, but they are aimed at fixing/alleviating important issues with the last released version, it may still be fine.
* If there are some simple QoL features merged that are irrelevant to the last release, it may still be fine to use it as a base for the Hotfix.
* If there are major features or large overhauls merged, it *most probably* is **not** fine to use as a base for the Hotfix.
If you decided that the current state of the master branch can be used as the Hotfix version, make sure that all the PRs merged since the last release
are in the Hotfix milestone and you are working on a clean branch based on the master branch, up-to-date with the one on the repo.
In this case, **skip** the following section.
### Prepare release branch
If you decided that the current state of the master branch shouldn't be used as the Hotfix version, you must prepare a release branch.
1. Create release branch from the last release tag, push it:
```
git checkout -b release/0.82.1 0.82.0
git push origin release/0.82.1
```
2. Cherry-pick the relevant commits from the master branch, or merge them from other (PR) branches.
3. Make sure your local copy of the branch contains all the relevant changes, **do not rebase**.
### Release process
1. Update CREDITS.md if it is needed
2. Update version in game.conf
3. If you've changed CREDITS.md, run the script:
```
lua tools/generate_ingame_credits.lua
```
4. Make a commit for the above:
```
git add game.conf
git commit -m "Set version for hotfix v0.87.1"
```
or, if credits got updated:
```
git add CREDITS.md
git add mods/HUD/mcl_credits/people.lua
git add game.conf
git commit -m "Updated release credits and set version for hotfix v0.87.1"
```
5. Add a section in the last releasnotes, like this:
```
## 0.87.1 hotfix
```
and describe the changes there
6. Make a commit for the releasenotes changes:
```
git add releasenotes/0_87-the_prismatic_release.md
git commit -m "Update release notes for hotfix v0.87.1"
```
7. **Tag and push to the tag:**
```
git tag 0.87.1
git push origin 0.87.1
```
8. If you are skipping some changes from the master branch (and thus are using a prepared master branch from the previous section),
push to the remote and skip the next two steps:
```
git push origin release/0.82.1
```
9. If you're releasing master branch, update version in game.conf to the next version with -SNAPSHOT suffix:
```
git commit -m "Post-hotfix reset version 0.88.0-SNAPSHOT"
```
10. If you're releasing master branch, push the above to a new branch, and make the release PR. Merge to finalize release process.
### Release via ContentDB
1. Go to VoxeLibre page (https://content.minetest.net/packages/Wuzzy/mineclone2/)
2. Click [+Release] button
3. Enter the release tag number in the title and Git reference box. For example (without quotes): "0.87.1"
4. In the minimum minetest version, put the oldest supported version (as of 19/05/2024 it is 5.6), leave the Maximum minetest version blank
5. Click save. Hotfix is now live.
### After releasing
...inform people.
* Add a comment to the forum post with the release number and change log. Maintainer will update the main post with code link.
* Add a Discord announcement post and @everyone with link to the release issue and release notes, and describe briefly what the hotfix does.
* Add a Matrix announcement post and @room with content like above.
* Share the news on reddit + Lemmy. Good subs to share with:
* r/linux_gaming
* r/opensourcegames
* r/opensource
* r/freesoftware
* r/linuxmasterrace
* r/VoxeLibre
* r/MineClone2 (*for now*)

View File

@ -1,9 +1,9 @@
# Making Textures In Mineclone2 # Making Textures In VoxeLibre
Textures are a crucial asset for all items, nodes, and models in mineclone2. This document is for artist who would like to make and modify textures for mineclone2. While no means comprehensive, this document contains the basic important information for beginners to get started with texture curation and optimization. Textures are a crucial asset for all items, nodes, and models in VoxeLibre. This document is for artist who would like to make and modify textures for VoxeLibre. While no means comprehensive, this document contains the basic important information for beginners to get started with texture curation and optimization.
## Minetest Wiki ## Minetest Wiki
For more detailed information on creating and modifing texture packs for Minetest/Mineclone2, please visit the Minetest wiki's page on creating a texture pack. Click [here](https://wiki.minetest.net/Creating_texture_packs) to view the wiki page on creating texture packs. For more detailed information on creating and modifing texture packs for Minetest/VoxeLibre, please visit the Minetest wiki's page on creating a texture pack. Click [here](https://wiki.minetest.net/Creating_texture_packs) to view the wiki page on creating texture packs.
## GIMP Tutorials Pixel Art Guide ## GIMP Tutorials Pixel Art Guide
GIMP Tutorials has an excellent guide to making pixel art in GIMP. If you would like further clarification as well as screenshots for what we are about to cover, it is an excellent resource to turn to. Click [here](https://thegimptutorials.com/how-to-make-pixel-art/) to view the guide GIMP Tutorials has an excellent guide to making pixel art in GIMP. If you would like further clarification as well as screenshots for what we are about to cover, it is an excellent resource to turn to. Click [here](https://thegimptutorials.com/how-to-make-pixel-art/) to view the guide

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

View File

@ -16,7 +16,7 @@ information.
How the mod is used How the mod is used
=================== ===================
In MineClone 2, all diggable nodes have the hardness set in the custom field In VoxeLibre, all diggable nodes have the hardness set in the custom field
"_mcl_hardness" (0 by default). These values are used together with digging "_mcl_hardness" (0 by default). These values are used together with digging
groups by this mod to create the correct digging times for nodes. Digging groups by this mod to create the correct digging times for nodes. Digging
groups are registered using the following code: groups are registered using the following code:
@ -117,10 +117,6 @@ end
-- Array of unique hardness values for each group which affects dig time. -- Array of unique hardness values for each group which affects dig time.
local hardness_values = get_hardness_values_for_groups() local hardness_values = get_hardness_values_for_groups()
-- Map indexed by hardness values which return the index of that value in
-- hardness_value. Used for quick lookup.
local hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
--[[local function compute_creativetimes(group) --[[local function compute_creativetimes(group)
local creativetimes = {} local creativetimes = {}
@ -186,6 +182,7 @@ local function add_groupcaps(toolname, groupcaps, groupcaps_def, efficiency)
local mult = capsdef.speed or 1 local mult = capsdef.speed or 1
local uses = capsdef.uses local uses = capsdef.uses
local def = mcl_autogroup.registered_diggroups[g] local def = mcl_autogroup.registered_diggroups[g]
assert(def, toolname .. " has unknown diggroup '" .. dump(g) .. "'")
local max_level = def.levels and #def.levels or 1 local max_level = def.levels and #def.levels or 1
assert(capsdef.level, toolname .. ' is missing level for ' .. g) assert(capsdef.level, toolname .. ' is missing level for ' .. g)
@ -313,6 +310,13 @@ function mcl_autogroup.get_wear(toolname, diggroup)
end end
local function overwrite() local function overwrite()
-- Refresh, now that all groups are known.
hardness_values = get_hardness_values_for_groups()
-- Map indexed by hardness values which return the index of that value in
-- hardness_value. Used for quick lookup.
local hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
for nname, ndef in pairs(minetest.registered_nodes) do for nname, ndef in pairs(minetest.registered_nodes) do
local newgroups = table.copy(ndef.groups) local newgroups = table.copy(ndef.groups)
if (nname ~= "ignore" and ndef.diggable) then if (nname ~= "ignore" and ndef.diggable) then
@ -374,4 +378,5 @@ local function overwrite()
end end
end end
overwrite() -- Make sure all tools and groups are registered
minetest.register_on_mods_loaded(overwrite)

View File

@ -1,3 +1,4 @@
name = _mcl_autogroup name = _mcl_autogroup
depends = mcl_autogroup
author = ryvnf author = ryvnf
description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times. description = VoxeLibre core mod which automatically adds groups to all items. Very important for digging times.

View File

@ -2,33 +2,33 @@
Simple flow functions. Simple flow functions.
## flowlib.is_touching(realpos, nodepos, radius) ## flowlib.is_touching(realpos, nodepos, radius)
Return true if a sphere of <radius> at <realpos> collide with node at <nodepos>. Return true if a sphere of `radius` at `realpos` collide with node at `nodepos`.
* realpos: position * realpos: position
* nodepos: position * nodepos: position
* radius: number * radius: number
## flowlib.is_water(pos) ## flowlib.is_water(pos)
Return true if node at <pos> is water, false overwise. Return true if node at `pos` is water, false otherwise.
* pos: position * pos: position
## flowlib.node_is_water(node) ## flowlib.node_is_water(node)
Return true if <node> is water, false overwise. Return true if `node` is water, false otherwise.
* node: node * node: node
## flowlib.is_lava(pos) ## flowlib.is_lava(pos)
Return true if node at <pos> is lava, false overwise. Return true if node at `pos` is lava, false otherwise.
* pos: position * pos: position
## flowlib.node_is_lava(node) ## flowlib.node_is_lava(node)
Return true if <node> is lava, false overwise. Return true if `node` is lava, false otherwise.
* node: node * node: node
## flowlib.is_liquid(pos) ## flowlib.is_liquid(pos)
Return true if node at <pos> is liquid, false overwise. Return true if node at `pos` is liquid, false otherwise.
* pos: position * pos: position
## flowlib.node_is_liquid(node) ## flowlib.node_is_liquid(node)
Return true if <node> is liquid, false overwise. Return true if `node` is liquid, false otherwise.
* node: node * node: node
## flowlib.quick_flow(pos, node) ## flowlib.quick_flow(pos, node)
@ -37,9 +37,9 @@ Return direction where the water is flowing (to be use to push mobs, items...).
* node: node * node: node
## flowlib.move_centre(pos, realpos, node, radius) ## flowlib.move_centre(pos, realpos, node, radius)
Return the pos of the nearest not water block near from <pos> in a sphere of <radius> at <realpos>. Return the pos of the nearest not water block near from `pos` in a sphere of `radius` at `realpos`.
WARNING: This function is never used in mcl2, use at your own risk. The informations described here may be wrong. WARNING: This function is never used in VL, use at your own risk. The informations described here may be wrong.
* pos: position * pos: position
* realpos: position, position of the entity * realpos: position, position of the entity
* node: node * node: node
* radius: number * radius: number

View File

@ -1,5 +1,5 @@
-- Overrides the builtin minetest.check_single_for_falling. -- Overrides the builtin minetest.check_single_for_falling.
-- We need to do this in order to handle nodes in mineclone specific groups -- We need to do this in order to handle nodes in VoxeLibre specific groups
-- "supported_node" and "attached_node_facedir". -- "supported_node" and "attached_node_facedir".
-- --
-- Nodes in group "supported_node" can be placed on any node that does not -- Nodes in group "supported_node" can be placed on any node that does not
@ -94,5 +94,16 @@ function minetest.check_single_for_falling(pos)
end end
end end
if get_item_group(node.name, "supported_node_facedir") ~= 0 then
local dir = facedir_to_dir(node.param2)
if dir then
local def = registered_nodes[get_node(vector.add(pos, dir)).name]
if def and def.drawtype == "airlike" then
drop_attached_node(pos)
return true
end
end
end
return false return false
end end

View File

@ -1,8 +1,8 @@
# mcl_autogroup # mcl_autogroup
This mod emulate digging times from mc. This mod emulates digging times from MC.
## mcl_autogroup.can_harvest(nodename, toolname, player) ## mcl_autogroup.can_harvest(nodename, toolname, player)
Return true if <nodename> can be dig with <toolname> by <player>. Return true if `nodename` can be dig with `toolname` by <player>.
* nodename: string, valid nodename * nodename: string, valid nodename
* toolname: (optional) string, valid toolname * toolname: (optional) string, valid toolname
* player: (optinal) ObjectRef, valid player * player: (optinal) ObjectRef, valid player
@ -14,7 +14,7 @@ WARNING: This function can only be called after mod initialization.
* efficiency: (optional) integer, the efficiency level the tool is enchanted with (default 0) * efficiency: (optional) integer, the efficiency level the tool is enchanted with (default 0)
## mcl_autogroup.get_wear(toolname, diggroup) ## mcl_autogroup.get_wear(toolname, diggroup)
Return the max wear of <toolname> with <diggroup> Return the max wear of `toolname` with `diggroup`
WARNING: This function can only be called after mod initialization. WARNING: This function can only be called after mod initialization.
* toolname: string, name of the tool used * toolname: string, name of the tool used
* diggroup: string, the name of the diggroup the tool is used on * diggroup: string, the name of the diggroup the tool is used on
@ -25,4 +25,4 @@ WARNING: This function can only be called after mod initialization.
* level: (optional) string, if specified it is an array containing the names of the different digging levels the digging group supports * level: (optional) string, if specified it is an array containing the names of the different digging levels the digging group supports
## mcl_autogroup.registered_diggroups ## mcl_autogroup.registered_diggroups
List of registered diggroups, indexed by name. List of registered diggroups, indexed by name.

View File

@ -1,3 +1,3 @@
name = mcl_autogroup name = mcl_autogroup
author = ryvnf author = ryvnf
description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times. description = VoxeLibre core mod which automatically adds groups to all items. Very important for digging times.

View File

@ -1,5 +1,5 @@
# mcl_colors # mcl_colors
Mod providing global table containing legacity minecraft colors to be used in mods. Mod providing global table containing legacy Minecraft colors to be used in mods.
## mcl_colors.* ## mcl_colors.*
Colors by upper name, in hex value. Colors by upper name, in hex value.

View File

@ -6,10 +6,10 @@ WARNING: Not using it inside your mods may cause strange bugs (using the native
## Callbacks ## Callbacks
To modify the amount of damage made by something: To modify the amount of damage dealt by something:
```lua ```lua
--obj: an ObjectRef --obj: an ObjectRef
mcl_damage.register_modifier(function(obj, damage, reason) mcl_damage.register_modifier(function(obj, damage, reason)
end, 0) end, 0)
``` ```

View File

@ -1,9 +1,13 @@
## mcl_events # mcl_events
### Registering Events
`mlc_events.register_event("name",def)`
#### Event Definition ## Registering Events
{
`mcl_events.register_event("name", def)`
### Event Definition
```
{
stage = 0, stage = 0,
max_stage = 1, max_stage = 1,
percent = 100, percent = 100,
@ -22,6 +26,8 @@
cond_complete = function(event) end, cond_complete = function(event) end,
--return true if event finished successfully --return true if event finished successfully
} }
```
### Debugging ## Debugging
* /event_start <event> -- starts the given event at the current player coordinates
* /event_start `event` -- starts the given event at the current player coordinates

View File

@ -3,13 +3,13 @@ This mod provide helper functions to create explosions.
## mcl_explosions.explode(pos, strength, info, puncher) ## mcl_explosions.explode(pos, strength, info, puncher)
* pos: position, initial position of the explosion * pos: position, initial position of the explosion
* strenght: number, radius of the explosion * strength: number, radius of the explosion
* info: table, explosion informations: * info: table, explosion informations:
* drop_chance: number, if specified becomes the drop chance of all nodes in the explosion (default: 1.0 / strength) * drop_chance: number, if specified becomes the drop chance of all nodes in the explosion (default: 1.0 / strength)
* max_blast_resistance: int, if specified the explosion will treat all non-indestructible nodes as having a blast resistance of no more than this value * max_blast_resistance: int, if specified the explosion will treat all non-indestructible nodes as having a blast resistance of no more than this value
* sound: bool, if true, the explosion will play a sound (default: true) * sound: bool, if true, the explosion will play a sound (default: true)
* particles: bool, if true, the explosion will create particles (default: true) * particles: bool, if true, the explosion will create particles (default: true)
* fire: bool, if true, 1/3 nodes become fire (default: false) * fire: bool, if true, 1/3 of nodes become fire (default: false)
* griefing: bool, if true, the explosion will destroy nodes (default: true) * griefing: bool, if true, the explosion will destroy nodes (default: true)
* grief_protected: bool, if true, the explosion will also destroy nodes which have been protected (default: false) * grief_protected: bool, if true, the explosion will also destroy nodes which have been protected (default: false)
* puncher: (optional) entity, will be used as source for damage done by the explosion * puncher: (optional) entity, will be used as source for damage done by the explosion

View File

@ -1,8 +1,8 @@
--[[ --[[
Explosion API mod for Minetest (adapted to MineClone 2) Explosion API mod for Minetest (adapted to VoxeLibre)
This mod is based on the Minetest explosion API mod, but has been changed This mod is based on the Minetest explosion API mod, but has been changed
to have the same explosion mechanics as Minecraft and work with MineClone. to have the same explosion mechanics as Minecraft and work with VoxeLibre
The computation-intensive parts of the mod has been optimized to allow for The computation-intensive parts of the mod has been optimized to allow for
larger explosions and faster world updating. larger explosions and faster world updating.

View File

@ -1,6 +1,8 @@
-- Some global variables (don't overwrite them!) -- Some global variables (don't overwrite them!)
mcl_vars = {} mcl_vars = {}
minetest.log("action", "World seed = " .. minetest.get_mapgen_setting("seed"))
mcl_vars.redstone_tick = 0.1 mcl_vars.redstone_tick = 0.1
-- GUI / inventory menu settings -- GUI / inventory menu settings
@ -36,6 +38,8 @@ mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16)
mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000) mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000)
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, minetest.MAX_MAP_GENERATION_LIMIT or 31000) mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, minetest.MAX_MAP_GENERATION_LIMIT or 31000)
-- Central chunk is offset from 0,0,0 coordinates by 32 nodes (2 blocks)
-- See more in https://git.minetest.land/VoxeLibre/VoxeLibre/wiki/World-structure%3A-positions%2C-boundaries%2C-blocks%2C-chunks%2C-dimensions%2C-barriers-and-the-void
local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2) local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2)
mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
@ -181,7 +185,7 @@ mcl_vars.mg_end_exit_portal_pos = vector.new(0, mcl_vars.mg_end_min + 71, 0)
mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max
mcl_vars.mg_realm_barrier_overworld_end_min = mcl_vars.mg_end_max - 11 mcl_vars.mg_realm_barrier_overworld_end_min = mcl_vars.mg_end_max - 11
-- Use MineClone 2-style dungeons -- Use VoxeLibre-style dungeons
mcl_vars.mg_dungeons = true mcl_vars.mg_dungeons = true
-- Set default stack sizes -- Set default stack sizes

View File

@ -1,3 +1,3 @@
name = mcl_init name = mcl_init
author = Wuzzy author = Wuzzy
description = Initialization mod of MineClone 2. Defines some common shared variables and sets up initial default settings which have to be set at the beginning. description = Initialization mod of VoxeLibre. Defines some common shared variables and sets up initial default settings which have to be set at the beginning.

View File

@ -1,4 +1,4 @@
# Oxidization API for MineClone 2 # Oxidization API for VoxeLibre
This mods adds the oxidization api, so that modders can easily use the same features that copper uses. This mods adds the oxidization api, so that modders can easily use the same features that copper uses.
## API ## API

View File

@ -1,4 +1,4 @@
name = mcl_oxidation name = mcl_oxidation
title = Oxidation API for MineClone 2 title = Oxidation API for VoxeLibre
author = PrairieWind, N011, Michael author = PrairieWind, N011, Michael
description = API to allow oxidizing different nodes. description = API to allow oxidizing different nodes.

View File

@ -1,3 +1,2 @@
name = mcl_particles name = mcl_particles
author = Wuzzy author = Wuzzy
description = Contains particle images of MineClone 2. No code.

View File

@ -1,3 +1,3 @@
name = mcl_sounds name = mcl_sounds
author = Wuzzy author = Wuzzy
description = This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them. description = This mod contains the core sounds of VoxeLibre as well as helper function for mods to access them.

View File

@ -1,5 +1,7 @@
mcl_util = {} mcl_util = {}
dofile(minetest.get_modpath(minetest.get_current_modname()).."/roman_numerals.lua")
-- Updates all values in t using values from to*. -- Updates all values in t using values from to*.
function table.update(t, ...) function table.update(t, ...)
for _, to in ipairs {...} do for _, to in ipairs {...} do
@ -46,6 +48,20 @@ function table.pairs_by_keys(t, f)
return iter return iter
end end
-- Removes one element randomly selected from the array section of the table and
-- returns it, or nil if there are no elements in the array section of the table
function table.remove_random_element(table)
local count = #table
if count == 0 then return nil end
local idx = math.random(count)
local res = table[idx]
table[idx] = table[count]
table[count] = nil
count = count - 1
return res
end
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_default", false) local LOGGING_ON = minetest.settings:get_bool("mcl_logging_default", false)
local LOG_MODULE = "[MCL2]" local LOG_MODULE = "[MCL2]"
function mcl_util.mcl_log(message, module, bypass_default_logger) function mcl_util.mcl_log(message, module, bypass_default_logger)
@ -113,7 +129,7 @@ end
-- Minetest 5.3.0 or less can only measure the light level. This came in at 5.4 -- 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 -- This function has been known to fail in multiple places so the error handling is added increase safety and improve
-- debugging. See: -- debugging. See:
-- https://git.minetest.land/MineClone2/MineClone2/issues/1392 -- https://git.minetest.land/VoxeLibre/VoxeLibre/issues/1392
function mcl_util.get_natural_light (pos, time) function mcl_util.get_natural_light (pos, time)
local status, retVal = pcall(minetest.get_natural_light, pos, time) local status, retVal = pcall(minetest.get_natural_light, pos, time)
if status then if status then
@ -257,12 +273,21 @@ end
---@param dst_inventory InvRef Destination inventory to push to ---@param dst_inventory InvRef Destination inventory to push to
---@param dst_list string Name of destination inventory list 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. ---@param condition? fun(stack: ItemStack) Condition which items are allowed to be transfered.
---@param count? integer Number of items to try to transfer at once
---@return integer Item stack number 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) function mcl_util.select_stack(src_inventory, src_list, dst_inventory, dst_list, condition, count)
local src_size = src_inventory:get_size(src_list) local src_size = src_inventory:get_size(src_list)
local stack local stack
for i = 1, src_size do for i = 1, src_size do
stack = src_inventory:get_stack(src_list, i) stack = src_inventory:get_stack(src_list, i)
-- Allow for partial stack movement
if count and stack:get_count() >= count then
local new_stack = ItemStack(stack)
new_stack:set_count(count)
stack = new_stack
end
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 dst_inventory:room_for_item(dst_list, stack) and ((condition == nil or condition(stack))) then
return i return i
end end
@ -280,21 +305,22 @@ end
-- Returns true on success and false on failure -- Returns true on success and false on failure
-- Possible failures: No item in source slot, destination inventory full -- 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) function mcl_util.move_item(source_inventory, source_list, source_stack_id, destination_inventory, destination_list)
if not source_inventory:is_empty(source_list) then -- Can't move items we don't have
local stack = source_inventory:get_stack(source_list, source_stack_id) if source_inventory:is_empty(source_list) then return false end
if not stack:is_empty() then
local new_stack = ItemStack(stack) -- Can't move from an empty stack
new_stack:set_count(1) local stack = source_inventory:get_stack(source_list, source_stack_id)
if not destination_inventory:room_for_item(destination_list, new_stack) then if stack:is_empty() then return false end
return false
end local new_stack = ItemStack(stack)
stack:take_item() new_stack:set_count(1)
source_inventory:set_stack(source_list, source_stack_id, stack) if not destination_inventory:room_for_item(destination_list, new_stack) then
destination_inventory:add_item(destination_list, new_stack) return false
return true
end
end end
return false stack:take_item()
source_inventory:set_stack(source_list, source_stack_id, stack)
destination_inventory:add_item(destination_list, new_stack)
return true
end end
--- Try pushing item from hopper inventory to destination inventory --- Try pushing item from hopper inventory to destination inventory
@ -314,25 +340,23 @@ function mcl_util.hopper_push(pos, dst_pos)
local dst_list = 'main' local dst_list = 'main'
local dst_inv, stack_id local dst_inv, stack_id
-- Find a inventory stack in the destination
if dst_def._mcl_hoppers_on_try_push then 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) dst_inv, dst_list, stack_id = dst_def._mcl_hoppers_on_try_push(dst_pos, pos, hop_inv, hop_list)
else else
local dst_meta = minetest.get_meta(dst_pos) local dst_meta = minetest.get_meta(dst_pos)
dst_inv = dst_meta:get_inventory() dst_inv = dst_meta:get_inventory()
stack_id = mcl_util.select_stack(hop_inv, hop_list, dst_inv, dst_list) stack_id = mcl_util.select_stack(hop_inv, hop_list, dst_inv, dst_list, nil, 1)
end
if not stack_id then return false end
-- Move the item
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)
end end
if stack_id ~= nil then return ok
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)
end
if ok then
return true
end
end
return false
end end
-- Try pulling from source inventory to hopper inventory -- Try pulling from source inventory to hopper inventory
@ -357,7 +381,7 @@ function mcl_util.hopper_pull(pos, src_pos)
else else
local src_meta = minetest.get_meta(src_pos) local src_meta = minetest.get_meta(src_pos)
src_inv = src_meta:get_inventory() src_inv = src_meta:get_inventory()
stack_id = mcl_util.select_stack(src_inv, src_list, hop_inv, hop_list) stack_id = mcl_util.select_stack(src_inv, src_list, hop_inv, hop_list, nil, 1)
end end
if stack_id ~= nil then if stack_id ~= nil then
@ -428,10 +452,11 @@ function mcl_util.generate_on_place_plant_function(condition)
if not def_under or not def_above then if not def_under or not def_above then
return itemstack return itemstack
end end
if def_under.buildable_to then if def_under.buildable_to and def_under.name ~= itemstack:get_name() then
place_pos = pointed_thing.under place_pos = pointed_thing.under
elseif def_above.buildable_to then elseif def_above.buildable_to and def_above.name ~= itemstack:get_name() then
place_pos = pointed_thing.above place_pos = pointed_thing.above
pointed_thing.under = pointed_thing.above
else else
return itemstack return itemstack
end end
@ -526,6 +551,7 @@ end
function mcl_util.use_item_durability(itemstack, n) function mcl_util.use_item_durability(itemstack, n)
local uses = mcl_util.calculate_durability(itemstack) local uses = mcl_util.calculate_durability(itemstack)
itemstack:add_wear(65535 / uses * n) itemstack:add_wear(65535 / uses * n)
tt.reload_itemstack_description(itemstack) -- update tooltip
end end
function mcl_util.deal_damage(target, damage, mcl_reason) function mcl_util.deal_damage(target, damage, mcl_reason)
@ -1091,3 +1117,39 @@ function mcl_util.is_it_christmas()
return false return false
end end
end end
function mcl_util.to_bool(val)
if not val then return false end
return true
end
if not vector.in_area then
-- backport from minetest 5.8, can be removed when the minimum version is 5.8
vector.in_area = function(pos, min, max)
return (pos.x >= min.x) and (pos.x <= max.x) and
(pos.y >= min.y) and (pos.y <= max.y) and
(pos.z >= min.z) and (pos.z <= max.z)
end
end
-- Traces along a line of nodes vertically to find the next possition that isn't an allowed node
---@param pos The position to start tracing from
---@param dir The direction to trace in. 1 is up, -1 is down, all other values are not allowed.
---@param allowed_nodes A set of node names to trace along.
---@param limit The maximum number of steps to make. Defaults to 16 if nil or missing
---@return Three return values:
--- the position of the next node that isn't allowed or nil if no such node was found,
--- the distance from the start where that node was found,
--- the node table if a node was found
function mcl_util.trace_nodes(pos, dir, allowed_nodes, limit)
if (dir ~= -1) and (dir ~= 1) then return nil, 0, nil end
limit = limit or 16
for i = 1,limit do
pos = vector.offset(pos, 0, dir, 0)
local node = minetest.get_node(pos)
if not allowed_nodes[node.name] then return pos, i, node end
end
return nil, limit, nil
end

View File

@ -1,4 +1,4 @@
name = mcl_util name = mcl_util
author = Wuzzy author = Wuzzy
description = Helper functions for MineClone 2. description = Helper functions for VoxeLibre.
depends = mcl_init depends = mcl_init

View File

@ -0,0 +1,30 @@
local converter = {
{1000, "M"},
{900, "CM"},
{500, "D"},
{400, "CD"},
{100, "C"},
{90, "XC"},
{50, "L"},
{40, "XL"},
{10, "X"},
{9, "IX"},
{5, "V"},
{4, "IV"},
{1, "I"}
}
mcl_util.to_roman = function(number)
local r = ""
local a = number
local i = 1
while a > 0 do
if a >= converter[i][1] then
a = a - converter[i][1]
r = r.. converter[i][2]
else
i = i + 1
end
end
return r
end

View File

@ -5,20 +5,21 @@ This mod provides utility functions about positions and dimensions.
This function returns: This function returns:
* true, true: if pos is in deep void (deadly) * true, true: if pos is in deep void (deadly)
* true, false: if the pos is in void (non deadly) * true, false: if the pos is in void (non-deadly)
* false, false: owerwise * false, false: otherwise
Params: Params:
* pos: position * pos: position
## mcl_worlds.y_to_layer(y) ## mcl_worlds.y_to_layer(y)
This function is used to calculate the minetest y layer and dimension of the given <y> minecraft layer. This function is used to calculate the Minetest y layer and dimension of the given y Minecraft layer.
Mainly used for ore generation. Mainly used for ore generation.
Takes an Y coordinate as input and returns: Takes a Y coordinate as input and returns:
* The corresponding Minecraft layer (can be `nil` if void)
* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if y is in the void
* The corresponding Minecraft layer (can be nil if void)
* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if <y> is in the void
If the Y coordinate is not located in any dimension, it will return: nil, "void" If the Y coordinate is not located in any dimension, it will return: nil, "void"
Params: Params:
@ -26,43 +27,44 @@ Params:
* y: int * y: int
## mcl_worlds.pos_to_dimension(pos) ## mcl_worlds.pos_to_dimension(pos)
This function return the Minecraft dimension of <pos> ("overworld", "nether" or "end") or "void" if <y> is in the void. This function return the Minecraft dimension of pos ("overworld", "nether" or "end") or "void" if y is in the void.
* pos: position * pos: position
## mcl_worlds.layer_to_y(layer, mc_dimension) ## mcl_worlds.layer_to_y(layer, mc_dimension)
Takes a Minecraft layer and a “dimension” name and returns the corresponding Y coordinate for MineClone 2. Takes a Minecraft layer and a “dimension” name and returns the corresponding Y coordinate for VoxeLibre.
mc_dimension can be "overworld", "nether", "end" (default: "overworld"). mc_dimension can be "overworld", "nether", "end" (default: "overworld").
* layer: int * layer: int
* mc_dimension: string * mc_dimension: string
## mcl_worlds.has_weather(pos) ## mcl_worlds.has_weather(pos)
Returns true if <pos> can have weather, false owerwise. Returns true if pos can have weather, false otherwise.
Weather can be only in the overworld. Weather can be only in the overworld.
* pos: position * pos: position
## mcl_worlds.has_dust(pos) ## mcl_worlds.has_dust(pos)
Returns true if <pos> can have nether dust, false owerwise. Returns true if pos can have nether dust, false otherwise.
Nether dust can be only in the nether. Nether dust can be only in the nether.
* pos: position * pos: position
## mcl_worlds.compass_works(pos) ## mcl_worlds.compass_works(pos)
Returns true if compasses are working at <pos>, false owerwise. Returns true if compasses are working at pos, false otherwise.
In mc, you cant use compass in the nether and the end. In MC, you cant use compass in the nether and the end.
* pos: position * pos: position
## mcl_worlds.compass_works(pos) ## mcl_worlds.compass_works(pos)
Returns true if clock are working at <pos>, false owerwise. Returns true if clock are working at pos, false otherwise.
In mc, you cant use clock in the nether and the end. In MC, you cant use clock in the nether and the end.
* pos: position * pos: position
## mcl_worlds.register_on_dimension_change(function(player, dimension, last_dimension)) ## mcl_worlds.register_on_dimension_change(function(player, dimension, last_dimension))
Register a callback function func(player, dimension). Register a callback function func(player, dimension).
It will be called whenever a player changes between dimensions. It will be called whenever a player changes between dimensions.
The void counts as dimension. The void counts as dimension.
@ -75,7 +77,7 @@ The void counts as dimension.
Table containing all function registered with mcl_worlds.register_on_dimension_change() Table containing all function registered with mcl_worlds.register_on_dimension_change()
## mcl_worlds.dimension_change(player, dimension) ## mcl_worlds.dimension_change(player, dimension)
Notify this mod of a dimension change of <player> to <dimension> Notify this mod of a dimension change of player to dimension
* player: player, player who changed the dimension * player: player, player who changed the dimension
* dimension: string, new dimension ("overworld", "nether", "end", "void") * dimension: string, new dimension ("overworld", "nether", "end", "void")

View File

@ -58,7 +58,7 @@ local pos_to_dimension = mcl_worlds.pos_to_dimension
-- Takes a Minecraft layer and a “dimension” name -- Takes a Minecraft layer and a “dimension” name
-- and returns the corresponding Y coordinate for -- and returns the corresponding Y coordinate for
-- MineClone 2. -- VoxeLibre
-- mc_dimension is one of "overworld", "nether", "end" (default: "overworld"). -- mc_dimension is one of "overworld", "nether", "end" (default: "overworld").
function mcl_worlds.layer_to_y(layer, mc_dimension) function mcl_worlds.layer_to_y(layer, mc_dimension)
if mc_dimension == "overworld" or mc_dimension == nil then if mc_dimension == "overworld" or mc_dimension == nil then

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,4 +1,87 @@
# tga_encoder # tga_encoder
A TGA Encoder written in Lua without the use of external Libraries. A TGA Encoder written in Lua without the use of external Libraries.
Created by fleckenstein for VoxeLibre, then improved by erlehmann.
May be used as a Minetest mod. May be used as a Minetest mod.
See `examples.lua` for example code and usage hints.
## Use Cases for `tga_encoder`
### Encoding Textures for Editing
TGA images of types 1/2/3 consist of header data followed by a pixel array.
This makes it trivial to parse TGA files and even edit pixels in-place.
No checksums need to be updated on any kind of in-place texture editing.
**Tip**: When storing an editable image in item meta, use zlib compression.
### Legacy Minetest Texture Encoding
Minetest 5.4 did not include `minetest.encode_png()` (or any equvivalent).
Since `tga_encoder` is written in pure Lua, it does not need engine support.
**Tip:** Look at `examples.lua` and the Minetest mod `mcl_maps` for guidance.
### Advanced Texture Format Control
The function `minetest.encode_png()` always encodes images as 32bpp RGBA.
`tga_encoder` allows saving images as grayscale, 16bpp RGBA and 24bpp RGB.
For generating maps from terrain, color-mapped formats can be more useful.
### Encoding Very Small Textures
Images of size 8×8 or below are often smaller than an equivalent PNG file.
Note that on many filesystems files use at least 4096 bytes (i.e. 64×64).
Therefore, saving bytes on files up to a few 100 bytes is often useless.
### Encoding Reference Textures
TGA is a simple format, which makes it easy to create reference textures.
Using a hex editor, one can trivially see how all the pixels are stored.
## Supported Image Types
For all types, images are encoded in a fast single pass (i.e. append-only).
### Color-Mapped Images (Type 1)
These images contain a palette, followed by pixel data.
* `A1R5G5B5` (8bpp RGB)
* `B8G8R8` (8bpp RGB)
* `B8G8R8A8` (8bpp RGBA)
### True-Color Images (Type 2)
These images contain uncompressed RGB(A) pixel data.
* `A1R5G5B5` (16bpp RGBA)
* `B8G8R8` (24bpp RGB)
* `B8G8R8A8` (32bpp RGBA)
### Grayscale Images (Type 3)
* `Y8` (8bpp grayscale)
### Run-Length Encoded (RLE), True-Color Images (Type 10)
These images contain compressed RGB(A) pixel data.
* `A1R5G5B5` (16bpp RGBA)
* `B8G8R8` (24bpp RGB)
* `B8G8R8A8` (32bpp RGBA)
## TODO
* Actually support `R8G8B8A8` input for `A1R5G5B5` output
* Add both zoomable and explorable maps to `mcl_maps`.

View File

@ -0,0 +1,32 @@
dofile("init.lua")
-- This generates images necessary to colorize 16 Minetest nodes in 4096 colors.
-- It serves as a demonstration of what you can achieve using colormapped nodes.
-- It is be useful for grass or beam or glass nodes that need to blend smoothly.
-- Sample depth rescaling is done according to the algorithm presented in:
-- <https://www.w3.org/TR/2003/REC-PNG-20031110/#13Sample-depth-rescaling>
local max_sample_in = math.pow(2, 4) - 1
local max_sample_out = math.pow(2, 8) - 1
for r = 0,15 do
local pixels = {}
for g = 0,15 do
if nil == pixels[g + 1] then
pixels[g + 1] = {}
end
for b = 0,15 do
local color = {
math.floor((r * max_sample_out / max_sample_in) + 0.5),
math.floor((g * max_sample_out / max_sample_in) + 0.5),
math.floor((b * max_sample_out / max_sample_in) + 0.5),
}
pixels[g + 1][b + 1] = color
end
end
local filename = "colormap_" .. tostring(r) .. ".tga"
tga_encoder.image(pixels):save(
filename,
{ color_format="A1R5G5B5" } -- waste less bits
)
end

View File

@ -0,0 +1,105 @@
#!/usr/bin/env lua5.1
-- -*- coding: utf-8 -*-
-- 3D “donut” shape rendering using floating-point math
-- see <https://www.a1k0n.net/2011/07/20/donut-math.html>
-- cargo-culted by erle 2023-09-18
local theta_spacing = 0.01 -- 0.07
local phi_spacing = 0.002 -- 0.02
local R1 = 1
local R2 = 2
local K2 = 5
local screen_height = 256
local screen_width = 256
local K1 = screen_width * K2 * 3 / ( 8 * ( R1 + R2 ) )
local output = {}
local zbuffer = {}
local grey = { 120, 120, 120 }
local gray = { 136, 136, 136 }
for y = 1,screen_height,1 do
output[y] = {}
zbuffer[y] = {}
for x = 1,screen_width,1 do
local hori = math.floor( ( (y - 1) / 32 ) % 2 )
local vert = math.floor( ( (x - 1) / 32 ) % 2 )
output[y][x] = hori ~= vert and grey or gray
zbuffer[y][x] = 0
end
end
function render_frame(A, B)
-- precompute sines and cosines of A and B
local cosA = math.cos(A)
local sinA = math.sin(A)
local cosB = math.cos(B)
local sinB = math.sin(B)
-- theta goas around the cross-sectional circle of a torus
local theta = 0
while theta <= 2*math.pi do
if ( theta < 2*math.pi * 1/8 ) or ( theta > 2*math.pi * 7/8 ) then
theta = theta + (theta_spacing * 16)
else
theta = theta + theta_spacing
end
-- precompute sines and cosines of theta
local costheta = math.cos(theta)
local sintheta = math.sin(theta)
-- phi goes around the center of revolution of a torus
local phi = 0
while phi <= 2*math.pi do
if ( phi > 2*math.pi * 3/8 ) and ( phi < 2*math.pi * 5/8 ) then
phi = phi + (phi_spacing * 128)
else
phi = phi + phi_spacing
end
-- precompute sines and cosines of phi
local cosphi = math.cos(phi)
local sinphi = math.sin(phi)
-- 2D (x, y) coordinates of the circle, before revolving
local circlex = R2 + R1*costheta
local circley = R1*sintheta
-- 3D (x, y, z) coordinates after rotation
local x = circlex*(cosB*cosphi + sinA*sinB*sinphi) - circley*cosA*sinB
local y = circlex*(sinB*cosphi - sinA*cosB*sinphi) + circley*cosA*cosB
local z = K2 + cosA*circlex*sinphi + circley*sinA
local ooz = 1/z
-- x and y projection
local xp = math.floor(screen_width/2 + K1*ooz*x)
local yp = math.floor(screen_height/2 + K1*ooz*y)
-- calculate luminance
local L = cosphi*costheta*sinB - cosA*costheta*sinphi - sinA*sintheta + cosB*( cosA*sintheta - costheta*sinA*sinphi )
-- if (L > 0) then
if (true) then
if (ooz > zbuffer[yp][xp]) then
zbuffer[yp][xp] = ooz
local luminance = math.max( math.ceil( L * 180 ), 0 )
-- luminance is now in the range 0 to 255
r = math.ceil( (luminance + xp) / 2 )
g = math.ceil( (luminance + yp) / 2 )
b = math.ceil( (luminance + xp + yp) / 3 )
output[yp][xp] = { r, g, b }
end
end
end
end
end
dofile('init.lua')
render_frame(-0.7, 0.7)
tga_encoder.image(output):save("donut.tga")

View File

@ -0,0 +1,181 @@
dofile("init.lua")
-- encode a bitmap
local _ = { 0, 0, 0 }
local R = { 255, 127, 127 }
local pixels = {
{ _, _, _, _, _, _, _ },
{ _, _, _, R, _, _, _ },
{ _, _, R, R, R, _, _ },
{ _, R, R, R, R, R, _ },
{ _, R, R, R, R, R, _ },
{ _, _, R, _, R, _, _ },
{ _, _, _, _, _, _, _ },
}
tga_encoder.image(pixels):save("bitmap_small.tga")
-- test that image can be encoded
local bitmap_small_0 = tga_encoder.image(pixels)
bitmap_small_0:encode()
assert(191 == #bitmap_small_0.data)
-- test that imbage can be encoded with parameters
local bitmap_small_1 = tga_encoder.image(pixels)
bitmap_small_1:encode(
{
colormap = {},
color_format = "B8G8R8",
compression = "RAW",
}
)
assert(191 == #bitmap_small_1.data)
-- change a single pixel, then rescale the bitmap
local pixels_orig = pixels
pixels_orig[4][4] = { 255, 255, 255 }
local pixels = {}
for x = 1,56,1 do
local x_orig = math.ceil(x/8)
for z = 1,56,1 do
local z_orig = math.ceil(z/8)
local color = pixels_orig[z_orig][x_orig]
pixels[z] = pixels[z] or {}
pixels[z][x] = color
end
end
tga_encoder.image(pixels):save("bitmap_large.tga")
-- note that the uncompressed grayscale TGA file written in this
-- example is 80 bytes but an optimized PNG file is 81 bytes …
local pixels = {}
for x = 1,6,1 do -- left to right
for z = 1,6,1 do -- bottom to top
local color = { math.min(x * z * 4 - 1, 255) }
pixels[z] = pixels[z] or {}
pixels[z][x] = color
end
end
tga_encoder.image(pixels):save("gradient_8bpp_raw.tga", {color_format="Y8", compression="RAW"})
local pixels = {}
for x = 1,16,1 do -- left to right
for z = 1,16,1 do -- bottom to top
local r = math.min(x * 32 - 1, 255)
local g = math.min(z * 32 - 1, 255)
local b = 0
-- blue rectangle in top right corner
if x > 8 and z > 8 then
r = 0
g = 0
b = math.min(z * 16 - 1, 255)
end
local color = { r, g, b }
pixels[z] = pixels[z] or {}
pixels[z][x] = color
end
end
local gradients = tga_encoder.image(pixels)
gradients:save("gradients_8bpp_raw.tga", {color_format="Y8", compression="RAW"})
gradients:save("gradients_16bpp_raw.tga", {color_format="A1R5G5B5", compression="RAW"})
gradients:save("gradients_16bpp_rle.tga", {color_format="A1R5G5B5", compression="RLE"})
gradients:save("gradients_24bpp_raw.tga", {color_format="B8G8R8", compression="RAW"})
gradients:save("gradients_24bpp_rle.tga", {color_format="B8G8R8", compression="RLE"})
for x = 1,16,1 do -- left to right
for z = 1,16,1 do -- bottom to top
local color = pixels[z][x]
color[#color+1] = ((x * x) + (z * z)) % 256
pixels[z][x] = color
end
end
gradients:save("gradients_32bpp_raw.tga", {color_format="B8G8R8A8", compression="RAW"})
-- the RLE-compressed file is larger than just dumping pixels because
-- the gradients in this picture can not be compressed well using RLE
gradients:save("gradients_32bpp_rle.tga", {color_format="B8G8R8A8", compression="RLE"})
local pixels = {}
for x = 1,512,1 do -- left to right
for z = 1,512,1 do -- bottom to top
local oz = (z - 256) / 256 + 0.75
local ox = (x - 256) / 256
local px, pz, i = 0, 0, 0
while (px * px) + (pz * pz) <= 4 and i < 128 do
px = (px * px) - (pz * pz) + oz
pz = (2 * px * pz) + ox
i = i + 1
end
local color = {
math.max(0, math.min(255, math.floor(px * 64))),
math.max(0, math.min(255, math.floor(pz * 64))),
math.max(0, math.min(255, math.floor(i))),
}
pixels[z] = pixels[z] or {}
pixels[z][x] = color
end
end
tga_encoder.image(pixels):save("fractal_8bpp.tga", {color_format="Y8"})
tga_encoder.image(pixels):save("fractal_16bpp.tga", {color_format="A1R5G5B5"})
tga_encoder.image(pixels):save("fractal_24bpp.tga", {color_format="B8G8R8"})
-- encode a colormapped bitmap
local K = { 0 }
local B = { 1 }
local R = { 2 }
local G = { 3 }
local W = { 4 }
local colormap = {
{ 1, 2, 3 }, -- K
{ 0, 0, 255 }, -- B
{ 255, 0, 0 }, -- R
{ 0, 255, 0 }, -- G
{ 253, 254, 255 }, -- W
}
local pixels = {
{ W, K, W, K, W, K, W },
{ R, G, B, R, G, B, K },
{ K, W, K, W, K, W, K },
{ G, B, R, G, B, R, W },
{ W, W, W, K, K, K, W },
{ B, R, G, B, R, G, K },
{ B, R, G, B, R, G, W },
}
-- note that the uncompressed colormapped TGA file written in this
-- example is 108 bytes but an optimized PNG file is 121 bytes …
tga_encoder.image(pixels):save("colormapped_B8G8R8.tga", {colormap=colormap})
-- encoding as A1R5G5B5 saves 1 byte per palette entry → 103 bytes
tga_encoder.image(pixels):save("colormapped_A1R5G5B5.tga", {colormap=colormap, color_format="A1R5G5B5"})
-- encode a colormapped bitmap with transparency
local _ = { 0 }
local K = { 1 }
local W = { 2 }
local colormap = {
{ 0, 0, 0, 0 },
{ 0, 0, 0, 255 },
{ 255, 255, 255, 255 },
}
local pixels = {
{ _, K, K, K, K, K, _ },
{ _, K, W, W, W, K, _ },
{ K, K, W, W, W, K, K },
{ K, W, W, W, W, W, K },
{ _, K, W, W, W, K, _ },
{ _, _, K, W, K, _, _ },
{ _, _, _, K, _, _, _ },
}
tga_encoder.image(pixels):save("colormapped_B8G8R8A8.tga", {colormap=colormap})
-- encoding a colormapped image with illegal colormap indexes should error out
local colormap = {
{ 0, 0, 0, 0 },
{ 0, 0, 0, 255 },
}
local status, message = pcall(
function ()
tga_encoder.image(pixels):encode({colormap=colormap})
end
)
assert(
false == status and
"init.lua:36: colormap index 2 not in colormap of size 2" == message
)

View File

@ -9,60 +9,566 @@ local image = setmetatable({}, {
}) })
function image:constructor(pixels) function image:constructor(pixels)
self.data = ""
self.pixels = pixels self.pixels = pixels
self.width = #pixels[1] self.width = #pixels[1]
self.height = #pixels self.height = #pixels
self:encode()
end end
function image:encode_colormap_spec() local pixel_depth_by_color_format = {
self.data = self.data ["Y8"] = 8,
.. string.char(0, 0) -- first entry index ["A1R5G5B5"] = 16,
.. string.char(0, 0) -- number of entries ["B8G8R8"] = 24,
.. string.char(0) -- bits per pixel ["B8G8R8A8"] = 32,
}
function image:encode_colormap_spec(properties)
local colormap = properties.colormap
local colormap_pixel_depth = 0
if 0 ~= #colormap then
colormap_pixel_depth = pixel_depth_by_color_format[
properties.color_format
]
-- ensure that each pixel references a legal colormap entry
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
local colormap_index = pixel[1]
if colormap_index >= #colormap then
error(
"colormap index " .. colormap_index ..
" not in colormap of size " .. #colormap
)
end
end
end
end
local colormap_spec =
string.char(0, 0) .. -- first entry index
string.char(#colormap % 256, math.floor(#colormap / 256)) .. -- number of entries
string.char(colormap_pixel_depth) -- bits per pixel
self.data = self.data .. colormap_spec
end end
function image:encode_image_spec() function image:encode_image_spec(properties)
self.data = self.data local color_format = properties.color_format
.. string.char(0, 0) -- X-origin assert(
.. string.char(0, 0) -- Y-origin "Y8" == color_format or -- (8 bit grayscale = 1 byte = 8 bits)
.. string.char(self.width % 256, math.floor(self.width / 256)) -- width "A1R5G5B5" == color_format or -- (A1R5G5B5 = 2 bytes = 16 bits)
.. string.char(self.height % 256, math.floor(self.height / 256)) -- height "B8G8R8" == color_format or -- (B8G8R8 = 3 bytes = 24 bits)
.. string.char(24) -- pixel depth (RGB = 3 bytes = 24 bits) "B8G8R8A8" == color_format -- (B8G8R8A8 = 4 bytes = 32 bits)
.. string.char(0) -- image descriptor )
local scanline_order = properties.scanline_order
assert (
"bottom-top" == scanline_order or
"top-bottom" == scanline_order
)
local pixel_depth
if 0 ~= #properties.colormap then
pixel_depth = self.pixel_depth
else
pixel_depth = pixel_depth_by_color_format[color_format]
end
assert( nil ~= pixel_depth)
-- the origin is the bottom left corner of the image (always)
local x_origin_lo = 0
local x_origin_hi = 0
local y_origin_lo = 0
local y_origin_hi = 0
local image_descriptor = 0 -- equal to bottom-top scanline order
local width_lo = self.width % 256
local width_hi = math.floor(self.width / 256)
local height_lo = self.height % 256
local height_hi = math.floor(self.height / 256)
if "top-bottom" == scanline_order then
image_descriptor = 32
y_origin_lo = height_lo
y_origin_hi = height_hi
end
self.data = self.data .. string.char (
x_origin_lo, x_origin_hi,
y_origin_lo, y_origin_hi,
width_lo, width_hi,
height_lo, height_hi,
pixel_depth,
image_descriptor
)
end end
function image:encode_header() function image:encode_colormap(properties)
local colormap = properties.colormap
if 0 == #colormap then
return
end
local color_format = properties.color_format
assert (
"A1R5G5B5" == color_format or
"B8G8R8" == color_format or
"B8G8R8A8" == color_format
)
local colors = {}
if "A1R5G5B5" == color_format then
-- Sample depth rescaling is done according to the algorithm presented in:
-- <https://www.w3.org/TR/2003/REC-PNG-20031110/#13Sample-depth-rescaling>
local max_sample_in = math.pow(2, 8) - 1
local max_sample_out = math.pow(2, 5) - 1
for i = 1,#colormap,1 do
local color = colormap[i]
local colorword = 32768 +
((math.floor((color[1] * max_sample_out / max_sample_in) + 0.5)) * 1024) +
((math.floor((color[2] * max_sample_out / max_sample_in) + 0.5)) * 32) +
((math.floor((color[3] * max_sample_out / max_sample_in) + 0.5)) * 1)
local color_bytes = string.char(
colorword % 256,
math.floor(colorword / 256)
)
colors[#colors + 1] = color_bytes
end
elseif "B8G8R8" == color_format then
for i = 1,#colormap,1 do
local color = colormap[i]
local color_bytes = string.char(
color[3], -- B
color[2], -- G
color[1] -- R
)
colors[#colors + 1] = color_bytes
end
elseif "B8G8R8A8" == color_format then
for i = 1,#colormap,1 do
local color = colormap[i]
local color_bytes = string.char(
color[3], -- B
color[2], -- G
color[1], -- R
color[4] -- A
)
colors[#colors + 1] = color_bytes
end
end
assert( 0 ~= #colors )
self.data = self.data .. table.concat(colors)
end
function image:encode_header(properties)
local color_format = properties.color_format
local colormap = properties.colormap
local compression = properties.compression
local colormap_type
local image_type
if "Y8" == color_format and "RAW" == compression then
colormap_type = 0
image_type = 3 -- grayscale
elseif (
"A1R5G5B5" == color_format or
"B8G8R8" == color_format or
"B8G8R8A8" == color_format
) then
if "RAW" == compression then
if 0 ~= #colormap then
colormap_type = 1
image_type = 1 -- colormapped RGB(A)
else
colormap_type = 0
image_type = 2 -- RAW RGB(A)
end
elseif "RLE" == compression then
colormap_type = 0
image_type = 10 -- RLE RGB
end
end
assert( nil ~= colormap_type )
assert( nil ~= image_type )
self.data = self.data self.data = self.data
.. string.char(0) -- image id .. string.char(0) -- image id
.. string.char(0) -- color map type .. string.char(colormap_type)
.. string.char(10) -- image type (RLE RGB = 10) .. string.char(image_type)
self:encode_colormap_spec() -- color map specification self:encode_colormap_spec(properties) -- color map specification
self:encode_image_spec() -- image specification self:encode_image_spec(properties) -- image specification
self:encode_colormap(properties)
end end
function image:encode_data() function image:encode_data(properties)
local current_pixel = '' local color_format = properties.color_format
local previous_pixel = '' local colormap = properties.colormap
local count = 1 local compression = properties.compression
local packets = {}
local rle_packet = '' local data_length_before = #self.data
if "Y8" == color_format and "RAW" == compression then
if 8 == self.pixel_depth then
self:encode_data_Y8_as_Y8_raw()
elseif 24 == self.pixel_depth then
self:encode_data_R8G8B8_as_Y8_raw()
end
elseif "A1R5G5B5" == color_format then
if 0 ~= #colormap then
if "RAW" == compression then
if 8 == self.pixel_depth then
self:encode_data_Y8_as_Y8_raw()
end
end
else
if "RAW" == compression then
self:encode_data_R8G8B8_as_A1R5G5B5_raw()
elseif "RLE" == compression then
self:encode_data_R8G8B8_as_A1R5G5B5_rle()
end
end
elseif "B8G8R8" == color_format then
if 0 ~= #colormap then
if "RAW" == compression then
if 8 == self.pixel_depth then
self:encode_data_Y8_as_Y8_raw()
end
end
else
if "RAW" == compression then
self:encode_data_R8G8B8_as_B8G8R8_raw()
elseif "RLE" == compression then
self:encode_data_R8G8B8_as_B8G8R8_rle()
end
end
elseif "B8G8R8A8" == color_format then
if 0 ~= #colormap then
if "RAW" == compression then
if 8 == self.pixel_depth then
self:encode_data_Y8_as_Y8_raw()
end
end
else
if "RAW" == compression then
self:encode_data_R8G8B8A8_as_B8G8R8A8_raw()
elseif "RLE" == compression then
self:encode_data_R8G8B8A8_as_B8G8R8A8_rle()
end
end
end
local data_length_after = #self.data
assert(
data_length_after ~= data_length_before,
"No data encoded for color format: " .. color_format
)
end
function image:encode_data_Y8_as_Y8_raw()
assert(8 == self.pixel_depth)
local raw_pixels = {}
for _, row in ipairs(self.pixels) do for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do for _, pixel in ipairs(row) do
current_pixel = string.char(pixel[3], pixel[2], pixel[1]) local raw_pixel = string.char(pixel[1])
if current_pixel ~= previous_pixel or count == 128 then raw_pixels[#raw_pixels + 1] = raw_pixel
packets[#packets +1] = rle_packet end
end
self.data = self.data .. table.concat(raw_pixels)
end
function image:encode_data_R8G8B8_as_Y8_raw()
assert(24 == self.pixel_depth)
local raw_pixels = {}
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
-- the HSP RGB to brightness formula is
-- sqrt( 0.299 r² + .587 g² + .114 b² )
-- see <https://alienryderflex.com/hsp.html>
local gray = math.floor(
math.sqrt(
0.299 * pixel[1]^2 +
0.587 * pixel[2]^2 +
0.114 * pixel[3]^2
) + 0.5
)
local raw_pixel = string.char(gray)
raw_pixels[#raw_pixels + 1] = raw_pixel
end
end
self.data = self.data .. table.concat(raw_pixels)
end
function image:encode_data_R8G8B8_as_A1R5G5B5_raw()
assert(24 == self.pixel_depth)
local raw_pixels = {}
-- Sample depth rescaling is done according to the algorithm presented in:
-- <https://www.w3.org/TR/2003/REC-PNG-20031110/#13Sample-depth-rescaling>
local max_sample_in = math.pow(2, 8) - 1
local max_sample_out = math.pow(2, 5) - 1
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
local colorword = 32768 +
((math.floor((pixel[1] * max_sample_out / max_sample_in) + 0.5)) * 1024) +
((math.floor((pixel[2] * max_sample_out / max_sample_in) + 0.5)) * 32) +
((math.floor((pixel[3] * max_sample_out / max_sample_in) + 0.5)) * 1)
local raw_pixel = string.char(colorword % 256, math.floor(colorword / 256))
raw_pixels[#raw_pixels + 1] = raw_pixel
end
end
self.data = self.data .. table.concat(raw_pixels)
end
function image:encode_data_R8G8B8_as_A1R5G5B5_rle()
assert(24 == self.pixel_depth)
local colorword = nil
local previous_r = nil
local previous_g = nil
local previous_b = nil
local raw_pixel = ''
local raw_pixels = {}
local count = 1
local packets = {}
local raw_packet = ''
local rle_packet = ''
-- Sample depth rescaling is done according to the algorithm presented in:
-- <https://www.w3.org/TR/2003/REC-PNG-20031110/#13Sample-depth-rescaling>
local max_sample_in = math.pow(2, 8) - 1
local max_sample_out = math.pow(2, 5) - 1
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
if pixel[1] ~= previous_r or pixel[2] ~= previous_g or pixel[3] ~= previous_b or count == 128 then
if nil ~= previous_r then
colorword = 32768 +
((math.floor((previous_r * max_sample_out / max_sample_in) + 0.5)) * 1024) +
((math.floor((previous_g * max_sample_out / max_sample_in) + 0.5)) * 32) +
((math.floor((previous_b * max_sample_out / max_sample_in) + 0.5)) * 1)
if 1 == count then
-- remember pixel verbatim for raw encoding
raw_pixel = string.char(colorword % 256, math.floor(colorword / 256))
raw_pixels[#raw_pixels + 1] = raw_pixel
if 128 == #raw_pixels then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
else
-- encode raw pixels, if any
if #raw_pixels > 0 then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
-- RLE encoding
rle_packet = string.char(128 + count - 1, colorword % 256, math.floor(colorword / 256))
packets[#packets +1] = rle_packet
end
end
count = 1 count = 1
previous_pixel = current_pixel previous_r = pixel[1]
previous_g = pixel[2]
previous_b = pixel[3]
else else
count = count + 1 count = count + 1
end end
rle_packet = string.char(128 + count - 1) .. current_pixel
end end
end end
packets[#packets +1] = rle_packet colorword = 32768 +
((math.floor((previous_r * max_sample_out / max_sample_in) + 0.5)) * 1024) +
((math.floor((previous_g * max_sample_out / max_sample_in) + 0.5)) * 32) +
((math.floor((previous_b * max_sample_out / max_sample_in) + 0.5)) * 1)
if 1 == count then
raw_pixel = string.char(colorword % 256, math.floor(colorword / 256))
raw_pixels[#raw_pixels + 1] = raw_pixel
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
else
-- encode raw pixels, if any
if #raw_pixels > 0 then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
-- RLE encoding
rle_packet = string.char(128 + count - 1, colorword % 256, math.floor(colorword / 256))
packets[#packets +1] = rle_packet
end
self.data = self.data .. table.concat(packets)
end
function image:encode_data_R8G8B8_as_B8G8R8_raw()
assert(24 == self.pixel_depth)
local raw_pixels = {}
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
local raw_pixel = string.char(pixel[3], pixel[2], pixel[1])
raw_pixels[#raw_pixels + 1] = raw_pixel
end
end
self.data = self.data .. table.concat(raw_pixels)
end
function image:encode_data_R8G8B8_as_B8G8R8_rle()
assert(24 == self.pixel_depth)
local previous_r = nil
local previous_g = nil
local previous_b = nil
local raw_pixel = ''
local raw_pixels = {}
local count = 1
local packets = {}
local raw_packet = ''
local rle_packet = ''
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
if pixel[1] ~= previous_r or pixel[2] ~= previous_g or pixel[3] ~= previous_b or count == 128 then
if nil ~= previous_r then
if 1 == count then
-- remember pixel verbatim for raw encoding
raw_pixel = string.char(previous_b, previous_g, previous_r)
raw_pixels[#raw_pixels + 1] = raw_pixel
if 128 == #raw_pixels then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
else
-- encode raw pixels, if any
if #raw_pixels > 0 then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
-- RLE encoding
rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r)
packets[#packets +1] = rle_packet
end
end
count = 1
previous_r = pixel[1]
previous_g = pixel[2]
previous_b = pixel[3]
else
count = count + 1
end
end
end
if 1 == count then
raw_pixel = string.char(previous_b, previous_g, previous_r)
raw_pixels[#raw_pixels + 1] = raw_pixel
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
else
-- encode raw pixels, if any
if #raw_pixels > 0 then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
-- RLE encoding
rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r)
packets[#packets +1] = rle_packet
end
self.data = self.data .. table.concat(packets)
end
function image:encode_data_R8G8B8A8_as_B8G8R8A8_raw()
assert(32 == self.pixel_depth)
local raw_pixels = {}
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
local raw_pixel = string.char(pixel[3], pixel[2], pixel[1], pixel[4])
raw_pixels[#raw_pixels + 1] = raw_pixel
end
end
self.data = self.data .. table.concat(raw_pixels)
end
function image:encode_data_R8G8B8A8_as_B8G8R8A8_rle()
assert(32 == self.pixel_depth)
local previous_r = nil
local previous_g = nil
local previous_b = nil
local previous_a = nil
local raw_pixel = ''
local raw_pixels = {}
local count = 1
local packets = {}
local raw_packet = ''
local rle_packet = ''
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
if pixel[1] ~= previous_r or pixel[2] ~= previous_g or pixel[3] ~= previous_b or pixel[4] ~= previous_a or count == 128 then
if nil ~= previous_r then
if 1 == count then
-- remember pixel verbatim for raw encoding
raw_pixel = string.char(previous_b, previous_g, previous_r, previous_a)
raw_pixels[#raw_pixels + 1] = raw_pixel
if 128 == #raw_pixels then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
else
-- encode raw pixels, if any
if #raw_pixels > 0 then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
-- RLE encoding
rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r, previous_a)
packets[#packets +1] = rle_packet
end
end
count = 1
previous_r = pixel[1]
previous_g = pixel[2]
previous_b = pixel[3]
previous_a = pixel[4]
else
count = count + 1
end
end
end
if 1 == count then
raw_pixel = string.char(previous_b, previous_g, previous_r, previous_a)
raw_pixels[#raw_pixels + 1] = raw_pixel
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
else
-- encode raw pixels, if any
if #raw_pixels > 0 then
raw_packet = string.char(#raw_pixels - 1)
packets[#packets + 1] = raw_packet
for i=1, #raw_pixels do
packets[#packets +1] = raw_pixels[i]
end
raw_pixels = {}
end
-- RLE encoding
rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r, previous_a)
packets[#packets +1] = rle_packet
end
self.data = self.data .. table.concat(packets) self.data = self.data .. table.concat(packets)
end end
@ -75,15 +581,45 @@ function image:encode_footer()
.. string.char(0) .. string.char(0)
end end
function image:encode() function image:encode(properties)
self:encode_header() -- header local properties = properties or {}
properties.colormap = properties.colormap or {}
properties.compression = properties.compression or "RAW"
properties.scanline_order = properties.scanline_order or "bottom-top"
self.pixel_depth = #self.pixels[1][1] * 8
local color_format_defaults_by_pixel_depth = {
[8] = "Y8",
[24] = "B8G8R8",
[32] = "B8G8R8A8",
}
if nil == properties.color_format then
if 0 ~= #properties.colormap then
properties.color_format =
color_format_defaults_by_pixel_depth[
#properties.colormap[1] * 8
]
else
properties.color_format =
color_format_defaults_by_pixel_depth[
self.pixel_depth
]
end
end
assert( nil ~= properties.color_format )
self.data = ""
self:encode_header(properties) -- header
-- no color map and image id data -- no color map and image id data
self:encode_data() -- encode data self:encode_data(properties) -- encode data
-- no extension or developer area -- no extension or developer area
self:encode_footer() -- footer self:encode_footer() -- footer
end end
function image:save(filename) function image:save(filename, properties)
self:encode(properties)
local f = assert(io.open(filename, "wb")) local f = assert(io.open(filename, "wb"))
f:write(self.data) f:write(self.data)
f:close() f:close()

View File

@ -0,0 +1,51 @@
dofile("init.lua")
local colormap = {
{ 0, 0, 0 }, -- black
{ 255, 255, 255 }, -- white
{ 255, 0, 0 }, -- red
{ 0, 255, 0 }, -- green
{ 0, 0, 255 }, -- blue
}
local _ = { 0 }
local W = { 1 }
local R = { 2 }
local G = { 3 }
local B = { 4 }
local pixels_tiny = {
{ W, W, W, W, W, W, W, W, W, W, W, W, },
{ W, _, _, _, _, _, _, _, _, _, _, W, },
{ W, _, _, _, _, _, _, B, _, B, _, W, },
{ W, _, _, _, _, _, _, B, B, B, _, W, },
{ W, _, _, _, G, G, G, B, _, B, _, W, },
{ W, _, _, _, G, _, G, B, B, B, _, W, },
{ W, _, _, R, G, _, _, _, _, _, _, W, },
{ W, _, _, R, G, G, G, _, _, _, _, W, },
{ W, _, _, R, _, _, _, _, _, _, _, W, },
{ W, _, R, R, R, _, _, _, _, _, _, W, },
{ W, _, _, _, _, _, _, _, _, _, _, W, },
{ W, W, W, W, W, W, W, W, W, W, W, W, },
}
local pixels_huge = {}
local size_tiny = #pixels_tiny
local size_huge = 1200
local scale = size_huge / size_tiny
for x_huge = 1,size_huge,1 do
local x_tiny = math.ceil( x_huge / scale )
for z_huge = 1,size_huge,1 do
local z_tiny = math.ceil( z_huge / scale )
if nil == pixels_huge[z_huge] then
pixels_huge[z_huge] = {}
end
pixels_huge[z_huge][x_huge] = pixels_tiny[z_tiny][x_tiny]
end
end
tga_encoder.image(pixels_tiny):save("logo_tiny.tga", {colormap=colormap})
tga_encoder.image(pixels_huge):save("logo_huge.tga", {colormap=colormap})

View File

@ -1,3 +1,2 @@
name = tga_encoder name = tga_encoder
author = Fleckenstein
description = A TGA Encoder written in Lua without the use of external Libraries. description = A TGA Encoder written in Lua without the use of external Libraries.

View File

@ -0,0 +1,180 @@
#!/usr/bin/env lua5.1
dofile("../init.lua")
local _ = { 0 }
local R = { 1 }
local G = { 2 }
local B = { 3 }
local pixels_colormapped_bt = {
{ _, _, _, _, _, B, _, B, },
{ _, _, _, _, _, B, B, B, },
{ _, _, G, G, G, B, _, B, },
{ _, _, G, _, G, B, B, B, },
{ _, R, G, _, _, _, _, _, },
{ _, R, G, G, G, _, _, _, },
{ _, R, _, _, _, _, _, _, },
{ R, R, R, _, _, _, _, _, },
}
local pixels_colormapped_tb = {
{ R, R, R, _, _, _, _, _, },
{ _, R, _, _, _, _, _, _, },
{ _, R, G, G, G, _, _, _, },
{ _, R, G, _, _, _, _, _, },
{ _, _, G, _, G, B, B, B, },
{ _, _, G, G, G, B, _, B, },
{ _, _, _, _, _, B, B, B, },
{ _, _, _, _, _, B, _, B, },
}
image_colormapped_bt = tga_encoder.image(pixels_colormapped_bt)
image_colormapped_tb = tga_encoder.image(pixels_colormapped_tb)
colormap_32bpp = {
{ 0, 0, 0, 128 },
{ 255, 0, 0, 255 },
{ 0, 255, 0, 255 },
{ 0, 0, 255, 255 },
}
image_colormapped_bt:save(
"type1_32bpp_bt.tga",
{ colormap = colormap_32bpp, color_format = "B8G8R8A8", scanline_order = "bottom-top" }
)
image_colormapped_tb:save(
"type1_32bpp_tb.tga",
{ colormap = colormap_32bpp, color_format = "B8G8R8A8", scanline_order = "top-bottom" }
)
image_colormapped_bt:save(
"type1_16bpp_bt.tga",
{ colormap = colormap_32bpp, color_format = "A1R5G5B5", scanline_order = "bottom-top" }
)
image_colormapped_tb:save(
"type1_16bpp_tb.tga",
{ colormap = colormap_32bpp, color_format = "A1R5G5B5", scanline_order = "top-bottom" }
)
colormap_24bpp = {
{ 0, 0, 0 },
{ 255, 0, 0 },
{ 0, 255, 0 },
{ 0, 0, 255 },
}
image_colormapped_bt:save(
"type1_24bpp_bt.tga",
{ colormap = colormap_32bpp, color_format = "B8G8R8", scanline_order = "bottom-top" }
)
image_colormapped_tb:save(
"type1_24bpp_tb.tga",
{ colormap = colormap_32bpp, color_format = "B8G8R8", scanline_order = "top-bottom" }
)
local _ = { 0, 0, 0, 128 }
local R = { 255, 0, 0, 255 }
local G = { 0, 255, 0, 255 }
local B = { 0, 0, 255, 255 }
local pixels_rgba_bt = {
{ _, _, _, _, _, B, _, B, },
{ _, _, _, _, _, B, B, B, },
{ _, _, G, G, G, B, _, B, },
{ _, _, G, _, G, B, B, B, },
{ _, R, G, _, _, _, _, _, },
{ _, R, G, G, G, _, _, _, },
{ _, R, _, _, _, _, _, _, },
{ R, R, R, _, _, _, _, _, },
}
local pixels_rgba_tb = {
{ R, R, R, _, _, _, _, _, },
{ _, R, _, _, _, _, _, _, },
{ _, R, G, G, G, _, _, _, },
{ _, R, G, _, _, _, _, _, },
{ _, _, G, _, G, B, B, B, },
{ _, _, G, G, G, B, _, B, },
{ _, _, _, _, _, B, B, B, },
{ _, _, _, _, _, B, _, B, },
}
image_rgba_bt = tga_encoder.image(pixels_rgba_bt)
image_rgba_tb = tga_encoder.image(pixels_rgba_tb)
image_rgba_bt:save(
"type2_32bpp_bt.tga",
{ color_format="B8G8R8A8", compression="RAW", scanline_order = "bottom-top" }
)
image_rgba_tb:save(
"type2_32bpp_tb.tga",
{ color_format="B8G8R8A8", compression="RAW", scanline_order = "top-bottom" }
)
image_rgba_bt:save(
"type10_32bpp_bt.tga",
{ color_format="B8G8R8A8", compression="RLE", scanline_order = "bottom-top" }
)
image_rgba_tb:save(
"type10_32bpp_tb.tga",
{ color_format="B8G8R8A8", compression="RLE", scanline_order = "top-bottom" }
)
local _ = { 0, 0, 0 }
local R = { 255, 0, 0 }
local G = { 0, 255, 0 }
local B = { 0, 0, 255 }
local pixels_rgb_bt = {
{ _, _, _, _, _, B, _, B, },
{ _, _, _, _, _, B, B, B, },
{ _, _, G, G, G, B, _, B, },
{ _, _, G, _, G, B, B, B, },
{ _, R, G, _, _, _, _, _, },
{ _, R, G, G, G, _, _, _, },
{ _, R, _, _, _, _, _, _, },
{ R, R, R, _, _, _, _, _, },
}
local pixels_rgb_tb = {
{ R, R, R, _, _, _, _, _, },
{ _, R, _, _, _, _, _, _, },
{ _, R, G, G, G, _, _, _, },
{ _, R, G, _, _, _, _, _, },
{ _, _, G, _, G, B, B, B, },
{ _, _, G, G, G, B, _, B, },
{ _, _, _, _, _, B, B, B, },
{ _, _, _, _, _, B, _, B, },
}
image_rgb_bt = tga_encoder.image(pixels_rgb_bt)
image_rgb_tb = tga_encoder.image(pixels_rgb_tb)
image_rgb_bt:save(
"type2_24bpp_bt.tga",
{ color_format="B8G8R8", compression="RAW", scanline_order = "bottom-top" }
)
image_rgb_tb:save(
"type2_24bpp_tb.tga",
{ color_format="B8G8R8", compression="RAW", scanline_order = "top-bottom" }
)
image_rgb_bt:save(
"type10_24bpp_bt.tga",
{ color_format="B8G8R8", compression="RLE", scanline_order = "bottom-top" }
)
image_rgb_tb:save(
"type10_24bpp_tb.tga",
{ color_format="B8G8R8", compression="RLE", scanline_order = "top-bottom" }
)
image_rgb_bt:save(
"type2_16bpp_bt.tga",
{ color_format="A1R5G5B5", compression="RAW", scanline_order = "bottom-top" }
)
image_rgb_tb:save(
"type2_16bpp_tb.tga",
{ color_format="A1R5G5B5", compression="RAW", scanline_order = "top-bottom" }
)
image_rgb_bt:save(
"type10_16bpp_bt.tga",
{ color_format="A1R5G5B5", compression="RLE", scanline_order = "bottom-top" }
)
image_rgb_tb:save(
"type10_16bpp_tb.tga",
{ color_format="A1R5G5B5", compression="RLE", scanline_order = "top-bottom" }
)

View File

@ -10,7 +10,7 @@ License of boat model:
GNU GPLv3 <https://www.gnu.org/licenses/gpl-3.0.html> GNU GPLv3 <https://www.gnu.org/licenses/gpl-3.0.html>
## Textures ## Textures
See the main MineClone 2 README.md file to learn more. See the main VoxeLibre README.md file to learn more.
## Code ## Code
Code based on Minetest Game, licensed under the MIT License (MIT). Code based on Minetest Game, licensed under the MIT License (MIT).

View File

@ -168,7 +168,7 @@ end
function boat.on_activate(self, staticdata, dtime_s) function boat.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({fleshy = 100}) self.object:set_armor_groups({fleshy = 125})
local data = minetest.deserialize(staticdata) local data = minetest.deserialize(staticdata)
if type(data) == "table" then if type(data) == "table" then
self._v = data.v self._v = data.v

View File

@ -10,3 +10,14 @@ Rightclick on a water source to place the boat. Rightclick the boat to enter it.
Spruce Boat=Fichtenboot Spruce Boat=Fichtenboot
Water vehicle=Wasserfahrzeug Water vehicle=Wasserfahrzeug
Sneak to dismount=Zum Aussteigen schleichen Sneak to dismount=Zum Aussteigen schleichen
Obsidian Boat=Obsidianboot
Mangrove Boat=
Cherry Boat=Kirschholzboot
Oak Chest Boat=Eichentruhenboot
Spruce Chest Boat=
Birch Chest Boat=Birkentruhenboot
Jungle Chest Boat=Dschungeltruhenboot
Acacia Chest Boat=
Dark Oak Chest Boat=
Mangrove Chest Boat=
Cherry Chest Boat=

View File

@ -1,4 +1,4 @@
name = mcl_burning name = mcl_burning
description = Burning Objects for MineClone2 description = Burning Objects for VoxeLibre
author = Fleckenstein author = Fleckenstein
depends = mcl_weather depends = mcl_weather

View File

@ -1,6 +1,6 @@
# mcl_dripping # mcl_dripping
Dripping Mod by kddekadenz, modified for MineClone 2 by Wuzzy, NO11 and AFCM Dripping Mod by kddekadenz, modified for VoxeLibre by Wuzzy, NO11 and AFCM
## Manual ## Manual

View File

@ -29,7 +29,7 @@ local function make_drop(pos, liquid, sound, interval, texture)
pt.expirationtime = t pt.expirationtime = t
pt.texture = "[combine:2x2:" .. pt.texture = "[combine:2x2:" ..
-math.random(1, 16) .. "," .. -math.random(1, 16) .. "=" .. texture math.random(-14, 0) .. "," .. math.random(-14, 0) .. "=" .. texture
minetest.add_particle(pt) minetest.add_particle(pt)

View File

@ -6,9 +6,6 @@ local pool = {}
local tick = false local tick = false
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
pool[player:get_player_name()] = 0 pool[player:get_player_name()] = 0
end) end)
@ -113,6 +110,57 @@ local function disable_physics(object, luaentity, ignore_check, reset_movement)
end end
end end
local function try_object_pickup(player, inv, object, checkpos)
if not inv then return end
local le = object:get_luaentity()
-- Check magnet timer
if not (le._magnet_timer >= 0) then return end
if not (le._magnet_timer < item_drop_settings.magnet_time) then return end
-- Don't try to collect again
if le._removed then return end
-- Ignore if itemstring is not set yet
if le.itemstring == "" then return end
-- Add what we can to the inventory
local itemstack = ItemStack(le.itemstring)
tt.reload_itemstack_description(itemstack)
local leftovers = inv:add_item("main", itemstack )
check_pickup_achievements(object, player)
if leftovers:is_empty() then
-- Destroy entity
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
le.target = checkpos
le.itemstring = ""
le._removed = true
-- Stop the object
object:set_velocity(vector.zero())
object:set_acceleration(vector.zero())
object:move_to(checkpos)
-- Update sound pool
local name = player:get_player_name()
pool[name] = ( pool[name] or 0 ) + 1
-- Make sure the object gets removed
minetest.after(0.25, function()
--safety check
if object and object:get_luaentity() then
object:remove()
end
end)
else
-- Update entity itemstring
le.itemstring = leftovers:to_string()
end
end
minetest.register_globalstep(function(_) minetest.register_globalstep(function(_)
tick = not tick tick = not tick
@ -123,17 +171,17 @@ minetest.register_globalstep(function(_)
local pos = player:get_pos() local pos = player:get_pos()
if tick == true and pool[name] > 0 then if tick == true and (pool[name] or 0) > 0 then
minetest.sound_play("item_drop_pickup", { minetest.sound_play("item_drop_pickup", {
pos = pos, pos = pos,
gain = 0.3, gain = 0.3,
max_hear_distance = 16, max_hear_distance = 16,
pitch = math.random(70, 110) / 100 pitch = math.random(70, 110) / 100
}) })
if pool[name] > 6 then if (pool[name] or 0) > 6 then
pool[name] = 6 pool[name] = 6
else else
pool[name] = pool[name] - 1 pool[name] = (pool[name] or 1) - 1
end end
end end
@ -147,40 +195,7 @@ minetest.register_globalstep(function(_)
object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer
and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then
if object:get_luaentity()._magnet_timer >= 0 and try_object_pickup( player, inv, object, checkpos )
object:get_luaentity()._magnet_timer < item_drop_settings.magnet_time and inv and
inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
-- Collection
if not object:get_luaentity()._removed then
-- Ignore if itemstring is not set yet
if object:get_luaentity().itemstring ~= "" then
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
check_pickup_achievements(object, player)
-- Destroy entity
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
object:get_luaentity().target = checkpos
object:get_luaentity()._removed = true
object:set_velocity(vector.zero())
object:set_acceleration(vector.zero())
object:move_to(checkpos)
pool[name] = pool[name] + 1
minetest.after(0.25, function()
--safety check
if object and object:get_luaentity() then
object:remove()
end
end)
end
end
end
elseif not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "mcl_experience:orb" then elseif not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "mcl_experience:orb" then
local entity = object:get_luaentity() local entity = object:get_luaentity()
entity.collector = player:get_player_name() entity.collector = player:get_player_name()
@ -306,6 +321,7 @@ function minetest.handle_node_drops(pos, drops, digger)
if tool and nodedef._mcl_fortune_drop and enchantments.fortune then if tool and nodedef._mcl_fortune_drop and enchantments.fortune then
local fortune_level = enchantments.fortune local fortune_level = enchantments.fortune
local fortune_drop = nodedef._mcl_fortune_drop local fortune_drop = nodedef._mcl_fortune_drop
local simple_drop = nodedef._mcl_fortune_drop.drop_without_fortune
if fortune_drop.discrete_uniform_distribution then if fortune_drop.discrete_uniform_distribution then
local min_count = fortune_drop.min_count local min_count = fortune_drop.min_count
local max_count = fortune_drop.max_count + fortune_level * (fortune_drop.factor or 1) local max_count = fortune_drop.max_count + fortune_level * (fortune_drop.factor or 1)
@ -321,6 +337,12 @@ function minetest.handle_node_drops(pos, drops, digger)
local drop = get_fortune_drops(fortune_drop, fortune_level) local drop = get_fortune_drops(fortune_drop, fortune_level)
drops = get_drops(drop, tool:get_name(), dug_node.param2, nodedef.paramtype2) drops = get_drops(drop, tool:get_name(), dug_node.param2, nodedef.paramtype2)
end end
if simple_drop then
for _, item in pairs(simple_drop) do
table.insert(drops, item)
end
end
end end
if digger and mcl_experience.throw_xp and not silk_touch_drop then if digger and mcl_experience.throw_xp and not silk_touch_drop then
@ -435,6 +457,7 @@ function minetest.node_dig(pos, node, digger)
end end
end end
end end
tt.reload_itemstack_description(wielded) -- update tooltip
digger:set_wielded_item(wielded) digger:set_wielded_item(wielded)
end end
@ -942,6 +965,7 @@ minetest.register_entity(":__builtin:item", {
self.random_velocity = 0 self.random_velocity = 0
self:set_item(own_stack:to_string()) self:set_item(own_stack:to_string())
entity.itemstring = ""
entity._removed = true entity._removed = true
object:remove() object:remove()
return true return true

View File

@ -134,4 +134,34 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype)
end end
end end
return {x=0, y=0, z=0} return {x=0, y=0, z=0}
end end
local plane_adjacents = {
vector.new(-1,0,0),
vector.new(1,0,0),
vector.new(0,0,-1),
vector.new(0,0,1),
}
function mcl_minecarts:get_start_direction(pos)
local dir
local i = 0
while (not dir and i < #plane_adjacents) do
i = i+1
local node = minetest.get_node_or_nil(vector.add(pos, plane_adjacents[i]))
if node ~= nil
and minetest.get_item_group(node.name, "rail") == 0
and minetest.get_item_group(node.name, "solid") == 1
and minetest.get_item_group(node.name, "opaque") == 1
then
dir = mcl_minecarts:check_front_up_down(pos, vector.multiply(plane_adjacents[i], -1), true)
end
end
return dir
end
function mcl_minecarts:set_velocity(obj, dir, factor)
obj._velocity = vector.multiply(dir, factor or 3)
obj._old_pos = nil
obj._punched = true
end

View File

@ -241,9 +241,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
if vector.equals(cart_dir, {x=0, y=0, z=0}) then if vector.equals(cart_dir, {x=0, y=0, z=0}) then
return return
end end
self._velocity = vector.multiply(cart_dir, 3) mcl_minecarts:set_velocity(self, cart_dir)
self._old_pos = nil
self._punched = true
return return
end end
@ -300,9 +298,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
time_from_last_punch = math.min(time_from_last_punch, tool_capabilities.full_punch_interval) time_from_last_punch = math.min(time_from_last_punch, tool_capabilities.full_punch_interval)
local f = 3 * (time_from_last_punch / tool_capabilities.full_punch_interval) local f = 3 * (time_from_last_punch / tool_capabilities.full_punch_interval)
self._velocity = vector.multiply(cart_dir, f) mcl_minecarts:set_velocity(self, cart_dir, f)
self._old_pos = nil
self._punched = true
end end
cart.on_activate_by_rail = on_activate_by_rail cart.on_activate_by_rail = on_activate_by_rail
@ -470,7 +466,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
return return
end end
local dir, last_switch = nil, nil local dir, last_switch, restart_pos = nil, nil, nil
if not pos then if not pos then
pos = self.object:get_pos() pos = self.object:get_pos()
end end
@ -497,6 +493,9 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
minetest.swap_node(rou_pos, newnode) minetest.swap_node(rou_pos, newnode)
mesecon.receptor_on(rou_pos) mesecon.receptor_on(rou_pos)
end end
if node.name == "mcl_minecarts:golden_rail_on" then
restart_pos = rou_pos
end
if node_old.name == "mcl_minecarts:detector_rail_on" then if node_old.name == "mcl_minecarts:detector_rail_on" then
local newnode = {name="mcl_minecarts:detector_rail", param2 = node_old.param2} local newnode = {name="mcl_minecarts:detector_rail", param2 = node_old.param2}
minetest.swap_node(rou_old, newnode) minetest.swap_node(rou_old, newnode)
@ -647,6 +646,14 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
if update.pos then if update.pos then
self.object:set_pos(pos) self.object:set_pos(pos)
end end
-- stopped on "mcl_minecarts:golden_rail_on"
if vector.equals(vel, {x=0, y=0, z=0}) and restart_pos then
local dir = mcl_minecarts:get_start_direction(restart_pos)
if dir then
mcl_minecarts:set_velocity(self, dir)
end
end
end end
function cart:get_staticdata() function cart:get_staticdata()
@ -687,7 +694,15 @@ function mcl_minecarts.place_minecart(itemstack, pointed_thing, placer)
if le then if le then
le._railtype = railtype le._railtype = railtype
end end
local cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype) local cart_dir
if node.name == "mcl_minecarts:golden_rail_on" then
cart_dir = mcl_minecarts:get_start_direction(railpos)
end
if cart_dir then
mcl_minecarts:set_velocity(le, cart_dir)
else
cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype)
end
cart:set_yaw(minetest.dir_to_yaw(cart_dir)) cart:set_yaw(minetest.dir_to_yaw(cart_dir))
local pname = "" local pname = ""

View File

@ -112,6 +112,22 @@ register_rail("mcl_minecarts:golden_rail_on",
onstate = "mcl_minecarts:golden_rail_on", onstate = "mcl_minecarts:golden_rail_on",
rules = rail_rules_long, rules = rail_rules_long,
}, },
effector = {
action_on = function(pos, node)
local dir = mcl_minecarts:get_start_direction(pos)
if not dir then return end
local objs = minetest.get_objects_inside_radius(pos, 1)
for _, o in pairs(objs) do
local l = o:get_luaentity()
local v = o:get_velocity()
if l and string.sub(l.name, 1, 14) == "mcl_minecarts:"
and v and vector.equals(v, vector.zero())
then
mcl_minecarts:set_velocity(l, dir)
end
end
end,
},
}, },
drop = "mcl_minecarts:golden_rail", drop = "mcl_minecarts:golden_rail",
}, },

View File

@ -1,7 +1,7 @@
local mob_class = mcl_mobs.mob_class local mob_class = mcl_mobs.mob_class
local mob_class_meta = {__index = mcl_mobs.mob_class} local mob_class_meta = {__index = mcl_mobs.mob_class}
local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs
-- API for Mobs Redo: MineClone 2 Edition (MRM) -- API for Mobs Redo: VoxeLibre Edition
local PATHFINDING = "gowp" local PATHFINDING = "gowp"
local CRASH_WARN_FREQUENCY = 60 local CRASH_WARN_FREQUENCY = 60
@ -18,7 +18,7 @@ mcl_mobs.invis = {}
local remove_far = true local remove_far = true
local mobs_debug = minetest.settings:get_bool("mobs_debug", false) -- Shows helpful debug info above each mob local mobs_debug = minetest.settings:get_bool("mobs_debug", false) -- Shows helpful debug info above each mob
local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true) local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn", false)
local MAPGEN_LIMIT = mcl_vars.mapgen_limit local MAPGEN_LIMIT = mcl_vars.mapgen_limit
local MAPGEN_MOB_LIMIT = MAPGEN_LIMIT - 90 local MAPGEN_MOB_LIMIT = MAPGEN_LIMIT - 90
@ -96,15 +96,23 @@ function mob_class:get_staticdata()
local tmp = {} local tmp = {}
for _,stat in pairs(self) do for tag, stat in pairs(self) do
local t = type(stat) local t = type(stat)
if t ~= "function" if t ~= "function"
and t ~= "nil" and t ~= "nil"
and t ~= "userdata" and t ~= "userdata"
and _ ~= "_cmi_components" then and tag ~= "_cmi_components" then
tmp[_] = self[_] tmp[tag] = self[tag]
end
end
tmp._mcl_potions = self._mcl_potions
if tmp._mcl_potions then
for name_raw, data in pairs(tmp._mcl_potions) do
local def = mcl_potions.registered_effects[name_raw:match("^_EF_(.+)$")]
if def and def.on_save_effect then def.on_save_effect(self.object) end
end end
end end
@ -142,6 +150,11 @@ function mob_class:mob_activate(staticdata, def, dtime)
local tmp = minetest.deserialize(staticdata) local tmp = minetest.deserialize(staticdata)
if tmp then if tmp then
-- Patch incorrectly converted mobs
if tmp.base_mesh ~= minetest.registered_entities[self.name].mesh then
mcl_mobs.strip_staticdata(tmp)
end
for _,stat in pairs(tmp) do for _,stat in pairs(tmp) do
self[_] = stat self[_] = stat
end end
@ -306,7 +319,10 @@ function mob_class:mob_activate(staticdata, def, dtime)
self._run_armor_init = true self._run_armor_init = true
end end
if not self._mcl_potions then
self._mcl_potions = {}
end
mcl_potions._load_entity_effects(self)
if def.after_activate then if def.after_activate then
@ -372,7 +388,7 @@ end
local function on_step_work (self, dtime) local function on_step_work(self, dtime, moveresult)
local pos = self.object:get_pos() local pos = self.object:get_pos()
if not pos then return end if not pos then return end
@ -386,7 +402,7 @@ local function on_step_work (self, dtime)
-- Do we abandon out of here now? -- Do we abandon out of here now?
end end
if self:falling(pos) then return end if self:falling(pos, moveresult) then return end
if self:step_damage (dtime, pos) then return end if self:step_damage (dtime, pos) then return end
if self.state == "die" then return end if self.state == "die" then return end
@ -473,7 +489,7 @@ local function warn_user_error ()
if time_since_warning > CRASH_WARN_FREQUENCY then if time_since_warning > CRASH_WARN_FREQUENCY then
last_crash_warn_time = current_time last_crash_warn_time = current_time
minetest.log("A game crashing bug was prevented. Please provide debug.log information to MineClone2 dev team for investigation. (Search for: --- Bug report start)") minetest.log("A game crashing bug was prevented. Please provide debug.log information to VoxeLibre dev team for investigation. (Search for: --- Bug report start)")
end end
end end
@ -486,11 +502,11 @@ end
-- main mob function -- main mob function
function mob_class:on_step(dtime) function mob_class:on_step(dtime, moveresult)
if not DEVELOPMENT then if not DEVELOPMENT then
-- Removed as bundled Lua (5.1 doesn't support xpcall) -- Removed as bundled Lua (5.1 doesn't support xpcall)
--local status, retVal = xpcall(on_step_work, on_step_error_handler, self, dtime) --local status, retVal = xpcall(on_step_work, on_step_error_handler, self, dtime)
local status, retVal = pcall(on_step_work, self, dtime) local status, retVal = pcall(on_step_work, self, dtime, moveresult)
if status then if status then
return retVal return retVal
else else
@ -505,7 +521,7 @@ function mob_class:on_step(dtime)
log_error (dump(retVal), dump(pos), dump(self)) log_error (dump(retVal), dump(pos), dump(self))
end end
else else
return on_step_work (self, dtime) return on_step_work (self, dtime, moveresult)
end end
end end

View File

@ -1,5 +1,5 @@
Mobs Redo: MineClone 2 Edition Mobs Redo: VoxeLibre Edition
API documentation API documentation
============================== ==============================
@ -231,7 +231,7 @@ functions needed for the mob to work properly which contains the following:
MineClone 2 extensions: VoxeLibre extensions:
'spawn_class' Classification of mod for the spawning algorithm: 'spawn_class' Classification of mod for the spawning algorithm:
"hostile", "passive", "ambient" or "water" "hostile", "passive", "ambient" or "water"
@ -434,7 +434,7 @@ true the mob will not spawn.
'name' is the name of the animal/monster 'name' is the name of the animal/monster
MineClone 2 extensions VoxeLibre extensions
---------------------- ----------------------
mcl_mobs:spawn_child(pos, mob_type) mcl_mobs:spawn_child(pos, mob_type)
@ -524,7 +524,7 @@ Does nothing and returns false.
This function is provided for compability with Mobs Redo for an attempt to This function is provided for compability with Mobs Redo for an attempt to
capture a mob. capture a mob.
Mobs cannot be captured in MineClone 2. Mobs cannot be captured in VoxeLibre.
In Mobs Redo, this is generally called inside the on_rightclick section of the mob In Mobs Redo, this is generally called inside the on_rightclick section of the mob
api code, it provides a chance of capturing the mob. See Mobs Redo documentation api code, it provides a chance of capturing the mob. See Mobs Redo documentation
@ -671,6 +671,13 @@ mob will spawn e.g.
mobs_animal:sheep_chance 11000 mobs_animal:sheep_chance 11000
mobs_monster:sand_monster_chance 100 mobs_monster:sand_monster_chance 100
Registering Mob Conversion
----------------
Sometimes you need to completely replace one mob with a different version. To do this, use:
mcl_mobs.register_conversion(old_name, new_name)
Rideable Horse Example Mob Rideable Horse Example Mob
-------------------------- --------------------------

View File

@ -78,6 +78,7 @@ function mob_class:feed_tame(clicker, feed_count, breed, tame, notake)
self.food = 0 self.food = 0
self.horny = true self.horny = true
self.persistent = true self.persistent = true
self._luck = mcl_luck.get_luck(clicker:get_player_name())
end end
end end
@ -273,7 +274,7 @@ function mob_class:check_breeding()
return return
end end
mcl_experience.throw_xp(pos, math.random(1, 7)) mcl_experience.throw_xp(pos, math.random(1, 7) + (parent1._luck or 0) + (parent2._luck or 0))
-- custom breed function -- custom breed function
if parent1.on_breed then if parent1.on_breed then
@ -284,6 +285,7 @@ function mob_class:check_breeding()
end end
local child = mcl_mobs.spawn_child(pos, parent1.name) local child = mcl_mobs.spawn_child(pos, parent1.name)
if not child then return end
local ent_c = child:get_luaentity() local ent_c = child:get_luaentity()
@ -322,7 +324,7 @@ function mob_class:toggle_sit(clicker,p)
particle = "mobs_mc_wolf_icon_roam.png" particle = "mobs_mc_wolf_icon_roam.png"
self.order = "roam" self.order = "roam"
self.state = "stand" self.state = "stand"
self.walk_chance = default_walk_chance self.walk_chance = 50
self.jump = true self.jump = true
self:set_animation("stand") self:set_animation("stand")
-- TODO: Add sitting model -- TODO: Add sitting model

View File

@ -21,8 +21,6 @@ local function atan(x)
end end
end end
mcl_mobs.effect_functions = {}
-- check if daytime and also if mob is docile during daylight hours -- check if daytime and also if mob is docile during daylight hours
function mob_class:day_docile() function mob_class:day_docile()
@ -534,6 +532,8 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
if self.protected and minetest.is_protected(mob_pos, hitter:get_player_name()) then if self.protected and minetest.is_protected(mob_pos, hitter:get_player_name()) then
return return
end end
mcl_potions.update_haste_and_fatigue(hitter)
end end
local time_now = minetest.get_us_time() local time_now = minetest.get_us_time()
@ -605,6 +605,13 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
* tmp * ((armor[group] or 0) / 100.0) * tmp * ((armor[group] or 0) / 100.0)
end end
-- strength and weakness effects
local strength = mcl_potions.get_effect(hitter, "strength")
local weakness = mcl_potions.get_effect(hitter, "weakness")
local str_fac = strength and strength.factor or 1
local weak_fac = weakness and weakness.factor or 1
damage = damage * str_fac * weak_fac
if weapon then if weapon then
local fire_aspect_level = mcl_enchanting.get_enchantment(weapon, "fire_aspect") local fire_aspect_level = mcl_enchanting.get_enchantment(weapon, "fire_aspect")
if fire_aspect_level > 0 then if fire_aspect_level > 0 then
@ -646,6 +653,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
if def.tool_capabilities and def.tool_capabilities.punch_attack_uses then if def.tool_capabilities and def.tool_capabilities.punch_attack_uses then
local wear = math.floor(65535/tool_capabilities.punch_attack_uses) local wear = math.floor(65535/tool_capabilities.punch_attack_uses)
weapon:add_wear(wear) weapon:add_wear(wear)
tt.reload_itemstack_description(weapon) -- update tooltip
hitter:set_wielded_item(weapon) hitter:set_wielded_item(weapon)
end end
end, hitter:get_player_name()) end, hitter:get_player_name())
@ -794,34 +802,37 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
end end
-- alert others to the attack -- alert others to the attack
local objs = minetest.get_objects_inside_radius(hitter:get_pos(), self.view_range) local alert_pos = hitter:get_pos()
local obj = nil if alert_pos then
local objs = minetest.get_objects_inside_radius(alert_pos, self.view_range)
local obj = nil
for n = 1, #objs do for n = 1, #objs do
obj = objs[n]:get_luaentity() obj = objs[n]:get_luaentity()
if obj then if obj then
-- only alert members of same mob or friends -- only alert members of same mob or friends
if obj.group_attack if obj.group_attack
and obj.state ~= "attack" and obj.state ~= "attack"
and obj.owner ~= name then and obj.owner ~= name then
if obj.name == self.name then if obj.name == self.name then
obj:do_attack(hitter) obj:do_attack(hitter)
elseif type(obj.group_attack) == "table" then elseif type(obj.group_attack) == "table" then
for i=1, #obj.group_attack do for i=1, #obj.group_attack do
if obj.group_attack[i] == self.name then if obj.group_attack[i] == self.name then
obj._aggro = true obj._aggro = true
obj:do_attack(hitter) obj:do_attack(hitter)
break break
end
end end
end end
end end
end
-- have owned mobs attack player threat -- have owned mobs attack player threat
if obj.owner == name and obj.owner_loyal then if obj.owner == name and obj.owner_loyal then
obj:do_attack(self.object) obj:do_attack(self.object)
end
end end
end end
end end
@ -957,6 +968,7 @@ function mob_class:do_states_attack (dtime)
if self.v_start then if self.v_start then
self.timer = self.timer + dtime self.timer = self.timer + dtime
self.blinktimer = (self.blinktimer or 0) + dtime self.blinktimer = (self.blinktimer or 0) + dtime
self:set_animation("fuse")
if self.blinktimer > 0.2 then if self.blinktimer > 0.2 then
self.blinktimer = 0 self.blinktimer = 0
@ -1142,9 +1154,8 @@ function mob_class:do_states_attack (dtime)
damage_groups = {fleshy = self.damage} damage_groups = {fleshy = self.damage}
}, nil) }, nil)
if self.dealt_effect then if self.dealt_effect then
mcl_mobs.effect_functions[self.dealt_effect.name]( mcl_potions.give_effect_by_level(self.dealt_effect.name, self.attack,
self.attack, self.dealt_effect.factor, self.dealt_effect.dur self.dealt_effect.level, self.dealt_effect.dur)
)
end end
end end
else else

View File

@ -5,6 +5,7 @@ local validate_vector = mcl_util.validate_vector
local active_particlespawners = {} local active_particlespawners = {}
local disable_blood = minetest.settings:get_bool("mobs_disable_blood") local disable_blood = minetest.settings:get_bool("mobs_disable_blood")
local DEFAULT_FALL_SPEED = -9.81*1.5 local DEFAULT_FALL_SPEED = -9.81*1.5
local PI_THIRD = math.pi / 3 -- 60 degrees
local PATHFINDING = "gowp" local PATHFINDING = "gowp"
@ -294,86 +295,66 @@ function mcl_mobs:set_animation(self, anim)
self:set_animation(anim) self:set_animation(anim)
end end
local function dir_to_pitch(dir)
--local dir2 = vector.normalize(dir)
local xz = math.abs(dir.x) + math.abs(dir.z)
return -math.atan2(-dir.y, xz)
end
local function who_are_you_looking_at (self, dtime) local function who_are_you_looking_at (self, dtime)
local pos = self.object:get_pos() if self.order == "sleep" then
self._locked_object = nil
return
end
local stop_look_at_player_chance = math.random(833/self.curiosity)
-- was 10000 - div by 12 for avg entities as outside loop -- was 10000 - div by 12 for avg entities as outside loop
local stop_look_at_player = math.random() * 833 <= self.curiosity
local stop_look_at_player = stop_look_at_player_chance == 1
if self.attack then if self.attack then
if not self.target_time_lost then self._locked_object = not self.target_time_lost and self.attack or nil
self._locked_object = self.attack
else
self._locked_object = nil
end
elseif self.following then elseif self.following then
self._locked_object = self.following self._locked_object = self.following
elseif self._locked_object then elseif self._locked_object then
if stop_look_at_player then if stop_look_at_player then self._locked_object = nil end
--minetest.log("Stop look: ".. self.name)
self._locked_object = nil
end
elseif not self._locked_object then elseif not self._locked_object then
if mcl_util.check_dtime_timer(self, dtime, "step_look_for_someone", 0.2) then if mcl_util.check_dtime_timer(self, dtime, "step_look_for_someone", 0.2) then
--minetest.log("Change look check: ".. self.name) local pos = self.object:get_pos()
-- For the wither this was 20/60=0.33, so probably need to rebalance and divide rates.
-- but frequency of check isn't good as it is costly. Making others too infrequent requires testing
local chance = 150/self.curiosity
if chance < 1 then chance = 1 end
local look_at_player_chance = math.random(chance)
-- was 5000 but called in loop based on entities. so div by 12 as estimate avg of entities found,
-- then div by 20 as less freq lookup
local look_at_player = look_at_player_chance == 1
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 8)) do for _, obj in pairs(minetest.get_objects_inside_radius(pos, 8)) do
if obj:is_player() and vector.distance(pos,obj:get_pos()) < 4 then if obj:is_player() and vector.distance(pos, obj:get_pos()) < 4 then
--minetest.log("Change look to player: ".. self.name)
self._locked_object = obj self._locked_object = obj
break break
elseif obj:is_player() or (obj:get_luaentity() and obj:get_luaentity().name == self.name and self ~= obj:get_luaentity()) then elseif obj:is_player() or (obj:get_luaentity() and self ~= obj:get_luaentity() and obj:get_luaentity().name == self.name) then
if look_at_player then -- For the wither this was 20/60=0.33, so probably need to rebalance and divide rates.
--minetest.log("Change look to mob: ".. self.name) -- but frequency of check isn't good as it is costly. Making others too infrequent requires testing
-- was 5000 but called in loop based on entities. so div by 12 as estimate avg of entities found,
-- then div by 20 as less freq lookup
if math.random() * 150 <= self.curiosity then
self._locked_object = obj self._locked_object = obj
break break
end end
end end
end end
end end
end end
end end
function mob_class:check_head_swivel(dtime) function mob_class:check_head_swivel(dtime)
if not self.head_swivel or type(self.head_swivel) ~= "string" then return end 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, dtime) local newr, oldp, oldr = vector.zero(), nil, nil
if self.object.get_bone_override then -- minetest >= 5.9
local ov = self.object:get_bone_override(self.head_swivel)
oldp, oldr = ov.position.vec, ov.rotation.vec
else -- minetest < 5.9
oldp, oldr = self.object:get_bone_position(self.head_swivel)
oldr = vector.apply(oldr, math.rad) -- old API uses radians
end
local final_rotation = vector.zero() local locked_object = self._locked_object
local oldp,oldr = self.object:get_bone_position(self.head_swivel) if locked_object and (locked_object:is_player() or locked_object:get_luaentity()) and locked_object:get_hp() > 0 then
if self._locked_object and (self._locked_object:is_player() or self._locked_object:get_luaentity()) and self._locked_object:get_hp() > 0 then
local _locked_object_eye_height = 1.5 local _locked_object_eye_height = 1.5
if self._locked_object:get_luaentity() then if locked_object:is_player() then
_locked_object_eye_height = self._locked_object:get_luaentity().head_eye_height _locked_object_eye_height = locked_object:get_properties().eye_height
end elseif locked_object:get_luaentity() then
if self._locked_object:is_player() then _locked_object_eye_height = locked_object:get_luaentity().head_eye_height
_locked_object_eye_height = self._locked_object:get_properties().eye_height
end end
if _locked_object_eye_height then if _locked_object_eye_height then
local self_rot = self.object:get_rotation() local self_rot = self.object:get_rotation()
-- If a mob is attached, should we really be messing with what they are looking at? -- If a mob is attached, should we really be messing with what they are looking at?
-- Should this be excluded? -- Should this be excluded?
@ -381,40 +362,48 @@ function mob_class:check_head_swivel(dtime)
self_rot = self.object:get_attach():get_rotation() self_rot = self.object:get_attach():get_rotation()
end end
local player_pos = self._locked_object:get_pos() local ps = self.object:get_pos()
local direction_player = vector.direction(vector.add(self.object:get_pos(), vector.new(0, self.head_eye_height*.7, 0)), vector.add(player_pos, vector.new(0, _locked_object_eye_height, 0))) ps.y = ps.y + self.head_eye_height * .7
local mob_yaw = math.deg(-(-(self_rot.y)-(-minetest.dir_to_yaw(direction_player))))+self.head_yaw_offset local pt = locked_object:get_pos()
local mob_pitch = math.deg(-dir_to_pitch(direction_player))*self.head_pitch_multiplier pt.y = pt.y + _locked_object_eye_height
local dir = vector.direction(ps, pt)
local mob_yaw = self_rot.y + math.atan2(dir.x, dir.z) + self.head_yaw_offset
local mob_pitch = math.asin(-dir.y) * self.head_pitch_multiplier
if (mob_yaw < -60 or mob_yaw > 60) and not (self.attack and self.state == "attack" and not self.runaway) then if (mob_yaw < -PI_THIRD or mob_yaw > PI_THIRD) and not (self.attack and self.state == "attack" and not self.runaway) then
final_rotation = vector.multiply(oldr, 0.9) newr = vector.multiply(oldr, 0.9)
elseif self.attack and self.state == "attack" and not self.runaway then elseif self.attack and self.state == "attack" and not self.runaway then
if self.head_yaw == "y" then if self.head_yaw == "y" then
final_rotation = vector.new(mob_pitch, mob_yaw, 0) newr = vector.new(mob_pitch, mob_yaw, 0)
elseif self.head_yaw == "z" then elseif self.head_yaw == "z" then
final_rotation = vector.new(mob_pitch, 0, -mob_yaw) newr = vector.new(mob_pitch, 0, -mob_yaw)
end end
else else
if self.head_yaw == "y" then if self.head_yaw == "y" then
final_rotation = vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, ((mob_yaw-oldr.y)*.3)+oldr.y, 0) newr = vector.new((mob_pitch-oldr.x)*.3+oldr.x, (mob_yaw-oldr.y)*.3+oldr.y, 0)
elseif self.head_yaw == "z" then elseif self.head_yaw == "z" then
final_rotation = vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, 0, -(((mob_yaw-oldr.y)*.3)+oldr.y)*3) newr = vector.new((mob_pitch-oldr.x)*.3+oldr.x, 0, ((mob_yaw-oldr.y)*.3+oldr.y)*-3)
end end
end end
end end
elseif not self._locked_object and math.abs(oldr.y) > 3 and math.abs(oldr.x) < 3 then elseif not locked_object and math.abs(oldr.y) > 0.05 and math.abs(oldr.x) < 0.05 then
final_rotation = vector.multiply(oldr, 0.9) newr = vector.multiply(oldr, 0.9)
else end
--final_rotation = vector.new(0,0,0)
-- 0.02 is about 1.14 degrees tolerance, to update less often
local newp = vector.new(0, self.bone_eye_height, self.horizontal_head_height)
if math.abs(oldr.x-newr.x) + math.abs(oldr.y-newr.y) + math.abs(oldr.z-newr.z) < 0.02 and vector.equals(oldp, newp) then return end
if self.object.get_bone_override then -- minetest >= 5.9
self.object:set_bone_override(self.head_swivel, {
position = { vec = newp, absolute = true },
rotation = { vec = newr, absolute = true } })
else -- minetest < 5.9
-- old API uses degrees not radians
self.object:set_bone_position(self.head_swivel, newp, vector.apply(newr, math.deg))
end end
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horizontal_head_height), final_rotation)
end end
function mob_class:set_animation_speed() function mob_class:set_animation_speed()
local v = self.object:get_velocity() local v = self.object:get_velocity()
if v then if v then

View File

@ -141,7 +141,7 @@ function mcl_mobs.register_mob(name, def)
local final_def = { local final_def = {
use_texture_alpha = def.use_texture_alpha, use_texture_alpha = def.use_texture_alpha,
head_swivel = def.head_swivel or nil, -- bool to activate this function head_swivel = def.head_swivel or nil, -- bool to activate this function
head_yaw_offset = def.head_yaw_offset or 0, -- for wonkey model bones head_yaw_offset = math.rad(def.head_yaw_offset or 0), -- for wonkey model bones
head_pitch_multiplier = def.head_pitch_multiplier or 1, --for inverted pitch head_pitch_multiplier = def.head_pitch_multiplier or 1, --for inverted pitch
bone_eye_height = def.bone_eye_height or 1.4, -- head bone offset bone_eye_height = def.bone_eye_height or 1.4, -- head bone offset
head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player
@ -314,6 +314,7 @@ function mcl_mobs.register_mob(name, def)
return self:mob_activate(staticdata, def, dtime) return self:mob_activate(staticdata, def, dtime)
end, end,
after_activate = def.after_activate,
attack_state = def.attack_state, -- custom attack state attack_state = def.attack_state, -- custom attack state
on_attack = def.on_attack, -- called after attack, useful with otherwise predefined attack states (not custom) on_attack = def.on_attack, -- called after attack, useful with otherwise predefined attack states (not custom)
harmed_by_heal = def.harmed_by_heal, harmed_by_heal = def.harmed_by_heal,
@ -324,16 +325,55 @@ function mcl_mobs.register_mob(name, def)
attack_exception = def.attack_exception or function(p) return false end, attack_exception = def.attack_exception or function(p) return false end,
_spawner = def._spawner, _spawner = def._spawner,
_mcl_potions = {},
} }
minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta))
if minetest.get_modpath("doc_identifier") ~= nil then if minetest.get_modpath("doc_identifier") ~= nil then
doc.sub.identifier.register_object(name, "basics", "mobs") doc.sub.identifier.register_object(name, "basics", "mobs")
if def.unused ~= true then
doc.add_entry("mobs", name, {
name = def.description or name,
data = final_def,
})
end
end end
minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta))
end -- END mcl_mobs.register_mob function end -- END mcl_mobs.register_mob function
local STRIP_FIELDS = { "mesh", "base_size", "textures", "base_mesh", "base_texture" }
function mcl_mobs.strip_staticdata(unpacked_staticdata)
-- Strip select fields from the staticdata to prevent conversion issues
for i = 1,#STRIP_FIELDS do
unpacked_staticdata[STRIP_FIELDS[i]] = nil
end
end
function mcl_mobs.register_conversion(old_name, new_name)
minetest.register_entity(old_name, {
on_activate = function(self, staticdata, dtime)
local unpacked_staticdata = minetest.deserialize(staticdata)
mcl_mobs.strip_staticdata(unpacked_staticdata)
staticdata = minetest.serialize(unpacked_staticdata)
local old_object = self.object
if not old_object then return end
local pos = old_object:get_pos()
if not pos then return end
old_object:remove()
local new_object = minetest.add_entity(pos, new_name, staticdata)
if not new_object then return end
local hook = (new_object:get_luaentity() or {})._on_after_convert
if hook then hook(new_object) end
end,
_convert_to = new_name,
})
end
function mcl_mobs.get_arrow_damage_func(damage, typ) function mcl_mobs.get_arrow_damage_func(damage, typ)
local typ = mcl_damage.types[typ] and typ or "arrow" local typ = mcl_damage.types[typ] and typ or "arrow"
return function(projectile, object) return function(projectile, object)
@ -367,7 +407,7 @@ function mcl_mobs.register_arrow(name, def)
rotate = def.rotate, rotate = def.rotate,
on_punch = def.on_punch or function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage) on_punch = def.on_punch or function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)
local vel = self.object:get_velocity():length() local vel = self.object:get_velocity():length()
self.object:set_velocity({x=dir.x * vel, y=dir.y * vel, z=dir.z * vel}) self.object:set_velocity(dir * vel)
self._puncher = puncher self._puncher = puncher
end, end,
collisionbox = def.collisionbox or {0, 0, 0, 0, 0, 0}, collisionbox = def.collisionbox or {0, 0, 0, 0, 0, 0},
@ -488,7 +528,7 @@ end
-- Note: This also introduces the “spawn_egg” group: -- Note: This also introduces the “spawn_egg” group:
-- * spawn_egg=1: Spawn egg (generic mob, no metadata) -- * spawn_egg=1: Spawn egg (generic mob, no metadata)
-- * spawn_egg=2: Spawn egg (captured/tamed mob, metadata) -- * spawn_egg=2: Spawn egg (captured/tamed mob, metadata)
function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addegg, no_creative) function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, addegg, no_creative)
local grp = {spawn_egg = 1} local grp = {spawn_egg = 1}
@ -499,7 +539,7 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
local invimg = "(spawn_egg.png^[multiply:" .. background_color ..")^(spawn_egg_overlay.png^[multiply:" .. overlay_color .. ")" local invimg = "(spawn_egg.png^[multiply:" .. background_color ..")^(spawn_egg_overlay.png^[multiply:" .. overlay_color .. ")"
if old_spawn_icons then if old_spawn_icons then
local mobname = mob:gsub("mobs_mc:","") local mobname = mob_id:gsub("mobs_mc:","")
local fn = "mobs_mc_spawn_icon_"..mobname..".png" local fn = "mobs_mc_spawn_icon_"..mobname..".png"
if mcl_util.file_exists(minetest.get_modpath("mobs_mc").."/textures/"..fn) then if mcl_util.file_exists(minetest.get_modpath("mobs_mc").."/textures/"..fn) then
invimg = fn invimg = fn
@ -511,7 +551,7 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
end end
-- register old stackable mob egg -- register old stackable mob egg
minetest.register_craftitem(mob, { minetest.register_craftitem(mob_id, {
description = desc, description = desc,
inventory_image = invimg, inventory_image = invimg,
@ -521,7 +561,6 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
_doc_items_usagehelp = S("Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns."), _doc_items_usagehelp = S("Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns."),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above local pos = pointed_thing.above
-- am I clicking on something with existing on_rightclick function? -- am I clicking on something with existing on_rightclick function?
@ -531,11 +570,12 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
return def.on_rightclick(pointed_thing.under, under, placer, itemstack) return def.on_rightclick(pointed_thing.under, under, placer, itemstack)
end end
local mob_name = itemstack:get_name()
if pos and within_limits(pos, 0) and not minetest.is_protected(pos, placer:get_player_name()) then if pos and within_limits(pos, 0) and not minetest.is_protected(pos, placer:get_player_name()) then
local name = placer:get_player_name() local name = placer:get_player_name()
local privs = minetest.get_player_privs(name) local privs = minetest.get_player_privs(name)
if under.name == "mcl_mobspawners:spawner" then if under.name == "mcl_mobspawners:spawner" then
if minetest.is_protected(pointed_thing.under, name) then if minetest.is_protected(pointed_thing.under, name) then
minetest.record_protection_violation(pointed_thing.under, name) minetest.record_protection_violation(pointed_thing.under, name)
@ -552,26 +592,35 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
--minetest.log("min light: " .. mob_light_lvl[1]) --minetest.log("min light: " .. mob_light_lvl[1])
--minetest.log("max light: " .. mob_light_lvl[2]) --minetest.log("max light: " .. mob_light_lvl[2])
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name(), mob_light_lvl[1], mob_light_lvl[2]) -- Handle egg conversion
local convert_to = (minetest.registered_entities[mob_name] or {})._convert_to
if convert_to then mob_name = convert_to end
mcl_mobspawners.setup_spawner(pointed_thing.under, mob_name, mob_light_lvl[1], mob_light_lvl[2])
if not minetest.is_creative_enabled(name) then if not minetest.is_creative_enabled(name) then
itemstack:take_item() itemstack:take_item()
end end
return itemstack return itemstack
end end
if not minetest.registered_entities[mob] then if not minetest.registered_entities[mob_name] then
return itemstack return itemstack
end end
if minetest.settings:get_bool("only_peaceful_mobs", false) if minetest.settings:get_bool("only_peaceful_mobs", false)
and minetest.registered_entities[mob].type == "monster" then and minetest.registered_entities[mob_name].type == "monster" then
minetest.chat_send_player(name, S("Only peaceful mobs allowed!")) minetest.chat_send_player(name, S("Only peaceful mobs allowed!"))
return itemstack return itemstack
end end
pos.y = pos.y - 0.5 pos.y = pos.y - 1
local mob = mcl_mobs.spawn(pos, mob_name)
if not mob then
pos.y = pos.y + 1
mob = mcl_mobs.spawn(pos, mob_name)
if not mob then return end
end
local mob = minetest.add_entity(pos, mob)
local entityname = itemstack:get_name() local entityname = itemstack:get_name()
minetest.log("action", "Player " ..name.." spawned "..entityname.." at "..minetest.pos_to_string(pos)) minetest.log("action", "Player " ..name.." spawned "..entityname.." at "..minetest.pos_to_string(pos))
local ent = mob:get_luaentity() local ent = mob:get_luaentity()
@ -602,5 +651,4 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
return itemstack return itemstack
end, end,
}) })
end end

View File

@ -87,7 +87,8 @@ function mob_class:check_item_pickup()
end end
if self.pick_up then if self.pick_up then
for k,v in pairs(self.pick_up) do for k,v in pairs(self.pick_up) do
if not player_near(p) and self.on_pick_up and l.itemstring:find(v) then local itemstack = ItemStack(l.itemstring)
if not player_near(p) and self.on_pick_up and itemstack:get_name():find(v) then
local r = self.on_pick_up(self,l) local r = self.on_pick_up(self,l)
if r and r.is_empty and not r:is_empty() then if r and r.is_empty and not r:is_empty() then
l.itemstring = r:to_string() l.itemstring = r:to_string()

View File

@ -1,5 +1,5 @@
name = mcl_mobs name = mcl_mobs
author = PilzAdam author = PilzAdam
description = Adds a mob API for mods to add animals or monsters, etc. description = Adds a mob API for mods to add animals or monsters, etc.
depends = mcl_particles depends = mcl_particles, mcl_luck
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience, mcl_sculk optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience, mcl_sculk

View File

@ -258,6 +258,18 @@ function mcl_mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
end end
end end
-- Stop!
local s = get_sign(entity.v)
entity.v = entity.v - 0.02 * s
if s ~= get_sign(entity.v) then
entity.object:set_velocity({x = 0, y = 0, z = 0})
entity.v = 0
return
end
-- if not moving then set animation and return -- if not moving then set animation and return
if entity.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then if entity.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
@ -273,18 +285,6 @@ function mcl_mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
mcl_mobs:set_animation(entity, moving_anim) mcl_mobs:set_animation(entity, moving_anim)
end end
-- Stop!
local s = get_sign(entity.v)
entity.v = entity.v - 0.02 * s
if s ~= get_sign(entity.v) then
entity.object:set_velocity({x = 0, y = 0, z = 0})
entity.v = 0
return
end
-- enforce speed limit forward and reverse -- enforce speed limit forward and reverse
local max_spd = entity.max_speed_reverse local max_spd = entity.max_speed_reverse

View File

@ -362,7 +362,7 @@ function mob_class:env_danger_movement_checks(player_in_active_range)
self.state = "stand" self.state = "stand"
self:set_animation( "stand") self:set_animation( "stand")
end end
yaw = yaw + math.random(-0.5, 0.5) yaw = yaw + math.random() - 0.5
yaw = self:set_yaw( yaw, 8) yaw = self:set_yaw( yaw, 8)
return return
end end
@ -788,9 +788,9 @@ function mob_class:flop()
if self.object:get_velocity().y < 0.1 then if self.object:get_velocity().y < 0.1 then
self:mob_sound("flop") self:mob_sound("flop")
self.object:set_velocity({ self.object:set_velocity({
x = math.random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED), x = (math.random()-0.5) * 2 * FLOP_HOR_SPEED,
y = FLOP_HEIGHT, y = FLOP_HEIGHT,
z = math.random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED), z = (math.random()-0.5) * 2 * FLOP_HOR_SPEED,
}) })
end end
end end
@ -920,7 +920,7 @@ function mob_class:do_states_walk()
-- Randomly turn -- Randomly turn
if math.random(1, 100) <= 30 then if math.random(1, 100) <= 30 then
yaw = yaw + math.random(-0.5, 0.5) yaw = yaw + math.random() - 0.5
yaw = self:set_yaw( yaw, 8) yaw = self:set_yaw( yaw, 8)
end end
end end
@ -929,7 +929,7 @@ function mob_class:do_states_walk()
-- otherwise randomly turn -- otherwise randomly turn
elseif math.random(1, 100) <= 30 then elseif math.random(1, 100) <= 30 then
yaw = yaw + math.random(-0.5, 0.5) yaw = yaw + math.random() - 0.5
yaw = self:set_yaw( yaw, 8) yaw = self:set_yaw( yaw, 8)
end end
@ -989,7 +989,7 @@ function mob_class:do_states_stand(player_in_active_range)
if lp.x > s.x then yaw = yaw +math.pi end if lp.x > s.x then yaw = yaw +math.pi end
else else
yaw = yaw + math.random(-0.5, 0.5) yaw = yaw + math.random() - 0.5
end end
yaw = self:set_yaw( yaw, 8) yaw = self:set_yaw( yaw, 8)

View File

@ -684,7 +684,7 @@ function mob_class:do_env_damage()
self.object:set_velocity({x = 0, y = 0, z = 0}) self.object:set_velocity({x = 0, y = 0, z = 0})
-- wither rose effect -- wither rose effect
elseif self.standing_in == "mcl_flowers:wither_rose" then elseif self.standing_in == "mcl_flowers:wither_rose" then
mcl_potions.withering_func(self.object, 1, 2) mcl_potions.give_effect_by_level("withering", self.object, 2, 2)
end end
local nodef = minetest.registered_nodes[self.standing_in] local nodef = minetest.registered_nodes[self.standing_in]
@ -692,14 +692,10 @@ function mob_class:do_env_damage()
local nodef3 = minetest.registered_nodes[self.standing_under] local nodef3 = minetest.registered_nodes[self.standing_under]
-- rain -- rain
if self.rain_damage > 0 then if self.rain_damage > 0 and mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then self.health = self.health - self.rain_damage
self.health = self.health - self.rain_damage if self:check_for_death("rain", {type = "environment", pos = pos, node = self.standing_in}) then
return true
if self:check_for_death("rain", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
end
end end
end end
@ -707,14 +703,10 @@ function mob_class:do_env_damage()
-- water damage -- water damage
if self.water_damage > 0 and nodef.groups.water then if self.water_damage > 0 and nodef.groups.water then
if self.water_damage ~= 0 then self.health = self.health - self.water_damage
self.health = self.health - self.water_damage mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png", nil, nil, 1, nil)
mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png", nil, nil, 1, nil) if self:check_for_death("water", {type = "environment", pos = pos, node = self.standing_in}) then
return true
if self:check_for_death("water", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
end
end end
elseif self.lava_damage > 0 and (nodef.groups.lava) then elseif self.lava_damage > 0 and (nodef.groups.lava) then
-- lava damage -- lava damage
@ -730,91 +722,69 @@ function mob_class:do_env_damage()
end end
elseif self.fire_damage > 0 and (nodef2.groups.fire) then elseif self.fire_damage > 0 and (nodef2.groups.fire) then
-- magma damage -- magma damage
if self.fire_damage ~= 0 then self.health = self.health - self.fire_damage
self.health = self.health - self.fire_damage if self:check_for_death("fire", {type = "environment", pos = pos, node = self.standing_in}) then
return true
if self:check_for_death("fire", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
end
end end
elseif self.fire_damage > 0 and (nodef.groups.fire) then elseif self.fire_damage > 0 and (nodef.groups.fire) then
-- fire damage -- fire damage
if self.fire_damage ~= 0 then self.health = self.health - self.fire_damage
self.health = self.health - self.fire_damage mcl_mobs.effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil)
mcl_mobs.effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil) mcl_burning.set_on_fire(self.object, 5)
mcl_burning.set_on_fire(self.object, 5) if self:check_for_death("fire", {type = "environment", pos = pos, node = self.standing_in}) then
return true
if self:check_for_death("fire", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
end
end end
elseif nodef.damage_per_second ~= 0 and not nodef.groups.lava and not nodef.groups.fire then elseif nodef.damage_per_second ~= 0 and not nodef.groups.lava and not nodef.groups.fire then
-- damage_per_second node check -- damage_per_second node check
self.health = self.health - nodef.damage_per_second self.health = self.health - nodef.damage_per_second
mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png") mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png")
if self:check_for_death("dps", {type = "environment", pos = pos, node = self.standing_in}) then
if self:check_for_death("dps", {type = "environment",
pos = pos, node = self.standing_in}) then
return true return true
end end
end end
-- Cactus damage -- Cactus damage
local near = minetest.find_node_near(pos, 1, "mcl_core:cactus", true) if self.standing_on == "mcl_core:cactus" or self.standing_in == "mcl_core:cactus" or self.standing_under == "mcl_core:cactus" then
if not near and near ~= nil then self:damage_mob("cactus", 2)
near = find_node_near({x=pos.x, y=pos.y-1, z=pos.z}, 1, "mcl_core:cactus", true) if self:check_for_death("cactus", {type = "environment", pos = pos, node = self.standing_in}) then
end return true
if near then
-- is mob touching the cactus?
local dist = vector.distance(pos, near)
local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near)
local large_mob = false
local medium_mob = false
if self.name == "mobs_mc:ender_dragon" or
self.name == "mobs_mc:ghast" or
self.name == "mobs_mc:guardian_elder" or
self.name == "mobs_mc:slime_big" or
self.name == "mobs_mc:magma_cube_big" or
self.name == "mobs_mc:wither" then
large_mob = true
elseif self.name == "mobs_mc:hoglin" or
self.name == "mobs_mc:zoglin" or
self.name == "mobs_mc:horse" or
self.name == "mobs_mc:skeleton_horse" or
self.name == "mobs_mc:zombie_horse" or
self.name == "mobs_mc:donkey" or
self.name == "mobs_mc:mule" or
self.name == "mobs_mc:iron_golem" or
self.name == "mobs_mc:polar_bear" or
self.name == "mobs_mc:spider" or
self.name == "mobs_mc:cave_spider" or
self.name == "mobs_mc:strider" then
medium_mob = true
end end
if (not large_mob and not medium_mob and (dist < 1.03 or dist_feet < 1.6)) or (medium_mob and (dist < 1.165 or dist_feet < 1.73)) or (large_mob and (dist < 1.25 or dist_feet < 1.9)) then else
if self.health ~= 0 then local near = minetest.find_node_near(pos, 1, "mcl_core:cactus")
if near then
-- is mob touching the cactus?
local dist = vector.distance(pos, near)
local threshold = 1.04 -- small mobs
-- medium mobs
if self.name == "mobs_mc:spider" or
self.name == "mobs_mc:iron_golem" or
self.name == "mobs_mc:horse" or
self.name == "mobs_mc:donkey" or
self.name == "mobs_mc:mule" or
self.name == "mobs_mc:polar_bear" or
self.name == "mobs_mc:cave_spider" or
self.name == "mobs_mc:skeleton_horse" or
self.name == "mobs_mc:zombie_horse" or
self.name == "mobs_mc:strider" or
self.name == "mobs_mc:hoglin" or
self.name == "mobs_mc:zoglin" then
threshold = 1.165
elseif self.name == "mobs_mc:slime_big" or
self.name == "mobs_mc:magma_cube_big" or
self.name == "mobs_mc:ghast" or
self.name == "mobs_mc:guardian_elder" or
self.name == "mobs_mc:wither" or
self.name == "mobs_mc:ender_dragon" then
threshold = 1.25
end
if dist < threshold then
self:damage_mob("cactus", 2) self:damage_mob("cactus", 2)
if self:check_for_death("cactus", {type = "environment", pos = pos, node = self.standing_in}) then
if self:check_for_death("cactus", {type = "environment",
pos = pos, node = self.standing_in}) then
return true return true
end end
end end
end end
end end
-- is mob standing on the cactus?
if self.standing_on == "mcl_core:cactus" or self.standing_in == "mcl_core:cactus" or self.standing_under == "mcl_core:cactus" then
self:damage_mob("cactus", 2)
if self:check_for_death("cactus", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
end
end
-- Drowning damage -- Drowning damage
if self.breath_max ~= -1 then if self.breath_max ~= -1 then
@ -957,8 +927,7 @@ end
-- falling and fall damage -- falling and fall damage
-- returns true if mob died -- returns true if mob died
function mob_class:falling(pos) function mob_class:falling(pos, moveresult)
if self.fly and self.state ~= "die" then if self.fly and self.state ~= "die" then
return return
end end
@ -981,7 +950,13 @@ function mob_class:falling(pos)
new_acceleration = vector.new(0, DEFAULT_FALL_SPEED, 0) new_acceleration = vector.new(0, DEFAULT_FALL_SPEED, 0)
elseif v.y <= 0 and v.y > self.fall_speed then elseif v.y <= 0 and v.y > self.fall_speed then
-- fall downwards at set speed -- fall downwards at set speed
new_acceleration = vector.new(0, self.fall_speed, 0) if moveresult and moveresult.touching_ground then
-- when touching ground, retain a minimal gravity to keep the touching_ground flag
-- but also to not get upwards acceleration with large dtime when on bouncy ground
new_acceleration = vector.new(0, self.fall_speed * 0.01, 0)
else
new_acceleration = vector.new(0, self.fall_speed, 0)
end
else else
-- stop accelerating once max fall speed hit -- stop accelerating once max fall speed hit
new_acceleration =vector.zero() new_acceleration =vector.zero()

View File

@ -1,74 +1,74 @@
Mobs Redo: MineClone 2 Edition Mobs Redo: VoxeLibre Edition
Based on Mobs Redo from TenPlus1 Based on Mobs Redo from TenPlus1
Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint. Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint.
This mod contains the API only for adding your own mobs into the world, so please use the additional modpacks to add animals, monsters etc. This mod contains the API only for adding your own mobs into the world, so please use the additional modpacks to add animals, monsters etc.
https://forum.minetest.net/viewtopic.php?f=11&t=9917 https://forum.minetest.net/viewtopic.php?f=11&t=9917
------------ ------------
Credits: Credits:
mcl_mobs_mob_poof.ogg: mcl_mobs_mob_poof.ogg:
- by Planman (license: Creative Commons Zero) - by Planman (license: Creative Commons Zero)
- Source: <https://freesound.org/people/Planman/sounds/208111/> - Source: <https://freesound.org/people/Planman/sounds/208111/>
------------ ------------
Changelog from original Mobs Redo mod: Changelog from original Mobs Redo mod:
- 1.41- Mob pathfinding has been updated thanks to Elkien3 - 1.41- Mob pathfinding has been updated thanks to Elkien3
- 1.40- Updated to use newer functions, requires Minetest 0.4.16+ to work. - 1.40- Updated to use newer functions, requires Minetest 0.4.16+ to work.
- 1.39- Added 'on_breed', 'on_grown' and 'do_punch' custom functions per mob - 1.39- Added 'on_breed', 'on_grown' and 'do_punch' custom functions per mob
- 1.38- Better entity checking, nametag setting and on_spawn function added to mob registry, tweaked light damage - 1.38- Better entity checking, nametag setting and on_spawn function added to mob registry, tweaked light damage
- 1.37- Added support for Raymoo's CMI (common mob interface) mod: https://forum.minetest.net/viewtopic.php?f=9&t=15448 - 1.37- Added support for Raymoo's CMI (common mob interface) mod: https://forum.minetest.net/viewtopic.php?f=9&t=15448
- 1.36- Death check added, if mob dies in fire/lava/with lava pick then drops are cooked - 1.36- Death check added, if mob dies in fire/lava/with lava pick then drops are cooked
- 1.35- Added owner_loyal flag for owned mobs to attack player enemies, also fixed group_attack - 1.35- Added owner_loyal flag for owned mobs to attack player enemies, also fixed group_attack
- 1.34- Added function to fly mob using directional movement (thanks D00Med for flying code) - 1.34- Added function to fly mob using directional movement (thanks D00Med for flying code)
- 1.33- Added functions to mount ride mobs (mobs.attach, mobs.detach, mobs.drive) many thanks to Blert2112 - 1.33- Added functions to mount ride mobs (mobs.attach, mobs.detach, mobs.drive) many thanks to Blert2112
- 1.32- Added new spawn check to count specific mobs AND new minetest.conf setting to chance spawn chance and numbers, added ability to protect tamed mobs - 1.32- Added new spawn check to count specific mobs AND new minetest.conf setting to chance spawn chance and numbers, added ability to protect tamed mobs
- 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks, also 'mob_difficulty' .conf setting to make mobs harder. - 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks, also 'mob_difficulty' .conf setting to make mobs harder.
- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code - 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code
- 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod - 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod
- 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :) - 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :)
- 1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function. - 1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function.
- 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :) - 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :)
- 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak. - 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak.
- 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition) - 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition)
- 1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings) - 1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings)
- 1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner - 1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner
- 1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp) - 1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp)
- 1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error - 1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error
- 1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick - 1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick
- 1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first - 1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first
- 1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added - 1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added
- 1.16- Mobs follow multiple items now, Npc's can breed - 1.16- Mobs follow multiple items now, Npc's can breed
- 1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility. - 1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility.
- 1.14- All .self variables saved in staticdata, Fixed self.health bug - 1.14- All .self variables saved in staticdata, Fixed self.health bug
- 1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's - 1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's
- 1.12- Added animal ownership so that players cannot steal your tamed animals - 1.12- Added animal ownership so that players cannot steal your tamed animals
- 1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy - 1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy
- 1,10- Footstep removed (use replace), explosion routine added for exploding mobs. - 1,10- Footstep removed (use replace), explosion routine added for exploding mobs.
- 1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals - 1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals
- 1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added - 1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added
- 1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables - 1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables
- beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop - beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop
- 1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal) - 1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal)
- 1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten - 1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten
- 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :) - 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :)
- 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc. - 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc.
- 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions - 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions
- 1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items - 1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items
- 1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :) - 1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :)
- 0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked - 0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked
- 0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound - 0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound
- 0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes - 0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes
- 0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block - 0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block
- 0.5 - Mobs now float in water, die from falling, and some code improvements - 0.5 - Mobs now float in water, die from falling, and some code improvements
- 0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :) - 0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :)
- 0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :) - 0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :)
- 0.2 - Cooking bucket of milk into cheese now returns empty bucket - 0.2 - Cooking bucket of milk into cheese now returns empty bucket
- 0.1 - Initial Release - 0.1 - Initial Release

584
mods/ENTITIES/mcl_mobs/spawning.lua Executable file → Normal file
View File

@ -10,19 +10,22 @@ local overworld_sky_threshold = tonumber(minetest.settings:get("mcl_mobs_overwor
local overworld_passive_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_passive_threshold")) or 7 local overworld_passive_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_passive_threshold")) or 7
local get_node = minetest.get_node local get_node = minetest.get_node
local get_item_group = minetest.get_item_group
local get_node_light = minetest.get_node_light local get_node_light = minetest.get_node_light
local find_nodes_in_area_under_air = minetest.find_nodes_in_area_under_air local find_nodes_in_area_under_air = minetest.find_nodes_in_area_under_air
local get_biome_name = minetest.get_biome_name local mt_get_biome_name = minetest.get_biome_name
local get_objects_inside_radius = minetest.get_objects_inside_radius local get_objects_inside_radius = minetest.get_objects_inside_radius
local get_connected_players = minetest.get_connected_players local get_connected_players = minetest.get_connected_players
local registered_nodes = minetest.registered_nodes
local math_min = math.min
local math_max = math.max
local math_random = math.random local math_random = math.random
local math_floor = math.floor local math_floor = math.floor
local math_ceil = math.ceil local math_ceil = math.ceil
local math_cos = math.cos local math_cos = math.cos
local math_sin = math.sin local math_sin = math.sin
local math_round = function(x) return (x > 0) and math_floor(x + 0.5) or math_ceil(x - 0.5) end local math_sqrt = math.sqrt
local math_abs = math.abs
local vector_distance = vector.distance local vector_distance = vector.distance
local vector_new = vector.new local vector_new = vector.new
@ -32,19 +35,15 @@ local table_copy = table.copy
local table_remove = table.remove local table_remove = table.remove
local pairs = pairs local pairs = pairs
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_mobs_spawning", false) local logging = minetest.settings:get_bool("mcl_logging_mobs_spawn", false)
local function mcl_log (message, property) local function mcl_log(message, property)
if LOGGING_ON then if property then message = message .. ": " .. dump(property) end
if property then mcl_util.mcl_log(message, "[Mobs spawn]", true)
message = message .. ": " .. dump(property)
end
mcl_util.mcl_log (message, "[Mobs spawn]", true)
end
end end
if not logging then mcl_log = function() end end
local dbg_spawn_attempts = 0 local dbg_spawn_attempts = 0
local dbg_spawn_succ = 0 local dbg_spawn_succ = 0
local dbg_spawn_counts = {}
local remove_far = true local remove_far = true
@ -53,8 +52,10 @@ local FIND_SPAWN_POS_RETRIES = 16
local FIND_SPAWN_POS_RETRIES_SUCCESS_RESPIN = 8 local FIND_SPAWN_POS_RETRIES_SUCCESS_RESPIN = 8
local MOB_SPAWN_ZONE_INNER = 24 local MOB_SPAWN_ZONE_INNER = 24
local MOB_SPAWN_ZONE_INNER_SQ = MOB_SPAWN_ZONE_INNER^2 -- squared
local MOB_SPAWN_ZONE_MIDDLE = 32 local MOB_SPAWN_ZONE_MIDDLE = 32
local MOB_SPAWN_ZONE_OUTER = 128 local MOB_SPAWN_ZONE_OUTER = 128
local MOB_SPAWN_ZONE_OUTER_SQ = MOB_SPAWN_ZONE_OUTER^2 -- squared
-- range for mob count -- range for mob count
local MOB_CAP_INNER_RADIUS = 32 local MOB_CAP_INNER_RADIUS = 32
@ -94,170 +95,6 @@ mcl_log("Percentage of hostile spawns are group: " .. hostile_group_percentage_s
--do mobs spawn? --do mobs spawn?
local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false
local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false
local logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true)
-- THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs
-- Also used for missing parameter
-- Please update the list when adding new biomes!
local list_of_all_biomes = {
-- underground:
"FlowerForest_underground",
"JungleEdge_underground",
"ColdTaiga_underground",
"IcePlains_underground",
"IcePlainsSpikes_underground",
"MegaTaiga_underground",
"Taiga_underground",
"ExtremeHills+_underground",
"JungleM_underground",
"ExtremeHillsM_underground",
"JungleEdgeM_underground",
"MangroveSwamp_underground",
-- ocean:
"RoofedForest_ocean",
"JungleEdgeM_ocean",
"BirchForestM_ocean",
"BirchForest_ocean",
"IcePlains_deep_ocean",
"Jungle_deep_ocean",
"Savanna_ocean",
"MesaPlateauF_ocean",
"ExtremeHillsM_deep_ocean",
"Savanna_deep_ocean",
"SunflowerPlains_ocean",
"Swampland_deep_ocean",
"Swampland_ocean",
"MegaSpruceTaiga_deep_ocean",
"ExtremeHillsM_ocean",
"JungleEdgeM_deep_ocean",
"SunflowerPlains_deep_ocean",
"BirchForest_deep_ocean",
"IcePlainsSpikes_ocean",
"Mesa_ocean",
"StoneBeach_ocean",
"Plains_deep_ocean",
"JungleEdge_deep_ocean",
"SavannaM_deep_ocean",
"Desert_deep_ocean",
"Mesa_deep_ocean",
"ColdTaiga_deep_ocean",
"Plains_ocean",
"MesaPlateauFM_ocean",
"Forest_deep_ocean",
"JungleM_deep_ocean",
"FlowerForest_deep_ocean",
"MushroomIsland_ocean",
"MegaTaiga_ocean",
"StoneBeach_deep_ocean",
"IcePlainsSpikes_deep_ocean",
"ColdTaiga_ocean",
"SavannaM_ocean",
"MesaPlateauF_deep_ocean",
"MesaBryce_deep_ocean",
"ExtremeHills+_deep_ocean",
"ExtremeHills_ocean",
"MushroomIsland_deep_ocean",
"Forest_ocean",
"MegaTaiga_deep_ocean",
"JungleEdge_ocean",
"MesaBryce_ocean",
"MegaSpruceTaiga_ocean",
"ExtremeHills+_ocean",
"Jungle_ocean",
"RoofedForest_deep_ocean",
"IcePlains_ocean",
"FlowerForest_ocean",
"ExtremeHills_deep_ocean",
"MesaPlateauFM_deep_ocean",
"Desert_ocean",
"Taiga_ocean",
"BirchForestM_deep_ocean",
"Taiga_deep_ocean",
"JungleM_ocean",
"MangroveSwamp_ocean",
"MangroveSwamp_deep_ocean",
-- water or beach?
"MesaPlateauFM_sandlevel",
"MesaPlateauF_sandlevel",
"MesaBryce_sandlevel",
"Mesa_sandlevel",
-- beach:
"FlowerForest_beach",
"Forest_beach",
"StoneBeach",
"ColdTaiga_beach_water",
"Taiga_beach",
"Savanna_beach",
"Plains_beach",
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore",
"BambooJungleM_shore",
"BambooJungle_shore",
"MangroveSwamp_shore",
-- dimension biome:
"Nether",
"BasaltDelta",
"CrimsonForest",
"WarpedForest",
"SoulsandValley",
"End",
-- Overworld regular:
"Mesa",
"FlowerForest",
"Swampland",
"Taiga",
"ExtremeHills",
"ExtremeHillsM",
"ExtremeHills+_snowtop",
"Jungle",
"Savanna",
"BirchForest",
"MegaSpruceTaiga",
"MegaTaiga",
"ExtremeHills+",
"Forest",
"Plains",
"Desert",
"ColdTaiga",
"MushroomIsland",
"IcePlainsSpikes",
"SunflowerPlains",
"IcePlains",
"RoofedForest",
"ExtremeHills+_snowtop",
"MesaPlateauFM_grasstop",
"JungleEdgeM",
"JungleM",
"BirchForestM",
"MesaPlateauF",
"MesaPlateauFM",
"MesaPlateauF_grasstop",
"MesaBryce",
"JungleEdge",
"SavannaM",
"MangroveSwamp",
"BambooJungle",
"BambooJungleEdge",
"BambooJungleEdgeM",
"BambooJungleM",
}
-- count how many mobs are in an area -- count how many mobs are in an area
local function count_mobs(pos,r,mob_type) local function count_mobs(pos,r,mob_type)
@ -286,11 +123,7 @@ local function count_mobs_total(mob_type)
end end
local function count_mobs_add_entry (mobs_list, mob_cat) local function count_mobs_add_entry (mobs_list, mob_cat)
if mobs_list[mob_cat] then mobs_list[mob_cat] = (mobs_list[mob_cat] or 0) + 1
mobs_list[mob_cat] = mobs_list[mob_cat] + 1
else
mobs_list[mob_cat] = 1
end
end end
--categorise_by can be name or type or spawn_class --categorise_by can be name or type or spawn_class
@ -449,7 +282,7 @@ function mcl_mobs:spawn_setup(def)
local dimension = def.dimension or "overworld" local dimension = def.dimension or "overworld"
local type_of_spawning = def.type_of_spawning or "ground" local type_of_spawning = def.type_of_spawning or "ground"
local biomes = def.biomes or list_of_all_biomes local biomes = def.biomes or nil
local min_light = def.min_light or 0 local min_light = def.min_light or 0
local max_light = def.max_light or (minetest.LIGHT_MAX + 1) local max_light = def.max_light or (minetest.LIGHT_MAX + 1)
local chance = def.chance or 1000 local chance = def.chance or 1000
@ -564,6 +397,9 @@ function mcl_mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_
return return
end end
assert(min_height)
assert(max_height)
-- chance/spawn number override in minetest.conf for registered mob -- chance/spawn number override in minetest.conf for registered mob
local numbers = minetest.settings:get(name) local numbers = minetest.settings:get(name)
@ -595,35 +431,91 @@ function mcl_mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_
spawn_dictionary[key]["max_height"] = max_height spawn_dictionary[key]["max_height"] = max_height
spawn_dictionary[key]["day_toggle"] = day_toggle spawn_dictionary[key]["day_toggle"] = day_toggle
spawn_dictionary[key]["check_position"] = check_position spawn_dictionary[key]["check_position"] = check_position
end end
local two_pi = 2 * math.pi
local function get_next_mob_spawn_pos(pos) local function get_next_mob_spawn_pos(pos)
-- TODO We should consider spawning something a little further away sporadically. -- Select a distance such that distances closer to the player are selected much more often than
-- It would be good for sky farms and variance, rather than all being on the 24 - 32 block away radius -- those further away from the player. This does produce a concentration at INNER (24 blocks)
local distance = math_random(MOB_SPAWN_ZONE_INNER, MOB_SPAWN_ZONE_MIDDLE) local distance = math_random()^2 * (MOB_SPAWN_ZONE_OUTER - MOB_SPAWN_ZONE_INNER) + MOB_SPAWN_ZONE_INNER
local angle = math_random() * two_pi --print("Using spawn distance of "..tostring(distance).." fx="..tostring(fx)..",x="..tostring(x))
-- TODO Floor xoff and zoff and add 0.5 so it tries to spawn in the middle of the square. Less failed attempts. -- Choose a random direction. Rejection sampling is simple and fast (1-2 tries usually)
local xoff = math_round(distance * math_cos(angle)) local xoff, yoff, zoff, dd
local zoff = math_round(distance * math_sin(angle)) repeat
return vector.offset(pos, xoff, 0, zoff) xoff, yoff, zoff = math_random() * 2 - 1, math_random() * 2 - 1, math_random() * 2 - 1
end dd = xoff*xoff + yoff*yoff + zoff*zoff
until (dd <= 1 and dd >= 1e-6) -- outside of uniform ball, retry
dd = distance / math_sqrt(dd) -- distance scaling factor
xoff, yoff, zoff = xoff * dd, yoff * dd, zoff * dd
local goal_pos = vector.offset(pos, xoff, yoff, zoff)
local function decypher_limits(posy) if not (math_abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math_abs(goal_pos.y) <= SPAWN_MAPGEN_LIMIT and math_abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT) then
posy = math_floor(posy) mcl_log("Pos outside mapgen limits: " .. minetest.pos_to_string(goal_pos))
return posy - MOB_SPAWN_ZONE_MIDDLE, posy + MOB_SPAWN_ZONE_MIDDLE return nil
end
-- Calculate upper/lower y limits
local d2 = xoff*xoff + zoff*zoff -- squared distance in x,z plane only
local y1 = math_sqrt(MOB_SPAWN_ZONE_OUTER_SQ - d2) -- absolue value of distance to outer sphere
local y_min, y_max
if d2 >= MOB_SPAWN_ZONE_INNER_SQ then
-- Outer region, y range has both ends on the outer sphere
y_min = pos.y - y1
y_max = pos.y + y1
else
-- Inner region, y range spans between inner and outer spheres
local y2 = math_sqrt(MOB_SPAWN_ZONE_INNER_SQ - d2)
if goal_pos.y > pos.y then
-- Upper hemisphere
y_min = pos.y + y2
y_max = pos.y + y1
else
-- Lower hemisphere
y_min = pos.y - y1
y_max = pos.y - y2
end
end
-- Limit total range of check to 32 nodes (maximum of 3 map blocks)
y_min = math_max(math_floor(y_min), goal_pos.y - 16)
y_max = math_min(math_ceil(y_max), goal_pos.y + 16)
-- Ask engine for valid spawn locations
local spawning_position_list = find_nodes_in_area_under_air(
{x = goal_pos.x, y = y_min, z = goal_pos.z},
{x = goal_pos.x, y = y_max, z = goal_pos.z},
{"group:solid", "group:water", "group:lava"}
) or {}
-- Select only the locations at a valid distance
local valid_positions = {}
for _,check_pos in ipairs(spawning_position_list) do
local dist = vector.distance(pos, check_pos)
if dist >= MOB_SPAWN_ZONE_INNER and dist <= MOB_SPAWN_ZONE_OUTER then
valid_positions[#valid_positions + 1] = check_pos
end
end
spawning_position_list = valid_positions
-- No valid locations, failed to find a position
if #spawning_position_list == 0 then
mcl_log("Spawning position isn't good. Do not spawn: " .. minetest.pos_to_string(goal_pos))
return nil
end
-- Pick a random valid location
mcl_log("Spawning positions available: " .. minetest.pos_to_string(goal_pos))
return spawning_position_list[math_random(1, #spawning_position_list)]
end end
--a simple helper function for mob_spawn --a simple helper function for mob_spawn
local function biome_check(biome_list, biome_goal) local function biome_check(biome_list, biome_goal)
if not biome_goal then return false end
for _, data in pairs(biome_list) do for _, data in pairs(biome_list) do
if data == biome_goal then if data == biome_goal then
return true return true
end end
end end
return false return false
end end
@ -638,8 +530,8 @@ local function get_water_spawn(p)
end end
end end
local function has_room(self,pos) local function has_room(self, pos)
local cb = self.collisionbox local cb = self.spawnbox or self.collisionbox
local nodes = {} local nodes = {}
if self.fly_in then if self.fly_in then
local t = type(self.fly_in) local t = type(self.fly_in)
@ -650,115 +542,167 @@ local function has_room(self,pos)
end end
end end
table.insert(nodes,"air") table.insert(nodes,"air")
local x = cb[4] - cb[1]
local y = cb[5] - cb[2] -- Calculate area to check for room
local z = cb[6] - cb[3] local cb_height = cb[5] - cb[2]
local r = math.ceil(x * y * z) local p1 = vector.new(
local p1 = vector.offset(pos,cb[1],cb[2],cb[3]) math.round(pos.x + cb[1]),
local p2 = vector.offset(pos,cb[4],cb[5],cb[6]) math.floor(pos.y),
local n = #minetest.find_nodes_in_area(p1,p2,nodes) or 0 math.round(pos.z + cb[3]))
if r > n then local p2 = vector.new(
minetest.log("warning","[mcl_mobs] No room for mob "..self.name.." at "..minetest.pos_to_string(vector.round(pos))) math.round(pos.x + cb[4]),
return false math.ceil(p1.y + cb_height) - 1,
math.round(pos.z + cb[6]))
-- Check if the entire spawn volume is free
local dx = p2.x - p1.x + 1
local dy = p2.y - p1.y + 1
local dz = p2.z - p1.z + 1
local found_nodes = minetest.find_nodes_in_area(p1,p2,nodes) or 0
local n = #found_nodes
if n == dx * dy * dz then
return true
end end
return true
end
-- If we don't have an implementation of get_node_boxes, we can't check for sub-node space
if not minetest.get_node_boxes then return false end
-- Check if it's possible for a sub-node space check to succeed
local needed_in_bottom_section = dx * ( dy - 1) * dz
if n < needed_in_bottom_section then return false end
local function spawn_check(pos, spawn_def) -- Make sure the entire volume except for the top level is free before checking the top layer
if not spawn_def or not pos then return end if dy > 1 then
-- Remove nodes in the top layer from the count
for i = 1,#found_nodes do
if found_nodes[i].y == p2.y then
n = n - 1
end
end
dbg_spawn_attempts = dbg_spawn_attempts + 1 -- If the entire volume except the top layer isn't air (or nodes) then we can't spawn this mob here
local dimension = mcl_worlds.pos_to_dimension(pos) if n < needed_in_bottom_section then return false end
local mob_def = minetest.registered_entities[spawn_def.name]
local mob_type = mob_def.type
local gotten_node = get_node(pos).name
local gotten_biome = minetest.get_biome_data(pos)
if not gotten_node or not gotten_biome then return end
gotten_biome = get_biome_name(gotten_biome.biome) --makes it easier to work with
local is_ground = minetest.get_item_group(gotten_node,"solid") ~= 0
if not is_ground then
pos.y = pos.y - 1
gotten_node = get_node(pos).name
is_ground = minetest.get_item_group(gotten_node,"solid") ~= 0
end end
pos.y = pos.y + 1
local is_water = get_item_group(gotten_node, "water") ~= 0
local is_lava = get_item_group(gotten_node, "lava") ~= 0
local is_leaf = get_item_group(gotten_node, "leaves") ~= 0
local is_bedrock = gotten_node == "mcl_core:bedrock"
local is_grass = minetest.get_item_group(gotten_node,"grass_block") ~= 0
if pos.y >= spawn_def.min_height -- Check the top layer to see if we have enough space to spawn in
and pos.y <= spawn_def.max_height local top_layer_height = 1
and spawn_def.dimension == dimension local processed = {}
and biome_check(spawn_def.biomes, gotten_biome) then for x = p1.x,p2.x do
for z = p1.z,p2.z do
local test_pos = vector.new(x,p2.y,z)
local node = minetest.get_node(test_pos) or { name = "ignore" }
local cache_name = string.format("%s-%d", node.name, node.param2)
if not processed[cache_name] then
-- Calculate node bounding box and select the lowest y value
local boxes = minetest.get_node_boxes("collision_box", test_pos, node)
for i = 1,#boxes do
local box = boxes[i]
local y_test = box[2] + 0.5
if y_test < top_layer_height then top_layer_height = y_test end
if (is_ground or spawn_def.type_of_spawning ~= "ground") local y_test = box[5] + 0.5
and (spawn_def.type_of_spawning ~= "ground" or not is_leaf) if y_test < top_layer_height then top_layer_height = y_test end
and (not is_farm_animal(spawn_def.name) or is_grass)
and (spawn_def.type_of_spawning ~= "water" or is_water)
and not is_bedrock
and has_room(mob_def,pos)
and (spawn_def.check_position and spawn_def.check_position(pos) or spawn_def.check_position == nil)
and ( not spawn_protected or not minetest.is_protected(pos, "") ) then
local gotten_light = get_node_light(pos)
if modern_lighting then
local my_node = get_node(pos)
local sky_light = minetest.get_natural_light(pos)
local art_light = minetest.get_artificial_light(my_node.param1)
if mob_def.spawn_check then
return mob_def.spawn_check(pos, gotten_light, art_light, sky_light)
elseif mob_type == "monster" then
if dimension == "nether" then
if art_light <= nether_threshold then
return true
end
elseif dimension == "end" then
if art_light <= end_threshold then
return true
end
elseif dimension == "overworld" then
if art_light <= overworld_threshold and sky_light <= overworld_sky_threshold then
return true
end
end
else
-- passive threshold is apparently the same in all dimensions ...
if gotten_light > overworld_passive_threshold then
return true
end
end
else
if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
return true
end end
end end
end end
end end
if top_layer_height + dy - 1 >= cb_height then return true end
-- We don't have room
return false return false
end end
function mcl_mobs.spawn(pos,id) mcl_mobs.custom_biomecheck = nil
local def = minetest.registered_entities[id] or minetest.registered_entities["mobs_mc:"..id] or minetest.registered_entities["extra_mobs:"..id]
if not def or (def.can_spawn and not def.can_spawn(pos)) or not def.is_mob then function mcl_mobs.register_custom_biomecheck(custom_biomecheck)
return false mcl_mobs.custom_biomecheck = custom_biomecheck
end
if not dbg_spawn_counts[def.name] then
dbg_spawn_counts[def.name] = 1
else
dbg_spawn_counts[def.name] = dbg_spawn_counts[def.name] + 1
end
return minetest.add_entity(pos, def.name)
end end
local function get_biome_name(pos)
if mcl_mobs.custom_biomecheck then return mcl_mobs.custom_biomecheck(pos) end
local gotten_biome = minetest.get_biome_data(pos)
return gotten_biome and mt_get_biome_name(gotten_biome.biome)
end
local function spawn_check(pos, spawn_def)
if not spawn_def or not pos then return end
dbg_spawn_attempts = dbg_spawn_attempts + 1
local dimension = mcl_worlds.pos_to_dimension(pos)
if spawn_def.dimension ~= dimension then return end -- wrong dimension
-- find ground node below spawn position
local node_name = get_node(pos).name
local node_def = registered_nodes[node_name]
if node_def and not node_def.groups.solid then -- try node one below instead
pos.y = pos.y - 1
node_name = get_node(pos).name
node_def = registered_nodes[node_name]
end
if not node_def or not node_def.groups then return end
-- do not spawn on bedrock
if node_name == "mcl_core:bedrock" then return end
pos.y = pos.y + 1
-- check spawn height
if pos.y < spawn_def.min_height or pos.y > spawn_def.max_height then return end
mcl_log("spawn_check#1 position checks passed")
-- do not spawn ground mobs on leaves
if spawn_def.type_of_spawning == "ground" and (not node_def.groups.solid or node_def.groups.leaves) then return end
-- water mobs only on water
if spawn_def.type_of_spawning == "water" and not node_def.groups.water then return end
-- lava mobs only on lava
if spawn_def.type_of_spawning == "lava" and not node_def.groups.lava then return end
-- farm animals on grass only
if is_farm_animal(spawn_def.name) and not node_def.groups.grass_block then return end
---- More expensive calls:
-- check the biome
if spawn_def.biomes and not biome_check(spawn_def.biomes, get_biome_name(pos)) then return end
-- check if there is enough room
local mob_def = minetest.registered_entities[spawn_def.name]
if not has_room(mob_def,pos) then return end
-- additional checks (slime etc.)
if spawn_def.check_position and not spawn_def.check_position(pos) then return end
if spawn_protected and minetest.is_protected(pos, "") then return end
mcl_log("spawn_check#2 advanced checks passed")
-- check light thresholds
local gotten_light = get_node_light(pos)
-- old lighting
if not modern_lighting then return gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light end
local sky_light = minetest.get_natural_light(pos)
local art_light = minetest.get_artificial_light(get_node(pos).param1)
if mob_def.spawn_check then
return mob_def.spawn_check(pos, gotten_light, art_light, sky_light)
end
if mob_def.type == "monster" then
if dimension == "nether" then
if art_light <= nether_threshold then
return true
end
elseif dimension == "end" then
if art_light <= end_threshold then
return true
end
elseif dimension == "overworld" then
if art_light <= overworld_threshold and sky_light <= overworld_sky_threshold then
return true
end
end
return false
end
-- passive threshold is apparently the same in all dimensions ...
return gotten_light > overworld_passive_threshold
end
function mcl_mobs.spawn(pos,id)
if not pos or not id then return false end
local def = minetest.registered_entities[id] or minetest.registered_entities["mobs_mc:"..id] or minetest.registered_entities["extra_mobs:"..id]
if not def or not def.is_mob or (def.can_spawn and not def.can_spawn(pos)) then return false end
if not has_room(def, pos) then return false end
return minetest.add_entity(pos, def.name)
end
local function spawn_group(p,mob,spawn_on,amount_to_spawn) local function spawn_group(p,mob,spawn_on,amount_to_spawn)
local nn= minetest.find_nodes_in_area_under_air(vector.offset(p,-5,-3,-5),vector.offset(p,5,3,5),spawn_on) local nn= minetest.find_nodes_in_area_under_air(vector.offset(p,-5,-3,-5),vector.offset(p,5,3,5),spawn_on)
@ -876,7 +820,7 @@ if mobs_spawn then
mob_total_wide = 0 mob_total_wide = 0
end end
local cap_space_wide = math.max(type_cap - mob_total_wide, 0) local cap_space_wide = math_max(type_cap - mob_total_wide, 0)
mcl_log("mob_type", mob_type) mcl_log("mob_type", mob_type)
mcl_log("cap_space_wide", cap_space_wide) mcl_log("cap_space_wide", cap_space_wide)
@ -884,10 +828,10 @@ if mobs_spawn then
local cap_space_available = 0 local cap_space_available = 0
if mob_type == "hostile" then if mob_type == "hostile" then
mcl_log("cap_space_global", cap_space_hostile) mcl_log("cap_space_global", cap_space_hostile)
cap_space_available = math.min(cap_space_hostile, cap_space_wide) cap_space_available = math_min(cap_space_hostile, cap_space_wide)
else else
mcl_log("cap_space_global", cap_space_non_hostile) mcl_log("cap_space_global", cap_space_non_hostile)
cap_space_available = math.min(cap_space_non_hostile, cap_space_wide) cap_space_available = math_min(cap_space_non_hostile, cap_space_wide)
end end
local mob_total_close = mob_counts_close[mob_type] local mob_total_close = mob_counts_close[mob_type]
@ -896,8 +840,8 @@ if mobs_spawn then
mob_total_close = 0 mob_total_close = 0
end end
local cap_space_close = math.max(close_zone_cap - mob_total_close, 0) local cap_space_close = math_max(close_zone_cap - mob_total_close, 0)
cap_space_available = math.min(cap_space_available, cap_space_close) cap_space_available = math_min(cap_space_available, cap_space_close)
mcl_log("cap_space_close", cap_space_close) mcl_log("cap_space_close", cap_space_close)
mcl_log("cap_space_available", cap_space_available) mcl_log("cap_space_available", cap_space_available)
@ -915,42 +859,16 @@ if mobs_spawn then
local function find_spawning_position(pos, max_times) local function find_spawning_position(pos, max_times)
local spawning_position local spawning_position
local max_loops = max_times or 1
local max_loops = 1
if max_times then max_loops = max_times end
local y_min, y_max = decypher_limits(pos.y)
--mcl_log("mapgen_limit: " .. SPAWN_MAPGEN_LIMIT) --mcl_log("mapgen_limit: " .. SPAWN_MAPGEN_LIMIT)
local i = 0 while max_loops > 0 do
repeat local spawning_position = get_next_mob_spawn_pos(pos)
local goal_pos = get_next_mob_spawn_pos(pos) if spawning_position then return spawning_position end
max_loops = max_loops - 1
if math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(pos.y) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT then end
local spawning_position_list = find_nodes_in_area_under_air( return nil
{x = goal_pos.x, y = y_min, z = goal_pos.z},
{x = goal_pos.x, y = y_max, z = goal_pos.z},
{"group:solid", "group:water", "group:lava"}
)
if #spawning_position_list > 0 then
mcl_log("Spawning positions available: " .. minetest.pos_to_string(goal_pos))
spawning_position = spawning_position_list[math_random(1, #spawning_position_list)]
else
mcl_log("Spawning position isn't good. Do not spawn: " .. minetest.pos_to_string(goal_pos))
end
else
mcl_log("Pos outside mapgen limits: " .. minetest.pos_to_string(goal_pos))
end
i = i + 1
if i >= max_loops then
mcl_log("Cancel finding spawn positions at: " .. max_loops)
break
end
until spawning_position
return spawning_position
end end
local cumulative_chance = nil local cumulative_chance = nil
@ -1050,7 +968,7 @@ if mobs_spawn then
local amount_to_spawn = math.random(group_min, spawn_in_group) local amount_to_spawn = math.random(group_min, spawn_in_group)
mcl_log("Spawning quantity: " .. amount_to_spawn) mcl_log("Spawning quantity: " .. amount_to_spawn)
amount_to_spawn = math.min(amount_to_spawn, cap_space_available) amount_to_spawn = math_min(amount_to_spawn, cap_space_available)
mcl_log("throttled spawning quantity: " .. amount_to_spawn) mcl_log("throttled spawning quantity: " .. amount_to_spawn)
if logging then if logging then
@ -1101,8 +1019,8 @@ if mobs_spawn then
local players = get_connected_players() local players = get_connected_players()
local total_mobs, total_non_hostile, total_hostile = count_mobs_total_cap() 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_hostile = math_max(mob_cap.global_hostile - total_hostile, 0)
local cap_space_non_hostile = math.max(mob_cap.global_non_hostile - total_non_hostile, 0) local cap_space_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_hostile", cap_space_hostile)
mcl_log("global cap_space_non_hostile", cap_space_non_hostile) mcl_log("global cap_space_non_hostile", cap_space_non_hostile)
@ -1176,11 +1094,9 @@ function mob_class:check_despawn(pos, dtime)
end end
end end
minetest.register_chatcommand("mobstats",{ minetest.register_chatcommand("mobstats",{
privs = { debug = true }, privs = { debug = true },
func = function(n,param) func = function(n,param)
--minetest.chat_send_player(n,dump(dbg_spawn_counts))
local pos = minetest.get_player_by_name(n):get_pos() local pos = minetest.get_player_by_name(n):get_pos()
minetest.chat_send_player(n,"mobs: within 32 radius of player/total loaded :"..count_mobs(pos,MOB_CAP_INNER_RADIUS) .. "/" .. count_mobs_total()) minetest.chat_send_player(n,"mobs: within 32 radius of player/total loaded :"..count_mobs(pos,MOB_CAP_INNER_RADIUS) .. "/" .. count_mobs_total())
minetest.chat_send_player(n,"spawning attempts since server start:" .. dbg_spawn_succ .. "/" .. dbg_spawn_attempts) minetest.chat_send_player(n,"spawning attempts since server start:" .. dbg_spawn_succ .. "/" .. dbg_spawn_attempts)

View File

@ -1,4 +1,4 @@
name = mcl_wither_spawning name = mcl_wither_spawning
description = Wither Spawning for MineClone2 description = Wither Spawning for VoxeLibre
author = Fleckenstein author = Fleckenstein
depends = mobs_mc, mcl_heads depends = mobs_mc, mcl_heads

View File

@ -33,11 +33,11 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers
* Husk * Husk
* Skeleton * Skeleton
* Stray * Stray
* Creeper * Stalker
* Slime * Slime
* Spider * Spider
* Cave Spider * Cave Spider
* Enderman * Rover
* Zombie Villager * Zombie Villager
* Zombie Piglin * Zombie Piglin
* Wither Skeleton * Wither Skeleton

View File

@ -1,6 +1,7 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local axolotl = { local axolotl = {
description = S("Axolotl"),
type = "animal", type = "animal",
spawn_class = "axolotl", spawn_class = "axolotl",
can_despawn = true, can_despawn = true,
@ -71,18 +72,24 @@ local axolotl = {
fly = true, fly = true,
fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" },
breathes_in_water = true, breathes_in_water = true,
jump = true, jump = false, -- would get them out of the water too often
damage = 2, damage = 2,
reach = 2, reach = 2,
attack_type = "dogfight", attack_type = "dogfight",
attack_animals = true, attack_animals = true,
specific_attack = { specific_attack = {
"extra_mobs_cod", "mobs_mc:cod",
"extra_mobs_glow_squid", "mobs_mc:glow_squid",
"extra_mobs_salmon", "mobs_mc:salmon",
"extra_mobs_tropical_fish", "mobs_mc:tropical_fish",
"mobs_mc_squid" "mobs_mc:squid",
}, "mobs_mc:zombie", -- todo: only drowned?
"mobs_mc:baby_zombie",
"mobs_mc:husk",
"mobs_mc:baby_husk",
"mobs_mc:guardian_elder",
"mobs_mc:guardian",
},
runaway = true, runaway = true,
} }

View File

@ -95,8 +95,8 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
end end
local pos = self.object:get_pos() local pos = self.object:get_pos()
minetest.add_particle({ minetest.add_particle({
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2}, pos = {x=pos.x+(math.random()*0.7-0.35)*math.random(),y=pos.y+0.7+math.random()*0.5,z=pos.z+(math.random()*0.7-0.35)*math.random()},
velocity = {x=0, y=math.random(1,1), z=0}, velocity = {x=0, y=1, z=0},
expirationtime = math.random(), expirationtime = math.random(),
size = math.random(1, 4), size = math.random(1, 4),
collisiondetection = true, collisiondetection = true,
@ -110,8 +110,8 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
}, },
}) })
minetest.add_particle({ minetest.add_particle({
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2}, pos = {x=pos.x+(math.random()*0.7-0.35)*math.random(),y=pos.y+0.7+math.random()*0.5,z=pos.z+(math.random()*0.7-0.35)*math.random()},
velocity = {x=0, y=math.random(1,1), z=0}, velocity = {x=0, y=1, z=0},
expirationtime = math.random(), expirationtime = math.random(),
size = math.random(1, 4), size = math.random(1, 4),
collisiondetection = true, collisiondetection = true,
@ -125,8 +125,8 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
}, },
}) })
minetest.add_particle({ minetest.add_particle({
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2}, pos = {x=pos.x+(math.random()*0.7-0.35)*math.random(),y=pos.y+0.7+math.random()*0.5,z=pos.z+(math.random()*0.7-0.35)*math.random()},
velocity = {x=0, y=math.random(1,1), z=0}, velocity = {x=0, y=1, z=0},
expirationtime = math.random(), expirationtime = math.random(),
size = math.random(1, 4), size = math.random(1, 4),
collisiondetection = true, collisiondetection = true,

View File

@ -30,6 +30,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
--################### --###################
local cod = { local cod = {
description = S("Cod"),
type = "animal", type = "animal",
spawn_class = "water_ambient", spawn_class = "water_ambient",
can_despawn = true, can_despawn = true,
@ -83,7 +84,7 @@ local cod = {
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0)) self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
if minetest.get_item_group(self.standing_in, "water") ~= 0 then if minetest.get_item_group(self.standing_in, "water") ~= 0 then
if self.object:get_velocity().y < 5 then if self.object:get_velocity().y < 5 then
self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 }) self.object:add_velocity({ x = 0 , y = math.random()*.014-.007, z = 0 })
end end
end end
--]] --]]

View File

@ -122,6 +122,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
if not minetest.is_creative_enabled(clicker:get_player_name()) then if not minetest.is_creative_enabled(clicker:get_player_name()) then
item:add_wear(mobs_mc.shears_wear) item:add_wear(mobs_mc.shears_wear)
tt.reload_itemstack_description(item) -- update tooltip
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item) clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
end end
-- Use bucket to milk -- Use bucket to milk

View File

@ -30,6 +30,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
--################### --###################
local dolphin = { local dolphin = {
description = S("Dolphin"),
type = "animal", type = "animal",
spawn_class = "water", spawn_class = "water",
can_despawn = true, can_despawn = true,
@ -80,16 +81,16 @@ local dolphin = {
reach = 2, reach = 2,
damage = 2.5, damage = 2.5,
attack_type = "dogfight", attack_type = "dogfight",
--[[ this is supposed to make them jump out the water but doesn't appear to work very well
do_custom = function(self,dtime) do_custom = function(self,dtime)
--[[ this is supposed to make them jump out the water but doesn't appear to work very well
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0)) self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
if minetest.get_item_group(self.standing_in, "water") ~= 0 then if minetest.get_item_group(self.standing_in, "water") ~= 0 then
if self.object:get_velocity().y < 5 then if self.object:get_velocity().y < 5 then
self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 }) self.object:add_velocity({ x = 0 , y = math.random()*.014-.007, z = 0 })
end end
end end
--]]
end, end,
--]]
} }
mcl_mobs.register_mob("mobs_mc:dolphin", dolphin) mcl_mobs.register_mob("mobs_mc:dolphin", dolphin)

View File

@ -4,21 +4,17 @@
local S = minetest.get_translator("mobs_mc") local S = minetest.get_translator("mobs_mc")
local BEAM_CHECK_FREQUENCY = 2 local BEAM_CHECK_FREQUENCY = 1
local POS_CHECK_FREQUENCY = 15 local POS_CHECK_FREQUENCY = 15
local HEAL_AMMOUNT = 37 local HEAL_INTERVAL = 1
local HEAL_AMOUNT = 2
local function heal(self)
local o = self.object
self.health = math.min(self.hp_max,self.health + HEAL_AMMOUNT)
end
local function check_beam(self) local function check_beam(self)
for _, obj in ipairs(minetest.get_objects_inside_radius(self.object:get_pos(), 80)) do for _, obj in ipairs(minetest.get_objects_inside_radius(self.object:get_pos(), 80)) do
local luaentity = obj:get_luaentity() local luaentity = obj:get_luaentity()
if luaentity and luaentity.name == "mcl_end:crystal" then if luaentity and luaentity.name == "mcl_end:crystal" then
if luaentity.beam then if luaentity.beam then
if luaentity.beam == self.beam then if luaentity.beam == self.beam then
heal(self)
break break
end end
else else
@ -106,7 +102,6 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", {
}, },
ignores_nametag = true, ignores_nametag = true,
do_custom = function(self,dtime) do_custom = function(self,dtime)
mcl_bossbars.update_boss(self.object, "Ender Dragon", "light_purple")
if self._pos_timer == nil or self._pos_timer > POS_CHECK_FREQUENCY then if self._pos_timer == nil or self._pos_timer > POS_CHECK_FREQUENCY then
self._pos_timer = 0 self._pos_timer = 0
check_pos(self) check_pos(self)
@ -115,8 +110,20 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", {
self._beam_timer = 0 self._beam_timer = 0
check_beam(self) check_beam(self)
end end
self._beam_timer = self._beam_timer + dtime self._beam_timer = self._beam_timer + dtime
self._pos_timer = self._pos_timer + dtime self._pos_timer = self._pos_timer + dtime
if self.beam ~= nil then
-- heal
self._heal_timer = (self._heal_timer or 0) + dtime
if self._heal_timer > HEAL_INTERVAL then
self.health = math.min(self.hp_max,self.health + HEAL_AMOUNT)
self._heal_timer = self._heal_timer - HEAL_INTERVAL
end
end
mcl_bossbars.update_boss(self.object, "Ender Dragon", "light_purple")
end, end,
on_die = function(self, pos, cmi_cause) on_die = function(self, pos, cmi_cause)
if self._portal_pos then if self._portal_pos then

View File

@ -126,13 +126,14 @@ mcl_mobs.register_arrow("mobs_mc:fireball", {
end, end,
hit_mob = function(self, mob) hit_mob = function(self, mob)
local name = mob:get_luaentity().name
mob:punch(self.object, 1.0, { mob:punch(self.object, 1.0, {
full_punch_interval = 1.0, full_punch_interval = 1.0,
damage_groups = {fleshy = 6}, damage_groups = {fleshy = 6},
}, nil) }, nil)
mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1, true) mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1, true)
local ent = mob:get_luaentity() local ent = mob:get_luaentity()
if not ent or ent.health <= 0 then if (not ent or ent.health <= 0) and self._puncher and name == "mobs_mc:ghast" then
awards.unlock(self._puncher:get_player_name(), "mcl:fireball_redir_serv") awards.unlock(self._puncher:get_player_name(), "mcl:fireball_redir_serv")
end end
end, end,

View File

@ -30,6 +30,7 @@ for i=1,4 do
end end
mcl_mobs.register_mob("mobs_mc:glow_squid", { mcl_mobs.register_mob("mobs_mc:glow_squid", {
description = S("Glow Squid"),
type = "animal", type = "animal",
spawn_class = "water_underground", spawn_class = "water_underground",
can_despawn = true, can_despawn = true,

View File

@ -99,9 +99,7 @@ mcl_mobs.register_mob("mobs_mc:guardian", {
view_range = 16, view_range = 16,
}) })
-- Spawning disabled due to size issues mcl_mobs:spawn_specific("mobs_mc:guardian", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level - 10, mobs_mc.water_level)
-- TODO: Re-enable spawning
--mcl_mobs:spawn_specific("mobs_mc:guardian", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level - 10)
mcl_mobs:non_spawn_specific("mobs_mc:guardian","overworld",0,minetest.LIGHT_MAX+1) mcl_mobs:non_spawn_specific("mobs_mc:guardian","overworld",0,minetest.LIGHT_MAX+1)
-- spawn eggs -- spawn eggs
mcl_mobs.register_egg("mobs_mc:guardian", S("Guardian"), "#5a8272", "#f17d31", 0) mcl_mobs.register_egg("mobs_mc:guardian", S("Guardian"), "#5a8272", "#f17d31", 0)

View File

@ -105,11 +105,14 @@ mcl_mobs.register_mob("mobs_mc:guardian_elder", {
fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" },
jump = false, jump = false,
view_range = 16, view_range = 16,
dealt_effect = {
name = "fatigue",
level = 3,
dur = 30,
},
}) })
-- Spawning disabled due to size issues <- what do you mean? -j4i mcl_mobs:spawn_specific("mobs_mc:guardian_elder", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level-18, mobs_mc.water_level)
-- TODO: Re-enable spawning
-- mcl_mobs:spawn_specific("mobs_mc:guardian_elder", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level-18)
-- spawn eggs -- spawn eggs
mcl_mobs.register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "#ceccba", "#747693", 0) mcl_mobs.register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "#ceccba", "#747693", 0)

View File

@ -122,10 +122,10 @@ local horse = {
stand_speed = 25, stand_speed = 25,
stand_start = 0, stand_start = 0,
stand_end = 0, stand_end = 0,
walk_speed = 25, walk_speed = 100,
walk_start = 0, walk_start = 0,
walk_end = 40, walk_end = 40,
run_speed = 60, run_speed = 200,
run_start = 0, run_start = 0,
run_end = 40, run_end = 40,
}, },
@ -543,11 +543,6 @@ donkey.description = S("Donkey")
donkey.textures = {{"blank.png", "mobs_mc_donkey.png", "blank.png"}} donkey.textures = {{"blank.png", "mobs_mc_donkey.png", "blank.png"}}
donkey.spawn_in_group = 3 donkey.spawn_in_group = 3
donkey.spawn_in_group_min = 1 donkey.spawn_in_group_min = 1
donkey.animation = {
speed_normal = 25,
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40,
}
donkey.sounds = { donkey.sounds = {
random = "mobs_mc_donkey_random", random = "mobs_mc_donkey_random",
damage = "mobs_mc_donkey_hurt", damage = "mobs_mc_donkey_hurt",

View File

@ -124,9 +124,7 @@ dofile(path .. "/witch.lua") -- Mesh and animation by toby109tt / https://githu
--Monsters --Monsters
dofile(path .. "/blaze.lua") -- Animation by daufinsyd dofile(path .. "/blaze.lua") -- Animation by daufinsyd
dofile(path .. "/creeper.lua") -- Mesh by Morn76 Animation by Pavel_S
dofile(path .. "/ender_dragon.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/ender_dragon.lua") -- Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/enderman.lua") -- Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/endermite.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/endermite.lua") -- Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/villager_illusioner.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/villager_illusioner.lua") -- Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/ghast.lua") -- maikerumine dofile(path .. "/ghast.lua") -- maikerumine
@ -134,10 +132,12 @@ dofile(path .. "/guardian.lua") -- maikerumine Mesh and animation by toby109tt
dofile(path .. "/guardian_elder.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/guardian_elder.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/snowman.lua") dofile(path .. "/snowman.lua")
dofile(path .. "/iron_golem.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/iron_golem.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/rover.lua") -- Mesh and Animation by Herowl
dofile(path .. "/shulker.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/shulker.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/silverfish.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/silverfish.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/skeleton+stray.lua") -- Mesh by Morn76 Animation by Pavel_S dofile(path .. "/skeleton+stray.lua") -- Mesh by Morn76 Animation by Pavel_S
dofile(path .. "/skeleton_wither.lua") -- Mesh by Morn76 Animation by Pavel_S dofile(path .. "/skeleton_wither.lua") -- Mesh by Morn76 Animation by Pavel_S
dofile(path .. "/stalker.lua") -- Mesh and Animation by Herowl
dofile(path .. "/zombie.lua") -- Mesh by Morn76 Animation by Pavel_S dofile(path .. "/zombie.lua") -- Mesh by Morn76 Animation by Pavel_S
dofile(path .. "/slime+magma_cube.lua") -- Wuzzy 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 .. "/spider.lua") -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)

View File

@ -83,8 +83,8 @@ mcl_mobs.register_mob("mobs_mc:iron_golem", {
stand_speed = 15, walk_speed = 15, run_speed = 25, punch_speed = 15, stand_speed = 15, walk_speed = 15, run_speed = 25, punch_speed = 15,
stand_start = 0, stand_end = 0, stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40, walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40, run_start = 40, run_end = 80,
punch_start = 40, punch_end = 50, punch_start = 80, punch_end = 90,
}, },
jump = true, jump = true,
do_custom = function(self, dtime) do_custom = function(self, dtime)

View File

@ -5,7 +5,7 @@ Blaze=Lohe
Chicken=Huhn Chicken=Huhn
Cow=Kuh Cow=Kuh
Mooshroom=Pilzkuh Mooshroom=Pilzkuh
Creeper=Creeper Stalker=Stalker
Ender Dragon=Enderdrache Ender Dragon=Enderdrache
Enderman=Enderman Enderman=Enderman
Endermite=Endermilbe Endermite=Endermilbe

View File

@ -6,7 +6,7 @@ Blaze=Blaze
Chicken=Kylling Chicken=Kylling
Cow=Ko Cow=Ko
Mooshroom=Svamp Mooshroom=Svamp
Creeper=Creeper Stalker=Stalker
Ender Dragon=Enderdrage Ender Dragon=Enderdrage
Enderman=Enderman Enderman=Enderman
Endermite=Endermide Endermite=Endermide
@ -67,4 +67,4 @@ Cod=Torsk
Salmon=Laks Salmon=Laks
Dolphin=Delfin Dolphin=Delfin
Pillager=Plyndrer Pillager=Plyndrer
Tropical fish=Tropisk fisk Tropical fish=Tropisk fisk

View File

@ -5,7 +5,7 @@ Chicken=Pollo
Cod=Bacalao Cod=Bacalao
Cow=Vaca Cow=Vaca
Mooshroom=Champivaca Mooshroom=Champivaca
Creeper=Creeper Stalker=Stalker
Dolphin=Delfín Dolphin=Delfín
Ender Dragon=Ender Dragon Ender Dragon=Ender Dragon
Enderman=Enderman Enderman=Enderman

View File

@ -6,7 +6,7 @@ Blaze=Blaze
Chicken=Poulet Chicken=Poulet
Cow=Vache Cow=Vache
Mooshroom=Champimeuh Mooshroom=Champimeuh
Creeper=Creeper Stalker=Stalker
Ender Dragon=Ender Dragon Ender Dragon=Ender Dragon
Enderman=Enderman Enderman=Enderman
Endermite=Endermite Endermite=Endermite

View File

@ -6,7 +6,7 @@ Blaze=Flamor
Chicken=Polet Chicken=Polet
Cow=Vacha Cow=Vacha
Mooshroom=Vachairòla Mooshroom=Vachairòla
Creeper=Creeper Stalker=Stalker
Ender Dragon=Dragon de Finuèit Ender Dragon=Dragon de Finuèit
Enderman=Finuèairi Enderman=Finuèairi
Endermite=Finuèibau Endermite=Finuèibau

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