0
0
mirror of https://github.com/Pumpkin-MC/Pumpkin synced 2025-04-28 16:06:28 +00:00

53 Commits

Author SHA1 Message Date
a2d9396bbd parse protocol version
one thing less to care about when porting
2025-04-01 16:06:51 +02:00
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
7a5a35b3d8 fix biomes index 2025-03-29 20:59:16 +01:00
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
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
7164a471d4 Implement Farmland
some things are still missing
2025-03-23 15:13:23 +01:00
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
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
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
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
8aef30ee13 Make TNT Work (#590)
* make tnt work

* Spawn TNT at right position

* Fix tnt
2025-02-25 16:38:12 +01:00
995edfb3c2 Add Effects 2025-02-22 14:17:06 +01:00
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
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
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
8d2ca8e404 Density Function Re-Work (#525)
* add density function parser, re-write functionality, and add initial tests

* add more tests and fix typo

* re-work density interpolator

* re-work flat cache

* re-work the rest of the chunk specific density functions

* re-work fill functions

* tweak sample logic and do some refactoring

* convert chunk noise to use new density functions

* work on porting proto chunk

* port proto chunk

* add cell cache test

* fix wrapper functions

* remove test print

* update benchmark

* rework again

* rework again pt 2

* classic off by one

* reduce components on the stack by 60x

* aquifer tweaks

* add multi noise sampler for biome sampling
2025-02-10 22:24:08 +01:00
8592d095f3 Parse Items at Compile time 2025-02-08 19:23:59 +01:00
09d6eb6da2 Add damage types & damage command (#526) 2025-02-02 11:22:49 +01:00
ef497fb435 Refactor World Entity System
Also support Item drops (WIP)
2025-01-31 21:45:20 +01:00
7ec4cc7c2e Add Message types
aka chat types
2025-01-23 18:35:00 +01:00
57e54284c5 Translate when printing to console 2025-01-23 16:57:23 +01:00
709d222c23 add basic entity NBT storage 2025-01-19 19:30:32 +01:00
6415f697e5 parse Biome enum at compile time 2025-01-11 19:48:18 +01:00
aad1f91acb parse entity types at compile time 2025-01-11 17:59:36 +01:00
308c125a20 parse world events at compile time 2025-01-11 17:06:21 +01:00
03cb80b216 parse scoreboard display slot at compile time 2025-01-11 16:52:09 +01:00
621bc31f48 parse entity pose at compile time 2025-01-11 16:20:31 +01:00
c95b27eafb parse sound category at compile time 2025-01-11 16:11:51 +01:00
82386a57c4 parse game event at compile time 2025-01-11 15:54:26 +01:00
da268b548b parse ChunkStatus at compile time 2025-01-10 15:31:20 +01:00
03e81a1436 transfer packet id parsing to build time
This also allows now to create custom packets with a custom packet id which is not in the packets.json
2025-01-10 13:42:39 +01:00
29ed502aea extractor: extract entities 2024-12-26 22:10:12 +01:00
35afc0bfb9 Port to 1.21.4 2024-12-03 23:34:59 +01:00
796341be05 Extractor: minimize everything
- blocks.json 8.3MB -> 4.1MB
- items.json 988KB -> 548KB
- packets.json 6.9kb -> 4.2kb
- particles.json 3.5kb -> 1.6kb
- recipies.json 376kb -> 264kb
- screens.json 731b -> 315b
- sounds.json 72.2kb -> 42.2kb
- synced_registeries.json 143.3kb -> 87.6kb
- tags.json 335.4kb -> 165.8kb
2024-11-27 00:12:11 +01:00
402f3951f5 Move to own NBT crate (Mostly) (#100)
* Remove fastnbt as dependency

* Move to own NBT crate

* Added deserialization

Also replaced i8 bool's with bool's

* Use: fastnbt for pumpkin-world

Until i don't figure out why Arrays do not work, we can use fastnbt
2024-11-23 14:50:54 +01:00
a23ce773ad Extract block hardness in block extractor
Fix: https://github.com/Snowiiii/Pumpkin/issues/297
2024-11-17 22:40:32 +01:00
b01b276307 Optimize Item Extractor
Reduce JSON file size. All things we put in are already there as components
Replace item searching with a HashMap (which is faster)
2024-11-17 22:30:38 +01:00
230a99adc5 Fix: Extractor Packet build 2024-11-17 22:02:33 +01:00
4348b56fbe Fix packet side in extractor (#294)
* fix packet side
2024-11-17 19:51:46 +01:00
711e16528a Simplify Screens, Sounds and Particles Extractor
Particles: 6.6KB -> 3.5KB
Screens: 1.4KB -> 732B
Sounds: 118KB -> 72.2KB
2024-11-14 19:00:38 +01:00
ac31d1c83b Improve Packet Extractor
Optimize packets.json
- Reduce lines from 1394 -> 256
- Reduces File size 23KB-> 6.9KB
2024-11-14 18:52:47 +01:00
8767e66777 Add icon to windows binary (#257)
* Add icon for windows binary

* Add comment to FileDescription

FileDescription is handled as the Program name by Windows!
2024-11-12 19:51:25 +01:00
b91825f507 Extractor: Add Tags 2024-11-10 17:14:48 +01:00
df1d5fb580 Extractor: Export Recipes 2024-11-08 16:48:33 +01:00
c470f94bc3 Fix: https://github.com/Snowiiii/Pumpkin/issues/236 2024-11-06 20:50:52 +01:00
8f90b29cfe Extractor: Parse and use screens.json 2024-11-03 11:25:15 +01:00
9e7adec16b Parse Registries from JSON 2024-11-02 16:34:35 +01:00
460e9d3cae Add more informations about blocks
Also fixed light for transparent blocks
2024-11-01 11:01:25 +01:00
b17ade7b06 Add own Extractor (#201)
* Add custom extractor

* Add namespaces to blocks

* Fix: Errors
2024-10-27 12:21:55 +01:00
7de3e0e995 Improved pvp (#173)
* Added CSoundEffect packet

* Added sound macro

added a macro that turns sound namespaces to the sounds id

* added CEntitySoundEffect

* updated id to i32

* Added sound effects to pvp

* Added sweeping and particles

* Added I-Frames to living entity

* Refactored combat

split up the combat handling into multiple functions and a new combat module

* use new packet macro

* updated json files

* fixed attacking

* use builtin clamp
2024-10-24 17:49:23 +02:00