Commit graph

265 commits

Author SHA1 Message Date
mat
6188230009 add stuff related to chat signing
and also some stuff related to digging because i forgot to do a different branch lol
2023-05-26 15:18:04 -05:00
mat
8ef57aa698 chore: Release 2023-05-17 00:04:16 -05:00
mat
cb20430481 chore: Release 2023-05-16 23:57:06 -05:00
mat
bb49c78ebc and also update the dependents lol 2023-05-16 23:53:13 -05:00
mat
2ba7b83490 ClientBuilder::new_without_plugins 2023-05-16 23:26:45 -05:00
mat
0cc76dfb67 ChatPacket::is_whisper 2023-05-13 19:29:55 -05:00
mat
e977391b04 auto respawn 2023-05-12 23:20:23 -05:00
mat
741a1f65d6 handle ping packet and resource pack correctly 2023-05-12 22:30:13 -05:00
mat
84c0908f34 fix panic on disconnect 2023-05-06 01:02:21 -05:00
mat
634cb8d72c
Inventory (#48)
* start adding azalea-inventory

* design more of how inventories are defined

* start working on az-inv-macros

* inventory macro works

* start adding inventory codegen

* update some deps

* add inventory codegen

* manually write inventory menus

* put the inventories in Client

* start on containersetcontent

* inventory menu should hopefully work

* checks in containersetcontent

* format a comment

* move some variant matches

* inventory.rs

* inventory stuff

* more inventory stuff

* inventory/container tracking works

* start adding interact function

* sequence number

* start adding HitResultComponent

* implement traverse_blocks

* start adding clip

* add clip function

* update_hit_result_component

* start trying to fix

* fix

* make some stuff simpler

* clippy

* lever

* chest

* container handle

* fix ambiguity

* fix some doc tests

* move some container stuff from az-client to azalea

* clicking container

* start implementing simulate_click

* keep working on simulate click

* implement more of simulate_click

this is really boring

* inventory fixes

* start implementing shift clicking

* fix panic in azalea-chat i hope

* shift clicking implemented

* more inventory stuff

* fix items not showing in containers sometimes

* fix test

* fix all warnings

* remove a println

---------

Co-authored-by: mat <git@matdoes.dev>
2023-05-03 20:57:27 -05:00
mat
8215331381 rename and export AccountOpts 2023-04-19 20:10:40 +00:00
mat
b276978195 clear titles packet 2023-03-21 18:20:47 +00:00
mat
157ac22461 remove unused dependencies
thanks cargo-udeps
2023-03-21 18:07:40 +00:00
mat
12a9c8ce65
1.19.4 (#57)
* 23w03a

* 23w04a

* 23w05a

* 23w06a

* fix

* 23w07a

mojang broke their json data generator so some stuff is missing

* didn't mean to commit that file here

* 1.19.4-pre2

* fix

* 1.19.4-pre3

* fix

* how did these packets get here

* 1.19.4-pre4

* 1.19.4-rc1

* 1.19.4-rc2

* 1.19.4-rc3

* merge main

* remove debugging code

* 1.19.4
2023-03-14 16:33:03 -05:00
mat
aa846bc027 make ResourceLocation::new -> Self and impl Serialize/Deserialize for ResourceLocation 2023-03-14 01:22:15 -05:00
mat
cd0a1ed8d4 fix doc errors 2023-03-11 17:02:57 -06:00
EightFactorial
c57c68ddf8
Add RegistryHolder struct and serde features (#81)
* Make RegistryHolder struct

* Update deps

* Move RegistryHolder to azalea-protocol

* Convert bytes to bools and back

* Rename and shuffle logic

* Move logic into trait, rename methods

* Final touchups

* Ah, merge mistakes

* Add serde support for ResourceLocation

* Reuse structs

* Error when serde skips values in debug mode
Add missing attributes

* Strict_registry feature, require packet feature

* Add test

* Move into packets

* Docs and touchups

* Reword docs

* Move into module inside ClientboundLoginPacket

* Add azalea-nbt serde feature

* remove duplicate comment and type_ -> kind

---------

Co-authored-by: mat <github@matdoes.dev>
2023-03-11 16:00:10 -06:00
mat
f28efd5637 make ClientInformation and TabList their own components 2023-03-08 19:26:40 +00:00
mat
719379a8a7
Bevy 0.10 (#79)
* replace 0.9.1 with 0.10.0

* start migrating to bevy .10

* well it compiles

* doesn't immediately panic

* remove unused imports

* fmt

* delete azalea-ecs

* make RelativeEntityUpdate an EntityCommand

* fix a doc test

* explain what FixedUpdate does
2023-03-07 14:14:36 -06:00
Shayne Hartford
91d97adb4f
Remove invalid characters and truncate messages and commands to 256 (#78)
* Remove invalid characters and truncate messages and commands to 256

* Remove duplicated use statements

* Remove to_owned and use matches! macro
2023-02-27 21:44:45 -06:00
Shayne Hartford
ec5f05c345
Change Windows env from USERPROFILE to APPDATA (#77) 2023-02-27 09:45:04 -06:00
mat
cbc6af81fb
Add PacketEvent (#75)
* add PacketEvent

* docs and fixes

* Event::Packet works
2023-02-26 15:07:52 -06:00
mat
c1588ef66e
Fix system order ambiguities (#74)
* start fixing stuff where systems run in the wrong order

* fix ordering ambiguity

* add debugging guide

* some fixes

* fix panic for swarms

* fix some warnings
2023-02-25 17:32:15 -06:00
mat
21e3f73c23 check entity for retroactively_add_game_profile_component 2023-02-23 18:46:41 -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
40073f5baa improve docs and rename model_customisation 2023-02-21 19:13:51 +00:00
EightFactorial
f382e2838f
Fix ClientboundBlockEventPacket::block (#70) 2023-02-13 20:46:40 -06:00
mat
1b3d6f9581 DisconnectEvent 2023-02-12 22:56:20 -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
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
Ubuntu
9d4f738d4e make blockstate good 2023-02-10 01:56:45 +00: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
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
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
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
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
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