- Optimize
create_chunk_and_light_data_packet
- Optimize
chunk_section_update_mesh
If you are on debian linux run ./dev-setup.sh
and ./import-data.sh
.
To build run
mkdir build && cd build
cmake ..
cd ..
cmake --build build -j8
To run
- Create a Minecraft profile and set a custom Java executable to the path of
custommc.sh
- Run that Minecraft profile which creates a file called
./run-with-token.sh
- Edit that file to change the server hostname and port.
- Run
./run-with-token.sh
To run with a local server online mode turned off (the final two args are unused auth placeholders)
./build/cmc <any-username> <host> <port> _ _
mkdir lib
- Download the prebuilt WGPU libraries from
https://github.com/gfx-rs/wgpu-native/releases and put the extracted zip in
the
lib/wgpu
directory - Download the GLFW sources into
lib/glfw
from the version pointed to from https://github.com/gfx-rs/wgpu-native/tree/trunk/examples/vendor - From the main directory, run
git clone https://github.com/recp/cglm.git -o ./lib/cglm
to get cglm. It works as a header-only library. - Retrieve
blocks.json
from the server jar with the following and place it in/data
.
java -DbundlerMainClass=net.minecraft.data.Main -jar paper-1.20.6-145.jar --reports
- To load default client resources, copy your client jar from
~/.minecraft/versions
to/data
and extract it withgunzip 1.20.6.jar
. To clean things up you canrm *.class
as these files are not needed. - To compile and run follow the instructions above
- Offline and online mode support
- Encryption support
- Basic rendering
- Building and breaking blocks
- Player movement
If there is a core dump:
coredumpctl dump -r `pwd`/a.out > core && gdb a.out -c core
framework.h
andframework.c
are from https://github.com/gfx-rs/wgpu-native/tree/trunk/examples/frameworkmain.c
andshader.wsgl
are from https://github.com/gfx-rs/wgpu-native/tree/trunk/examples/triangle- In
main.c
I updated the includes to their local locations:
#include "wgpu/webgpu.h"
#include "wgpu/wgpu.h"
// ...
#include "GLFW/include/GLFW/glfw3.h"
#include "GLFW/include/GLFW/glfw3native.h"
- I added
#define GLFW_EXPOSE_NATIVE_WAYLAND
#define GLFW_EXPOSE_NATIVE_X11
before
#include "GLFW/include/GLFW/glfw3.h"
- I commented out this line that causes an error (probably a mismatched wgpu version)
// .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED,
jq -r '.textures | keys[]' block/*.json | sort | uniq -c | sort -nr