Commit Graph

84 Commits

Author SHA1 Message Date
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
Alexander Medvedev
4bccba7b20 fix some typos
- also moved tempfile dep to dev-dependencies
- removed the noise crate
- renamed some things
2025-04-10 21:21:43 +02: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
kralverde
91ef79325a Network Serialization Quality of Life and Safety Improvements (#701) 2025-04-07 07:59:00 -10:00
Alexander Medvedev
67f26cf9bd fix 1.21.5 item and entity hover 2025-04-06 14:07:17 +02:00
teknostom
08ed44e7bc Implement Flowing Fluids (#643)
* Water flow downwards

* working impl falling

* remove unused code

* format

* finish up default implementations

* Full water physics

* merge from master

* More like vanilla

* Deterministic fluid sim

* Fix warning

* fix clippy

* fix fmt

* Add lava support

* move fluids to block

* fmt fix

* add neighbor updates

* fix clippy

* Fix Dissapearing fluids

* Fix air spread and add static water updates

* fix lint

* fixes

* fmt
2025-04-05 11:54:40 +02:00
Alexander Medvedev
dda7cac329 Save/Read and broadcast biomes (#678)
* send biomes in packet

* fix single pallet

* complete logical palette container

* refactor codecs

* palette work

* palette work

* fix palettes

* clean up palette logic

* better handling of chunk loading channel errors

* fix encompassing bits

* fix network serialization

* fix typos

---------

Co-authored-by: kralverde <github@email.kralverde.dev>
2025-04-03 19:06:40 +02:00
Alexander Medvedev
a2d9396bbd parse protocol version
one thing less to care about when porting
2025-04-01 16:06:51 +02:00
Andrew Neeley
a63b49a095 add Secure Chat (#656)
* Add secure chat configuration option

* Add secure chat bool to login packet

* change name of config flag

* add packet deserializer for player session packet

* make session update async

* Change config option

* Formatting

* Add chat configuration option

* Basic custom chat formatting

* formatting

* Add chat session to Player

* fix duplicate imports

* Formatting

* chat validation mostly working

* add registry for custom raw message

* chat formatting working with secure chat

* don't share session tokens if reporting blocked

* add received message index

* add custom registry without modifying asset files

* resolve color decorator before MESSAGE so player can't inject color codes by default

* move comment

* update all player sessions on join

* better previous message handling

* fix multiplayer bugs

* send new players existing signatures

* clean stuff up

* only send ChatSession if reports are enabled

* make clippy happy
2025-03-30 21:31:55 +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
4lve
eb587c9753 add Partial Redstone functionality (#621)
* Add scheduled block ticks

* Fix typos

* fix scheduled block ticks

* Default to empty vec

* Proper Block Updates

* Basic redstone works LFG!

* add buttons and lamps

* observers

* Only send update packet at end of tick

* hmm

* Start implementing MCHPRS

* redstone connections done

* visual state done

* Begin implementing multi_block_update

* Redstone works partially

* Fix typos

* Think I know what caused the client side desync

* Fix clippy

* Change fluid tick type

* Something is broken

* Don't use RWLock for block_ticks

* fix delay not decrementing

* Remove server from scheduled block ticks

* Fix redstone bug

* fix hardpower

* Fix tick lag

* Fix comperators

* Don't loop every tick

* Fix panic

* Fix redstone not powering block below

* make redstone_wire emit hard power

* Add target block

* fix clippy

* Merge

* merge

* add redstone torches

* Fix tick piorities

* default to air

* fix doors

* Update README.md

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-03-21 15:37:19 +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
Epix
93510eecd5 Grammar fixes, terminology change (#633)
* Major grammar sweep

* Remove extra backtick

* Use more specific terminology for chunk data storage

* Forgor to cargofmt

* Fix typo "thier"

* Fix typo "clousures"

* Try new terminology

* Forgor to cargofmt

* Use "Subchunks" instead of "Heterogeneous" for ChunkBlocks variant

* Fix variable name

* Forgor to change comment
2025-03-16 10:40:17 +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
081bdbbbaa Added Stop Command 2025-03-05 23:06:33 +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
cccdf53e7c Add Multi noise (#597)
* Copy @urisinger work

* Fix compile time errors

* fix clippy
2025-03-04 10:07:06 +01:00
kralverde
d518732a76 Fix dupe, double click, and shift click (re-PR) (#591)
* Fix dupe, doubble click and shift click

* Fix inventory desync

* Fix clippy

* refactor magic numbers

* fix clippy

* refactor item logic

* fix inventory

* prefer main inventory over offhand

* Set slot stack to None if empty

* fix container deadlock

* fix linter

* fix lint pt 2

---------

Co-authored-by: 4lve <72332750+4lve@users.noreply.github.com>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-03-01 08:09:14 -10: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
Alexander Medvedev
1fb2be46d4 Update to Rust edition 2024 2025-02-20 18:42:20 +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
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