Skip to content

Commit ea16d88

Browse files
committed
Merge branch 'next' into perf-test
2 parents 92187a6 + ac04d45 commit ea16d88

60 files changed

Lines changed: 2189 additions & 315 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# we dont want default config to be loaded in the dockerfile, but rather using a volume
2-
config.json
31
# build stuff
42
node_modules
53
public

.github/workflows/publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to GitHub pages
1+
name: Release
22
env:
33
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
44
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
@@ -17,6 +17,7 @@ jobs:
1717
# - run: pnpm install
1818
# - run: pnpm build
1919
- run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
20+
- run: node scripts/replaceFavicon.mjs ${{ secrets.FAVICON_MAIN }}
2021
# will install + build to .vercel/output/static
2122
- run: vercel build --token=${{ secrets.VERCEL_TOKEN }} --prod
2223
- run: pnpm build-storybook

.storybook/preview.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import React from 'react'
22

3-
import type { Preview } from "@storybook/react";
3+
import type { Preview } from "@storybook/react"
44

5-
import '../src/styles.css'
65
import './storybook.css'
6+
import '../src/styles.css'
7+
import '../src/scaleInterface'
78

89
const preview: Preview = {
910
decorators: [
1011
(Story, c) => {
1112
const noScaling = c.parameters.noScaling
1213
return <div id={noScaling ? '' : 'ui-root'}>
1314
<Story />
14-
</div>;
15+
</div>
1516
},
1617
],
1718
parameters: {
@@ -23,6 +24,6 @@ const preview: Preview = {
2324
},
2425
},
2526
},
26-
};
27+
}
2728

28-
export default preview;
29+
export default preview

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ How different modules are used:
2121

2222
- `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.
2323

24-
## Making protocol changes
24+
## Making protocol-related changes
2525

2626
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).
2727

@@ -37,6 +37,7 @@ Also there are [src/generatedClientPackets.ts](src/generatedClientPackets.ts) an
3737
- Some data are cached between restarts. If you see something doesn't work after upgrading dependencies, try to clear the by simply removing the `dist` folder.
3838
- The same folder `dist` is used for both development and production builds, so be careful when deploying the project.
3939
- Use `start-prod` script to start the project in production mode after running the `build` script to build the project.
40+
- 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.
4041

4142
### Would be useful to have
4243

Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1-
FROM node:14-alpine
1+
FROM node:18-alpine
22
# Without git installing the npm packages fails
33
RUN apk add git
44
RUN mkdir /app
55
WORKDIR /app
66
COPY . /app
7-
RUN npm install
8-
RUN npm run build
7+
# install python and other dependencies
8+
RUN apk add python3 make g++ cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev
9+
# install pnpm
10+
RUN npm i -g pnpm@9.0.4
11+
RUN pnpm install
12+
# only for prod
13+
RUN pnpm run build
14+
# ---
15+
EXPOSE 8080
16+
# uncomment for development
17+
# EXPOSE 9090
18+
# VOLUME /app/src
19+
# VOLUME /app/prismarine-viewer
20+
# ENTRYPOINT ["pnpm", "run", "run-all"]
21+
# only for prod
922
ENTRYPOINT ["npm", "run", "prod-start"]

README.MD

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
A true Minecraft client running in your browser! A port of the original game to the web, written in JavaScript using modern web technologies.
66

7-
If you encounter any bugs or usability issues, please report them!
7+
If you encounter any bugs or usability issues, please report them! For development, see [development](#development--debugging).
88

99
You can try this out at [mcraft.fun](https://mcraft.fun/), [pcm.gg](https://pcm.gg) (short link) [mcon.vercel.app](https://mcon.vercel.app/) or the GitHub pages deploy. Every commit from the `develop` (default) branch is deployed to [s.mcraft.fun](https://s.mcraft.fun/) - so it's usually newer, but might be less stable.
1010

1111
### Big Features
1212

1313
- Open any zip world file or even folder in read-write mode!
14-
- Connect to cracked servers* (it's possible because of proxy servers, see below)
14+
- Connect to Java servers running in both offline (cracked) and online mode* (it's possible because of proxy servers, see below)
1515
- Singleplayer mode with simple world generations!
1616
- Works offline
1717
- Play with friends over internet! (P2P is powered by Peer.js discovery servers)
@@ -39,9 +39,9 @@ Whatever offline mode you used (zip, folder, just single player), you can always
3939

4040
### Servers
4141

42-
You can play almost on any server, supporting offline connections.
42+
You can play almost on any Java server, vanilla servers are fully supported.
4343
See the [Mineflayer](https://github.com/PrismarineJS/mineflayer) repo for the list of supported versions (should support majority of versions).
44-
There is a builtin proxy, but you can also host a your one! Just clone the repo, run `pnpm i` (following CONTRIBUTING.MD) and run `pnpm prod-start`, then you can specify `http://localhost:8080` in the proxy field.
44+
There is a builtin proxy, but you can also host your one! Just clone the repo, run `pnpm i` (following CONTRIBUTING.MD) and run `pnpm prod-start`, then you can specify `http://localhost:8080` in the proxy field.
4545
MS account authentication will be supported soon.
4646

4747
### Rendering
@@ -67,9 +67,9 @@ There are many many settings, that are not exposed in the UI yet. You can find o
6767

6868
To open the console, press `F12`, or if you are on mobile, you can type `#debug` in the URL (browser address bar), it wont't reload the page, but you will see a button to open the console. This way you can change advanced settings and see all errors or warnings. Also this way you can access global variables (described below).
6969

70-
### Debugging
70+
### Development & Debugging
7171

72-
It should be easy to build/start the project locally. See [CONTRIBUTING.MD](./CONTRIBUTING.md) for more info.
72+
It should be easy to build/start the project locally. See [CONTRIBUTING.MD](./CONTRIBUTING.md) for more info. Also you can look at Dockerfile for reference.
7373

7474
There is world renderer playground ([link](https://mcon.vercel.app/playground.html)).
7575

@@ -113,10 +113,10 @@ Press `Y` to set query parameters to url of your current game state.
113113
- `?version=<version>` - Set the version for server
114114
- `?lockConnect=true` - Disable cancel / save buttons, useful for integrates iframes
115115
- `?reconnect=true` - Reconnect to the server on page reloads. Available in **dev mode only** and very useful on server testing.
116-
<!-- - `?password=<password>` - Set the password on load -->
117116
- `?loadSave=<save_name>` - Load the save on load with the specified folder name (not title)
118117
- `?singleplayer=1` - Create empty world on load. Nothing will be saved
119118
- `?noSave=true` - Disable auto save on unload / disconnect / export. Only manual save with `/save` command will work
119+
<!-- - `?requiresAuth=true` - Show the Microsoft login screen on server connect. Useful for servers that require authentication (running in online mode) -->
120120

121121
- `?map=<map_url>` - Load the map from ZIP. You can use any url, but it must be CORS enabled.
122122
- `?setting=<setting_name>:<setting_value>` - Set the and lock the setting on load. You can set multiple settings by separating them with `&` e.g. `?setting=autoParkour:true&setting=renderDistance:4`

README.NPM.MD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Minecraft React
22

3+
Minecraft UI components for React.
4+
35
```bash
4-
yarn add minecraft-react
6+
pnpm i minecraft-react
57
```
68

9+
![demo](https://github-production-user-asset-6210df.s3.amazonaws.com/46503702/346295584-80f3ed4a-cab6-45d2-8896-5e20233cc9b1.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240706%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240706T195400Z&X-Amz-Expires=300&X-Amz-Signature=5b063823a57057c4042c15edd1db3edd107e00940fd0e66a2ba1df4e564a2809&X-Amz-SignedHeaders=host&actor_id=46503702&key_id=0&repo_id=432411890)
10+
711
## Usage
812

913
```jsx

assets/extra-textures/loading.png

-66.5 KB
Binary file not shown.

assets/favicon.png

-76.3 KB
Loading

cypress/e2e/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const compareRenderedFlatWorld = () => {
1414
}
1515

1616
const testWorldLoad = () => {
17-
return cy.document().then({ timeout: 20_000 }, doc => {
17+
return cy.document().then({ timeout: 25_000 }, doc => {
1818
return new Cypress.Promise(resolve => {
1919
doc.addEventListener('cypress-world-ready', resolve)
2020
})

0 commit comments

Comments
 (0)