Merge branch '4jcraft:dev' into issue/51-phase-1-portable-win32-cleanup

This commit is contained in:
MatthewBeshay 2026-03-11 19:53:03 +11:00 committed by GitHub
commit a9d1322a6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 46 additions and 28 deletions

View file

@ -32,7 +32,7 @@ jobs:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 ninja-build meson libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev
sudo apt-get install -y build-essential ccache python3 ninja-build meson libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev
# Set a reasonable ccache size
ccache -M 5G || true
@ -86,7 +86,7 @@ jobs:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 ninja-build meson libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev
sudo apt-get install -y build-essential ccache python3 ninja-build meson libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev
# Set a reasonable ccache size
ccache -M 5G || true

3
.gitignore vendored
View file

@ -6,6 +6,9 @@ builddir/
build_meson/
cmake-build-debug/
# Nix flake output
result
# Final binaries and platform output
/Linux/
/x64/

View file

@ -743,7 +743,7 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha)
#if 1
// 4J - cut down version, we're not using offsetted render lists, or a sorted chunk list, anymore
mc->gameRenderer->turnOnLightLayer(alpha); // 4J - brought forward from 1.8.2
shared_ptr<Mob> player = mc->cameraTargetPlayer;
std::shared_ptr<Mob> player = mc->cameraTargetPlayer;
double xOff = player->xOld + (player->x - player->xOld) * alpha;
double yOff = player->yOld + (player->y - player->yOld) * alpha;
double zOff = player->zOld + (player->z - player->zOld) * alpha;

View file

@ -1,11 +1,11 @@
{
description = "4jcraft-nix dev shell";
description = "4jcraft-nix package and dev shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { nixpkgs, ... }:
outputs = { self, nixpkgs, ... }:
let
allSystems = [
"x86_64-linux"
@ -19,30 +19,45 @@
});
in
{
devShells = forAllSystems ({ pkgs }:
let
libs = with pkgs; [
openssl.dev
libGL
libGLU
sdl2
zlib
];
packages = with pkgs; [
clang
lld
cmake
gnumake
meson
ninja
pkg-config
];
in
packages = forAllSystems ({ pkgs }:
{
default = pkgs.mkShell {
LD_LIBRARY_PATH = "/run/opengl-driver/lib";
buildInputs = libs;
nativeBuildInputs = packages;
default = pkgs.clangStdenv.mkDerivation {
pname = "4jcraft";
version = "0.1.0";
src = ./.;
buildInputs = with pkgs; [
openssl.dev
libGL
libGLU
SDL2
zlib
];
nativeBuildInputs = with pkgs; [
lld
meson
ninja
pkg-config
python3
makeWrapper
];
installPhase = ''
mkdir -p $out/share/4jcraft
cp -r Minecraft.Client/. $out/share/4jcraft/
mkdir -p $out/bin
makeWrapper $out/share/4jcraft/Minecraft.Client \
$out/bin/4jcraft \
--run "cd $out/share/4jcraft"
'';
meta = {
description = "4JCraft";
platforms = pkgs.lib.platforms.linux;
};
};
}
);