Commit Graph

72 Commits

Author SHA1 Message Date
Alexander Medvedev
995edfb3c2 Add Effects 2025-02-22 14:17:06 +01:00
Toyo
2af2fbbf73 README: Add more to the To-Do (#569)
* Add more to the To-Do

Added biomes, vegetation, player data saving, off hand, advancements, villagers and mobs inventory as objectives in the to-do

* Remove stack limits from the to-do
2025-02-21 09:42:40 +01:00
Alexander Medvedev
2e2fe83720 Add Hunger 2025-02-07 00:22:52 +01:00
Mili
12866bce36 feat: add linear chunk format (#494)
* feat: add linear chunk format with zstd lib dependency

* fixing a typo

* refactor: rename file handling methods for clarity and more lint fixes

* refactor: improve clarity on validation methods

* fix: invert version check in LinearFile header validation

* fix: remove leading dot from file path formatting in LinearChunkFormat

* refactor: improve error handling and method naming in LinearFile operations

* fix: ensure file is flushed after writing in LinearFile operations

* fix: lints and warnings

* fix: more lints

* refactor: streamline LinearFile structure and improve header management

* refactor: change chunks_headers to use Box for improved memory management and use exception to know if file exist

* refactor: update path parameter types to PathBuf for consistency and improved usability

* refactor: update path parameter types to Path avoiding uknown changes and adjust file truncation logic

* fix: avoid using the same path for different tests

* fix: fix some bytes sizes for the header based on the spec

* refactor: enable file truncation when opening for writing and simplify save method

* fix: removing IoSlices for windows issues.

* fix: clippy lints

* refactor: improve incompatible files cheking, some documentation and variable nameing

* feat: add file_format to ChunkConfig and implement format handling in Level

* feat: add error logging for invalid file headers and data size checks in LinearFile and tmp filenames on write

* feat: implement file locking mechanism for concurrent chunk read/write operations

* fix: bug at desserializing the chunks headers.

* Refactor chunk file locking mechanism to use DashMap for improved concurrency and simplify read/write guard management

* docs: Update documentation for LinearVersion enum with format references

* re-check workflows

* re-check lints 2

* rename config values

* Some doc improvements

---------

Co-authored-by: Mili <santiagoogle@hotmail.com>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-05 22:28:20 +01:00
Alexander Medvedev
484009bb9e Fixed Some typos 2025-02-02 15:12:34 +01:00
Alexander Medvedev
fefcb78e56 Fix reading from invalid level.data
Also use Spawn x and z now !
2025-01-30 15:13:56 +01:00
vyPal
a0ae1ae515 add Plugin system (#339)
* Add pumpkin-api crate for API definitions

* Add proc-macro definitions for pumpkin-api

* Add pumpkin-api and pumpkin-api-macros to workspace

* Add basic PluginManager implementation plugin loading

* Update .gitignore to include specific plugin file types

* Add example plugin

* Cargo fmt

* Fix clippy issues

* Refactoring to prevent a circular import

* Add base impl for plugin hooks

* Move plugin manager to server

* Make metadata have static lifetime

* Add default implementations to events

* Add hooks to proc macro

* Update example

* Fix formatting

* Fix clippy warnings

* Load metadata from Cargo.toml

* Mark plugins as an implemented feature :D

* Implement new event handling

* Create a static global reference to the plugin manager

* Emit player join and leave events

* Update macro generation

* Update example

* Fix formatting

* Fix clippy issue

* Simplify event handling

* Add plugin command to list plugins

* Make handlers async

* Update macros

* Update example

* Fix formatting and clippy issues

* Better styling on plugins command

* Fix clippy issues

* Cargo fmt

* Disable doctest for lib target on pumpkin crate

* New API for plugins

* Update api macros

* Update plugin example

* A bit of clean up

* Some QoL (and performance) improvements

* Cargo fmt and clippy fixes

* refactoring, better event handling, new context functions

* Async on_load and on_unload

* Fix mutex lock never going out of scope

* Async plugin loading

* Add plugin management command

* Fix clippy issues

* Fix import issues

* Move TcpConnection out of client

* Move packet encoding out of client

* Allow plugins to register commands

* Fix fmt and clippy

* Implement plugin list in query

* Make arguments public so that plugins can use them

* Update proc_macros to handle runtime

* Make tree_builder public for use in plugins

* Make FindArg trait public for use in plugins

* Update example plugin

* Fix merge related issues

* Fix cargo fmt

* Post-merge fixes (also 69th commit, nice)

* New event system

* cargo fmt

* Impl block break event

* cargo fmt and clippy

* Reduced plugin size

* Reduce dependency count

* Old code cleanup

* cargo fmt

* Add event priority and blocking options to event registration and handling

* Refactor event handling to support blocking execution and improve event registration

* Fix post-merge errors

* Update example plugin

* increase mpsc channel capacity and handle write errors gracefully

* Use Arc<Player> instead of &Player

* add missing import

* Update example plugin with playing sounds

* Remove example plugin

* Create plugins dir if doesnt exist

* Remove unused vars

* Remove unnecessary clones

* Fix impl

* cargo fmt

* Make server pub in context
2025-01-24 17:26:09 +01:00
Alexander Medvedev
23dbb72bbe rename WorldPosition 2025-01-12 16:45:22 +01:00
Alexander Medvedev
495de3db16 add Anvil Chunk saving (#401)
* anvil saving foundation

* fix: clippy warns

* write chunk header

* write x_pos and z_pos

* cargo: fmt

* maybe improve something, maybe made something worse

* Make anvil work (#465)

* refactored stuff into chaos

* now we got sinkholes

* Reimplemented the whole write logic we now have wierd chunks but the data is mostly correct

* Fixed long overflow

* Fix fmt and clippy

* Added unit test to check anvil saving

* Fix fmt

* Fixed useless clone

* Removed unnecessary unwraps and added timestamp table

* Removed fs2 dependency

* Fix stop deadlock

---------

Co-authored-by: Alvsch <94403567+Alvsch@users.noreply.github.com>

* Update README.md

---------

Co-authored-by: Nico Göbel <147538729+leobeg@users.noreply.github.com>
Co-authored-by: Alvsch <94403567+Alvsch@users.noreply.github.com>
2025-01-07 17:07:35 +01:00
Alexander Medvedev
f2cfad06bd Add Entity AI 2025-01-04 18:37:59 +01:00
Alexander Medvedev
a9a7dcc6b0 Update README.md 2024-12-30 16:39:00 +01:00
Alexander Medvedev
c5c7e897cb Update website and repo links 2024-12-29 12:40:22 +01:00
Kyle Davis
6a5add8de5 Added native operator permission management (#348)
* Starting work on Operator permission system

This commit adds the ops.json configuration found in vanilla
servers, and updates the basic configuration to handle the default
permission level.

Server now uses ops file and defaults players to op level 0

The /op command has been added but needs players to rejoin for now.

* Clippy Fix + need to Rejoin after /op removed

I found the source of the DeadLock. Updated set permission function.

Fix cargo formatting issues and clippy issues.

* Remove temp warn message

* Move OperatorConfig to server

As Snowiii pointed out, OperatorConfig is runtime data.

Revert most changes in pumpkin-config.

op_permission_level must say in the basic configuration for
parity with Minecraft.

* cargo fmt + cargo clippy

* Sync permission change with client

* Fixs issues @Commandcracker found in review

- Move PermissionLvl to core and removed OpLevel
- Move ops.json to /data/ops.json
- Fix permissions issue with /op command
- Shorten /op command description

* refactor into `data` folder

* create data dir when needed

* add to readme

* fix: conflicts

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2024-12-27 17:22:19 +01:00
LieOnLion
37372986b0 Fixed Pumpkin website links (#423) 2024-12-27 13:18:43 +01:00
Snowiiii
35afc0bfb9 Port to 1.21.4 2024-12-03 23:34:59 +01:00
Commandcracker
0cc693e4b2 Add Server Links (#307)
* Add Server Links

* Use config phase

---------
2024-11-26 21:28:59 +01:00
Snowiiii
9491aedfc6 README: Added World time 2024-11-26 19:08:40 +01:00
Snowiiii
216235d706 README: Add Bossbar 2024-11-26 18:36:41 +01:00
Commandcracker
e43e9f4575 Add Cookies (#325)
* COKKIES PROTOCOL

* Update pumpkin-protocol/src/client/config/c_store_cookie.rs

Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>

* Update pumpkin-protocol/src/server/config/s_cookie_response.rs

Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>

* Update pumpkin-protocol/src/server/play/s_cookie_response.rs

Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>

* Add read fn

* Finished

* Add to readme

* remove async

* use payload.len()

* fix payload_length

* fix all

---------

Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>
2024-11-25 23:15:02 +01:00
Snowiiii
c470f94bc3 Fix: https://github.com/Snowiiii/Pumpkin/issues/236 2024-11-06 20:50:52 +01:00
we sell insurance
93c6da993f Implement Query protocol (#218)
* Add query options to config
Added packet data types
Correctly parse a handshake packet
Add tokio to pumpkin protocol for `AsyncReadExt` convenience functions

* Add repr(u8) so that PacketType is a byte

* Respond to handshake correctly

* Allow for proper decoding of status packets and properly handle errors in decoding

* Implement challange tokens and verify with token and address

* Encode Basic status packet
Switch to CString since its better to and null errors higher up the code

* Encode Full status packet

* Add forgotten fields to full status packet

* Correctly respond to query clients when requesting full status

* Return actual address and port of server
Respect config options
Remove uncessary debug derives

* Remove packet type as it is redundant/unnecssary

* Implement basic status request
Refactor code for better error handling

* Update README

* Show players correctly in full status packet

* Store all packets in structs instead of enums
Break up en/decoding for each packet
Reduce client tracking
Get rid of QueryClients struct
Stop storing of magic value and check during decoding
Added tests for all decoding and encoding
Fix all sugestions from @StripedMonkey
2024-11-05 20:07:31 +01:00
Snowiiii
1f8385e890 Add Serverbound Player Input 2024-11-04 22:02:14 +01:00
Snowiiii
21dd9c194c Split PacketError into 2 Structs
Much nicer now
2024-11-01 10:26:07 +01:00
Snowiiii
a6f3b3f748 Clientbound Packets: use ids from JSON 2024-10-27 14:18:18 +01:00
Snowiiii
6fb751accf Update to 1.21.3 2024-10-23 19:41:08 +02:00
Alexander Medvedev
e396399e66 Port to 1.21.2 (#171)
* Update JSON Files to 1.21.2

* Update constants to 1.21.2

* Port c_login_success to 1.21.2

* Fix: damage type

* Overhaul Packet ID system

We now use Packet IDS from enums.

1. This is very very nice for seeing which Packets are already implemented and which not.
2. This lets us easly port to newer Minecraft version, In vanilla there are no Packet ids hardcoded, Packet IDs will be parsed from a enum like this

* Port all Packets to 1.20.2

* Update README badge to 1.20.2

* Change doc for the new packet id system
2024-10-23 14:31:23 +02:00
Snowiiii
c3dcec2dde docs: Add lighting 2024-10-19 20:34:28 +02:00
Snowiiii
2945a6542e Fix: Gamemode messages
Do not send them to target, send them to sender
2024-10-19 10:57:11 +02:00
Snowiiii
9802fdfb4e docs: Velocity works 2024-10-17 00:42:10 +02:00
Snowiiii
15832078af Add: Bungeecord support 2024-10-16 21:51:09 +02:00
Snowiiii
05bcde494e docs: Add RCON
also more grammer fixes
2024-10-16 11:40:29 +02:00
Snowiiii
5de4b808f0 Remove: World Generation from README
I see people thinking Pumpkin does not have Chunk generation when they see that. What i actually meant was that there is no world folder structure saved. Pumpkin has Chunk generation
2024-10-16 09:09:39 +02:00
Snowiiii
e7afc23427 docs: fix some grammer issues 2024-10-15 19:34:40 +02:00
Snowiiii
47f149d154 Support custom authentication servers 2024-10-13 12:15:16 +02:00
David Rush
7505b09a54 Update README.md 2024-10-12 10:47:38 -05:00
Snowiiii
d8220bf49b docs: Overhaul 2024-10-12 17:39:43 +02:00
paul
ac4223f89b expose docker container port 2024-10-08 19:24:33 +02:00
Snowiiii
39b4cb3ac9 Move world into entity
Also fixes most of error when leaving while chunks are loading
2024-09-07 22:39:42 +02:00
Snowiiii
443febefdb Update README.md 2024-08-28 19:04:31 +02:00
Alexander Medvedev
8e9ea66787 README: Change run command
I still like to use target-cpu=native. The problem is that there is no cross platform way to the the env var RUSTFLAGS. I also don't want to have a script for that
2024-08-27 16:17:59 +01:00
Erb3
e6e63c6c1e docs: simple docker instructions 2024-08-21 18:01:25 +02:00
Erb3
09ce32ab45 docs: run formatter 2024-08-20 17:50:28 +02:00
Kolibroid
1a21290e0f Fix some minor typos 2024-08-19 17:52:04 +01:00
Snowiiii
bf92fe22a0 Add Particles 2024-08-16 12:45:58 +02:00
Snowiiii
231bdb5614 World: Add GZip compression 2024-08-16 11:10:16 +02:00
Snowiiii
ceb718d475 Setup Base for Velocity (Proxy) 2024-08-15 15:00:41 +02:00
Snowiiii
333bf64235 README: Add use local CPU features when running 2024-08-15 13:40:34 +02:00
Alexander Medvedev
dbe588576d Update README.md 2024-08-15 08:45:03 +02:00
Alexander Medvedev
f79860aae4 Update README.md 2024-08-14 23:17:46 +02:00
Alexander Medvedev
ccd915a459 README: Add image 2024-08-13 13:31:43 +02:00