10 Commits

Author SHA1 Message Date
IntegratedQuantum
c2ef9aba62 Remove the root . . . . . . . . . . import, replacing it with @import("main")
To fully solve the ZLS issues I had to also add the import to the other executables.
2025-03-27 21:16:35 +01:00
Zachary Hall
20dfc6ba71
Add hunger, hunger bar, and related functions on the Player struct. (#1210)
* Add hunger and hunger bar
 - New functions added to Player struct in game.zig to use and heal hunger.
 - If an attempt is made to use more hunger than there is available, the player is killed.
 - Hunger bar uses placeholder icons.
 - Hunger bar is based on the health bar
 -  Hunger bar is anchored to the left of the hotbar, rather than the right like the health bar.

* Don't kill player when hunger runs out.
- Don't use hunger when there's not enough to use
- Allow for code to know if hunger was used, so that is can handle not having enough hunger.

* New hunger textures

* Desaturate the highlight a little

* Return true if hunger was already true.

* Fix formatting

* Rename hunger to energy, and fix other issues.

* Make energy synchronized between client and server

Also removes the functions that add/remove energy on the game.Player struct

* Run formatter

* Fix incorrect formatting by formatter.

* Remove AddHunger struct and addHunger function

 - Keep base operation so things like accessories and food can use it when syncing

* Fix formatting again.

---------

Co-authored-by: Carrie <carriecapp9@gmail.com>
2025-03-23 17:06:21 +01:00
IntegratedQuantum
09fc516828 Move all the allocators to a separate file. They can now be imported with main.heap (analogous to std.heap)
I also removed the unused BufferFallbackAllocator which was from a time where I was still experimenting with different allocators.
2025-03-09 16:26:41 +01:00
OneAvargeCoder193
818f736311
Added fall damage and /kill (#959)
* add player health and fall damage and /kill

* less latency for taking damage

* clamp health

* changes

* final changes maybe

* return serverFailure if target not found

* fix error

* remove /damage
2025-01-25 22:54:23 +01:00
IntegratedQuantum
b4f3dfbeca Replace json with zon in the entire game and autoamtically convert all json files when an old version is detected.
progress on #733
2024-09-29 16:28:16 +02:00
IntegratedQuantum
3a74300a43 JsonElement.get and .put can now handle Vector attributes.
fixes #430
2024-06-02 20:09:34 +02:00
IntegratedQuantum
e2459d1fbd Remove all the commented java code.
Most of it is already implemented elsewhere or no longer applicable and would need to be rewritten from scratch.
closes #129
2024-04-20 10:58:59 +02:00
IntegratedQuantum
1cc6410ef6 z is now up
Closes #272
2024-02-26 17:31:42 +01:00
IntegratedQuantum
de004841b7 Handle OutOfMemory errors centrally for the globalAllocator and derivatives.
To let the rest of the code know about this decision I implemented a wrapper over the Allocator interface which cannot fail.

This is just the first step in the upcoming refactoring attempt.
2024-01-29 17:22:20 +01:00
IntegratedQuantum
4d092126cc Store the player position on the server to prioritize terrain generation. 2023-05-28 19:31:03 +02:00