Commit Graph

40 Commits

Author SHA1 Message Date
Alexander Medvedev
fba4d405ac ci: add Windows Arm and macOS Intel 2025-12-09 19:29:57 +01:00
Alexander Medvedev
92fe87e921 smaller structure gen preparations 2025-12-08 20:52:03 +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
ae751f3a83 remove #[async_trait] from many many places
Compile time got improved by 77% (including last commit)
2025-12-04 13:57:03 +01:00
Alexander Medvedev
6f7006fcb9 improve block to_props 2025-11-27 18:44:14 +01:00
とぴ。(おーけ
2c26124a90 use const instead of static in some places (#1198) 2025-11-12 18:18:59 +01:00
unschlagbar
0bc7405f12 fix world y offset & bedrock update (#1121) 2025-08-30 09:27:03 +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
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
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
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
Alexander Medvedev
8fec1d56cd Improve compile time by a bit 2025-07-08 23:58: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
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
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
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
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
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
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
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
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
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
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
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