Commit Graph

2315 Commits

Author SHA1 Message Date
teknomunk 2fec9696b6 Implement mcl_util.remove_entity() and convert projectile code to use it 2024-11-16 19:46:37 -06:00
teknomunk 4731ae64f0 Fix condition on node collision for mob projectiles 2024-11-14 06:36:49 -06:00
teknomunk 7867168c41 Correct damage for mob projectiles 2024-11-14 06:25:30 -06:00
teknomunk a6363f779f Move arrow self-collision grace logic to vl_projectile then apply to mob projectiles and splash and linger potions, allow entity luaentity to be passed to mcl_util.get_entity_id() 2024-11-13 22:02:58 -06:00
teknomunk b8250e4dcc Replace _puncher with _owner, rework projectile code to make _owner a string, copy mcl_util.gen_uuid() from minecart branch, add mcl_util.get_entity_id(), fix crash 2024-11-12 01:00:42 +01:00
the-real-herowl 0cbe304c87 Fixed abnormal skull rotation 2024-11-12 01:00:42 +01:00
the-real-herowl f594473276 Fixed wither skulls
- wither skulls now hit players again
- wither skulls (strong version) don't cause a crash anymore
2024-11-12 01:00:42 +01:00
teknomunk 6025678cf2 Prevent dereferencing nil in wither.lua, fix minor typo in debug statement 2024-11-12 01:00:42 +01:00
teknomunk c6376f09e6 Stop wither from shooting itself 2024-11-12 01:00:42 +01:00
teknomunk 07ebebdc48 Fix unintentional collision box change 2024-11-12 01:00:42 +01:00
teknomunk 76d654762a Fix luacheck findings for this PR: remove unused variables, remove overwritten value, add missing dependencies, fix undefined variable usage 2024-11-12 01:00:42 +01:00
teknomunk 26062a9d26 Prevent projectiles from crashing server when removed when it punched something (wither skull hitting the wither will cause this), mark wither skull with _removed = true when death timer removes it 2024-11-12 01:00:42 +01:00
teknomunk 9c11d0ce92 Allow mob projectiles to hit their owner after 2 seconds (used by ghast fireball) 2024-11-12 01:00:42 +01:00
teknomunk b17c16804d Remove redundant check 2024-11-12 01:00:42 +01:00
teknomunk d2676da152 Correct behavior when ignore_gravity flag is true, fix mob projectile velocity calculation, add missing entity_def lookup 2024-11-12 01:00:42 +01:00
teknomunk d195066d94 Convert mcl_mobs.register_arrow() to use vl_projectile, tested only with shulker bullet so far 2024-11-12 01:00:42 +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 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 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
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 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 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
teknomunk 1707eef672 Fix two additional dependency issues 2024-09-15 22:25:44 +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
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 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
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
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