Commit Graph

111 Commits

Author SHA1 Message Date
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
Alexander Medvedev
705ecfe221 Allow to enter other dimensions
a bit broken though
2025-05-18 14:59:01 +02:00
Alexander Medvedev
1edbfa7289 Implement Piston 1/2
Not fully done
2025-05-12 19:42:55 +02:00
Alexander Medvedev
cb51228adb Add Noteblock support 2025-05-11 20:08:32 +02:00
Alexander Medvedev
575f17948f Inline format arguments
Looks much nicer and more readable
2025-05-10 15:22:06 +02:00
4lve
9e36cdf683 Full inventory refactor + barrels (#691)
* replace slot with ItemStackSeralizer

* Dismantle current inv logic

* Disassemble even more, items need fixing markd with TODO: Inv

* Player inventory methods implmented

* make some fields private

* remove invalid comment

* Partial screen handler and slot

* Add armorslot

* prepare for crafting

* implement some more crafting traits

* Fix ItemStack

* Fix pickup and remove faulty crafting (getting reworked in inv revamp)

* fix

* fix error

* add readme

* move readme file

* asd

* remove readme

* add uppsercase readme

* Some more work

* merge

* Move from generics to dynamics

* fix

* move to same impl

* Some changes

* add player open logic

* Basic impl of sync and listeners

* Why did mojang complicate it so much

* bruh

* Simplify things with DefaultScreenHandlerBehaviour

* Implement partial slot clicks

* add

* itemhashes are broken

* Start implementing packets

* fix deadlock

* new vanilla update

* Use static item refs and use Arc Mutex on invs

* working normal click

* fix deadlock

* implement sync handler

* small patch

* Implement quick_move

* Implement Swap click type

* pickup, update bug

* start fixing updates

* fix pickup desync

* Make Inventories non mutexes

* Implement some finishing stuff

* close screen on player leave

* fix pick item

* Move to item hashes

* remove some logs

* begin implementing barrels

* Begin implementing barrel

* implement barrels

* fix clippy + typos

* Fix merge conflicts

* Fix lint error

* don't use unwrap when getting equipment slot

* Fix typo and single threaded

* Accidentally removed tokio completley

* Fix crash when opening barrel holding item

* Add support for marking block entities dirty

* Player Equipment changes

* Make ScreenHandlerFactory own inventory instead of passing in optional

* remove log

* replace todo's

* fix clippy

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-05-09 16:28:15 +02:00
Laurent Stéphenne
afe42a5d15 Added basic function support for block's loot tables (#786)
* Added loot table function deserialisation

* Implemented basic loot table functions

* Split loot logic to another file

* Clippy

* Binomial
2025-05-06 17:14:28 +02:00
Laurent Stéphenne
172782a67e Correct placement for glass panes, iron bars and walls (#790)
* Glass panes

* Useless visibility changes

* Fences fix

* Added iron bars

* Moved horizontalfacing impl

* Implemented walls

* Clippy
2025-05-02 08:55:50 -10:00
Laurent Stéphenne
2c3c213a41 Chests placement and more waterlogging (#785)
* Chest placement works fully

* Rail waterlogging

* More waterlogging

* Clippy

* PR fix and fence bugfix
2025-05-01 09:26:35 -10:00
akashbeh
604d5bae2f Un-option item_name (#771)
* Remove option

* Removed todo line

---------

Co-authored-by: Akash Beh <akashsebastianbeh@gmail.com>
2025-04-26 20:32:10 -10: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
Alexander Medvedev
254982f745 Allow Up and Down direction for blocks
now we only calculate the direction if we need and also can calculate up and down which can be used for blocks like Observers or Pistons.
Fixes https://github.com/Pumpkin-MC/Pumpkin/issues/738
2025-04-14 17:02:09 +02:00
Alexander Medvedev
929388fc9d added more heightmaps
thanks to kralverde

Co-Authored-By: kralverde <80051564+kralverde@users.noreply.github.com>
2025-04-12 16:52:16 +02:00
akashbeh
77846fc7d0 Add food components to item (#711)
* Add food component to item

* Ran and fixed cargo --fmt check

---------

Co-authored-by: Akash Beh <akashsebastianbeh@gmail.com>
2025-04-11 15:52:04 +02:00