Commit graph

834 commits

Author SHA1 Message Date
Ubuntu
2fc768612e change wording in a comment 2023-02-10 02:09:46 +00:00
Ubuntu
ef91f436c0 change one of the blocks examples 2023-02-10 02:06:41 +00:00
Ubuntu
9d4f738d4e make blockstate good 2023-02-10 01:56:45 +00:00
Charles Johnson
48b2a37aa0
derive Debug for BlockState (#64)
* derive `Debug` for `BlockState`

* change default Debug for BlockState

---------

Co-authored-by: Ubuntu <github@matdoes.dev>
2023-02-09 11:18:56 -06:00
EightFactorial
c23fae6e5d
Add KeepAliveEvent and Fix Error Messages (#65)
* Add KeepAliveEvent

* Fix error messages

* Panic instead of log error

* Do not panic on closed connections

* change some wording and fixes

* fmt

---------

Co-authored-by: Ubuntu <github@matdoes.dev>
2023-02-08 12:05:14 -06:00
Ubuntu
aa886c101b move az_world::entity_info to az_world::entities::info 2023-02-07 20:30:53 +00:00
Ubuntu
d51b2a29b2 fix some swarm examples/docs 2023-02-06 19:15:41 +00:00
mat
cbcf1d5e54 shut up clippy 2023-02-05 14:52:25 -06:00
mat
0d3a091c23 improve docs 2023-02-05 14:31:52 -06:00
mat
a72b768397 reword readme a bit 2023-02-04 19:42:38 -06:00
mat
5d4d29f116 move 'bot' into its own example (actually) 2023-02-04 19:38:46 -06:00
mat
2db9e1c098 move 'bot' into its own example 2023-02-04 19:38:33 -06:00
mat
cc345d2c0a make task_pool mod public 2023-02-04 19:34:24 -06:00
mat
a5672815cc
Use an ECS (#52)
* add EntityData::kind

* start making metadata use hecs

* make entity codegen generate ecs stuff

* fix registry codegen

* get rid of worldhaver

it's not even used

* add bevy_ecs to deps

* rename Component to FormattedText

also start making the metadata use bevy_ecs but bevy_ecs doesn't let you query on Bundles so it's annoying

* generate metadata.rs correctly for bevy_ecs

* start switching more entity stuff to use ecs

* more ecs stuff for entity storage

* ok well it compiles but

it definitely doesn't work

* random fixes

* change a bunch of entity things to use the components

* some ecs stuff in az-client

* packet handler uses the ecs now

and other fun changes

i still need to make ticking use the ecs but that's tricker, i'm considering using bevy_ecs systems for those

bevy_ecs systems can't be async but the only async things in ticking is just sending packets which can just be done as a tokio task so that's not a big deal

* start converting some functions in az-client into systems

committing because i'm about to try something that might go horribly wrong

* start splitting client

i'm probably gonna change it so azalea entity ids are separate from minecraft entity ids next (so stuff like player ids can be consistent and we don't have to wait for the login packet)

* separate minecraft entity ids from azalea entity ids + more ecs stuff

i guess i'm using bevy_app now too huh
it's necessary for plugins and it lets us control the tick rate anyways so it's fine i think

i'm still not 100% sure how packet handling that interacts with the world will work, but i think if i can sneak the ecs world into there it'll be fine. Can't put packet handling in the schedule because that'd make it tick-bound, which it's not (technically it'd still work but it'd be wrong and anticheats might realize).

* packet handling

now it runs the schedule only when we get a tick or packet 😄

also i systemified some more functions and did other random fixes so az-world and az-physics compile

making azalea-client use the ecs is almost done! all the hard parts are done now i hope, i just have to finish writing all the code so it actually works

* start figuring out how functions in Client will work

generally just lifetimes being annoying but i think i can get it all to work

* make writing packets work synchronously*

* huh az-client compiles

* start fixing stuff

* start fixing some packets

* make packet handler work

i still haven't actually tested any of this yet lol but in theory it should all work

i'll probably either actually test az-client and fix all the remaining issues or update the azalea crate next

ok also one thing that i'm not particularly happy with is how the packet handlers are doing ugly queries like
```rs
let local_player = ecs
    .query::<&LocalPlayer>()
    .get_mut(ecs, player_entity)
    .unwrap();
```
i think the right way to solve it would be by putting every packet handler in its own system but i haven't come up with a way to make that not be really annoying yet

* fix warnings

* ok what if i just have a bunch of queries and a single packet handler system

* simple example for azalea-client

* 🐛

* maybe fix deadlock idk

can't test it rn lmao

* make physicsstate its own component

* use the default plugins

* azalea compiles lol

* use systemstate for packet handler

* fix entities

basically moved some stuff from being in the world to just being components

* physics (ticking) works

* try to add a .entity_by function

still doesn't work because i want to make the predicate magic

* try to make entity_by work

well it does work but i couldn't figure out how to make it look not terrible. Will hopefully change in the future

* everything compiles

* start converting swarm to use builder

* continue switching swarm to builder and fix stuff

* make swarm use builder

still have to fix some stuff and make client use builder

* fix death event

* client builder

* fix some warnings

* document plugins a bit

* start trying to fix tests

* azalea-ecs

* azalea-ecs stuff compiles

* az-physics tests pass 🎉

* fix all the tests

* clippy on azalea-ecs-macros

* remove now-unnecessary trait_upcasting feature

* fix some clippy::pedantic warnings lol

* why did cargo fmt not remove the trailing spaces

* FIX ALL THE THINGS

* when i said 'all' i meant non-swarm bugs

* start adding task pool

* fix entity deduplication

* fix pathfinder not stopping

* fix some more random bugs

* fix panic that sometimes happens in swarms

* make pathfinder run in task

* fix some tests

* fix doctests and clippy

* deadlock

* fix systems running in wrong order

* fix non-swarm bots
2023-02-04 19:32:27 -06:00
dependabot[bot]
7c7446ab1e
Bump tokio from 1.23.1 to 1.24.2 (#62)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.1 to 1.24.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-03 19:27:19 -06:00
EightFactorial
6e818852d8
More packet fixes, tests, handle error (#61)
* Fix packet, fix tests, fixedbitsets

* Clippy: Nightmare Mode

* Fix mistake

* simplify impl Display and make thing pub

---------

Co-authored-by: mat <github@matdoes.dev>
2023-01-30 18:18:14 -06:00
Ubuntu
2539f948c7 have docs for all crates 2023-01-30 22:05:18 +00:00
Ubuntu
d195f400ed replace some string ranges with function equivalents 2023-01-25 17:56:32 +00:00
EightFactorial
9a66cb97a6
Fix test and packets (#60)
* Fix test and packets

* Fix bug, fix a couple more packets

* add tests and fix stuff

* fix warnings

Co-authored-by: Ubuntu <github@matdoes.dev>
2023-01-25 11:51:27 -06:00
mat
473c74175c oops
accidentally left this random person's server ip in lmao
2023-01-21 22:36:59 -06:00
mat
c652bbc609 clippy 2023-01-21 22:25:22 -06:00
EightFactorial
9ee5e71bb1
Server functions and proxy example (#59)
* A couple useful things for servers

* Add proxy example

* Use Uuid's serde feature

* Add const options to proxy example

* Example crates go in dev-dependencies

* Warn instead of error

* Log address on login

* Requested changes

* add a test for deserializing game profile + random small changes

Co-authored-by: mat <github@matdoes.dev>
2023-01-21 22:14:23 -06:00
Nemo157
1059afa6fc
Allow using azalea-chat without azalea-buf to avoid unstable features (#58) 2023-01-20 15:31:02 -06:00
Ubuntu
c6b5664972 update a thing in cargo.toml 2023-01-18 17:52:40 +00:00
mat
a3033321f2 the repo is NOT called Cargo.toml 2023-01-15 22:05:31 -06:00
EightFactorial
54e00eb3df
Add function to get message sender's UUID (#56)
* Add uuid function for chat messages

* Does this please you, clippy?
2023-01-14 21:56:09 -06:00
dependabot[bot]
b86a89fa1e
Bump tokio from 1.22.0 to 1.23.1 (#55)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.22.0 to 1.23.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.22.0...tokio-1.23.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 22:01:50 -06:00
EightFactorial
0c30138d26
Add reason for disconnect (#54)
* Add reason for disconnect

Handles messages like "The server is full!" and "Banned by an operator."
Ban reasons are shown like "You are banned from this server.\nReason: foo"

* keep the kick reason as a Component in the error

Co-authored-by: mat <github@matdoes.dev>
2023-01-06 18:30:55 -06:00
mat
0bca3d8f5d log headers on unknown sessionserver error 2023-01-05 19:24:21 -06:00
mat
4760488c4a fix 2023-01-05 18:36:44 -06:00
mat
82fad00240 fix auto reauthentication
THANKS MOJANG
2023-01-05 18:28:35 -06:00
Shayne Hartford
fc88dabd95
Fix binary compilation (#53)
* Fix binary compilation

* Unnecessary reference
2023-01-05 14:31:25 -06:00
mat
fd18cae476 fix bot/main.rs 2022-12-11 13:34:36 -06:00
mat
fa290b30f2 fix PartialWorld::default() for tests 2022-12-11 03:23:20 -06:00
mat
b60a55e61e rename find_entity to entity_by & add entities_by 2022-12-11 02:24:31 -06:00
mat
37b9f10b3b make entities have a reference to WeakWorlds instead
... and other exciting bug fixes
2022-12-11 00:15:37 -06:00
Ubuntu
2d6737b247 (cargo-release) version 0.5.0 2022-12-09 15:34:29 +00:00
Ubuntu
b6d0b3744d (cargo-release) version 0.5.0 2022-12-09 15:34:29 +00:00
Ubuntu
16be171fb4 (cargo-release) version 0.5.0 2022-12-09 15:34:29 +00:00
Ubuntu
6a5008b0f7 (cargo-release) version 0.5.0 2022-12-09 15:34:28 +00:00
Ubuntu
4484411489 (cargo-release) version 0.5.0 2022-12-09 15:34:28 +00:00
Ubuntu
b0de28d9bd (cargo-release) version 0.5.0 2022-12-09 15:34:28 +00:00
Ubuntu
0cce10d1a5 (cargo-release) version 0.5.0 2022-12-09 15:34:27 +00:00
Ubuntu
a6a0839521 (cargo-release) version 0.5.0 2022-12-09 15:34:27 +00:00
Ubuntu
ebffd5d77e (cargo-release) version 0.5.0 2022-12-09 15:34:26 +00:00
Ubuntu
75db835bfc (cargo-release) version 0.5.0 2022-12-09 15:34:26 +00:00
Ubuntu
3baae656c0 (cargo-release) version 0.5.0 2022-12-09 15:34:26 +00:00
Ubuntu
aa05eeac50 (cargo-release) version 0.5.0 2022-12-09 15:34:26 +00:00
Ubuntu
6b3b691376 (cargo-release) version 0.5.0 2022-12-09 15:34:25 +00:00
Ubuntu
fd6da211b7 (cargo-release) version 0.5.0 2022-12-09 15:34:25 +00:00