* 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>
I also bumped model index size to 32 bits (storage is currently limited to 20 bits though)
We can afford this, since it's CPU side and it's only stored perblock type.
Instead of storing 14 different array lists, the parts of the mesh are now constructed on the stack and then directly inserted into the full list (which I abstracted into a generic data structure)
fixes#1188
makes #182 less severe (it is now overshadowed by #1202)
* add pipes, which are like branches but you can have different textures on each mode
* fix formatting
* remove testing block
* fix more formatting issues
* fix more formatting issues
* simplify fromRelPos
* fix fromRelPos and give pipe same properties as branch
* fix flashing dots caused by floating point inaccuracies
* remove debug object
* fix formatting issues
* fix a couple things
* remove debug textures
* fix formatting and also make dir an enum
* fix more formatting issues
* remove branches
* rename pipe to branch
* remove floating point fix
* remove branch model
* Add back branches and add temporary textures
* add back the branches
* fix some stuff
* small changes
* fix compiler error
---------
Co-authored-by: Carrie <carriecapp9@gmail.com>
* Make hash function more complicated
* Change seed value for array and vector hashes
* Fix formatting issues
* Fix formatting issues
* Update src/server/terrain/biomes.zig
* update VirtualList to new page size API
* Resolve TODO
mprotect needs its slices page-aligned. Since the VirtualList range
is contiguous, using a larger page size wouldn't necessarily reduce
memory anyways. And since pageSize() will only get called when
allocating, it is not particularly expensive.
* replace pageSize() with page_size_max in comptime
* determine maxSizeBytes at runtime
* remove assertion
* add aarch64 linux to CI
* revert CI
* Format all the zon assets to prepare for running the the format check with our zig fmt
* Update ci.yml
* Remove zon files from the old formatter
* Add a formatting violation to test the CI
* Undo the check
* Refactor compressChunk to use BinaryWriter
* Refactor decompressChunk to use BinaryReader
* Back to fat switch we go
* Yeet // @import("../utils.zig");
* Update src/server/storage.zig
* Add block touch detection
* Fix touch detection syntax errors
* Remove Whitespace
* Fix off by one in negatives
* Remove Block Touch Detection
* Simpler touch detection as suggested by Quantum
* Remove touchRetraction because for some reason it is no longer needed
* Touch Functions are now function pointers
* Remove unwanted debug prints
* Add parameter names to TouchFunction declaration
* Add error check
---------
Co-authored-by: gfh <@>
Co-authored-by: SuperIceG <102669377+SEGenjoysBlivits@users.noreply.github.com>
* Refactor RegionFile to use BinaryReader for loading
* Refactor RegionFile to use BinaryWriter for writing
* Apply review suggestions
* Add trace logging
* Restore region version mismatch message
* Update src/server/storage.zig
* Rename chunkSizes to chunkDataLengths
* Remove redundant whitespace
* Replace readAlloc with readSlice