aboutsummaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
blob: bf26bf5a2e10ebb85be8b0646503812c3cd97c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Thanks for your interest in contributing to Azalea!

This document is a work-in-progress.

## How you can help

First, you're advised to join the Matrix space at [#azalea:matdoes.dev](https://matrix.to/#/#azalea:matdoes.dev) or the Discord server at [discord.gg/FaRey6ytmC](https://discord.gg/FaRey6ytmC) (bridged, you don't need to join both). If you're unsure of how to do something related to Azalea, you should go and ask there.

If there's a feature you want, implement it! You should search the GitHub issues first to make sure that it's not already being worked on, though.

After you're done, please submit a PR. It'll be reviewed/merged when the maintainer has time.

Note that not all features are within scope for Azalea, but many features can still be implemented as a plugin which you may publish separately (and which may be advertised in Azalea's README).

## Things to watch out for

If you're working with low-level physics or packet related code, it's quite easy to accidentally make a change that causes Azalea to start flagging anticheats. If you're unsure about a change, you're advised to reference the decompiled vanilla Minecraft source code and test with an anticheat such as [GrimAC](https://modrinth.com/plugin/grimac) (Grim is preferred as it's relatively strict and is used on some popular anarchy servers).

The second major thing to watch out for is accidentally introducing performance regressions. Certain parts of Azalea are highly performance sensitive (notably, the pathfinder), so most changes in these areas should be benchmarked to avoid accidentally hurting performance.

## Profiling

Please see [the chapter about profiling in the Rust performance book](https://nnethercote.github.io/perf-book/profiling.html).

The usual profiling setup is something like this:

```sh
cargo install flamegraph
RUSTFLAGS="-C force-frame-pointers=yes" cargo r -r --example testbot
# wait a few seconds so chunks being loaded doesn't affect the flamegraph, and
# then run this in a separate window:
flamegraph -p $(pidof testbot)
# wait about 15 seconds, then ctrl+c, and view the flamegraph.svg
```

## AI Policy

Please avoid using generative AI to make contributions to Azalea. We do not enjoy working with code that wasn't written by people.