169 Commits

Author SHA1 Message Date
teknostom
a18d399ad1 Add random block ticks and crop impls (#935)
* add random block ticks

* fix linx

* fmt

* fix performance

* remove log

* fix ci

* fix data

* Crop growing

* fix

* fix crops

* optimize

* fix

* fmt

* performance

* fmt

* remove chunk checking

* fix deadlocks

* final fixes

* clippy

* fix
2025-07-08 15:06:34 +02:00
AyaSanae
e73541a12e pumpkun-data: Add fuels (#1005) 2025-07-06 20:44:09 +02:00
Alexander Medvedev
85007547c4 Initial Enchantment work 2025-07-03 16:41:57 +02:00
Alexander Medvedev
630560e1d8 Update README gif 2025-07-02 10:45:32 +02:00
ht06
0804a07626 Implement Flower pot and change the state of eye blossom flower (#930)
* feat: place flowers, saplings, ... inside the pot

* feat: remove flowers, saplings, ... inside the pot and check when placing block next to the pot

* feat: add changement for eye blossom flower state (open and closed)

* fix: adapt to the BlockState commit (8ebc9ee)

* fix: delete unused import

* fix: refactor

* cargo clippy + fmt

* feat: use extractor to place the flower inside the pot

* All done

* fix: replace blocking_lock() by lock().await

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-07-01 08:50:52 +02:00
Alexander Medvedev
c67d4cfd2e Update to 1.21.7 2025-06-30 23:41:23 +02:00
teknostom
2333d6b959 Add fire spreading (#931)
* Add Fire

* fixes

* fix dropping blocks

* fix logic

* Fix CI

* add support for waterlogged

* fmt

* fix comment

* remove particles and sound from fire breaking

* fmt
2025-06-27 16:08:05 +02:00
とぴ。(おーけ
31bef9593b Add Gamerule (#929)
* make gamerules from assets at buildtime

* fix tests / add default functions

* add gamerule command
2025-06-27 15:28:12 +02:00
とぴ。(おーけ
fe5ab6876d Add Composter (#936)
* added composter

* separate into Extractor and pumpkin-data

* add game event
2025-06-27 14:18:51 +02:00
Alexander Medvedev
82948f830e Update to 1.21.6 2025-06-17 19:53:33 +02:00
Alexander Medvedev
1a736267ba Prepare chunk entity generation
Also switch to strip_prefix instead of replace, much more efficient
2025-06-09 16:04:08 +02:00
teknostom
8c6cfee20f Implement The End (#868)
* Add end portals

* lint fix

* Last fixes

* fmt

* re-add buckets pr

* last fixes

* Add block entity for end_portal

* add end

* Add block boundaries

* Add properties

* change names
2025-06-08 22:28:08 +02:00
Alexander Medvedev
abccd3f700 add Chunk features (#685)
* inital chunk features

* add more things

great title i know

* add some features

still no result, but we are getting there...

* make it parse

* add simple BlockPredicate

* add simple random selector

* new things

* change stuff

* base tree impl

* change things

* add more heightmaps

* fix master merge

* steps towards proper random

* fix upper level block placement logic

* Make it compile

* fix block dir serde name

* Added Tree Foliage

* more Tree work

* Implement would_survive check

I don't say its good, but it works :D

* Fixed biome placement modifier (#836)

* Implement all tree foliages

* Fix grass, flowers, seagrass, seapickles...

* Add Ores

* add Bamboo, Vine, Spring feature

Also more fixes

* Corals

* Add Tree decoration & more

Many many fixes

* fix vines

* fixed bamboo

* fix some clippy warns

* fix trees outside of chunk

* make it compile again

upsi

* fix clippy warns

* fix InsideWorldBoundsBlockPredicate

* set dirt under tress trunk

dirt, not grass

* more trees work

---------

Co-authored-by: kralverde <github@email.kralverde.dev>
Co-authored-by: Laurent Stéphenne <laurent@guibi.dev>
2025-06-05 17:03:52 +02:00
unschlagbar
fd8f1d370d Add Solidity flags to BlockState (#818)
* intial

* fix

---------

Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
2025-05-20 14:54:49 +02:00
unschlagbar
b997687e8b implement Door placement & pumpkin_data changes (#713)
* fix: view distance goes no above 16

* fix: cargo fmt

* removed the floating point conversation

* fixed spelling

* renamed the test for the capacity estimation

* edit: replaced division with bitshifting

* added more ()

* extendet test and fixed missing chunks when the view distance is very low

* added commentar

* fixed door placement & fence connection

* fix linting

* fmt

* fix clippy

* removed useless borrow

* fix all clippy warnings

* bro i changed so much

* added const to fn

* Update block_state.rs

* added bunch of things

* fix

* lol

* fmt

* fix: player is able to place where it stands

* fix: spelling

* upd2

* upd 4

* remove Option types from blockstate

* resolve conflicts

* Update player.rs

* fix

* fmt

* remove uninit

* fix

* resolved conflicts

* fmt

* remove dupe code

---------

Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
2025-04-26 10:27:37 -10:00
kralverde
f0636bb924 Memory and binary size decreases and chunk generation code cleaning (#715)
* initial work

* refactor perlin noise function & re-add tests

* make the biome tree compile time

* seperate density function stacks
2025-04-09 10:39:45 -10:00
Alexander Medvedev
a2d9396bbd parse protocol version
one thing less to care about when porting
2025-04-01 16:06:51 +02:00
kralverde
d54325113f Biome & surface generation fixes (#648)
* add biome test

* tweak biome data

* add multi noise sample test

* multi noise work

* extract tree itself

* tweak tests

* chunk tests complete

* add surface test

* fix badlands

* refactor perlin noise

* frozen ocean tests

* fix glaciers

* cache optimization

* cache block lookup

* update asset files

* add second badlands test

* add biome blend test

* add more tests
2025-03-29 21:23:27 +01:00
Alexander Medvedev
7a5a35b3d8 fix biomes index 2025-03-29 20:59:16 +01:00
Alexander Medvedev
ce60881132 change biomes parsing (#683)
* change biomes parsing

now we have more infos

* add temperature_modifier

* add ids
2025-03-29 19:45:35 +01:00
Alexander Medvedev
d8b726dfe2 Update to 1.21.5 (#665)
* update to 1.21.5

* maybe made something better maybe made something worse

:c does still not work

* some fixes

* fix chunk packet

finally, this took way too much of my life time

* port text component

* fix tests

recipes are broken but we currently don't use them anyway
2025-03-27 21:49:02 +01:00
Alexander Medvedev
7164a471d4 Implement Farmland
some things are still missing
2025-03-23 15:13:23 +01:00
Alexander Medvedev
7a15a50030 Generate Biomes (#610)
* Populate biomes

* actually fix multi noise sampler

* actually they are all pass-through

* fix serde error

* prepare things

* implement surface rules

* fix max_y

* fix terrain gen

* make surface rules work

* fix wrong biome coords

* refactor height estimator to its own struct

* implement surface estimation for surface rules

* fix surface gen

* some carve work

* fix conflicts

* more biomes work

* fix biome map

* refactor biome lookups

* add unit tests

* change from_block to from_chunk

* not only lushcaves anymore

* add more unit tests

* add unit test

* fix multi noise

* Update proto_chunk.rs

* fix biome map access

* test badlands impl

* fix badlands

* fix some values

* make it compile

* Fix bug in get_enclosing_parameters (#641)

* add badlands pillar and icebergs

* fix clippy

* fix clippy in test

* Update README.md

---------

Co-authored-by: kralverde <github@email.kralverde.dev>
Co-authored-by: 4lve <72332750+4lve@users.noreply.github.com>
2025-03-19 17:02:52 +01:00
4lve
eb27cfa16a Generate Blocks and Properties Revamp (#613)
* Add block builder

* Implement loot tables

* chaos snapshot

* LFG

* add oak fence

* lever facing

* Add trait for CardinalDirection

* fix clippy

* fix clippy

* reimplement partial state of loottable

* Implement neighbor block updates

* add oak door

* Fix crash on invalid state

* Fixes

* Add fences

* Add doors

* Refactor how we handle block properties when implemented in many places

* Remove old loot_table, moved to block generation

* Better Block Properties

* Add fence gates

* Update block_grouper and add logs

* Build tags instead and make it easier to define variants of blocks

* Save block states

* Allow nether fences to connect with fence gates

* Move away from hardcoded property names

* Clean up property remaps

* start refactor of blocks

* refactor block compile build

* refactor name map for property groups

* Make it so fences can't connect to the air part of a fence gate

* Use extractor instead of hard coded property names

* to_value and from_value should be stripped of "L" prefix

* Prefix isn't used anymore

* use hashes to verify uniqueness

* Don't declare IntProvider twice and fix typo

* remove some comments that don't apply anymore

* Move loot table so it's shared

* Futureproof Loot Tables

* Implement BlockStateProperty condition for LootTables

* Move experience to pumpkin_utils

* Add is_liquid

---------

Co-authored-by: kralverde <github@email.kralverde.dev>
2025-03-10 18:06:44 +01:00
Alexander Medvedev
e055dd740c Check if player can destroy block using an tool
Prevents players to destroy blocks when holding a sword or trident in creative
2025-03-04 19:45:39 +01:00
Alexander Medvedev
27f239a612 Living Entity: Proper death
Now we wait until despawning the entity so the death animation is played
2025-02-27 22:51:49 +01:00
Alexander Medvedev
8aef30ee13 Make TNT Work (#590)
* make tnt work

* Spawn TNT at right position

* Fix tnt
2025-02-25 16:38:12 +01:00
Alexander Medvedev
995edfb3c2 Add Effects 2025-02-22 14:17:06 +01:00
kralverde
4f3c146500 Fix Item Tool Components and Partially Implement Tag Updates (#554)
* initial commit

* add fluid tags

* rename tag item

* Don't broadcast block breaking to breaker

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-16 15:54:07 +01:00
Alexander Medvedev
5a77b21d22 Calculate block breaking speed
Also broadcast current held item. The block progress is already correctly displayed and calculated for tools. But for some reason the destruction does not work, looking at vanilla code i have no idea what i'm doing wrong
2025-02-15 22:47:14 +01:00
Alexander Medvedev
3d1e0bf35c Check for correct tool when breaking blocks
Also rewrite how we handle tags. Now we can use tags everywhere we want!. I also decided to make the json assets pretty printed which is so much easier to debug, The decision was made because of the reason that we are moving to compile time assets, so pretty printing does not affect performance
2025-02-14 22:47:09 +01:00
kralverde
8d2ca8e404 Density Function Re-Work (#525)
* add density function parser, re-write functionality, and add initial tests

* add more tests and fix typo

* re-work density interpolator

* re-work flat cache

* re-work the rest of the chunk specific density functions

* re-work fill functions

* tweak sample logic and do some refactoring

* convert chunk noise to use new density functions

* work on porting proto chunk

* port proto chunk

* add cell cache test

* fix wrapper functions

* remove test print

* update benchmark

* rework again

* rework again pt 2

* classic off by one

* reduce components on the stack by 60x

* aquifer tweaks

* add multi noise sampler for biome sampling
2025-02-10 22:24:08 +01:00
Alexander Medvedev
8592d095f3 Parse Items at Compile time 2025-02-08 19:23:59 +01:00
drakeerv
09d6eb6da2 Add damage types & damage command (#526) 2025-02-02 11:22:49 +01:00
Alexander Medvedev
ef497fb435 Refactor World Entity System
Also support Item drops (WIP)
2025-01-31 21:45:20 +01:00
Alexander Medvedev
7ec4cc7c2e Add Message types
aka chat types
2025-01-23 18:35:00 +01:00
Alexander Medvedev
57e54284c5 Translate when printing to console 2025-01-23 16:57:23 +01:00
Alexander Medvedev
709d222c23 add basic entity NBT storage 2025-01-19 19:30:32 +01:00
Alexander Medvedev
6415f697e5 parse Biome enum at compile time 2025-01-11 19:48:18 +01:00
Alexander Medvedev
aad1f91acb parse entity types at compile time 2025-01-11 17:59:36 +01:00
Alexander Medvedev
308c125a20 parse world events at compile time 2025-01-11 17:06:21 +01:00
Alexander Medvedev
03cb80b216 parse scoreboard display slot at compile time 2025-01-11 16:52:09 +01:00
Alexander Medvedev
621bc31f48 parse entity pose at compile time 2025-01-11 16:20:31 +01:00
Alexander Medvedev
c95b27eafb parse sound category at compile time 2025-01-11 16:11:51 +01:00
Alexander Medvedev
82386a57c4 parse game event at compile time 2025-01-11 15:54:26 +01:00
Alexander Medvedev
da268b548b parse ChunkStatus at compile time 2025-01-10 15:31:20 +01:00
Alexander Medvedev
03e81a1436 transfer packet id parsing to build time
This also allows now to create custom packets with a custom packet id which is not in the packets.json
2025-01-10 13:42:39 +01:00
Alexander Medvedev
29ed502aea extractor: extract entities 2024-12-26 22:10:12 +01:00
Snowiiii
35afc0bfb9 Port to 1.21.4 2024-12-03 23:34:59 +01:00
Snowiiii
796341be05 Extractor: minimize everything
- blocks.json 8.3MB -> 4.1MB
- items.json 988KB -> 548KB
- packets.json 6.9kb -> 4.2kb
- particles.json 3.5kb -> 1.6kb
- recipies.json 376kb -> 264kb
- screens.json 731b -> 315b
- sounds.json 72.2kb -> 42.2kb
- synced_registeries.json 143.3kb -> 87.6kb
- tags.json 335.4kb -> 165.8kb
2024-11-27 00:12:11 +01:00