Commit Graph

124 Commits

Author SHA1 Message Date
KP64
80d0482c78 build: nix user development simplification (#1141)
* chore: add treewide nix formatting

This allows nix users to format more filetypes than just the `.nix` files. Treefmt-nix is partitioned to a `dev` flake. Refer to the corresponding flake description as to why this was done.

* style: nix fmt

* build: nix caching, sync nix toolchain to rust-toolchain.toml

Nix triggers a full rebuild on any file change. Even for changes on 'non src' relevant files, like e.g. the readme file. This fixes the caching issues, syncs the 'nixified' rust toolchain with the rust-toolchain.toml file, and moves checks and devShells to the development partition.

* chore: add rust-analyzer and rust-src components

Unless the rust-analyzer & rust-src components are installed somewhere else developers will not have a LSP and the rust std docs available. This installs those components for the specified channel, which is especially useful for Nix users.

* chore: remove taplo

Taplo defaults to 2 Spaces, but setting them to 4 doesn't work either for whatever reason. Therefore the removal.

* style: 4 instead of 2 spaces

Reverts the "mistake" by the taplo formatter

* chore: re-add taplo but with 4 spaces

* style: revert unnecessary Cargo.toml formatting
2025-08-21 10:03:27 +02:00
Alexander Medvedev
bc2bdb87b2 fix shield blocking
(shields still don't reduce/block damage, but you can block with it)
2025-08-20 16:11:48 +02:00
Alexander Medvedev
684db059e5 feat: Support for eating food 2025-08-19 20:46:52 +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
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
Ancient77
b6e55cfbd2 build: Make file generation deterministic & skip unchanged files (#1119)
* update build.rs formatting code

* update build.rs don't save generated file when no change

* generated files use BTreeMap no build changes

* disallow HashMap in build scripts

* fmt
2025-08-12 17:34:01 +02:00
Alexander Medvedev
306a007e3c feat: Falling Blocks 2025-08-03 17:21:46 +02:00
Liyan Zhao
73c2c0115e Refactor entity argument (#1098)
* refactor: implement entity arguments

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

[skip ci]

* refactor: use dyn EntityBase in EntitiesArgument, unify entities & players

* fix clippy

* feat: server.select_entities

* fix clippy

* fix clippy

* fix /kill

* fix /kill damage

* fix entity filter parsing

* type filtering

* chore

* fix entity argument

* fix clippy

* fix entity arg

* Update player.rs

* Update entities.rs

* Update entity_type.rs

* fix

* fix clippy

* fix kill
2025-08-03 12:10:21 +02:00
Alexander Medvedev
3f2484672c Add Entity physics
Thanks to akashbeh for his work
https://github.com/Pumpkin-MC/Pumpkin/pull/824

Co-Authored-By: akashbeh <112662680+akashbeh@users.noreply.github.com>
2025-08-01 15:25:18 +02:00
Liyan Zhao
5ea2f70dba Fix damage & death msg & portal delay (#1095)
* fix: damage sound & death message

* fix

* fix

* fix rustfmt

* fix: reset_state

* fix
2025-08-01 10:04:59 +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
Liyan Zhao
43534cbffd Add EquippableComponent; Handle armour items more elegantly (#1052)
* Partially revert #1008

commit a378e48a04

* feat: equippable component

* chore

* chore

* fix

* fix

* fix: slot & equip_sound

* fix: reg
2025-07-30 22:31:13 +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
spr-equinox
15c9aa4ac8 Improve tags (#1057)
* improve tag v1

* improve tag v2

* fix typo and make BlockPredicate better

* improve get state from state id

* make tag pub

* Update tag.rs

* fix error

* Update hopper.rs

* Update hopper.rs
2025-07-27 21:34:18 +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
Alexander Medvedev
b0cea38596 remove some internal crates 2025-07-11 14:23:14 +02:00
spr-equinox
c965a2ff1f Change BlockRegistry and ItemRegistry to use u16 (#1035)
* optimize

* fix

* fix the weird indent

* Update fluid.rs

* Update blocks.rs

* fmt

* use hash block

* apply to item

* fix incorrect name
2025-07-10 10:43:47 +02:00
4lve
60d83022be Optimize everything (#1032)
* Start fixing block entities

* Fix

* Begin performance fixing

* Fix stuff

* cleanup

* fix clippy

* Fast as fuck

* fix clippy

* Write chunks concurrently

* Disable random ticks for now

* Fix

* Merge

* fix merge errors

* Fix clippy

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-07-09 23:53:50 +02:00
とぴ。(おーけ
1c97edb360 replace to static Fluid / impl ToResourceLocation and FromResourceLocation traits (#1023) 2025-07-09 18:00:52 +02:00
Alexander Medvedev
8fec1d56cd Improve compile time by a bit 2025-07-08 23:58:00 +02:00
Commandcracker
a3c8a7831d Add rayon to data build.rs (#1033)
* Add rayon to data build.rs

* make clippy and fmt happy
2025-07-08 20:02:05 +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
Clicks
6461067b60 Add Candles, Cakes and Candle Cakes (#907)
* feat: basic implementation of sea_pickles

* feat: sea pickle placement done

* feat: sea_pickle growing done

* fix: remove unused function

* fix: clippy time

* fix: variable name

* fix: rng

* add candle block

* add to registry

* add fire charge

* implement putting out campfires

* fix adding the wrong color of candle

* FIXME: placing underwater and on top of waterlogged blocks

* fix trying to place inside of water

* cargo fmt

* clippy :)

* prevent fire and candles from being placed ontop of waterlogged blocks

* clipppyyyyy

* .-.

* fix missing negation

* putting candles on cakes and lighting them

* hard code ids

* add eating candle cakes

* implement @Snowiiii's suggestion

* prettier :D

* fix merge

* fix resetting of block states

* fix creative mode

* fmt

* fix ignition of candle cakes

* fix cakes in creative

* switch to args as structs

* fix ci

* cargo fmt .-.

---------

Co-authored-by: ht06 <hthug06@gmail.com>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-07-07 20:23:48 +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
4lve
622e2a13d2 Improve chunk generation speed by 5x (#988)
* Fewer locks and limit chunk gen to 2x per core

* remove logs

* Fix server shutdown

* Always use static blockstate

* Remove clone from block

* Fix clippy

* Imporve perf

* Implement FyorDev & MartV0 lookup tables

* Add chunk benchmark (FyorDev)

* fix c

* Fix CI

* fix clippy

* Format

* fix CI fr

* format

* Update benchmark to 1000 chunks
2025-07-02 09:48:36 +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
AyaSanae
2d30f7af23 Recipes: add cooking recipes (#965)
* Recipes: add cooking recipes

* fix dead_code warn
2025-06-30 10:19:17 +02:00
Liyan Zhao
b31548e56a Feat: crafting system (#952)
* Added recipes.json basic deserialisation

* Basic crafting implementation

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix: add use_with_item method to CraftingTable

* chore: remove dbg!

* fix: crafting bug

* fix: avoid taking item from result slots

* fix

* fix: asymmetrical recipes

* fix: clippy

---------

Co-authored-by: Laurent Stéphenne <laurent@guibi.dev>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-06-29 23:56:32 +02:00
Alexander Medvedev
402b6b130a Implement Minecart spawning 2025-06-29 21:17:59 +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
Alexander Medvedev
7395925a49 fix CI 2025-06-27 15:52:16 +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
908a915b17 fix generated CI 2025-06-26 22:04:41 +02:00
Alexander Medvedev
03c71fc9f4 Less Allocations more Fun
this made things faster
2025-06-26 00:10:56 +02:00
Alexander Medvedev
8ebc9ee494 Refactor block default state 2025-06-22 21:28:14 +02:00
Alexander Medvedev
f16d4a6247 Add Entity loot
not done, but works
2025-06-21 16:38:05 +02:00
teknostom
95d5fe28eb add fluid mixing (#915)
* add water and lava mixing

* fix

* fix comment

* fix comments pt2

* fmt

* remove unused imports

* use rand in pitch
2025-06-19 11:23:27 +02:00
Alexander Medvedev
b5f09a26a0 Broadcast equipment on player join 2025-06-13 18:10:43 +02:00
Alexander Medvedev
c253b0902c fix some CI issues
hopefully...
2025-06-12 20:15:46 +02:00
unschlagbar
b9eed8e9a5 hopefully fix for miss generating files (#873)
---------
Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
2025-06-10 14:02:26 +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
unschlagbar
da7453cf10 Pumpkin data changes (#854)
* fix

* another fix

* Update build.rs

* Delete pumpkin-data/src/generated directory

* clippy fix

---------

Co-authored-by: unschlagbar <adrian@kuhlmann@gmx.de>
2025-06-08 11:59:48 +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
TheDarkSword
f449b693c7 Save/Load entity effects and send to player on join (#807)
* Save/Load entity effects and send to player on join

* Moved nbt writing and reading to Effect struct

* Fix cargo fmt

* Improved reading logic

* Resolve conflicts
2025-05-18 19:07:11 +02:00