Commit Graph

89 Commits

Author SHA1 Message Date
Alexander Medvedev
42c903493a port to 1.21.11 2025-12-24 13:09:01 +01:00
teknostom
168f885dda feat: prepare block light (#1127)
* add block light

* fmt

* fixes

* remove import

* remove unused state

* sky light

* Comment out Sky light

* Fix sky light

* fixes

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-12-05 18:44:01 +01:00
Alexander Medvedev
0ce5471761 Overhaul registry loading
Registry data is now loaded dynamically for automatic future-proofing, ending the need for manual struct updates. Access to specific values now requires explicit data lookups.
2025-11-18 19:00:18 +01:00
unschlagbar
e154b394af update to bedrock 1.21.111 (#1193) 2025-10-15 09:52:30 +02:00
Alexander Medvedev
58583da4c1 Port to 1.21.9
I did not update density functions because i'm too lazy to refactor a bunch of things because Mojang decided to remove "initial_density_without_jaggedness", but i will in the future
2025-10-02 18:27:10 +02:00
unschlagbar
0bc7405f12 fix world y offset & bedrock update (#1121) 2025-08-30 09:27:03 +02:00
Alexander Medvedev
c5c3ffc005 feat: add name tag logic 2025-08-22 12:09:30 +02:00
ht06
3b1fffcb6e feat: add french translation (#1135) 2025-08-18 18:23:57 +02:00
Bram
56ad480ba2 Fix redstone wire with non-solid blocks (#1124)
* Fix redstone wire when interacting with glass and non-full blocks

* Use is_solid_block to determine whether redstone wire should be blocked

* Fix: incorrect uses of BlockState.is_solid()

* run cargo fmt

* split state_flags into 2 u8's and remove BlockState.blocks_wire() methods

* Resolve clippy warning

* Revert state_flags back to a single u16

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-08-18 18:11:42 +02:00
Crefax
398ba39233 feat(tr): Add Some Turkish translations (#1132)
* feat(tr): Add Turkish translations

* Fix formatting issue in translation.rs
2025-08-18 09:12:04 +02:00
Alexander Medvedev
53cef4b050 Add structures
this is by far not done and the implementation is not correct in many ways, but it is still something
2025-08-17 22:12:38 +02:00
Missing_Love
b741881729 Added some Simplified Chinese translations. (#1129)
* Added some Simplified Chinese translations.

This is my first Pumpkin PR, and it means the world to me. (≧∇≦)🎃

* Added Simplified Chinese

* Added Simplified Chinese
2025-08-16 17:23:49 +02:00
spr-equinox
4205befa5d DataComponent serialize, deserialize and nbt. Enchantment and Damage implement (#1117)
* add

* fix hash

* Update data_component_impl.rs

* write nbt

* update enchantments

* Update data_component.rs

* fix enchant

* Update login.rs

* remove 1 todo

* KnownPack version

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-08-16 17:20:56 +02:00
MrMelther
f4eadc5681 feat: Added custom translations (#1109)
* Custom translations!

Added to TextComponents custom translations, allowing to send commands in the current player locale.

* Ignoring locale's typos

* Paired reorder_substitutions with vanilla

Changed how reorder substitutions work to match how vanilla allows to join next and numeral substitutions.
2025-08-15 09:59:47 +02:00
Alexander Medvedev
fae24008db pumpkin-world(structures): Add structure placement calculation 2025-08-13 17:11:56 +02:00
spr-equinox
5084ccd43f Add Entity spawning on Chunk generation (#1054)
* Support Spawn

* Update natural_spawner.rs

* fix distance

* fix error

* fix

* use heigh map

* Update living.rs

* impl get_rough_biome and merge

* fix dropper and entity disappear

* merge

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-07-31 18:38:06 +02:00
spr-equinox
13ef8de2dc add Potion Data, refactor Effect, and add BrewingRecipe Data (#1070)
* improve tag v1

* improve tag v2

* fix typo and make BlockPredicate better

* improve get state from state id

* impl DataComponent

* make tag pub

* make component work

* apply clippy

* apply clippy

* remove unused crate

* apply to itemstack and no lifetime mark anymore

* Update tag.rs

* use Cow

* remove unnecessary lazy_static and Cow

* Update mod.rs

* Update mod.rs

* make DataComponent dyn

* 1

* fmt

* remove unused crate

* fix error

* fix

* Update Cargo.toml

* Update Cargo.lock

* fix

* Update composter.rs

* update rust-version, remove unused crate, and merge

* Update furnace.rs

* Update lib.rs

* Update living.rs

* Update living.rs
2025-07-28 20:34:29 +02:00
spr-equinox
8ce65cc42d Refactor ItemStack to Support Vanilla-Like Data Components (#1059)
* improve tag v1

* improve tag v2

* fix typo and make BlockPredicate better

* improve get state from state id

* impl DataComponent

* make tag pub

* make component work

* apply clippy

* apply clippy

* remove unused crate

* apply to itemstack and no lifetime mark anymore

* Update tag.rs

* use Cow

* remove unnecessary lazy_static and Cow

* Update mod.rs

* Update mod.rs

* make DataComponent dyn

* remove unused crate

* fix error

* Update Cargo.toml

* Update Cargo.lock

* fix

* Update composter.rs

* update rust-version, remove unused crate, and merge

* Update furnace.rs
2025-07-28 12:24:40 +02:00
AyaSanae
f80650c36c Implement Furnace (#1058)
* fix: the fields of the struct CookingRecipe should be pub.

* Add furnace screen handler and slot

* Add furnace block entity

* Add furnace block

* fix bug

* add client-side sync

* fix furnace facing

* remove unused statements

* fix spelling error

* Listening for property changes and syncing them to the client-side.

* fix furnace lit state

* fix fuel should be placed at fuel slot in quick_move()

* fix spelling error

* remove unused comment

* fix: only one listener is needed.

* pumpkin-data: add recipe_remainder

* Set the bottom item as the remainder if it has one

* pumpkin-data && furnace:fix spelling error

* fix building error

* use_with_item is the same as normal_use

* fix quick_move()

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-07-28 10:10:17 +02:00
unschlagbar
2e2236bf3b Bedrock player joining (#1063)
Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
2025-07-26 17:31:00 +02:00
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