1243 Commits

Author SHA1 Message Date
Krzysztof Wiśniewski
ac76d1ffd6
Move compiler detection to separate scripts (#1573)
This will allow for Cubyz Dev Kit to install compiler without building
the project itself.

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-06-02 15:50:25 +02:00
IntegratedQuantum
03a5e2cf38 The particle hashmap was never inited 2025-06-02 15:38:40 +02:00
OneAvargeCoder193
a59ac2b011
Change log rotation to be more similar to branches, and also remove log_top (#1496)
Fixes #357 

Stuff left to do

- [x] Make them more like branches
- [x] ~Make them rotate~ Fixed automatically by making them like
branches
- [x] ~Let them be chiseled like stairs?~ This will be a future pr
- [x] Automatic migration between old and new logs

---------

Co-authored-by: Carrie <carriecapp9@gmail.com>
2025-06-01 17:17:33 +02:00
IntegratedQuantum
0c1ee186b2 Silence some of the less important OpenGL messages
fixes #1532
2025-06-01 15:22:47 +02:00
IntegratedQuantum
39bea9a66e Fix lossy chunk compression for transparent blocks
fixes #1565
2025-06-01 15:05:18 +02:00
IntegratedQuantum
4dc994ae9d Remove the text listener while deiniting the component
Previously there was a rare race condition where this could crash.

should fix #1562
2025-06-01 14:48:44 +02:00
IntegratedQuantum
beed67403e Allow summing tool parameters instead of averaging them.
Currently everything uses average, but it does make some things less intuitive.
2025-06-01 14:32:20 +02:00
Krzysztof Wiśniewski
8f9ebe55fa
Allow direct use of blueprints as SBBs (#1500)
## Descriptions

This pull request adds inline SBBs feature which allows blueprints to be
used directly (without SBB zon file) as child in other SBB files.
Blueprint used this way must not any child blocks on it's own.
To ensure that the feature works correctly some of the now redundant SBB
zon files were removed.
Current implementation generates SBB at runtime for each of the
blueprints that has 0 child blocks and doesn't have an SBB with same ID.
In the future the implementation could be changed to create SBBs on
demand, to avoid wasting memory on blueprints which are not used or use
SBB with different name, that is not critical tho (really small gains)
and requires #1499

## Links

Resolves: #1403

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-06-01 12:56:54 +02:00
Carrie
74b0fb4431
Misc texture palette tweaks (#1568)
Some thrilling and game-changing texture edits:
These are a bunch of small tweaks that have been on my to-do list.
Ideally i would have before/afters for these but they are so minor that
I feel its not worth the effort

- Lower contrast of brightest sand colour (this was bothering me all
week when testing logs in the desert)

![image](https://github.com/user-attachments/assets/764933e4-11db-4f68-9081-5ab9f29d7233)

- Lower contrast of duckweed 

![image](https://github.com/user-attachments/assets/73820d80-c17d-4cb4-96d4-52e784d9d2be)

- Reduce hue shifting on red chalk (the darkest colour is now more red
than more pink)

![image](https://github.com/user-attachments/assets/cf56f087-b33b-4250-8877-e56977c87905)

- Darken dead leaves & lower contrast. This is probably the most
noticeable change. (ensuring good contrast when on top of grass blocks)

![image](https://github.com/user-attachments/assets/1fe5c9b1-3f05-45a3-96bc-8550e3a49d60)
2025-06-01 11:28:32 +02:00
MnHs
152e91b6d1
Fix particle UVs (#1564) 2025-06-01 11:17:40 +02:00
IntegratedQuantum
4b3e5aebf2 Introduce a testing mode for developers which doesn't reload LODs on biome changes and doesn't save maps either.
fixes #1489
2025-05-31 14:20:02 +02:00
IntegratedQuantum
b9a43284c6 Close all settings windows when the mouse is grabbed
fixes #710
2025-05-31 13:57:14 +02:00
IntegratedQuantum
3846cd54d4 Add crafting recipes for signs 2025-05-31 11:09:25 +02:00
Krzysztof Wiśniewski
df99bfc804
Add baseItem migrations (#1534)
Resolves: #1503
2025-05-31 11:05:40 +02:00
IntegratedQuantum
eaaf524f99
Signs (#1446)
- [x] Rotation (already merged)
- [x] basic GUI
- [x] sign models and textures
- [x] sign blocks
- [x] update the text on the client
- [x] Figure out block entity rendering
- [x] Render the text to a texture on update
- [x] Render the texture in the world in the location of the sign
- [x] Use varint instead of u32 for storing the block data lengths,
(now, while we can still change it)
- [x] Sync the text with the server and all clients
- [x] Figure out block entity storage on the server
- [x] Send the entity data of the initial chunk
- [x] Store the text on the server
- [x] Set the chunk as changed whenever a block entity data update
happens, so we actually store it
- [x] Disable or figure out optimized local chunk transmission
- [x] fix memory leak
- [x] Rethink some of the API (do we need onPlace/onBreak, when there is
unload and updateData?)
- [x] Remove the background shadow from text, it produces too much
aliasing
- [x] Figure out if the default should be black or white
- [x] Correctly center the text
- [x] Why are newlines not working?
- [x] Check if a deadlock is possible on deinit --- it would be possible
only if another thread has a reference to it, which should not be the
case when unload is called.
- [x] Set the text margin and sizes reasonably
- [x] Make sure the GUI fits with the sign width
- [x] Create an issue for configurable sign texture size and
configurable default color

fixes #367

---------

Co-authored-by: Carrie <122191047+careeoki@users.noreply.github.com>
Co-authored-by: OneAvargeCoder193 <85588535+OneAvargeCoder193@users.noreply.github.com>
2025-05-31 10:49:50 +02:00
Carrie
b333d22bbc
Add sickle (#1550)
resolves #1547 

The sickle, balanced to the best of my ability. It breaks `.leaf` and
`.cloth` tagged blocks.
A metal sickle lets you get rid of floating leaves or clear a grassy
field super quickly.


![449059994-d2c01e85-3d92-471b-a4e3-e766d7dfb00b](https://github.com/user-attachments/assets/428afbc0-e337-4cb6-9469-e02acdbcadda)

![449060984-db0d1f5d-5f2f-4cd0-b4e1-bffd1046be09](https://github.com/user-attachments/assets/b5d5d517-c3c0-4442-82b4-8dfa07508a19)

![449060868-712ecad3-f6ef-432c-8269-de34c59ba154](https://github.com/user-attachments/assets/3d2528ed-62e5-44ed-a3bf-d19b37877216)

![image](https://github.com/user-attachments/assets/e4d52853-501c-44dc-a933-8855b1b91c79)
2025-05-30 20:40:44 +02:00
OneAvargeCoder193
3d8b4f200e
Change gitignore to ignore all assets that aren't either inside assets/cubyz or assets/backgrounds/default_background.png (#1527) 2025-05-27 21:41:26 +02:00
MnHs
de304e49d3
Particles (#1367)
https://github.com/user-attachments/assets/de82e298-acfb-431d-973a-2d37b9a707ae

resolves #293

---------

Co-authored-by: Krzysztof Wiśniewski <argmaster.world@gmail.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: Krzysztof Wiśniewski <Argmaster@users.noreply.github.com>
2025-05-25 20:53:05 +02:00
Krzysztof Wiśniewski
14c7fafce9
Merge sbb and blueprint asset directories (#1498)
## Description

This pull request merges `sbb` and `blueprint` directory trees into
single directory tree as discussed in #1403 searched twice, once to load
blueprint files, once to load sbb zon files.

## Links

Related to: #1403
Related to: #1408
2025-05-24 13:23:51 +02:00
Carrie
bb0289c738
Furnace assets (#1479)
Following suggestions in #1151, this adds the nonfunctional kiln,
furnace, bellows, and chimney blocks.


![image](https://github.com/user-attachments/assets/94e9de34-b1fc-4344-94e2-5cbfbbb7d394)

![image](https://github.com/user-attachments/assets/b9a071c6-5a09-4d09-b954-70a6e4af31a7)
And I even did lit textures.
![Recording 2025-05-18 at 19 10
56](https://github.com/user-attachments/assets/e96fd91b-3ed2-4045-a1c1-f6c9c056222e)

This is what I imagine for recipes:
```
Kiln
- 8 any stone

Furnace
- 8 terracotta

Bellows
- 2 planks
- 2 copper
- 4 leather

Chimney
- 4 terracotta
- 2 iron
```

There is a lot of changes because I had to do some consistency fixes
along the way:
- terracotta grout colour
- copper block palette changes
- change 1 colour of the torch flame
2025-05-23 20:51:37 +02:00
Krzysztof Wiśniewski
c13d9415d8
Add tool palette (#1494)
## Description

This pull request adds a tool palette to allow using stable indexes for
binary storage.

## Links

Related to: #1290 
Related to: #1478
Related to: #1473
2025-05-23 19:06:24 +02:00
IntegratedQuantum
5a3a125730 Set the colorMask correctly in the graphics.Pipeline
fixes #1492
2025-05-22 20:52:34 +02:00
Krzysztof Wiśniewski
a15f1a96bc
Refactor common* variables from assets.zig into struct (#1289)
## Description

This pull request moves all of the `common*` variables into `Assets`
struct.

As a bonus change `Managed` was special cased in
`refAllDeclsRecursiveExceptCImports` to avoid infinite recursion for
`*HashMap*` aliases.

## Links

Resolves: #1205
Resolves: #1204
Related to: #1181
2025-05-22 17:05:47 +02:00
Krzysztof Wiśniewski
cbe400c9a4
Migrate all the test to use main.heap.testingAllocator (#1487)
Resolves: #1432
2025-05-21 20:43:03 +02:00
IntegratedQuantum
c852393076
Refactor how block entity unloading works and unloading things on the client side (#1475)
extracted from #1446
2025-05-21 20:42:17 +02:00
IntegratedQuantum
a4809555e9
Use a SparseSet in BlockEntity data, instead of manually managing a dense list. (#1470)
fixes #1453
2025-05-20 20:37:41 +02:00
Krzysztof Wiśniewski
2e705d9cc9
Fix #1457 (#1459)
Resolves: #1457

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-20 19:51:43 +02:00
Krzysztof Wiśniewski
b79784a0aa
Add /replace command (#1424)
## Description

This pull request adds `/replace` command. The main difference from
`/set` with `/mask global` is that mask specified for `/replace` is
inlined, local and positive, i.e. only blocks matching the mask
specified as part of `/replace` command will be affected. `/replace`
ignores global masks.

```
/replace <old> <new>
```

`<old>` - expression following mask syntax (#1284), blocks which match
will be affected
`<new>` - expression following pattern syntax (#1237) used to fill
blocks matched by `<old>`

## Examples

`/replace cubyz:air cubyz:void`
`/replace $leaf|cubyz:air cubyz:stone,cubyz:grass`

## Links

Related to: #1214 
Depends on: #1337 
Depends on: #1284

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-20 19:03:12 +02:00
IntegratedQuantum
c52b231983
Make iron more elastic (#1472)
Currently Copper beats iron due to its low swing time.

This makes iron more elastic, giving it the same swing time as copper.
Both a copper-head and an iron-head pickaxe now have a swing time of
0.12s

This makes iron strictly better than copper, reducing it from the best
metal in the game to a step in the progression, it's still required to
mine iron. However the plan is to give it a come-back in the end game
due to its high conductivity.
2025-05-20 18:56:25 +02:00
ChibChi
0e1aa68174
Add random tick events (#1338)
This pull request adds random tick events for blocks. Tick events can be
added by using the `tickEvent` trait and contain the `name` of the
callback function and the probability ( `chance`).

Resolves: https://github.com/PixelGuys/Cubyz/issues/77

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-19 20:55:42 +02:00
OneAvargeCoder193
2f48161712
Add a SparseSet implementation (#1414) 2025-05-19 16:49:41 +02:00
IntegratedQuantum
a29bb3c3b9
Rename EntityDataClass to BlockEntityType (#1464)
I also removed the legacy (java) blockEntity references.

fixes #1454

@Argmaster since you wrote the original code in #1224, please review and
check if the new names are fine for you.
2025-05-18 19:20:51 +02:00
Krzysztof Wiśniewski
1f4d23464a
Add /mask command (#1337)
* Add masks

* Apply masks to /set

* Change char used for tags

* Remove mask command

* Revert "Remove mask command"

This reverts commit 83e8cdd9044452f11efdd4d515bee330491ea1f6.

* Fix use of BlockTag

* Fix use of BlockTag

* Move Pattern into Blueprint

* Improve error message on capture failure

* Change memory management

* Move EditMask to blueprint.zig

* Polish mask command

* Fix some fixes

* Fix block formatting

* Fix blueprint formatting

* Implement some of the suggestions

* Fix field renames

* Unstupidify Entry.initFromString inverse handling

* Use introspection to create Property enum

* Make or_ and_ inverse etc. private

* Use functions instead of generics

* Rename getBlockById parameter

* Update src/blueprint.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Improve error names

* Add get method to Tag

* Improve error names

* Update src/blueprint.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Change how block dispatch is done

* Add hasTag

* Quick fixes of small bugs

* Fix implementation of hasTag

* Remove redundant try from parseBlockLike

* Add test for inverse masks

* Fix inversed mask check

* Remove brush masks

* Remove unused imports

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-18 19:03:41 +02:00
IntegratedQuantum
f5fd3356d9 Reset the client-side inventory sync after leaving a world.
should fix #1461
2025-05-18 13:06:15 +02:00
Krzysztof Wiśniewski
6596835cf3
Tweak coal ore health (#1456) 2025-05-18 12:07:22 +02:00
IntegratedQuantum
5c68b2da2a Fix memory leak of world name
fixes #1458
2025-05-17 22:56:49 +02:00
Krzysztof Wiśniewski
53d6cc70e9
Add BaseItemIndex struct (#1445)
* Add BaseItemIndex struct

* Please fix

* Update src/Inventory.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Sticks and stones may break my bones but pr will always need fixes

* Update src/assets.zig

* Replace break with return in Inventory.update

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-17 15:51:21 +02:00
Krzysztof Wiśniewski
f9a65a0681
Add modified test runner (#1294)
* Add modified test runner

* Add test runner to build.zig

* Fix build.zig formatting

* Merge master runner and changed runner

* Restore proper comment

* Update test/runner.zig

* Update test/runner.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Update test/runner.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Update test/runner.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Update test/runner.zig

* Restore deleted line

* Restore deleted line

* Get rid of padding stuff

* Update test/runner.zig

* Colors

* doColors

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-15 17:58:17 +02:00
IntegratedQuantum
54ab3fc8ed Add sign rotation mode
a first step towards #367
2025-05-14 21:38:34 +02:00
IntegratedQuantum
824840a776 Fix formatting 2025-05-13 21:48:58 +02:00
IntegratedQuantum
73bbdcc033 Allow arbitrary and duplicate Save names.
This is done by replacing all illegal file name characters with `-`. Unicode is still preserved because it doesn't seem to be a problem for modern file systems.
The idea of file name encoding/decoding is discarded, instead the name is just stored in the zon
fixes #606
2025-05-13 21:10:14 +02:00
IntegratedQuantum
8bcc00f536 Sort the world list in save selection by least recently used.
Also did some further refactoring to make it easier to deal with different world paths (#606) in the future.
fixes #1311
2025-05-13 20:39:12 +02:00
IntegratedQuantum
ab4beca0f4 Rename the server thread to make it easier to distinguish in a profiler or debugger.
I would also rename the main thread, but that doesn't seem to be possible.
2025-05-13 19:54:48 +02:00
IntegratedQuantum
3db8c22b5d Fix number of indices
fixes #1437
2025-05-12 20:28:03 +02:00
IntegratedQuantum
4d62da9ae8 Rename solid to replacable
fixes #1358
2025-05-12 18:06:21 +02:00
IntegratedQuantum
48f67e19c2 Why did I test this after merging? 2025-05-12 17:51:37 +02:00
IntegratedQuantum
2f3a25dfb3
Draw a thicker selection box (#1435)
* Draw a thicker bounding box

* Draw an actual 3d model for the selection box.

This is done using a line model with a cubiod offset model.
2025-05-12 17:47:14 +02:00
IntegratedQuantum
e4840f7503 Limit the performance impact from freeing from the GPU buffer to 5 ms per frame
fixes #1416
this is a workaround until #1434 is implemented
2025-05-11 21:06:02 +02:00
IntegratedQuantum
1fbf5618b9 Set the placeholder biome before receiving the first biome packet from the server
fixes #1428
2025-05-11 19:54:25 +02:00
Krzysztof Wiśniewski
b0aa8ea6ea
Edit masks (#1284)
* Add masks

* Apply masks to /set

* Change char used for tags

* Remove mask command

* Fix use of BlockTag

* Move Pattern into Blueprint

* Improve error message on capture failure

* Change memory management

* Move EditMask to blueprint.zig

* Fix some fixes

* Fix block formatting

* Fix blueprint formatting

* Implement some of the suggestions

* Fix field renames

* Unstupidify Entry.initFromString inverse handling

* Use introspection to create Property enum

* Make or_ and_ inverse etc. private

* Use functions instead of generics

* Rename getBlockById parameter

* Update src/blueprint.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Improve error names

* Add get method to Tag

* Improve error names

* Update src/blueprint.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Change how block dispatch is done

* Add hasTag

* Quick fixes of small bugs

* Fix implementation of hasTag

* Remove redundant try from parseBlockLike

* Add test for inverse masks

* Fix inversed mask check

* Return Inner from parseBlockLike

* Apply review change requests

* Fix memory leak and add negative tests

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-11 15:31:17 +02:00