1105 Commits

Author SHA1 Message Date
Carrie
3c7231cb43
Darken grass plants for better contrast (#1182)
* Make grass plants darker for better contrast

* Make grass plants blend into grass blocks
2025-03-09 12:57:38 +01:00
archbirdplus
449e9df7e3
Fix page sizes (#1184)
* 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
2025-03-09 12:52:13 +01:00
IntegratedQuantum
b5df364ab2 Improve DynamicPackedIntArray.resize using a bit-interleaving algorithm, instead of fetching and putting the values one by one.
fixes #322 (SIMD would be even faster, but at 0.05% of the total runtime, it doesn't make sense to go that far)
2025-03-09 12:00:31 +01:00
IntegratedQuantum
435d22083d Fix formatting 2025-03-08 14:17:17 +01:00
IntegratedQuantum
588e12fcdb Restrict palette compression to power of 2 bitSizes and improve the addressing to use aligned reads.
This does make it slightly faster, and due to the missing padding bytes it also slightly reduces memory usage.

fixes #443
would make #322 easier
2025-03-08 14:01:15 +01:00
IntegratedQuantum
b303244773
Run the zon format check with our zig fmt (#1175)
* 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
2025-03-07 22:34:55 +01:00
ikabod-kee
5a9e537ed4
Birch, Thin Birch + Rare Chopped Forests (#1170)
* A

* Added Thin Birch Biome

* Density

* Changes

* Changes 2
2025-03-07 22:08:38 +01:00
Carrie
f9c5e4bb98
Glimmergills and Glimmergill caves (#1174)
* Add glimmergills and glimmergill caves

* Lower glimmergill cave height

* Formatting
2025-03-07 22:07:44 +01:00
IntegratedQuantum
17b8c8d8b6 Use the equality operator instead std.meta.eql for packed structs.
progress towards #1160
2025-03-07 21:07:21 +01:00
Krzysztof Wiśniewski
832f5e7e08
Refactor ClientEntityManager.serverUpdate to use BinaryReader (#1171)
* Use ReaderWriter for reading

* Reformat switch

* Apply review suggestions

* Remove redundant comptime

* Remove message length check
2025-03-07 20:49:17 +01:00
Krzysztof Wiśniewski
867e908981
Refactor ChunkCompression to use BinaryReader and BinaryWriter (#1162)
* 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
2025-03-07 20:38:22 +01:00
qFelix
2b3547d103
Simplified Block Touch Detection (#1143)
* 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>
2025-03-06 23:30:33 +01:00
IntegratedQuantum
471210f585 Use array @splat
progress towards #1160
2025-03-06 22:08:15 +01:00
Krzysztof Wiśniewski
9d786abcb5
Refactor RegionFile to use BinaryReader and BinaryWriter (#1159)
* 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
2025-03-06 21:34:34 +01:00
Carrie
81bb084997
Branches for all wood types + item textures and recipes (#1149)
* Add all branch variants, item textures, recipes

* Delete unused textures

* Fix indentation
2025-03-06 21:32:39 +01:00
Krzysztof Wiśniewski
ac43b7128e
Add biome migrations to mitigate damage after biome renames (#1157)
* Add biomes migrations

* Fix error on empty migration file

* Fix migrations_zig.applyBiomePaletteMigrations call

* Fix formatting issues

* Rename thingsMigrations to thingMigrations

* Change log type for incorrect migrations

* Use comptime enum for migration selection

* Fix formatting issues

* Update src/migrations.zig

* Update src/migrations.zig

* Update src/migrations.zig
2025-03-06 20:49:11 +01:00
Carrie
b497133967
Mushrooms: Bolete and Toadstool (#1165)
* Add bolete and toadstool

* Add item textures and add to biomes
2025-03-06 20:34:47 +01:00
IntegratedQuantum
4b45f4fef5 Rename file to .zig.zon 2025-03-06 20:22:41 +01:00
IntegratedQuantum
1d6ca53cf7 Add the "spawn" biome 2025-03-06 20:18:57 +01:00
ikabod-kee
07a8d4ba5c
Added Limestone Mountains and some sub-biomes (#1131)
* Added Limestone Mountains and some sub-biomes

* Changed chances

* Update base.zig.zon

* Update patchy.zig.zon

* Slight Adjustments

* Fixed the totally-not-embarrassing syntax error
2025-03-06 18:36:39 +01:00
Garrett
1eb813ff51
Reduce Cacti spawn rates (#1163)
This is my first contribution to Cubyz. There were too many cacti spawning in the desert. I adjusted the rates so they would appear more infrequently and make the desert look more natural.
2025-03-06 17:56:04 +01:00
IntegratedQuantum
a033913dbb Link X11 instead of x11
This seems to cause trouble sometimes, not sure why. The library file has a capital X, so I guess somehow there was any alias on my PC.
fixes #1148
fixes #1040
2025-03-06 15:16:35 +01:00
IntegratedQuantum
8a86b8f0c7 Remove the empty migrations file, since it causes errors. 2025-03-05 22:23:03 +01:00
IntegratedQuantum
03769c2cda
Update Zig to 0.14.0 (#1158)
* Update Zig to 0.14.0

* Update ci.yml

* Copy the zig fmt source code

* Update ci.yml

* Fix formatting issues

* Update CONTRIBUTING.md with a new formatting command
2025-03-05 21:41:02 +01:00
Krzysztof Wiśniewski
43b1b977f4
Fix conflict with master (#1154) 2025-03-05 19:57:31 +01:00
Krzysztof Wiśniewski
565bb7b8c4
Remove unused openWorkbench function (#1153) 2025-03-05 19:44:29 +01:00
Krzysztof Wiśniewski
0236451ac8
Add block migrations to mitigate damage after block renames (#1125)
* Add block  migrations logic

* TEMP: Example migration

* Adjust block migrations according to review

* Fix indentation in example file

* Remove unused migration enums

* Fix indentation in example file

* Extract asset ID creation to separate function

* Remove example migration

* Restore readAllFilesInAddons to shrink the diff

* Revert "Extract asset ID creation to separate function"

This reverts commit 3fea996152bd464643a9d84a52008e568f726f34.

* Shrink diff in assets.zig

* Fix migration behavior with empty migration map

* Restore birch_log.png

* Shrink diff

* Fix use of commonBlocksMigrations

* Remove biome and item migrations code

* Remove Palette changes

* Apply review suggestions

* Fix use after free in migration code

* Revert readAllZonFilesInAddons back to how it was but with migrations included

* Remove stray whitespace

* Remove stray defer

* Fix style issues

* Apply review suggestions

* Fix formatting issues

* Apply review suggestions

* Apply review suggestions

* Remove addon name from migrations

* Change migration notation to list of objects

* Apply review suggestions

* Apply review suggestions

* Apply review suggestions
2025-03-05 19:43:43 +01:00
IntegratedQuantum
0dc0da90d8 Fix formatting issues. 2025-03-05 19:22:53 +01:00
IntegratedQuantum
f3b508bf47 Introduce a BinaryReader/Writer to make working with binary protocols easier especially with regards to error handling.
fixes #762
fixes #264
2025-03-05 19:14:49 +01:00
IntegratedQuantum
72a68d6b6d Allow specifying the side model for the torch rotation.
fixes #1016
2025-03-04 19:02:17 +01:00
IntegratedQuantum
aacd2bae5b Refactor all the key pressing/releasing code into a function.
fixes #746
2025-03-03 21:36:32 +01:00
IntegratedQuantum
57d32338fb Fix crash when the chat window gets a message before the GUI finished initializing.
fixes #649
2025-03-03 20:24:15 +01:00
IntegratedQuantum
b50ffa5ea7 Add basic lighting for entity rendering. 2025-03-03 19:53:14 +01:00
IntegratedQuantum
ae4b60349e Add basic lighting for item drops.
fixes #623
2025-03-03 19:39:44 +01:00
Krzysztof Wiśniewski
c4a4d29a07
Add branch block type (#1118)
* Add branch block type

* Fix tabs

* Degenerate quads by setting them (.5,.5,.5)

* Add directional branch connecting

* Fix branches connecting to non-solid blocks

* Simplify branchTransform

* No automatic connections to solid blocks

* Use Neighbor to express branch connections

* Allow manual modification of branch connections

* Update branch model to have solid ends

* Tweak block connecting logic

* Tweak comments

* Tweak branch model UV

* Update branch debug texture

* Remove extra faces on connections

* Apply review suggestions

* Exclude viewThrough blocks from branch updateData

* Revert "Exclude viewThrough blocks from branch updateData"

This reverts commit 5942870253e841669c26db959e956fe416d77b9e.

* Apply review suggestions

* Snakes not allowed

* Fix style issues

* Apply review suggestions

* Fix formatting issue
2025-03-03 17:00:42 +01:00
IntegratedQuantum
1f18486c67 List available tool function types when not found. 2025-03-02 19:30:50 +01:00
IntegratedQuantum
0cfcf801ca
Update CONTRIBUTING.md now that we have a full formatter running 2025-03-02 17:43:04 +01:00
IntegratedQuantum
bc02bb0587
Use (an adapted version) of zig fmt to format the source code. (#1140)
* Format all the files

* Fix compilation error.

* The install scripts now patch render.zig from the zig standard library.

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update the formatter, it doesn't need to run on .zig files anymore.

* Update ci.yml

* Update ci.yml

* Add a mistake to check if it works

* IT WORKS!
2025-03-02 16:36:58 +01:00
ikabod-kee
ef1a33f6d5
Pickaxe Rebalance (2) (#1128)
* Pickaxe Rebalance (2)

* Changed ore health

* Can you believe I forgot marble?

* Fix indentation and fix duplicate entry in void_stone.zig

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2025-03-01 16:28:15 +01:00
IntegratedQuantum
868b4aade3 Keep crafting more when holding left click in inventory crafting.
fixes #1051
2025-03-01 15:23:05 +01:00
IntegratedQuantum
ead00272cc Fix crash when leaving an reentering a world.
fixes #972
2025-03-01 14:35:08 +01:00
IntegratedQuantum
ffd408bf18 Print the file path when printing a zon error.
fixes #1133
2025-03-01 12:30:06 +01:00
IntegratedQuantum
e7b3bf5727 Introduce block resistance, remove breakingPower and rename power to damage.
fixes #935
2025-02-28 21:32:47 +01:00
IntegratedQuantum
e71161362a Remove extranous newline when printing a zon syntax error 2025-02-28 18:42:30 +01:00
IntegratedQuantum
1c64a8e4b7 zon: Improve the duplicate key error 2025-02-28 18:38:50 +01:00
Carrie
b660a26b19
Uranium ore, ingots and blocks (#1127)
* Add uranium assets

* Redesign raw uranium to resemble the ore better

* Fix formatting
2025-02-28 17:44:25 +01:00
IntegratedQuantum
6f20f71737 Calculate block damage as individual swings.
fixes #953
2025-02-27 21:19:15 +01:00
IntegratedQuantum
2a73886498 Diminishing returns
fixes #1119
2025-02-27 19:38:28 +01:00
IntegratedQuantum
163db4929a Introduce modifiers that allow changing the power based on the block type.
Basically https://github.com/PixelGuys/Cubyz/issues/172#issuecomment-2685028175
2025-02-26 23:02:18 +01:00
IntegratedQuantum
54c2d2afc6 Replace blockClass with block tags.
This allows defining custom block tags, and multiple of them.

fixes #948
2025-02-26 21:11:08 +01:00