forked from PrismarineJS/prismarine-web-client
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new small but essential release (#178)
- Loading branch information
Showing
68 changed files
with
1,207 additions
and
584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ After forking the repository, run the following commands to get started: | |
0. Ensure you have [Node.js](https://nodejs.org) and `pnpm` installed. To install pnpm run `npm i -g [email protected]`. | ||
1. Install dependencies: `pnpm i` | ||
2. Start the project in development mode: `pnpm start` | ||
3. Read the [Tasks Categories](#tasks-categories) and [Workflow](#workflow) sections below | ||
4. Let us know if you are working on something and be sure to open a PR if you got any changes. Happy coding! | ||
|
||
## Project Structure | ||
|
||
|
@@ -57,6 +59,20 @@ How different modules are used: | |
|
||
- `mineflayer` - provider `bot` variable and as mineflayer states it is a wrapper for the `node-minecraft-protocol` module and is used to connect and interact with real Java Minecraft servers. However not all events & properties are exposed and sometimes you have to use `bot._client.on('packet_name', data => ...)` to handle packets that are not handled via mineflayer API. Also you can use almost any mineflayer plugin. | ||
|
||
## Running Main App + Playground | ||
|
||
To start the main web app and playground, run `pnpm run-all`. Note is doesn't start storybook and tests. | ||
|
||
## Cypress Tests (E2E) | ||
|
||
Cypress tests are located in `cypress` folder. To run them, run `pnpm test-mc-server` and then `pnpm test:cypress` when the `pnpm prod-start` is running (or change the port to 3000 to test with the dev server). Usually you don't need to run these until you get issues on the CI. | ||
|
||
## Unit Tests | ||
|
||
There are not many unit tests for now (which we are trying to improve). | ||
Location of unit tests: `**/*.test.ts` files in `src` folder and `prismarine-viewer` folder. | ||
Start them with `pnpm test-unit`. | ||
|
||
## Making protocol-related changes | ||
|
||
You can get a description of packets for the latest protocol version from <https://wiki.vg/Protocol> and for previous protocol versions from <https://wiki.vg/Protocol_version_numbers> (look for *Page* links that have *Protocol* in URL). | ||
|
@@ -75,6 +91,84 @@ Also there are [src/generatedClientPackets.ts](src/generatedClientPackets.ts) an | |
- Use `start-prod` script to start the project in production mode after running the `build` script to build the project. | ||
- If CI is failing on the next branch for some reason, feel free to use the latest commit for release branch. We will update the base branch asap. Please, always make sure to allow maintainers do changes when opening PRs. | ||
|
||
## Tasks Categories | ||
|
||
(most important for now are on top). | ||
|
||
## 1. Client-side Logic (most important right now) | ||
|
||
Everything related to the client side packets. Investigate issues when something goes wrong with some server. It's much easier to work on these types of tasks when you have experience in Java with Minecraft, a deep understanding of the original client, and know how to debug it (which is not hard actually). Right now the client is easily detectable by anti-cheat plugins, and the main goal is to fix it (mostly because of wrong physics implementation). | ||
|
||
Priority tasks: | ||
|
||
- Rewrite or fix the physics logic (Botcraft or Grim can be used as a reference as well) | ||
- Implement basic minecart / boat / horse riding | ||
- Fix auto jump module (false triggers, performance issues) | ||
- Investigate connection issues to some servers | ||
- Setup a platform for automatic cron testing against the latest version of the anti-cheat plugins | ||
- ... | ||
|
||
Goals: | ||
|
||
- Make more servers playable. Right now on hypixel-like servers (servers with minigames), only tnt run (and probably ) is fully playable. | ||
|
||
Notes: | ||
|
||
- You can see the incoming/outgoing packets in the console (F12 in Chrome) by enabling `options.debugLogNotFrequentPackets = true`. However, if you need a FULL log of all packets, you can start recording the packets by going into `Settings` > `Advanced` > `Enable Packets Replay` and then you can download the file and use it to replay the packets. | ||
- You can use mcraft-e2e studio to send the same packets over and over again (which is useful for testing) or use the packets replayer (which is useful for debugging). | ||
|
||
## 2. Three.js Renderer | ||
|
||
Example tasks: | ||
|
||
- Improve / fix entity rendering | ||
- Better update entities on specific packets | ||
- Investigate performance issues under different conditions (instructions provided) | ||
- Work on the playground code | ||
|
||
Goals: | ||
|
||
- Fix a lot of entity rendering issues (including position updates) | ||
- Implement switching camera mode (first person, third person, etc) | ||
- Animated blocks | ||
- Armor rendering | ||
- ... | ||
|
||
Note: | ||
|
||
- It's useful to know how to use helpers & additional cameras (e.g. setScissor) | ||
|
||
## 3. Server-side Logic | ||
|
||
Flying squid fork (space-squid). | ||
Example tasks: | ||
|
||
- Add missing commands (e.g. /scoreboard) | ||
- Basic physics (player fall damage, falling blocks & entities) | ||
- Basic entities AI (spawning, attacking) | ||
- Pvp | ||
- Emit more packets on some specific events (e.g. when a player uses an item) | ||
- Make more maps playable (e.g. fix when something is not implemented in both server and client and blocking map interaction) | ||
- ... | ||
|
||
Long Term Goals: | ||
|
||
- Make most adventure maps playable | ||
- Make a way to complete the game from the scratch (crafting, different dimensions, terrain generation, etc) | ||
- Make bedwars playable! | ||
Most of the tasks are straightforward to implement, just be sure to use a debugger ;). If you feel you are stuck, ask for help on Discord. Absolutely any tests / refactor suggestions are welcome! | ||
|
||
## 4. Frontend | ||
|
||
New React components, improve UI (including mobile support). | ||
|
||
## Workflow | ||
|
||
1. Locate the problem on the public test server & make an easily reproducible environment (you can also use local packets replay server or your custom server setup). Dm me for details on public test server / replay server | ||
2. Debug the code, find an issue in the code, isolate the problem | ||
3. Develop, try to fix and test. Finally we should find a way to fix it. It's ideal to have an automatic test but it's not necessary for now | ||
3. Repeat step 1 to make sure the task is done and the problem is fixed (or the feature is implemented) | ||
|
||
### Would be useful to have | ||
|
||
- cleanup folder & modules structure, cleanup playground code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.