Commit graph

812 commits

Author SHA1 Message Date
mat
21e3f73c23 check entity for retroactively_add_game_profile_component 2023-02-23 18:46:41 -06:00
mat
54a2eb9c95 fix jumping 2023-02-23 18:35:37 -06:00
Charles Johnson
d3af7ba7a9
fix disconnect_on_read_packets_ended (#73) 2023-02-22 13:50:08 -06:00
mat
1f5775ed4e unused import 2023-02-21 22:22:03 -06:00
mat
c52cee3a69 don't keep firing disconnectevent 2023-02-21 22:21:43 -06:00
mat
48640ca303 properly disconnect on ungraceful disconnect 2023-02-21 21:53:22 -06:00
mat
66094921c8 make metadata components clonable 2023-02-21 21:46:41 -06:00
EightFactorial
6942e3547b
Fix writing palettes (#72) 2023-02-21 20:17:32 -06:00
mat
40073f5baa improve docs and rename model_customisation 2023-02-21 19:13:51 +00:00
EightFactorial
d88ca2d865
Make things public (#71)
* Make struct data pub

* Add derives

* Rename packet fields

* Make Palette structs pub
2023-02-21 12:13:06 -06:00
mat
71308ee0a3 fix 0ns delay 2023-02-15 22:45:03 -06:00
mat
6782b1d9ec max reconnect wait from 120s to 15s 2023-02-15 19:04:14 +00:00
EightFactorial
f382e2838f
Fix ClientboundBlockEventPacket::block (#70) 2023-02-13 20:46:40 -06:00
mat
9897cef520 i should start testing my fixes before committing them 2023-02-13 18:33:30 -06:00
mat
edc37cfd4b fix bad compression on sending long packets
THANKS JAM \SHARP
2023-02-13 18:22:42 -06:00
Ubuntu
37b0cbf058 fix comment in tests 2023-02-13 16:34:43 +00:00
Charles Johnson
17463391fe
fix BlockCollisions bounding box (#68)
* fix `BlockCollisions` bounding box

* add test

---------

Co-authored-by: Ubuntu <github@matdoes.dev>
2023-02-13 10:33:51 -06:00
mat
1b3d6f9581 DisconnectEvent 2023-02-12 22:56:20 -06:00
mat
913f17299b
update .cargo/config.toml
thanks bevy
2023-02-12 18:47:09 -06:00
mat
5d53d063c3
Better chat events (#67)
* Better chat events

* add a comment explaining why SendChatKindEvent is only one event
2023-02-12 17:49:09 -06:00
mat
962cb576b3 fix pathfinder example link 2023-02-10 22:36:18 -06:00
Ubuntu
f8f976ac02 make it so registries can have doc comments 2023-02-10 19:16:25 +00:00
Ubuntu
758372f938 improve docs a bit more and delete potatobot example 2023-02-10 18:19:06 +00:00
Ubuntu
f5ae1b9717 fix and improve examples in docs 2023-02-10 18:06:18 +00:00
mat
7e43e6d24a no iyes_loopless 2023-02-09 21:20:09 -06:00
mat
ba3d8c35af chore: Release 2023-02-09 21:03:16 -06:00
mat
2c7518be33 release ecs crates 2023-02-09 21:02:34 -06:00
mat
7341a06dbf ok i think i'm gonna leave the block examples like this 2023-02-09 20:38:25 -06:00
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