diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..8b8545f4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +A non-negotiable agreement you make as a contributor to this project, is to +welcome everyone, regardless of age, body size, disability, ethnicity, gender identity +and expression, level of experience, education, socio-economic status, nationality, +personal appearance, race, religion, or sexual identity and orientation. + +If you cannot agree to this agreement, stuff it. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at {{ email }}. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..031ca6a3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,41 @@ +## Before getting started + +Thank you for your interest in contributing to Alya Client! + +# Guidelines + +This is a safe space for people to contribute to the project. + +# How to contribute + +1. **Find an issue** that you want to work on. +2. **Fork** the repository. +3. **Create a branch** for your changes. +4. **Make your changes**. +5. **Submit a pull request**. +6. **Wait for the review**. + +If you need further guidance, you can find us on the following platforms: + +- Discord (https://discord.gg/J3XUnGaZjQ) + +## Getting started + +> Here you should address guidelines about future functionalities, milestone +labels, bugs and unlisted features, issued assignments, etc. Since now we have +an `Issue` and a `Pull Request` template, you can reference them directly: + +> **ProTip:** It's important people know the rules for contributing in the +project. It's irritating for people trying to help when they are pushed back +because they didn't follow some process that they didn't know existed. This file +is the place for these processes and it will lower the barrier to entry for +contribution. + +## Coding conventions + +In order to sanitize coding standards, please follow [this style +guide](STYLE_GUIDE.md). + +## Code of Conduct + +See the [code of conduct](CODE_OF_CONDUCT.md) for more details. diff --git a/README.md b/README.md index 2814de46..56a21f0d 100644 --- a/README.md +++ b/README.md @@ -11,22 +11,67 @@ Open the project in IntelliJ, import it and run the `Start` or `Start (macOS)` r ### I am the IDE (manual) #### Prerequisites + - Java 25 +- Gradle (Optional, will be downloaded by wrapper) -1. Init the Gradle wrapper and package libraries +1. Init the Gradle wrapper and package libraries: `./scripts/init.sh` +2. Build the project: `./gradlew jar shadowJar` +3. Run the project: `./scripts/run.sh` -```sh -./scripts/init.sh -``` +## Project Structure + +Packages +- `bypass`: The package holding all of Alya Client's base code. +- `net.minecraft`, `net.minecraftforge` and `net.optifine`: Contains all of Minecraft + Optifines source. +- `de.florianmichael`: ViaMCP for protocol switching +- `resources/lua`: Contains most of Alya client's bypasses and modules. -2. Build the project +You will mainly need to look at `bypass` and `resources/lua` while developing. If you need to hook into Minecraft, +you will (obviously) be digging through `net.minecraft`. -```sh -./gradlew jar shadowJar +### Project Tree + +```aiignore +. +├── src/main/java +│ ├── bypass # Alya base code +│ ├── de.florianmichael # ViaMCP +│ ├── net.minecraft / net.minecraftforge / net.optifine +│ └── start +├── src/main/resources +│ └── lua # bypasses and modules +├── jars # runtime working directory +├── scripts # utilities +└── build.gradle.kts ``` -3. Run the project +## Support + +If you have trouble, please feel free to join our [Discord](https://discord.gg/J3XUnGaZjQ) +or DM `@thoqx` on Discord. + +## License + +This project uses the GPL-2.0-only license. + +PERMISSIONS +- Use the software for any purpose +- Study and read the source code +- Modify the source code +- Distribute original copies +- Distribute modified copies, under the same license + +CONDITIONS +- Copyleft: any distributed version must also be licensed under GPL-2.0 +- Source code must be made available when distributing +- Original license and copyright notices must be preserved +- No additional restrictions may be imposed on recipients + +RESTRICTIONS +- Cannot be relicensed under a different or more restrictive license +- Cannot be distributed as closed-source without providing source +- Cannot be upgraded to GPL-3.0 or any other version + (the "-only" suffix locks it strictly to version 2) -```shell -./scripts/run.sh -``` \ No newline at end of file +See the [LICENSE](LICENSE) file for more information. diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md new file mode 100644 index 00000000..ac8af9da --- /dev/null +++ b/STYLE_GUIDE.md @@ -0,0 +1,77 @@ +# Alya Client Code Style Guide + +## Control Flow + +Do NOT put a space between the keyword and the opening parenthesis. + +```java +// wrong +if (condition) { ... } +while (condition) { ... } +for (int i = 0; i < n; i++) { ... } +switch (value) { ... } + +// correct +if(condition) { ... } +while(condition) { ... } +for(int i = 0; i < n; i++) { ... } +switch(value) { ... } +``` + +This applies to: `if`, `while`, `for`, `switch`, `catch`, and all other control flow statements. + +--- + +## Variable Names + +Variable names must be fully descriptive. Abbreviations are not allowed. + +```java +// wrong +int btn; +String usr; +boolean isConn; +int idx; + +// correct +int button; +String user; +boolean isConnected; +int index; +``` + +Single-letter variable names are only permitted as loop counters (e.g. `i`, +`j`, `k`). + +--- + +## Immutability + +Declare classes, variables, parameters, and fields as `final` wherever possible. + +```java +// wrong +int count = getCount(); +String name = getName(); + +// correct +final int count = getCount(); +final String name = getName(); +``` + +This includes: +- Local variables that are not reassigned +- Method parameters that are not reassigned +- Methods not inside a final class +- Fields that are only assigned once (in the constructor or at declaration) +- Classes that are not extended or abstract + +```java +// wrong +public void doSomething(String input) { ... } +public class MyClass { ... } + +// correct +public void doSomething(final String input) { ... } +public final class MyClass { ... } +``` diff --git a/build.gradle.kts b/build.gradle.kts index d89e9044..5f4e665c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -70,7 +70,7 @@ val generateBuildConfig by tasks.registering { } val outputDir = generatedSrcDir.get().asFile - val packageDir = File(outputDir, "dev/thoq/alya") + val packageDir = File(outputDir, "bypass") outputs.dir(outputDir) @@ -78,7 +78,7 @@ val generateBuildConfig by tasks.registering { packageDir.mkdirs() File(packageDir, "BuildConfig.java").writeText( """ - package dev.thoq.alya; + package bypass; public class BuildConfig { public static final String GIT_HASH = "$gitHash"; diff --git a/jars/run_config/Start (macOS).run.xml b/jars/run_config/Start (macOS).run.xml index 0dcca12f..06005c6a 100644 --- a/jars/run_config/Start (macOS).run.xml +++ b/jars/run_config/Start (macOS).run.xml @@ -1,27 +1,7 @@ - -