Commit Graph

61 Commits

Author SHA1 Message Date
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
vyPal
94dc37a275 Fix plugin macros (#553) 2025-02-15 12:02:00 +01:00
Alexander Medvedev
3d789f7450 Some Renames 2025-02-05 23:12:16 +01:00
Alexander Medvedev
1712e5f0ac Use bytes 1.10.0 and replace our try_get with their 2025-02-03 22:48:48 +01:00
suprohub
186e846858 Plugin event rewrite (#513)
* simplify all

* fmt

* Consider using derive macro

* Add new events

* Add events call

* minor fixes

* minor fixes

* fix

* optimize code

* big changes

* fix skill issue

* fix

* Consider not specify patch version

* make logger shared

* i want test one thing

* Add one useful function

* add little amouth of docs

* use config instead

* revert changes

* fmt

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-01 18:14:28 +01:00
Alexander Medvedev
deda78231a play sound on fall damage 2025-01-27 21:55:32 +01:00
Alexander Medvedev
aad1f91acb parse entity types at compile time 2025-01-11 17:59:36 +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
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
Alexander Medvedev
fa07af7308 shorten compile times
but only by a bit :c
2025-01-02 15:47:11 +01:00
kralverde
55e8cd696e Remove optimizations for dev builds (#404) 2024-12-21 12:54:23 +01:00
Snowiiii
f587cb6748 remove iter_tools
we only used them for collect_vec. I think its worth the "effort" to write Vec type annotations ourself and have one big crate with way too may features we don't need less
2024-12-12 23:40:52 +01:00
Snowiiii
d0d0f35a94 Some minor improvements 2024-12-08 23:59:52 +01:00
Snowiiii
b2f627d517 Use Entity teleport Packet instead of Player
Should make fixing https://github.com/Snowiiii/Pumpkin/issues/363 easier
2024-12-07 15:40:50 +01:00
kralverde
979877f048 "populate noise" step of chunk generation (#319)
* implement populate noise step of chunk generation

* fix gitignore

* pass thru seed

* add counter for edge case

* add entire chunk test case

* remove eclipse file

* remove packet timing

* precompute float divisions

* unsafe speed up

* slight aquifer optimization

* tweak block pos packing

* optimize perlin map

* precompute aquifer random positions

* fix aquifer regression

* refactor samplers, add tests to aquifer, and move chunk extractor to the extractors

* fix base density function error and add a bunch of test cases

* ignore expensive tests by default

* remove un-needed lifetimes

* remove minecraft prefix from block lookups

* fix populate noise bench

* slight optimizations

* read files at runtime to speed up test compilation speed and remove ignores

* remove new lines from test data so people stop freaking out about line count

* make extractor the same

* leverage branch prediction

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2024-12-02 19:01:37 +01:00
Alvsch
df25c1fceb Some Chunkloading fixes (#342)
* fixed cylindrical

* Fixed chunk loading when changing view distance
2024-11-27 18:37:14 +01:00
Alexander Medvedev
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
Commandcracker
76d05d0593 Upgrade thiserror (#304) 2024-11-17 19:50:39 +01:00
Snowiiii
9e7adec16b Parse Registries from JSON 2024-11-02 16:34:35 +01:00
Alvsch
3f2bbcc7f9 small CChunkData write improvement (#216)
* small CChunkData write improvement

* Reuse palette instead of palette_ids
2024-10-31 17:39:44 +01:00
lokka30
1c048a17cc Implement cross platform signal handling with tokio (#183)
* ctrlc: also handle `sigterm` and `sighup` via `termination` feature

This commit enables the `termination` feature in `ctrlc` so that
`sigterm` and `sighup` are also handled on UNIX systems. This in turn
improves Docker compatibility since containers now listen to the
`SIGTERM` signal it sends to containers when trying to stop the
container via `Ctrl-C` whilst attached.

* Replace `ctrlc` signal handling with `tokio`

This removes the `ctrlc` crate from the project, replacing (and upgrading) its functionality to also handle `sigterm` and `sighup`.

Sigterm handling is working on UNIX with this commit, I haven't tested Windows compatibility with `Ctrl-C` nor have I tested `sighup` or `sigint`.

Of course, compiles and runs on UNIX. Haven't tested Windows.

* fix: remove unused import; collapse if statement

* main: fix per-os signal handling

Will only compile Windows-specific/Unix-specific code when on their respective environments.

Handles signals in a separate tokio thread so it doesn't suspend the main thread.

Tested to work on UNIX (macOS) but not tested on Windows.

* main: cargo fmt

* main: fix setup_sighandler fn signature on windows

* main: attempt 2 at fixing windows sighandler

* main: enable ctrlc for all non-unix systems

Previously, ctrlc usage in tokio was only enabled on Windows systems
(since UNIX systems have their own signal handling in Pumpkin). Instead
of limiting ctrlc to just Windows, we can make it run on any non-UNIX
system since it should be platform independent anyhow.
2024-10-27 16:29:59 +01:00
Snowiiii
b23b7421cf Revert "CChunkData optimizations (#193)"
This reverts commit a1b97730bd.

Due to Errors
```
thread 'tokio-runtime-worker' panicked at pumpkin-protocol/src/client/play/c_chunk_data.rs:84:25:
index out of bounds: the len is 4096 but the index is 25374
```
2024-10-27 12:29:53 +01:00
Alvsch
a1b97730bd CChunkData optimizations (#193)
* optimized CChunkData::write

* Added a profiling profile

* fix CI
2024-10-27 00:15:01 +02:00
kralverde
c15232929f reduce client id to u16 (#172) 2024-10-25 22:37:11 +02:00
Snowiiii
b8b4a8ce8d Make CommandSender not mut 2024-10-22 14:02:49 +02:00
Snowiiii
790adbc0b3 Merge branch 'master' of https://github.com/Snowiiii/Pumpkin 2024-10-22 11:29:32 +02:00
kralverde
43116c54e9 fix tick system (#169)
* fix tick system

* also async wait on stdin
2024-10-22 11:27:40 +02:00
Snowiiii
287f466ae1 More workspace dependencies 2024-10-21 19:36:42 +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
3ca472c2ba Remove: pumpkin-plugin
We will focus on other things by now. And extism just slows down compile and indexing times extremly
2024-10-14 17:58:19 +02:00
Snowiiii
df80ac2837 Add abstraction to support multiple world formats 2024-10-14 15:57:37 +02:00
lukas0008
a30dbde50b Merge pull request #101 from Snowiiii/block-macro
Add `block_id!` macro
2024-09-19 17:31:30 +02:00
StripedMonkey
229be05e98 run formatter on cargo.toml files 2024-09-19 03:10:26 -04:00
lukas0008
cf62babfe4 Make itertools a workspace dependency 2024-09-18 16:59:12 +02:00
Asurar0
c6043189d3 Improved synchronization primitives
- Replaced all `std::sync::Mutex` by `parking_lot::Mutex` and refactored implementation accordingly
- Replaced all `Mutex<T> where T: Copy` by `crossbeam::AtomicCell<T>` and refactored implementation accordingly
2024-09-11 22:39:53 +02:00
lukas0008
f3728a169a Make a way to disable extism
- Made a `plugins` feature in `pumpkin-plugin`
- Made a `plugins` feature in `pumpkin`, which enables the `plugins` feature in `pumpkin-plugin`
- Made the feature default
2024-09-07 21:01:05 +02:00
Alexander Medvedev
dad4798844 Update deps 2024-09-06 11:34:59 +01:00
we sell insurance
047f5a4efc Merge branch 'master' of https://github.com/Snowiiii/Pumpkin into event-api
Resolve merge conflicts
2024-09-01 12:31:09 -05:00
we sell insurance
0a02c28b26 Move serde into workspace 2024-09-01 12:26:48 -05:00
DaniD3v
070a50833b Moved config into its own crate 2024-08-31 19:38:47 +02:00
lukas0008
5f05a1886b Change coordinates, and add .get_block to ChunkBlocks
- Renamed ChunkRelativeScalar to ChunkRelativeOffset
- Added more traits to Height and ChunkRelativeOffset
- Added .get_block to ChunkBlocks
2024-08-30 15:07:54 +02:00
Snowiiii
3b438872a8 Add pumpkin-plugin
mhh, Whats that?
2024-08-27 22:47:21 +02:00
lukas0008
8eb894ef13 Create pumpkin-core, and move pumpkin-text 2024-08-21 16:12:09 +02:00
Luk-ESC
8263d886ce move uuid to workspace 2024-08-21 12:31:12 +02:00
Luk-ESC
a2828a8ac0 add required feature to tokio 2024-08-21 12:29:59 +02:00
lukas0008
ade661d5b8 Add dhat and rayon
- Set up dhat, when dhat-heap feature, the dhap memory profiler will run. Due to this tokio needs to be manually built.
- Rayon now explicitly built outside of tokio runtime.
2024-08-13 23:25:11 +02:00
lidar
fd8897ce1d Add release profile optimiztion 2024-08-11 11:59:57 +09:00
Snowiiii
50dcbfeb6d Add inventory support 2024-08-09 22:38:00 +02:00
Snowiiii
f122b47e50 Create pumpkin-text 2024-08-09 10:41:10 +02:00