Commit Graph

1008 Commits

Author SHA1 Message Date
Alexander Medvedev
da268b548b parse ChunkStatus at compile time 2025-01-10 15:31:20 +01:00
Alexander Medvedev
7b205fe108 remove build from gitignore 2025-01-10 14:57:06 +01:00
Alexander Medvedev
45a591b27b parse Sounds into enum at compile time 2025-01-10 14:47:34 +01:00
Alexander Medvedev
c711d1511c parse Particle into enum at compile time 2025-01-10 14:39:25 +01:00
Alexander Medvedev
1208e67f36 parse screen into enum at compile time 2025-01-10 14:31:43 +01:00
Alexander Medvedev
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
we sell insurance
7885da726f Fix players timing out after a command executes for a while (#460)
* Fix players not being removed from world on timeout

* Spawn new task for each command
Undo bandaid fix

* Fix cargo fmt

* Move console commands and RCON commands into seperate tokio task
2025-01-10 10:51:02 +01:00
Alexander Medvedev
996497259e fix rust 1.84 clippy warns 2025-01-09 19:51:06 +01:00
Alexander Medvedev
fcc3aaefe4 entity: spawn with random yaw 2025-01-09 14:29:42 +01:00
Alexander Medvedev
debb713f3b ai: don't follow invulnerable
Prevents to follow invulnerable players (e.g. Gamemode Creative or Spectator)
2025-01-09 14:05:31 +01:00
Alexander Medvedev
ee485056fb rename pumpkin-core to pumpkin-util
I see that there is an confusion between the pumpkin-core crate,  People often think that this is the most important one
2025-01-09 13:12:57 +01:00
suprohub
4494432595 use Subchunks instead of ChunkBlocks (#458)
* first not error version, but crashibg

* small fix for not crashing

* fmt & clippy

* docs

* Update mod.rs

* Update mod.rs

* Update mod.rs

* Update mod.rs

* Update mod.rs

* Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

* fixes

* fmt

* fixes

* fix: anvil

also improve `array_iter` function

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-01-09 12:14:12 +01:00
Matin Mohammadi
9cfbb323a3 Fix misspelled word "probably" (#468) 2025-01-08 16:06:07 +01:00
Alexander Medvedev
7775f119ed fix: clippy 2025-01-08 12:51:16 +01:00
Cash
a312f59dd1 feat: support receiving player_loaded packet (#466)
* feat: support receiving player_loaded packet

* fix: clippy
2025-01-08 12:39:53 +01:00
Alexander Medvedev
fda0b1d96a create level.dat when not existent 2025-01-08 12:34:50 +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
87215765e7 Align entity position when spawned
Fixes: https://github.com/Pumpkin-MC/Pumpkin/issues/456.
This also fixes the issue that the spawned position is wrong and does not match the saved one
2025-01-07 10:36:10 +01:00
Tomer
f80cdf6c95 Add a proper error message for a non-existent command (#463)
* Add check for command not existing

* Make linter stop complaining
2025-01-06 23:19:51 +01:00
Alexander Medvedev
e15b2e06ae Add Path finding (#459)
* add initial path finding

* Make everything work

:D
2025-01-06 11:41:05 +01:00
RealVaprant
6a34f6cc6c Made getting players by name case-insensitive (#457) 2025-01-05 20:26:49 +01:00
Alexander Medvedev
3bb30c4413 fix: Alias command names
was broken in 2d136b1c24 (diff-f79fb5d460a0d374c892732876dd40efaced4a118291a777519d3965fe904195)
2025-01-05 09:31:34 +01:00
Alexander Medvedev
f2cfad06bd Add Entity AI 2025-01-04 18:37:59 +01:00
Noah
0fbc730818 fix listening to RUST_LOG (#448)
Per the logger documentation:

> Enables the user to choose log level by setting RUST_LOG=<level> environment variable. This will use the default level set by with_level if RUST_LOG is not set or can't be parsed as a standard log level.
> This must be called after with_level. If called before with_level, it will have no effect.

Personally, I feel that using a config file, which defaults to *false* to configure whether or not to listen to the environment for enabling and disabling logging is a bit dumb. Usually environment variables are meant to allow you to modify the configuration of a program for one "environment", not necessarily permanently. Especially when you get more complicated environment filtering.

Additionally, I'd like to use this as a springboard to advocate for a few things, primarily introducing the idea of migrating away from `log` to `tracing`, as there's a lot more that can be done with regards to performance testing.
2025-01-03 12:35:28 +01:00
Alexander Medvedev
2a935d0025 Update PR template 2025-01-03 12:31:48 +01:00
Alexander Medvedev
d5174a2d31 Delete issues/config.yml 2025-01-03 10:20:39 +01:00
Alexander Medvedev
ad39b28d6d move some config things into networking 2025-01-02 22:42:56 +01:00
Alexander Medvedev
2767eff91a fix: clippy 2025-01-02 15:49:35 +01:00
Alexander Medvedev
fa07af7308 shorten compile times
but only by a bit :c
2025-01-02 15:47:11 +01:00
smuu
4bfbff7c88 feat: add deop command and refactor op command (#440)
* fix: command permission handling

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* fix: formatting

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* feat: add deop command

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* refactor: op command

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* fix: fmt and clippy

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* fix: merge conflict

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* fix: cargo fmt

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

---------

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>
2025-01-01 22:49:04 +01:00
Alexander Medvedev
c95345f1bd Update year in license 2025-01-01 13:05:17 +01:00
Nico Göbel
72a9670ba9 Changed bossbar title to TextComponent instead of String (#435)
* Changed bossbar title to TextComponent instead of String

* Clippy and fmt
2024-12-30 22:30:12 +01:00
kedor
9d770e9fb6 add the missing Acknowledge Block Change packet on interact (#434)
* add the missing Acknowledge Block Change packet when the player break a block

* move it down the match to be call everytime
2024-12-30 18:27:24 +01:00
Alexander Medvedev
a9a7dcc6b0 Update README.md 2024-12-30 16:39:00 +01:00
Alexander Medvedev
f772d971f6 Remove lifetime from TextComponent 2024-12-30 13:10:02 +01:00
Kris
6f7433ee68 Added Spawn Egg Functionality (#350)
* Added spawn egg functionality

* Readd changes from before merge

* Added basic attacks on mobs

* Fixed spawn rotation and position

* Updated entities.json

* Fixed entity registry

* Added correct bounding boxes per entity

* Various fixes

* use right data types in entity registry

* fix: clippy

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2024-12-29 22:52:12 +01:00
Adel C
02cec5873b Add Pick block (Middle Mouse Click) (#418)
* Pick Item Changes

* Changed some logging

* Pick Item working for hotbar slots

* Basic functionality, changes needed to adhere to expected minecraft behaviour

* Clean up code

* Added todo for pick from entity

* Added item swapping

* Swapping and cleanup

* Fix for rebase

* Remove unused function

* Bugfix

* remove todo

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2024-12-29 19:04:57 +01:00
Alexander Medvedev
b40c274445 extractor moved to: https://github.com/Pumpkin-MC/Extractor 2024-12-29 18:15:39 +01:00
DataModel
f4de9e41c8 kick for self-attacking (#430)
* fix(combat): kick for self-attacking

* chore(combat): fix the duplication of the word client

* chore(pumpkin/src/net/packet/play.rs#Player/handle_interact): remove useless parens

* fix(combat): compare entity IDs, not actual objects

* chore(pumpkin/src/net/packet/play): `cargo fmt`
2024-12-29 17:19:14 +01:00
smuu
2d136b1c24 fix: command permission message (#428)
* fix: command permission handling

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* fix: formatting

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

---------

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>
2024-12-29 16:43:25 +01:00
Alexander Medvedev
c5c7e897cb Update website and repo links 2024-12-29 12:40:22 +01:00
Kris
ad2fd3c9a5 Added chest opening and closing animation (#421)
* Added basic chest opening and closing

* Added number tracking

* Added play chest action function
2024-12-28 18:02:32 +01:00
Kris
205191b194 Added default op level (#426) 2024-12-28 17:46:25 +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
Kris
c521ef8bb0 Correct Interactive Block Behavior (#388)
* Added chest and furnace

* Corrected interactive block functionality

* Fixed merge

* Added standard functions and player remove on destroy

* Added unique block standard functions

* Fix clippy

* Fix deadlock in standard function
2024-12-27 16:24:23 +01:00
Alexander Medvedev
98d1406646 Implement session.lock
Lock session.lock so other processes know that we currently read and write to the level. This is vanilla behavior.

Test:
Tested to start the a new server while on was locking the file, and got `Failed to lock level: AlreadyLocked("session.lock")` as expected
2024-12-27 16:04:40 +01:00
LieOnLion
37372986b0 Fixed Pumpkin website links (#423) 2024-12-27 13:18:43 +01:00
Alexander Medvedev
af54cb4289 fix: clippy fmt 2024-12-27 13:15:45 +01:00
Alexander Medvedev
7161491005 add some simple test to our nbt crate 2024-12-27 00:27:24 +01:00
urisinger
25f4834236 Remove unnecessary lifetimes in CommandDispatcher and Command (#419)
* make command dispatcher use owned strings and not take any lifetimes

* remove get_argument_consumer

* fix clippy

* fix elided lifetimes
2024-12-26 23:15:13 +01:00