From 9af1496b9d3ae2b72c0f9e9e14bf03eb377a0964 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 21 Mar 2026 15:04:50 +0300 Subject: [PATCH 001/189] FIX: windows CI build --- .github/workflows/build.yml | 7 ++++--- CMakeLists.txt | 14 ++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5e081e..f7cc987 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,10 +68,9 @@ jobs: name: mcpe-windows path: | ${{github.workspace}}/build/MinecraftPE.exe - ${{github.workspace}}/build/glfw3.dll ${{github.workspace}}/build/libpng16.dll ${{github.workspace}}/build/OpenAL32.dll - ${{github.workspace}}/build/z.dll + ${{github.workspace}}/build/libz.dll build-linux: name: Linux Build @@ -236,14 +235,16 @@ jobs: - name: Zip Windows Artifacts uses: vimtor/action-zip@v1.2 with: - files: data mcpe-windows/MinecraftPE.exe mcpe-windows/glfw3.dll mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/z.dll + files: data mcpe-windows/MinecraftPE.exe mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/libz.dll dest: minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip + recursive: false - name: Zip Linux Artifacts uses: vimtor/action-zip@v1.2 with: files: data mcpe-linux/MinecraftPE dest: minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip + recursive: false - name: Zip Linux Server Artifacts uses: vimtor/action-zip@v1.2 diff --git a/CMakeLists.txt b/CMakeLists.txt index cdf558a..b1c2e4e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,10 +7,6 @@ set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_POLICY_VERSION_MINIMUM 3.10) -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "-Wno-c++11-narrowing -Wno-narrowing -Wno-invalid-source-encoding -Wno-reserved-user-defined-literal") -endif() - include(cmake/EnumOption.cmake) if(EMSCRIPTEN) @@ -26,6 +22,14 @@ find_package(OpenSSL) if (${PLATFORM} STREQUAL "Desktop") set(PLATFORM_CPP "PLATFORM_DESKTOP") + if (MINGW) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc") + endif() + + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-narrowing -Wno-narrowing -Wno-invalid-source-encoding -Wno-reserved-user-defined-literal") + endif() + if (WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(misc/windows) @@ -102,6 +106,8 @@ CPMAddPackage( "ALSOFT_UTILS OFF" "LIBTYPE ${AL_LIBTYPE}" "ALSOFT_ENABLE_MODULES OFF" + "ALSOFT_STATIC_STDCXX ON" + "ALSOFT_STATIC_LIBGCC ON" ) # TODO: Clear this paths with * From 5717aeab24d80afe9de0c009986eb845c42f7d1b Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 21 Mar 2026 15:23:37 +0300 Subject: [PATCH 002/189] ADD: Web action --- .github/workflows/build.yml | 78 ++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7cc987..8931304 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ permissions: jobs: build-windows: - name: Windows Build + name: Build Windows runs-on: ubuntu-22.04 steps: @@ -73,7 +73,7 @@ jobs: ${{github.workspace}}/build/libz.dll build-linux: - name: Linux Build + name: Build Linux runs-on: ubuntu-latest steps: @@ -119,7 +119,7 @@ jobs: ${{github.workspace}}/build/MinecraftPE-server build-android: # pray to god - name: Build Android APK (${{ matrix.abi }}) + name: Build Android (${{ matrix.abi }}) runs-on: ubuntu-latest strategy: @@ -214,10 +214,59 @@ jobs: name: minecraftpe-apk-${{ matrix.abi }} path: ${{ github.workspace }}/build-apk/minecraftpe-*-debug.apk + build-web: + name: Build Web + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup caches + uses: ./.github/actions/setup-cache + with: + host: linux + target: linux + + - name: Setup Ninja + uses: ./.github/actions/setup-ninja + with: + host: linux + + - name: Setup emsdk + uses: mymindstorm/setup-emsdk@v14 + with: + version: 5.0.3 + actions-cache-folder: 'emsdk-cache' + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/emsdk-cache/emsdk-main/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" + + - name: Build + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target MinecraftPE --parallel + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: mcpe-web + path: | + ${{github.workspace}}/build/MinecraftPE.js + ${{github.workspace}}/build/MinecraftPE.wasm + ${{github.workspace}}/build/MinecraftPE.data + publish: name: Publish runs-on: ubuntu-latest - needs: [ build-windows, build-linux, build-android ] + needs: [ build-windows, build-linux, build-android, build-web ] if: github.ref == 'refs/heads/main' steps: - name: Checkout @@ -235,16 +284,14 @@ jobs: - name: Zip Windows Artifacts uses: vimtor/action-zip@v1.2 with: - files: data mcpe-windows/MinecraftPE.exe mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/libz.dll + files: mcpe-windows/MinecraftPE.exe mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/libz.dll dest: minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip - recursive: false - name: Zip Linux Artifacts uses: vimtor/action-zip@v1.2 with: - files: data mcpe-linux/MinecraftPE + files: mcpe-linux/MinecraftPE dest: minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip - recursive: false - name: Zip Linux Server Artifacts uses: vimtor/action-zip@v1.2 @@ -264,6 +311,18 @@ jobs: files: minecraftpe-apk-armeabi-v7a/minecraftpe-v7a-debug.apk dest: minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip + - name: Zip Web Artifact + uses: vimtor/action-zip@v1.2 + with: + files: mcpe-web/MinecraftPE.js mcpe-web/MinecraftPE.wasm mcpe-web/MinecraftPE.data misc/web/index.html + dest: minecraftpe-${{ steps.ref.outputs.hash }}-web.zip + + - name: Zip Data + uses: vimtor/action-zip@v1.2 + with: + files: data + recursive: false + - name: Update Development Release uses: andelf/nightly-release@main env: @@ -278,4 +337,5 @@ jobs: ./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip ./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip - ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip \ No newline at end of file + ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip + ./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip \ No newline at end of file From 668fc9d16fc75bd4e8eacf1a2a4a0ce4838cc3f4 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 21 Mar 2026 15:25:18 +0300 Subject: [PATCH 003/189] oh i forgot data --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8931304..eba5db7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -322,6 +322,7 @@ jobs: with: files: data recursive: false + dest: data.zip - name: Update Development Release uses: andelf/nightly-release@main @@ -333,6 +334,7 @@ jobs: body: | MinecraftPE development release for commit ${{ github.sha }}. files: | + ./data.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip ./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip From 298451c29017d4efaf6b9cd73085dded24af12c1 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 21 Mar 2026 15:28:50 +0300 Subject: [PATCH 004/189] USE_LIBPNG when compile web --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1c2e4e..39809fb 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -327,7 +327,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC if(${PLATFORM} MATCHES "Web") set(CMAKE_CXX_STANDARD 11) # uuuh i hate it - set(EM_FLAGS "-pthread -sUSE_PTHREADS=1 -sSHARED_MEMORY=1") + set(EM_FLAGS "-pthread -sUSE_PTHREADS=1 -sUSE_LIBPNG=1 -sSHARED_MEMORY=1") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EM_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EM_FLAGS}") From e9766ed2a149c291b5a0b45fc7f037f3f44f83f7 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 15:44:05 +0200 Subject: [PATCH 005/189] FEAT: Option button in PauseScreen --- src/client/gui/screens/OptionsScreen.cpp | 6 +++++- src/client/gui/screens/PauseScreen.cpp | 22 +++++++++++++++++----- src/client/gui/screens/PauseScreen.h | 4 +++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index adeb5be..b1e7828 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -153,7 +153,11 @@ void OptionsScreen::buttonClicked(Button* button) { if (button == btnClose) { minecraft->options.save(); - minecraft->screenChooser.setScreen(SCREEN_STARTMENU); + if (minecraft->screen != NULL) { + minecraft->setScreen(NULL); + } else { + minecraft->screenChooser.setScreen(SCREEN_STARTMENU); + } } else if (button->id > 1 && button->id < 7) { int categoryButton = button->id - categoryButtons[0]->id; diff --git a/src/client/gui/screens/PauseScreen.cpp b/src/client/gui/screens/PauseScreen.cpp index aac6f21..46d99cd 100755 --- a/src/client/gui/screens/PauseScreen.cpp +++ b/src/client/gui/screens/PauseScreen.cpp @@ -5,12 +5,16 @@ #include "../../../util/Mth.h" #include "../../../network/RakNetInstance.h" #include "../../../network/ServerSideNetworkHandler.h" +#include "client/Options.h" +#include "client/gui/components/Button.h" +#include "client/gui/screens/OptionsScreen.h" PauseScreen::PauseScreen(bool wasBackPaused) : saveStep(0), visibleTime(0), bContinue(0), bQuit(0), + bOptions(0), bQuitAndSaveLocally(0), bServerVisibility(0), // bThirdPerson(0), @@ -39,18 +43,21 @@ PauseScreen::~PauseScreen() { delete bQuit; delete bQuitAndSaveLocally; delete bServerVisibility; + delete bOptions; // delete bThirdPerson; } void PauseScreen::init() { if (minecraft->useTouchscreen()) { bContinue = new Touch::TButton(1, "Back to game"); + bOptions = new Touch::TButton(5, "Options"); bQuit = new Touch::TButton(2, "Quit to title"); bQuitAndSaveLocally = new Touch::TButton(3, "Quit and copy map"); bServerVisibility = new Touch::TButton(4, ""); // bThirdPerson = new Touch::TButton(5, "Toggle 3:rd person view"); } else { bContinue = new Button(1, "Back to game"); + bOptions = new Button(5, "Options"); bQuit = new Button(2, "Quit to title"); bQuitAndSaveLocally = new Button(3, "Quit and copy map"); bServerVisibility = new Button(4, ""); @@ -59,7 +66,7 @@ void PauseScreen::init() { buttons.push_back(bContinue); buttons.push_back(bQuit); - + buttons.push_back(bOptions); // bSound.updateImage(&minecraft->options); bThirdPerson.updateImage(&minecraft->options); bHideGui.updateImage(&minecraft->options); @@ -99,21 +106,24 @@ void PauseScreen::setupPositions() { saveStep = 0; int yBase = 16; - bContinue->width = bQuit->width = /*bThirdPerson->w =*/ 160; + bContinue->width = bOptions->width = bQuit->width = /*bThirdPerson->w =*/ 160; bQuitAndSaveLocally->width = bServerVisibility->width = 160; bContinue->x = (width - bContinue->width) / 2; bContinue->y = yBase + 32 * 1; + bOptions->x = (width - bOptions->width) / 2; + bOptions->y = yBase + 32 * 2; + bQuit->x = (width - bQuit->width) / 2; - bQuit->y = yBase + 32 * 2; + bQuit->y = yBase + 32 * 3; #if APPLE_DEMO_PROMOTION bQuit->y += 16; #endif bQuitAndSaveLocally->x = bServerVisibility->x = (width - bQuitAndSaveLocally->width) / 2; - bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 3; + bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 4; // bSound.y = bThirdPerson.y = 8; // bSound.x = 4; @@ -157,7 +167,9 @@ void PauseScreen::buttonClicked(Button* button) { if (button->id == bQuitAndSaveLocally->id) { minecraft->leaveGame(true); } - + if (button->id == bOptions->id) { + minecraft->setScreen(new OptionsScreen()); + } if (button->id == bServerVisibility->id) { if (minecraft->raknetInstance && minecraft->netCallback && minecraft->raknetInstance->isServer()) { ServerSideNetworkHandler* ss = (ServerSideNetworkHandler*) minecraft->netCallback; diff --git a/src/client/gui/screens/PauseScreen.h b/src/client/gui/screens/PauseScreen.h index 6f6a078..4098511 100755 --- a/src/client/gui/screens/PauseScreen.h +++ b/src/client/gui/screens/PauseScreen.h @@ -33,7 +33,9 @@ private: Button* bQuit; Button* bQuitAndSaveLocally; Button* bServerVisibility; -// Button* bThirdPerson; + Button* bOptions; + + // Button* bThirdPerson; // OptionButton bSound; OptionButton bThirdPerson; From 6e0615c0bc2d0adeb729481a0d3378510fc50bcd Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 16:03:51 +0200 Subject: [PATCH 006/189] FEAT: Auto jump in settings (again) --- data/lang/en_US.lang | 2 +- src/client/Minecraft.cpp | 1 - src/client/gui/Gui.cpp | 2 +- src/client/gui/screens/OptionsScreen.cpp | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/lang/en_US.lang b/data/lang/en_US.lang index d4b83d5..4bb15e2 100755 --- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -153,7 +153,7 @@ options.group.tweaks=Tweaks options.allowSprint=Allow sprint options.barOnTop=HUD above inventory options.rpiCursor=Show Raspberry PI cursor -options.autojump=Auto Jump +options.autoJump=Auto Jump options.thirdperson=Third Person options.servervisible=Server Visible options.sensitivity=Sensitivity diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 5b03708..8d38c06 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1228,7 +1228,6 @@ void Minecraft::reloadOptions() { if ((wasTouchscreen != useTouchscreen()) || (inputHolder == 0)) _reloadInput(); - // TODO: // user->name = options.username; LOGI("Reloading-options\n"); diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index cf1ab58..b7c462e 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -349,7 +349,7 @@ void Gui::setNowPlaying(const std::string& string) { void Gui::displayClientMessage(const std::string& messageId) { //Language language = Language.getInstance(); //std::string languageString = language.getElement(messageId); - addMessage(std::string("Client message: ") + messageId); + addMessage(messageId); } void Gui::renderVignette(float br, int w, int h) { diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index b1e7828..a7875dd 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -213,7 +213,8 @@ void OptionsScreen::generateOptionScreens() { // // Controls Pane optionPanes[2]->addOptionItem(OPTIONS_INVERT_Y_MOUSE, minecraft) - .addOptionItem(OPTIONS_USE_TOUCHSCREEN, minecraft); + .addOptionItem(OPTIONS_USE_TOUCHSCREEN, minecraft) + .addOptionItem(OPTIONS_AUTOJUMP, minecraft); for (int i = OPTIONS_KEY_FORWARD; i <= OPTIONS_KEY_USE; i++) { optionPanes[2]->addOptionItem((OptionId)i, minecraft); From f114536463a1d13cda4196903621d647586a1b26 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 21 Mar 2026 17:19:46 +0300 Subject: [PATCH 007/189] FIX: improve web port --- CMakeLists.txt | 3 +- misc/web/index.html | 172 +++++++++-------------------------------- src/AppPlatform_glfw.h | 27 ++++++- 3 files changed, 63 insertions(+), 139 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39809fb..1711d1c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ if(${PLATFORM} MATCHES "Web") add_library(png INTERFACE IMPORTED) set_target_properties(png PROPERTIES + INTERFACE_COMPILE_OPTIONS "-sUSE_LIBPNG=1" INTERFACE_LINK_OPTIONS "-sUSE_LIBPNG=1" ) @@ -331,7 +332,7 @@ if(${PLATFORM} MATCHES "Web") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EM_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EM_FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EM_FLAGS} --preload-file ${CMAKE_SOURCE_DIR}/data@/data -sPROXY_TO_PTHREAD") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EM_FLAGS} --preload-file ${CMAKE_SOURCE_DIR}/data@/data") target_compile_options(${PROJECT_NAME} PUBLIC "-Os" diff --git a/misc/web/index.html b/misc/web/index.html index 108e109..eed3f5b 100644 --- a/misc/web/index.html +++ b/misc/web/index.html @@ -1,143 +1,43 @@ - - - - - - Emscripten-Generated Code - + + - - - -
-
emscripten
-
Downloading...
-
- -
-
- -
-
-
- Resize canvas - Lock/hide mouse pointer -     - -
+ -
- -
- - var Module = { - print(...args) { - // These replacements are necessary if you render to raw HTML - //text = text.replace(/&/g, "&"); - //text = text.replace(//g, ">"); - //text = text.replace('\n', '
', 'g'); - console.log(...args); - if (outputElement) { - var text = args.join(' '); - outputElement.value += text + "\n"; - outputElement.scrollTop = outputElement.scrollHeight; // focus on bottom - } - }, - canvas: canvasElement, - setStatus: setStatus, - totalDependencies: 0, - monitorRunDependencies(left) { - this.totalDependencies = Math.max(this.totalDependencies, left); - setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); - } - }; - setStatus('Downloading...'); - window.onerror = () => { - setStatus('Exception thrown, see JavaScript console'); - spinnerElement.style.display = 'none'; - setStatus = (text) => { - if (text) console.error('[post-exception status] ' + text); - }; - }; - - - + + \ No newline at end of file diff --git a/src/AppPlatform_glfw.h b/src/AppPlatform_glfw.h index 0e2e505..619ae57 100755 --- a/src/AppPlatform_glfw.h +++ b/src/AppPlatform_glfw.h @@ -20,6 +20,10 @@ #include #endif +#ifdef __EMSCRIPTEN__ + #include +#endif + static void png_funcReadFile(png_structp pngPtr, png_bytep data, png_size_t length) { ((std::istream*)png_get_io_ptr(pngPtr))->read((char*)data, length); } @@ -102,8 +106,27 @@ public: return std::string(mbstr); } - virtual int getScreenWidth() override { return 854; }; - virtual int getScreenHeight() override { return 480; }; + virtual int getScreenWidth() override { + #ifdef __EMSCRIPTEN__ + int w, h; + emscripten_get_canvas_element_size("canvas", &w, &h); + + return w; + #endif + + return 854; + }; + + virtual int getScreenHeight() override { + #ifdef __EMSCRIPTEN__ + int w, h; + emscripten_get_canvas_element_size("canvas", &w, &h); + + return h; + #endif + + return 480; + }; virtual float getPixelsPerMillimeter() override; From b94c16b22a5ae416328771e15a5970f7d7bec827 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 16:22:50 +0200 Subject: [PATCH 008/189] FIX: Bow release --- src/client/Minecraft.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 8d38c06..8feb6c9 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -872,6 +872,10 @@ void Minecraft::tickInput() { if (inputHolder && inputHolder->getBuildInput()->tickBuild(player, &bai)) { handleBuildAction(&bai); } + + if (!Mouse::isButtonDown(MouseAction::ACTION_RIGHT)) { + gameMode->releaseUsingItem(player); + } } else { // Desktop: left mouse = destroy/attack if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) { From 3f6d9cdcb8d62abda04332d870187fe0375b9611 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 18:10:46 +0200 Subject: [PATCH 009/189] FIX: Armor display --- src/client/renderer/entity/PlayerRenderer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/renderer/entity/PlayerRenderer.cpp b/src/client/renderer/entity/PlayerRenderer.cpp index 6a773f0..96ee2eb 100755 --- a/src/client/renderer/entity/PlayerRenderer.cpp +++ b/src/client/renderer/entity/PlayerRenderer.cpp @@ -17,8 +17,8 @@ PlayerRenderer::PlayerRenderer( HumanoidModel* humanoidModel, float shadow ) : super(humanoidModel, shadow), playerModel64(humanoidModel), playerModel32(new HumanoidModel(0, 0, 64, 32)), - armorParts1(new HumanoidModel(1.0f, 0, 64, 64)), - armorParts2(new HumanoidModel(0.5f, 0, 64, 64)) + armorParts1(new HumanoidModel(1.0f, 0, 64, 32)), + armorParts2(new HumanoidModel(0.5f, 0, 64, 32)) { // default to legacy skin path until we know the exact texture size model = playerModel32; @@ -77,10 +77,10 @@ void PlayerRenderer::render(Entity* mob_, float x, float y, float z, float rot, model = desired; humanoidModel = desired; } - // LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", - // ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), - // humanoidModel->texWidth, humanoidModel->texHeight, - // (desired == playerModel64 ? "64" : "32")); + LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", + ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), + humanoidModel->texWidth, humanoidModel->texHeight, + (desired == playerModel64 ? "64" : "32")); HumanoidMobRenderer::render(mob_, x, y, z, rot, a); } From 98a05e5aa3dbfac4472383a091f6f3863e256002 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 18:25:42 +0200 Subject: [PATCH 010/189] FIX: Keyboard on android --- src/client/gui/screens/OptionsScreen.cpp | 8 -------- src/client/player/input/touchscreen/TouchscreenInput.cpp | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index a7875dd..11b87c1 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -19,7 +19,6 @@ OptionsScreen::OptionsScreen() } OptionsScreen::~OptionsScreen() { - if (btnClose != NULL) { delete btnClose; btnClose = NULL; @@ -53,7 +52,6 @@ OptionsScreen::~OptionsScreen() { } void OptionsScreen::init() { - bHeader = new Touch::THeader(0, "Options"); btnClose = new ImageButton(1, ""); @@ -89,7 +87,6 @@ void OptionsScreen::init() { } void OptionsScreen::setupPositions() { - int buttonHeight = btnClose->height; btnClose->x = width - btnClose->width; @@ -134,7 +131,6 @@ void OptionsScreen::setupPositions() { void OptionsScreen::render(int xm, int ym, float a) { - renderBackground(); int xmm = xm * width / minecraft->width; @@ -150,7 +146,6 @@ void OptionsScreen::removed() { } void OptionsScreen::buttonClicked(Button* button) { - if (button == btnClose) { minecraft->options.save(); if (minecraft->screen != NULL) { @@ -169,7 +164,6 @@ void OptionsScreen::buttonClicked(Button* button) { } void OptionsScreen::selectCategory(int index) { - int currentIndex = 0; for (std::vector::iterator it = categoryButtons.begin(); it != categoryButtons.end(); ++it) { @@ -235,7 +229,6 @@ void OptionsScreen::generateOptionScreens() { } void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { - if (currentOptionsGroup != NULL) currentOptionsGroup->mouseClicked(minecraft, x, y, buttonNum); @@ -243,7 +236,6 @@ void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { } void OptionsScreen::mouseReleased(int x, int y, int buttonNum) { - if (currentOptionsGroup != NULL) currentOptionsGroup->mouseReleased(minecraft, x, y, buttonNum); diff --git a/src/client/player/input/touchscreen/TouchscreenInput.cpp b/src/client/player/input/touchscreen/TouchscreenInput.cpp index 41474f3..b00f7e8 100755 --- a/src/client/player/input/touchscreen/TouchscreenInput.cpp +++ b/src/client/player/input/touchscreen/TouchscreenInput.cpp @@ -320,6 +320,7 @@ void TouchscreenInput_TestFps::tick( Player* player ) if (Multitouch::isReleased(p)) { _minecraft->soundEngine->playUI("random.click", 1, 1); _minecraft->screenChooser.setScreen(SCREEN_CONSOLE); + _minecraft->platform()->showKeyboard(); } } From 2bfa8f11f1b736bfa3535a8f94bff5d0caee0223 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 18:39:08 +0200 Subject: [PATCH 011/189] hmm --- src/client/Minecraft.cpp | 10 ++++++---- .../player/input/touchscreen/TouchscreenInput.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 8feb6c9..d85b529 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -866,15 +866,17 @@ void Minecraft::tickInput() { gameMode->stopDestroyBlock(); } + if (!Mouse::isButtonDown(MouseAction::ACTION_RIGHT)) { + gameMode->releaseUsingItem(player); + } + if (useTouchscreen()) { // Touch: gesture recognizer classifies the action type (turn/destroy/build) BuildActionIntention bai; if (inputHolder && inputHolder->getBuildInput()->tickBuild(player, &bai)) { handleBuildAction(&bai); - } - - if (!Mouse::isButtonDown(MouseAction::ACTION_RIGHT)) { - gameMode->releaseUsingItem(player); + } else { + gameMode->stopDestroyBlock(); } } else { // Desktop: left mouse = destroy/attack diff --git a/src/client/player/input/touchscreen/TouchscreenInput.cpp b/src/client/player/input/touchscreen/TouchscreenInput.cpp index b00f7e8..563de6c 100755 --- a/src/client/player/input/touchscreen/TouchscreenInput.cpp +++ b/src/client/player/input/touchscreen/TouchscreenInput.cpp @@ -164,7 +164,7 @@ void TouchscreenInput_TestFps::onConfigChanged(const Config& c) { float maxPixels = _minecraft->pixelCalc.millimetersToPixels(10); // float btnSize = Mth::Min(18 * Gui::GuiScale, maxPixels); - float btnSize = pc.millimetersToPixels(50); + float btnSize = pc.millimetersToPixels(50 * Gui::GuiScale); _model.addArea(AREA_PAUSE, aPause = new RectangleArea(w - 4 - btnSize, 4, w - 4, 4 + btnSize)); _model.addArea(AREA_CHAT, aChat = new RectangleArea(w - 8 - btnSize * 2, 4, w - 8 - btnSize, 4 + btnSize)); From 13c624e07e7ce0ff1713a8da4fe8622017d8777f Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 18:54:04 +0200 Subject: [PATCH 012/189] hmmmmmmmmmm --- src/client/Minecraft.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index d85b529..e8f040d 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -873,10 +873,11 @@ void Minecraft::tickInput() { if (useTouchscreen()) { // Touch: gesture recognizer classifies the action type (turn/destroy/build) BuildActionIntention bai; - if (inputHolder && inputHolder->getBuildInput()->tickBuild(player, &bai)) { - handleBuildAction(&bai); - } else { - gameMode->stopDestroyBlock(); + bool buildHandled = inputHolder->getBuildInput()->tickBuild(player, &bai); + + if (buildHandled) { + if (!bai.isRemoveContinue()) + handleBuildAction(&bai); } } else { // Desktop: left mouse = destroy/attack From b088f39e52f33a9fcef33f38b8b5badad321f26e Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 18:54:51 +0200 Subject: [PATCH 013/189] emm --- src/client/player/input/touchscreen/TouchscreenInput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/player/input/touchscreen/TouchscreenInput.cpp b/src/client/player/input/touchscreen/TouchscreenInput.cpp index 563de6c..37cb6d8 100755 --- a/src/client/player/input/touchscreen/TouchscreenInput.cpp +++ b/src/client/player/input/touchscreen/TouchscreenInput.cpp @@ -164,7 +164,7 @@ void TouchscreenInput_TestFps::onConfigChanged(const Config& c) { float maxPixels = _minecraft->pixelCalc.millimetersToPixels(10); // float btnSize = Mth::Min(18 * Gui::GuiScale, maxPixels); - float btnSize = pc.millimetersToPixels(50 * Gui::GuiScale); + float btnSize = pc.millimetersToPixels(18 * Gui::GuiScale); _model.addArea(AREA_PAUSE, aPause = new RectangleArea(w - 4 - btnSize, 4, w - 4, 4 + btnSize)); _model.addArea(AREA_CHAT, aChat = new RectangleArea(w - 8 - btnSize * 2, 4, w - 8 - btnSize, 4 + btnSize)); From a16f76f2b6fc0281b9f43b8a28599c57631a7fd3 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 19:05:00 +0200 Subject: [PATCH 014/189] idk??? --- src/client/Minecraft.cpp | 33 +++++++++++++++++++++++++++++++++ src/client/Minecraft.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index e8f040d..0cc8e44 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -879,6 +879,13 @@ void Minecraft::tickInput() { if (!bai.isRemoveContinue()) handleBuildAction(&bai); } +#ifdef __ANDROID__ + bool isTryingToDestroyBlock = (options.useMouseForDigging + ? (Mouse::isButtonDown(MouseAction::ACTION_LEFT) && mouseDiggable) + : Keyboard::isKeyDown(options.keyDestroy.key)) + || (buildHandled && bai.isRemove()); + handleMouseDown(MouseAction::ACTION_LEFT, isTryingToDestroyBlock || (buildHandled && bai.isInteract())); +#endif } else { // Desktop: left mouse = destroy/attack if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) { @@ -921,6 +928,32 @@ void Minecraft::tickInput() { TIMER_POP(); #endif } +void Minecraft::handleMouseDown(int button, bool down) { +#ifndef STANDALONE_SERVER +#ifndef RPI + if(player->isUsingItem()) { + if(!down && !Keyboard::isKeyDown(options.keyUse.key)) { + gameMode->releaseUsingItem(player); + } + return; + } +#endif + if(player->isSleeping()) { + return; + } + if (button == MouseAction::ACTION_LEFT && missTime > 0) return; + if (down && hitResult.type == TILE && button == MouseAction::ACTION_LEFT && !hitResult.indirectHit) { + int x = hitResult.x; + int y = hitResult.y; + int z = hitResult.z; + gameMode->continueDestroyBlock(x, y, z, hitResult.f); + particleEngine->crack(x, y, z, hitResult.f); + player->swing(); + } else { + gameMode->stopDestroyBlock(); + } +#endif +} void Minecraft::handleBuildAction(BuildActionIntention* action) { #ifndef STANDALONE_SERVER diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index cd9dcce..1a90b12 100755 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -109,6 +109,8 @@ public: bool isLevelGenerated(); + void handleMouseDown(int button, bool down); + void audioEngineOn(); void audioEngineOff(); From 5251085752e513a236be09198caeaf09c1e90253 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 19:09:11 +0200 Subject: [PATCH 015/189] i broke all --- src/client/Minecraft.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 0cc8e44..e200797 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -880,10 +880,7 @@ void Minecraft::tickInput() { handleBuildAction(&bai); } #ifdef __ANDROID__ - bool isTryingToDestroyBlock = (options.useMouseForDigging - ? (Mouse::isButtonDown(MouseAction::ACTION_LEFT) && mouseDiggable) - : Keyboard::isKeyDown(options.keyDestroy.key)) - || (buildHandled && bai.isRemove()); + bool isTryingToDestroyBlock = buildHandled && bai.isRemove(); handleMouseDown(MouseAction::ACTION_LEFT, isTryingToDestroyBlock || (buildHandled && bai.isInteract())); #endif } else { @@ -930,9 +927,9 @@ void Minecraft::tickInput() { } void Minecraft::handleMouseDown(int button, bool down) { #ifndef STANDALONE_SERVER -#ifndef RPI +#ifdef __ANDROID__ if(player->isUsingItem()) { - if(!down && !Keyboard::isKeyDown(options.keyUse.key)) { + if(!down) { gameMode->releaseUsingItem(player); } return; From 2acb57d051ac2eed1e958cc450cf6ea494652d31 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 19:19:07 +0200 Subject: [PATCH 016/189] revert all sht --- src/client/Minecraft.cpp | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index e200797..3d783bb 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -873,16 +873,12 @@ void Minecraft::tickInput() { if (useTouchscreen()) { // Touch: gesture recognizer classifies the action type (turn/destroy/build) BuildActionIntention bai; - bool buildHandled = inputHolder->getBuildInput()->tickBuild(player, &bai); - if (buildHandled) { - if (!bai.isRemoveContinue()) - handleBuildAction(&bai); + if (inputHolder && inputHolder->getBuildInput()->tickBuild(player, &bai)) { + handleBuildAction(&bai); + } else { + gameMode->stopDestroyBlock(); } -#ifdef __ANDROID__ - bool isTryingToDestroyBlock = buildHandled && bai.isRemove(); - handleMouseDown(MouseAction::ACTION_LEFT, isTryingToDestroyBlock || (buildHandled && bai.isInteract())); -#endif } else { // Desktop: left mouse = destroy/attack if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) { @@ -925,32 +921,6 @@ void Minecraft::tickInput() { TIMER_POP(); #endif } -void Minecraft::handleMouseDown(int button, bool down) { -#ifndef STANDALONE_SERVER -#ifdef __ANDROID__ - if(player->isUsingItem()) { - if(!down) { - gameMode->releaseUsingItem(player); - } - return; - } -#endif - if(player->isSleeping()) { - return; - } - if (button == MouseAction::ACTION_LEFT && missTime > 0) return; - if (down && hitResult.type == TILE && button == MouseAction::ACTION_LEFT && !hitResult.indirectHit) { - int x = hitResult.x; - int y = hitResult.y; - int z = hitResult.z; - gameMode->continueDestroyBlock(x, y, z, hitResult.f); - particleEngine->crack(x, y, z, hitResult.f); - player->swing(); - } else { - gameMode->stopDestroyBlock(); - } -#endif -} void Minecraft::handleBuildAction(BuildActionIntention* action) { #ifndef STANDALONE_SERVER From 4f8b18b735aaf785af2a828e19f622d0fccd000e Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sun, 22 Mar 2026 02:12:04 +0300 Subject: [PATCH 017/189] FIX: Now we're using useTouchsceen() right way!!!! --- misc/web/index.html | 3 + src/AppPlatform_glfw.h | 4 +- src/client/Minecraft.cpp | 275 +++++++++--------- src/client/MouseHandler.cpp | 6 +- src/client/OptionsFile.cpp | 2 + src/client/gui/Gui.cpp | 41 +-- src/client/gui/Gui.h | 2 + src/client/gui/Screen.cpp | 5 + src/client/gui/components/Button.cpp | 5 +- src/client/gui/components/ImageButton.cpp | 2 +- .../gui/components/LargeImageButton.cpp | 2 +- src/client/gui/screens/ConfirmScreen.cpp | 2 +- src/client/gui/screens/DeathScreen.cpp | 2 +- src/client/gui/screens/DisconnectionScreen.h | 2 +- src/client/gui/screens/InBedScreen.cpp | 2 +- src/client/gui/screens/PauseScreen.cpp | 2 +- src/client/gui/screens/ProgressScreen.h | 2 + src/client/gui/screens/ScreenChooser.cpp | 2 +- .../gui/screens/SimpleChooseLevelScreen.cpp | 2 +- .../screens/crafting/PaneCraftingScreen.cpp | 4 +- src/client/player/input/KeyboardInput.cpp | 6 +- src/client/renderer/GameRenderer.cpp | 15 +- src/main_glfw.h | 14 +- 23 files changed, 193 insertions(+), 209 deletions(-) diff --git a/misc/web/index.html b/misc/web/index.html index eed3f5b..6eb328d 100644 --- a/misc/web/index.html +++ b/misc/web/index.html @@ -36,6 +36,9 @@ } window.addEventListener('resize', resizeCanvas); + window.addEventListener('onunload', () => { + FS.syncfs(true, function (err) { console.log('Sync FS failed: ' + err) }); + }) diff --git a/src/AppPlatform_glfw.h b/src/AppPlatform_glfw.h index 619ae57..d996860 100755 --- a/src/AppPlatform_glfw.h +++ b/src/AppPlatform_glfw.h @@ -130,7 +130,7 @@ public: virtual float getPixelsPerMillimeter() override; - virtual bool supportsTouchscreen() override { return true; } + virtual bool supportsTouchscreen() override { return false; /* glfw supports only mouse and keyboard */ } virtual void hideCursor(bool hide) override { int isHide = hide ? GLFW_CURSOR_NORMAL : GLFW_CURSOR_HIDDEN; @@ -143,6 +143,8 @@ public: #elif __linux__ std::string command = "xdg-open " + url; system(command.c_str()); +#elif __EMSCRIPTEN__ + emscripten_run_script(std::string("window.open('" + url + "', '_blank')").c_str()); #endif } diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 8d38c06..3c6b368 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1,4 +1,5 @@ #include "Minecraft.h" +#include "Options.h" #include "client/Options.h" #include "client/player/input/IBuildInput.h" #include "platform/input/Keyboard.h" @@ -640,13 +641,11 @@ void Minecraft::tickInput() { const MouseAction& e = Mouse::getEvent(); -#ifdef RPI // If clicked when not having focus, get focus @keyboard - if (!mouseGrabbed) { + if (!useTouchscreen() && !mouseGrabbed) { if (!screen && e.data == MouseAction::DATA_DOWN) { grabMouse(); } } -#endif if (allowGuiClicks && e.action == MouseAction::ACTION_LEFT && e.data == MouseAction::DATA_DOWN) { gui.handleClick(MouseAction::ACTION_LEFT, Mouse::getX(), Mouse::getY()); @@ -660,9 +659,7 @@ void Minecraft::tickInput() { Inventory* v = player->inventory; int numSlots = gui.getNumSlots(); -#ifndef PLATFORM_DESKTOP - numSlots--; -#endif + if (!useTouchscreen()) numSlots--; int slot = (v->selected - e.dy + numSlots) % numSlots; v->selectSlot(slot); @@ -691,155 +688,147 @@ void Minecraft::tickInput() { if (isPressed) { gui.handleKeyPressed(key); - #if defined(WIN32) || defined(RPI) || defined (PLATFORM_DESKTOP)//|| defined(_DEBUG) || defined(DEBUG) - if (key >= '0' && key <= '9') { - int digit = key - '0'; - int slot = digit - 1; + if (key >= '0' && key <= '9') { + int digit = key - '0'; + int slot = digit - 1; - if (slot >= 0 && slot < gui.getNumSlots()) - player->inventory->selectSlot(slot); + if (slot >= 0 && slot < gui.getNumSlots()) + player->inventory->selectSlot(slot); - #if defined(WIN32) - if (digit >= 1 && GetAsyncKeyState(VK_CONTROL) < 0) { - // Set adventure settings here! - AdventureSettingsPacket p(level->adventureSettings); - p.toggle((AdventureSettingsPacket::Flags)(1 << slot)); - p.fillIn(level->adventureSettings); - raknetInstance->send(p); - } - if (digit == 0) { - Pos pos((int)player->x, (int)player->y-1, (int)player->z); - SetSpawnPositionPacket p(pos); - raknetInstance->send(p); - } - #endif - } - #endif - #if defined(PLATFORM_DESKTOP) - if (key == Keyboard::KEY_LEFT_CTRL) { - player->setSprinting(true); + #if defined(WIN32) + if (digit >= 1 && GetAsyncKeyState(VK_CONTROL) < 0) { + // Set adventure settings here! + AdventureSettingsPacket p(level->adventureSettings); + p.toggle((AdventureSettingsPacket::Flags)(1 << slot)); + p.fillIn(level->adventureSettings); + raknetInstance->send(p); + } + if (digit == 0) { + Pos pos((int)player->x, (int)player->y-1, (int)player->z); + SetSpawnPositionPacket p(pos); + raknetInstance->send(p); + } + #endif + } + + if (key == Keyboard::KEY_LEFT_CTRL) { + player->setSprinting(true); + } + + if (key == Keyboard::KEY_E) { + screenChooser.setScreen(SCREEN_BLOCKSELECTION); + } + + if (!screen && key == Keyboard::KEY_T && level) { + setScreen(new ConsoleScreen()); + } + + if (key == Keyboard::KEY_F3) { + options.toggle(OPTIONS_RENDER_DEBUG); + } + + if (key == Keyboard::KEY_F5) { + options.toggle(OPTIONS_THIRD_PERSON_VIEW); + /* + ImprovedNoise noise; + for (int i = 0; i < 16; ++i) + printf("%d\t%f\n", i, noise.grad2(i, 3, 8)); + */ + } + + if (!screen && key == Keyboard::KEY_O || key == 250) { + releaseMouse(); + } + + if (key == Keyboard::KEY_F) { + int dst = options.getIntValue(OPTIONS_VIEW_DISTANCE); + options.set(OPTIONS_VIEW_DISTANCE, (dst + 1) % 4); + } + #ifdef CHEATS + if (key == Keyboard::KEY_U) { + onGraphicsReset(); + player->heal(100); } - if (key == Keyboard::KEY_E) { - screenChooser.setScreen(SCREEN_BLOCKSELECTION); - } + if (key == Keyboard::KEY_B || key == 108) // Toggle the game mode + setIsCreativeMode(!isCreativeMode()); - if (!screen && key == Keyboard::KEY_T && level) { - setScreen(new ConsoleScreen()); - } + if (key == Keyboard::KEY_P) // Step forward in time + level->setTime( level->getTime() + 1000); - if (key == Keyboard::KEY_F3) { - options.toggle(OPTIONS_RENDER_DEBUG); - } - - if (key == Keyboard::KEY_F5) { - options.toggle(OPTIONS_THIRD_PERSON_VIEW); + if (key == Keyboard::KEY_G) { + setScreen(new ArmorScreen()); /* - ImprovedNoise noise; - for (int i = 0; i < 16; ++i) - printf("%d\t%f\n", i, noise.grad2(i, 3, 8)); + std::vector& boxs = level->getCubes(NULL, AABB(128.1f, 73, 128.1f, 128.9f, 74.9f, 128.9f)); + LOGI("boxes: %d\n", (int)boxs.size()); */ } - if (!screen && key == Keyboard::KEY_O || key == 250) { - releaseMouse(); + if (key == Keyboard::KEY_Y) { + textures->reloadAll(); + player->hurtTo(2); + } + if (key == Keyboard::KEY_Z || key == 108) { + for (int i = 0; i < 1; ++i) { + Mob* mob = NULL; + int forceId = 0;//MobTypes::Sheep; + + int types[] = { + MobTypes::Sheep, + MobTypes::Pig, + MobTypes::Chicken, + MobTypes::Cow, + }; + + int mobType = (forceId > 0)? forceId : types[Mth::random(sizeof(types) / sizeof(int))]; + mob = MobFactory::CreateMob(mobType, level); + + //((Animal*)mob)->setAge(-1000); + float dx = 4 - 8 * Mth::random() + 4 * Mth::sin(Mth::DEGRAD * player->yRot); + float dz = 4 - 8 * Mth::random() + 4 * Mth::cos(Mth::DEGRAD * player->yRot); + if (mob && !MobSpawner::addMob(level, mob, player->x + dx, player->y, player->z + dz, Mth::random()*360, 0, true)) + delete mob; + } } - if (key == Keyboard::KEY_F) { - int dst = options.getIntValue(OPTIONS_VIEW_DISTANCE); - options.set(OPTIONS_VIEW_DISTANCE, (dst + 1) % 4); + if (key == Keyboard::KEY_X) { + const EntityList& entities = level->getAllEntities(); + for (int i = entities.size()-1; i >= 0; --i) { + Entity* e = entities[i]; + if (!e->isPlayer()) + level->removeEntity(e); + } } - #ifdef CHEATS - if (key == Keyboard::KEY_U) { - onGraphicsReset(); - player->heal(100); + + if (key == Keyboard::KEY_C /*|| key == 4*/) { + player->inventory->clearInventoryWithDefault(); + // @todo: Add saving here for benchmarking + } + if (key == Keyboard::KEY_H) { + setScreen( new PrerenderTilesScreen() ); + } + + if (key == Keyboard::KEY_O) { + for (int i = Inventory::MAX_SELECTION_SIZE; i < player->inventory->getContainerSize(); ++i) + if (player->inventory->getItem(i)) + player->inventory->dropSlot(i, false); + } + if (key == Keyboard::KEY_M) { + Difficulty difficulty = (Difficulty)options.getIntValue(OPTIONS_DIFFICULTY); + options.set(OPTIONS_DIFFICULTY, (difficulty == Difficulty::PEACEFUL)? + Difficulty::NORMAL : Difficulty::PEACEFUL); + //setIsCreativeMode( !isCreativeMode() ); + } + + if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { + if (key >= '0' && key <= '9') { + _perfRenderer->debugFpsMeterKeyPress(key - '0'); } - - if (key == Keyboard::KEY_B || key == 108) // Toggle the game mode - setIsCreativeMode(!isCreativeMode()); - - if (key == Keyboard::KEY_P) // Step forward in time - level->setTime( level->getTime() + 1000); - - if (key == Keyboard::KEY_G) { - setScreen(new ArmorScreen()); - /* - std::vector& boxs = level->getCubes(NULL, AABB(128.1f, 73, 128.1f, 128.9f, 74.9f, 128.9f)); - LOGI("boxes: %d\n", (int)boxs.size()); - */ - } - - if (key == Keyboard::KEY_Y) { - textures->reloadAll(); - player->hurtTo(2); - } - if (key == Keyboard::KEY_Z || key == 108) { - for (int i = 0; i < 1; ++i) { - Mob* mob = NULL; - int forceId = 0;//MobTypes::Sheep; - - int types[] = { - MobTypes::Sheep, - MobTypes::Pig, - MobTypes::Chicken, - MobTypes::Cow, - }; - - int mobType = (forceId > 0)? forceId : types[Mth::random(sizeof(types) / sizeof(int))]; - mob = MobFactory::CreateMob(mobType, level); - - //((Animal*)mob)->setAge(-1000); - float dx = 4 - 8 * Mth::random() + 4 * Mth::sin(Mth::DEGRAD * player->yRot); - float dz = 4 - 8 * Mth::random() + 4 * Mth::cos(Mth::DEGRAD * player->yRot); - if (mob && !MobSpawner::addMob(level, mob, player->x + dx, player->y, player->z + dz, Mth::random()*360, 0, true)) - delete mob; - } - } - - if (key == Keyboard::KEY_X) { - const EntityList& entities = level->getAllEntities(); - for (int i = entities.size()-1; i >= 0; --i) { - Entity* e = entities[i]; - if (!e->isPlayer()) - level->removeEntity(e); - } - } - - if (key == Keyboard::KEY_C /*|| key == 4*/) { - player->inventory->clearInventoryWithDefault(); - // @todo: Add saving here for benchmarking - } - if (key == Keyboard::KEY_H) { - setScreen( new PrerenderTilesScreen() ); - } - - if (key == Keyboard::KEY_O) { - for (int i = Inventory::MAX_SELECTION_SIZE; i < player->inventory->getContainerSize(); ++i) - if (player->inventory->getItem(i)) - player->inventory->dropSlot(i, false); - } - if (key == Keyboard::KEY_M) { - Difficulty difficulty = (Difficulty)options.getIntValue(OPTIONS_DIFFICULTY); - options.set(OPTIONS_DIFFICULTY, (difficulty == Difficulty::PEACEFUL)? - Difficulty::NORMAL : Difficulty::PEACEFUL); - //setIsCreativeMode( !isCreativeMode() ); - } - - if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { - if (key >= '0' && key <= '9') { - _perfRenderer->debugFpsMeterKeyPress(key - '0'); - } - } - #endif + } #endif - #ifndef PLATFORM_DESKTOP - if (key == 82) - pauseGame(false); - #else - if (key == Keyboard::KEY_ESCAPE) - pauseGame(false); - #endif + if (key == Keyboard::KEY_ESCAPE) + pauseGame(false); #ifndef OPENGL_ES if (key == Keyboard::KEY_P) { @@ -1112,7 +1101,7 @@ bool Minecraft::useTouchscreen() { #ifdef RPI return false; #endif - return options.getBooleanValue(OPTIONS_USE_TOUCHSCREEN) || !_supportsNonTouchscreen; + return options.getBooleanValue(OPTIONS_USE_TOUCHSCREEN) && !_supportsNonTouchscreen; } bool Minecraft::supportNonTouchScreen() { return _supportsNonTouchscreen; @@ -1241,11 +1230,7 @@ void Minecraft::_reloadInput() { #ifndef STANDALONE_SERVER delete inputHolder; -#ifdef PLATFORM_DESKTOP - const bool useTouchHolder = false; -#else const bool useTouchHolder = useTouchscreen(); -#endif if (useTouchHolder) { inputHolder = new TouchInputHolder(this, &options); } else { @@ -1570,6 +1555,8 @@ void Minecraft::optionUpdated(OptionId option, bool value ) { if(netCallback != NULL && option == OPTIONS_SERVER_VISIBLE) { ServerSideNetworkHandler* ss = (ServerSideNetworkHandler*) netCallback; ss->allowIncomingConnections(value); + } else if (option == OPTIONS_USE_TOUCHSCREEN) { + _reloadInput(); } } diff --git a/src/client/MouseHandler.cpp b/src/client/MouseHandler.cpp index d122950..d77e28b 100755 --- a/src/client/MouseHandler.cpp +++ b/src/client/MouseHandler.cpp @@ -5,7 +5,7 @@ #include #endif -#ifdef PLATFORM_DESKTOP +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) #include #endif @@ -34,7 +34,7 @@ void MouseHandler::grab() { SDL_ShowCursor(0); #endif -#ifdef PLATFORM_DESKTOP +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_DISABLED); #endif } @@ -46,7 +46,7 @@ void MouseHandler::release() { SDL_ShowCursor(1); #endif -#ifdef PLATFORM_DESKTOP +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_NORMAL); #endif } diff --git a/src/client/OptionsFile.cpp b/src/client/OptionsFile.cpp index 4601429..ef2a0dc 100755 --- a/src/client/OptionsFile.cpp +++ b/src/client/OptionsFile.cpp @@ -16,6 +16,8 @@ OptionsFile::OptionsFile() { settingsPath = "./Documents/options.txt"; #elif defined(ANDROID) settingsPath = "options.txt"; +#elif defined(__EMSCRIPTEN__) + settingsPath = "/games/com.mojang/options.txt"; #else settingsPath = "options.txt"; #endif diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index b7c462e..ccc9c26 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -51,7 +51,8 @@ Gui::Gui(Minecraft* minecraft) _currentDropTicks(-1), _currentDropSlot(-1), MAX_MESSAGE_WIDTH(240), - itemNameOverlayTime(2) + itemNameOverlayTime(2), + _openInventorySlot(minecraft->useTouchscreen()) { glGenBuffers2(1, &_inventoryRc.vboId); glGenBuffers2(1, &rcFeedbackInner.vboId); @@ -75,11 +76,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { //minecraft->gameRenderer->setupGuiScreen(); Font* font = minecraft->font; -#ifdef PLATFORM_DESKTOP - const bool isTouchInterface = false; -#else const bool isTouchInterface = minecraft->useTouchscreen(); -#endif + const int screenWidth = (int)(minecraft->width * InvGuiScale); const int screenHeight = (int)(minecraft->height * InvGuiScale); blitOffset = -90; @@ -206,16 +204,10 @@ void Gui::handleClick(int button, int x, int y) { if (button != MouseAction::ACTION_LEFT) return; int slot = getSlotIdAt(x, y); - if (slot != -1) - { -#ifndef PLATFORM_DESKTOP - if (slot == (getNumSlots()-1)) - { + if (slot != -1) { + if (_openInventorySlot && slot == (getNumSlots()-1)) { minecraft->screenChooser.setScreen(SCREEN_BLOCKSELECTION); - } - else -#endif - { + } else { minecraft->player->inventory->selectSlot(slot); itemNameOverlayTime = 0; } @@ -537,11 +529,7 @@ void Gui::tickItemDrop() static bool isCurrentlyActive = false; isCurrentlyActive = false; - int slots = getNumSlots(); - -#ifndef PLATFORM_DESKTOP - slots--; -#endif + int slots = getNumSlots() - _openInventorySlot; if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) { int slot = getSlotIdAt(Mouse::getX(), Mouse::getY()); @@ -1083,13 +1071,7 @@ void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) { float x = baseItemX; - int slots = getNumSlots(); - - // TODO: if using touchscreen - -#ifndef PLATFORM_DESKTOP - slots--; -#endif + int slots = getNumSlots() - _openInventorySlot; for (int i = 0; i < slots; i++) { renderSlot(i, (int)x, ySlot, a); @@ -1097,9 +1079,10 @@ void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) { } _inventoryNeedsUpdate = false; -#ifndef PLATFORM_DESKTOP - blit(screenWidth / 2 + 10 * getNumSlots() - 20 + 4, ySlot + 6, 242, 252, 14, 4, 14, 4); -#endif + + if (_openInventorySlot) { + blit(screenWidth / 2 + 10 * getNumSlots() - 20 + 4, ySlot + 6, 242, 252, 14, 4, 14, 4); + } minecraft->textures->loadAndBindTexture("gui/gui_blocks.png"); t.endOverrideAndDraw(); diff --git a/src/client/gui/Gui.h b/src/client/gui/Gui.h index 1c36f83..1335035 100755 --- a/src/client/gui/Gui.h +++ b/src/client/gui/Gui.h @@ -127,6 +127,8 @@ private: static const float DropTicks; float _currentDropTicks; int _currentDropSlot; + + bool _openInventorySlot; }; #endif /*NET_MINECRAFT_CLIENT_GUI__Gui_H__*/ diff --git a/src/client/gui/Screen.cpp b/src/client/gui/Screen.cpp index ae39036..a6bcc6f 100755 --- a/src/client/gui/Screen.cpp +++ b/src/client/gui/Screen.cpp @@ -177,9 +177,11 @@ void Screen::keyPressed( int eventKey ) textbox->keyPressed(minecraft, eventKey); } +#ifdef TABBING if (minecraft->useTouchscreen()) return; + // "Tabbing" the buttons (walking with keys) const int tabButtonCount = tabButtons.size(); if (!tabButtonCount) @@ -199,6 +201,7 @@ void Screen::keyPressed( int eventKey ) } updateTabButtonSelection(); +#endif } void Screen::charPressed(char inputChar) { @@ -209,11 +212,13 @@ void Screen::charPressed(char inputChar) { void Screen::updateTabButtonSelection() { +#ifdef TABBING if (minecraft->useTouchscreen()) return; for (unsigned int i = 0; i < tabButtons.size(); ++i) tabButtons[i]->selected = (i == tabButtonIndex); +#endif } void Screen::mouseClicked( int x, int y, int buttonNum ) diff --git a/src/client/gui/components/Button.cpp b/src/client/gui/components/Button.cpp index e03ae37..39022a7 100755 --- a/src/client/gui/components/Button.cpp +++ b/src/client/gui/components/Button.cpp @@ -95,7 +95,7 @@ void Button::renderBg( Minecraft* minecraft, int xm, int ym ) } bool Button::hovered(Minecraft* minecraft, int xm , int ym) { - return minecraft->useTouchscreen()? (_currentlyDown && isInside(xm, ym)) : false; + return minecraft->useTouchscreen()? (_currentlyDown && isInside(xm, ym)) : isInside(xm, ym); } bool Button::isInside( int xm, int ym ) { @@ -143,7 +143,8 @@ TButton::TButton( int id, int x, int y, int w, int h, const std::string& msg ) void TButton::renderBg( Minecraft* minecraft, int xm, int ym ) { - bool hovered = active && (minecraft->useTouchscreen()? (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : false); + bool hovered = active && (minecraft->useTouchscreen()? (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : isInside(xm, ym)); + // bool hovered = active && (_currentlyDown && isInside(xm, ym)); minecraft->textures->loadAndBindTexture("gui/touchgui.png"); diff --git a/src/client/gui/components/ImageButton.cpp b/src/client/gui/components/ImageButton.cpp index 1c7a57a..3d95acc 100755 --- a/src/client/gui/components/ImageButton.cpp +++ b/src/client/gui/components/ImageButton.cpp @@ -42,7 +42,7 @@ void ImageButton::render(Minecraft* minecraft, int xm, int ym) { //minecraft->textures->loadAndBindTexture("gui/gui.png"); glColor4f2(1, 1, 1, 1); - bool hovered = active && (minecraft->useTouchscreen()? (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : false); + bool hovered = active && (minecraft->useTouchscreen()? (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : isInside(xm, ym)); bool IsSecondImage = isSecondImage(hovered); //printf("ButtonId: %d - Hovered? %d (cause: %d, %d, %d, %d, <> %d, %d)\n", id, hovered, x, y, x+w, y+h, xm, ym); diff --git a/src/client/gui/components/LargeImageButton.cpp b/src/client/gui/components/LargeImageButton.cpp index 673d983..db1f599 100755 --- a/src/client/gui/components/LargeImageButton.cpp +++ b/src/client/gui/components/LargeImageButton.cpp @@ -33,7 +33,7 @@ void LargeImageButton::render(Minecraft* minecraft, int xm, int ym) { //minecraft->textures->loadAndBindTexture("gui/gui.png"); glColor4f2(1, 1, 1, 1); - bool hovered = active && (minecraft->useTouchscreen()? (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : false); + bool hovered = active && (minecraft->useTouchscreen()? (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : isInside(xm, ym)); //printf("ButtonId: %d - Hovered? %d (cause: %d, %d, %d, %d, <> %d, %d)\n", id, hovered, x, y, x+w, y+h, xm, ym); //int yImage = getYImage(hovered || selected); diff --git a/src/client/gui/screens/ConfirmScreen.cpp b/src/client/gui/screens/ConfirmScreen.cpp index ce911c6..2529549 100755 --- a/src/client/gui/screens/ConfirmScreen.cpp +++ b/src/client/gui/screens/ConfirmScreen.cpp @@ -31,7 +31,7 @@ ConfirmScreen::~ConfirmScreen() { void ConfirmScreen::init() { - if (minecraft->useTouchscreen()) { + if (/* minecraft->useTouchscreen() */ true) { yesButton = new Touch::TButton(0, 0, 0, yesButtonText), noButton = new Touch::TButton(1, 0, 0, noButtonText); } else { diff --git a/src/client/gui/screens/DeathScreen.cpp b/src/client/gui/screens/DeathScreen.cpp index a5685dc..411b148 100755 --- a/src/client/gui/screens/DeathScreen.cpp +++ b/src/client/gui/screens/DeathScreen.cpp @@ -23,7 +23,7 @@ DeathScreen::~DeathScreen() void DeathScreen::init() { - if (minecraft->useTouchscreen()) { + if (/* minecraft->useTouchscreen() */ true) { bRespawn = new Touch::TButton(1, "Respawn!"); bTitle = new Touch::TButton(2, "Main menu"); } else { diff --git a/src/client/gui/screens/DisconnectionScreen.h b/src/client/gui/screens/DisconnectionScreen.h index 12c62ec..f32530f 100755 --- a/src/client/gui/screens/DisconnectionScreen.h +++ b/src/client/gui/screens/DisconnectionScreen.h @@ -21,7 +21,7 @@ public: } void init() { - if (minecraft->useTouchscreen()) + if (/* minecraft->useTouchscreen() */ true) _back = new Touch::TButton(1, "Ok"); else _back = new Button(1, "Ok"); diff --git a/src/client/gui/screens/InBedScreen.cpp b/src/client/gui/screens/InBedScreen.cpp index ef6dd95..3adadc7 100755 --- a/src/client/gui/screens/InBedScreen.cpp +++ b/src/client/gui/screens/InBedScreen.cpp @@ -17,7 +17,7 @@ InBedScreen::~InBedScreen() { } void InBedScreen::init() { - if (minecraft->useTouchscreen()) { + if (/* minecraft->useTouchscreen() */ true) { bWakeUp = new Touch::TButton(1, "Leave Bed"); } else { bWakeUp = new Button(1, "Leave Bed"); diff --git a/src/client/gui/screens/PauseScreen.cpp b/src/client/gui/screens/PauseScreen.cpp index 46d99cd..ab30ecb 100755 --- a/src/client/gui/screens/PauseScreen.cpp +++ b/src/client/gui/screens/PauseScreen.cpp @@ -48,7 +48,7 @@ PauseScreen::~PauseScreen() { } void PauseScreen::init() { - if (minecraft->useTouchscreen()) { + if (/* minecraft->useTouchscreen() */ true) { bContinue = new Touch::TButton(1, "Back to game"); bOptions = new Touch::TButton(5, "Options"); bQuit = new Touch::TButton(2, "Quit to title"); diff --git a/src/client/gui/screens/ProgressScreen.h b/src/client/gui/screens/ProgressScreen.h index 263e346..762d4fa 100755 --- a/src/client/gui/screens/ProgressScreen.h +++ b/src/client/gui/screens/ProgressScreen.h @@ -11,6 +11,8 @@ public: void render(int xm, int ym, float a); bool isInGameScreen(); + virtual void keyPressed(int eventKey) {} + void tick(); private: int ticks; diff --git a/src/client/gui/screens/ScreenChooser.cpp b/src/client/gui/screens/ScreenChooser.cpp index 9f45e3c..b423524 100755 --- a/src/client/gui/screens/ScreenChooser.cpp +++ b/src/client/gui/screens/ScreenChooser.cpp @@ -21,7 +21,7 @@ Screen* ScreenChooser::createScreen( ScreenId id ) Screen* screen = NULL; // :sob: - if (_mc->useTouchscreen()) { + if (/* _mc->useTouchscreen() */ true) { switch (id) { case SCREEN_STARTMENU: screen = new Touch::StartMenuScreen(); break; case SCREEN_SELECTWORLD: screen = new Touch::SelectWorldScreen();break; diff --git a/src/client/gui/screens/SimpleChooseLevelScreen.cpp b/src/client/gui/screens/SimpleChooseLevelScreen.cpp index f839725..c5a1278 100755 --- a/src/client/gui/screens/SimpleChooseLevelScreen.cpp +++ b/src/client/gui/screens/SimpleChooseLevelScreen.cpp @@ -56,7 +56,7 @@ void SimpleChooseLevelScreen::init() def.setSrc(IntRectangle(150, 0, (int)def.width, (int)def.height)); bBack->setImageDef(def, true); } - if (minecraft->useTouchscreen()) { + if (/* minecraft->useTouchscreen() */ true) { bGamemode = new Touch::TButton(1, "Survival mode"); bCheats = new Touch::TButton(4, "Cheats: Off"); bCreate = new Touch::TButton(3, "Create"); diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index 0e39082..4e3d025 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -41,7 +41,7 @@ public: //fill(x+1, y+1, x+w-1, y+h-1, 0xff999999); bool hovered = active && (minecraft->useTouchscreen()? - (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : false); + (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : isInside(xm, ym)); if (hovered || *selectedPtr == this) statePressed->draw(Tesselator::instance, (float)x, (float)y); @@ -547,7 +547,7 @@ void CraftButton::renderBg(Minecraft* minecraft, int xm, int ym) { //fill(x+1, y+1, x+w-1, y+h-1, 0xff999999); bool hovered = active && (minecraft->useTouchscreen()? - (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : false); + (_currentlyDown && xm >= x && ym >= y && xm < x + width && ym < y + height) : isInside(xm, ym)); if (hovered || selected) bgSelected->draw(Tesselator::instance, (float)x, (float)y); diff --git a/src/client/player/input/KeyboardInput.cpp b/src/client/player/input/KeyboardInput.cpp index 674838d..b84fe75 100755 --- a/src/client/player/input/KeyboardInput.cpp +++ b/src/client/player/input/KeyboardInput.cpp @@ -50,10 +50,8 @@ void KeyboardInput::tick( Player* player ) ya *= 0.3f; } - #if defined(RPI) || defined(PLATFORM_DESKTOP) - wantUp = jumping; - wantDown = sneaking; - #endif + wantUp = jumping; + wantDown = sneaking; if (keys[KEY_CRAFT]) player->startCrafting((int)player->x, (int)player->y, (int)player->z, Recipe::SIZE_2X2); diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index ca9d388..1aa6a15 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -153,7 +153,7 @@ void GameRenderer::render(float a) { int xMouse = (int)(Mouse::getX() * Gui::InvGuiScale); int yMouse = (int)(Mouse::getY() * Gui::InvGuiScale); -#ifndef PLATFORM_DESKTOP + if (mc->useTouchscreen()) { const int pid = Multitouch::getFirstActivePointerIdExThisUpdate(); if (pid >= 0) { @@ -164,7 +164,6 @@ void GameRenderer::render(float a) { yMouse = -9999; } } -#endif TIMER_POP(); bool hasClearedColorBuffer = false; @@ -361,9 +360,9 @@ void GameRenderer::renderLevel(float a) { if (mc->hitResult.isHit() && !cameraEntity->isUnderLiquid(Material::water)) { TIMER_POP_PUSH("select"); Player* player = (Player*) cameraEntity; - if (mc->useTouchscreen()) { + // if (mc->useTouchscreen()) { levelRenderer->renderHitSelect(player, mc->hitResult, 0, NULL, a); //player.inventory->getSelected(), a); - } + // } levelRenderer->renderHit(player, mc->hitResult, 0, NULL, a);//player->inventory.getSelected(), a); } } @@ -657,11 +656,9 @@ void GameRenderer::pick(float a) { float range = mc->gameMode->getPickRange(); bool isPicking = true; -#ifndef PLATFORM_DESKTOP - bool freeform = mc->useTouchscreen() && !mc->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA); -#else - bool freeform = false; -#endif + + bool freeform = mc->useTouchscreen(); //&& !mc->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA); + if (freeform) { isPicking = updateFreeformPickDirection(a, pickDirection); } else { diff --git a/src/main_glfw.h b/src/main_glfw.h index 2b5bb97..042c9fb 100755 --- a/src/main_glfw.h +++ b/src/main_glfw.h @@ -139,12 +139,14 @@ int main(void) { #ifndef STANDALONE_SERVER // Platform init. appContext.platform = new AppPlatform_glfw(); -#if defined(DEBUG) && defined(__EMSCRIPTEN__) - EM_ASM({ - console.log(FS.readdir("/")); - console.log(FS.readdir("/data")); - console.log(FS.readdir("/data/images")); - }); +#if defined(__EMSCRIPTEN__) + EM_ASM( + FS.mkdir('/games'); + FS.mkdir('/games/com.mojang'); + FS.mkdir('/games/com.mojang/minecraftWorlds'); + FS.mount(IDBFS, {}, '/games'); + FS.syncfs(true, function (err) {}); + ); #endif glfwSetErrorCallback(error_callback); From bef09a330543f00dc07a090af38f096436018a1c Mon Sep 17 00:00:00 2001 From: mschiller890 Date: Sun, 22 Mar 2026 14:51:22 +0100 Subject: [PATCH 018/189] FIXED: sprinting now works when flying --- src/client/player/LocalPlayer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/player/LocalPlayer.cpp b/src/client/player/LocalPlayer.cpp index 1113468..398edcd 100755 --- a/src/client/player/LocalPlayer.cpp +++ b/src/client/player/LocalPlayer.cpp @@ -388,6 +388,12 @@ void LocalPlayer::calculateFlight(float xa, float ya, float za) { ya = 0; za = za * flySpeed; + if (sprinting) { + float sprintBoost = getWalkingSpeedModifier(); // 1.3x + xa *= sprintBoost; + za *= sprintBoost; + } + #ifdef ANDROID if (Keyboard::isKeyDown(103)) ya = .2f * flySpeed; if (Keyboard::isKeyDown(102)) ya = -.2f * flySpeed; @@ -506,7 +512,7 @@ void LocalPlayer::aiStep() { if (sprintDoubleTapTimer > 0) sprintDoubleTapTimer--; prevForwardHeld = forwardHeld; } - if (input->sneaking || abilities.flying) + if (input->sneaking) sprinting = false; if (input->sneaking) { From 9405e8daad92e1970608f38b6193ecd42df93784 Mon Sep 17 00:00:00 2001 From: mschiller890 Date: Sun, 22 Mar 2026 18:38:14 +0100 Subject: [PATCH 019/189] FIXED: Scrolling with mouse wheel improved --- src/client/gui/components/ScrollingPane.cpp | 77 +++++++++++++++++++-- 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/src/client/gui/components/ScrollingPane.cpp b/src/client/gui/components/ScrollingPane.cpp index 6ee7744..090bc3a 100755 --- a/src/client/gui/components/ScrollingPane.cpp +++ b/src/client/gui/components/ScrollingPane.cpp @@ -20,6 +20,9 @@ static const float kMinimumTrackingForDrag = 5; static const float kMinIndicatorLength = 34.0f / 3; static const float PKScrollIndicatorEndSize = 3; static const float PKScrollIndicatorThickness = 7.0f /3; +static const float kWheelOverscrollMax = 80.0f; +static const float kWheelOverscrollDamping = 0.6f; +static const float kWheelOverscrollRestoreAlpha = 0.18f; ScrollingPane::ScrollingPane( int optionFlags, @@ -70,13 +73,19 @@ ScrollingPane::ScrollingPane( } //LOGI("%d, %d :: %d\n", bbox.w, itemBbox.w, this->columns); - rows = 1 + (numItems-1) / this->columns, + rows = 1 + (numItems-1) / this->columns; /* if (columns * itemBbox.w <= bbox.w) flags |= SF_LockX; if (rows * itemBbox.h <= bbox.h) flags |= SF_LockY; */ + // initialize content bounds immediately + adjustContentSize(); + minPoint.set((float)(this->size.w - this->adjustedContentSize.w), (float)(this->size.h - this->adjustedContentSize.h), 0); + this->snapContentOffsetToBounds(false); + + dragDeltas.reserve(128); te_moved = 0; @@ -114,6 +123,34 @@ void ScrollingPane::tick() { updateScrollFade(vScroll); updateScrollFade(hScroll); } + + if (isNotSet(SF_HardLimits) && !Mouse::isButtonDown(MouseAction::ACTION_LEFT) && !dragging && !tracking && !decelerating) { + float targetX = _contentOffset.x; + float targetY = _contentOffset.y; + bool corrected = false; + + if (targetX > 0.0f) { + targetX = Mth::lerp(targetX, 0.0f, kWheelOverscrollRestoreAlpha); + corrected = true; + } else if (targetX < minPoint.x) { + targetX = Mth::lerp(targetX, minPoint.x, kWheelOverscrollRestoreAlpha); + corrected = true; + } + + if (targetY > 0.0f) { + targetY = Mth::lerp(targetY, 0.0f, kWheelOverscrollRestoreAlpha); + corrected = true; + } else if (targetY < minPoint.y) { + targetY = Mth::lerp(targetY, minPoint.y, kWheelOverscrollRestoreAlpha); + corrected = true; + } + + if (corrected) { + if (Mth::abs(targetX - _contentOffset.x) < 0.25f) targetX = (targetX > 0.0f ? 0.0f : (targetX < minPoint.x ? minPoint.x : targetX)); + if (Mth::abs(targetY - _contentOffset.y) < 0.25f) targetY = (targetY > 0.0f ? 0.0f : (targetY < minPoint.y ? minPoint.y : targetY)); + setContentOffset(Vec3(targetX, targetY, 0)); + } + } } bool ScrollingPane::getGridItemFor_slow(int itemIndex, GridItem& out) { @@ -549,11 +586,39 @@ void ScrollingPane::stepThroughDecelerationAnimation(bool noAnimation) { } void ScrollingPane::scrollBy(float dx, float dy) { - // adjust the translation offsets fpx/fpy by the requested amount - float nfpx = fpx + dx; - float nfpy = fpy + dy; - // convert back to content offset (fpx = -contentOffset.x) - setContentOffset(Vec3(-nfpx, -nfpy, 0)); + // compute target content offset from wheel delta (in screen-space w/ opposite sign) + float targetX = _contentOffset.x - dx; + float targetY = _contentOffset.y - dy; + + if (isSet(SF_LockX)) targetX = _contentOffset.x; + if (isSet(SF_LockY)) targetY = _contentOffset.y; + + if (isSet(SF_HardLimits)) { + targetX = Mth::clamp(targetX, minPoint.x, 0.0f); + targetY = Mth::clamp(targetY, minPoint.y, 0.0f); + } else { + if (targetX > 0.0f) { + float overshoot = targetX; + overshoot = Mth::Min(overshoot, kWheelOverscrollMax); + targetX = overshoot * kWheelOverscrollDamping; + } else if (targetX < minPoint.x) { + float overshoot = targetX - minPoint.x; + overshoot = Mth::Max(overshoot, -kWheelOverscrollMax); + targetX = minPoint.x + overshoot * kWheelOverscrollDamping; + } + + if (targetY > 0.0f) { + float overshoot = targetY; + overshoot = Mth::Min(overshoot, kWheelOverscrollMax); + targetY = overshoot * kWheelOverscrollDamping; + } else if (targetY < minPoint.y) { + float overshoot = targetY - minPoint.y; + overshoot = Mth::Max(overshoot, -kWheelOverscrollMax); + targetY = minPoint.y + overshoot * kWheelOverscrollDamping; + } + } + + setContentOffset(Vec3(targetX, targetY, 0)); } void ScrollingPane::setContentOffset(float x, float y) { From 468ae4a21150302611866077522396c7126a76b0 Mon Sep 17 00:00:00 2001 From: EpikIzCool Date: Tue, 24 Mar 2026 00:24:16 +0200 Subject: [PATCH 020/189] Whool Fix part 1 --- src/client/gamemode/CreativeMode.cpp | 125 +++++----- src/client/gamemode/CreativeMode.h | 53 ++-- src/client/gamemode/CreatorMode.cpp | 217 ++++++++--------- src/client/gamemode/CreatorMode.h | 235 +++++++++--------- src/client/gamemode/GameMode.cpp | 348 +++++++++++++-------------- 5 files changed, 475 insertions(+), 503 deletions(-) diff --git a/src/client/gamemode/CreativeMode.cpp b/src/client/gamemode/CreativeMode.cpp index 8be511a..c33cf8d 100755 --- a/src/client/gamemode/CreativeMode.cpp +++ b/src/client/gamemode/CreativeMode.cpp @@ -1,69 +1,56 @@ -#include "CreativeMode.h" -#include "../Minecraft.h" -#ifndef STANDALONE_SERVER -#include "../particle/ParticleEngine.h" -#endif -#include "../player/LocalPlayer.h" -#ifndef STANDALONE_SERVER -#include "../renderer/LevelRenderer.h" -#include "../sound/SoundEngine.h" -#endif -#include "../../world/level/Level.h" -//#include "../../network/Packet.h" -#include "../../network/packet/RemoveBlockPacket.h" -#include "../../world/entity/player/Abilities.h" - -static const int DestructionTickDelay = 5; - -CreativeMode::CreativeMode(Minecraft* minecraft) -: super(minecraft) -{ -} - -void CreativeMode::startDestroyBlock(int x, int y, int z, int face) { - if(minecraft->player->getCarriedItem() != NULL && minecraft->player->getCarriedItem()->id == Item::bow->id) - return; - - creativeDestroyBlock(x, y, z, face); - destroyDelay = DestructionTickDelay; -} - -void CreativeMode::creativeDestroyBlock(int x, int y, int z, int face) { - minecraft->level->extinguishFire(x, y, z, face); - destroyBlock(x, y, z, face); -} - -void CreativeMode::continueDestroyBlock(int x, int y, int z, int face) { - destroyDelay--; - if (destroyDelay <= 0) { - destroyDelay = DestructionTickDelay; - creativeDestroyBlock(x, y, z, face); - } -} - -void CreativeMode::stopDestroyBlock() { - destroyDelay = 0; -} - -void CreativeMode::initAbilities( Abilities& abilities ) { - abilities.mayfly = true; - abilities.instabuild = true; - abilities.invulnerable = true; -} - -bool CreativeMode::isCreativeType() { - return true; -} - -void CreativeMode::releaseUsingItem( Player* player ) { - if(player->getCarriedItem() != NULL) { - int oldItemId = player->getCarriedItem()->id; - int oldAux = player->getAuxData(); - super::releaseUsingItem(player); - if(player->getCarriedItem() != NULL && player->getCarriedItem()->id == oldItemId) { - player->getCarriedItem()->setAuxValue(oldAux); - } - } else { - super::releaseUsingItem(player); - } -} +#include "CreativeMode.h" +#include "../Minecraft.h" +#ifndef STANDALONE_SERVER +#include "../particle/ParticleEngine.h" +#endif +#include "../player/LocalPlayer.h" +#ifndef STANDALONE_SERVER +#include "../renderer/LevelRenderer.h" +#include "../sound/SoundEngine.h" +#endif +#include "../../world/level/Level.h" +//#include "../../network/Packet.h" +#include "../../network/packet/RemoveBlockPacket.h" +#include "../../world/entity/player/Abilities.h" + +static const int DestructionTickDelay = 5; + +CreativeMode::CreativeMode(Minecraft* minecraft) +: super(minecraft) +{ +} + +void CreativeMode::startDestroyBlock(int x, int y, int z, int face) { + if(minecraft->player->getCarriedItem() != NULL && minecraft->player->getCarriedItem()->id == Item::bow->id) + return; + + creativeDestroyBlock(x, y, z, face); + destroyDelay = DestructionTickDelay; +} + +void CreativeMode::creativeDestroyBlock(int x, int y, int z, int face) { + minecraft->level->extinguishFire(x, y, z, face); + destroyBlock(x, y, z, face); +} + +void CreativeMode::continueDestroyBlock(int x, int y, int z, int face) { + destroyDelay--; + if (destroyDelay <= 0) { + destroyDelay = DestructionTickDelay; + creativeDestroyBlock(x, y, z, face); + } +} + +void CreativeMode::stopDestroyBlock() { + destroyDelay = 0; +} + +void CreativeMode::initAbilities( Abilities& abilities ) { + abilities.mayfly = true; + abilities.instabuild = true; + abilities.invulnerable = true; +} + +bool CreativeMode::isCreativeType() { + return true; +} diff --git a/src/client/gamemode/CreativeMode.h b/src/client/gamemode/CreativeMode.h index b418111..61f7d1b 100755 --- a/src/client/gamemode/CreativeMode.h +++ b/src/client/gamemode/CreativeMode.h @@ -1,27 +1,26 @@ -#ifndef NET_MINECRAFT_CLIENT_GAMEMODE__CreativeMode_H__ -#define NET_MINECRAFT_CLIENT_GAMEMODE__CreativeMode_H__ - -//package net.minecraft.client.gamemode; - -#include "GameMode.h" - -class CreativeMode: public GameMode -{ - typedef GameMode super; -public: - CreativeMode(Minecraft* minecraft); - - void startDestroyBlock(int x, int y, int z, int face); - void continueDestroyBlock(int x, int y, int z, int face); - void stopDestroyBlock(); - - bool isCreativeType(); - - void initAbilities(Abilities& abilities); - - void releaseUsingItem(Player* player); -private: - void creativeDestroyBlock(int x, int y, int z, int face); -}; - -#endif /*NET_MINECRAFT_CLIENT_GAMEMODE__CreativeMode_H__*/ +#ifndef NET_MINECRAFT_CLIENT_GAMEMODE__CreativeMode_H__ +#define NET_MINECRAFT_CLIENT_GAMEMODE__CreativeMode_H__ + +//package net.minecraft.client.gamemode; + +#include "GameMode.h" + +class CreativeMode: public GameMode +{ + typedef GameMode super; +public: + CreativeMode(Minecraft* minecraft); + + void startDestroyBlock(int x, int y, int z, int face); + void continueDestroyBlock(int x, int y, int z, int face); + void stopDestroyBlock(); + + bool isCreativeType(); + + void initAbilities(Abilities& abilities); + +private: + void creativeDestroyBlock(int x, int y, int z, int face); +}; + +#endif /*NET_MINECRAFT_CLIENT_GAMEMODE__CreativeMode_H__*/ diff --git a/src/client/gamemode/CreatorMode.cpp b/src/client/gamemode/CreatorMode.cpp index e06d624..c33d0f5 100755 --- a/src/client/gamemode/CreatorMode.cpp +++ b/src/client/gamemode/CreatorMode.cpp @@ -1,115 +1,102 @@ -#include "CreatorMode.h" -#include "../Minecraft.h" -#include "../particle/ParticleEngine.h" -#include "../player/LocalPlayer.h" -#include "../renderer/LevelRenderer.h" -#include "../sound/SoundEngine.h" -#include "../../world/level/Level.h" -//#include "../../network/Packet.h" -#include "../../network/packet/RemoveBlockPacket.h" -#include "../../world/entity/player/Abilities.h" - -static const int DestructionTickDelay = 5; - -class Creator: public ICreator { - //virtual void getEvents(); - -public: - Creator(/*int eventLifeTime*/) - : _tileEvents(32), - _tickId(0) - { - } - - void setTick(int tick) { - _tickId = tick; - } - - EventList& getTileEvents() { return _tileEvents; } - - void addevent_blockUse(int entityId, int x, int y, int z, int face) { - TileEvent t = { - entityId, - x,y,z, - face - }; - _tileEvents.add(t, _tickId); - } - -private: - EventList _tileEvents; - int _tickId; -}; - -CreatorMode::CreatorMode(Minecraft* minecraft) -: super(minecraft) -{ - _creator = new Creator(); -} - -CreatorMode::~CreatorMode() { - delete _creator; -} - -void CreatorMode::startDestroyBlock(int x, int y, int z, int face) { - if(minecraft->player->getCarriedItem() != NULL && minecraft->player->getCarriedItem()->id == Item::bow->id) - return; - - CreatorDestroyBlock(x, y, z, face); - destroyDelay = DestructionTickDelay; -} - -void CreatorMode::CreatorDestroyBlock(int x, int y, int z, int face) { - minecraft->level->extinguishFire(x, y, z, face); - destroyBlock(x, y, z, face); -} - -void CreatorMode::continueDestroyBlock(int x, int y, int z, int face) { - destroyDelay--; - if (destroyDelay <= 0) { - destroyDelay = DestructionTickDelay; - CreatorDestroyBlock(x, y, z, face); - } -} - -bool CreatorMode::useItemOn( Player* player, Level* level, ItemInstance* item, int x, int y, int z, int face, const Vec3& hit ) { - if (item && item->id == ((Item*)Item::sword_iron)->id) - _creator->addevent_blockUse(player->entityId, x, y, z, face); - return super::useItemOn(player, level, item, x, y, z, face, hit); -} - -void CreatorMode::stopDestroyBlock() { - destroyDelay = 0; -} - -void CreatorMode::initAbilities( Abilities& abilities ) { - abilities.mayfly = true; - abilities.instabuild = true; - abilities.invulnerable = true; -} - -bool CreatorMode::isCreativeType() { - return true; -} - -void CreatorMode::releaseUsingItem( Player* player ) { - if(player->getCarriedItem() != NULL) { - int oldItemId = player->getCarriedItem()->id; - int oldAux = player->getAuxData(); - super::releaseUsingItem(player); - if(player->getCarriedItem() != NULL && player->getCarriedItem()->id == oldItemId) { - player->getCarriedItem()->setAuxValue(oldAux); - } - } else { - super::releaseUsingItem(player); - } -} - -ICreator* CreatorMode::getCreator() { - return _creator; -} - -void CreatorMode::tick() { - _creator->setTick(minecraft->level->getTime()); - super::tick(); -} +#include "CreatorMode.h" +#include "../Minecraft.h" +#include "../particle/ParticleEngine.h" +#include "../player/LocalPlayer.h" +#include "../renderer/LevelRenderer.h" +#include "../sound/SoundEngine.h" +#include "../../world/level/Level.h" +//#include "../../network/Packet.h" +#include "../../network/packet/RemoveBlockPacket.h" +#include "../../world/entity/player/Abilities.h" + +static const int DestructionTickDelay = 5; + +class Creator: public ICreator { + //virtual void getEvents(); + +public: + Creator(/*int eventLifeTime*/) + : _tileEvents(32), + _tickId(0) + { + } + + void setTick(int tick) { + _tickId = tick; + } + + EventList& getTileEvents() { return _tileEvents; } + + void addevent_blockUse(int entityId, int x, int y, int z, int face) { + TileEvent t = { + entityId, + x,y,z, + face + }; + _tileEvents.add(t, _tickId); + } + +private: + EventList _tileEvents; + int _tickId; +}; + +CreatorMode::CreatorMode(Minecraft* minecraft) +: super(minecraft) +{ + _creator = new Creator(); +} + +CreatorMode::~CreatorMode() { + delete _creator; +} + +void CreatorMode::startDestroyBlock(int x, int y, int z, int face) { + if(minecraft->player->getCarriedItem() != NULL && minecraft->player->getCarriedItem()->id == Item::bow->id) + return; + + CreatorDestroyBlock(x, y, z, face); + destroyDelay = DestructionTickDelay; +} + +void CreatorMode::CreatorDestroyBlock(int x, int y, int z, int face) { + minecraft->level->extinguishFire(x, y, z, face); + destroyBlock(x, y, z, face); +} + +void CreatorMode::continueDestroyBlock(int x, int y, int z, int face) { + destroyDelay--; + if (destroyDelay <= 0) { + destroyDelay = DestructionTickDelay; + CreatorDestroyBlock(x, y, z, face); + } +} + +bool CreatorMode::useItemOn( Player* player, Level* level, ItemInstance* item, int x, int y, int z, int face, const Vec3& hit ) { + if (item && item->id == ((Item*)Item::sword_iron)->id) + _creator->addevent_blockUse(player->entityId, x, y, z, face); + return super::useItemOn(player, level, item, x, y, z, face, hit); +} + +void CreatorMode::stopDestroyBlock() { + destroyDelay = 0; +} + +void CreatorMode::initAbilities( Abilities& abilities ) { + abilities.mayfly = true; + abilities.instabuild = true; + abilities.invulnerable = true; +} + +bool CreatorMode::isCreativeType() { + return true; +} + +ICreator* CreatorMode::getCreator() { + return _creator; +} + +void CreatorMode::tick() { + _creator->setTick(minecraft->level->getTime()); + super::tick(); +} diff --git a/src/client/gamemode/CreatorMode.h b/src/client/gamemode/CreatorMode.h index a74fe52..8e0ece7 100755 --- a/src/client/gamemode/CreatorMode.h +++ b/src/client/gamemode/CreatorMode.h @@ -1,61 +1,61 @@ -#ifndef NET_MINECRAFT_CLIENT_GAMEMODE__CreatorMode_H__ -#define NET_MINECRAFT_CLIENT_GAMEMODE__CreatorMode_H__ - -//package net.minecraft.client.gamemode; - -#include "GameMode.h" -#include "../../world/PosTranslator.h" - -class ICreator { -public: - virtual ~ICreator() {} - - struct TileEvent { - int entityId; - int x, y, z; - int face; - - void write(std::stringstream& ss, IPosTranslator& t) const { - int xx = x, yy = y, zz = z; - t.to(xx, yy, zz); - ss << xx << "," << yy << "," << zz << "," << face << "," << entityId; - } - }; - - template - class EventList { - public: - EventList(int size) { - _events.reserve(size); - _maxSize = (int)size; - clear(); - } - void clear() { - _index = -1; - _size = 0; - } - void add(const T& item, int tick) { - if (_size < _maxSize) { - _events.push_back(Item()); - ++_size; - } - Item& e = _events[_nextIndex()]; - e.item = item; - e.timestamp = tick; - } - int size() const { - return _size; - } - - const T& operator[](int i) const { - return _events[_getIndex(i)].item; - } - - T& operator[](int i) { - return _events[_getIndex(i)].item; - } - - void write(std::stringstream& ss, IPosTranslator& t, int minTimetamp) const { +#ifndef NET_MINECRAFT_CLIENT_GAMEMODE__CreatorMode_H__ +#define NET_MINECRAFT_CLIENT_GAMEMODE__CreatorMode_H__ + +//package net.minecraft.client.gamemode; + +#include "GameMode.h" +#include "../../world/PosTranslator.h" + +class ICreator { +public: + virtual ~ICreator() {} + + struct TileEvent { + int entityId; + int x, y, z; + int face; + + void write(std::stringstream& ss, IPosTranslator& t) const { + int xx = x, yy = y, zz = z; + t.to(xx, yy, zz); + ss << xx << "," << yy << "," << zz << "," << face << "," << entityId; + } + }; + + template + class EventList { + public: + EventList(int size) { + _events.reserve(size); + _maxSize = (int)size; + clear(); + } + void clear() { + _index = -1; + _size = 0; + } + void add(const T& item, int tick) { + if (_size < _maxSize) { + _events.push_back(Item()); + ++_size; + } + Item& e = _events[_nextIndex()]; + e.item = item; + e.timestamp = tick; + } + int size() const { + return _size; + } + + const T& operator[](int i) const { + return _events[_getIndex(i)].item; + } + + T& operator[](int i) { + return _events[_getIndex(i)].item; + } + + void write(std::stringstream& ss, IPosTranslator& t, int minTimetamp) const { int i = _getFirstNewerIndex(minTimetamp); if (i < 0) return; @@ -66,63 +66,62 @@ public: ss << "|"; if (++i == _size) i = 0; } - } - - private: - int _getIndex(int i) const { return (1 + _index + i) % _size; } - int _nextIndex() { - if (++_index == _size) _index = 0; - return _index; - } - - int _getFirstNewerIndex(int timestamp) const { - for (int i = _index + 1, j = 0; j < _size; ++i, ++j) { - if (i == _size) i = 0; - if (_events[i].timestamp >= timestamp) return i; - } - return -1; - } - struct Item { - int timestamp; - T item; - }; - - int _index; - int _size; - int _maxSize; - std::vector _events; - }; - - virtual EventList& getTileEvents() = 0; -}; - -class Creator; - -class CreatorMode: public GameMode -{ - typedef GameMode super; -public: - CreatorMode(Minecraft* minecraft); - ~CreatorMode(); - - void startDestroyBlock(int x, int y, int z, int face); - void continueDestroyBlock(int x, int y, int z, int face); - void stopDestroyBlock(); - - bool useItemOn(Player* player, Level* level, ItemInstance* item, int x, int y, int z, int face, const Vec3& hit); - - void tick(); - ICreator* getCreator(); - - bool isCreativeType(); - - void initAbilities(Abilities& abilities); - - void releaseUsingItem(Player* player); -private: - void CreatorDestroyBlock(int x, int y, int z, int face); - - Creator* _creator; -}; - -#endif /*NET_MINECRAFT_CLIENT_GAMEMODE__CreatorMode_H__*/ + } + + private: + int _getIndex(int i) const { return (1 + _index + i) % _size; } + int _nextIndex() { + if (++_index == _size) _index = 0; + return _index; + } + + int _getFirstNewerIndex(int timestamp) const { + for (int i = _index + 1, j = 0; j < _size; ++i, ++j) { + if (i == _size) i = 0; + if (_events[i].timestamp >= timestamp) return i; + } + return -1; + } + struct Item { + int timestamp; + T item; + }; + + int _index; + int _size; + int _maxSize; + std::vector _events; + }; + + virtual EventList& getTileEvents() = 0; +}; + +class Creator; + +class CreatorMode: public GameMode +{ + typedef GameMode super; +public: + CreatorMode(Minecraft* minecraft); + ~CreatorMode(); + + void startDestroyBlock(int x, int y, int z, int face); + void continueDestroyBlock(int x, int y, int z, int face); + void stopDestroyBlock(); + + bool useItemOn(Player* player, Level* level, ItemInstance* item, int x, int y, int z, int face, const Vec3& hit); + + void tick(); + ICreator* getCreator(); + + bool isCreativeType(); + + void initAbilities(Abilities& abilities); + +private: + void CreatorDestroyBlock(int x, int y, int z, int face); + + Creator* _creator; +}; + +#endif /*NET_MINECRAFT_CLIENT_GAMEMODE__CreatorMode_H__*/ diff --git a/src/client/gamemode/GameMode.cpp b/src/client/gamemode/GameMode.cpp index 292165a..de6df50 100755 --- a/src/client/gamemode/GameMode.cpp +++ b/src/client/gamemode/GameMode.cpp @@ -1,174 +1,174 @@ -#include "GameMode.h" -#include "../Minecraft.h" -#include "../../network/packet/UseItemPacket.h" -#include "../../network/packet/PlayerActionPacket.h" -#include "../../world/level/Level.h" -#include "../../world/item/ItemInstance.h" -#include "../player/LocalPlayer.h" -#include "client/Options.h" -#ifndef STANDALONE_SERVER -#include "../sound/SoundEngine.h" -#include "../particle/ParticleEngine.h" -#endif -#include "../../network/RakNetInstance.h" -#include "../../network/packet/RemoveBlockPacket.h" -#ifndef STANDALONE_SERVER -#include "../renderer/LevelRenderer.h" -#endif -#include "../../world/level/material/Material.h" - -GameMode::GameMode( Minecraft* minecraft) -: minecraft(minecraft), - destroyProgress(0), - oDestroyProgress(0), - destroyTicks(0), - destroyDelay(0) -{ -} - -/*virtual*/ -Player* GameMode::createPlayer(Level* level) { - return new LocalPlayer(minecraft, level, minecraft->options.getStringValue(OPTIONS_USERNAME), level->dimension->id, isCreativeType()); -} - -/*virtual*/ -void GameMode::interact(Player* player, Entity* entity) { - player->interact(entity); -} - -/*virtual*/ -void GameMode::attack(Player* player, Entity* entity) { - if (minecraft->level->adventureSettings.noPvP && entity->isPlayer()) - return; - if (minecraft->level->adventureSettings.noPvM && entity->isMob()) - return; - player->attack(entity); -} - -/* virtual */ -void GameMode::startDestroyBlock( int x, int y, int z, int face ) { - if(minecraft->player->getCarriedItem() != NULL && minecraft->player->getCarriedItem()->id == Item::bow->id) - return; - destroyBlock(x, y, z, face); -} - -/*virtual*/ -bool GameMode::destroyBlock(int x, int y, int z, int face) { - Level* level = minecraft->level; - Tile* oldTile = Tile::tiles[level->getTile(x, y, z)]; - if (!oldTile) - return false; - - if (level->adventureSettings.immutableWorld) { - if (oldTile != (Tile*)Tile::leaves - && oldTile->material != Material::plant) { - return false; - } - } -#ifndef STANDALONE_SERVER - minecraft->particleEngine->destroy(x, y, z); -#endif - int data = level->getData(x, y, z); - bool changed = level->setTile(x, y, z, 0); - if (changed) { -#ifndef STANDALONE_SERVER - minecraft->soundEngine->play(oldTile->soundType->getBreakSound(), x + 0.5f, y + 0.5f, z + 0.5f, (oldTile->soundType->getVolume() + 1) / 2, oldTile->soundType->getPitch() * 0.8f); -#endif - oldTile->destroy(level, x, y, z, data); - if (minecraft->options.getBooleanValue(OPTIONS_DESTROY_VIBRATION)) minecraft->platform()->vibrate(24); - - if (minecraft->isOnline()) { - RemoveBlockPacket packet(minecraft->player, x, y, z); - minecraft->raknetInstance->send(packet); - } - } - return changed; -} -/*virtual*/ -bool GameMode::useItemOn(Player* player, Level* level, ItemInstance* item, int x, int y, int z, int face, const Vec3& hit) { - float clickX = hit.x - x; - float clickY = hit.y - y; - float clickZ = hit.z - z; - item = player->inventory->getSelected(); - if(level->isClientSide) { - UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ); - minecraft->raknetInstance->send(packet); - } - int t = level->getTile(x, y, z); - if (t == Tile::invisible_bedrock->id) return false; - if (t > 0 && Tile::tiles[t]->use(level, x, y, z, player)) - return true; - - if (item == NULL) return false; - if(isCreativeType()) { - int aux = item->getAuxValue(); - int count = item->count; - bool success = item->useOn(player, level, x, y, z, face, clickX, clickY, clickZ); - item->setAuxValue(aux); - item->count = count; - return success; - } else { - return item->useOn(player, level, x, y, z, face, clickX, clickY, clickZ); - } -} - -bool GameMode::useItem( Player* player, Level* level, ItemInstance* item ) { - int oldCount = item->count; - - ItemInstance* itemInstance = item->use(level, player); - if(level->isClientSide) { - UseItemPacket packet(item, player->entityId, player->aimDirection); - minecraft->raknetInstance->send(packet); - } - if (itemInstance != item || (itemInstance != NULL && itemInstance->count != oldCount)) { - //player.inventory.items[player.inventory.selected] = itemInstance; - //if (itemInstance.count == 0) { - // player.inventory.items[player.inventory.selected] = NULL; - //} - return true; - } - return false; -} - -ItemInstance* GameMode::handleInventoryMouseClick( int containerId, int slotNum, int buttonNum, Player* player ) { - //return player.containerMenu.clicked(slotNum, buttonNum, player); - return NULL; -} - -void GameMode::handleCloseInventory( int containerId, Player* player ) { - //player.containerMenu.removed(player); - //player.containerMenu = player.inventoryMenu; -} - -float GameMode::getPickRange() { - return 5.0f; -} - -void GameMode::initPlayer( Player* player ) { - initAbilities(player->abilities); -} - -void GameMode::releaseUsingItem(Player* player){ - if(minecraft->level->isClientSide) { - PlayerActionPacket packet(PlayerActionPacket::RELEASE_USE_ITEM, 0, 0, 0, 0, player->entityId); - minecraft->raknetInstance->send(packet); - } - player->releaseUsingItem(); -} - -void GameMode::tick() { - oDestroyProgress = destroyProgress; -} - -void GameMode::render( float a ) { -#ifndef STANDALONE_SERVER - if (destroyProgress <= 0) { - minecraft->gui.progress = 0; - minecraft->levelRenderer->destroyProgress = 0; - } else { - float dp = oDestroyProgress + (destroyProgress - oDestroyProgress) * a; - minecraft->gui.progress = dp; - minecraft->levelRenderer->destroyProgress = dp; - } -#endif -} +#include "GameMode.h" +#include "../Minecraft.h" +#include "../../network/packet/UseItemPacket.h" +#include "../../network/packet/PlayerActionPacket.h" +#include "../../world/level/Level.h" +#include "../../world/item/ItemInstance.h" +#include "../player/LocalPlayer.h" +#include "client/Options.h" +#ifndef STANDALONE_SERVER +#include "../sound/SoundEngine.h" +#include "../particle/ParticleEngine.h" +#endif +#include "../../network/RakNetInstance.h" +#include "../../network/packet/RemoveBlockPacket.h" +#ifndef STANDALONE_SERVER +#include "../renderer/LevelRenderer.h" +#endif +#include "../../world/level/material/Material.h" + +GameMode::GameMode( Minecraft* minecraft) +: minecraft(minecraft), + destroyProgress(0), + oDestroyProgress(0), + destroyTicks(0), + destroyDelay(0) +{ +} + +/*virtual*/ +Player* GameMode::createPlayer(Level* level) { + return new LocalPlayer(minecraft, level, minecraft->options.getStringValue(OPTIONS_USERNAME), level->dimension->id, isCreativeType()); +} + +/*virtual*/ +void GameMode::interact(Player* player, Entity* entity) { + player->interact(entity); +} + +/*virtual*/ +void GameMode::attack(Player* player, Entity* entity) { + if (minecraft->level->adventureSettings.noPvP && entity->isPlayer()) + return; + if (minecraft->level->adventureSettings.noPvM && entity->isMob()) + return; + player->attack(entity); +} + +/* virtual */ +void GameMode::startDestroyBlock( int x, int y, int z, int face ) { + if(minecraft->player->getCarriedItem() != NULL && minecraft->player->getCarriedItem()->id == Item::bow->id) + return; + destroyBlock(x, y, z, face); +} + +/*virtual*/ +bool GameMode::destroyBlock(int x, int y, int z, int face) { + Level* level = minecraft->level; + Tile* oldTile = Tile::tiles[level->getTile(x, y, z)]; + if (!oldTile) + return false; + + if (level->adventureSettings.immutableWorld) { + if (oldTile != (Tile*)Tile::leaves + && oldTile->material != Material::plant) { + return false; + } + } +#ifndef STANDALONE_SERVER + minecraft->particleEngine->destroy(x, y, z); +#endif + int data = level->getData(x, y, z); + bool changed = level->setTile(x, y, z, 0); + if (changed) { +#ifndef STANDALONE_SERVER + minecraft->soundEngine->play(oldTile->soundType->getBreakSound(), x + 0.5f, y + 0.5f, z + 0.5f, (oldTile->soundType->getVolume() + 1) / 2, oldTile->soundType->getPitch() * 0.8f); +#endif + oldTile->destroy(level, x, y, z, data); + if (minecraft->options.getBooleanValue(OPTIONS_DESTROY_VIBRATION)) minecraft->platform()->vibrate(24); + + if (minecraft->isOnline()) { + RemoveBlockPacket packet(minecraft->player, x, y, z); + minecraft->raknetInstance->send(packet); + } + } + return changed; +} +/*virtual*/ +bool GameMode::useItemOn(Player* player, Level* level, ItemInstance* item, int x, int y, int z, int face, const Vec3& hit) { + float clickX = hit.x - x; + float clickY = hit.y - y; + float clickZ = hit.z - z; + if (level->isClientSide) { + item = player->inventory->getSelected(); + UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ); + minecraft->raknetInstance->send(packet); + } + int t = level->getTile(x, y, z); + if (t == Tile::invisible_bedrock->id) return false; + if (t > 0 && Tile::tiles[t]->use(level, x, y, z, player)) + return true; + + if (item == NULL) return false; + if(isCreativeType()) { + int aux = item->getAuxValue(); + int count = item->count; + bool success = item->useOn(player, level, x, y, z, face, clickX, clickY, clickZ); + item->setAuxValue(aux); + item->count = count; + return success; + } else { + return item->useOn(player, level, x, y, z, face, clickX, clickY, clickZ); + } +} + +bool GameMode::useItem( Player* player, Level* level, ItemInstance* item ) { + int oldCount = item->count; + + ItemInstance* itemInstance = item->use(level, player); + if(level->isClientSide) { + UseItemPacket packet(item, player->entityId, player->aimDirection); + minecraft->raknetInstance->send(packet); + } + if (itemInstance != item || (itemInstance != NULL && itemInstance->count != oldCount)) { + //player.inventory.items[player.inventory.selected] = itemInstance; + //if (itemInstance.count == 0) { + // player.inventory.items[player.inventory.selected] = NULL; + //} + return true; + } + return false; +} + +ItemInstance* GameMode::handleInventoryMouseClick( int containerId, int slotNum, int buttonNum, Player* player ) { + //return player.containerMenu.clicked(slotNum, buttonNum, player); + return NULL; +} + +void GameMode::handleCloseInventory( int containerId, Player* player ) { + //player.containerMenu.removed(player); + //player.containerMenu = player.inventoryMenu; +} + +float GameMode::getPickRange() { + return 5.0f; +} + +void GameMode::initPlayer( Player* player ) { + initAbilities(player->abilities); +} + +void GameMode::releaseUsingItem(Player* player){ + if (minecraft->level->isClientSide && player->isUsingItem()) { + PlayerActionPacket packet(PlayerActionPacket::RELEASE_USE_ITEM, 0, 0, 0, 0, player->entityId); + minecraft->raknetInstance->send(packet); + } + player->releaseUsingItem(); +} + +void GameMode::tick() { + oDestroyProgress = destroyProgress; +} + +void GameMode::render( float a ) { +#ifndef STANDALONE_SERVER + if (destroyProgress <= 0) { + minecraft->gui.progress = 0; + minecraft->levelRenderer->destroyProgress = 0; + } else { + float dp = oDestroyProgress + (destroyProgress - oDestroyProgress) * a; + minecraft->gui.progress = dp; + minecraft->levelRenderer->destroyProgress = dp; + } +#endif +} From a7c75d2ad2673ed4ccfc0ff5dda2b806b01fcc3d Mon Sep 17 00:00:00 2001 From: EpikIzCool Date: Tue, 24 Mar 2026 00:29:52 +0200 Subject: [PATCH 021/189] Touch thingie --- .../touch/TouchIngameBlockSelectionScreen.cpp | 584 +++++++++--------- 1 file changed, 293 insertions(+), 291 deletions(-) diff --git a/src/client/gui/screens/touch/TouchIngameBlockSelectionScreen.cpp b/src/client/gui/screens/touch/TouchIngameBlockSelectionScreen.cpp index d88025d..1749984 100755 --- a/src/client/gui/screens/touch/TouchIngameBlockSelectionScreen.cpp +++ b/src/client/gui/screens/touch/TouchIngameBlockSelectionScreen.cpp @@ -1,291 +1,293 @@ -#include "TouchIngameBlockSelectionScreen.h" -#include "../crafting/WorkbenchScreen.h" -#include "../../Screen.h" -#include "../../components/ImageButton.h" -#include "../../components/InventoryPane.h" -#include "../../../gamemode/GameMode.h" -#include "../../../renderer/TileRenderer.h" -#include "../../../player/LocalPlayer.h" -#include "../../../renderer/gles.h" -#include "../../../renderer/entity/ItemRenderer.h" -#include "../../../renderer/Tesselator.h" -#include "../../../renderer/Textures.h" -#include "../../../Minecraft.h" -#include "../../../sound/SoundEngine.h" -#include "../../../../world/entity/player/Inventory.h" -#include "../../../../platform/input/Mouse.h" -#include "../../../../util/Mth.h" -#include "../../../../world/item/ItemInstance.h" -#include "../../../../world/entity/player/Player.h" -#include "../../../../world/item/crafting/Recipe.h" -#include "../../../player/input/touchscreen/TouchAreaModel.h" -#include "../ArmorScreen.h" - -namespace Touch { - -#if defined(__APPLE__) - static const std::string demoVersionString("Not available in the Lite version"); -#else - static const std::string demoVersionString("Not available in the demo version"); -#endif - -#ifdef __APPLE__ - static const float BorderPixels = 4; - #ifdef DEMO_MODE - static const float BlockPixels = 22; - #else - static const float BlockPixels = 22; - #endif -#else - static const float BorderPixels = 4; - static const float BlockPixels = 24; -#endif - -static const int ItemSize = (int)(BlockPixels + 2*BorderPixels); - -static const int Bx = 10; // Border Frame width -static const int By = 6; // Border Frame height - -// -// Block selection screen -// -IngameBlockSelectionScreen::IngameBlockSelectionScreen() -: selectedItem(0), - _blockList(NULL), - _pendingClose(false), - bArmor (4, "Armor"), - bDone (3, ""), - //bDone (3, "Done"), - bMenu (2, "Menu"), - bCraft (1, "Craft"), - bHeader (0, "Select blocks") -{ -} - -IngameBlockSelectionScreen::~IngameBlockSelectionScreen() -{ - delete _blockList; -} - -void IngameBlockSelectionScreen::init() -{ - Inventory* inventory = minecraft->player->inventory; - - //const int itemWidth = 2 * BorderPixels + - - int maxWidth = width - Bx - Bx; - InventoryColumns = maxWidth / ItemSize; - const int realWidth = InventoryColumns * ItemSize; - const int realBx = (width - realWidth) / 2; - - IntRectangle rect(realBx, -#ifdef __APPLE__ - 24 + By - ((width==240)?1:0), realWidth, ((width==240)?1:0) + height-By-By-20-24); -#else - 24 + By, realWidth, height-By-By-20-24); -#endif - - _blockList = new InventoryPane(this, minecraft, rect, width, BorderPixels, inventory->getContainerSize() - Inventory::MAX_SELECTION_SIZE, ItemSize, (int)BorderPixels); - _blockList->fillMarginX = realBx; - - //for (int i = 0; i < inventory->getContainerSize(); ++i) - //LOGI("> %d - %s\n", i, inventory->getItem(i)? inventory->getItem(i)->getDescriptionId().c_str() : "<-->\n"); - - InventorySize = inventory->getContainerSize(); - InventoryRows = 1 + (InventorySize-1) / InventoryColumns; - - // - // Buttons - // - ImageDef def; - def.name = "gui/spritesheet.png"; - def.x = 0; - def.y = 1; - def.width = def.height = 18; - def.setSrc(IntRectangle(60, 0, 18, 18)); - bDone.setImageDef(def, true); - bDone.width = bDone.height = 19; - - bDone.scaleWhenPressed = false; - - buttons.push_back(&bHeader); - buttons.push_back(&bDone); - if (!minecraft->isCreativeMode()) { - buttons.push_back(&bCraft); - buttons.push_back(&bArmor); - } -} - -void IngameBlockSelectionScreen::setupPositions() { - bHeader.y = bDone.y = bCraft.y = 0; - bDone.x = width - bDone.width; - bCraft.x = 0;//width - bDone.w - bCraft.w; - bCraft.width = bArmor.width = 48; - bArmor.x = bCraft.width; - - if (minecraft->isCreativeMode()) { - bHeader.x = 0; - bHeader.width = width;// - bDone.w; - bHeader.xText = width/2; // Center of the screen - } else { - bHeader.x = bCraft.width + bArmor.width; - bHeader.width = width - bCraft.width - bArmor.width;// - bDone.w; - bHeader.xText = bHeader.x + (bHeader.width - bDone.width) /2; - } - - clippingArea.x = 0; - clippingArea.w = minecraft->width; - clippingArea.y = 0; - clippingArea.h = (int)(Gui::GuiScale * 24); -} - -void IngameBlockSelectionScreen::removed() -{ - minecraft->gui.inventoryUpdated(); -} - -int IngameBlockSelectionScreen::getSlotPosX(int slotX) { - // @todo: Number of columns - return width / 2 - InventoryColumns * 10 + slotX * 20 + 2; -} - -int IngameBlockSelectionScreen::getSlotPosY(int slotY) { - return height - 16 - 3 - 22 * 2 - 22 * slotY; -} - -int IngameBlockSelectionScreen::getSlotHeight() { - // same as non-touch implementation - return 22; -} - -void IngameBlockSelectionScreen::mouseClicked(int x, int y, int buttonNum) { - _pendingClose = _blockList->_clickArea->isInside((float)x, (float)y); - if (!_pendingClose) - super::mouseClicked(x, y, buttonNum); -} - -void IngameBlockSelectionScreen::mouseReleased(int x, int y, int buttonNum) { - if (_pendingClose && _blockList->_clickArea->isInside((float)x, (float)y)) - minecraft->setScreen(NULL); - else - super::mouseReleased(x, y, buttonNum); -} - -void IngameBlockSelectionScreen::mouseWheel(int dx, int dy, int xm, int ym) -{ - if (dy == 0) return; - if (_blockList) { - float amount = -dy * getSlotHeight(); - _blockList->scrollBy(0, amount); - } - int cols = InventoryColumns; - int maxIndex = InventorySize - 1; - int idx = selectedItem; - if (dy > 0) { - if (idx >= cols) idx -= cols; - } else { - if (idx + cols <= maxIndex) idx += cols; - } - selectedItem = idx; -} - -bool IngameBlockSelectionScreen::addItem(const InventoryPane* pane, int itemId) -{ - Inventory* inventory = minecraft->player->inventory; - itemId += Inventory::MAX_SELECTION_SIZE; - - if (!inventory->getItem(itemId)) - return false; - - inventory->moveToSelectionSlot(0, itemId, true); - - inventory->selectSlot(0); -#ifdef __APPLE__ - minecraft->soundEngine->playUI("random.pop", 0.3f, 0.3f);//1.0f + 0.2f*(Mth::random()-Mth::random())); -#else - minecraft->soundEngine->playUI("random.pop2", 1.0f, 0.3f);//1.0f + 0.2f*(Mth::random()-Mth::random())); -#endif - - // Flash the selected gui item - minecraft->gui.flashSlot(inventory->selected); - return true; -} - -void IngameBlockSelectionScreen::tick() -{ - _blockList->tick(); - super::tick(); -} - -void IngameBlockSelectionScreen::render( int xm, int ym, float a ) -{ - glDisable2(GL_DEPTH_TEST); - glEnable2(GL_BLEND); - - Screen::render(xm, ym, a); - _blockList->render(xm, ym, a); - - // render frame - IntRectangle& bbox = _blockList->rect; - Tesselator::instance.colorABGR(0xffffffff); - minecraft->textures->loadAndBindTexture("gui/itemframe.png"); - glEnable2(GL_BLEND); - glColor4f2(1, 1, 1, 1); - glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - blit(0, bbox.y-By, 0, 0, width, bbox.h+By+By, 215, 256); // why bbox.h + 1*B? - glDisable2(GL_BLEND); - - glEnable2(GL_DEPTH_TEST); -} - -void IngameBlockSelectionScreen::renderDemoOverlay() { -#ifdef DEMO_MODE - fill( getSlotPosX(0) - 3, getSlotPosY(1) - 3, - getSlotPosX(9) - 3, getSlotPosY(-1) - 3, 0xa0 << 24); - - const int centerX = (getSlotPosX(4) + getSlotPosX(5)) / 2; - const int centerY = (getSlotPosY(0) + getSlotPosY(1)) / 2 + 5; - drawCenteredString(minecraft->font, demoVersionString, centerX, centerY, 0xffffffff); -#endif /*DEMO_MODE*/ -} - -void IngameBlockSelectionScreen::buttonClicked(Button* button) { - if (button->id == bDone.id) - minecraft->setScreen(NULL); - - if (button->id == bMenu.id) - minecraft->screenChooser.setScreen(SCREEN_PAUSE); - - if (button->id == bCraft.id) - minecraft->setScreen(new WorkbenchScreen(Recipe::SIZE_2X2)); - - if (button == &bArmor) - minecraft->setScreen(new ArmorScreen()); -} - -bool IngameBlockSelectionScreen::isAllowed( int slot ) -{ - if (slot < 0 || slot >= minecraft->player->inventory->getContainerSize()) - return false; - -#ifdef DEMO_MODE - if (slot >= (minecraft->isCreativeMode()? 28 : 27)) return false; -#endif - return true; -} - -bool IngameBlockSelectionScreen::hasClippingArea( IntRectangle& out ) -{ - out = clippingArea; - return true; -} - -std::vector IngameBlockSelectionScreen::getItems( const InventoryPane* forPane ) -{ - std::vector out; - for (int i = Inventory::MAX_SELECTION_SIZE; i < minecraft->player->inventory->getContainerSize(); ++i) - out.push_back(minecraft->player->inventory->getItem(i)); - return out; -} - -} +#include "TouchIngameBlockSelectionScreen.h" +#include "../crafting/WorkbenchScreen.h" +#include "../../Screen.h" +#include "../../components/ImageButton.h" +#include "../../components/InventoryPane.h" +#include "../../../gamemode/GameMode.h" +#include "../../../renderer/TileRenderer.h" +#include "../../../player/LocalPlayer.h" +#include "../../../renderer/gles.h" +#include "../../../renderer/entity/ItemRenderer.h" +#include "../../../renderer/Tesselator.h" +#include "../../../renderer/Textures.h" +#include "../../../Minecraft.h" +#include "../../../sound/SoundEngine.h" +#include "../../../../world/entity/player/Inventory.h" +#include "../../../../platform/input/Mouse.h" +#include "../../../../util/Mth.h" +#include "../../../../world/item/ItemInstance.h" +#include "../../../../world/entity/player/Player.h" +#include "../../../../world/item/crafting/Recipe.h" +#include "../../../player/input/touchscreen/TouchAreaModel.h" +#include "../ArmorScreen.h" + +namespace Touch { + +#if defined(__APPLE__) + static const std::string demoVersionString("Not available in the Lite version"); +#else + static const std::string demoVersionString("Not available in the demo version"); +#endif + +#ifdef __APPLE__ + static const float BorderPixels = 4; + #ifdef DEMO_MODE + static const float BlockPixels = 22; + #else + static const float BlockPixels = 22; + #endif +#else + static const float BorderPixels = 4; + static const float BlockPixels = 24; +#endif + +static const int ItemSize = (int)(BlockPixels + 2*BorderPixels); + +static const int Bx = 10; // Border Frame width +static const int By = 6; // Border Frame height + +// +// Block selection screen +// +IngameBlockSelectionScreen::IngameBlockSelectionScreen() +: selectedItem(0), + _blockList(NULL), + _pendingClose(false), + bArmor (4, "Armor"), + bDone (3, ""), + //bDone (3, "Done"), + bMenu (2, "Menu"), + bCraft (1, "Craft"), + bHeader (0, "Select blocks") +{ +} + +IngameBlockSelectionScreen::~IngameBlockSelectionScreen() +{ + delete _blockList; +} + +void IngameBlockSelectionScreen::init() +{ + Inventory* inventory = minecraft->player->inventory; + + //const int itemWidth = 2 * BorderPixels + + + int maxWidth = width - Bx - Bx; + InventoryColumns = maxWidth / ItemSize; + const int realWidth = InventoryColumns * ItemSize; + const int realBx = (width - realWidth) / 2; + + IntRectangle rect(realBx, +#ifdef __APPLE__ + 24 + By - ((width==240)?1:0), realWidth, ((width==240)?1:0) + height-By-By-20-24); +#else + 24 + By, realWidth, height-By-By-20-24); +#endif + + _blockList = new InventoryPane(this, minecraft, rect, width, BorderPixels, inventory->getContainerSize() - Inventory::MAX_SELECTION_SIZE, ItemSize, (int)BorderPixels); + _blockList->fillMarginX = realBx; + + //for (int i = 0; i < inventory->getContainerSize(); ++i) + //LOGI("> %d - %s\n", i, inventory->getItem(i)? inventory->getItem(i)->getDescriptionId().c_str() : "<-->\n"); + + // Grid indices are 0..N-1 for main inventory only; slots 0..MAX_SELECTION_SIZE-1 are hotbar links. + InventorySize = inventory->getContainerSize() - Inventory::MAX_SELECTION_SIZE; + InventoryRows = 1 + (InventorySize-1) / InventoryColumns; + + // + // Buttons + // + ImageDef def; + def.name = "gui/spritesheet.png"; + def.x = 0; + def.y = 1; + def.width = def.height = 18; + def.setSrc(IntRectangle(60, 0, 18, 18)); + bDone.setImageDef(def, true); + bDone.width = bDone.height = 19; + + bDone.scaleWhenPressed = false; + + buttons.push_back(&bHeader); + buttons.push_back(&bDone); + if (!minecraft->isCreativeMode()) { + buttons.push_back(&bCraft); + buttons.push_back(&bArmor); + } +} + +void IngameBlockSelectionScreen::setupPositions() { + bHeader.y = bDone.y = bCraft.y = 0; + bDone.x = width - bDone.width; + bCraft.x = 0;//width - bDone.w - bCraft.w; + bCraft.width = bArmor.width = 48; + bArmor.x = bCraft.width; + + if (minecraft->isCreativeMode()) { + bHeader.x = 0; + bHeader.width = width;// - bDone.w; + bHeader.xText = width/2; // Center of the screen + } else { + bHeader.x = bCraft.width + bArmor.width; + bHeader.width = width - bCraft.width - bArmor.width;// - bDone.w; + bHeader.xText = bHeader.x + (bHeader.width - bDone.width) /2; + } + + clippingArea.x = 0; + clippingArea.w = minecraft->width; + clippingArea.y = 0; + clippingArea.h = (int)(Gui::GuiScale * 24); +} + +void IngameBlockSelectionScreen::removed() +{ + minecraft->gui.inventoryUpdated(); +} + +int IngameBlockSelectionScreen::getSlotPosX(int slotX) { + // @todo: Number of columns + return width / 2 - InventoryColumns * 10 + slotX * 20 + 2; +} + +int IngameBlockSelectionScreen::getSlotPosY(int slotY) { + return height - 16 - 3 - 22 * 2 - 22 * slotY; +} + +int IngameBlockSelectionScreen::getSlotHeight() { + // same as non-touch implementation + return 22; +} + +void IngameBlockSelectionScreen::mouseClicked(int x, int y, int buttonNum) { + _pendingClose = _blockList->_clickArea->isInside((float)x, (float)y); + if (!_pendingClose) + super::mouseClicked(x, y, buttonNum); +} + +void IngameBlockSelectionScreen::mouseReleased(int x, int y, int buttonNum) { + if (_pendingClose && _blockList->_clickArea->isInside((float)x, (float)y)) + minecraft->setScreen(NULL); + else + super::mouseReleased(x, y, buttonNum); +} + +void IngameBlockSelectionScreen::mouseWheel(int dx, int dy, int xm, int ym) +{ + if (dy == 0) return; + if (_blockList) { + float amount = -dy * getSlotHeight(); + _blockList->scrollBy(0, amount); + } + int cols = InventoryColumns; + int maxIndex = InventorySize - 1; + int idx = selectedItem; + if (dy > 0) { + if (idx >= cols) idx -= cols; + } else { + if (idx + cols <= maxIndex) idx += cols; + } + selectedItem = idx; +} + +bool IngameBlockSelectionScreen::addItem(const InventoryPane* pane, int itemId) +{ + Inventory* inventory = minecraft->player->inventory; + itemId += Inventory::MAX_SELECTION_SIZE; + + if (!inventory->getItem(itemId)) + return false; + + inventory->moveToSelectionSlot(0, itemId, true); + + inventory->selectSlot(0); +#ifdef __APPLE__ + minecraft->soundEngine->playUI("random.pop", 0.3f, 0.3f);//1.0f + 0.2f*(Mth::random()-Mth::random())); +#else + minecraft->soundEngine->playUI("random.pop2", 1.0f, 0.3f);//1.0f + 0.2f*(Mth::random()-Mth::random())); +#endif + + // Flash the selected gui item + minecraft->gui.flashSlot(inventory->selected); + return true; +} + +void IngameBlockSelectionScreen::tick() +{ + _blockList->tick(); + super::tick(); +} + +void IngameBlockSelectionScreen::render( int xm, int ym, float a ) +{ + glDisable2(GL_DEPTH_TEST); + glEnable2(GL_BLEND); + + Screen::render(xm, ym, a); + _blockList->render(xm, ym, a); + + // render frame + IntRectangle& bbox = _blockList->rect; + Tesselator::instance.colorABGR(0xffffffff); + minecraft->textures->loadAndBindTexture("gui/itemframe.png"); + glEnable2(GL_BLEND); + glColor4f2(1, 1, 1, 1); + glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + blit(0, bbox.y-By, 0, 0, width, bbox.h+By+By, 215, 256); // why bbox.h + 1*B? + glDisable2(GL_BLEND); + + glEnable2(GL_DEPTH_TEST); +} + +void IngameBlockSelectionScreen::renderDemoOverlay() { +#ifdef DEMO_MODE + fill( getSlotPosX(0) - 3, getSlotPosY(1) - 3, + getSlotPosX(9) - 3, getSlotPosY(-1) - 3, 0xa0 << 24); + + const int centerX = (getSlotPosX(4) + getSlotPosX(5)) / 2; + const int centerY = (getSlotPosY(0) + getSlotPosY(1)) / 2 + 5; + drawCenteredString(minecraft->font, demoVersionString, centerX, centerY, 0xffffffff); +#endif /*DEMO_MODE*/ +} + +void IngameBlockSelectionScreen::buttonClicked(Button* button) { + if (button->id == bDone.id) + minecraft->setScreen(NULL); + + if (button->id == bMenu.id) + minecraft->screenChooser.setScreen(SCREEN_PAUSE); + + if (button->id == bCraft.id) + minecraft->setScreen(new WorkbenchScreen(Recipe::SIZE_2X2)); + + if (button == &bArmor) + minecraft->setScreen(new ArmorScreen()); +} + +bool IngameBlockSelectionScreen::isAllowed( int slot ) +{ + const int gridCount = minecraft->player->inventory->getContainerSize() - Inventory::MAX_SELECTION_SIZE; + if (slot < 0 || slot >= gridCount) + return false; + +#ifdef DEMO_MODE + if (slot >= (minecraft->isCreativeMode()? 28 : 27)) return false; +#endif + return true; +} + +bool IngameBlockSelectionScreen::hasClippingArea( IntRectangle& out ) +{ + out = clippingArea; + return true; +} + +std::vector IngameBlockSelectionScreen::getItems( const InventoryPane* forPane ) +{ + std::vector out; + for (int i = Inventory::MAX_SELECTION_SIZE; i < minecraft->player->inventory->getContainerSize(); ++i) + out.push_back(minecraft->player->inventory->getItem(i)); + return out; +} + +} From cbd81b47ce4c974e51fe49637ff38de2f8913d5a Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Tue, 24 Mar 2026 17:32:52 +0300 Subject: [PATCH 022/189] ADD: EpikIzCool to credits --- src/client/gui/screens/CreditsScreen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/gui/screens/CreditsScreen.cpp b/src/client/gui/screens/CreditsScreen.cpp index 56f13ac..02114da 100644 --- a/src/client/gui/screens/CreditsScreen.cpp +++ b/src/client/gui/screens/CreditsScreen.cpp @@ -28,6 +28,7 @@ void CreditsScreen::init() { buttons.push_back(bHeader); buttons.push_back(btnBack); + // TODO: rewrite it // prepare text lines _lines.clear(); _lines.push_back("Minecraft: Pocket Edition"); @@ -39,6 +40,7 @@ void CreditsScreen::init() { _lines.push_back("Kolyah35"); _lines.push_back("karson"); _lines.push_back("deepfriedwaffles"); + _lines.push_back("EpikIzCool"); _lines.push_back(""); // avoid color tags around the URL so it isn't mangled by the parser please _lines.push_back("Join our Discord server: https://discord.gg/c58YesBxve"); From 88ef7f3d1792e7df7c849142187c1939b5bc15ae Mon Sep 17 00:00:00 2001 From: SAS_OP <14040386+sasop3@users.noreply.github.com> Date: Wed, 25 Mar 2026 06:07:49 +0300 Subject: [PATCH 023/189] added missing audio random.burp when finishing a food item --- .../mojang/minecraftpe/sound/SoundPlayer.java | 1 + src/client/sound/Sound.cpp | 2 + src/client/sound/Sound.h | 1 + src/client/sound/SoundEngine.cpp | 1 + src/client/sound/SoundEngine.mm | 1 + src/client/sound/data/burp1.pcm | 2413 +++++++++++++++++ 6 files changed, 2419 insertions(+) create mode 100644 src/client/sound/data/burp1.pcm diff --git a/project/android_java/src/com/mojang/minecraftpe/sound/SoundPlayer.java b/project/android_java/src/com/mojang/minecraftpe/sound/SoundPlayer.java index f3686c7..e36fa83 100755 --- a/project/android_java/src/com/mojang/minecraftpe/sound/SoundPlayer.java +++ b/project/android_java/src/com/mojang/minecraftpe/sound/SoundPlayer.java @@ -129,6 +129,7 @@ public class SoundPlayer new SoundId(R.raw.eat1, "random.eat"), new SoundId(R.raw.eat2, "random.eat"), new SoundId(R.raw.eat3, "random.eat"), + new SoundId(R.raw.burp1, "random.burp"), new SoundId(R.raw.fuse, "random.fuse"), new SoundId(R.raw.zpig1, "mob.zombiepig.zpig"), diff --git a/src/client/sound/Sound.cpp b/src/client/sound/Sound.cpp index ff5442a..1b1c6b5 100755 --- a/src/client/sound/Sound.cpp +++ b/src/client/sound/Sound.cpp @@ -111,6 +111,7 @@ #include "data/eat1.pcm" #include "data/eat2.pcm" #include "data/eat3.pcm" +#include "data/burp1.pcm" #include "data/fuse.pcm" SoundDesc SA_cloth1((char*)PCM_cloth1); @@ -221,6 +222,7 @@ SoundDesc SA_creeperdeath((char*)PCM_creeperdeath); SoundDesc SA_eat1((char*)PCM_eat1); SoundDesc SA_eat2((char*)PCM_eat2); SoundDesc SA_eat3((char*)PCM_eat3); +SoundDesc SA_burp1((char*)PCM_burp1); SoundDesc SA_fuse((char*)PCM_fuse); #endif /*!PRE_ANDROID23 && !__APPLE__*/ diff --git a/src/client/sound/Sound.h b/src/client/sound/Sound.h index 62f3db0..46ee97b 100755 --- a/src/client/sound/Sound.h +++ b/src/client/sound/Sound.h @@ -172,6 +172,7 @@ extern SoundDesc SA_creeperdeath; extern SoundDesc SA_eat1; extern SoundDesc SA_eat2; extern SoundDesc SA_eat3; +extern SoundDesc SA_burp1; extern SoundDesc SA_fuse; #endif /*!PRE_ANDROID23 && !__APPLE__*/ diff --git a/src/client/sound/SoundEngine.cpp b/src/client/sound/SoundEngine.cpp index 0af6d43..2f847fb 100755 --- a/src/client/sound/SoundEngine.cpp +++ b/src/client/sound/SoundEngine.cpp @@ -144,6 +144,7 @@ void SoundEngine::init( Minecraft* mc, Options* options ) sounds.add("random.eat", SA_eat1); sounds.add("random.eat", SA_eat2); sounds.add("random.eat", SA_eat3); + sounds.add("random.burp", SA_burp1); sounds.add("random.fuse", SA_fuse); #endif diff --git a/src/client/sound/SoundEngine.mm b/src/client/sound/SoundEngine.mm index c135d15..db9af18 100755 --- a/src/client/sound/SoundEngine.mm +++ b/src/client/sound/SoundEngine.mm @@ -227,6 +227,7 @@ void SoundEngine::init( Minecraft* mc, Options* options ) sounds.add( "random.eat", _pp("eat1")); sounds.add( "random.eat", _pp("eat2")); sounds.add( "random.eat", _pp("eat3")); + sounds.add( "random.burp", _pp("burp1")); sounds.add( "random.fuse", _pp("fuse")); sounds.add( "step.cloth", _pp("cloth1")); diff --git a/src/client/sound/data/burp1.pcm b/src/client/sound/data/burp1.pcm new file mode 100644 index 0000000..62c6a02 --- /dev/null +++ b/src/client/sound/data/burp1.pcm @@ -0,0 +1,2413 @@ +unsigned char PCM_burp1[28924] = { +0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x44, 0xac, 0x00, 0x00, 0x76, 0x38, 0x00, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0xfe, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, + 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0xff, 0xff, 0xfc, 0xff, 0xfd, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, + 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x06, 0x00, 0x07, 0x00, + 0x09, 0x00, 0x09, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x06, 0x00, + 0x06, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0c, 0x00, + 0x0b, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x0b, 0x00, 0x09, 0x00, + 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x07, 0x00, 0x07, 0x00, 0x09, 0x00, + 0x08, 0x00, 0x07, 0x00, 0x06, 0x00, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, + 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfd, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0b, 0x00, + 0x0a, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0b, 0x00, + 0x0a, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x09, 0x00, + 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x05, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x06, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xfa, 0xff, + 0xf9, 0xff, 0xf7, 0xff, 0xf3, 0xff, 0xef, 0xff, 0xec, 0xff, 0xeb, 0xff, + 0xed, 0xff, 0xed, 0xff, 0xed, 0xff, 0xed, 0xff, 0xef, 0xff, 0xf1, 0xff, + 0xf3, 0xff, 0xf7, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0xfd, 0xff, 0xff, 0xff, + 0x01, 0x00, 0x04, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x05, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xf5, 0xff, + 0xf4, 0xff, 0xf5, 0xff, 0xf6, 0xff, 0xf7, 0xff, 0xf4, 0xff, 0xf0, 0xff, + 0xed, 0xff, 0xec, 0xff, 0xec, 0xff, 0xed, 0xff, 0xef, 0xff, 0xf0, 0xff, + 0xf0, 0xff, 0xf1, 0xff, 0xf2, 0xff, 0xf3, 0xff, 0xf4, 0xff, 0xf4, 0xff, + 0xf3, 0xff, 0xf2, 0xff, 0xf2, 0xff, 0xf1, 0xff, 0xee, 0xff, 0xea, 0xff, + 0xe8, 0xff, 0xe7, 0xff, 0xe3, 0xff, 0xdf, 0xff, 0xdc, 0xff, 0xd6, 0xff, + 0xd2, 0xff, 0xd2, 0xff, 0xd4, 0xff, 0xd7, 0xff, 0xd9, 0xff, 0xdc, 0xff, + 0xe0, 0xff, 0xe3, 0xff, 0xe5, 0xff, 0xe9, 0xff, 0xef, 0xff, 0xf2, 0xff, + 0xf3, 0xff, 0xf2, 0xff, 0xf0, 0xff, 0xed, 0xff, 0xec, 0xff, 0xee, 0xff, + 0xee, 0xff, 0xe9, 0xff, 0xe1, 0xff, 0xdb, 0xff, 0xd9, 0xff, 0xd9, 0xff, + 0xda, 0xff, 0xdd, 0xff, 0xe2, 0xff, 0xe6, 0xff, 0xe8, 0xff, 0xe6, 0xff, + 0xe2, 0xff, 0xe4, 0xff, 0xe8, 0xff, 0xee, 0xff, 0xf2, 0xff, 0xf6, 0xff, + 0xfa, 0xff, 0xfd, 0xff, 0x00, 0x00, 0x04, 0x00, 0x07, 0x00, 0x0b, 0x00, + 0x0d, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x0b, 0x00, 0x0d, 0x00, 0x0e, 0x00, + 0x10, 0x00, 0x15, 0x00, 0x19, 0x00, 0x18, 0x00, 0x13, 0x00, 0x0e, 0x00, + 0x09, 0x00, 0x06, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0d, 0x00, 0x0c, 0x00, + 0x07, 0x00, 0x05, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x15, 0x00, 0x1a, 0x00, + 0x1c, 0x00, 0x1a, 0x00, 0x15, 0x00, 0x12, 0x00, 0x12, 0x00, 0x13, 0x00, + 0x0f, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0d, 0x00, + 0x09, 0x00, 0xff, 0xff, 0xf9, 0xff, 0xfb, 0xff, 0xff, 0xff, 0x02, 0x00, + 0x00, 0x00, 0xfe, 0xff, 0x02, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x04, 0x00, + 0xf8, 0xff, 0xf1, 0xff, 0xf5, 0xff, 0x02, 0x00, 0x0c, 0x00, 0x0c, 0x00, + 0x06, 0x00, 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x01, 0x00, 0xfb, 0xff, + 0xfa, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xff, 0xff, 0x00, 0x00, + 0xfc, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0x00, 0x00, + 0x07, 0x00, 0x0a, 0x00, 0x09, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x11, 0x00, + 0x15, 0x00, 0x13, 0x00, 0x0d, 0x00, 0x07, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x04, 0x00, 0x04, 0x00, 0x06, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x10, 0x00, + 0x10, 0x00, 0x11, 0x00, 0x14, 0x00, 0x17, 0x00, 0x17, 0x00, 0x15, 0x00, + 0x12, 0x00, 0x12, 0x00, 0x15, 0x00, 0x17, 0x00, 0x15, 0x00, 0x12, 0x00, + 0x11, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x15, 0x00, 0x09, 0x00, + 0x04, 0x00, 0x08, 0x00, 0x12, 0x00, 0x1e, 0x00, 0x23, 0x00, 0x24, 0x00, + 0x21, 0x00, 0x18, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x17, 0x00, 0x1e, 0x00, + 0x24, 0x00, 0x29, 0x00, 0x29, 0x00, 0x23, 0x00, 0x1e, 0x00, 0x20, 0x00, + 0x25, 0x00, 0x27, 0x00, 0x26, 0x00, 0x23, 0x00, 0x20, 0x00, 0x1f, 0x00, + 0x22, 0x00, 0x23, 0x00, 0x1f, 0x00, 0x1a, 0x00, 0x17, 0x00, 0x11, 0x00, + 0x0a, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0b, 0x00, 0x0a, 0x00, 0x03, 0x00, + 0xfd, 0xff, 0xfe, 0xff, 0x03, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x02, 0x00, 0x03, 0x00, 0x06, 0x00, 0x07, 0x00, 0x04, 0x00, 0xff, 0xff, + 0xfe, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf6, 0xff, 0xf8, 0xff, 0xf8, 0xff, + 0xf5, 0xff, 0xf4, 0xff, 0xf5, 0xff, 0xf1, 0xff, 0xe8, 0xff, 0xe2, 0xff, + 0xe2, 0xff, 0xe8, 0xff, 0xf1, 0xff, 0xf8, 0xff, 0xfc, 0xff, 0x00, 0x00, + 0x04, 0x00, 0x06, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x09, 0x00, + 0x06, 0x00, 0x07, 0x00, 0x0a, 0x00, 0x0b, 0x00, 0x0a, 0x00, 0x06, 0x00, + 0x02, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfb, 0xff, 0xf6, 0xff, + 0xf1, 0xff, 0xed, 0xff, 0xe7, 0xff, 0xe0, 0xff, 0xdd, 0xff, 0xe0, 0xff, + 0xe4, 0xff, 0xe3, 0xff, 0xe3, 0xff, 0xe8, 0xff, 0xf2, 0xff, 0xf8, 0xff, + 0xf8, 0xff, 0xf5, 0xff, 0xf5, 0xff, 0xfc, 0xff, 0x07, 0x00, 0x11, 0x00, + 0x13, 0x00, 0x15, 0x00, 0x1b, 0x00, 0x24, 0x00, 0x29, 0x00, 0x28, 0x00, + 0x23, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1e, 0x00, 0x1a, 0x00, 0x19, 0x00, + 0x19, 0x00, 0x10, 0x00, 0xff, 0xff, 0xeb, 0xff, 0xdd, 0xff, 0xda, 0xff, + 0xdb, 0xff, 0xdc, 0xff, 0xde, 0xff, 0xe1, 0xff, 0xdd, 0xff, 0xd1, 0xff, + 0xca, 0xff, 0xcf, 0xff, 0xd7, 0xff, 0xdf, 0xff, 0xe7, 0xff, 0xee, 0xff, + 0xf0, 0xff, 0xed, 0xff, 0xe7, 0xff, 0xe4, 0xff, 0xe4, 0xff, 0xe3, 0xff, + 0xe1, 0xff, 0xdf, 0xff, 0xde, 0xff, 0xde, 0xff, 0xde, 0xff, 0xdb, 0xff, + 0xd4, 0xff, 0xcd, 0xff, 0xc7, 0xff, 0xc8, 0xff, 0xce, 0xff, 0xd1, 0xff, + 0xd2, 0xff, 0xd3, 0xff, 0xd8, 0xff, 0xe1, 0xff, 0xea, 0xff, 0xf0, 0xff, + 0xf3, 0xff, 0xf9, 0xff, 0x04, 0x00, 0x0b, 0x00, 0x09, 0x00, 0xfd, 0xff, + 0xec, 0xff, 0xde, 0xff, 0xd6, 0xff, 0xd2, 0xff, 0xd1, 0xff, 0xd3, 0xff, + 0xd1, 0xff, 0xce, 0xff, 0xce, 0xff, 0xce, 0xff, 0xd0, 0xff, 0xdc, 0xff, + 0xf0, 0xff, 0xfe, 0xff, 0x05, 0x00, 0x10, 0x00, 0x21, 0x00, 0x37, 0x00, + 0x4c, 0x00, 0x54, 0x00, 0x4a, 0x00, 0x3c, 0x00, 0x39, 0x00, 0x3f, 0x00, + 0x41, 0x00, 0x3a, 0x00, 0x2d, 0x00, 0x21, 0x00, 0x18, 0x00, 0x0f, 0x00, + 0x02, 0x00, 0xf3, 0xff, 0xe4, 0xff, 0xdb, 0xff, 0xe1, 0xff, 0xf5, 0xff, + 0x12, 0x00, 0x2a, 0x00, 0x33, 0x00, 0x2f, 0x00, 0x27, 0x00, 0x1e, 0x00, + 0x10, 0x00, 0x01, 0x00, 0xfd, 0xff, 0x00, 0x00, 0xfc, 0xff, 0xf0, 0xff, + 0xee, 0xff, 0x03, 0x00, 0x1e, 0x00, 0x2f, 0x00, 0x36, 0x00, 0x39, 0x00, + 0x36, 0x00, 0x2d, 0x00, 0x25, 0x00, 0x1f, 0x00, 0x14, 0x00, 0x07, 0x00, + 0xf8, 0xff, 0xef, 0xff, 0xf2, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xf9, 0xff, 0xec, 0xff, 0xda, 0xff, 0xd5, 0xff, 0xe1, 0xff, 0xf1, 0xff, + 0xf8, 0xff, 0xfa, 0xff, 0x06, 0x00, 0x1b, 0x00, 0x27, 0x00, 0x1c, 0x00, + 0x07, 0x00, 0xf7, 0xff, 0xea, 0xff, 0xdb, 0xff, 0xcd, 0xff, 0xc7, 0xff, + 0xc9, 0xff, 0xd1, 0xff, 0xd2, 0xff, 0xc5, 0xff, 0xa3, 0xff, 0x75, 0xff, + 0x59, 0xff, 0x68, 0xff, 0x99, 0xff, 0xcf, 0xff, 0xe8, 0xff, 0xdf, 0xff, + 0xcf, 0xff, 0xcc, 0xff, 0xd0, 0xff, 0xd3, 0xff, 0xd5, 0xff, 0xd4, 0xff, + 0xcc, 0xff, 0xb4, 0xff, 0x8f, 0xff, 0x70, 0xff, 0x6d, 0xff, 0x7d, 0xff, + 0x7f, 0xff, 0x53, 0xff, 0xf9, 0xfe, 0x8d, 0xfe, 0x2e, 0xfe, 0xec, 0xfd, + 0xbf, 0xfd, 0x8c, 0xfd, 0x42, 0xfd, 0xda, 0xfc, 0x47, 0xfc, 0x8c, 0xfb, + 0xc7, 0xfa, 0xff, 0xf9, 0x2e, 0xf9, 0x89, 0xf8, 0x66, 0xf8, 0xd6, 0xf8, + 0xc5, 0xf9, 0x38, 0xfb, 0x13, 0xfd, 0x18, 0xff, 0x2e, 0x01, 0x48, 0x03, + 0xf8, 0x04, 0x9d, 0x05, 0xe7, 0x04, 0x49, 0x03, 0xc2, 0x01, 0xea, 0x00, + 0x9c, 0x00, 0xb3, 0x00, 0x3f, 0x01, 0xea, 0x01, 0x21, 0x02, 0xaf, 0x01, + 0xaa, 0x00, 0x63, 0xff, 0x95, 0xfe, 0x18, 0xff, 0x01, 0x01, 0x89, 0x03, + 0xd7, 0x05, 0x9d, 0x07, 0xd1, 0x08, 0x31, 0x09, 0x93, 0x08, 0x82, 0x07, + 0xc7, 0x06, 0xad, 0x06, 0x28, 0x07, 0x0f, 0x08, 0xee, 0x08, 0x3e, 0x09, + 0xe4, 0x08, 0x05, 0x08, 0xd2, 0x06, 0xaf, 0x05, 0x22, 0x05, 0x58, 0x05, + 0x03, 0x06, 0xaf, 0x06, 0xf8, 0x06, 0x89, 0x06, 0x26, 0x05, 0xeb, 0x02, + 0x64, 0x00, 0x40, 0xfe, 0xd8, 0xfc, 0x2e, 0xfc, 0x37, 0xfc, 0xd2, 0xfc, + 0xa9, 0xfd, 0x68, 0xfe, 0xcf, 0xfe, 0x9b, 0xfe, 0xc4, 0xfd, 0xc1, 0xfc, + 0x30, 0xfc, 0x4d, 0xfc, 0xd2, 0xfc, 0x23, 0xfd, 0xa3, 0xfc, 0x08, 0xfb, + 0x7c, 0xf8, 0x63, 0xf5, 0x49, 0xf2, 0xc9, 0xef, 0x38, 0xee, 0x91, 0xed, + 0xbe, 0xed, 0x9b, 0xee, 0xcb, 0xef, 0xec, 0xf0, 0xbf, 0xf1, 0x21, 0xf2, + 0x1d, 0xf2, 0xef, 0xf1, 0xca, 0xf1, 0xda, 0xf1, 0x56, 0xf2, 0x54, 0xf3, + 0xa5, 0xf4, 0x1d, 0xf6, 0xad, 0xf7, 0x2f, 0xf9, 0x79, 0xfa, 0x97, 0xfb, + 0x95, 0xfc, 0x52, 0xfd, 0xc1, 0xfd, 0x1b, 0xfe, 0x9e, 0xfe, 0x56, 0xff, + 0x15, 0x00, 0xb7, 0x00, 0x90, 0x01, 0x1e, 0x03, 0x36, 0x05, 0xf8, 0x06, + 0xc0, 0x07, 0xa5, 0x07, 0x10, 0x07, 0x68, 0x06, 0x2c, 0x06, 0xdc, 0x06, + 0x97, 0x08, 0x35, 0x0b, 0x66, 0x0e, 0x75, 0x11, 0x7f, 0x13, 0x3b, 0x14, + 0x33, 0x14, 0xe9, 0x13, 0x34, 0x13, 0xca, 0x11, 0x08, 0x10, 0xa7, 0x0e, + 0x00, 0x0e, 0x10, 0x0e, 0xa1, 0x0e, 0x20, 0x0f, 0xf1, 0x0e, 0x20, 0x0e, + 0x3a, 0x0d, 0x92, 0x0c, 0x2d, 0x0c, 0x2d, 0x0c, 0xb0, 0x0c, 0x5b, 0x0d, + 0x9d, 0x0d, 0x4e, 0x0d, 0x7d, 0x0c, 0x22, 0x0b, 0x75, 0x09, 0xfa, 0x07, + 0xfd, 0x06, 0x51, 0x06, 0xb1, 0x05, 0x19, 0x05, 0xb7, 0x04, 0x85, 0x04, + 0x37, 0x04, 0xbd, 0x03, 0x59, 0x03, 0xff, 0x02, 0x46, 0x02, 0x13, 0x01, + 0xa7, 0xff, 0x24, 0xfe, 0xb7, 0xfc, 0xc0, 0xfb, 0x54, 0xfb, 0x1f, 0xfb, + 0xe4, 0xfa, 0xcc, 0xfa, 0xf6, 0xfa, 0x1f, 0xfb, 0xf2, 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 0xf5, 0xfb, + 0x90, 0xfc, 0x92, 0xfd, 0xd5, 0xfe, 0x47, 0x00, 0x88, 0x01, 0x17, 0x02, + 0x53, 0x02, 0xf4, 0x02, 0xaa, 0x03, 0xd5, 0x03, 0xc4, 0x03, 0xcc, 0x03, + 0x99, 0x03, 0x4c, 0x03, 0x99, 0x03, 0x9f, 0x04, 0xed, 0x05, 0x3a, 0x07, + 0x71, 0x08, 0x77, 0x09, 0x41, 0x0a, 0xd4, 0x0a, 0x22, 0x0b, 0x0a, 0x0b, + 0xab, 0x0a, 0x61, 0x0a, 0x05, 0x0a, 0xf0, 0x08, 0x59, 0x07, 0x99, 0x06, + 0x59, 0x07, 0xe0, 0x08, 0x61, 0x0a, 0x33, 0x0b, 0x5b, 0x0a, 0xbf, 0x07, + 0xe5, 0x04, 0x16, 0x03, 0x19, 0x02, 0x9e, 0x01, 0x4c, 0x02, 0x4f, 0x04, + 0x7e, 0x06, 0xe4, 0x07, 0xc5, 0x08, 0x45, 0x09, 0xae, 0x08, 0xb5, 0x06, + 0x04, 0x04, 0x5d, 0x01, 0x41, 0xff, 0x1a, 0xfe, 0x12, 0xfe, 0xb6, 0xfe, + 0x46, 0xff, 0x6a, 0xff, 0x55, 0xff, 0x1b, 0xff, 0x6c, 0xfe, 0x29, 0xfd, + 0xd8, 0xfb, 0x27, 0xfb, 0x19, 0xfb, 0x4c, 0xfb, 0x00, 0xfc, 0xb0, 0xfd, + 0xa7, 0xff, 0x61, 0x00, 0x82, 0xff, 0x45, 0xfe, 0xc6, 0xfd, 0xe2, 0xfd, + 0x2c, 0xfe, 0xe2, 0xfe, 0x43, 0x00, 0xe7, 0x01, 0x4f, 0x03, 0x74, 0x04, + 0x47, 0x05, 0x38, 0x05, 0x06, 0x04, 0xb9, 0x02, 0xb4, 0x02, 0x28, 0x04, + 0x55, 0x06, 0xb1, 0x08, 0xcf, 0x0a, 0x01, 0x0c, 0x0e, 0x0c, 0xa9, 0x0b, + 0x74, 0x0b, 0x63, 0x0b, 0x61, 0x0b, 0xa1, 0x0b, 0x3a, 0x0c, 0x23, 0x0d, + 0x11, 0x0e, 0x6d, 0x0e, 0x4f, 0x0e, 0xb7, 0x0e, 0xed, 0x0f, 0xfb, 0x10, + 0x50, 0x11, 0x79, 0x11, 0xfa, 0x11, 0x8f, 0x12, 0x8e, 0x12, 0xa5, 0x11, + 0x44, 0x10, 0x37, 0x0f, 0xab, 0x0e, 0x46, 0x0e, 0x1d, 0x0e, 0x8e, 0x0e, + 0x69, 0x0f, 0xdd, 0x0f, 0xfc, 0x0e, 0xa6, 0x0c, 0xee, 0x09, 0xf1, 0x07, + 0xea, 0x06, 0x0a, 0x07, 0xca, 0x08, 0xae, 0x0b, 0x00, 0x0e, 0x9e, 0x0e, + 0x14, 0x0e, 0x47, 0x0d, 0x26, 0x0c, 0x9b, 0x0a, 0x30, 0x09, 0xee, 0x07, + 0x57, 0x06, 0xd7, 0x04, 0x7b, 0x04, 0x53, 0x05, 0x58, 0x06, 0xa8, 0x06, + 0x16, 0x06, 0xbc, 0x04, 0xd6, 0x02, 0x18, 0x01, 0x46, 0x00, 0x65, 0x00, + 0xf4, 0x00, 0xbd, 0x01, 0xc3, 0x02, 0xb9, 0x03, 0x1c, 0x04, 0xb2, 0x03, + 0xa9, 0x02, 0x8c, 0x01, 0x17, 0x01, 0xb3, 0x01, 0x20, 0x03, 0xb9, 0x04, + 0xf7, 0x05, 0xa2, 0x06, 0xa9, 0x06, 0xf5, 0x05, 0x9f, 0x04, 0x2b, 0x03, + 0x3c, 0x02, 0x2b, 0x02, 0x04, 0x03, 0x9b, 0x04, 0x86, 0x06, 0x2f, 0x08, + 0x0d, 0x09, 0xb5, 0x08, 0x1c, 0x07, 0x3d, 0x05, 0xc2, 0x04, 0x23, 0x06, + 0x58, 0x08, 0xa0, 0x0a, 0xce, 0x0c, 0x43, 0x0e, 0x8b, 0x0e, 0x09, 0x0e, + 0x1d, 0x0d, 0xcb, 0x0b, 0x88, 0x0a, 0x1d, 0x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, 0x02, 0x44, 0x03, 0xb9, 0x02, 0x41, 0x01, 0x11, 0xff, 0x06, 0xfd, + 0xeb, 0xfb, 0xaa, 0xfb, 0xf6, 0xfb, 0xf0, 0xfc, 0x5f, 0xfe, 0x70, 0xff, + 0xff, 0xff, 0x8e, 0x00, 0xac, 0x00, 0x55, 0xff, 0xc1, 0xfc, 0x29, 0xfa, + 0x64, 0xf8, 0x7f, 0xf7, 0x25, 0xf7, 0x51, 0xf7, 0x70, 0xf8, 0x7d, 0xfa, + 0x61, 0xfc, 0xdd, 0xfc, 0x01, 0xfc, 0x19, 0xfb, 0xe8, 0xfa, 0xe5, 0xfa, + 0x80, 0xfa, 0xf9, 0xf9, 0x92, 0xf9, 0x2f, 0xf9, 0xc6, 0xf8, 0x72, 0xf8, + 0x3e, 0xf8, 0x69, 0xf8, 0x90, 0xf9, 0xf7, 0xfb, 0xb2, 0xfe, 0x39, 0x00, + 0x0e, 0x00, 0x20, 0xff, 0x55, 0xfe, 0x8f, 0xfd, 0x7a, 0xfc, 0x56, 0xfb, + 0xb4, 0xfa, 0xee, 0xfa, 0xef, 0xfb, 0x54, 0xfd, 0xaf, 0xfe, 0x98, 0xff, + 0xf5, 0xff, 0x3e, 0x00, 0xd6, 0x00, 0x5e, 0x01, 0x7b, 0x01, 0x97, 0x01, + 0x49, 0x02, 0x74, 0x03, 0x4a, 0x04, 0x54, 0x04, 0x34, 0x04, 0xaa, 0x04, + 0xa1, 0x05, 0xcb, 0x06, 0xfc, 0x07, 0xed, 0x08, 0x72, 0x09, 0x6d, 0x09, + 0x65, 0x08, 0x1e, 0x06, 0x6e, 0x03, 0xc4, 0x01, 0xe6, 0x01, 0x82, 0x03, + 0xc8, 0x05, 0xf7, 0x07, 0x54, 0x09, 0x84, 0x09, 0x08, 0x09, 0x9d, 0x08, + 0x46, 0x08, 0xb3, 0x07, 0x1c, 0x07, 0xdf, 0x06, 0xe3, 0x06, 0x06, 0x07, + 0x7b, 0x07, 0x42, 0x08, 0xd8, 0x08, 0xa0, 0x08, 0x97, 0x07, 0xab, 0x06, + 0xd9, 0x06, 0xd8, 0x07, 0x57, 0x08, 0x86, 0x07, 0xb0, 0x05, 0x87, 0x03, + 0x99, 0x01, 0x58, 0x00, 0x10, 0x00, 0xcc, 0x00, 0x50, 0x02, 0x12, 0x04, + 0x5a, 0x05, 0xc3, 0x05, 0x72, 0x05, 0xbc, 0x04, 0xf9, 0x03, 0x7a, 0x03, + 0x51, 0x03, 0x49, 0x03, 0x22, 0x03, 0xd3, 0x02, 0xbd, 0x02, 0x5f, 0x03, + 0x7e, 0x04, 0x09, 0x05, 0x5d, 0x04, 0x2a, 0x03, 0x63, 0x02, 0xed, 0x01, + 0x3c, 0x01, 0x79, 0x00, 0x2e, 0x00, 0x91, 0x00, 0x91, 0x01, 0x06, 0x03, + 0xa9, 0x04, 0xec, 0x05, 0x36, 0x06, 0x9f, 0x05, 0xf3, 0x04, 0x9d, 0x04, + 0x93, 0x04, 0x20, 0x05, 0x75, 0x06, 0xc8, 0x07, 0x02, 0x08, 0x0f, 0x07, + 0xb4, 0x05, 0x99, 0x04, 0x2a, 0x04, 0xd4, 0x04, 0x8e, 0x06, 0x82, 0x08, + 0xce, 0x09, 0x5a, 0x0a, 0x7b, 0x0a, 0x1e, 0x0a, 0x1e, 0x09, 0x22, 0x08, + 0xf1, 0x07, 0x39, 0x08, 0x22, 0x08, 0xca, 0x07, 0x14, 0x08, 0x22, 0x09, + 0x00, 0x0a, 0xdd, 0x09, 0xf1, 0x08, 0x02, 0x08, 0xce, 0x07, 0xcd, 0x08, + 0xc7, 0x0a, 0xda, 0x0c, 0x58, 0x0e, 0x1e, 0x0f, 0x0f, 0x0f, 0x03, 0x0e, + 0x33, 0x0c, 0x22, 0x0a, 0x3f, 0x08, 0x0f, 0x07, 0x02, 0x07, 0xcf, 0x07, + 0xb4, 0x08, 0x86, 0x09, 0x83, 0x0a, 0x21, 0x0b, 0x4c, 0x0a, 0xf9, 0x07, + 0x7a, 0x05, 0x22, 0x04, 0x40, 0x04, 0x64, 0x05, 0x03, 0x07, 0xbc, 0x08, + 0x43, 0x0a, 0x3d, 0x0b, 0x46, 0x0b, 0x35, 0x0a, 0x6e, 0x08, 0xd7, 0x06, + 0x23, 0x06, 0x3f, 0x06, 0xc3, 0x06, 0x47, 0x07, 0x31, 0x07, 0x56, 0x06, + 0x69, 0x05, 0xf4, 0x04, 0xc3, 0x04, 0x8c, 0x04, 0x39, 0x04, 0xfa, 0x03, + 0x3d, 0x04, 0xe2, 0x04, 0x2a, 0x05, 0xe6, 0x04, 0x66, 0x04, 0x95, 0x03, + 0x8b, 0x02, 0x0b, 0x02, 0x7a, 0x02, 0x74, 0x03, 0xa6, 0x04, 0xe4, 0x05, + 0xb4, 0x06, 0xbe, 0x06, 0x3b, 0x06, 0x6d, 0x05, 0x66, 0x04, 0x92, 0x03, + 0x8e, 0x03, 0x42, 0x04, 0x08, 0x05, 0x9b, 0x05, 0x0a, 0x06, 0x34, 0x06, + 0x09, 0x06, 0xb2, 0x05, 0x2d, 0x05, 0x7e, 0x04, 0x04, 0x04, 0x0a, 0x04, + 0x95, 0x04, 0x77, 0x05, 0x18, 0x06, 0xc2, 0x05, 0x77, 0x04, 0x37, 0x03, + 0x2e, 0x03, 0x79, 0x04, 0x10, 0x06, 0x45, 0x07, 0x56, 0x08, 0x1b, 0x09, + 0xd2, 0x08, 0x95, 0x07, 0x76, 0x06, 0x19, 0x06, 0x38, 0x06, 0x3a, 0x06, + 0xb9, 0x05, 0xe6, 0x04, 0x95, 0x04, 0x74, 0x05, 0x42, 0x07, 0xe7, 0x08, + 0x54, 0x09, 0x60, 0x08, 0xc3, 0x06, 0x29, 0x05, 0xc7, 0x03, 0xfe, 0x02, + 0x33, 0x03, 0xd1, 0x03, 0xdc, 0x03, 0x60, 0x03, 0xea, 0x02, 0x29, 0x02, + 0xe9, 0x00, 0x6b, 0x00, 0xb3, 0x01, 0xbd, 0x03, 0x27, 0x05, 0xf4, 0x05, + 0x4a, 0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, 0xfc, 0xe6, 0xfc, 0x59, 0xfc, 0x62, 0xfb, + 0x4f, 0xfb, 0x3c, 0xfc, 0x7d, 0xfd, 0xaa, 0xfe, 0x80, 0xff, 0x92, 0xff, + 0xe6, 0xfe, 0x51, 0xfe, 0x70, 0xfe, 0x0b, 0xff, 0xe4, 0xff, 0xfe, 0x00, + 0xff, 0x01, 0x98, 0x02, 0xf5, 0x02, 0xf0, 0x02, 0x0f, 0x02, 0xd5, 0x00, + 0x74, 0x00, 0x2a, 0x01, 0x39, 0x02, 0x0e, 0x03, 0x76, 0x03, 0x46, 0x03, + 0x9d, 0x02, 0xf6, 0x01, 0x83, 0x01, 0xf3, 0x00, 0x1c, 0x00, 0x84, 0xff, + 0xd2, 0xff, 0xc1, 0x00, 0x75, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x29, 0x02, + 0x07, 0x02, 0xe5, 0x01, 0x26, 0x02, 0xd5, 0x02, 0xe8, 0x03, 0x0b, 0x05, + 0x7e, 0x05, 0x1f, 0x05, 0xbd, 0x04, 0xb9, 0x04, 0x56, 0x04, 0x11, 0x03, + 0x69, 0x01, 0xe7, 0xff, 0xa0, 0xfe, 0xfb, 0xfd, 0x87, 0xfe, 0xec, 0xff, + 0x2d, 0x01, 0xd2, 0x01, 0xe1, 0x01, 0x54, 0x01, 0x68, 0x00, 0xd2, 0xff, + 0xf9, 0xff, 0x55, 0x00, 0x54, 0x00, 0x5d, 0x00, 0x10, 0x01, 0xff, 0x01, + 0x47, 0x02, 0xd2, 0x01, 0x1f, 0x01, 0x76, 0x00, 0x08, 0x00, 0xd9, 0xff, + 0x5e, 0xff, 0x5a, 0xfe, 0xbf, 0xfd, 0x2c, 0xfe, 0x9a, 0xfe, 0x35, 0xfe, + 0xf7, 0xfd, 0xb5, 0xfe, 0x8f, 0xff, 0xcc, 0xff, 0x11, 0x00, 0xc8, 0x00, + 0x39, 0x01, 0xc6, 0x00, 0xc6, 0xff, 0xfa, 0xfe, 0xc3, 0xfe, 0x26, 0xff, + 0x0e, 0x00, 0x0d, 0x01, 0x66, 0x01, 0xfb, 0x00, 0x4f, 0x00, 0xa4, 0xff, + 0x25, 0xff, 0x4e, 0xff, 0x39, 0x00, 0x74, 0x01, 0x99, 0x02, 0x2c, 0x03, + 0xcd, 0x02, 0xea, 0x01, 0x13, 0x01, 0x4b, 0x00, 0xf0, 0xff, 0xa9, 0x00, + 0x13, 0x02, 0x2d, 0x03, 0xad, 0x03, 0x8f, 0x03, 0x90, 0x02, 0x0b, 0x01, + 0x12, 0x00, 0x2e, 0x00, 0xeb, 0x00, 0xb6, 0x01, 0x9d, 0x02, 0xf3, 0x03, + 0x5d, 0x05, 0xe1, 0x05, 0x3a, 0x05, 0x3b, 0x04, 0x9d, 0x03, 0x36, 0x03, + 0xbb, 0x02, 0x80, 0x02, 0xf4, 0x02, 0x96, 0x03, 0x45, 0x03, 0xdf, 0x01, + 0x90, 0x00, 0x2f, 0x00, 0x61, 0x00, 0x9e, 0x00, 0x0a, 0x01, 0x1d, 0x02, + 0xab, 0x03, 0x88, 0x04, 0xf1, 0x03, 0xb0, 0x02, 0x89, 0x01, 0xf1, 0xff, + 0xeb, 0xfd, 0x0f, 0xfd, 0x1e, 0xfe, 0xbb, 0xff, 0x94, 0x00, 0xee, 0x00, + 0x73, 0x01, 0xcf, 0x01, 0x52, 0x01, 0x38, 0x00, 0x4b, 0xff, 0x8a, 0xfe, + 0x91, 0xfd, 0xe7, 0xfc, 0x4b, 0xfd, 0x39, 0xfe, 0x98, 0xfe, 0x4f, 0xfe, + 0x11, 0xfe, 0x25, 0xfe, 0x54, 0xfe, 0x7c, 0xfe, 0xac, 0xfe, 0xe8, 0xfe, + 0x34, 0xff, 0x4b, 0xff, 0x9b, 0xfe, 0x18, 0xfd, 0x9c, 0xfb, 0xc6, 0xfa, + 0x68, 0xfa, 0x79, 0xfa, 0x70, 0xfb, 0x6a, 0xfd, 0xa9, 0xff, 0x36, 0x01, + 0xac, 0x01, 0x47, 0x01, 0x41, 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, 0x14, 0xff, 0x91, 0xfe, + 0x53, 0xfe, 0xa8, 0xfe, 0xb6, 0xff, 0xf5, 0x00, 0xa2, 0x01, 0xc4, 0x01, + 0xee, 0x01, 0x23, 0x02, 0xe9, 0x01, 0x2b, 0x01, 0x53, 0x00, 0xcc, 0xff, + 0xab, 0xff, 0xb0, 0xff, 0xb5, 0xff, 0x04, 0x00, 0xdb, 0x00, 0xec, 0x01, + 0x9d, 0x02, 0xa6, 0x02, 0x49, 0x02, 0xfc, 0x01, 0xf1, 0x01, 0x27, 0x02, + 0xec, 0x02, 0x8f, 0x04, 0x89, 0x06, 0xbd, 0x07, 0x7e, 0x07, 0xe6, 0x05, + 0x9f, 0x03, 0x7d, 0x01, 0x04, 0x00, 0x4a, 0xff, 0x58, 0xff, 0x56, 0x00, + 0x2b, 0x02, 0x4f, 0x04, 0x1b, 0x06, 0xe1, 0x06, 0x31, 0x06, 0x96, 0x04, + 0x48, 0x03, 0xb5, 0x02, 0x4b, 0x02, 0xce, 0x01, 0x93, 0x01, 0xb3, 0x01, + 0xe6, 0x01, 0xd3, 0x01, 0x48, 0x01, 0xa4, 0x00, 0x86, 0x00, 0xe4, 0x00, + 0x3d, 0x01, 0x7a, 0x01, 0xca, 0x01, 0x30, 0x02, 0x98, 0x02, 0xe0, 0x02, + 0xd6, 0x02, 0x49, 0x02, 0x11, 0x01, 0x75, 0xff, 0x50, 0xfe, 0x1b, 0xfe, + 0x52, 0xfe, 0x95, 0xfe, 0x55, 0xff, 0xa9, 0x00, 0xae, 0x01, 0x96, 0x01, + 0x8f, 0x00, 0x68, 0xff, 0xd5, 0xfe, 0x09, 0xff, 0xe2, 0xff, 0x35, 0x01, + 0xc7, 0x02, 0x22, 0x04, 0xda, 0x04, 0xbf, 0x04, 0xe5, 0x03, 0xb3, 0x02, + 0xaf, 0x01, 0xf9, 0x00, 0x44, 0x00, 0x8d, 0xff, 0x70, 0xff, 0x5f, 0x00, + 0xdd, 0x01, 0x10, 0x03, 0xa2, 0x03, 0x9e, 0x03, 0x08, 0x03, 0x45, 0x02, + 0x06, 0x02, 0x5f, 0x02, 0xdc, 0x02, 0x61, 0x03, 0xd9, 0x03, 0x7c, 0x03, + 0xc8, 0x01, 0xdc, 0xff, 0x81, 0xff, 0x08, 0x01, 0x3e, 0x03, 0x19, 0x05, + 0x52, 0x06, 0xca, 0x06, 0x74, 0x06, 0xba, 0x05, 0x19, 0x05, 0xa1, 0x04, + 0x5f, 0x04, 0xb0, 0x04, 0x83, 0x05, 0x1c, 0x06, 0x36, 0x06, 0x78, 0x06, + 0x1c, 0x07, 0x33, 0x07, 0x00, 0x06, 0x0f, 0x04, 0x69, 0x02, 0x7c, 0x01, + 0x39, 0x01, 0x9e, 0x01, 0xb7, 0x02, 0x22, 0x04, 0x1d, 0x05, 0x3e, 0x05, + 0xdd, 0x04, 0x79, 0x04, 0x2d, 0x04, 0xcf, 0x03, 0x30, 0x03, 0x5f, 0x02, + 0xa1, 0x01, 0x18, 0x01, 0xb4, 0x00, 0x8a, 0x00, 0xad, 0x00, 0xe5, 0x00, + 0xf8, 0x00, 0x03, 0x01, 0x3b, 0x01, 0xb7, 0x01, 0x77, 0x02, 0x67, 0x03, + 0x09, 0x04, 0x7e, 0x03, 0x82, 0x01, 0x49, 0xff, 0x57, 0xfe, 0xb5, 0xfe, + 0x51, 0xff, 0x92, 0xff, 0x9b, 0xff, 0xa0, 0xff, 0xbc, 0xff, 0xee, 0xff, + 0xf7, 0xff, 0xbb, 0xff, 0x8b, 0xff, 0xd2, 0xff, 0x93, 0x00, 0x6e, 0x01, + 0x10, 0x02, 0x8d, 0x02, 0x01, 0x03, 0x15, 0x03, 0x7e, 0x02, 0x88, 0x01, + 0xa6, 0x00, 0x02, 0x00, 0xb9, 0xff, 0xdb, 0xff, 0x30, 0x00, 0x53, 0x00, + 0x1d, 0x00, 0xd3, 0xff, 0xcc, 0xff, 0xe3, 0xff, 0xc2, 0xff, 0x8a, 0xff, + 0x72, 0xff, 0x3d, 0xff, 0xb1, 0xfe, 0x1d, 0xfe, 0xea, 0xfd, 0x26, 0xfe, + 0xc3, 0xfe, 0xaf, 0xff, 0xa4, 0x00, 0x45, 0x01, 0x96, 0x01, 0x07, 0x02, + 0xe5, 0x02, 0xe3, 0x03, 0x5e, 0x04, 0x0b, 0x04, 0x3e, 0x03, 0x88, 0x02, + 0x1a, 0x02, 0x97, 0x01, 0xb9, 0x00, 0xf7, 0xff, 0x0b, 0x00, 0xf9, 0x00, + 0x0d, 0x02, 0xe5, 0x02, 0xdd, 0x03, 0xed, 0x04, 0x1d, 0x05, 0x02, 0x04, + 0x82, 0x02, 0x7d, 0x01, 0x05, 0x01, 0xfe, 0x00, 0x4a, 0x01, 0x93, 0x01, + 0xb6, 0x01, 0x04, 0x02, 0x97, 0x02, 0x03, 0x03, 0xf7, 0x02, 0xb5, 0x02, + 0xab, 0x02, 0xee, 0x02, 0x51, 0x03, 0x9c, 0x03, 0x97, 0x03, 0x1f, 0x03, + 0x43, 0x02, 0x39, 0x01, 0x2e, 0x00, 0x6b, 0xff, 0x49, 0xff, 0xb2, 0xff, + 0x1b, 0x00, 0x13, 0x00, 0xb5, 0xff, 0x79, 0xff, 0xb3, 0xff, 0x3a, 0x00, + 0xac, 0x00, 0xcb, 0x00, 0x86, 0x00, 0xfc, 0xff, 0x53, 0xff, 0x84, 0xfe, + 0x9b, 0xfd, 0x1f, 0xfd, 0xc3, 0xfd, 0xac, 0xff, 0x18, 0x02, 0xd1, 0x03, + 0xf5, 0x03, 0x76, 0x02, 0x45, 0x00, 0xd8, 0xfe, 0x04, 0xff, 0x5f, 0x00, + 0xd5, 0x01, 0x82, 0x02, 0x23, 0x02, 0xd8, 0x00, 0xd1, 0xfe, 0xc7, 0xfc, + 0x00, 0xfc, 0x0e, 0xfd, 0x29, 0xff, 0x35, 0x01, 0x9b, 0x02, 0x5e, 0x03, + 0xe9, 0x03, 0x3e, 0x04, 0x9b, 0x03, 0xad, 0x01, 0x65, 0xff, 0x15, 0xfe, + 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36, 0xfd, 0x52, 0xfd, 0xb5, 0xfd, + 0x51, 0xfe, 0x10, 0xff, 0xcf, 0xff, 0x5e, 0x00, 0xaf, 0x00, 0xdf, 0x00, + 0x10, 0x01, 0x55, 0x01, 0xa6, 0x01, 0xf2, 0x01, 0x4c, 0x02, 0xf2, 0x02, + 0x00, 0x04, 0x27, 0x05, 0xe3, 0x05, 0xef, 0x05, 0x91, 0x05, 0x66, 0x05, + 0xcc, 0x05, 0x9f, 0x06, 0x8b, 0x07, 0x75, 0x08, 0x4b, 0x09, 0xb1, 0x09, + 0x5f, 0x09, 0xb1, 0x08, 0x46, 0x08, 0x4c, 0x08, 0x94, 0x08, 0x08, 0x09, + 0x93, 0x09, 0x09, 0x0a, 0x46, 0x0a, 0x1a, 0x0a, 0x48, 0x09, 0xee, 0x07, + 0x92, 0x06, 0xa7, 0x05, 0x5b, 0x05, 0xbf, 0x05, 0xad, 0x06, 0xbc, 0x07, + 0x96, 0x08, 0xfd, 0x08, 0xb4, 0x08, 0xd1, 0x07, 0xba, 0x06, 0x99, 0x05, + 0x66, 0x04, 0x71, 0x03, 0x15, 0x03, 0x3b, 0x03, 0x8a, 0x03, 0xc2, 0x03, + 0xae, 0x03, 0x3d, 0x03, 0xad, 0x02, 0x30, 0x02, 0xa5, 0x01, 0xde, 0x00, + 0x1b, 0x00, 0xe4, 0xff, 0x61, 0x00, 0x05, 0x01, 0x25, 0x01, 0x9a, 0x00, + 0xb0, 0xff, 0xd7, 0xfe, 0x63, 0xfe, 0x72, 0xfe, 0xf4, 0xfe, 0xb7, 0xff, + 0x56, 0x00, 0x78, 0x00, 0x31, 0x00, 0xca, 0xff, 0x2c, 0xff, 0x1c, 0xfe, + 0xe1, 0xfc, 0x34, 0xfc, 0x99, 0xfc, 0xfb, 0xfd, 0xbd, 0xff, 0x2c, 0x01, + 0xd4, 0x01, 0x77, 0x01, 0x05, 0x00, 0xf4, 0xfd, 0x51, 0xfc, 0x18, 0xfc, + 0x6c, 0xfd, 0x85, 0xff, 0x65, 0x01, 0x89, 0x02, 0xf8, 0x02, 0xf3, 0x02, + 0xc6, 0x02, 0x96, 0x02, 0x42, 0x02, 0xd5, 0x01, 0xde, 0x01, 0xcf, 0x02, + 0x58, 0x04, 0xf5, 0x05, 0x6b, 0x07, 0x69, 0x08, 0x80, 0x08, 0xba, 0x07, + 0xbd, 0x06, 0x40, 0x06, 0x92, 0x06, 0x8f, 0x07, 0xd8, 0x08, 0xf5, 0x09, + 0x6d, 0x0a, 0x09, 0x0a, 0x17, 0x09, 0x32, 0x08, 0xd1, 0x07, 0x0a, 0x08, + 0xc7, 0x08, 0xe3, 0x09, 0x02, 0x0b, 0xc1, 0x0b, 0xff, 0x0b, 0xd9, 0x0b, + 0x5c, 0x0b, 0x73, 0x0a, 0x56, 0x09, 0x9f, 0x08, 0xad, 0x08, 0x53, 0x09, + 0x45, 0x0a, 0x42, 0x0b, 0xd2, 0x0b, 0x7e, 0x0b, 0x5d, 0x0a, 0x20, 0x09, + 0x5d, 0x08, 0x1f, 0x08, 0x13, 0x08, 0xd3, 0x07, 0x3f, 0x07, 0x8f, 0x06, + 0x16, 0x06, 0x16, 0x06, 0x8e, 0x06, 0x07, 0x07, 0xe9, 0x06, 0x06, 0x06, + 0xb8, 0x04, 0x78, 0x03, 0x83, 0x02, 0xef, 0x01, 0xdf, 0x01, 0x42, 0x02, + 0xab, 0x02, 0xc5, 0x02, 0x8d, 0x02, 0x13, 0x02, 0x47, 0x01, 0x4c, 0x00, + 0xa5, 0xff, 0x8f, 0xff, 0x99, 0xff, 0x36, 0xff, 0x5f, 0xfe, 0x8f, 0xfd, + 0x4c, 0xfd, 0x98, 0xfd, 0xee, 0xfd, 0xd4, 0xfd, 0x52, 0xfd, 0xd6, 0xfc, + 0xb4, 0xfc, 0xdf, 0xfc, 0x13, 0xfd, 0x24, 0xfd, 0x1b, 0xfd, 0x0f, 0xfd, + 0x08, 0xfd, 0x19, 0xfd, 0x4f, 0xfd, 0x92, 0xfd, 0xea, 0xfd, 0x7c, 0xfe, + 0x34, 0xff, 0xd8, 0xff, 0x39, 0x00, 0x34, 0x00, 0xde, 0xff, 0x81, 0xff, + 0x3c, 0xff, 0x07, 0xff, 0x09, 0xff, 0x9a, 0xff, 0xc2, 0x00, 0xfd, 0x01, + 0xbc, 0x02, 0xe3, 0x02, 0xd9, 0x02, 0x14, 0x03, 0x87, 0x03, 0xd1, 0x03, + 0x00, 0x04, 0x84, 0x04, 0x5a, 0x05, 0xf7, 0x05, 0x1a, 0x06, 0x08, 0x06, + 0xf4, 0x05, 0xda, 0x05, 0xf8, 0x05, 0x9a, 0x06, 0x63, 0x07, 0xa4, 0x07, + 0x2a, 0x07, 0x5d, 0x06, 0xa8, 0x05, 0x49, 0x05, 0x72, 0x05, 0x28, 0x06, + 0x11, 0x07, 0xbe, 0x07, 0xea, 0x07, 0x99, 0x07, 0x19, 0x07, 0xab, 0x06, + 0x3a, 0x06, 0xa5, 0x05, 0x04, 0x05, 0x81, 0x04, 0x4a, 0x04, 0x85, 0x04, + 0x02, 0x05, 0x27, 0x05, 0x81, 0x04, 0x4f, 0x03, 0x3c, 0x02, 0xaf, 0x01, + 0x86, 0x01, 0x72, 0x01, 0x4f, 0x01, 0x04, 0x01, 0x71, 0x00, 0x8e, 0xff, + 0x81, 0xfe, 0x81, 0xfd, 0xbe, 0xfc, 0x61, 0xfc, 0x7b, 0xfc, 0xef, 0xfc, + 0x5f, 0xfd, 0x54, 0xfd, 0xa0, 0xfc, 0x80, 0xfb, 0x57, 0xfa, 0x6d, 0xf9, + 0xf5, 0xf8, 0x0f, 0xf9, 0x85, 0xf9, 0xe5, 0xf9, 0x0a, 0xfa, 0x2e, 0xfa, + 0x47, 0xfa, 0xff, 0xf9, 0x56, 0xf9, 0xb5, 0xf8, 0x68, 0xf8, 0x6f, 0xf8, + 0xab, 0xf8, 0x0c, 0xf9, 0x83, 0xf9, 0xfc, 0xf9, 0x5a, 0xfa, 0x8d, 0xfa, + 0xa6, 0xfa, 0xd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, 0xf7, 0xf7, 0xf7, 0x42, 0xf8, + 0x8b, 0xf8, 0xc6, 0xf8, 0x10, 0xf9, 0x75, 0xf9, 0xd4, 0xf9, 0xfe, 0xf9, + 0x14, 0xfa, 0x7d, 0xfa, 0x79, 0xfb, 0xe6, 0xfc, 0x50, 0xfe, 0x3e, 0xff, + 0x87, 0xff, 0x46, 0xff, 0xcc, 0xfe, 0x8c, 0xfe, 0xb2, 0xfe, 0x0a, 0xff, + 0x7a, 0xff, 0x29, 0x00, 0x26, 0x01, 0x24, 0x02, 0xc9, 0x02, 0x15, 0x03, + 0x41, 0x03, 0x7a, 0x03, 0xdb, 0x03, 0x58, 0x04, 0xb3, 0x04, 0xcf, 0x04, + 0xe2, 0x04, 0x0e, 0x05, 0x17, 0x05, 0xd2, 0x04, 0x79, 0x04, 0x5f, 0x04, + 0xa8, 0x04, 0x60, 0x05, 0x54, 0x06, 0x1e, 0x07, 0x7e, 0x07, 0x8c, 0x07, + 0x6f, 0x07, 0x12, 0x07, 0x57, 0x06, 0x7e, 0x05, 0xfe, 0x04, 0x18, 0x05, + 0xa3, 0x05, 0x32, 0x06, 0x79, 0x06, 0x7d, 0x06, 0x35, 0x06, 0x6b, 0x05, + 0x18, 0x04, 0x9f, 0x02, 0x81, 0x01, 0xf6, 0x00, 0xd7, 0x00, 0xed, 0x00, + 0x2b, 0x01, 0x9b, 0x01, 0x25, 0x02, 0x6a, 0x02, 0x04, 0x02, 0xf9, 0x00, + 0xc9, 0xff, 0xe3, 0xfe, 0x5c, 0xfe, 0x39, 0xfe, 0x74, 0xfe, 0xca, 0xfe, + 0xef, 0xfe, 0xd4, 0xfe, 0x73, 0xfe, 0xcc, 0xfd, 0x0d, 0xfd, 0x75, 0xfc, + 0x18, 0xfc, 0xf2, 0xfb, 0x08, 0xfc, 0x4b, 0xfc, 0x75, 0xfc, 0x49, 0xfc, + 0xd8, 0xfb, 0x4f, 0xfb, 0xc1, 0xfa, 0x4c, 0xfa, 0x2b, 0xfa, 0x67, 0xfa, + 0xd8, 0xfa, 0x63, 0xfb, 0xf2, 0xfb, 0x4d, 0xfc, 0x5c, 0xfc, 0x53, 0xfc, + 0x73, 0xfc, 0xba, 0xfc, 0x00, 0xfd, 0x40, 0xfd, 0x8f, 0xfd, 0xf0, 0xfd, + 0x67, 0xfe, 0x21, 0xff, 0x29, 0x00, 0x36, 0x01, 0xca, 0x01, 0x94, 0x01, + 0xb9, 0x00, 0xb9, 0xff, 0x0b, 0xff, 0xe0, 0xfe, 0x2d, 0xff, 0xd3, 0xff, + 0xb8, 0x00, 0xab, 0x01, 0x64, 0x02, 0xb4, 0x02, 0xb6, 0x02, 0xbb, 0x02, + 0xf2, 0x02, 0x40, 0x03, 0x7e, 0x03, 0xc5, 0x03, 0x4e, 0x04, 0x17, 0x05, + 0xe5, 0x05, 0x89, 0x06, 0xe0, 0x06, 0xc1, 0x06, 0x3b, 0x06, 0x9c, 0x05, + 0x31, 0x05, 0x1f, 0x05, 0x66, 0x05, 0xd5, 0x05, 0x2a, 0x06, 0x54, 0x06, + 0x7b, 0x06, 0x9f, 0x06, 0x77, 0x06, 0xdc, 0x05, 0xf9, 0x04, 0x06, 0x04, + 0x3a, 0x03, 0xf2, 0x02, 0x56, 0x03, 0xf7, 0x03, 0x3a, 0x04, 0x06, 0x04, + 0xb3, 0x03, 0x7e, 0x03, 0x6b, 0x03, 0x8c, 0x03, 0xe7, 0x03, 0x2c, 0x04, + 0xed, 0x03, 0x20, 0x03, 0x24, 0x02, 0x5d, 0x01, 0x03, 0x01, 0x29, 0x01, + 0x9d, 0x01, 0xf0, 0x01, 0xd7, 0x01, 0x66, 0x01, 0xd4, 0x00, 0x3e, 0x00, + 0xbc, 0xff, 0x64, 0xff, 0x18, 0xff, 0xa8, 0xfe, 0x26, 0xfe, 0xda, 0xfd, + 0xdb, 0xfd, 0x03, 0xfe, 0x2f, 0xfe, 0x49, 0xfe, 0x29, 0xfe, 0xce, 0xfd, + 0x95, 0xfd, 0xf8, 0xfd, 0xe5, 0xfe, 0xc0, 0xff, 0x0e, 0x00, 0xd2, 0xff, + 0x2d, 0xff, 0x37, 0xfe, 0x50, 0xfd, 0x0d, 0xfd, 0x85, 0xfd, 0x46, 0xfe, + 0xff, 0xfe, 0xb0, 0xff, 0x39, 0x00, 0x71, 0x00, 0x60, 0x00, 0x07, 0x00, + 0x39, 0xff, 0x20, 0xfe, 0x73, 0xfd, 0xc7, 0xfd, 0x03, 0xff, 0xb3, 0x00, + 0x4f, 0x02, 0x3d, 0x03, 0x21, 0x03, 0x43, 0x02, 0x54, 0x01, 0xca, 0x00, + 0xba, 0x00, 0x28, 0x01, 0x0c, 0x02, 0x17, 0x03, 0xce, 0x03, 0x0e, 0x04, + 0x29, 0x04, 0x62, 0x04, 0x95, 0x04, 0x9a, 0x04, 0x91, 0x04, 0xa4, 0x04, + 0xd2, 0x04, 0x11, 0x05, 0x52, 0x05, 0x56, 0x05, 0xe4, 0x04, 0x1c, 0x04, + 0x5b, 0x03, 0xf3, 0x02, 0x16, 0x03, 0xcf, 0x03, 0xdf, 0x04, 0xd4, 0x05, + 0x46, 0x06, 0x05, 0x06, 0x1c, 0x05, 0xe1, 0x03, 0xef, 0x02, 0xcc, 0x02, + 0x6c, 0x03, 0x35, 0x04, 0x93, 0x04, 0x71, 0x04, 0x09, 0x04, 0x84, 0x03, + 0xfe, 0x02, 0x9b, 0x02, 0x5f, 0x02, 0x2c, 0x02, 0xf9, 0x01, 0xd8, 0x01, + 0xb4, 0x01, 0x65, 0x01, 0xee, 0x00, 0x67, 0x00, 0xdc, 0xff, 0x6f, 0xff, + 0x5d, 0xff, 0xb0, 0xff, 0x1c, 0x00, 0x51, 0x00, 0x33, 0x00, 0xd1, 0xff, + 0x5e, 0xff, 0x12, 0xff, 0xfc, 0xfe, 0xf1, 0xfe, 0xd1, 0xfe, 0xa7, 0xfe, + 0x8f, 0xfe, 0x89, 0xfe, 0x82, 0xfe, 0x78, 0xfe, 0x74, 0xfe, 0x5f, 0xfe, + 0x14, 0xfe, 0x94, 0xfd, 0x11, 0xfd, 0xac, 0xfc, 0x67, 0xfc, 0x4b, 0xfc, + 0x6d, 0xfc, 0xbe, 0xfc, 0x11, 0xfd, 0x4a, 0xfd, 0x64, 0xfd, 0x58, 0xfd, + 0x3b, 0xfd, 0x3f, 0xfd, 0x8b, 0xfd, 0x03, 0xfe, 0x64, 0xfe, 0x84, 0xfe, + 0x7b, 0xfe, 0x86, 0xfe, 0xd3, 0xfe, 0x60, 0xff, 0x11, 0x00, 0xbf, 0x00, + 0x33, 0x01, 0x3c, 0x01, 0xdf, 0x00, 0x63, 0x00, 0x18, 0x00, 0x19, 0x00, + 0x52, 0x00, 0x9d, 0x00, 0xdd, 0x00, 0xfc, 0x00, 0xed, 0x00, 0xbe, 0x00, + 0x9c, 0x00, 0xad, 0x00, 0xe5, 0x00, 0x2f, 0x01, 0x99, 0x01, 0x2a, 0x02, + 0xc2, 0x02, 0x32, 0x03, 0x67, 0x03, 0x60, 0x03, 0x27, 0x03, 0xe2, 0x02, + 0xdc, 0x02, 0x3b, 0x03, 0xd7, 0x03, 0x59, 0x04, 0x87, 0x04, 0x63, 0x04, + 0x0d, 0x04, 0xa3, 0x03, 0x39, 0x03, 0xd7, 0x02, 0x7c, 0x02, 0x34, 0x02, + 0x19, 0x02, 0x1f, 0x02, 0x00, 0x02, 0x91, 0x01, 0x01, 0x01, 0x93, 0x00, + 0x55, 0x00, 0x2e, 0x00, 0x1a, 0x00, 0x26, 0x00, 0x46, 0x00, 0x5e, 0x00, + 0x5b, 0x00, 0x3e, 0x00, 0x17, 0x00, 0xf3, 0xff, 0xc4, 0xff, 0x6c, 0xff, + 0xf3, 0xfe, 0x99, 0xfe, 0x93, 0xfe, 0xc1, 0xfe, 0xca, 0xfe, 0x81, 0xfe, + 0x07, 0xfe, 0x90, 0xfd, 0x30, 0xfd, 0xe6, 0xfc, 0xa2, 0xfc, 0x46, 0xfc, + 0xcf, 0xfb, 0x77, 0xfb, 0x70, 0xfb, 0xa4, 0xfb, 0xd6, 0xfb, 0x00, 0xfc, + 0x3f, 0xfc, 0x85, 0xfc, 0x9f, 0xfc, 0x7b, 0xfc, 0x2c, 0xfc, 0xce, 0xfb, + 0x84, 0xfb, 0x88, 0xfb, 0xfd, 0xfb, 0xbb, 0xfc, 0x71, 0xfd, 0xea, 0xfd, + 0x0f, 0xfe, 0xd5, 0xfd, 0x4d, 0xfd, 0xbf, 0xfc, 0x6d, 0xfc, 0x5b, 0xfc, + 0x69, 0xfc, 0x8e, 0xfc, 0xd4, 0xfc, 0x24, 0xfd, 0x51, 0xfd, 0x48, 0xfd, + 0x24, 0xfd, 0x17, 0xfd, 0x46, 0xfd, 0xb9, 0xfd, 0x58, 0xfe, 0x09, 0xff, + 0xb1, 0xff, 0x22, 0x00, 0x2e, 0x00, 0xdf, 0xff, 0x87, 0xff, 0x64, 0xff, + 0x76, 0xff, 0xb1, 0xff, 0x36, 0x00, 0x20, 0x01, 0x38, 0x02, 0x10, 0x03, + 0x5f, 0x03, 0x28, 0x03, 0x95, 0x02, 0xcb, 0x01, 0xf0, 0x00, 0x3f, 0x00, + 0xec, 0xff, 0x02, 0x00, 0x61, 0x00, 0xde, 0x00, 0x4c, 0x01, 0x88, 0x01, + 0x88, 0x01, 0x69, 0x01, 0x59, 0x01, 0x78, 0x01, 0xb6, 0x01, 0xda, 0x01, + 0xc5, 0x01, 0x9a, 0x01, 0x86, 0x01, 0x85, 0x01, 0x79, 0x01, 0x62, 0x01, + 0x5a, 0x01, 0x69, 0x01, 0x7c, 0x01, 0x7b, 0x01, 0x65, 0x01, 0x57, 0x01, + 0x62, 0x01, 0x65, 0x01, 0x2d, 0x01, 0xad, 0x00, 0x08, 0x00, 0x6b, 0xff, + 0xff, 0xfe, 0xdc, 0xfe, 0xf0, 0xfe, 0x13, 0xff, 0x29, 0xff, 0x27, 0xff, + 0xff, 0xfe, 0xb5, 0xfe, 0x6f, 0xfe, 0x53, 0xfe, 0x75, 0xfe, 0xcc, 0xfe, + 0x39, 0xff, 0x82, 0xff, 0x83, 0xff, 0x4b, 0xff, 0x15, 0xff, 0x0b, 0xff, + 0x1a, 0xff, 0x1c, 0xff, 0x0b, 0xff, 0x0d, 0xff, 0x3b, 0xff, 0x81, 0xff, + 0xab, 0xff, 0x82, 0xff, 0x00, 0xff, 0x69, 0xfe, 0x17, 0xfe, 0x21, 0xfe, + 0x63, 0xfe, 0xc8, 0xfe, 0x3e, 0xff, 0x9a, 0xff, 0xc0, 0xff, 0xd3, 0xff, + 0x03, 0x00, 0x4f, 0x00, 0x99, 0x00, 0xd2, 0x00, 0xf4, 0x00, 0x04, 0x01, + 0x1d, 0x01, 0x53, 0x01, 0x9a, 0x01, 0xd0, 0x01, 0xd3, 0x01, 0x93, 0x01, + 0x2b, 0x01, 0xd9, 0x00, 0xc6, 0x00, 0xf2, 0x00, 0x4f, 0x01, 0xd4, 0x01, + 0x63, 0x02, 0xc7, 0x02, 0xca, 0x02, 0x49, 0x02, 0x65, 0x01, 0x93, 0x00, + 0x56, 0x00, 0xd5, 0x00, 0xc8, 0x01, 0xb8, 0x02, 0x4b, 0x03, 0x6a, 0x03, + 0x32, 0x03, 0xd4, 0x02, 0x7c, 0x02, 0x53, 0x02, 0x63, 0x02, 0x94, 0x02, + 0xdb, 0x02, 0x3f, 0x03, 0xb3, 0x03, 0xf8, 0x03, 0xd3, 0x03, 0x49, 0x03, + 0x96, 0x02, 0x04, 0x02, 0xb6, 0x01, 0xa3, 0x01, 0xb2, 0x01, 0xd1, 0x01, + 0xd7, 0x01, 0x96, 0x01, 0x17, 0x01, 0x99, 0x00, 0x4a, 0x00, 0x2a, 0x00, + 0x1c, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x1d, 0x00, 0x76, 0x00, 0xf6, 0x00, + 0x69, 0x01, 0xa2, 0x01, 0x83, 0x01, 0x00, 0x01, 0x45, 0x00, 0xa5, 0xff, + 0x50, 0xff, 0x53, 0xff, 0xae, 0xff, 0x49, 0x00, 0xd5, 0x00, 0xf0, 0x00, + 0x6e, 0x00, 0x74, 0xff, 0x6f, 0xfe, 0xd5, 0xfd, 0xd0, 0xfd, 0x2d, 0xfe, + 0x9f, 0xfe, 0xee, 0xfe, 0x04, 0xff, 0xe8, 0xfe, 0xae, 0xfe, 0x68, 0xfe, + 0x31, 0xfe, 0x34, 0xfe, 0x75, 0xfe, 0xc4, 0xfe, 0xef, 0xfe, 0xf5, 0xfe, + 0xec, 0xfe, 0xdb, 0xfe, 0xc5, 0xfe, 0xa8, 0xfe, 0x88, 0xfe, 0x86, 0xfe, + 0xc7, 0xfe, 0x35, 0xff, 0x8c, 0xff, 0xa2, 0xff, 0x85, 0xff, 0x55, 0xff, + 0x30, 0xff, 0x1c, 0xff, 0x08, 0xff, 0xe3, 0xfe, 0xbb, 0xfe, 0xb2, 0xfe, + 0xeb, 0xfe, 0x69, 0xff, 0x08, 0x00, 0x8e, 0x00, 0xd8, 0x00, 0xe9, 0x00, + 0xdd, 0x00, 0xcd, 0x00, 0xbd, 0x00, 0xa1, 0x00, 0x90, 0x00, 0xa8, 0x00, + 0xd5, 0x00, 0xf3, 0x00, 0x15, 0x01, 0x58, 0x01, 0x9e, 0x01, 0xb0, 0x01, + 0x8f, 0x01, 0x5b, 0x01, 0x13, 0x01, 0xba, 0x00, 0x6d, 0x00, 0x30, 0x00, + 0xf0, 0xff, 0xba, 0xff, 0xa7, 0xff, 0xae, 0xff, 0xc9, 0xff, 0x1c, 0x00, + 0xaf, 0x00, 0x41, 0x01, 0x89, 0x01, 0x62, 0x01, 0xc9, 0x00, 0xde, 0xff, + 0xf1, 0xfe, 0x5c, 0xfe, 0x56, 0xfe, 0xdb, 0xfe, 0xa7, 0xff, 0x63, 0x00, + 0xca, 0x00, 0xc1, 0x00, 0x52, 0x00, 0xa0, 0xff, 0xda, 0xfe, 0x24, 0xfe, + 0x9f, 0xfd, 0x68, 0xfd, 0x8c, 0xfd, 0xe8, 0xfd, 0x36, 0xfe, 0x47, 0xfe, + 0x12, 0xfe,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02, 0x53, 0x02, 0x8c, 0x02, 0x34, 0x03, + 0xf2, 0x03, 0x43, 0x04, 0x0c, 0x04, 0x85, 0x03, 0x14, 0x03, 0xd6, 0x02, + 0x63, 0x02, 0x98, 0x01, 0x9a, 0x00, 0x1c, 0xff, 0xec, 0xfc, 0xd8, 0xfa, + 0x09, 0xfa, 0x88, 0xfa, 0x58, 0xfb, 0x1f, 0xfc, 0x6a, 0xfd, 0x79, 0xff, + 0x1a, 0x02, 0x25, 0x05, 0x6b, 0x08, 0x87, 0x0b, 0xd3, 0x0d, 0xd5, 0x0e, + 0x83, 0x0e, 0xc0, 0x0c, 0xa5, 0x09, 0x12, 0x06, 0x21, 0x03, 0x9a, 0x01, + 0xd3, 0x01, 0x66, 0x03, 0x56, 0x05, 0xca, 0x06, 0x8e, 0x07, 0xce, 0x07, + 0xae, 0x07, 0x5f, 0x07, 0x1a, 0x07, 0xdd, 0x06, 0x54, 0x06, 0x2f, 0x05, + 0xe0, 0x03, 0x58, 0x03, 0xb7, 0x03, 0x5f, 0x04, 0x03, 0x05, 0xb4, 0x05, + 0x87, 0x06, 0x82, 0x07, 0xa6, 0x08, 0xca, 0x09, 0xab, 0x0a, 0x33, 0x0b, + 0x38, 0x0b, 0x94, 0x0a, 0xbb, 0x09, 0x2f, 0x09, 0xe8, 0x08, 0x98, 0x08, + 0xcb, 0x07, 0x74, 0x06, 0x3c, 0x05, 0x78, 0x04, 0xe6, 0x03, 0x3f, 0x03, + 0x58, 0x02, 0x0b, 0x01, 0x88, 0xff, 0x43, 0xfe, 0x55, 0xfd, 0x88, 0xfc, + 0x21, 0xfc, 0xb5, 0xfc, 0x44, 0xfe, 0xef, 0xff, 0xb2, 0x00, 0x68, 0x00, + 0xa5, 0xff, 0x15, 0xff, 0x2f, 0xff, 0xc3, 0xff, 0x05, 0x00, 0x4a, 0xff, + 0xd2, 0xfd, 0x9f, 0xfc, 0x0b, 0xfc, 0xa9, 0xfb, 0x5b, 0xfb, 0x07, 0xfb, + 0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0xe9, 0x6e, 0xe9, 0x9a, 0xe9, 0x29, 0xea, + 0xbe, 0xea, 0x1a, 0xeb, 0x45, 0xeb, 0x5d, 0xeb, 0x50, 0xeb, 0x20, 0xeb, + 0x07, 0xeb, 0x14, 0xeb, 0x47, 0xeb, 0xd2, 0xeb, 0xb5, 0xec, 0x77, 0xed, + 0xa7, 0xed, 0x54, 0xed, 0xe9, 0xec, 0xa3, 0xec, 0x72, 0xec, 0x4e, 0xec, + 0x41, 0xec, 0x23, 0xec, 0xfc, 0xeb, 0x78, 0xec, 0x0d, 0xee, 0x13, 0xf0, + 0x8b, 0xf1, 0x4a, 0xf2, 0x93, 0xf2, 0x7a, 0xf2, 0x69, 0xf2, 0x3b, 0xf3, + 0x27, 0xf5, 0x5c, 0xf7, 0x32, 0xf9, 0xe1, 0xfa, 0xb2, 0xfc, 0x65, 0xfe, + 0xcf, 0xff, 0x1c, 0x01, 0x3d, 0x02, 0xd8, 0x02, 0xf6, 0x02, 0x08, 0x03, + 0x34, 0x03, 0x49, 0x03, 0x47, 0x03, 0x61, 0x03, 0x95, 0x03, 0xbb, 0x03, + 0xda, 0x03, 0xfe, 0x03, 0x0d, 0x04, 0x0c, 0x04, 0x35, 0x04, 0x82, 0x04, + 0xb6, 0x04, 0xc7, 0x04, 0xe5, 0x04, 0x21, 0x05, 0x66, 0x05, 0xa6, 0x05, + 0xdf, 0x05, 0xec, 0x05, 0x99, 0x05, 0xff, 0x04, 0x86, 0x04, 0x6d, 0x04, + 0x90, 0x04, 0x99, 0x04, 0x3e, 0x04, 0x71, 0x03, 0x60, 0x02, 0x31, 0x01, + 0xf5, 0xff, 0xed, 0xfe, 0x3d, 0xfe, 0x8b, 0xfd, 0x84, 0xfc, 0x51, 0xfb, + 0x2a, 0xfa, 0xf8, 0xf8, 0xa5, 0xf7, 0x3d, 0xf6, 0xc6, 0xf4, 0x59, 0xf3, + 0x32, 0xf2, 0x72, 0xf1, 0xf9, 0xf0, 0x9f, 0xf0, 0x73, 0xf0, 0x77, 0xf0, + 0x65, 0xf0, 0x0b, 0xf0, 0xa9, 0xef, 0x63, 0xef, 0xdd, 0xee, 0xf1, 0xed, + 0x1f, 0xed, 0xde, 0xec, 0xf6, 0xec, 0xeb, 0xec, 0xa4, 0xec, 0x5b, 0xec, + 0x21, 0xec, 0xd7, 0xeb, 0x99, 0xeb, 0xbf, 0xeb, 0x33, 0xec, 0x76, 0xec, + 0x5d, 0xec, 0x53, 0xec, 0xc1, 0xec, 0x84, 0xed, 0x14, 0xee, 0x36, 0xee, + 0x3b, 0xee, 0x8f, 0xee, 0x4c, 0xef, 0x5f, 0xf0, 0xb6, 0xf1, 0x27, 0xf3, + 0x63, 0xf4, 0x3f, 0xf5, 0xe4, 0xf5, 0xa5, 0xf6, 0x98, 0xf7, 0x86, 0xf8, + 0x51, 0xf9, 0x33, 0xfa, 0x70, 0xfb, 0xfd, 0xfc, 0x80, 0xfe, 0xa6, 0xff, + 0x6e, 0x00, 0x08, 0x01, 0x89, 0x01, 0xef, 0x01, 0x4f, 0x02, 0xb7, 0x02, + 0x12, 0x03, 0x53, 0x03, 0x9a, 0x03, 0x0d, 0x04, 0x8f, 0x04, 0xdc, 0x04, + 0xe6, 0x04, 0xee, 0x04, 0x33, 0x05, 0xc0, 0x05, 0x7a, 0x06, 0x37, 0x07, + 0xd5, 0x07, 0x42, 0x08, 0x71, 0x08, 0x65, 0x08, 0x61, 0x08, 0xb4, 0x08, + 0x53, 0x09, 0xe5, 0x09, 0x33, 0x0a, 0x4d, 0x0a, 0x4b, 0x0a, 0x28, 0x0a, + 0xe6, 0x09, 0x9f, 0x09, 0x48, 0x09, 0xab, 0x08, 0xbf, 0x07, 0xbe, 0x06, + 0xba, 0x05, 0xa0, 0x04, 0xab, 0x03, 0x30, 0x03, 0x04, 0x03, 0x9a, 0x02, + 0xba, 0x01, 0x90, 0x00, 0x4d, 0xff, 0x1d, 0xfe, 0x49, 0xfd, 0xf3, 0xfc, + 0xc5, 0xfc, 0x58, 0xf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0d, 0x60, 0x0d, 0xae, 0x0c, 0xde, 0x0b, 0x48, 0x0b, + 0x10, 0x0b, 0x11, 0x0b, 0x1b, 0x0b, 0x1d, 0x0b, 0xe7, 0x0a, 0x2d, 0x0a, + 0xfb, 0x08, 0xca, 0x07, 0xed, 0x06, 0x4c, 0x06, 0xcd, 0x05, 0x70, 0x05, + 0x13, 0x05, 0x84, 0x04, 0xd8, 0x03, 0x51, 0x03, 0x07, 0x03, 0xdf, 0x02, + 0xb9, 0x02, 0x82, 0x02, 0x38, 0x02, 0xd4, 0x01, 0x42, 0x01, 0x77, 0x00, + 0xa9, 0xff, 0x22, 0xff, 0xf6, 0xfe, 0x02, 0xff, 0x21, 0xff, 0x35, 0xff, + 0x25, 0xff, 0xf2, 0xfe, 0xb9, 0xfe, 0x8c, 0xfe, 0x65, 0xfe, 0x3b, 0xfe, + 0x0d, 0xfe, 0xe1, 0xfd, 0xc3, 0xfd, 0xb9, 0xfd, 0xc0, 0xfd, 0xc9, 0xfd, + 0xd7, 0xfd, 0xfd, 0xfd, 0x38, 0xfe, 0x53, 0xfe, 0x29, 0xfe, 0xe9, 0xfd, + 0xd1, 0xfd, 0xd5, 0xfd, 0xc7, 0xfd, 0xb8, 0xfd, 0xd4, 0xfd, 0x26, 0xfe, + 0xa3, 0xfe, 0x44, 0xff, 0xfa, 0xff, 0xc0, 0x00, 0xa1, 0x01, 0x78, 0x02, + 0xed, 0x02, 0xf2, 0x02, 0xf3, 0x02, 0x53, 0x03, 0x0d, 0x04, 0xf0, 0x04, + 0xd9, 0x05, 0xa4, 0x06, 0x31, 0x07, 0x7f, 0x07, 0x9c, 0x07, 0x91, 0x07, + 0x76, 0x07, 0x65, 0x07, 0x6c, 0x07, 0x84, 0x07, 0x9f, 0x07, 0x97, 0x07, + 0x57, 0x07, 0xfb, 0x06, 0xb6, 0x06, 0xa5, 0x06, 0xc3, 0x06, 0x08, 0x07, + 0x6c, 0x07, 0xed, 0x07, 0x76, 0x08, 0xd4, 0x08, 0xe1, 0x08, 0xb8, 0x08, + 0x81, 0x08, 0x40, 0x08, 0x07, 0x08, 0x0e, 0x08, 0x4f, 0x08, 0x76, 0x08, + 0x56, 0x08, 0x14, 0x08, 0xc7, 0x07, 0x5c, 0x07, 0xcf, 0x06, 0x36, 0x06, + 0xa3, 0x05, 0x22, 0x05, 0xb2, 0x04, 0x43, 0x04, 0xd6, 0x03, 0x7e, 0x03, + 0x30, 0x03, 0xcd, 0x02, 0x60, 0x02, 0x07, 0x02, 0xbf, 0x01, 0x69, 0x01, + 0xf7, 0x00, 0x71, 0x00, 0xef, 0xff, 0x9b, 0xff, 0x87, 0xff, 0x99, 0xff, + 0xb0, 0xff, 0xb5, 0xff, 0x83, 0xff, 0x00, 0xff, 0x4d, 0xfe, 0xac, 0xfd, + 0x32, 0xfd, 0xcb, 0xfc, 0x7a, 0xfc, 0x4c, 0xfc, 0x22, 0xfc, 0xc8, 0xfb, + 0x2c, 0xfb, 0x71, 0xfa, 0xe1, 0xf9, 0xbb, 0xf9, 0xe4, 0xf9, 0x05, 0xfa, + 0xf8, 0xf9, 0xda, 0xf9, 0xc5, 0xf9, 0xc9, 0xf9, 0xfc, 0xf9, 0x5e, 0xfa, + 0xcf, 0xfa, 0x41, 0xfb, 0xa5, 0xfb, 0xd5, 0xfb, 0xc0, 0xfb, 0x9c, 0xfb, + 0xa5, 0xfb, 0xde, 0xfb, 0x2b, 0xfc, 0x7b, 0xfc, 0xc8, 0xfc, 0x09, 0xfd, + 0x29, 0xfd, 0x11, 0xfd, 0xca, 0xfc, 0x83, 0xfc, 0x67, 0xfc, 0x7f, 0xfc, + 0xc4, 0xfc, 0x33, 0xfd, 0xbe, 0xfd, 0x41, 0xfe, 0x91, 0xfe, 0xb4, 0xfe, + 0xdf, 0xfe, 0x42, 0xff, 0xde, 0xff, 0x98, 0x00, 0x5a, 0x01, 0x06, 0x02, + 0x80, 0x02, 0xbe, 0x02, 0xc4, 0x02, 0x9b, 0x02, 0x51, 0x02, 0xfc, 0x01, + 0xa2, 0x01, 0x44, 0x01, 0xeb, 0x00, 0xb2, 0x00, 0xa6, 0x00, 0xbd, 0x00, + 0xea, 0x00, 0x28, 0x01, 0x4e, 0x01, 0x1a, 0x01, 0x84, 0x00, 0xdd, 0xff, + 0x77, 0xff, 0x63, 0xff, 0xa2, 0xff, 0x2b, 0x00, 0xc8, 0x00, 0x36, 0x01, + 0x68, 0x01, 0x78, 0x01, 0x75, 0x01, 0x67, 0x01, 0x5b, 0x01, 0x4f, 0x01, + 0x17, 0x01, 0x9f, 0x00, 0x24, 0x00, 0xf6, 0xff, 0x1a, 0x00, 0x5e, 0x00, + 0xa2, 0x00, 0xc4, 0x00, 0x87, 0x00, 0xd6, 0xff, 0x04, 0xff, 0x6f, 0xfe, + 0x2d, 0xfe, 0x19, 0xfe, 0x08, 0xfe, 0xd6, 0xfd, 0x7e, 0xfd, 0x19, 0xfd, + 0xba, 0xfc, 0x77, 0xfc, 0x8b, 0xfc, 0x25, 0xfd, 0x33, 0xfe, 0x7c, 0xff, + 0xcb, 0x00, 0xf1, 0x01, 0xd3, 0x02, 0x7b, 0x03, 0x07, 0x04, 0x7e, 0x04, + 0xd3, 0x04, 0xff, 0x04, 0x0e, 0x05, 0x16, 0x05, 0x0a, 0x05, 0xae, 0x04, + 0xbc, 0x03, 0x18, 0x02, 0xd4, 0xff, 0x22, 0xfd, 0x43, 0xfa, 0x8f, 0xf7, + 0x68, 0xf5, 0x05, 0xf4, 0x5b, 0xf3, 0x32, 0xf3, 0x59, 0xf3, 0xd8, 0xf3, + 0xf8, 0xf4, 0xf1, 0xf6, 0x91, 0xf9, 0x6f, 0xfc, 0x4d, 0xff, 0xdc, 0x01, + 0x60, 0x03, 0x16, 0x03, 0xfb, 0x00, 0xb0, 0xfd, 0xc2, 0xf9, 0x65, 0xf5, + 0xe2, 0xf0, 0xe1, 0xec, 0xf3, 0xe9, 0x03, 0xe8, 0xa6, 0xe6, 0xdb, 0xe5, + 0x09, 0xe6, 0x5a, 0xe7, 0x97, 0xe9, 0x64, 0xec, 0x51, 0xef, 0xde, 0xf1, + 0xcd, 0xf3, 0x1d, 0xf5, 0xb1, 0xf5, 0x4c, 0xf5, 0xfb, 0xf3, 0x3d, 0xf2, + 0xae, 0xf0, 0x95, 0xef, 0xe1, 0xee, 0x93, 0xee, 0xf4, 0xee, 0x37, 0xf0, + 0x16, 0xf2, 0x09, 0xf4, 0xc9, 0xf5, 0x6a, 0xf7, 0xec, 0xf8, 0xf7, 0xf9, + 0x4c, 0xfa, 0x1c, 0xfa, 0xa4, 0xf9, 0xcb, 0xf8, 0x87, 0xf7, 0x1e, 0xf6, + 0xc5, 0xf4, 0x76, 0xf3, 0x65, 0xf2, 0x1a, 0xf2, 0xe0, 0xf2, 0x84, 0xf4, + 0xb9, 0xf6, 0x6c, 0xf9, 0x96, 0xfc, 0xf6, 0xff, 0x32, 0x03, 0x15, 0x06, + 0x85, 0x08, 0x65, 0x0a, 0x97, 0x0b, 0x15, 0x0c, 0xda, 0x0b, 0x04, 0x0b, + 0xdc, 0x09, 0x9d, 0x08, 0x52, 0x07, 0x0c, 0x06, 0xe9, 0x04, 0x05, 0x04, + 0x6e, 0x03, 0x26, 0x03, 0x27, 0x03, 0x76, 0x03, 0x07, 0x04, 0x95, 0x04, + 0xe8, 0x04, 0x0a, 0x05, 0x10, 0x05, 0xee, 0x04, 0xba, 0x04, 0xb3, 0x04, + 0xf6, 0x04, 0x73, 0x05, 0x1a, 0x06, 0xcf, 0x06, 0x53, 0x07, 0x6e, 0x07, + 0x2d, 0x07, 0xe7, 0x06, 0xd1, 0x06, 0xc2, 0x06, 0x89, 0x06, 0x45, 0x06, + 0x15, 0x06, 0xce, 0x05, 0x3a, 0x05, 0x4a, 0x04, 0xfc, 0x02, 0x5f, 0x01, + 0xa3, 0xff, 0xf0, 0xfd, 0x72, 0xfc, 0x79, 0xfb, 0x21, 0xfb, 0x00, 0xfb, + 0x98, 0xfa, 0xe7, 0xf9, 0x31, 0xf9, 0x81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0x07, 0x0d, 0x06, 0xb4, 0x04, + 0xb7, 0x03, 0xfb, 0x02, 0x92, 0x02, 0x83, 0x02, 0x7b, 0x02, 0x44, 0x02, + 0x1e, 0x02, 0x49, 0x02, 0x90, 0x02, 0x88, 0x02, 0x10, 0x02, 0x5e, 0x01, + 0xaf, 0x00, 0x2a, 0x00, 0xda, 0xff, 0x9d, 0xff, 0x2f, 0xff, 0x6e, 0xfe, + 0x88, 0xfd, 0xbd, 0xfc, 0x10, 0xfc, 0x79, 0xfb, 0x20, 0xfb, 0x29, 0xfb, + 0x84, 0xfb, 0x22, 0xfc, 0x01, 0xfd, 0xef, 0xfd, 0x8d, 0xfe, 0xc9, 0xfe, + 0xf4, 0xfe, 0x3f, 0xff, 0x74, 0xff, 0x50, 0xff, 0xd8, 0xfe, 0x3a, 0xfe, + 0xab, 0xfd, 0x4d, 0xfd, 0x0e, 0xfd, 0xd8, 0xfc, 0xbe, 0xfc, 0xc8, 0xfc, + 0xd5, 0xfc, 0xe0, 0xfc, 0x18, 0xfd, 0x8b, 0xfd, 0x03, 0xfe, 0x3f, 0xfe, + 0x27, 0xfe, 0xf2, 0xfd, 0xfa, 0xfd, 0x68, 0xfe, 0xf4, 0xfe, 0x38, 0xff, + 0x36, 0xff, 0x4c, 0xff, 0xa5, 0xff, 0x09, 0x00, 0x40, 0x00, 0x56, 0x00, + 0x7f, 0x00, 0xe2, 0x00, 0x86, 0x01, 0x51, 0x02, 0x1a, 0x03, 0xd6, 0x03, + 0x7d, 0x04, 0xdf, 0x04, 0xfe, 0x04, 0x35, 0x05, 0x9b, 0x05, 0xd5, 0x05, + 0xc8, 0x05, 0xc9, 0x05, 0x05, 0x06, 0x4f, 0x06, 0x83, 0x06, 0xb1, 0x06, + 0x04, 0x07, 0xa1, 0x07, 0x7f, 0x08, 0x5e, 0x09, 0x0c, 0x0a, 0x85, 0x0a, + 0xc8, 0x0a, 0xd5, 0x0a, 0xc2, 0x0a, 0xa3, 0x0a, 0x6e, 0x0a,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00, 0x26, 0x00, 0x3b, 0x00, 0x1f, 0x00, 0xcd, 0xff, 0x81, 0xff, + 0x81, 0xff, 0xe4, 0xff, 0x7b, 0x00, 0x1f, 0x01, 0xff, 0x01, 0x46, 0x03, + 0xa1, 0x04, 0x9f, 0x05, 0x24, 0x06, 0x4f, 0x06, 0x46, 0x06, 0x3d, 0x06, + 0x69, 0x06, 0xed, 0x06, 0xad, 0x07, 0x54, 0x08, 0x91, 0x08, 0x4e, 0x08, + 0x99, 0x07, 0x80, 0x06, 0x36, 0x05, 0x18, 0x04, 0x71, 0x03, 0x47, 0x03, + 0x7e, 0x03, 0xf4, 0x03, 0x5d, 0x04, 0x59, 0x04, 0xde, 0x03, 0x3c, 0x03, + 0xaa, 0x02, 0x19, 0x02, 0x8c, 0x01, 0x4c, 0x01, 0x84, 0x01, 0x17, 0x02, + 0xd8, 0x02, 0x99, 0x03, 0x1d, 0x04, 0x3c, 0x04, 0x02, 0x04, 0x99, 0x03, + 0x1e, 0x03, 0x92, 0x02, 0xfa, 0x01, 0x84, 0x01, 0x5f, 0x01, 0x5f, 0x01, + 0x1b, 0x01, 0x65, 0x00, 0x69, 0xff, 0x7a, 0xfe, 0xcd, 0xfd, 0x63, 0xfd, + 0x34, 0xfd, 0x53, 0xfd, 0xb4, 0xfd, 0xfb, 0xfd, 0xd9, 0xfd, 0x64, 0xfd, + 0xdc, 0xfc, 0x67, 0xfc, 0x13, 0xfc, 0xf7, 0xfb, 0x2f, 0xfc, 0xd3, 0xfc, + 0xc6, 0xfd, 0xbd, 0xfe, 0x7d, 0xff, 0xe2, 0xff, 0xc4, 0xff, 0x27, 0xff, + 0x5d, 0xfe, 0xb4, 0xfd, 0x3f, 0xfd, 0x06, 0xfd, 0x27, 0xfd, 0xa0, 0xfd, + 0x3e, 0xfe, 0xc2, 0xfe, 0x0c, 0xff, 0x0e, 0xff, 0xb7, 0xfe, 0x05, 0xfe, + 0x3a, 0xfd, 0xd6, 0xfc, 0x24, 0xfd, 0xe1, 0xfd, 0x93, 0xfe, 0x10, 0xff, + 0x7d, 0xff, 0xec, 0xff, 0x33, 0x00, 0x3c, 0x00, 0x33, 0x00, 0x4e, 0x00, + 0x8f, 0x00, 0xe9, 0x00, 0x66, 0x01, 0x01, 0x02, 0x91, 0x02, 0xdd, 0x02, + 0xc9, 0x02, 0x6b, 0x02, 0x13, 0x02, 0x0f, 0x02, 0x66, 0x02, 0xf3, 0x02, + 0x90, 0x03, 0x0d, 0x04, 0x41, 0x04, 0x3c, 0x04, 0x2e, 0x04, 0x05, 0x04, + 0x97, 0x03, 0x13, 0x03, 0xe2, 0x02, 0x19, 0x03, 0x6e, 0x03, 0xa7, 0x03, + 0xb2, 0x03, 0x6a, 0x03, 0xac, 0x02, 0xaf, 0x01, 0xe7, 0x00, 0x7c, 0x00, + 0x48, 0x00, 0x43, 0x00, 0x87, 0x00, 0x03, 0x01, 0x7e, 0x01, 0xd4, 0x01, + 0xff, 0x01, 0xee, 0x01, 0x8c, 0x01, 0xee, 0x00, 0x62, 0x00, 0x30, 0x00, + 0x5d, 0x00, 0xc6, 0x00, 0x44, 0x01, 0xa0, 0x01, 0x9f, 0x01, 0x47, 0x01, + 0xd8, 0x00, 0x7a, 0x00, 0x21, 0x00, 0xb3, 0xff, 0x36, 0xff, 0xd7, 0xfe, + 0xad, 0xfe, 0xa1, 0xfe, 0x9e, 0xfe, 0xa2, 0xfe, 0x91, 0xfe, 0x41, 0xfe, + 0xb9, 0xfd, 0x27, 0xfd, 0xb9, 0xfc, 0x96, 0xfc, 0xbe, 0xfc, 0x06, 0xfd, + 0x52, 0xfd, 0x93, 0xfd, 0xa4, 0xfd, 0x75, 0xfd, 0x40, 0xfd, 0x4e, 0xfd, + 0xb5, 0xfd, 0x5e, 0xfe, 0x18, 0xff, 0xb9, 0xff, 0x3a, 0x00, 0x9c, 0x00, + 0xcd, 0x00, 0xd3, 0x00, 0xb6, 0x00, 0x69, 0x00, 0xff, 0xff, 0xc2, 0xff, + 0xcc, 0xff, 0xdc, 0xff, 0xbf, 0xff, 0x85, 0xff, 0x4e, 0xff, 0x2e, 0xff, + 0x2e, 0xff, 0x2c, 0xff, 0x08, 0xff, 0xf3, 0xfe, 0x2d, 0xff, 0x91, 0xff, + 0xcf, 0xff, 0x03, 0x00, 0x6e, 0x00, 0xf1, 0x00, 0x55, 0x01, 0xb8, 0x01, + 0x38, 0x02, 0xc5, 0x02, 0x57, 0x03, 0xdc, 0x03, 0x2b, 0x04, 0x47, 0x04, + 0x67, 0x04, 0x8a, 0x04, 0x7b, 0x04, 0x2d, 0x04, 0xbe, 0x03, 0x43, 0x03, + 0xc8, 0x02, 0x50, 0x02, 0xe2, 0x01, 0x97, 0x01, 0x7c, 0x01, 0x86, 0x01, + 0xac, 0x01, 0xed, 0x01, 0x31, 0x02, 0x60, 0x02, 0x73, 0x02, 0x67, 0x02, + 0x4c, 0x02, 0x56, 0x02, 0xae, 0x02, 0x3d, 0x03, 0xca, 0x03, 0x34, 0x04, + 0x7d, 0x04, 0xa1, 0x04, 0x86, 0x04, 0x2d, 0x04, 0xc3, 0x03, 0x76, 0x03, + 0x54, 0x03, 0x46, 0x03, 0x29, 0x03, 0xfc, 0x02, 0xcd, 0x02, 0x87, 0x02, + 0x17, 0x02, 0x97, 0x01, 0x26, 0x01, 0xbf, 0x00, 0x68, 0x00, 0x31, 0x00, + 0x0a, 0x00, 0xf3, 0xff, 0x09, 0x00, 0x41, 0x00, 0x65, 0x00, 0x68, 0x00, + 0x5a, 0x00, 0x42, 0x00, 0x38, 0x00, 0x5c, 0x00, 0xa3, 0x00, 0xef, 0x00, + 0x25, 0x01, 0x29, 0x01, 0xed, 0x00, 0x80, 0x00, 0x00, 0x00, 0x95, 0xff, + 0x60, 0xff, 0x6a, 0xff, 0xa4, 0xff, 0xf1, 0xff, 0x24, 0x00, 0x1e, 0x00, + 0xdd, 0xff, 0x59, 0xff, 0x99, 0xfe, 0xe1, 0xfd, 0x67, 0xfd, 0x12, 0xfd, + 0xcd, 0xfc, 0xbe, 0xfc, 0x03, 0xfd, 0x7a, 0xfd, 0xe4, 0xfd, 0x17, 0xfe, + 0x1d, 0xfe, 0x1c, 0xfe, 0x17, 0xfe, 0x0c, 0xfe, 0x22, 0xfe, 0x78, 0xfe, + 0xf9, 0xfe, 0x80, 0xff, 0xf5, 0xff, 0x38, 0x00, 0x28, 0x00, 0xc0, 0xff, + 0x32, 0xff, 0xc7, 0xfe, 0x8d, 0xfe, 0x4e, 0xfe, 0x04, 0xfe, 0xe9, 0xfd, + 0x09, 0xfe, 0x2d, 0xfe, 0x37, 0xfe, 0x2e, 0xfe, 0x0c, 0xfe, 0xcc, 0xfd, + 0x95, 0xfd, 0x9b, 0xfd, 0xef, 0xfd, 0x60, 0xfe, 0xa9, 0xfe, 0xb4, 0xfe, + 0x8c, 0xfe, 0x3c, 0xfe, 0xd4, 0xfd, 0x8e, 0xfd, 0xab, 0xfd, 0x2f, 0xfe, + 0xe5, 0xfe, 0x9d, 0xff, 0x3e, 0x00, 0x99, 0x00, 0x86, 0x00, 0x23, 0x00, + 0xc0, 0xff, 0x84, 0xff, 0x69, 0xff, 0x6b, 0xff, 0x7a, 0xff, 0x77, 0xff, + 0x5e, 0xff, 0x45, 0xff, 0x2e, 0xff, 0x19, 0xff, 0x0f, 0xff, 0x03, 0xff, + 0xde, 0xfe, 0xa0, 0xfe, 0x65, 0xfe, 0x55, 0xfe, 0x87, 0xfe, 0xdc, 0xfe, + 0x25, 0xff, 0x59, 0xff, 0x7f, 0xff, 0x88, 0xff, 0x7a, 0xff, 0x86, 0xff, + 0xbc, 0xff, 0xfc, 0xff, 0x2a, 0x00, 0x3a, 0x00, 0x22, 0x00, 0xed, 0xff, + 0xba, 0xff, 0x9b, 0xff, 0x87, 0xff, 0x73, 0xff, 0x66, 0xff, 0x75, 0xff, + 0xb8, 0xff, 0x2d, 0x00, 0xa3, 0x00, 0xe3, 0x00, 0xe1, 0x00, 0xa3, 0x00, + 0x31, 0x00, 0xa4, 0xff, 0x2a, 0xff, 0xed, 0xfe, 0xf9, 0xfe, 0x30, 0xff, + 0x5c, 0xff, 0x6d, 0xff, 0x8e, 0xff, 0xcd, 0xff, 0xf6, 0xff, 0xde, 0xff, + 0x97, 0xff, 0x43, 0xff, 0xf6, 0xfe, 0xd4, 0xfe, 0x00, 0xff, 0x75, 0xff, + 0x02, 0x00, 0x70, 0x00, 0x92, 0x00, 0x5d, 0x00, 0xe5, 0xff, 0x59, 0xff, + 0xf0, 0xfe, 0xcd, 0xfe, 0xd5, 0xfe, 0xd1, 0xfe, 0xbc, 0xfe, 0xb1, 0xfe, + 0xb0, 0xfe, 0xae, 0xfe, 0xc6, 0xfe, 0x13, 0xff, 0x86, 0xff, 0xfe, 0xff, + 0x4e, 0x00, 0x53, 0x00, 0x28, 0x00, 0x0e, 0x00, 0x0a, 0x00, 0xef, 0xff, + 0xb6, 0xff, 0x7e, 0xff, 0x50, 0xff, 0x25, 0xff, 0xfe, 0xfe, 0xd1, 0xfe, + 0xa1, 0xfe, 0x8c, 0xfe, 0x91, 0xfe, 0x84, 0xfe, 0x54, 0xfe, 0x23, 0xfe, + 0xf5, 0xfd, 0xb8, 0xfd, 0x8b, 0xfd, 0xaa, 0xfd, 0x0d, 0xfe, 0x7b, 0xfe, + 0xd0, 0xfe, 0x0d, 0xff, 0x35, 0xff, 0x4d, 0xff, 0x5e, 0xff, 0x61, 0xff, + 0x54, 0xff, 0x5a, 0xff, 0x89, 0xff, 0xce, 0xff, 0x0e, 0x00, 0x49, 0x00, + 0x7d, 0x00, 0x97, 0x00, 0x8b, 0x00, 0x5f, 0x00, 0x12, 0x00, 0xa1, 0xff, + 0x1e, 0xff, 0xa0, 0xfe, 0x3b, 0xfe, 0x05, 0xfe, 0x08, 0xfe, 0x2c, 0xfe, + 0x45, 0xfe, 0x52, 0xfe, 0x75, 0xfe, 0xba, 0xfe, 0x09, 0xff, 0x4c, 0xff, + 0x7d, 0xff, 0x98, 0xff, 0xa3, 0xff, 0xa7, 0xff, 0xa3, 0xff, 0xad, 0xff, + 0xea, 0xff, 0x55, 0x00, 0xb7, 0x00, 0xeb, 0x00, 0xf8, 0x00, 0xfa, 0x00, + 0x08, 0x01, 0x18, 0x01, 0x02, 0x01, 0xbf, 0x00, 0x71, 0x00, 0x34, 0x00, + 0xfe, 0xff, 0xcf, 0xff, 0xb8, 0xff, 0xc1, 0xff, 0xe4, 0xff, 0x12, 0x00, + 0x1e, 0x00, 0xf1, 0xff, 0xab, 0xff, 0x80, 0xff, 0x77, 0xff, 0x85, 0xff, + 0xa5, 0xff, 0xd0, 0xff, 0x09, 0x00, 0x56, 0x00, 0xa1, 0x00, 0xcc, 0x00, + 0xe8, 0x00, 0x0e, 0x01, 0x2b, 0x01, 0x21, 0x01, 0x06, 0x01, 0xfe, 0x00, + 0x0d, 0x01, 0x28, 0x01, 0x48, 0x01, 0x5a, 0x01, 0x3f, 0x01, 0x01, 0x01, + 0xcc, 0x00, 0xb1, 0x00, 0x93, 0x00, 0x5d, 0x00, 0x24, 0x00, 0x06, 0x00, + 0xfd, 0xff, 0xe0, 0xff, 0x96, 0xff, 0x32, 0xff, 0xdc, 0xfe, 0xaf, 0xfe, + 0xbd, 0xfe, 0x12, 0xff, 0x90, 0xff, 0xf8, 0xff, 0x1b, 0x00, 0x02, 0x00, + 0xe4, 0xff, 0xe8, 0xff, 0xef, 0xff, 0xdd, 0xff, 0xbd, 0xff, 0x9f, 0xff, + 0x7d, 0xff, 0x5b, 0xff, 0x41, 0xff, 0x3d, 0xff, 0x5f, 0xff, 0x96, 0xff, + 0xb1, 0xff, 0xa3, 0xff, 0x90, 0xff, 0x99, 0xff, 0xb3, 0xff, 0xb4, 0xff, + 0x85, 0xff, 0x48, 0xff, 0x39, 0xff, 0x5d, 0xff, 0x81, 0xff, 0x84, 0xff, + 0x8c, 0xff, 0xc7, 0xff, 0x22, 0x00, 0x68, 0x00, 0x90, 0x00, 0xa8, 0x00, + 0xab, 0x00, 0x8c, 0x00, 0x50, 0x00, 0x12, 0x00, 0xf3, 0xff, 0xf2, 0xff, + 0xe7, 0xff, 0xa9, 0xff, 0x4a, 0xff, 0x11, 0xff, 0x29, 0xff, 0x79, 0xff, + 0xbe, 0xff, 0xd7, 0xff, 0xde, 0xff, 0xe9, 0xff, 0xdb, 0xff, 0xa7, 0xff, + 0x85, 0xff, 0x9d, 0xff, 0xd3, 0xff, 0x0a, 0x00, 0x4f, 0x00, 0xb3, 0x00, + 0x20, 0x01, 0x6a, 0x01, 0x88, 0x01, 0xa8, 0x01, 0xe6, 0x01, 0x14, 0x02, + 0x05, 0x02, 0xdd, 0x01, 0xb6, 0x01, 0x71, 0x01, 0x0b, 0x01, 0xa5, 0x00, + 0x45, 0x00, 0xe2, 0xff, 0x94, 0xff, 0x69, 0xff, 0x64, 0xff, 0x80, 0xff, + 0x9f, 0xff, 0xa9, 0xff, 0xa4, 0xff, 0x97, 0xff, 0x76, 0xff, 0x43, 0xff, + 0x12, 0xff, 0xf8, 0xfe, 0xf9, 0xfe, 0x05, 0xff, 0x21, 0xff, 0x5b, 0xff, + 0x95, 0xff, 0xb9, 0xff, 0xe2, 0xff, 0x20, 0x00, 0x5d, 0x00, 0x81, 0x00, + 0x73, 0x00, 0x2e, 0x00, 0xca, 0xff, 0x58, 0xff, 0xe6, 0xfe, 0x95, 0xfe, + 0x62, 0xfe, 0x28, 0xfe, 0xea, 0xfd, 0xc5, 0xfd, 0xb3, 0xfd, 0xa8, 0xfd, + 0xb0, 0xfd, 0xd4, 0xfd, 0x06, 0xfe, 0x22, 0xfe, 0x1c, 0xfe, 0x12, 0xfe, + 0x26, 0xfe, 0x45, 0xfe, 0x58, 0xfe, 0x6d, 0xfe, 0x8e, 0xfe, 0xae, 0xfe, + 0xce, 0xfe, 0xf7, 0xfe, 0x20, 0xff, 0x31, 0xff, 0x35, 0xff, 0x4a, 0xff, + 0x6e, 0xff, 0x8c, 0xff, 0xa7, 0xff, 0xc1, 0xff, 0xd7, 0xff, 0xe1, 0xff, + 0xd8, 0xff, 0xd1, 0xff, 0xe3, 0xff, 0xf8, 0xff, 0xfe, 0xff, 0x0c, 0x00, + 0x1b, 0x00, 0x0d, 0x00, 0xf3, 0xff, 0xee, 0xff, 0x12, 0x00, 0x51, 0x00, + 0x82, 0x00, 0x96, 0x00, 0xa5, 0x00, 0xcb, 0x00, 0x09, 0x01, 0x4c, 0x01, + 0x79, 0x01, 0x88, 0x01, 0xa7, 0x01, 0x0e, 0x02, 0x84, 0x02, 0xb2, 0x02, + 0xae, 0x02, 0xbd, 0x02, 0xd4, 0x02, 0xad, 0x02, 0x30, 0x02, 0xb4, 0x01, + 0x88, 0x01, 0x68, 0x01, 0x0a, 0x01, 0xbe, 0x00, 0xd1, 0x00, 0xfe, 0x00, + 0xdf, 0x00, 0x95, 0x00, 0x93, 0x00, 0xcb, 0x00, 0xbe, 0x00, 0x56, 0x00, + 0xf9, 0xff, 0xfe, 0xff, 0x3c, 0x00, 0x20, 0x00, 0x72, 0xff, 0xc4, 0xfe, + 0xc6, 0xfe, 0x48, 0xff, 0x63, 0xff, 0xc6, 0xfe, 0x40, 0xfe, 0x55, 0xfe, + 0x77, 0xfe, 0x20, 0xfe, 0xa1, 0xfd, 0x76, 0xfd, 0x70, 0xfd, 0x10, 0xfd, + 0x6e, 0xfc, 0x17, 0xfc, 0x1d, 0xfc, 0x20, 0xfc, 0x15, 0xfc, 0x4d, 0xfc, + 0xc0, 0xfc, 0xcf, 0xfc, 0x40, 0xfc, 0xd7, 0xfb, 0x2b, 0xfc, 0xb3, 0xfc, + 0xbf, 0xfc, 0x68, 0xfc, 0x1a, 0xfc, 0xfe, 0xfb, 0x20, 0xfc, 0x98, 0xfc, + 0x1e, 0xfd, 0x27, 0xfd, 0xb0, 0xfc, 0x4b, 0xfc, 0x33, 0xfc, 0x00, 0xfc, + 0x91, 0xfb, 0x84, 0xfb, 0x61, 0xfc, 0xdd, 0xfd, 0x5e, 0xff, 0x99, 0x00, + 0x85, 0x01, 0x19, 0x02, 0x5f, 0x02, 0xab, 0x02, 0x49, 0x03, 0x22, 0x04, + 0x08, 0x05, 0xc7, 0x05, 0x0d, 0x06, 0xfd, 0x05, 0x0d, 0x06, 0x32, 0x06, + 0x50, 0x06, 0xc3, 0x06, 0x97, 0x07, 0x40, 0x08, 0x69, 0x08, 0x3c, 0x08, + 0xf5, 0x07, 0xa4, 0x07, 0x54, 0x07, 0x07, 0x07, 0xc3, 0x06, 0xb4, 0x06, + 0x3c, 0x07, 0x96, 0x08, 0x65, 0x0a, 0x01, 0x0c, 0x34, 0x0d, 0x2c, 0x0e, + 0xee, 0x0e, 0x64, 0x0f, 0x91, 0x0f, 0xa1, 0x0f, 0xda, 0x0f, 0x31, 0x10, + 0x34, 0x10, 0x84, 0x0f, 0x16, 0x0e, 0x68, 0x0c, 0x36, 0x0b, 0xa4, 0x0a, + 0x4d, 0x0a, 0xdd, 0x09, 0x59, 0x09, 0x69, 0x09, 0x84, 0x0a, 0x6f, 0x0b, + 0x8b, 0x0a, 0x70, 0x08, 0x31, 0x07, 0x72, 0x07, 0x19, 0x08, 0xa4, 0x08, + 0xfa, 0x09, 0xc0, 0x0c, 0x59, 0x10, 0x57, 0x13, 0x30, 0x14, 0x5d, 0x12, + 0xf6, 0x0e, 0x3d, 0x0b, 0x37, 0x07, 0xdc, 0x02, 0xa4, 0xff, 0x29, 0xff, + 0xe5, 0x00, 0xf3, 0x02, 0x87, 0x04, 0x1d, 0x06, 0xcb, 0x07, 0xeb, 0x08, + 0x71, 0x09, 0xee, 0x09, 0x4e, 0x0a, 0x44, 0x0a, 0xed, 0x09, 0xfd, 0x08, + 0x47, 0x07, 0xba, 0x05, 0xfc, 0x04, 0xc8, 0x04, 0x34, 0x05, 0x7f, 0x06, + 0xf1, 0x07, 0x8f, 0x08, 0x03, 0x09, 0x01, 0x0b, 0x24, 0x0e, 0x6c, 0x10, + 0xd3, 0x11, 0x29, 0x14, 0x28, 0x19, 0xce, 0x21, 0xd9, 0x2c, 0x31, 0x37, + 0xb0, 0x3d, 0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 0x03, 0x6e, 0x02, 0x14, 0x04, 0x7a, 0x06, + 0x70, 0x07, 0x0f, 0x08, 0xe7, 0x0a, 0x7f, 0x0f, 0xe6, 0x12, 0x93, 0x13, + 0xd3, 0x12, 0x9a, 0x12, 0xd4, 0x12, 0x21, 0x12, 0xe3, 0x10, 0xcf, 0x10, + 0x0e, 0x12, 0xc6, 0x13, 0x58, 0x16, 0x84, 0x1a, 0x81, 0x1f, 0xa8, 0x23, + 0x4b, 0x26, 0xad, 0x27, 0x98, 0x27, 0xbd, 0x25, 0x41, 0x23, 0xac, 0x21, + 0x90, 0x20, 0xfd, 0x1d, 0x0d, 0x19, 0x15, 0x13, 0x4b, 0x0e, 0x22, 0x0b, + 0xd9, 0x07, 0xd6, 0x03, 0x79, 0x01, 0x3d, 0x02, 0xb4, 0x03, 0x83, 0x03, + 0xf7, 0x02, 0x16, 0x04, 0xc6, 0x06, 0x02, 0x0a, 0xd4, 0x0c, 0xbe, 0x0e, + 0xbd, 0x10, 0x49, 0x14, 0xd4, 0x18, 0xcf, 0x1b, 0x78, 0x1b, 0xff, 0x18, + 0xbc, 0x16, 0xdc, 0x14, 0xd6, 0x11, 0x33, 0x0d, 0x54, 0x08, 0x30, 0x05, + 0x59, 0x04, 0xfe, 0x03, 0x03, 0x02, 0x4c, 0xfe, 0xdb, 0xf9, 0x48, 0xf5, + 0xf1, 0xf0, 0x1d, 0xed, 0x08, 0xea, 0x5c, 0xe8, 0x7f, 0xe8, 0x6d, 0xe9, + 0x04, 0xea, 0xb2, 0xea, 0xa6, 0xec, 0xb2, 0xf0, 0xf5, 0xf6, 0x14, 0xfe, + 0xbc, 0x03, 0x5c, 0x07, 0xba, 0x0a, 0xf8, 0x0e, 0x6a, 0x12, 0x0d, 0x12, + 0x39, 0x0d, 0x11, 0x07, 0x91, 0x02, 0x96, 0xfe, 0x96, 0xf8, 0x8a, 0xf1, + 0xaf, 0xec, 0xb4, 0xea, 0x00, 0xe9, 0x8d, 0xe5, 0x7f, 0x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xef, 0x00, 0xe3, 0x00, 0x4b, 0x01, 0x4c, 0x02, 0x1d, 0x03, 0x2d, 0x03, + 0x15, 0x03, 0x9a, 0x03, 0x9e, 0x04, 0xa2, 0x05, 0xa7, 0x06, 0xef, 0x07, + 0x49, 0x09, 0x53, 0x0a, 0x1b, 0x0b, 0xa4, 0x0b, 0xa2, 0x0b, 0x7c, 0x0b, + 0x0e, 0x0c, 0x02, 0x0d, 0x04, 0x0d, 0xaa, 0x0b, 0xf9, 0x09, 0xf8, 0x08, + 0x8d, 0x08, 0x01, 0x08, 0x1b, 0x07, 0x19, 0x06, 0x11, 0x05, 0x14, 0x04, + 0x8d, 0x03, 0xf4, 0x03, 0x34, 0x05, 0x89, 0x06, 0x40, 0x07, 0x93, 0x07, + 0x23, 0x08, 0xcc, 0x08, 0xf9, 0x08, 0xe5, 0x08, 0x50, 0x09, 0x1b, 0x0a, + 0x85, 0x0a, 0x39, 0x0a, 0x5c, 0x09, 0x29, 0x08, 0x05, 0x07, 0x26, 0x06, + 0x4d, 0x05, 0x43, 0x04, 0x13, 0x03, 0xb4, 0x01, 0x29, 0x00, 0xab, 0xfe, + 0x64, 0xfd, 0x6e, 0xfc, 0xe5, 0xfb, 0xa9, 0xfb, 0x77, 0xfb, 0x6c, 0xfb, + 0xd0, 0xfb, 0x86, 0xfc, 0x41, 0xfd, 0x0a, 0xfe, 0xfe, 0xfe, 0xf1, 0xff, + 0x9a, 0x00, 0xd3, 0x00, 0xba, 0x00, 0xd6, 0x00, 0x7e, 0x01, 0x50, 0x02, + 0xcc, 0x02, 0xe2, 0x02, 0x83, 0x02, 0x9b, 0x01, 0x78, 0x00, 0x4d, 0xff, + 0xbf, 0xfd, 0xb5, 0xfb, 0xcb, 0xf9, 0x61, 0xf8, 0x30, 0xf7, 0x23, 0xf6, + 0xb8, 0xf5, 0x39, 0xf6, 0x48, 0xf7, 0x35, 0xf8, 0xba, 0xf8, 0x66, 0xf9, + 0xf1, 0xfa, 0x13, 0xfd, 0xca, 0xfe, 0xbe, 0xff, 0x92, 0x00, 0xcf, 0x01, + 0x37, 0x03, 0x3c, 0x04, 0xe4, 0x04, 0xb1, 0x05, 0xa5, 0x06, 0x34, 0x07, + 0x12, 0x07, 0x63, 0x06, 0x65, 0x05, 0x58, 0x04, 0x73, 0x03, 0xb4, 0x02, + 0x05, 0x02, 0x6d, 0x01, 0xe0, 0x00, 0x39, 0x00, 0xa6, 0xff, 0x99, 0xff, + 0x0e, 0x00, 0x5a, 0x00, 0x29, 0x00, 0x34, 0x00, 0x3d, 0x01, 0xd4, 0x02, + 0xf9, 0x03, 0xaf, 0x04, 0xd6, 0x05, 0xbe, 0x07, 0xb8, 0x09, 0x06, 0x0b, + 0xbe, 0x0b, 0x7c, 0x0c, 0x8a, 0x0d, 0x8e, 0x0e, 0xf5, 0x0e, 0x6b, 0x0e, + 0x1e, 0x0d, 0xae, 0x0b, 0x95, 0x0a, 0x99, 0x09, 0x3f, 0x08, 0x80, 0x06, + 0xcd, 0x04, 0x77, 0x03, 0x4d, 0x02, 0x18, 0x01, 0x4f, 0x00, 0x97, 0x00, + 0x99, 0x01, 0x35, 0x02, 0x15, 0x02, 0x2d, 0x02, 0x39, 0x03, 0x9b, 0x04, + 0x5d, 0x05, 0x94, 0x05, 0x01, 0x06, 0xcb, 0x06, 0x6d, 0x07, 0x7b, 0x07, + 0x17, 0x07, 0xc4, 0x06, 0xee, 0x06, 0x70, 0x07, 0xa5, 0x07, 0x20, 0x07, + 0x35, 0x06, 0x7c, 0x05, 0xde, 0x04, 0xb4, 0x03, 0xbd, 0x01, 0x6d, 0xff, + 0x4c, 0xfd, 0x9e, 0xfb, 0x87, 0xfa, 0x05, 0xfa, 0xe9, 0xf9, 0x09, 0xfa, + 0x50, 0xfa, 0xcc, 0xfa, 0xae, 0xfb, 0xfb, 0xfc, 0x5c, 0xfe, 0x7e, 0xff, + 0x5e, 0x00, 0x10, 0x01, 0x7a, 0x01, 0x7e, 0x01, 0x46, 0x01, 0x2f, 0x01, + 0x52, 0x01, 0x69, 0x01, 0x2e, 0x01, 0xbd, 0x00, 0x72, 0x00, 0x68, 0x00, + 0x32, 0x00, 0x73, 0xff, 0x72, 0xfe, 0xb9, 0xfd, 0x57, 0xfd, 0xdd, 0xfc, + 0xdf, 0xfb, 0x7d, 0xfa, 0x5c, 0xf9, 0xef, 0xf8, 0xf4, 0xf8, 0xe7, 0xf8, + 0xd5, 0xf8, 0x6e, 0xf9, 0x31, 0xfb, 0x8d, 0xfd, 0x5e, 0xff, 0x65, 0x00, + 0x62, 0x01, 0xc2, 0x02, 0x0c, 0x04, 0xb6, 0x04, 0xcb, 0x04, 0xdd, 0x04, + 0x5c, 0x05, 0xef, 0x05, 0xe2, 0x05, 0x4a, 0x05, 0xbd, 0x04, 0x39, 0x04, + 0x5f, 0x03, 0x51, 0x02, 0x55, 0x01, 0x3c, 0x00, 0xd2, 0xfe, 0x5a, 0xfd, + 0x2b, 0xfc, 0x3b, 0xfb, 0x9b, 0xfa, 0xc3, 0xfa, 0xc5, 0xfb, 0x0f, 0xfd, + 0x6d, 0xfe, 0x4a, 0x00, 0xab, 0x02, 0xe6, 0x04, 0x80, 0x06, 0xa5, 0x07, + 0xca, 0x08, 0x03, 0x0a, 0xd6, 0x0a, 0xc1, 0x0a, 0xd5, 0x09, 0xa0, 0x08, + 0xa2, 0x07, 0xdd, 0x06, 0x15, 0x06, 0x32, 0x05, 0x46, 0x04, 0x59, 0x03, + 0x6e, 0x02, 0x87, 0x01, 0x99, 0x00, 0x95, 0xff, 0xb1, 0xfe, 0x72, 0xfe, + 0xef, 0xfe, 0x72, 0xff, 0x70, 0xff, 0x58, 0xff, 0xe0, 0xff, 0x09, 0x01, + 0x5f, 0x02, 0x7c, 0x03, 0x25, 0x04, 0x77, 0x04, 0xc9, 0x04, 0x09, 0x05, + 0xc6, 0x04, 0x0f, 0x04, 0x71, 0x03, 0x04, 0x03, 0x71, 0x02, 0xaa, 0x01, + 0xdb, 0x00, 0x12, 0x00, 0x60,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e, 0xf7, 0xaa, 0xf7, 0x39, 0xf8, 0x2f, 0xf9, 0x6e, 0xfa, + 0xd5, 0xfb, 0x3b, 0xfd, 0x8b, 0xfe, 0xbd, 0xff, 0xbd, 0x00, 0x6e, 0x01, + 0xc0, 0x01, 0xc8, 0x01, 0xb5, 0x01, 0x95, 0x01, 0x51, 0x01, 0xf4, 0x00, + 0x9d, 0x00, 0x5e, 0x00, 0x45, 0x00, 0x42, 0x00, 0x44, 0x00, 0x5a, 0x00, + 0x67, 0x00, 0x06, 0x00, 0x13, 0xff, 0x00, 0xfe, 0x5f, 0xfd, 0x5b, 0xfd, + 0xb2, 0xfd, 0x26, 0xfe, 0xf7, 0xfe, 0x71, 0x00, 0x24, 0x02, 0x49, 0x03, + 0xca, 0x03, 0x2f, 0x04, 0xc3, 0x04, 0x65, 0x05, 0xca, 0x05, 0xc1, 0x05, + 0x6a, 0x05, 0x1d, 0x05, 0xfd, 0x04, 0xfe, 0x04, 0x23, 0x05, 0x6e, 0x05, + 0xd9, 0x05, 0x5e, 0x06, 0xcf, 0x06, 0xe8, 0x06, 0x8e, 0x06, 0xdb, 0x05, + 0x1f, 0x05, 0x8d, 0x04, 0xd3, 0x03, 0xa1, 0x02, 0x72, 0x01, 0x0b, 0x01, + 0x63, 0x01, 0xc8, 0x01, 0xf3, 0x01, 0x53, 0x02, 0x2e, 0x03, 0x14, 0x04, + 0x75, 0x04, 0x49, 0x04, 0xec, 0x03, 0x9d, 0x03, 0x56, 0x03, 0xf2, 0x02, + 0x69, 0x02, 0xca, 0x01, 0x42, 0x01, 0x09, 0x01, 0x29, 0x01, 0x5d, 0x01, + 0x5a, 0x01, 0x24, 0x01, 0xe4, 0x00, 0x94, 0x00, 0x08, 0x00, 0x43, 0xff, + 0x6f, 0xfe, 0xa6, 0xfd, 0xed, 0xfc, 0x3c, 0xfc, 0x97, 0xfb, 0x1b, 0xfb, + 0xb4, 0xfa, 0x28, 0xfa, 0xa2, 0xf9, 0x8e, 0xf9, 0xfc, 0xf9, 0xaf, 0xfa, + 0x73, 0xfb, 0x0d, 0xfc, 0x4f, 0xfc, 0x49, 0xfc, 0x13, 0xfc, 0x9a, 0xfb, + 0xf1, 0xfa, 0x61, 0xfa, 0x13, 0xfa, 0xdc, 0xf9, 0x8b, 0xf9, 0x3a, 0xf9, + 0x3a, 0xf9, 0xba, 0xf9, 0x82, 0xfa, 0x20, 0xfb, 0x74, 0xfb, 0xc0, 0xfb, + 0x34, 0xfc, 0xbe, 0xfc, 0x33, 0xfd, 0x75, 0xfd, 0x79, 0xfd, 0x67, 0xfd, + 0x81, 0xfd, 0xc8, 0xfd, 0xf7, 0xfd, 0xf3, 0xfd, 0xf1, 0xfd, 0x1f, 0xfe, + 0x87, 0xfe, 0x26, 0xff, 0xce, 0xff, 0x3c, 0x00, 0x5b, 0x00, 0x3d, 0x00, + 0x0c, 0x00, 0xdd, 0xff, 0x8e, 0xff, 0x18, 0xff, 0xcb, 0xfe, 0xbd, 0xfe, + 0xa7, 0xfe, 0x73, 0xfe, 0x5f, 0xfe, 0x9b, 0xfe, 0x2a, 0xff, 0xf1, 0xff, + 0xd7, 0x00, 0xe8, 0x01, 0x24, 0x03, 0x53, 0x04, 0x4a, 0x05, 0x02, 0x06, + 0x5e, 0x06, 0x48, 0x06, 0xe6, 0x05, 0x6f, 0x05, 0xf5, 0x04, 0x66, 0x04, + 0xad, 0x03, 0xdb, 0x02, 0x23, 0x02, 0x92, 0x01, 0x0f, 0x01, 0xaa, 0x00, + 0x87, 0x00, 0xa4, 0x00, 0xe8, 0x00, 0x39, 0x01, 0x97, 0x01, 0x12, 0x02, + 0x9e, 0x02, 0x11, 0x03, 0x60, 0x03, 0x89, 0x03, 0x8f, 0x03, 0xa1, 0x03, + 0xd6, 0x03, 0xe6, 0x03, 0xa2, 0x03, 0x3a, 0x03, 0xd5, 0x02, 0x74, 0x02, + 0x1c, 0x02, 0xb6, 0x01, 0x1b, 0x01, 0x5c, 0x00, 0xbb, 0xff, 0x49, 0xff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 0xc0, 0x02, 0xfc, 0x02, 0x6e, 0x03, 0x1d, 0x04, 0xe3, 0x04, + 0x94, 0x05, 0x2b, 0x06, 0x94, 0x06, 0xa8, 0x06, 0x66, 0x06, 0xe2, 0x05, + 0x0f, 0x05, 0xed, 0x03, 0xa6, 0x02, 0x6c, 0x01, 0x71, 0x00, 0xd3, 0xff, + 0x75, 0xff, 0x35, 0xff, 0x35, 0xff, 0xa0, 0xff, 0x61, 0x00, 0x44, 0x01, + 0x11, 0x02, 0x94, 0x02, 0xcf, 0x02, 0xe5, 0x02, 0xd2, 0x02, 0x70, 0x02, + 0xad, 0x01, 0xbf, 0x00, 0x21, 0x00, 0x26, 0x00, 0x87, 0x00, 0xc7, 0x00, + 0xcf, 0x00, 0xe0, 0x00, 0x20, 0x01, 0x7e, 0x01, 0xe4, 0x01, 0x40, 0x02, + 0x62, 0x02, 0x0e, 0x02, 0x4f, 0x01, 0x77, 0x00, 0xd9, 0xff, 0x83, 0xff, + 0x5c, 0xff, 0x5d, 0xff, 0x88, 0xff, 0xae, 0xff, 0xa7, 0xff, 0x92, 0xff, + 0xa8, 0xff, 0xf0, 0xff, 0x3f, 0x00, 0x7a, 0x00, 0xa5, 0x00, 0xc6, 0x00, + 0xd9, 0x00, 0xf0, 0x00, 0x28, 0x01, 0x69, 0x01, 0x8e, 0x01, 0xb3, 0x01, + 0x17, 0x02, 0xa9, 0x02, 0x01, 0x03, 0xe8, 0x02, 0x8f, 0x02, 0x3c, 0x02, + 0x02, 0x02, 0xc4, 0x01, 0x6c, 0x01, 0x0d, 0x01, 0xc8, 0x00, 0xbb, 0x00, + 0x10, 0x01, 0xbd, 0x01, 0x60, 0x02, 0xc1, 0x02, 0x20, 0x03, 0xbe, 0x03, + 0x61, 0x04, 0x8a, 0x04, 0x27, 0x04, 0xbb, 0x03, 0x9e, 0x03, 0x95, 0x03, + 0x73, 0x03, 0x5b, 0x03, 0x5a, 0x03, 0x65, 0x03, 0x96, 0x03, 0xe7, 0x03, + 0x1c, 0x04, 0x27, 0x04, 0x39, 0x04, 0x52, 0x04, 0x3d, 0x04, 0xf2, 0x03, + 0x99, 0x03, 0x4a, 0x03, 0x14, 0x03, 0x18, 0x03, 0x5e, 0x03, 0xb3, 0x03, + 0xf4, 0x03, 0x4b, 0x04, 0xf1, 0x04, 0xb8, 0x05, 0x34, 0x06, 0x3b, 0x06, + 0x03, 0x06, 0xc8, 0x05, 0x86, 0x05, 0x14, 0x05, 0x73, 0x04, 0xd8, 0x03, + 0x6d, 0x03, 0x31, 0x03, 0x1e, 0x03, 0x24, 0x03, 0x0f, 0x03, 0xbc, 0x02, + 0x47, 0x02, 0xdc, 0x01, 0x65, 0x01, 0xbf, 0x00, 0x1a, 0x00, 0xda, 0xff, + 0x17, 0x00, 0x8a, 0x00, 0xf0, 0x00, 0x4f, 0x01, 0xcf, 0x01, 0x6d, 0x02, + 0x0d, 0x03, 0x94, 0x03, 0xd3, 0x03, 0xa5, 0x03, 0x2f, 0x03, 0xb6, 0x02, + 0x51, 0x02, 0xe8, 0x01, 0x5f, 0x01, 0xcb, 0x00, 0x59, 0x00, 0x17, 0x00, + 0xdc, 0xff, 0x7e, 0xff, 0x10, 0xff, 0xcc, 0xfe, 0xac, 0xfe, 0x4a, 0xfe, + 0x7a, 0xfd, 0xa8, 0xfc, 0x4d, 0xfc, 0x5e, 0xfc, 0x9c, 0xfc, 0xf0, 0xfc, + 0x59, 0xfd, 0xce, 0xfd, 0x52, 0xfe, 0xe5, 0xfe, 0x66, 0xff, 0xbb, 0xff, + 0xe5, 0xff, 0xf1, 0xff, 0xec, 0xff, 0xd7, 0xff, 0x97, 0xff, 0x36, 0xff, + 0xe2, 0xfe, 0xab, 0xfe, 0x7e, 0xfe, 0x51, 0xfe, 0x31, 0xfe, 0x35, 0xfe, + 0x48, 0xfe, 0x2c, 0xfe, 0xd1, 0xfd, 0x67, 0xfd, 0x0b, 0xfd, 0xb3, 0xfc, + 0x62, 0xfc, 0x30, 0xfc, 0x18, 0xfc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0xfc, 0xf6, 0xfb, 0xd8, 0xfb, + 0xb9, 0xfb, 0x83, 0xfb, 0x5a, 0xfb, 0x75, 0xfb, 0xdb, 0xfb, 0x47, 0xfc, + 0x81, 0xfc, 0xa6, 0xfc, 0xe7, 0xfc, 0x45, 0xfd, 0x9b, 0xfd, 0xbb, 0xfd, + 0x98, 0xfd, 0x5e, 0xfd, 0x4f, 0xfd, 0x84, 0xfd, 0xd1, 0xfd, 0xee, 0xfd, + 0xc6, 0xfd, 0x99, 0xfd, 0x9a, 0xfd, 0xc3, 0xfd, 0xe9, 0xfd, 0xdd, 0xfd, + 0x99, 0xfd, 0x4c, 0xfd, 0x12, 0xfd, 0xed, 0xfc, 0xf3, 0xfc, 0x2c, 0xfd, + 0x87, 0xfd, 0xf9, 0xfd, 0x80, 0xfe, 0x08, 0xff, 0x93, 0xff, 0x2a, 0x00, + 0xb3, 0x00, 0x06, 0x01, 0x13, 0x01, 0xe5, 0x00, 0x87, 0x00, 0x0f, 0x00, + 0xa5, 0xff, 0x6f, 0xff, 0x71, 0xff, 0x84, 0xff, 0x75, 0xff, 0x40, 0xff, + 0x11, 0xff, 0x0a, 0xff, 0x17, 0xff, 0x25, 0xff, 0x48, 0xff, 0x7e, 0xff, + 0xaf, 0xff, 0xcd, 0xff, 0xd3, 0xff, 0xb3, 0xff, 0x76, 0xff, 0x44, 0xff, + 0x42, 0xff, 0x77, 0xff, 0xc2, 0xff, 0x09, 0x00, 0x4f, 0x00, 0x9a, 0x00, + 0xd9, 0x00, 0xf0, 0x00, 0xce, 0x00, 0x87, 0x00, 0x55, 0x00, 0x53, 0x00, + 0x4d, 0x00, 0x04, 0x00, 0x7d, 0xff, 0x0f, 0xff, 0x0d, 0xff, 0x70, 0xff, + 0xe5, 0xff, 0x23, 0x00, 0x2b, 0x00, 0x29, 0x00, 0x23, 0x00, 0xf7, 0xff, + 0x99, 0xff, 0x1e, 0xff, 0xa3, 0xfe, 0x50, 0xfe, 0x32, 0xfe, 0x2d, 0xfe, + 0x26, 0xfe, 0x40, 0xfe, 0xae, 0xfe, 0x5e, 0xff, 0xf8, 0xff, 0x48, 0x00, + 0x6e, 0x00, 0x90, 0x00, 0x8e, 0x00, 0x40, 0x00, 0xbe, 0xff, 0x42, 0xff, + 0xf4, 0xfe, 0xda, 0xfe, 0xe6, 0xfe, 0xfe, 0xfe, 0x0c, 0xff, 0x20, 0xff, + 0x4e, 0xff, 0x82, 0xff, 0x89, 0xff, 0x4a, 0xff, 0xed, 0xfe, 0xb8, 0xfe, + 0xbb, 0xfe, 0xc9, 0xfe, 0xbc, 0xfe, 0x9d, 0xfe, 0x86, 0xfe, 0x7f, 0xfe, + 0x81, 0xfe, 0x85, 0xfe, 0x89, 0xfe, 0x9c, 0xfe, 0xc8, 0xfe, 0xfb, 0xfe, + 0x01, 0xff, 0xba, 0xfe, 0x60, 0xfe, 0x58, 0xfe, 0xc0, 0xfe, 0x55, 0xff, + 0xe5, 0xff, 0x84, 0x00, 0x4b, 0x01, 0x21, 0x02, 0xd4, 0x02, 0x3d, 0x03, + 0x3d, 0x03, 0xbf, 0x02, 0xeb, 0x01, 0x0f, 0x01, 0x5c, 0x00, 0xd2, 0xff, + 0x66, 0xff, 0x17, 0xff, 0xee, 0xfe, 0xf8, 0xfe, 0x27, 0xff, 0x6a, 0xff, + 0xae, 0xff, 0xd5, 0xff, 0xcb, 0xff, 0x9d, 0xff, 0x69, 0xff, 0x53, 0xff, + 0x6f, 0xff, 0xb0, 0xff, 0x02, 0x00, 0x62, 0x00, 0xb7, 0x00, 0xf1, 0x00, + 0x36, 0x01, 0xb7, 0x01, 0x6a, 0x02, 0xfd, 0x02, 0x1b, 0x03, 0xd6, 0x02, + 0x91, 0x02, 0x63, 0x02, 0x1f, 0x02, 0xbe, 0x01, 0x57, 0x01, 0xf5, 0x00, + 0xa0, 0x00, 0x57, 0x00, 0x0b, 0x00, 0xb4, 0xff, 0x48, 0xff, 0xc1, 0xfe, + 0x3c, 0xfe, 0xe1, 0xfd, 0xb8, 0xfd, 0xb9, 0xfd, 0xe6, 0xfd, 0x42, 0xfe, + 0xcd, 0xfe, 0x8a, 0xff, 0x58, 0x00, 0x06, 0x01, 0x97, 0x01, 0x47, 0x02, + 0x23, 0x03, 0xdc, 0x03, 0x15, 0x04, 0xd3, 0x03, 0x82, 0x03, 0x6d, 0x03, + 0x5b, 0x03, 0x00, 0x03, 0x78, 0x02, 0x04, 0x02, 0xb3, 0x01, 0x66, 0x01, + 0xf0, 0x00, 0x53, 0x00, 0xc6, 0xff, 0x6b, 0xff, 0x30, 0xff, 0xfe, 0xfe, + 0xc0, 0xfe, 0x79, 0xfe, 0x62, 0xfe, 0xa1, 0xfe, 0x10, 0xff, 0x7a, 0xff, + 0xd1, 0xff, 0x21, 0x00, 0x77, 0x00, 0xd6, 0x00, 0x2b, 0x01, 0x63, 0x01, + 0x86, 0x01, 0xbd, 0x01, 0x23, 0x02, 0xa3, 0x02, 0xfa, 0x02, 0xfb, 0x02, + 0xc2, 0x02, 0x88, 0x02, 0x54, 0x02, 0xf3, 0x01, 0x48, 0x01, 0x7e, 0x00, + 0xdd, 0xff, 0x7d, 0xff, 0x3d, 0xff, 0xe4, 0xfe, 0x62, 0xfe, 0xe9, 0xfd, + 0xc0, 0xfd, 0xf3, 0xfd, 0x4d, 0xfe, 0x9a, 0xfe, 0xe4, 0xfe, 0x61, 0xff, + 0x1c, 0x00, 0xd4, 0x00, 0x44, 0x01, 0x77, 0x01, 0xb4, 0x01, 0x1b, 0x02, + 0x80, 0x02, 0xb2, 0x02, 0xbf, 0x02, 0xc0, 0x02, 0xb0, 0x02, 0x7b, 0x02, + 0x0e, 0x02, 0x70, 0x01, 0xdc, 0x00, 0x83, 0x00, 0x50, 0x00, 0x06, 0x00, + 0x90, 0xff, 0x07, 0xff, 0x92, 0xfe, 0x48, 0xfe, 0x2a, 0xfe, 0x26, 0xfe, + 0x32, 0xfe, 0x5a, 0xfe, 0xb1, 0xfe, 0x3a, 0xff, 0xf2, 0xff, 0xc1, 0x00, + 0x87, 0x01, 0x38, 0x02, 0xd0, 0x02, 0x4b, 0x03, 0x9f, 0x03, 0xc1, 0x03, + 0xb3, 0x03, 0x9b, 0x03, 0x8f, 0x03, 0x80, 0x03, 0x62, 0x03, 0x30, 0x03, + 0xdf, 0x02, 0x68, 0x02, 0xdd, 0x01, 0x5c, 0x01, 0xf9, 0x00, 0x9e, 0x00, + 0x38, 0x00, 0xe8, 0xff, 0xd0, 0xff, 0xdb, 0xff, 0xf8, 0xff, 0x31, 0x00, + 0x7a, 0x00, 0xb9, 0x00, 0xf3, 0x00, 0x47, 0x01, 0xcb, 0x01, 0x73, 0x02, + 0x0f, 0x03, 0x76, 0x03, 0xa9, 0x03, 0xc0, 0x03, 0xc1, 0x03, 0xa3, 0x03, + 0x6a, 0x03, 0x1f, 0x03, 0xc6, 0x02, 0x5c, 0x02, 0xde, 0x01, 0x5e, 0x01, + 0xf0, 0x00, 0x87, 0x00, 0x12, 0x00, 0x9e, 0xff, 0x44, 0xff, 0x0b, 0xff, + 0xe6, 0xfe, 0xbb, 0xfe, 0x7a, 0xfe, 0x44, 0xfe, 0x54, 0xfe, 0xad, 0xfe, + 0x25, 0xff, 0xa1, 0xff, 0x19, 0x00, 0x7a, 0x00, 0xc0, 0x00, 0xf3, 0x00, + 0x06, 0x01, 0xf2, 0x00, 0xc6, 0x00, 0x83, 0x00, 0x1c, 0x00, 0x99, 0xff, + 0x1c, 0xff, 0xba, 0xfe, 0x6c, 0xfe, 0x24, 0xfe, 0xe3, 0xfd, 0xb5, 0xfd, + 0x81, 0xfd, 0x1d, 0xfd, 0x8f, 0xfc, 0x1c, 0xfc, 0xf6, 0xfb, 0x0c, 0xfc, + 0x33, 0xfc, 0x5d, 0xfc, 0xaa, 0xfc, 0x40, 0xfd, 0xfe, 0xfd, 0x93, 0xfe, + 0xf6, 0xfe, 0x5a, 0xff, 0xbd, 0xff, 0xfe, 0xff, 0x14, 0x00, 0xfd, 0xff, + 0xc3, 0xff, 0x7c, 0xff, 0x35, 0xff, 0x01, 0xff, 0xee, 0xfe, 0xe6, 0xfe, + 0xd6, 0xfe, 0xcb, 0xfe, 0xb2, 0xfe, 0x6c, 0xfe, 0x1a, 0xfe, 0xfa, 0xfd, + 0x10, 0xfe, 0x29, 0xfe, 0x26, 0xfe, 0x06, 0xfe, 0xdc, 0xfd, 0xc7, 0xfd, + 0xe5, 0xfd, 0x45, 0xfe, 0xda, 0xfe, 0x87, 0xff, 0x37, 0x00, 0xde, 0x00, + 0x60, 0x01, 0x9b, 0x01, 0x94, 0x01, 0x77, 0x01, 0x59, 0x01, 0x2d, 0x01, + 0xe9, 0x00, 0xa0, 0x00, 0x6f, 0x00, 0x5b, 0x00, 0x4e, 0x00, 0x3a, 0x00, + 0x1b, 0x00, 0xe4, 0xff, 0x9d, 0xff, 0x5f, 0xff, 0x32, 0xff, 0xf9, 0xfe, + 0x9a, 0xfe, 0x28, 0xfe, 0xda, 0xfd, 0xd1, 0xfd, 0xf7, 0xfd, 0x2b, 0xfe, + 0x6d, 0xfe, 0xce, 0xfe, 0x4b, 0xff, 0xbd, 0xff, 0x09, 0x00, 0x49, 0x00, + 0x9e, 0x00, 0xeb, 0x00, 0x05, 0x01, 0xfc, 0x00, 0xf3, 0x00, 0xe3, 0x00, + 0xc6, 0x00, 0xae, 0x00, 0xa4, 0x00, 0x91, 0x00, 0x62, 0x00, 0x21, 0x00, + 0xef, 0xff, 0xcc, 0xff, 0x8d, 0xff, 0x1d, 0xff, 0x97, 0xfe, 0x22, 0xfe, + 0xd7, 0xfd, 0xac, 0xfd, 0x8e, 0xfd, 0x8e, 0xfd, 0xce, 0xfd, 0x55, 0xfe, + 0x0d, 0xff, 0xc9, 0xff, 0x54, 0x00, 0xaa, 0x00, 0xf0, 0x00, 0x2e, 0x01, + 0x47, 0x01, 0x32, 0x01, 0x0d, 0x01, 0xe5, 0x00, 0xa7, 0x00, 0x4f, 0x00, + 0xf6, 0xff, 0xb3, 0xff, 0xa0, 0xff, 0xc7, 0xff, 0x0e, 0x00, 0x55, 0x00, + 0xa1, 0x00, 0xf6, 0x00, 0x31, 0x01, 0x24, 0x01, 0xd0, 0x00, 0x76, 0x00, + 0x52, 0x00, 0x63, 0x00, 0x7c, 0x00, 0x80, 0x00, 0x81, 0x00, 0xa1, 0x00, + 0xdb, 0x00, 0x16, 0x01, 0x4c, 0x01, 0x84, 0x01, 0xc4, 0x01, 0xff, 0x01, + 0x15, 0x02, 0x03, 0x02, 0xf7, 0x01, 0x15, 0x02, 0x49, 0x02, 0x78, 0x02, + 0x8e, 0x02, 0x87, 0x02, 0x75, 0x02, 0x62, 0x02, 0x3f, 0x02, 0x06, 0x02, + 0xbe, 0x01, 0x64, 0x01, 0xf2, 0x00, 0x75, 0x00, 0x0f, 0x00, 0xd6, 0xff, + 0xb3, 0xff, 0x83, 0xff, 0x47, 0xff, 0x28, 0xff, 0x37, 0xff, 0x43, 0xff, + 0x13, 0xff, 0xaf, 0xfe, 0x4d, 0xfe, 0x18, 0xfe, 0x02, 0xfe, 0xd4, 0xfd, + 0x82, 0xfd, 0x46, 0xfd, 0x47, 0xfd, 0x7d, 0xfd, 0xcb, 0xfd, 0x05, 0xfe, + 0x05, 0xfe, 0xd2, 0xfd, 0x9d, 0xfd, 0x91, 0xfd, 0xab, 0xfd, 0xcb, 0xfd, + 0xe5, 0xfd, 0x02, 0xfe, 0x13, 0xfe, 0xf4, 0xfd, 0xb1, 0xfd, 0x7e, 0xfd, + 0x5e, 0xfd, 0x2e, 0xfd, 0xe4, 0xfc, 0x8c, 0xfc, 0x31, 0xfc, 0xee, 0xfb, + 0xe8, 0xfb, 0x22, 0xfc, 0x7b, 0xfc, 0xbf, 0xfc, 0xdc, 0xfc, 0xff, 0xfc, + 0x5e, 0xfd, 0xe4, 0xfd, 0x39, 0xfe, 0x2f, 0xfe, 0xfd, 0xfd, 0xf2, 0xfd, + 0x1a, 0xfe, 0x4f, 0xfe, 0x6d, 0xfe, 0x61, 0xfe, 0x37, 0xfe, 0x12, 0xfe, + 0xff, 0xfd, 0xff, 0xfd, 0x18, 0xfe, 0x42, 0xfe, 0x6d, 0xfe, 0x90, 0xfe, + 0x99, 0xfe, 0x74, 0xfe, 0x31, 0xfe, 0xf6, 0xfd, 0xc6, 0xfd, 0x90, 0xfd, + 0x55, 0xfd, 0x30, 0xfd, 0x35, 0xfd, 0x5c, 0xfd, 0x8d, 0xfd, 0xba, 0xfd, + 0xf6, 0xfd, 0x58, 0xfe, 0xc1, 0xfe, 0xf9, 0xfe, 0xff, 0xfe, 0xfa, 0xfe, + 0x04, 0xff, 0x1b, 0xff, 0x26, 0xff, 0x18, 0xff, 0x11, 0xff, 0x36, 0xff, + 0x88, 0xff, 0xf7, 0xff, 0x5f, 0x00, 0x9f, 0x00, 0xb2, 0x00, 0x9f, 0x00, + 0x6a, 0x00, 0x2c, 0x00, 0x04, 0x00, 0xf8, 0xff, 0xfa, 0xff, 0xf8, 0xff, + 0xec, 0xff, 0xec, 0xff, 0x07, 0x00, 0x12, 0x00, 0xd7, 0xff, 0x6f, 0xff, + 0x24, 0xff, 0x14, 0xff, 0x2b, 0xff, 0x55, 0xff, 0x91, 0xff, 0xda, 0xff, + 0x16, 0x00, 0x32, 0x00, 0x3d, 0x00, 0x4e, 0x00, 0x71, 0x00, 0x9f, 0x00, + 0xce, 0x00, 0xe8, 0x00, 0xd7, 0x00, 0xa0, 0x00, 0x6c, 0x00, 0x51, 0x00, + 0x4b, 0x00, 0x50, 0x00, 0x54, 0x00, 0x52, 0x00, 0x54, 0x00, 0x5e, 0x00, + 0x6c, 0x00, 0x72, 0x00, 0x58, 0x00, 0x0b, 0x00, 0xa2, 0xff, 0x5a, 0xff, + 0x4b, 0xff, 0x51, 0xff, 0x51, 0xff, 0x69, 0xff, 0xc3, 0xff, 0x46, 0x00, + 0x9f, 0x00, 0xa6, 0x00, 0x8b, 0x00, 0x96, 0x00, 0xd5, 0x00, 0x1b, 0x01, + 0x2e, 0x01, 0x0e, 0x01, 0xe9, 0x00, 0xbe, 0x00, 0x71, 0x00, 0x18, 0x00, + 0xe8, 0xff, 0xec, 0xff, 0x05, 0x00, 0x15, 0x00, 0x0d, 0x00, 0xe3, 0xff, + 0x9f, 0xff, 0x5e, 0xff, 0x26, 0xff, 0xdc, 0xfe, 0x88, 0xfe, 0x4d, 0xfe, + 0x49, 0xfe, 0x72, 0xfe, 0xb1, 0xfe, 0x06, 0xff, 0x7b, 0xff, 0x05, 0x00, + 0x9a, 0x00, 0x2e, 0x01, 0xa2, 0x01, 0xde, 0x01, 0xef, 0x01, 0xf5, 0x01, + 0xfc, 0x01, 0xf2, 0x01, 0xd5, 0x01, 0xb4, 0x01, 0x91, 0x01, 0x66, 0x01, + 0x34, 0x01, 0xff, 0x00, 0xd1, 0x00, 0xad, 0x00, 0x86, 0x00, 0x62, 0x00, + 0x4d, 0x00, 0x45, 0x00, 0x3a, 0x00, 0x2e, 0x00, 0x2f, 0x00, 0x49, 0x00, + 0x83, 0x00, 0xe1, 0x00, 0x68, 0x01, 0x1b, 0x02, 0xdd, 0x02, 0x80, 0x03, + 0xfe, 0x03, 0x71, 0x04, 0xce, 0x04, 0xf8, 0x04, 0xf5, 0x04, 0xdc, 0x04, + 0xaf, 0x04, 0x68, 0x04, 0x13, 0x04, 0xcc, 0x03, 0xa3, 0x03, 0x8e, 0x03, + 0x6a, 0x03, 0x25, 0x03, 0xde, 0x02, 0xc1, 0x02, 0xca, 0x02, 0xdc, 0x02, + 0xe8, 0x02, 0xe6, 0x02, 0xd4, 0x02, 0xc1, 0x02, 0xc4, 0x02, 0xeb, 0x02, + 0x30, 0x03, 0x88, 0x03, 0xe9, 0x03, 0x49, 0x04, 0xa1, 0x04, 0xf0, 0x04, + 0x27, 0x05, 0x37, 0x05, 0x28, 0x05, 0x04, 0x05, 0xba, 0x04, 0x44, 0x04, + 0xce, 0x03, 0x82, 0x03, 0x64, 0x03, 0x63, 0x03, 0x64, 0x03, 0x5a, 0x03, + 0x45, 0x03, 0x21, 0x03, 0xed, 0x02, 0xb1, 0x02, 0x7b, 0x02, 0x5b, 0x02, + 0x58, 0x02, 0x6b, 0x02, 0x84, 0x02, 0x8c, 0x02, 0x84, 0x02, 0x96, 0x02, + 0xc4, 0x02, 0xd9, 0x02, 0xb5, 0x02, 0x79, 0x02, 0x4b, 0x02, 0x2d, 0x02, + 0x0c, 0x02, 0xde, 0x01, 0xac, 0x01, 0x7a, 0x01, 0x43, 0x01, 0x03, 0x01, + 0xb7, 0x00, 0x6e, 0x00, 0x32, 0x00, 0xfc, 0xff, 0xbe, 0xff, 0x75, 0xff, + 0x2c, 0xff, 0xeb, 0xfe, 0xbb, 0xfe, 0xa9, 0xfe, 0xb6, 0xfe, 0xcd, 0xfe, + 0xe0, 0xfe, 0xf9, 0xfe, 0x16, 0xff, 0x2d, 0xff, 0x3b, 0xff, 0x49, 0xff, + 0x53, 0xff, 0x51, 0xff, 0x51, 0xff, 0x59, 0xff, 0x48, 0xff, 0x06, 0xff, + 0xa6, 0xfe, 0x42, 0xfe, 0xf8, 0xfd, 0xe0, 0xfd, 0xe9, 0xfd, 0xf1, 0xfd, + 0xee, 0xfd, 0xeb, 0xfd, 0xfb, 0xfd, 0x22, 0xfe, 0x4d, 0xfe, 0x72, 0xfe, + 0x9a, 0xfe, 0xc1, 0xfe, 0xe4, 0xfe, 0x12, 0xff, 0x51, 0xff, 0x93, 0xff, + 0xd2, 0xff, 0x14, 0x00, 0x52, 0x00, 0x70, 0x00, 0x69, 0x00, 0x5e, 0x00, + 0x63, 0x00, 0x62, 0x00, 0x4d, 0x00, 0x2b, 0x00, 0x0e, 0x00, 0x03, 0x00, + 0x01, 0x00, 0xe9, 0xff, 0xaf, 0xff, 0x6e, 0xff, 0x48, 0xff, 0x49, 0xff, + 0x6b, 0xff, 0x9d, 0xff, 0xc9, 0xff, 0xd9, 0xff, 0xd0, 0xff, 0xc2, 0xff, + 0xca, 0xff, 0xfc, 0xff, 0x53, 0x00, 0xbc, 0x00, 0x21, 0x01, 0x73, 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x95, 0xff, 0xbd, 0xff, 0xe5, 0xff, 0x0a, 0x00, 0x3d, 0x00, 0x89, 0x00, + 0xd1, 0x00, 0xec, 0x00, 0xbe, 0x00, 0x4a, 0x00, 0xc4, 0xff, 0x74, 0xff, + 0x72, 0xff, 0x8b, 0xff, 0x87, 0xff, 0x78, 0xff, 0x8b, 0xff, 0xbe, 0xff, + 0x08, 0x00, 0x5b, 0x00, 0xa1, 0x00, 0xe7, 0x00, 0x41, 0x01, 0x93, 0x01, + 0xb6, 0x01, 0xa5, 0x01, 0x7d, 0x01, 0x61, 0x01, 0x4f, 0x01, 0x2f, 0x01, + 0xfb, 0x00, 0xd0, 0x00, 0xc5, 0x00, 0xc3, 0x00, 0xb4, 0x00, 0xa6, 0x00, + 0x9e, 0x00, 0x8d, 0x00, 0x73, 0x00, 0x52, 0x00, 0x2f, 0x00, 0x17, 0x00, + 0x0e, 0x00, 0x0a, 0x00, 0xff, 0xff, 0xe9, 0xff, 0xcb, 0xff, 0xb0, 0xff, + 0xaf, 0xff, 0xd0, 0xff, 0xf7, 0xff, 0x0a, 0x00, 0x07, 0x00, 0xf8, 0xff, + 0xf3, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x20, 0x00, 0x31, 0x00, 0x42, 0x00, + 0x5e, 0x00, 0x8e, 0x00, 0xcc, 0x00, 0x00, 0x01, 0x13, 0x01, 0x0a, 0x01, + 0xf5, 0x00, 0xdd, 0x00, 0xd1, 0x00, 0xd9, 0x00, 0xe1, 0x00, 0xdd, 0x00, + 0xc8, 0x00, 0xa4, 0x00, 0x85, 0x00, 0x74, 0x00, 0x63, 0x00, 0x4b, 0x00, + 0x27, 0x00, 0x00, 0x00, 0xe7, 0xff, 0xec, 0xff, 0x0f, 0x00, 0x35, 0x00, + 0x47, 0x00, 0x4b, 0x00, 0x48, 0x00, 0x34, 0x00, 0x02, 0x00, 0xb2, 0xff, + 0x46, 0xff, 0xcf, 0xfe, 0x5b, 0xfe, 0xe8, 0xfd, 0x7b, 0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0x1a, 0x01, + 0xd8, 0x00, 0x92, 0x00, 0x58, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x50, 0x00, + 0x5e, 0x00, 0x62, 0x00, 0x66, 0x00, 0x56, 0x00, 0x32, 0x00, 0x31, 0x00, + 0x79, 0x00, 0xc4, 0x00, 0xbf, 0x00, 0x6f, 0x00, 0x16, 0x00, 0xeb, 0xff, + 0xf8, 0xff, 0xfe, 0xff, 0xc8, 0xff, 0x97, 0xff, 0xcb, 0xff, 0x40, 0x00, + 0x85, 0x00, 0x80, 0x00, 0x66, 0x00, 0x49, 0x00, 0x04, 0x00, 0x9e, 0xff, + 0x5c, 0xff, 0x5d, 0xff, 0x71, 0xff, 0x6f, 0xff, 0x5d, 0xff, 0x4e, 0xff, + 0x45, 0xff, 0x3b, 0xff, 0x34, 0xff, 0x3b, 0xff, 0x58, 0xff, 0x98, 0xff, + 0xf2, 0xff, 0x3e, 0x00, 0x5d, 0x00, 0x4c, 0x00, 0x0f, 0x00, 0xd6, 0xff, + 0xe4, 0xff, 0x3c, 0x00, 0x9c, 0x00, 0xd0, 0x00, 0xda, 0x00, 0xce, 0x00, + 0xae, 0x00, 0x7e, 0x00, 0x58, 0x00, 0x3a, 0x00, 0xff, 0xff, 0x99, 0xff, + 0x2c, 0xff, 0xda, 0xfe, 0xb6, 0xfe, 0xcf, 0xfe, 0x22, 0xff, 0x81, 0xff, + 0xc3, 0xff, 0xed, 0xff, 0x12, 0x00, 0x46, 0x00, 0x99, 0x00, 0xf4, 0x00, + 0x34, 0x01, 0x5a, 0x01, 0x85, 0x01, 0xbb, 0x01, 0xe7, 0x01, 0x06, 0x02, + 0x27, 0x02, 0x35, 0x02, 0x14, 0x02, 0xe5, 0x01, 0xdb, 0x01, 0xed, 0x01, + 0xf0, 0x01, 0xbf, 0x01, 0x5c, 0x01, 0xf3, 0x00, 0xae, 0x00, 0x86, 0x00, + 0x5f, 0x00, 0x3b, 0x00, 0x26, 0x00, 0x20, 0x00, 0x2f, 0x00, 0x53, 0x00, + 0x7f, 0x00, 0xb7, 0x00, 0x06, 0x01, 0x66, 0x01, 0xc1, 0x01, 0x0a, 0x02, + 0x4a, 0x02, 0x98, 0x02, 0xfa, 0x02, 0x63, 0x03, 0xbc, 0x03, 0xe8, 0x03, + 0xe2, 0x03, 0xba, 0x03, 0x76, 0x03, 0x21, 0x03, 0xd0, 0x02, 0x88, 0x02, + 0x41, 0x02, 0xed, 0x01, 0x85, 0x01, 0x1d, 0x01, 0xd0, 0x00, 0x9d, 0x00, + 0x6e, 0x00, 0x42, 0x00, 0x38, 0x00, 0x5d, 0x00, 0xa1, 0x00, 0xf4, 0x00, + 0x4e, 0x01, 0xa9, 0x01, 0x0c, 0x02, 0x6e, 0x02, 0xb3, 0x02, 0xd4, 0x02, + 0xf1, 0x02, 0x23, 0x03, 0x68, 0x03, 0xac, 0x03, 0xdc, 0x03, 0xe7, 0x03, + 0xc9, 0x03, 0x7d, 0x03, 0xff, 0x02, 0x68, 0x02, 0xe0, 0x01, 0x7a, 0x01, + 0x2a, 0x01, 0xe9, 0x00, 0xbc, 0x00, 0x99, 0x00, 0x6f, 0x00, 0x4a, 0x00, + 0x34, 0x00, 0x22, 0x00, 0x12, 0x00, 0x23, 0x00, 0x64, 0x00, 0xb7, 0x00, + 0xf1, 0x00, 0x10, 0x01, 0x33, 0x01, 0x63, 0x01, 0x8b, 0x01, 0xac, 0x01, + 0xd9, 0x01, 0x12, 0x02, 0x38, 0x02, 0x36, 0x02, 0x16, 0x02, 0xef, 0x01, + 0xbe, 0x01, 0x7a, 0x01, 0x23, 0x01, 0xd0, 0x00, 0x8e, 0x00, 0x4c, 0x00, + 0x00, 0x00, 0xbb, 0xff, 0x83, 0xff, 0x4c, 0xff, 0x17, 0xff, 0xe7, 0xfe, + 0xc1, 0xfe, 0xac, 0xfe, 0xad, 0xfe, 0xc7, 0xfe, 0xed, 0xfe, 0x1b, 0xff, + 0x65, 0xff, 0xca, 0xff, 0x27, 0x00, 0x6f, 0x00, 0xac, 0x00, 0xe2, 0x00, + 0x07, 0x01, 0x11, 0x01, 0x02, 0x01, 0xee, 0x00, 0xd2, 0x00, 0x94, 0x00, + 0x3a, 0x00, 0xfa, 0xff, 0xea, 0xff, 0xf4, 0xff, 0xf6, 0xff, 0xd1, 0xff, + 0x92, 0xff, 0x67, 0xff, 0x5c, 0xff, 0x5e, 0xff, 0x5e, 0xff, 0x54, 0xff, + 0x4a, 0xff, 0x53, 0xff, 0x6e, 0xff, 0x8e, 0xff, 0xa7, 0xff, 0xb2, 0xff, + 0xb6, 0xff, 0xc8, 0xff, 0xf2, 0xff, 0x30, 0x00, 0x77, 0x00, 0xb1, 0x00, + 0xd0, 0x00, 0xdf, 0x00, 0xed, 0x00, 0xfe, 0x00, 0x11, 0x01, 0x1c, 0x01, + 0x14, 0x01, 0xf8, 0x00, 0xd7, 0x00, 0xbc, 0x00, 0xaa, 0x00, 0xa0, 0x00, + 0x8f, 0x00, 0x6b, 0x00, 0x2d, 0x00, 0xdf, 0xff, 0x9f, 0xff, 0x81, 0xff, + 0x7d, 0xff, 0x85, 0xff, 0x8c, 0xff, 0x95, 0xff, 0xbe, 0xff, 0x0c, 0x00, + 0x5c, 0x00, 0x97, 0x00, 0xb9, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xd4, 0x00, + 0xe5, 0x00, 0xe0, 0x00, 0xd9, 0x00, 0xe8, 0x00, 0x11, 0x01, 0x3d, 0x01, + 0x4f, 0x01, 0x4d, 0x01, 0x4d, 0x01, 0x46, 0x01, 0x29, 0x01, 0xfc, 0x00, + 0xd0, 0x00, 0xb0, 0x00, 0x90, 0x00, 0x5d, 0x00, 0x1f, 0x00, 0xef, 0xff, + 0xd8, 0xff, 0xd4, 0xff, 0xd3, 0xff, 0xd0, 0xff, 0xd5, 0xff, 0xe1, 0xff, + 0xe3, 0xff, 0xdf, 0xff, 0xe6, 0xff, 0x00, 0x00, 0x17, 0x00, 0x15, 0x00, + 0x08, 0x00, 0x08, 0x00, 0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x01, 0x41, 0x01, 0x3b, 0x01, 0x24, 0x01, + 0xf4, 0x00, 0xad, 0x00, 0x5f, 0x00, 0x19, 0x00, 0xdd, 0xff, 0xb7, 0xff, + 0xb0, 0xff, 0xb2, 0xff, 0xa5, 0xff, 0x9c, 0xff, 0xad, 0xff, 0xdd, 0xff, + 0x18, 0x00, 0x42, 0x00, 0x5c, 0x00, 0x7e, 0x00, 0xb0, 0x00, 0xe5, 0x00, + 0x0a, 0x01, 0x1f, 0x01, 0x33, 0x01, 0x46, 0x01, 0x46, 0x01, 0x28, 0x01, + 0xef, 0x00, 0xa9, 0x00, 0x6a, 0x00, 0x3f, 0x00, 0x2e, 0x00, 0x24, 0x00, + 0x12, 0x00, 0xff, 0xff, 0xf0, 0xff, 0xd5, 0xff, 0xa8, 0xff, 0x7f, 0xff, + 0x6a, 0xff, 0x6c, 0xff, 0x7c, 0xff, 0x95, 0xff, 0xaa, 0xff, 0xb2, 0xff, + 0xb8, 0xff, 0xd0, 0xff, 0xf6, 0xff, 0x18, 0x00, 0x2b, 0x00, 0x39, 0x00, + 0x41, 0x00, 0x33, 0x00, 0x0a, 0x00, 0xd7, 0xff, 0xbc, 0xff, 0xd4, 0xff, + 0x11, 0x00, 0x45, 0x00, 0x50, 0x00, 0x38, 0x00, 0x23, 0x00, 0x22, 0x00, + 0x26, 0x00, 0x19, 0x00, 0xf3, 0xff, 0xc2, 0xff, 0x93, 0xff, 0x63, 0xff, + 0x3f, 0xff, 0x4b, 0xff, 0x8d, 0xff, 0xe2, 0xff, 0x27, 0x00, 0x4c, 0x00, + 0x61, 0x00, 0x76, 0x00, 0x8d, 0x00, 0xa0, 0x00, 0xa3, 0x00, 0x8d, 0x00, + 0x63, 0x00, 0x3f, 0x00, 0x31, 0x00, 0x30, 0x00, 0x2d, 0x00, 0x25, 0x00, + 0x1e, 0x00, 0x1e, 0x00, 0x21, 0x00, 0x25, 0x00, 0x1f, 0x00, 0x05, 0x00, + 0xe0, 0xff, 0xcc, 0xff, 0xdf, 0xff, 0x07, 0x00, 0x32, 0x00, 0x5d, 0x00, + 0x95, 0x00, 0xe5, 0x00, 0x3d, 0x01, 0x75, 0x01, 0x7a, 0x01, 0x55, 0x01, + 0x1a, 0x01, 0xdf, 0x00, 0xc0, 0x00, 0xc3, 0x00, 0xcb, 0x00, 0xc2, 0x00, + 0xac, 0x00, 0x9d, 0x00, 0xad, 0x00, 0xd5, 0x00, 0xfd, 0x00, 0x17, 0x01, + 0x20, 0x01, 0x0b, 0x01, 0xda, 0x00, 0x9f, 0x00, 0x80, 0x00, 0x92, 0x00, + 0xbb, 0x00, 0xd4, 0x00, 0xd4, 0x00, 0xbd, 0x00, 0xa1, 0x00, 0x8f, 0x00, + 0x88, 0x00, 0x8d, 0x00, 0x9a, 0x00, 0xa2, 0x00, 0x9f, 0x00, 0x9c, 0x00, + 0xa4, 0x00, 0xb7, 0x00, 0xc8, 0x00, 0xcf, 0x00, 0xd0, 0x00, 0xd1, 0x00, + 0xcd, 0x00, 0xb8, 0x00, 0x9e, 0x00, 0x9a, 0x00, 0xac, 0x00, 0xbf, 0x00, + 0xc7, 0x00, 0xbf, 0x00, 0xb1, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xa6, 0x00, + 0x97, 0x00, 0x78, 0x00, 0x59, 0x00, 0x57, 0x00, 0x6f, 0x00, 0x7a, 0x00, + 0x63, 0x00, 0x45, 0x00, 0x39, 0x00, 0x3c, 0x00, 0x48, 0x00, 0x56, 0x00, + 0x51, 0x00, 0x2d, 0x00, 0xfc, 0xff, 0xdb, 0xff, 0xd4, 0xff, 0xd2, 0xff, + 0xc0, 0xff, 0x93, 0xff, 0x4b, 0xff, 0x06, 0xff, 0xec, 0xfe, 0xfd, 0xfe, + 0x1d, 0xff, 0x33, 0xff, 0x32, 0xff, 0x1b, 0xff, 0xf2, 0xfe, 0xc1, 0xfe, + 0x9f, 0xfe, 0x96, 0xfe, 0xa1, 0xfe, 0xbc, 0xfe, 0xe1, 0xfe, 0x0d, 0xff, + 0x3f, 0xff, 0x71, 0xff, 0x9d, 0xff, 0xba, 0xff, 0xb9, 0xff, 0xa3, 0xff, + 0x86, 0xff, 0x60, 0xff, 0x2b, 0xff, 0xf5, 0xfe, 0xcc, 0xfe, 0xad, 0xfe, + 0x99, 0xfe, 0x91, 0xfe, 0x8f, 0xfe, 0x88, 0xfe, 0x7f, 0xfe, 0x7e, 0xfe, + 0x90, 0xfe, 0xb7, 0xfe, 0xea, 0xfe, 0x1d, 0xff, 0x42, 0xff, 0x58, 0xff, + 0x65, 0xff, 0x73, 0xff, 0x87, 0xff, 0xa5, 0xff, 0xc9, 0xff, 0xeb, 0xff, + 0x0a, 0x00, 0x26, 0x00, 0x2c, 0x00, 0x13, 0x00, 0xed, 0xff, 0xbf, 0xff, + 0x87, 0xff, 0x61, 0xff, 0x61, 0xff, 0x6f, 0xff, 0x72, 0xff, 0x60, 0xff, + 0x3e, 0xff, 0x1d, 0xff, 0x05, 0xff, 0xf4, 0xfe, 0xec, 0xfe, 0xf2, 0xfe, + 0x0b, 0xff, 0x40, 0xff, 0x89, 0xff, 0xc7, 0xff, 0xde, 0xff, 0xe4, 0xff, + 0x1f, 0x00, 0xa5, 0x00, 0x36, 0x01, 0x94, 0x01, 0xc1, 0x01, 0xc5, 0x01, + 0x8b, 0x01, 0x17, 0x01, 0xa7, 0x00, 0x73, 0x00, 0x70, 0x00, 0x7c, 0x00, + 0x82, 0x00, 0x70, 0x00, 0x3f, 0x00, 0xf4, 0xff, 0xa7, 0xff, 0x77, 0xff, + 0x73, 0xff, 0x99, 0xff, 0xd4, 0xff, 0xff, 0xff, 0x09, 0x00, 0xfd, 0xff, + 0xeb, 0xff, 0xe1, 0xff, 0xe6, 0xff, 0x00, 0x00, 0x3b, 0x00, 0x94, 0x00, + 0xe9, 0x00, 0x24, 0x01, 0x46, 0x01, 0x58, 0x01, 0x5e, 0x01, 0x53, 0x01, + 0x38, 0x01, 0x15, 0x01, 0xeb, 0x00, 0xb8, 0x00, 0x81, 0x00, 0x4b, 0x00, + 0x16, 0x00, 0xe6, 0xff, 0xbe, 0xff, 0x96, 0xff, 0x64, 0xff, 0x37, 0xff, + 0x1f, 0xff, 0x15, 0xff, 0x0e, 0xff, 0x0b, 0xff, 0x18, 0xff, 0x33, 0xff, + 0x4d, 0xff, 0x6c, 0xff, 0xa5, 0xff, 0xf1, 0xff, 0x34, 0x00, 0x63, 0x00, + 0x7d, 0x00, 0x8e, 0x00, 0xad, 0x00, 0xd5, 0x00, 0xed, 0x00, 0xea, 0x00, + 0xc8, 0x00, 0x90, 0x00, 0x53, 0x00, 0x19, 0x00, 0xee, 0xff, 0xe1, 0xff, + 0xe5, 0xff, 0xde, 0xff, 0xcd, 0xff, 0xc3, 0xff, 0xc1, 0xff, 0xc1, 0xff, + 0xba, 0xff, 0xa9, 0xff, 0x9a, 0xff, 0x91, 0xff, 0x89, 0xff, 0x7c, 0xff, + 0x74, 0xff, 0x7f, 0xff, 0x9b, 0xff, 0xbd, 0xff, 0xe6, 0xff, 0x12, 0x00, + 0x33, 0x00, 0x37, 0x00, 0x16, 0x00, 0xdb, 0xff, 0x9f, 0xff, 0x73, 0xff, + 0x5b, 0xff, 0x52, 0xff, 0x52, 0xff, 0x59, 0xff, 0x64, 0xff, 0x64, 0xff, + 0x50, 0xff, 0x23, 0xff, 0xec, 0xfe, 0xc6, 0xfe, 0xb5, 0xfe, 0xae, 0xfe, + 0xa4, 0xfe, 0x92, 0xfe, 0x85, 0xfe, 0x82, 0xfe, 0x84, 0xfe, 0x94, 0xfe, + 0xb9, 0xfe, 0xe7, 0xfe, 0x1e, 0xff, 0x5c, 0xff, 0x96, 0xff, 0xd0, 0xff, + 0x11, 0x00, 0x56, 0x00, 0x89, 0x00, 0x99, 0x00, 0x8a, 0x00, 0x62, 0x00, + 0x25, 0x00, 0xea, 0xff, 0xcc, 0xff, 0xcd, 0xff, 0xe6, 0xff, 0x0c, 0x00, + 0x2f, 0x00, 0x46, 0x00, 0x46, 0x00, 0x20, 0x00, 0xd6, 0xff, 0x7f, 0xff, + 0x38, 0xff, 0x0c, 0xff, 0xf7, 0xfe, 0x01, 0xff, 0x34, 0xff, 0x77, 0xff, + 0xaf, 0xff, 0xe0, 0xff, 0x11, 0x00, 0x35, 0x00, 0x45, 0x00, 0x4a, 0x00, + 0x4e, 0x00, 0x5b, 0x00, 0x7e, 0x00, 0x97, 0x00, 0x8d, 0x00, 0x83, 0x00, + 0x8e, 0x00, 0x7f, 0x00, 0x40, 0x00, 0x03, 0x00, 0xf1, 0xff, 0xf1, 0xff, + 0xd2, 0xff, 0x93, 0xff, 0x56, 0xff, 0x33, 0xff, 0x30, 0xff, 0x49, 0xff, + 0x70, 0xff, 0x88, 0xff, 0x7e, 0xff, 0x56, 0xff, 0x21, 0xff, 0xf5, 0xfe, + 0xea, 0xfe, 0x05, 0xff, 0x2c, 0xff, 0x54, 0xff, 0x93, 0xff, 0xf4, 0xff, + 0x64, 0x00, 0xd4, 0x00, 0x23, 0x01, 0x13, 0x01, 0x90, 0x00, 0xe0, 0xff, + 0x5f, 0xff, 0x30, 0xff, 0x4f, 0xff, 0xb1, 0xff, 0x43, 0x00, 0xca, 0x00, + 0x00, 0x01, 0xcb, 0x00, 0x4a, 0x00, 0xac, 0xff, 0x1e, 0xff, 0xdc, 0xfe, + 0x1d, 0xff, 0xc6, 0xff, 0x7a, 0x00, 0xe8, 0x00, 0xec, 0x00, 0x98, 0x00, + 0x2b, 0x00, 0xdd, 0xff, 0xd3, 0xff, 0x13, 0x00, 0x7c, 0x00, 0xe1, 0x00, + 0x29, 0x01, 0x45, 0x01, 0x40, 0x01, 0x31, 0x01, 0x23, 0x01, 0x1c, 0x01, + 0x21, 0x01, 0x22, 0x01, 0x1a, 0x01, 0x0a, 0x01, 0xfb, 0x00, 0xf9, 0x00, + 0x01, 0x01, 0xf5, 0x00, 0xcc, 0x00, 0xa3, 0x00, 0x90, 0x00, 0x83, 0x00, + 0x69, 0x00, 0x49, 0x00, 0x2f, 0x00, 0x29, 0x00, 0x46, 0x00, 0x80, 0x00, + 0xb8, 0x00, 0xcf, 0x00, 0xc6, 0x00, 0xc3, 0x00, 0xda, 0x00, 0xf0, 0x00, + 0xf4, 0x00, 0xf3, 0x00, 0xfa, 0x00, 0x06, 0x01, 0x00, 0x01, 0xdc, 0x00, + 0xb3, 0x00, 0x9c, 0x00, 0x9a, 0x00, 0xaa, 0x00, 0xc3, 0x00, 0xcb, 0x00, + 0xbd, 0x00, 0xa5, 0x00, 0x85, 0x00, 0x5a, 0x00, 0x2e, 0x00, 0x13, 0x00, + 0x15, 0x00, 0x30, 0x00, 0x5c, 0x00, 0x8b, 0x00, 0xb4, 0x00, 0xcb, 0x00, + 0xc3, 0x00, 0x92, 0x00, 0x4b, 0x00, 0x14, 0x00, 0x0d, 0x00, 0x31, 0x00, + 0x5c, 0x00, 0x71, 0x00, 0x6b, 0x00, 0x50, 0x00, 0x2c, 0x00, 0x10, 0x00, + 0x09, 0x00, 0x22, 0x00, 0x53, 0x00, 0x84, 0x00, 0x9e, 0x00, 0x99, 0x00, + 0x85, 0x00, 0x7a, 0x00, 0x83, 0x00, 0x90, 0x00, 0x97, 0x00, 0xa1, 0x00, + 0xad, 0x00, 0xa9, 0x00, 0x96, 0x00, 0x88, 0x00, 0x93, 0x00, 0xb7, 0x00, + 0xd4, 0x00, 0xd1, 0x00, 0xb2, 0x00, 0x8b, 0x00, 0x67, 0x00, 0x4f, 0x00, + 0x47, 0x00, 0x47, 0x00, 0x3f, 0x00, 0x2b, 0x00, 0x18, 0x00, 0x16, 0x00, + 0x24, 0x00, 0x39, 0x00, 0x61, 0x00, 0xa6, 0x00, 0xf4, 0x00, 0x37, 0x01, + 0x6a, 0x01, 0x8b, 0x01, 0xa1, 0x01, 0xaa, 0x01, 0x99, 0x01, 0x77, 0x01, + 0x64, 0x01, 0x6f, 0x01, 0x88, 0x01, 0x91, 0x01, 0x7d, 0x01, 0x51, 0x01, + 0x0f, 0x01, 0xc9, 0x00, 0x92, 0x00, 0x6c, 0x00, 0x50, 0x00, 0x36, 0x00, + 0x1a, 0x00, 0x0b, 0x00, 0x11, 0x00, 0x24, 0x00, 0x47, 0x00, 0x7f, 0x00, + 0xb5, 0x00, 0xd0, 0x00, 0xd4, 0x00, 0xdb, 0x00, 0xf0, 0x00, 0x11, 0x01, + 0x3d, 0x01, 0x61, 0x01, 0x6a, 0x01, 0x5a, 0x01, 0x3b, 0x01, 0x12, 0x01, + 0xdd, 0x00, 0x9c, 0x00, 0x6b, 0x00, 0x55, 0x00, 0x3e, 0x00, 0x20, 0x00, + 0x15, 0x00, 0x1d, 0x00, 0x1e, 0x00, 0x0b, 0x00, 0xf2, 0xff, 0xec, 0xff, + 0x01, 0x00, 0x19, 0x00, 0x15, 0x00, 0xf6, 0xff, 0xdc, 0xff, 0xda, 0xff, + 0xe7, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x44, 0x00, 0x5f, 0x00, 0x6c, 0x00, + 0x67, 0x00, 0x56, 0x00, 0x4b, 0x00, 0x50, 0x00, 0x5e, 0x00, 0x5d, 0x00, + 0x49, 0x00, 0x2e, 0x00, 0x0f, 0x00, 0xde, 0xff, 0xa3, 0xff, 0x70, 0xff, + 0x47, 0xff, 0x21, 0xff, 0x0a, 0xff, 0x08, 0xff, 0x0d, 0xff, 0x0d, 0xff, + 0x0b, 0xff, 0x14, 0xff, 0x29, 0xff, 0x42, 0xff, 0x57, 0xff, 0x68, 0xff, + 0x76, 0xff, 0x8c, 0xff, 0xa5, 0xff, 0xb2, 0xff, 0xae, 0xff, 0x99, 0xff, + 0x7a, 0xff, 0x60, 0xff, 0x59, 0xff, 0x63, 0xff, 0x71, 0xff, 0x74, 0xff, + 0x6b, 0xff, 0x59, 0xff, 0x45, 0xff, 0x3a, 0xff, 0x3e, 0xff, 0x4d, 0xff, + 0x58, 0xff, 0x50, 0xff, 0x39, 0xff, 0x24, 0xff, 0x1f, 0xff, 0x28, 0xff, + 0x2d, 0xff, 0x23, 0xff, 0x15, 0xff, 0x10, 0xff, 0x1e, 0xff, 0x46, 0xff, + 0x80, 0xff, 0xb9, 0xff, 0xee, 0xff, 0x17, 0x00, 0x1c, 0x00, 0xf2, 0xff, + 0xbc, 0xff, 0xb1, 0xff, 0xe5, 0xff, 0x34, 0x00, 0x68, 0x00, 0x65, 0x00, + 0x3d, 0x00, 0x08, 0x00, 0xcb, 0xff, 0x8c, 0xff, 0x66, 0xff, 0x68, 0xff, + 0x91, 0xff, 0xc6, 0xff, 0xd5, 0xff, 0xa8, 0xff, 0x57, 0xff, 0x0a, 0xff, + 0xdf, 0xfe, 0xdd, 0xfe, 0x0d, 0xff, 0x73, 0xff, 0xea, 0xff, 0x34, 0x00, + 0x38, 0x00, 0x0a, 0x00, 0xd8, 0xff, 0xc5, 0xff, 0xd5, 0xff, 0xf1, 0xff, + 0x0b, 0x00, 0x1d, 0x00, 0x2d, 0x00, 0x40, 0x00, 0x60, 0x00, 0x8d, 0x00, + 0xb3, 0x00, 0xb7, 0x00, 0x8e, 0x00, 0x49, 0x00, 0x06, 0x00, 0xd1, 0xff, + 0xaa, 0xff, 0x92, 0xff, 0x85, 0xff, 0x7f, 0xff, 0x7b, 0xff, 0x75, 0xff, + 0x67, 0xff, 0x4d, 0xff, 0x35, 0xff, 0x32, 0xff, 0x4a, 0xff, 0x77, 0xff, + 0xae, 0xff, 0xd8, 0xff, 0xe6, 0xff, 0xdd, 0xff, 0xc5, 0xff, 0xa4, 0xff, + 0x8e, 0xff, 0x90, 0xff, 0xa6, 0xff, 0xcf, 0xff, 0x01, 0x00, 0x21, 0x00, + 0x1f, 0x00, 0xfe, 0xff, 0xc6, 0xff, 0x77, 0xff, 0x26, 0xff, 0xf4, 0xfe, + 0xf5, 0xfe, 0x18, 0xff, 0x39, 0xff, 0x43, 0xff, 0x30, 0xff, 0x06, 0xff, + 0xd4, 0xfe, 0xaa, 0xfe, 0x8c, 0xfe, 0x7b, 0xfe, 0x74, 0xfe, 0x77, 0xfe, + 0x89, 0xfe, 0xa2, 0xfe, 0xb2, 0xfe, 0xb3, 0xfe, 0xaa, 0xfe, 0xac, 0xfe, + 0xc8, 0xfe, 0xfd, 0xfe, 0x37, 0xff, 0x6b, 0xff, 0x92, 0xff, 0xac, 0xff, + 0xb0, 0xff, 0x94, 0xff, 0x56, 0xff, 0x0a, 0xff, 0xc4, 0xfe, 0x8f, 0xfe, + 0x75, 0xfe, 0x74, 0xfe, 0x82, 0xfe, 0x92, 0xfe, 0x9f, 0xfe, 0xa7, 0xfe, + 0xb5, 0xfe, 0xd5, 0xfe, 0x03, 0xff, 0x37, 0xff, 0x67, 0xff, 0x8b, 0xff, + 0xa8, 0xff, 0xc6, 0xff, 0xe6, 0xff, 0xfd, 0xff, 0x02, 0x00, 0x06, 0x00, + 0x1b, 0x00, 0x39, 0x00, 0x55, 0x00, 0x75, 0x00, 0x92, 0x00, 0x99, 0x00, + 0x85, 0x00, 0x62, 0x00, 0x3a, 0x00, 0x19, 0x00, 0x08, 0x00, 0x04, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x12, 0x00, 0x28, 0x00, 0x3c, 0x00, 0x48, 0x00, + 0x4c, 0x00, 0x49, 0x00, 0x3d, 0x00, 0x2a, 0x00, 0x0c, 0x00, 0xe1, 0xff, + 0xbb, 0xff, 0xb1, 0xff, 0xc1, 0xff, 0xe2, 0xff, 0x12, 0x00, 0x43, 0x00, + 0x66, 0x00, 0x7c, 0x00, 0x87, 0x00, 0x8c, 0x00, 0x91, 0x00, 0x98, 0x00, + 0x95, 0x00, 0x7f, 0x00, 0x63, 0x00, 0x50, 0x00, 0x46, 0x00, 0x3f, 0x00, + 0x41, 0x00, 0x52, 0x00, 0x6b, 0x00, 0x7e, 0x00, 0x8d, 0x00, 0x95, 0x00, + 0x8e, 0x00, 0x82, 0x00, 0x7f, 0x00, 0x81, 0x00, 0x7f, 0x00, 0x77, 0x00, + 0x63, 0x00, 0x44, 0x00, 0x2b, 0x00, 0x24, 0x00, 0x27, 0x00, 0x1f, 0x00, + 0x09, 0x00, 0xfb, 0xff, 0x03, 0x00, 0x18, 0x00, 0x2d, 0x00, 0x38, 0x00, + 0x37, 0x00, 0x28, 0x00, 0x0b, 0x00, 0xe9, 0xff, 0xd3, 0xff, 0xcf, 0xff, + 0xd4, 0xff, 0xd3, 0xff, 0xc9, 0xff, 0xb7, 0xff, 0xa8, 0xff, 0xa1, 0xff, + 0xa3, 0xff, 0xae, 0xff, 0xc4, 0xff, 0xdf, 0xff, 0xf9, 0xff, 0x0a, 0x00, + 0x0a, 0x00, 0x04, 0x00, 0xfc, 0xff, 0xeb, 0xff, 0xce, 0xff, 0xb3, 0xff, + 0xa0, 0xff, 0x96, 0xff, 0x99, 0xff, 0xb3, 0xff, 0xdb, 0xff, 0xf3, 0xff, + 0xf0, 0xff, 0xe0, 0xff, 0xcf, 0xff, 0xc4, 0xff, 0xcc, 0xff, 0xeb, 0xff, + 0x18, 0x00, 0x3d, 0x00, 0x45, 0x00, 0x36, 0x00, 0x2f, 0x00, 0x3e, 0x00, + 0x58, 0x00, 0x6d, 0x00, 0x7c, 0x00, 0x87, 0x00, 0x93, 0x00, 0xae, 0x00, + 0xd3, 0x00, 0xf7, 0x00, 0x14, 0x01, 0x25, 0x01, 0x22, 0x01, 0x09, 0x01, + 0xe3, 0x00, 0xc2, 0x00, 0xa8, 0x00, 0x91, 0x00, 0x7a, 0x00, 0x65, 0x00, + 0x4e, 0x00, 0x37, 0x00, 0x27, 0x00, 0x25, 0x00, 0x2d, 0x00, 0x34, 0x00, + 0x3c, 0x00, 0x4d, 0x00, 0x6b, 0x00, 0x8f, 0x00, 0xa8, 0x00, 0xb1, 0x00, + 0xb1, 0x00, 0xb1, 0x00, 0xb2, 0x00, 0xbc, 0x00, 0xdc, 0x00, 0x0d, 0x01, + 0x36, 0x01, 0x47, 0x01, 0x46, 0x01, 0x3a, 0x01, 0x24, 0x01, 0x00, 0x01, + 0xce, 0x00, 0x9c, 0x00, 0x79, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x71, 0x00, + 0x65, 0x00, 0x50, 0x00, 0x41, 0x00, 0x49, 0x00, 0x6a, 0x00, 0x8d, 0x00, + 0x9c, 0x00, 0x9a, 0x00, 0x98, 0x00, 0xa1, 0x00, 0xb3, 0x00, 0xc2, 0x00, + 0xc6, 0x00, 0xbc, 0x00, 0xa8, 0x00, 0x8d, 0x00, 0x74, 0x00, 0x64, 0x00, + 0x59, 0x00, 0x4d, 0x00, 0x44, 0x00, 0x40, 0x00, 0x3d, 0x00, 0x36, 0x00, + 0x32, 0x00, 0x2a, 0x00, 0x11, 0x00, 0xe8, 0xff, 0xc1, 0xff, 0xa4, 0xff, + 0x88, 0xff, 0x6d, 0xff, 0x5a, 0xff, 0x52, 0xff, 0x4c, 0xff, 0x42, 0xff, + 0x3a, 0xff, 0x3f, 0xff, 0x56, 0xff, 0x72, 0xff, 0x8b, 0xff, 0xa3, 0xff, + 0xc4, 0xff, 0xe9, 0xff, 0x05, 0x00, 0x10, 0x00, 0x0d, 0x00, 0x04, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xfc, 0xff, 0xf7, 0xff, 0xee, 0xff, 0xdf, 0xff, + 0xc6, 0xff, 0xae, 0xff, 0xa0, 0xff, 0x97, 0xff, 0x8a, 0xff, 0x80, 0xff, + 0x85, 0xff, 0x93, 0xff, 0x9d, 0xff, 0xa5, 0xff, 0xb1, 0xff, 0xb9, 0xff, + 0xb3, 0xff, 0xa4, 0xff, 0x9a, 0xff, 0x9d, 0xff, 0xa4, 0xff, 0xa8, 0xff, + 0xb0, 0xff, 0xc3, 0xff, 0xe9, 0xff, 0x1d, 0x00, 0x47, 0x00, 0x51, 0x00, + 0x3e, 0x00, 0x1c, 0x00, 0xfb, 0xff, 0xe8, 0xff, 0xeb, 0xff, 0xfc, 0xff, + 0x13, 0x00, 0x2d, 0x00, 0x47, 0x00, 0x5b, 0x00, 0x66, 0x00, 0x69, 0x00, + 0x63, 0x00, 0x5b, 0x00, 0x59, 0x00, 0x5e, 0x00, 0x5f, 0x00, 0x55, 0x00, + 0x48, 0x00, 0x43, 0x00, 0x4a, 0x00, 0x56, 0x00, 0x65, 0x00, 0x7d, 0x00, + 0xa4, 0x00, 0xd0, 0x00, 0xf5, 0x00, 0x08, 0x01, 0x04, 0x01, 0xf0, 0x00, + 0xd4, 0x00, 0xb9, 0x00, 0x9a, 0x00, 0x6f, 0x00, 0x3c, 0x00, 0x0c, 0x00, + 0xe6, 0xff, 0xcd, 0xff, 0xc2, 0xff, 0xc3, 0xff, 0xc5, 0xff, 0xc1, 0xff, + 0xbe, 0xff, 0xc4, 0xff, 0xd1, 0xff, 0xde, 0xff, 0xe1, 0xff, 0xd8, 0xff, + 0xca, 0xff, 0xc5, 0xff, 0xcf, 0xff, 0xe5, 0xff, 0x02, 0x00, 0x25, 0x00, + 0x46, 0x00, 0x59, 0x00, 0x61, 0x00, 0x65, 0x00, 0x5f, 0x00, 0x44, 0x00, + 0x16, 0x00, 0xe4, 0xff, 0xb9, 0xff, 0x92, 0xff, 0x6e, 0xff, 0x52, 0xff, + 0x3d, 0xff, 0x35, 0xff, 0x3e, 0xff, 0x59, 0xff, 0x78, 0xff, 0x8d, 0xff, + 0x98, 0xff, 0x9a, 0xff, 0x8c, 0xff, 0x6c, 0xff, 0x46, 0xff, 0x2a, 0xff, + 0x1d, 0xff, 0x1d, 0xff, 0x29, 0xff, 0x3f, 0xff, 0x55, 0xff, 0x60, 0xff, + 0x5c, 0xff, 0x48, 0xff, 0x2a, 0xff, 0x11, 0xff, 0x09, 0xff, 0x16, 0xff, + 0x2c, 0xff, 0x37, 0xff, 0x30, 0xff, 0x23, 0xff, 0x2a, 0xff, 0x48, 0xff, + 0x68, 0xff, 0x7b, 0xff, 0x80, 0xff, 0x78, 0xff, 0x6a, 0xff, 0x63, 0xff, + 0x68, 0xff, 0x70, 0xff, 0x74, 0xff, 0x76, 0xff, 0x70, 0xff, 0x5a, 0xff, + 0x3c, 0xff, 0x23, 0xff, 0x15, 0xff, 0x16, 0xff, 0x22, 0xff, 0x2a, 0xff, + 0x2d, 0xff, 0x3b, 0xff, 0x5d, 0xff, 0x85, 0xff, 0x9c, 0xff, 0x96, 0xff, + 0x75, 0xff, 0x48, 0xff, 0x26, 0xff, 0x25, 0xff, 0x4a, 0xff, 0x8a, 0xff, + 0xcb, 0xff, 0xf2, 0xff, 0xfa, 0xff, 0xf2, 0xff, 0xe8, 0xff, 0xe2, 0xff, + 0xdb, 0xff, 0xcc, 0xff, 0xb6, 0xff, 0x9f, 0xff, 0x89, 0xff, 0x73, 0xff, + 0x64, 0xff, 0x64, 0xff, 0x71, 0xff, 0x85, 0xff, 0x9b, 0xff, 0xaf, 0xff, + 0xbc, 0xff, 0xc2, 0xff, 0xc2, 0xff, 0xb8, 0xff, 0xa2, 0xff, 0x8c, 0xff, + 0x7e, 0xff, 0x79, 0xff, 0x7e, 0xff, 0x91, 0xff, 0xab, 0xff, 0xc1, 0xff, + 0xd0, 0xff, 0xdf, 0xff, 0xee, 0xff, 0xfa, 0xff, 0xfd, 0xff, 0xfd, 0xff, + 0x02, 0x00, 0x06, 0x00, 0xfe, 0xff, 0xe4, 0xff, 0xc1, 0xff, 0xa2, 0xff, + 0x92, 0xff, 0x8d, 0xff, 0x88, 0xff, 0x81, 0xff, 0x89, 0xff, 0xa8, 0xff, + 0xcf, 0xff, 0xe7, 0xff, 0xe8, 0xff, 0xdc, 0xff, 0xcf, 0xff, 0xc8, 0xff, + 0xc0, 0xff, 0xae, 0xff, 0x95, 0xff, 0x80, 0xff, 0x75, 0xff, 0x7a, 0xff, + 0x98, 0xff, 0xce, 0xff, 0x04, 0x00, 0x25, 0x00, 0x30, 0x00, 0x2a, 0x00, + 0x19, 0x00, 0x07, 0x00, 0xfe, 0xff, 0xfd, 0xff, 0xfa, 0xff, 0xf4, 0xff, + 0xf2, 0xff, 0xfb, 0xff, 0x0b, 0x00, 0x17, 0x00, 0x1e, 0x00, 0x23, 0x00, + 0x29, 0x00, 0x31, 0x00, 0x41, 0x00, 0x55, 0x00, 0x61, 0x00, 0x5c, 0x00, + 0x49, 0x00, 0x35, 0x00, 0x2c, 0x00, 0x33, 0x00, 0x43, 0x00, 0x4f, 0x00, + 0x54, 0x00, 0x55, 0x00, 0x55, 0x00, 0x57, 0x00, 0x5b, 0x00, 0x5b, 0x00, + 0x53, 0x00, 0x46, 0x00, 0x39, 0x00, 0x29, 0x00, 0x18, 0x00, 0x0f, 0x00, + 0x14, 0x00, 0x24, 0x00, 0x39, 0x00, 0x4c, 0x00, 0x5d, 0x00, 0x72, 0x00, + 0x8c, 0x00, 0x9f, 0x00, 0xa0, 0x00, 0x93, 0x00, 0x86, 0x00, 0x82, 0x00, + 0x81, 0x00, 0x80, 0x00, 0x7b, 0x00, 0x6f, 0x00, 0x5b, 0x00, 0x4c, 0x00, + 0x55, 0x00, 0x6f, 0x00, 0x80, 0x00, 0x7d, 0x00, 0x72, 0x00, 0x71, 0x00, + 0x72, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x5e, 0x00, 0x60, 0x00, 0x69, 0x00, + 0x7b, 0x00, 0x9a, 0x00, 0xc6, 0x00, 0xee, 0x00, 0x03, 0x01, 0x08, 0x01, + 0x09, 0x01, 0x07, 0x01, 0x00, 0x01, 0xee, 0x00, 0xd0, 0x00, 0xaf, 0x00, + 0x93, 0x00, 0x81, 0x00, 0x72, 0x00, 0x65, 0x00, 0x5f, 0x00, 0x5d, 0x00, + 0x56, 0x00, 0x4d, 0x00, 0x48, 0x00, 0x49, 0x00, 0x51, 0x00, 0x60, 0x00, + 0x76, 0x00, 0x92, 0x00, 0xb1, 0x00, 0xd0, 0x00, 0xed, 0x00, 0x05, 0x01, + 0x1a, 0x01, 0x2a, 0x01, 0x35, 0x01, 0x3d, 0x01, 0x3d, 0x01, 0x34, 0x01, + 0x21, 0x01, 0x07, 0x01, 0xe8, 0x00, 0xc9, 0x00, 0xac, 0x00, 0x8f, 0x00, + 0x73, 0x00, 0x5c, 0x00, 0x48, 0x00, 0x38, 0x00, 0x30, 0x00, 0x35, 0x00, + 0x3c, 0x00, 0x3f, 0x00, 0x3c, 0x00, 0x2f, 0x00, 0x16, 0x00, 0x01, 0x00, + 0xf9, 0xff, 0xf7, 0xff, 0xee, 0xff, 0xe3, 0xff, 0xe2, 0xff, 0xf4, 0xff, + 0x19, 0x00, 0x43, 0x00, 0x64, 0x00, 0x76, 0x00, 0x87, 0x00, 0x9c, 0x00, + 0xa7, 0x00, 0xa1, 0x00, 0x93, 0x00, 0x87, 0x00, 0x74, 0x00, 0x55, 0x00, + 0x2f, 0x00, 0x0c, 0x00, 0xf1, 0xff, 0xd9, 0xff, 0xbe, 0xff, 0x9b, 0xff, + 0x78, 0xff, 0x5f, 0xff, 0x55, 0xff, 0x54, 0xff, 0x5e, 0xff, 0x70, 0xff, + 0x84, 0xff, 0x9b, 0xff, 0xb9, 0xff, 0xd9, 0xff, 0xf5, 0xff, 0x10, 0x00, + 0x31, 0x00, 0x54, 0x00, 0x75, 0x00, 0x97, 0x00, 0xaf, 0x00, 0xb1, 0x00, + 0x9c, 0x00, 0x7a, 0x00, 0x59, 0x00, 0x3a, 0x00, 0x1f, 0x00, 0x08, 0x00, + 0xf4, 0xff, 0xe4, 0xff, 0xd9, 0xff, 0xd2, 0xff, 0xd6, 0xff, 0xe5, 0xff, + 0xef, 0xff, 0xeb, 0xff, 0xe0, 0xff, 0xda, 0xff, 0xd5, 0xff, 0xce, 0xff, + 0xc8, 0xff, 0xc8, 0xff, 0xd2, 0xff, 0xec, 0xff, 0x16, 0x00, 0x45, 0x00, + 0x6e, 0x00, 0x8d, 0x00, 0x9b, 0x00, 0x95, 0x00, 0x7b, 0x00, 0x55, 0x00, + 0x2c, 0x00, 0x08, 0x00, 0xee, 0xff, 0xdf, 0xff, 0xdb, 0xff, 0xdd, 0xff, + 0xdd, 0xff, 0xdb, 0xff, 0xda, 0xff, 0xe1, 0xff, 0xf0, 0xff, 0xfd, 0xff, + 0x02, 0x00, 0x01, 0x00, 0x06, 0x00, 0x16, 0x00, 0x2c, 0x00, 0x43, 0x00, + 0x5b, 0x00, 0x72, 0x00, 0x82, 0x00, 0x8a, 0x00, 0x89, 0x00, 0x87, 0x00, + 0x88, 0x00, 0x88, 0x00, 0x7d, 0x00, 0x67, 0x00, 0x50, 0x00, 0x38, 0x00, + 0x1e, 0x00, 0x09, 0x00, 0x01, 0x00, 0xff, 0xff, 0xf9, 0xff, 0xed, 0xff, + 0xdd, 0xff, 0xc9, 0xff, 0xb7, 0xff, 0xab, 0xff, 0xa1, 0xff, 0x9a, 0xff, + 0xa2, 0xff, 0xbc, 0xff, 0xdc, 0xff, 0xf9, 0xff, 0x14, 0x00, 0x31, 0x00, + 0x4f, 0x00, 0x63, 0x00, 0x6b, 0x00, 0x68, 0x00, 0x5f, 0x00, 0x55, 0x00, + 0x50, 0x00, 0x49, 0x00, 0x30, 0x00, 0x0b, 0x00, 0xee, 0xff, 0xdd, 0xff, + 0xca, 0xff, 0xaf, 0xff, 0x94, 0xff, 0x7c, 0xff, 0x66, 0xff, 0x5b, 0xff, + 0x60, 0xff, 0x6d, 0xff, 0x77, 0xff, 0x82, 0xff, 0x93, 0xff, 0xa8, 0xff, + 0xc0, 0xff, 0xd8, 0xff, 0xe6, 0xff, 0xed, 0xff, 0xfb, 0xff, 0x1d, 0x00, + 0x47, 0x00, 0x69, 0x00, 0x78, 0x00, 0x78, 0x00, 0x75, 0x00, 0x71, 0x00, + 0x67, 0x00, 0x61, 0x00, 0x68, 0x00, 0x6d, 0x00, 0x5d, 0x00, 0x3e, 0x00, + 0x27, 0x00, 0x17, 0x00, 0x00, 0x00, 0xde, 0xff, 0xbf, 0xff, 0xb1, 0xff, + 0xb7, 0xff, 0xc2, 0xff, 0xc8, 0xff, 0xca, 0xff, 0xd2, 0xff, 0xe1, 0xff, + 0xf4, 0xff, 0x04, 0x00, 0x10, 0x00, 0x19, 0x00, 0x25, 0x00, 0x39, 0x00, + 0x50, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x75, 0x00, 0x78, 0x00, 0x71, 0x00, + 0x61, 0x00, 0x52, 0x00, 0x43, 0x00, 0x2c, 0x00, 0x10, 0x00, 0xfa, 0xff, + 0xef, 0xff, 0xe7, 0xff, 0xe4, 0xff, 0xef, 0xff, 0x03, 0x00, 0x11, 0x00, + 0x14, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, + 0x20, 0x00, 0x3a, 0x00, 0x56, 0x00, 0x73, 0x00, 0x8c, 0x00, 0x93, 0x00, + 0x83, 0x00, 0x65, 0x00, 0x4b, 0x00, 0x3e, 0x00, 0x35, 0x00, 0x26, 0x00, + 0x12, 0x00, 0x00, 0x00, 0xf4, 0xff, 0xec, 0xff, 0xe8, 0xff, 0xe3, 0xff, + 0xd5, 0xff, 0xb7, 0xff, 0x92, 0xff, 0x72, 0xff, 0x5d, 0xff, 0x4d, 0xff, + 0x40, 0xff, 0x37, 0xff, 0x32, 0xff, 0x33, 0xff, 0x40, 0xff, 0x5f, 0xff, + 0x8d, 0xff, 0xc3, 0xff, 0xf8, 0xff, 0x1b, 0x00, 0x28, 0x00, 0x2d, 0x00, + 0x34, 0x00, 0x39, 0x00, 0x35, 0x00, 0x2d, 0x00, 0x22, 0x00, 0x15, 0x00, + 0x0a, 0x00, 0x02, 0x00, 0x01, 0x00, 0x07, 0x00, 0x11, 0x00, 0x13, 0x00, + 0x06, 0x00, 0xec, 0xff, 0xcb, 0xff, 0xa4, 0xff, 0x7e, 0xff, 0x61, 0xff, + 0x50, 0xff, 0x4a, 0xff, 0x51, 0xff, 0x67, 0xff, 0x86, 0xff, 0x9f, 0xff, + 0xa9, 0xff, 0xa6, 0xff, 0xa6, 0xff, 0xac, 0xff, 0xb0, 0xff, 0xaf, 0xff, + 0xb6, 0xff, 0xc5, 0xff, 0xcc, 0xff, 0xc4, 0xff, 0xbe, 0xff, 0xc4, 0xff, + 0xcc, 0xff, 0xcf, 0xff, 0xca, 0xff, 0xbd, 0xff, 0xa9, 0xff, 0x96, 0xff, + 0x89, 0xff, 0x7d, 0xff, 0x6a, 0xff, 0x4e, 0xff, 0x31, 0xff, 0x1f, 0xff, + 0x1e, 0xff, 0x30, 0xff, 0x47, 0xff, 0x59, 0xff, 0x68, 0xff, 0x82, 0xff, + 0xab, 0xff, 0xd2, 0xff, 0xeb, 0xff, 0xfa, 0xff, 0x07, 0x00, 0x11, 0x00, + 0x17, 0x00, 0x1a, 0x00, 0x1a, 0x00, 0x15, 0x00, 0x0d, 0x00, 0xff, 0xff, + 0xe8, 0xff, 0xce, 0xff, 0xbb, 0xff, 0xb1, 0xff, 0xab, 0xff, 0xa3, 0xff, + 0x97, 0xff, 0x8b, 0xff, 0x81, 0xff, 0x7a, 0xff, 0x72, 0xff, 0x68, 0xff, + 0x63, 0xff, 0x68, 0xff, 0x77, 0xff, 0x86, 0xff, 0x94, 0xff, 0xa2, 0xff, + 0xb2, 0xff, 0xc4, 0xff, 0xd6, 0xff, 0xe5, 0xff, 0xef, 0xff, 0xf5, 0xff, + 0xf7, 0xff, 0xf6, 0xff, 0xf5, 0xff, 0xf4, 0xff, 0xed, 0xff, 0xde, 0xff, + 0xcd, 0xff, 0xc2, 0xff, 0xba, 0xff, 0xb0, 0xff, 0xa4, 0xff, 0x97, 0xff, + 0x86, 0xff, 0x70, 0xff, 0x5f, 0xff, 0x5d, 0xff, 0x69, 0xff, 0x78, 0xff, + 0x82, 0xff, 0x84, 0xff, 0x84, 0xff, 0x83, 0xff, 0x81, 0xff, 0x7b, 0xff, + 0x74, 0xff, 0x74, 0xff, 0x7d, 0xff, 0x87, 0xff, 0x8d, 0xff, 0x92, 0xff, + 0x93, 0xff, 0x8c, 0xff, 0x84, 0xff, 0x84, 0xff, 0x8c, 0xff, 0x91, 0xff, + 0x92, 0xff, 0x92, 0xff, 0x8f, 0xff, 0x8a, 0xff, 0x85, 0xff, 0x84, 0xff, + 0x7d, 0xff, 0x6e, 0xff, 0x5e, 0xff, 0x56, 0xff, 0x55, 0xff, 0x58, 0xff, + 0x5c, 0xff, 0x65, 0xff, 0x70, 0xff, 0x7b, 0xff, 0x86, 0xff, 0x93, 0xff, + 0xa5, 0xff, 0xb8, 0xff, 0xc4, 0xff, 0xc4, 0xff, 0xc5, 0xff, 0xd0, 0xff, + 0xde, 0xff, 0xe4, 0xff, 0xec, 0xff, 0xfb, 0xff, 0x00, 0x00, 0xee, 0xff, + 0xdd, 0xff, 0xe0, 0xff, 0xe4, 0xff, 0xd1, 0xff, 0xbb, 0xff, 0xbb, 0xff, + 0xc6, 0xff, 0xc5, 0xff, 0xc0, 0xff, 0xc6, 0xff, 0xcd, 0xff, 0xc5, 0xff, + 0xb6, 0xff, 0xb1, 0xff, 0xb9, 0xff, 0xcc, 0xff, 0xe6, 0xff, 0xff, 0xff, + 0x11, 0x00, 0x1e, 0x00, 0x2c, 0x00, 0x39, 0x00, 0x3e, 0x00, 0x39, 0x00, + 0x2f, 0x00, 0x25, 0x00, 0x17, 0x00, 0x02, 0x00, 0xed, 0xff, 0xe2, 0xff, + 0xe6, 0xff, 0xf1, 0xff, 0xfd, 0xff, 0x07, 0x00, 0x0c, 0x00, 0x0e, 0x00, + 0x11, 0x00, 0x17, 0x00, 0x1b, 0x00, 0x13, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x11, 0x00, 0x25, 0x00, 0x39, 0x00, 0x49, 0x00, 0x54, 0x00, + 0x57, 0x00, 0x54, 0x00, 0x4e, 0x00, 0x48, 0x00, 0x3f, 0x00, 0x2f, 0x00, + 0x1a, 0x00, 0x05, 0x00, 0xf2, 0xff, 0xdf, 0xff, 0xcd, 0xff, 0xbd, 0xff, + 0xb0, 0xff, 0xaa, 0xff, 0xad, 0xff, 0xba, 0xff, 0xca, 0xff, 0xda, 0xff, + 0xe4, 0xff, 0xe4, 0xff, 0xd9, 0xff, 0xcc, 0xff, 0xca, 0xff, 0xd7, 0xff, + 0xed, 0xff, 0x01, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x19, 0x00, 0x2b, 0x00, + 0x3e, 0x00, 0x46, 0x00, 0x42, 0x00, 0x39, 0x00, 0x31, 0x00, 0x26, 0x00, + 0x16, 0x00, 0x05, 0x00, 0xfc, 0xff, 0xfd, 0xff, 0x02, 0x00, 0xfe, 0xff, + 0xf1, 0xff, 0xe4, 0xff, 0xde, 0xff, 0xde, 0xff, 0xe3, 0xff, 0xeb, 0xff, + 0xf6, 0xff, 0x05, 0x00, 0x19, 0x00, 0x2d, 0x00, 0x39, 0x00, 0x3e, 0x00, + 0x45, 0x00, 0x54, 0x00, 0x66, 0x00, 0x74, 0x00, 0x80, 0x00, 0x87, 0x00, + 0x85, 0x00, 0x7a, 0x00, 0x72, 0x00, 0x73, 0x00, 0x75, 0x00, 0x70, 0x00, + 0x66, 0x00, 0x59, 0x00, 0x4a, 0x00, 0x3d, 0x00, 0x33, 0x00, 0x2c, 0x00, + 0x28, 0x00, 0x24, 0x00, 0x1c, 0x00, 0x0d, 0x00, 0xfd, 0xff, 0xf5, 0xff, + 0xf9, 0xff, 0x09, 0x00, 0x24, 0x00, 0x45, 0x00, 0x65, 0x00, 0x7b, 0x00, + 0x86, 0x00, 0x8a, 0x00, 0x91, 0x00, 0x99, 0x00, 0x98, 0x00, 0x8a, 0x00, + 0x7a, 0x00, 0x75, 0x00, 0x7b, 0x00, 0x80, 0x00, 0x78, 0x00, 0x66, 0x00, + 0x53, 0x00, 0x41, 0x00, 0x2d, 0x00, 0x16, 0x00, 0x02, 0x00, 0xf8, 0xff, + 0xf4, 0xff, 0xee, 0xff, 0xe5, 0xff, 0xdf, 0xff, 0xe3, 0xff, 0xee, 0xff, + 0xfc, 0xff, 0x0a, 0x00, 0x18, 0x00, 0x27, 0x00, 0x39, 0x00, 0x4d, 0x00, + 0x5d, 0x00, 0x68, 0x00, 0x70, 0x00, 0x79, 0x00, 0x7f, 0x00, 0x7f, 0x00, + 0x7f, 0x00, 0x7e, 0x00, 0x79, 0x00, 0x71, 0x00, 0x6d, 0x00, 0x69, 0x00, + 0x5c, 0x00, 0x48, 0x00, 0x36, 0x00, 0x27, 0x00, 0x1b, 0x00, 0x13, 0x00, + 0x0d, 0x00, 0x05, 0x00, 0xfa, 0xff, 0xee, 0xff, 0xe6, 0xff, 0xe3, 0xff, + 0xeb, 0xff, 0x00, 0x00, 0x1e, 0x00, 0x39, 0x00, 0x49, 0x00, 0x4c, 0x00, + 0x4d, 0x00, 0x50, 0x00, 0x57, 0x00, 0x5e, 0x00, 0x62, 0x00, 0x5f, 0x00, + 0x5a, 0x00, 0x56, 0x00, 0x53, 0x00, 0x4f, 0x00, 0x49, 0x00, 0x44, 0x00, + 0x3d, 0x00, 0x32, 0x00, 0x25, 0x00, 0x1a, 0x00, 0x12, 0x00, 0x08, 0x00, + 0xfb, 0xff, 0xf2, 0xff, 0xee, 0xff, 0xee, 0xff, 0xec, 0xff, 0xed, 0xff, + 0xf9, 0xff, 0x0f, 0x00, 0x26, 0x00, 0x39, 0x00, 0x4a, 0x00, 0x5c, 0x00, + 0x6f, 0x00, 0x80, 0x00, 0x86, 0x00, 0x81, 0x00, 0x78, 0x00, 0x76, 0x00, + 0x7b, 0x00, 0x81, 0x00, 0x80, 0x00, 0x74, 0x00, 0x61, 0x00, 0x54, 0x00, + 0x53, 0x00, 0x55, 0x00, 0x4d, 0x00, 0x3d, 0x00, 0x29, 0x00, 0x15, 0x00, + 0xff, 0xff, 0xeb, 0xff, 0xe0, 0xff, 0xe3, 0xff, 0xef, 0xff, 0xf9, 0xff, + 0xfa, 0xff, 0xf9, 0xff, 0x00, 0x00, 0x10, 0x00, 0x22, 0x00, 0x2f, 0x00, + 0x39, 0x00, 0x41, 0x00, 0x48, 0x00, 0x4b, 0x00, 0x4e, 0x00, 0x55, 0x00, + 0x5c, 0x00, 0x5e, 0x00, 0x5b, 0x00, 0x58, 0x00, 0x52, 0x00, 0x46, 0x00, + 0x34, 0x00, 0x24, 0x00, 0x19, 0x00, 0x0c, 0x00, 0xfd, 0xff, 0xee, 0xff, + 0xe7, 0xff, 0xe8, 0xff, 0xed, 0xff, 0xee, 0xff, 0xea, 0xff, 0xec, 0xff, + 0xf8, 0xff, 0x07, 0x00, 0x11, 0x00, 0x17, 0x00, 0x18, 0x00, 0x16, 0x00, + 0x15, 0x00, 0x1a, 0x00, 0x21, 0x00, 0x26, 0x00, 0x2b, 0x00, 0x32, 0x00, + 0x39, 0x00, 0x3d, 0x00, 0x41, 0x00, 0x46, 0x00, 0x45, 0x00, 0x3c, 0x00, + 0x2b, 0x00, 0x18, 0x00, 0x05, 0x00, 0xf0, 0xff, 0xde, 0xff, 0xd4, 0xff, + 0xd5, 0xff, 0xda, 0xff, 0xdc, 0xff, 0xdd, 0xff, 0xe1, 0xff, 0xe8, 0xff, + 0xf2, 0xff, 0x02, 0x00, 0x15, 0x00, 0x26, 0x00, 0x2e, 0x00, 0x2f, 0x00, + 0x2a, 0x00, 0x24, 0x00, 0x21, 0x00, 0x22, 0x00, 0x26, 0x00, 0x2d, 0x00, + 0x34, 0x00, 0x38, 0x00, 0x3a, 0x00, 0x3a, 0x00, 0x37, 0x00, 0x32, 0x00, + 0x2c, 0x00, 0x27, 0x00, 0x23, 0x00, 0x21, 0x00, 0x1f, 0x00, 0x1c, 0x00, + 0x15, 0x00, 0x09, 0x00, 0xfb, 0xff, 0xec, 0xff, 0xe2, 0xff, 0xdf, 0xff, + 0xe0, 0xff, 0xe2, 0xff, 0xe6, 0xff, 0xe8, 0xff, 0xe7, 0xff, 0xe2, 0xff, + 0xde, 0xff, 0xde, 0xff, 0xdf, 0xff, 0xdc, 0xff, 0xd8, 0xff, 0xd7, 0xff, + 0xdc, 0xff, 0xe7, 0xff, 0xf2, 0xff, 0xf9, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xeb, 0xff, 0xea, 0xff, + 0xea, 0xff, 0xeb, 0xff, 0xeb, 0xff, 0xe8, 0xff, 0xe0, 0xff, 0xd9, 0xff, + 0xd7, 0xff, 0xdb, 0xff, 0xe4, 0xff, 0xef, 0xff, 0xf8, 0xff, 0xf8, 0xff, + 0xf1, 0xff, 0xeb, 0xff, 0xeb, 0xff, 0xef, 0xff, 0xf4, 0xff, 0xf8, 0xff, + 0xf7, 0xff, 0xee, 0xff, 0xe4, 0xff, 0xe0, 0xff, 0xe4, 0xff, 0xe9, 0xff, + 0xea, 0xff, 0xec, 0xff, 0xf2, 0xff, 0xf9, 0xff, 0xf8, 0xff, 0xef, 0xff, + 0xe4, 0xff, 0xdb, 0xff, 0xd4, 0xff, 0xcf, 0xff, 0xcc, 0xff, 0xc9, 0xff, + 0xc4, 0xff, 0xc0, 0xff, 0xc3, 0xff, 0xcb, 0xff, 0xd5, 0xff, 0xe2, 0xff, + 0xf0, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x17, 0x00, 0x17, 0x00, 0x13, 0x00, + 0x0c, 0x00, 0x01, 0x00, 0xf2, 0xff, 0xe7, 0xff, 0xde, 0xff, 0xd3, 0xff, + 0xc6, 0xff, 0xbd, 0xff, 0xb8, 0xff, 0xb6, 0xff, 0xb6, 0xff, 0xb8, 0xff, + 0xb8, 0xff, 0xb6, 0xff, 0xb4, 0xff, 0xb3, 0xff, 0xb2, 0xff, 0xb1, 0xff, + 0xb4, 0xff, 0xbb, 0xff, 0xc3, 0xff, 0xcd, 0xff, 0xdc, 0xff, 0xea, 0xff, + 0xf1, 0xff, 0xf6, 0xff, 0x01, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0xfb, 0xff, + 0xdc, 0xff, 0xbe, 0xff, 0xae, 0xff, 0xaa, 0xff, 0xaa, 0xff, 0xa9, 0xff, + 0xab, 0xff, 0xae, 0xff, 0xad, 0xff, 0xab, 0xff, 0xac, 0xff, 0xaf, 0xff, + 0xb1, 0xff, 0xb3, 0xff, 0xb6, 0xff, 0xb8, 0xff, 0xb8, 0xff, 0xbb, 0xff, + 0xc6, 0xff, 0xd4, 0xff, 0xe1, 0xff, 0xec, 0xff, 0xf8, 0xff, 0x03, 0x00, + 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0xf8, 0xff, 0xed, 0xff, 0xe4, 0xff, + 0xdd, 0xff, 0xd6, 0xff, 0xce, 0xff, 0xca, 0xff, 0xcb, 0xff, 0xc9, 0xff, + 0xbe, 0xff, 0xb1, 0xff, 0xaa, 0xff, 0xa9, 0xff, 0xa8, 0xff, 0xaa, 0xff, + 0xb0, 0xff, 0xb6, 0xff, 0xbb, 0xff, 0xc2, 0xff, 0xcd, 0xff, 0xdc, 0xff, + 0xec, 0xff, 0xfc, 0xff, 0x05, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0x02, 0x00, 0x07, 0x00, 0x06, 0x00, + 0xfb, 0xff, 0xea, 0xff, 0xd8, 0xff, 0xca, 0xff, 0xc5, 0xff, 0xc3, 0xff, + 0xc1, 0xff, 0xbf, 0xff, 0xbd, 0xff, 0xbc, 0xff, 0xbe, 0xff, 0xc3, 0xff, + 0xce, 0xff, 0xd8, 0xff, 0xe1, 0xff, 0xe7, 0xff, 0xea, 0xff, 0xee, 0xff, + 0xf5, 0xff, 0xfe, 0xff, 0x02, 0x00, 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, + 0x0c, 0x00, 0x0a, 0x00, 0x06, 0x00, 0x05, 0x00, 0x04, 0x00, 0x01, 0x00, + 0xfe, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x00, 0x01, 0x00, 0xff, 0xff, + 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfd, 0xff, + 0xf4, 0xff, 0xe8, 0xff, 0xe0, 0xff, 0xde, 0xff, 0xdf, 0xff, 0xe2, 0xff, + 0xe4, 0xff, 0xe3, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe6, 0xff, 0xf2, 0xff, + 0xfe, 0xff, 0x07, 0x00, 0x0e, 0x00, 0x12, 0x00, 0x16, 0x00, 0x1a, 0x00, + 0x1c, 0x00, 0x16, 0x00, 0x0a, 0x00, 0xfb, 0xff, 0xf2, 0xff, 0xf4, 0xff, + 0xfa, 0xff, 0xfb, 0xff, 0xf5, 0xff, 0xef, 0xff, 0xeb, 0xff, 0xe8, 0xff, + 0xe6, 0xff, 0xe4, 0xff, 0xe4, 0xff, 0xe3, 0xff, 0xe3, 0xff, 0xe7, 0xff, + 0xeb, 0xff, 0xeb, 0xff, 0xe7, 0xff, 0xeb, 0xff, 0xf7, 0xff, 0x04, 0x00, + 0x0b, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x08, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x03, 0x00, 0x02, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x0c, 0x00, + 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, 0x25, 0x00, 0x27, 0x00, 0x28, 0x00, + 0x26, 0x00, 0x21, 0x00, 0x1c, 0x00, 0x19, 0x00, 0x16, 0x00, 0x0d, 0x00, + 0x02, 0x00, 0xf9, 0xff, 0xf6, 0xff, 0xf9, 0xff, 0xff, 0xff, 0x06, 0x00, + 0x09, 0x00, 0x0a, 0x00, 0x0f, 0x00, 0x16, 0x00, 0x18, 0x00, 0x10, 0x00, + 0x06, 0x00, 0x02, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x15, 0x00, 0x1d, 0x00, + 0x1f, 0x00, 0x1d, 0x00, 0x1e, 0x00, 0x22, 0x00, 0x27, 0x00, 0x2b, 0x00, + 0x2e, 0x00, 0x2d, 0x00, 0x26, 0x00, 0x1a, 0x00, 0x0d, 0x00, 0x03, 0x00, + 0xfe, 0xff, 0xfc, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xfa, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf8, 0xff, 0xf2, 0xff, 0xee, 0xff, + 0xf1, 0xff, 0xfc, 0xff, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, + 0x0b, 0x00, 0x18, 0x00, 0x29, 0x00, 0x39, 0x00, 0x40, 0x00, 0x3c, 0x00, + 0x34, 0x00, 0x2e, 0x00, 0x2a, 0x00, 0x26, 0x00, 0x23, 0x00, 0x1f, 0x00, + 0x18, 0x00, 0x0d, 0x00, 0xfe, 0xff, 0xf3, 0xff, 0xf2, 0xff, 0xf7, 0xff, + 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0x00, 0x00, 0x06, 0x00, + 0x0d, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x16, 0x00, 0x23, 0x00, 0x31, 0x00, + 0x37, 0x00, 0x35, 0x00, 0x2f, 0x00, 0x2b, 0x00, 0x2f, 0x00, 0x35, 0x00, + 0x37, 0x00, 0x34, 0x00, 0x2d, 0x00, 0x22, 0x00, 0x13, 0x00, 0x07, 0x00, + 0x03, 0x00, 0x06, 0x00, 0x0a, 0x00, 0x07, 0x00, 0x03, 0x00, 0x02, 0x00, + 0x06, 0x00, 0x0b, 0x00, 0x11, 0x00, 0x15, 0x00, 0x16, 0x00, 0x16, 0x00, + 0x18, 0x00, 0x1e, 0x00, 0x25, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x35, 0x00, + 0x38, 0x00, 0x3d, 0x00, 0x43, 0x00, 0x48, 0x00, 0x4b, 0x00, 0x4c, 0x00, + 0x4d, 0x00, 0x4e, 0x00, 0x4c, 0x00, 0x45, 0x00, 0x3c, 0x00, 0x32, 0x00, + 0x27, 0x00, 0x1d, 0x00, 0x17, 0x00, 0x16, 0x00, 0x17, 0x00, 0x15, 0x00, + 0x12, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x15, 0x00, 0x1e, 0x00, + 0x2b, 0x00, 0x39, 0x00, 0x44, 0x00, 0x4b, 0x00, 0x4b, 0x00, 0x47, 0x00, + 0x3d, 0x00, 0x31, 0x00, 0x26, 0x00, 0x20, 0x00, 0x1e, 0x00, 0x1d, 0x00, + 0x18, 0x00, 0x0f, 0x00, 0x04, 0x00, 0xfc, 0xff, 0xf6, 0xff, 0xf2, 0xff, + 0xf1, 0xff, 0xf5, 0xff, 0xfd, 0xff, 0x06, 0x00, 0x0a, 0x00, 0x06, 0x00, + 0xfe, 0xff, 0xf8, 0xff, 0xf7, 0xff, 0xfc, 0xff, 0x01, 0x00, 0x03, 0x00, + 0x01, 0x00, 0xfd, 0xff, 0xfa, 0xff, 0xfc, 0xff, 0x02, 0x00, 0x08, 0x00, + 0x0a, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x06, 0x00, 0xfa, 0xff, 0xed, 0xff, + 0xe6, 0xff, 0xe5, 0xff, 0xe5, 0xff, 0xe3, 0xff, 0xdd, 0xff, 0xd6, 0xff, + 0xd2, 0xff, 0xd5, 0xff, 0xdc, 0xff, 0xe1, 0xff, 0xe5, 0xff, 0xe8, 0xff, + 0xeb, 0xff, 0xeb, 0xff, 0xe7, 0xff, 0xe4, 0xff, 0xe5, 0xff, 0xe7, 0xff, + 0xe8, 0xff, 0xea, 0xff, 0xec, 0xff, 0xec, 0xff, 0xea, 0xff, 0xe9, 0xff, + 0xe8, 0xff, 0xe8, 0xff, 0xe9, 0xff, 0xeb, 0xff, 0xe9, 0xff, 0xe6, 0xff, + 0xe5, 0xff, 0xe8, 0xff, 0xeb, 0xff, 0xec, 0xff, 0xea, 0xff, 0xe7, 0xff, + 0xe6, 0xff, 0xec, 0xff, 0xf4, 0xff, 0xf7, 0xff, 0xf5, 0xff, 0xf0, 0xff, + 0xea, 0xff, 0xe5, 0xff, 0xe3, 0xff, 0xe4, 0xff, 0xe5, 0xff, 0xe5, 0xff, + 0xe6, 0xff, 0xe9, 0xff, 0xec, 0xff, 0xec, 0xff, 0xe9, 0xff, 0xe6, 0xff, + 0xe7, 0xff, 0xec, 0xff, 0xf1, 0xff, 0xf2, 0xff, 0xee, 0xff, 0xe6, 0xff, + 0xde, 0xff, 0xd8, 0xff, 0xd5, 0xff, 0xd5, 0xff, 0xd7, 0xff, 0xd7, 0xff, + 0xd1, 0xff, 0xc7, 0xff, 0xc0, 0xff, 0xbe, 0xff, 0xbf, 0xff, 0xbe, 0xff, + 0xbe, 0xff, 0xbd, 0xff, 0xbc, 0xff, 0xb9, 0xff, 0xb4, 0xff, 0xb2, 0xff, + 0xb5, 0xff, 0xc0, 0xff, 0xcf, 0xff, 0xde, 0xff, 0xe8, 0xff, 0xeb, 0xff, + 0xe7, 0xff, 0xe5, 0xff, 0xe9, 0xff, 0xf0, 0xff, 0xf5, 0xff, 0xf7, 0xff, + 0xf5, 0xff, 0xee, 0xff, 0xe5, 0xff, 0xdf, 0xff, 0xdc, 0xff, 0xda, 0xff, + 0xd9, 0xff, 0xd8, 0xff, 0xd5, 0xff, 0xcf, 0xff, 0xc9, 0xff, 0xc7, 0xff, + 0xc9, 0xff, 0xcd, 0xff, 0xd4, 0xff, 0xdb, 0xff, 0xe2, 0xff, 0xe7, 0xff, + 0xec, 0xff, 0xf4, 0xff, 0xfe, 0xff, 0x08, 0x00, 0x10, 0x00, 0x16, 0x00, + 0x19, 0x00, 0x1a, 0x00, 0x19, 0x00, 0x14, 0x00, 0x0a, 0x00, 0x02, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfc, 0xff, 0xf9, 0xff, 0xf6, 0xff, + 0xf3, 0xff, 0xf4, 0xff, 0xf9, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0x00, 0x00, 0x07, 0x00, 0x10, 0x00, 0x18, 0x00, + 0x1d, 0x00, 0x22, 0x00, 0x24, 0x00, 0x26, 0x00, 0x29, 0x00, 0x2d, 0x00, + 0x30, 0x00, 0x2f, 0x00, 0x2d, 0x00, 0x2d, 0x00, 0x2a, 0x00, 0x24, 0x00, + 0x1f, 0x00, 0x1b, 0x00, 0x16, 0x00, 0x0e, 0x00, 0x06, 0x00, 0xff, 0xff, + 0xfa, 0xff, 0xf6, 0xff, 0xf2, 0xff, 0xef, 0xff, 0xec, 0xff, 0xeb, 0xff, + 0xea, 0xff, 0xed, 0xff, 0xf7, 0xff, 0x06, 0x00, 0x15, 0x00, 0x1e, 0x00, + 0x26, 0x00, 0x2f, 0x00, 0x34, 0x00, 0x33, 0x00, 0x30, 0x00, 0x2d, 0x00, + 0x29, 0x00, 0x23, 0x00, 0x1d, 0x00, 0x15, 0x00, 0x0c, 0x00, 0x05, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xf8, 0xff, 0xf4, 0xff, 0xf0, 0xff, 0xec, 0xff, + 0xee, 0xff, 0xf5, 0xff, 0xfd, 0xff, 0x00, 0x00, 0x02, 0x00, 0x06, 0x00, + 0x0c, 0x00, 0x14, 0x00, 0x1d, 0x00, 0x25, 0x00, 0x2b, 0x00, 0x31, 0x00, + 0x3a, 0x00, 0x43, 0x00, 0x48, 0x00, 0x4a, 0x00, 0x47, 0x00, 0x40, 0x00, + 0x39, 0x00, 0x36, 0x00, 0x34, 0x00, 0x2e, 0x00, 0x22, 0x00, 0x15, 0x00, + 0x07, 0x00, 0xfc, 0xff, 0xf5, 0xff, 0xf4, 0xff, 0xf7, 0xff, 0xfc, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0x00, 0x00, + 0x0c, 0x00, 0x18, 0x00, 0x20, 0x00, 0x24, 0x00, 0x25, 0x00, 0x23, 0x00, + 0x21, 0x00, 0x23, 0x00, 0x28, 0x00, 0x2b, 0x00, 0x2a, 0x00, 0x24, 0x00, + 0x1e, 0x00, 0x17, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x09, 0x00, + 0x09, 0x00, 0x06, 0x00, 0x02, 0x00, 0xfd, 0xff, 0xf8, 0xff, 0xf7, 0xff, + 0x00, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0x0f, 0x00, 0x13, 0x00, 0x10, 0x00, + 0xff, 0xff, 0xf0, 0xff, 0xf2, 0xff, 0xfe, 0xff, 0x09, 0x00, 0x15, 0x00, + 0x1f, 0x00, 0x1f, 0x00, 0x17, 0x00, 0x13, 0x00, 0x13, 0x00, 0x10, 0x00, + 0x0c, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x04, 0x00, 0xff, 0xff, 0xfb, 0xff, + 0xf6, 0xff, 0xf0, 0xff, 0xef, 0xff, 0xf5, 0xff, 0xfd, 0xff, 0x02, 0x00, + 0x03, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xfc, 0xff, + 0x03, 0x00, 0x0a, 0x00, 0x0e, 0x00, 0x11, 0x00, 0x11, 0x00, 0x0e, 0x00, + 0x0b, 0x00, 0x0c, 0x00, 0x11, 0x00, 0x14, 0x00, 0x11, 0x00, 0x0b, 0x00, + 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x05, 0x00, 0x04, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x08, 0x00, 0x0f, 0x00, 0x17, 0x00, 0x1b, 0x00, 0x19, 0x00, + 0x14, 0x00, 0x0f, 0x00, 0x0a, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, + 0x04, 0x00, 0x02, 0x00, 0x05, 0x00, 0x0c, 0x00, 0x0f, 0x00, 0x10, 0x00, + 0x0f, 0x00, 0x0d, 0x00, 0x07, 0x00, 0x01, 0x00, 0xff, 0xff, 0xfc, 0xff, + 0xf7, 0xff, 0xf5, 0xff, 0xf6, 0xff, 0xf7, 0xff, 0xfa, 0xff, 0xfd, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x04, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x09, 0x00, 0x09, 0x00, + 0x06, 0x00, 0x04, 0x00, 0x04, 0x00, 0x06, 0x00, 0x09, 0x00, 0x0b, 0x00, + 0x0b, 0x00, 0x09, 0x00, 0x07, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, + 0x06, 0x00, 0x02, 0x00, 0xfc, 0xff, 0xf4, 0xff, 0xee, 0xff, 0xea, 0xff, + 0xe9, 0xff, 0xeb, 0xff, 0xf1, 0xff, 0xfc, 0xff, 0x07, 0x00, 0x0e, 0x00, + 0x0f, 0x00, 0x0a, 0x00, 0x02, 0x00, 0xfc, 0xff, 0xf8, 0xff, 0xf3, 0xff, + 0xf1, 0xff, 0xf4, 0xff, 0xfa, 0xff, 0x01, 0x00, 0x07, 0x00, 0x0c, 0x00, + 0x0e, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, + 0x05, 0x00, 0x03, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x07, 0x00, 0x06, 0x00, 0x05, 0x00, 0x03, 0x00, 0xff, 0xff, + 0xfb, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xf8, 0xff, 0xf7, 0xff, 0xf9, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf7, 0xff, 0xf4, 0xff, 0xf4, 0xff, + 0xf7, 0xff, 0xfc, 0xff, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x01, 0x00, 0xfd, 0xff, 0xf9, 0xff, 0xf7, 0xff, 0xf7, 0xff, + 0xf8, 0xff, 0xfb, 0xff, 0x00, 0x00, 0x07, 0x00, 0x0c, 0x00, 0x0f, 0x00, + 0x11, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x04, 0x00, 0x02, 0x00, + 0xfe, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfd, 0xff, + 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, + 0x04, 0x00, 0x09, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x0a, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x07, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x06, 0x00, + 0x02, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0x00, 0x00, 0x03, 0x00, 0x05, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfa, 0xff, + 0xfb, 0xff, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x05, 0x00, 0x09, 0x00, + 0x0a, 0x00, 0x07, 0x00, 0x04, 0x00, 0x04, 0x00, 0x06, 0x00, 0x0a, 0x00, + 0x0c, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x04, 0x00, 0xff, 0xff, 0xfb, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xfb, 0xff, 0xfc, 0xff, + 0xfb, 0xff, 0xf9, 0xff, 0xf5, 0xff, 0xf2, 0xff, 0xf2, 0xff, 0xf3, 0xff, + 0xf6, 0xff, 0xf9, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfb, 0xff, 0xfa, 0xff, + 0xf8, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf7, 0xff, 0xf6, 0xff, 0xf3, 0xff, + 0xf3, 0xff, 0xf2, 0xff, 0xf0, 0xff, 0xed, 0xff, 0xe9, 0xff, 0xe7, 0xff, + 0xe6, 0xff, 0xe7, 0xff, 0xea, 0xff, 0xed, 0xff, 0xee, 0xff, 0xed, 0xff, + 0xe9, 0xff, 0xe5, 0xff, 0xe3, 0xff, 0xe4, 0xff, 0xe6, 0xff, 0xe8, 0xff, + 0xe8, 0xff, 0xe6, 0xff, 0xe3, 0xff, 0xe2, 0xff, 0xe3, 0xff, 0xe6, 0xff, + 0xe8, 0xff, 0xe7, 0xff, 0xe5, 0xff, 0xe2, 0xff, 0xdf, 0xff, 0xdb, 0xff, + 0xd9, 0xff, 0xdc, 0xff, 0xe0, 0xff, 0xe1, 0xff, 0xe0, 0xff, 0xdd, 0xff, + 0xdb, 0xff, 0xdd, 0xff, 0xe0, 0xff, 0xe6, 0xff, 0xeb, 0xff, 0xef, 0xff, + 0xf1, 0xff, 0xf1, 0xff, 0xf2, 0xff, 0xf4, 0xff, 0xf3, 0xff, 0xf0, 0xff, + 0xec, 0xff, 0xe7, 0xff, 0xe4, 0xff, 0xe4, 0xff, 0xe6, 0xff, 0xe9, 0xff, + 0xeb, 0xff, 0xee, 0xff, 0xef, 0xff, 0xef, 0xff, 0xf0, 0xff, 0xf1, 0xff, + 0xf2, 0xff, 0xf3, 0xff, 0xf6, 0xff, 0xf8, 0xff, 0xf9, 0xff, 0xf9, 0xff, + 0xfa, 0xff, 0xfc, 0xff, 0x00, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, + 0x05, 0x00, 0x02, 0x00, 0xfe, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0x01, 0x00, 0x03, 0x00, + 0x05, 0x00, 0x06, 0x00, 0x03, 0x00, 0xfe, 0xff, 0xf9, 0xff, 0xf6, 0xff, + 0xf3, 0xff, 0xf1, 0xff, 0xf0, 0xff, 0xf1, 0xff, 0xf5, 0xff, 0xfa, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x06, 0x00, + 0x08, 0x00, 0x08, 0x00, 0x06, 0x00, 0x04, 0x00, 0x03, 0x00, 0x01, 0x00, + 0xfd, 0xff, 0xf8, 0xff, 0xf4, 0xff, 0xf3, 0xff, 0xf5, 0xff, 0xf9, 0xff, + 0xfd, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xf9, 0xff, 0xf4, 0xff, 0xf3, 0xff, + 0xf6, 0xff, 0xfa, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfb, 0xff, 0xf8, 0xff, + 0xf5, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf3, 0xff, + 0xf4, 0xff, 0xf5, 0xff, 0xf8, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfa, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0xfe, 0xff, 0x03, 0x00, 0x08, 0x00, + 0x0c, 0x00, 0x0f, 0x00, 0x11, 0x00, 0x12, 0x00, 0x13, 0x00, 0x15, 0x00, + 0x17, 0x00, 0x18, 0x00, 0x17, 0x00, 0x16, 0x00, 0x15, 0x00, 0x14, 0x00, + 0x12, 0x00, 0x10, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0e, 0x00, + 0x0d, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0f, 0x00, 0x13, 0x00, 0x16, 0x00, + 0x18, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1b, 0x00, + 0x17, 0x00, 0x14, 0x00, 0x13, 0x00, 0x15, 0x00, 0x18, 0x00, 0x1a, 0x00, + 0x19, 0x00, 0x16, 0x00, 0x15, 0x00, 0x15, 0x00, 0x17, 0x00, 0x19, 0x00, + 0x18, 0x00, 0x15, 0x00, 0x11, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x08, 0x00, + 0x0a, 0x00, 0x0b, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x09, 0x00, 0x09, 0x00, + 0x09, 0x00, 0x09, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0c, 0x00, + 0x0b, 0x00, 0x09, 0x00, 0x09, 0x00, 0x0b, 0x00, 0x0e, 0x00, 0x0f, 0x00, + 0x0d, 0x00, 0x0a, 0x00, 0x07, 0x00, 0x04, 0x00, 0x05, 0x00, 0x0a, 0x00, + 0x0e, 0x00, 0x0f, 0x00, 0x0c, 0x00, 0x09, 0x00, 0x08, 0x00, 0x09, 0x00, + 0x0a, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0b, 0x00, 0x08, 0x00, + 0x07, 0x00, 0x07, 0x00, 0x06, 0x00, 0x05, 0x00, 0x05, 0x00, 0x04, 0x00, + 0x01, 0x00, 0xff, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0x00, 0x00, 0x05, 0x00, + 0x0c, 0x00, 0x10, 0x00, 0x11, 0x00, 0x11, 0x00, 0x0f, 0x00, 0x0c, 0x00, + 0x0b, 0x00, 0x0e, 0x00, 0x12, 0x00, 0x16, 0x00, 0x15, 0x00, 0x12, 0x00, + 0x0e, 0x00, 0x0b, 0x00, 0x0a, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x0a, 0x00, + 0x08, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x09, 0x00, 0x0b, 0x00, + 0x0f, 0x00, 0x12, 0x00, 0x15, 0x00, 0x16, 0x00, 0x14, 0x00, 0x11, 0x00, + 0x0d, 0x00, 0x0b, 0x00, 0x09, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, + 0x07, 0x00, 0x07, 0x00, 0x05, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, + 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, + 0x0f, 0x00, 0x11, 0x00, 0x11, 0x00, 0x12, 0x00, 0x12, 0x00, 0x11, 0x00, + 0x0f, 0x00, 0x0b, 0x00, 0x09, 0x00, 0x08, 0x00, 0x08, 0x00, 0x09, 0x00, + 0x0b, 0x00, 0x0a, 0x00, 0x09, 0x00, 0x07, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x03, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, + 0x04, 0x00, 0x07, 0x00, 0x0c, 0x00, 0x0f, 0x00, 0x11, 0x00, 0x12, 0x00, + 0x11, 0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x14, 0x00, 0x14, 0x00, + 0x12, 0x00, 0x0f, 0x00, 0x0d, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x0b, 0x00, + 0x0c, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x07, 0x00, 0x04, 0x00, + 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x04, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x07, 0x00, 0x0a, 0x00, + 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x10, 0x00, 0x10, 0x00, 0x0e, 0x00, + 0x0d, 0x00, 0x0a, 0x00, 0x09, 0x00, 0x08, 0x00, 0x06, 0x00, 0x03, 0x00, + 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, + 0x05, 0x00, 0x07, 0x00, 0x09, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0e, 0x00, + 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0f, 0x00, 0x0f, 0x00, + 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xfd, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfd, 0xff, + 0xfd, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, + 0x03, 0x00, 0x06, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0a, 0x00, + 0x0b, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x09, 0x00, 0x08, 0x00, + 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, + 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, + 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0x06, 0x00, 0x08, 0x00, 0x09, 0x00, + 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, + 0x07, 0x00, 0x05, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x04, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xff, + 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfd, 0xff, + 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfb, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf7, 0xff, + 0xf6, 0xff, 0xf4, 0xff, 0xf4, 0xff, 0xf6, 0xff, 0xf7, 0xff, 0xf8, 0xff, + 0xf9, 0xff, 0xf9, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf7, 0xff, 0xf7, 0xff, + 0xf9, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf5, 0xff, 0xf3, 0xff, + 0xf4, 0xff, 0xf4, 0xff, 0xf4, 0xff, 0xf2, 0xff, 0xf0, 0xff, 0xf0, 0xff, + 0xef, 0xff, 0xee, 0xff, 0xef, 0xff, 0xf0, 0xff, 0xf1, 0xff, 0xf1, 0xff, + 0xf0, 0xff, 0xf0, 0xff, 0xf1, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xff, + 0xf1, 0xff, 0xf1, 0xff, 0xf0, 0xff, 0xee, 0xff, 0xee, 0xff, 0xee, 0xff, + 0xed, 0xff, 0xec, 0xff, 0xeb, 0xff, 0xea, 0xff, 0xe9, 0xff, 0xe7, 0xff, + 0xe7, 0xff, 0xe8, 0xff, 0xe8, 0xff, 0xe8, 0xff, 0xe9, 0xff, 0xe9, 0xff, + 0xea, 0xff, 0xea, 0xff, 0xe9, 0xff, 0xe9, 0xff, 0xe8, 0xff, 0xe8, 0xff, + 0xe8, 0xff, 0xe8, 0xff, 0xe8, 0xff, 0xe8, 0xff, 0xe7, 0xff, 0xe7, 0xff, + 0xea, 0xff, 0xeb, 0xff, 0xec, 0xff, 0xec, 0xff, 0xec, 0xff, 0xec, 0xff, + 0xeb, 0xff, 0xe8, 0xff, 0xe8, 0xff, 0xe8, 0xff, 0xe7, 0xff, 0xe6, 0xff, + 0xe6, 0xff, 0xe6, 0xff, 0xe7, 0xff, 0xe7, 0xff, 0xe9, 0xff, 0xec, 0xff, + 0xee, 0xff, 0xee, 0xff, 0xed, 0xff, 0xec, 0xff, 0xec, 0xff, 0xee, 0xff, + 0xf0, 0xff, 0xf2, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf2, 0xff, 0xf1, 0xff, + 0xf1, 0xff, 0xf2, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf2, 0xff, 0xf1, 0xff, + 0xf0, 0xff, 0xef, 0xff, 0xef, 0xff, 0xef, 0xff, 0xef, 0xff, 0xef, 0xff, + 0xf0, 0xff, 0xf1, 0xff, 0xf0, 0xff, 0xef, 0xff, 0xef, 0xff, 0xef, 0xff, + 0xef, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xf1, 0xff, 0xf1, 0xff, 0xf1, 0xff, + 0xf2, 0xff, 0xf2, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf3, 0xff, + 0xf5, 0xff, 0xf5, 0xff, 0xf5, 0xff, 0xf5, 0xff, 0xf5, 0xff, 0xf6, 0xff, + 0xf5, 0xff, 0xf4, 0xff, 0xf4, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf3, 0xff, + 0xf3, 0xff, 0xf2, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf4, 0xff, 0xf4, 0xff, + 0xf2, 0xff, 0xf1, 0xff, 0xf1, 0xff, 0xf1, 0xff, 0xf3, 0xff, 0xf5, 0xff, + 0xf5, 0xff, 0xf7, 0xff, 0xf8, 0xff, 0xf6, 0xff, 0xf4, 0xff, 0xf3, 0xff, + 0xf2, 0xff, 0xf2, 0xff, 0xf3, 0xff, 0xf3, 0xff, 0xf5, 0xff, 0xf7, 0xff, + 0xf7, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf8, 0xff, + 0xf9, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, + 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x04, 0x00, 0x03, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x05, 0x00, 0x06, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x06, 0x00, + 0x07, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0x00, 0x06, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, + 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x07, 0x00, 0x07, 0x00, 0x08, 0x00, + 0x09, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0b, 0x00, 0x0a, 0x00, + 0x09, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0c, 0x00, + 0x0c, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x08, 0x00, 0x09, 0x00, + 0x0a, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, + 0x0d, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, + 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0f, 0x00, 0x10, 0x00, + 0x0f, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0e, 0x00, + 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0d, 0x00, + 0x0d, 0x00, 0x0e, 0x00, 0x0f, 0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, + 0x12, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x10, 0x00, + 0x11, 0x00, 0x11, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x0f, 0x00, + 0x0f, 0x00, 0x0f, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, + 0x0f, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, + 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, + 0x0f, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0f, 0x00, 0x10, 0x00, 0x11, 0x00, + 0x12, 0x00, 0x12, 0x00, 0x11, 0x00, 0x0f, 0x00, 0x0e, 0x00, 0x0e, 0x00, + 0x0e, 0x00, 0x0e, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0e, 0x00, 0x0e, 0x00, + 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0d, 0x00, + 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0e, 0x00, + 0x0d, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0b, 0x00, + 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0c, 0x00, + 0x0b, 0x00, 0x09, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, + 0x09, 0x00, 0x09, 0x00, 0x07, 0x00, 0x06, 0x00, 0x05, 0x00, 0x06, 0x00, + 0x06, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08, 0x00, 0x07, 0x00, 0x06, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x09, 0x00, 0x0a, 0x00, + 0x0a, 0x00, 0x09, 0x00, 0x08, 0x00, 0x07, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x06, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x04, 0x00, 0x06, 0x00, 0x06, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x04, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x04, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x04, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, + 0x04, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, + 0xfd, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfd, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfa, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf8, 0xff, + 0xf9, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xfa, 0xff, + 0xf9, 0xff, 0xf8, 0xff, 0xf7, 0xff, 0xf8, 0xff, 0xf9, 0xff, 0xf9, 0xff, + 0xf9, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfa, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xf8, 0xff, 0xf7, 0xff, 0xf7, 0xff, + 0xf8, 0xff, 0xf8, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xf9, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfb, 0xff, 0xfc, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf9, 0xff, + 0xf9, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf9, 0xff, 0xf9, 0xff, + 0xf9, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xf8, 0xff, + 0xf9, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xf9, 0xff, 0xf9, 0xff, + 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfa, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfc, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfb, 0xff, + 0xfb, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, + 0xfd, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff, + 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, + 0xfc, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfd, 0xff, + 0xfd, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfc, 0xff, + 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfc, 0xff, + 0xfd, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, + 0xfd, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfe, 0xff +}; + From 4beb5cb0f94b488b4065e1a6b8ec1d43a7e03d0a Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Thu, 26 Mar 2026 23:32:09 +0300 Subject: [PATCH 024/189] i think i fixed player equip --- src/network/ServerSideNetworkHandler.cpp | 63 +++++++++++++++++++----- src/network/packet/SendInventoryPacket.h | 1 + src/server/ServerPlayer.cpp | 18 +++++-- src/world/inventory/FillingContainer.cpp | 5 ++ 4 files changed, 71 insertions(+), 16 deletions(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 7736908..76007f3 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -13,6 +13,7 @@ #include "../client/gamemode/GameMode.h" #include "../raknet/RakPeerInterface.h" #include "../raknet/PacketPriority.h" +#include "platform/log.h" #ifndef STANDALONE_SERVER #include "../client/sound/SoundEngine.h" #endif @@ -244,6 +245,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ReadyPac if (packet->type == ReadyPacket::READY_REQUESTEDCHUNKS) onReady_RequestedChunks(source); + + LOGI("Ready player two ready ready player two!!\n "); } void ServerSideNetworkHandler::onReady_ClientGeneration(const RakNet::RakNetGUID& source) @@ -374,6 +377,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RemoveBl oldTile->destroy(level, x, y, z, data); } + + LOGI("Remove block [%i, %i, %i]\n", packet->x, packet->y, packet->z); } void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RequestChunkPacket* packet) @@ -403,6 +408,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RequestC raknetInstance->send(source, p); } } + + // LOGI("Requested chunk [%i, %i]\n", packet->x, packet->z); } void ServerSideNetworkHandler::levelGenerated( Level* level ) @@ -429,23 +436,36 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, PlayerEq if (!player) return; if (rakPeer->GetMyGUID() == player->owner) return; + LOGI("Equip item: id %i aux %i\n", packet->itemId, packet->itemAuxValue); + // override the player's inventory - //int slot = player->inventory->getSlot(packet->itemId, packet->itemAuxValue); - int slot = Inventory::MAX_SELECTION_SIZE; + int slot = player->inventory->getSlot(packet->itemId, packet->itemAuxValue); + if (slot >= 0) { - if (packet->itemId == 0) { - player->inventory->clearSlot(slot); - } else { - // @note: 128 is an ugly hack for depletable items. - // @todo: fix - ItemInstance newItem(packet->itemId, 128, packet->itemAuxValue); - player->inventory->replaceSlot(slot, &newItem); - } + // if (packet->itemId == 0) { + // player->inventory->clearSlot(slot); + // } else { + // // @note: 128 is an ugly hack for depletable items. + // // @todo: fix + // ItemInstance newItem(packet->itemId, 128, packet->itemAuxValue); + // player->inventory->replaceSlot(slot, &newItem); + // } + player->inventory->moveToSelectedSlot(slot, true); - redistributePacket(packet, source); + } else if (packet->itemId == 0) { + player->inventory->linkEmptySlot(player->inventory->selected); } else { - LOGW("Warning: Remote player doesn't have his thing, Odd!\n"); + LOGW("Warning: Remote player doesn't have his thing (or crafted it)!\n"); + return; } + + LOGI("Inventory:\n"); + for (int i = 0; i < player->inventory->numTotalSlots; i++) { + auto item = player->inventory->getItem(i); + if (item) LOGI("\t %i: %s (%i)\n", i, item->getName().c_str(), item->count); + } + + redistributePacket(packet, source); } void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, PlayerArmorEquipmentPacket* packet) { @@ -455,6 +475,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, PlayerAr if (!player) return; if (rakPeer->GetMyGUID() == player->owner) return; + LOGI("Equip armor: %i %i %i %i\n", packet->head, packet->torso, packet->legs, packet->feet); + packet->fillIn(player); redistributePacket(packet, source); } @@ -466,6 +488,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Interact Entity* entity = level->getEntity(packet->targetId); if (src && entity && src->isPlayer()) { + LOGI("Interact: source %i target %i\n", packet->sourceId, packet->targetId); + Player* player = (Player*) src; if (InteractPacket::Attack == packet->action) { player->swing(); @@ -544,6 +568,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemP void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, EntityEventPacket* packet) { if (!level) return; + LOGI("EntityEventPacket: id %i\n", packet->eventId); + if (Entity* e = level->getEntity(packet->entityId)) e->handleEntityEvent(packet->eventId); } @@ -577,6 +603,11 @@ void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SendInv { if (!level) return; + LOGI("Sent inventory:\n"); + for (int i = 0; i < packet->numItems; i++) { + LOGI("\t %i: %s (%i)\n", i, packet->items.at(i).getName().c_str(), packet->items.at(i).count); + } + Entity* entity = level->getEntity(packet->entityId); if (entity && entity->isPlayer()) { Player* p = (Player*)entity; @@ -592,6 +623,8 @@ void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, DropIte { if (!level) return; + LOGI("DropItemPacket\n"); + Entity* entity = level->getEntity(packet->entityId); if (entity && entity->isPlayer()) { Player* p = (Player*)entity; @@ -601,6 +634,7 @@ void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, DropIte void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ContainerClosePacket* packet) { if (!level) return; + LOGI("ContainerClosePacket\n"); Player* p = findPlayer(level, &source); if (!p) return; @@ -611,6 +645,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ContainerSetSlotPacket* packet) { if (!level) return; + LOGI("ContainerSetSlot: slot %i item %s\n", packet->slot, packet->item.getName().c_str()); Player* p = findPlayer(level, &source); if (!p) return; @@ -639,6 +674,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SetHealthPacket* packet ) { + LOGI("SetHealthPacket\n"); + for (unsigned int i = 0; i < level->players.size(); ++i) { Player* p = level->players[i]; if (p->owner == source) { @@ -657,6 +694,8 @@ void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SignUpd if (!level) return; + LOGI("SignUpdate: [%i, %i, %i]\n", packet->x, packet->y, packet->z); + TileEntity* te = level->getTileEntity(packet->x, packet->y, packet->z); if (TileEntity::isType(te, TileEntityType::Sign)) { SignTileEntity* ste = (SignTileEntity*) te; diff --git a/src/network/packet/SendInventoryPacket.h b/src/network/packet/SendInventoryPacket.h index 65d12f4..482ef51 100755 --- a/src/network/packet/SendInventoryPacket.h +++ b/src/network/packet/SendInventoryPacket.h @@ -2,6 +2,7 @@ #define NET_MINECRAFT_NETWORK_PACKET__SendInventoryPacket_H__ #include "../Packet.h" +#include "world/entity/player/Inventory.h" class SendInventoryPacket: public Packet { diff --git a/src/server/ServerPlayer.cpp b/src/server/ServerPlayer.cpp index ad3b4a9..c27ae38 100755 --- a/src/server/ServerPlayer.cpp +++ b/src/server/ServerPlayer.cpp @@ -19,6 +19,8 @@ #include "../network/packet/AnimatePacket.h" #include "../world/level/tile/entity/ChestTileEntity.h" #include "../network/packet/HurtArmorPacket.h" +#include "network/packet/SendInventoryPacket.h" +#include "world/entity/player/Inventory.h" ServerPlayer::ServerPlayer( Minecraft* minecraft, Level* level ) : super(level, minecraft->isCreativeMode()), @@ -26,7 +28,7 @@ ServerPlayer::ServerPlayer( Minecraft* minecraft, Level* level ) _prevHealth(-999), _containerCounter(0) { - hasFakeInventory = true; + // hasFakeInventory = true; footSize = 0; } @@ -67,8 +69,16 @@ void ServerPlayer::tick() { void ServerPlayer::take( Entity* e, int orgCount ) { TakeItemEntityPacket packet(e->entityId, entityId); + // SendInventoryPacket packet(this, false); _mc->raknetInstance->send(packet); + LOGI("Inventory:\n"); + for (int i = 0; i < inventory->numLinkedSlots; i++) { + auto item = inventory->getItem(i); + if (item) + LOGI("\t %i: %s (%i)\n", i, item->getName().c_str(), item->count); + } + super::take(e, orgCount); } @@ -118,20 +128,20 @@ bool ServerPlayer::hasResource( int id ) { void ServerPlayer::setContainerData( BaseContainerMenu* menu, int id, int value ) { ContainerSetDataPacket p(menu->containerId, id, value); _mc->raknetInstance->send(owner, p); - //LOGI("Setting container data for id %d: %d\n", id, value); + LOGI("Setting container data for id %d: %d\n", id, value); } void ServerPlayer::slotChanged( BaseContainerMenu* menu, int slot, const ItemInstance& item, bool isResultSlot ) { if (isResultSlot) return; ContainerSetSlotPacket p(menu->containerId, slot, item); _mc->raknetInstance->send(owner, p); - //LOGI("Slot %d changed\n", slot); + LOGI("Slot %d changed\n", slot); } void ServerPlayer::refreshContainer( BaseContainerMenu* menu, const std::vector& items ) { ContainerSetContentPacket p(menu->containerId, menu->getItems()); _mc->raknetInstance->send(owner, p); - //LOGI("Refreshing container with %d items\n", items.size()); + LOGI("Refreshing container with %zu items\n", items.size()); } void ServerPlayer::nextContainerCounter() { diff --git a/src/world/inventory/FillingContainer.cpp b/src/world/inventory/FillingContainer.cpp index 10028b0..e4fcd5d 100755 --- a/src/world/inventory/FillingContainer.cpp +++ b/src/world/inventory/FillingContainer.cpp @@ -141,6 +141,11 @@ bool FillingContainer::add( ItemInstance* item ) // // silently destroy the item when having a full inventory // item->count = 0; // return true; + + LOGI("Inventory:\n"); + for (int i = 0; i < numTotalSlots; i++) { + LOGI("\t %i: %s (%i)\n", i, items.at(i)->getName().c_str(), items.at(i)->count); + } } return false; From 2c1b5e256e699f76dccb807f22e768e6cb87be5f Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Thu, 26 Mar 2026 22:48:50 +0200 Subject: [PATCH 025/189] change proto ver --- src/SharedConstants.h | 5 +++-- src/network/ServerSideNetworkHandler.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SharedConstants.h b/src/SharedConstants.h index f97ea36..dcae293 100755 --- a/src/SharedConstants.h +++ b/src/SharedConstants.h @@ -16,8 +16,9 @@ namespace SharedConstants { // 0.5.0 uses NPv8 // 0.6.0 uses NPv9 - const int NetworkProtocolVersion = 9; - const int NetworkProtocolLowestSupportedVersion = 9; + // TODO: Better proto check + const int NetworkProtocolVersion = 10; + const int NetworkProtocolLowestSupportedVersion = 10; const int GameProtocolVersion = 1; const int GameProtocolLowestSupportedVersion = 1; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 7736908..96e4a4e 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -179,7 +179,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac if (!_allowIncoming) return; LOGI("LoginPacket\n"); - + + printf("%d", packet->clientNetworkVersion); int loginStatus = LoginStatus::Success; // // Bad/incompatible client version From 96e8826f01866d5cdecb051930ee84c1757c4c74 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 02:14:28 +0200 Subject: [PATCH 026/189] FEAT: Crafting on server --- CMakeLists.txt | 1 - .../screens/crafting/PaneCraftingScreen.cpp | 53 ++++++++------- src/network/ClientSideNetworkHandler.cpp | 37 +++++++++++ src/network/ClientSideNetworkHandler.h | 4 ++ src/network/NetEventCallback.h | 6 ++ src/network/Packet.cpp | 12 +++- src/network/Packet.h | 5 +- src/network/ServerSideNetworkHandler.cpp | 64 +++++++++++++++++++ src/network/ServerSideNetworkHandler.h | 3 +- src/network/packet/PacketInclude.h | 4 +- src/network/packet/RemoveItemPacket.h | 54 ++++++++++++++++ src/network/packet/TakeItemPacket.h | 54 ++++++++++++++++ src/network/packet/WantCreatePacket.h | 54 ++++++++++++++++ 13 files changed, 323 insertions(+), 28 deletions(-) create mode 100644 src/network/packet/RemoveItemPacket.h create mode 100644 src/network/packet/TakeItemPacket.h create mode 100644 src/network/packet/WantCreatePacket.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 1711d1c..9c3acea 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,6 @@ CPMAddPackage( "ALSOFT_STATIC_LIBGCC ON" ) -# TODO: Clear this paths with * file(GLOB SERVER_SOURCES "project/lib_projects/raknet/jni/RaknetSources/*.cpp" "src/NinecraftApp.cpp" diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index 4e3d025..4a23720 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -16,6 +16,8 @@ #include "../../../../world/level/Level.h" #include "../../../../world/item/DyePowderItem.h" #include "../../../../world/item/crafting/Recipe.h" +#include "network/RakNetInstance.h" +#include "network/packet/WantCreatePacket.h" #include "platform/input/Keyboard.h" static NinePatchLayer* guiPaneFrame = NULL; @@ -439,33 +441,38 @@ void PaneCraftingScreen::craftSelectedItem() ItemInstance resultItem = currentItem->item; if (minecraft->player) { - // Remove all items required for the recipe and ... - for (unsigned int i = 0; i < currentItem->neededItems.size(); ++i) { - CItem::ReqItem& req = currentItem->neededItems[i]; + if (minecraft->isOnline()) { + WantCreatePacket packet(minecraft->player->entityId, resultItem.count, resultItem.getAuxValue(), resultItem.id); + minecraft->raknetInstance->send(packet); + } else { + // Remove all items required for the recipe and ... + for (unsigned int i = 0; i < currentItem->neededItems.size(); ++i) { + CItem::ReqItem& req = currentItem->neededItems[i]; - // If the recipe allows any aux-value as ingredients, first deplete - // aux == 0 from inventory. Since I'm not sure if this always is - // correct, let's only do it for ingredient sandstone for now. - ItemInstance toRemove = req.item; + // If the recipe allows any aux-value as ingredients, first deplete + // aux == 0 from inventory. Since I'm not sure if this always is + // correct, let's only do it for ingredient sandstone for now. + ItemInstance toRemove = req.item; - if (Tile::sandStone->id == req.item.id - && Recipe::ANY_AUX_VALUE == req.item.getAuxValue()) { - toRemove.setAuxValue(0); - toRemove.count = minecraft->player->inventory->removeResource(toRemove, true); - toRemove.setAuxValue(Recipe::ANY_AUX_VALUE); - } + if (Tile::sandStone->id == req.item.id + && Recipe::ANY_AUX_VALUE == req.item.getAuxValue()) { + toRemove.setAuxValue(0); + toRemove.count = minecraft->player->inventory->removeResource(toRemove, true); + toRemove.setAuxValue(Recipe::ANY_AUX_VALUE); + } - if (toRemove.count > 0) { - minecraft->player->inventory->removeResource(toRemove); - } + if (toRemove.count > 0) { + minecraft->player->inventory->removeResource(toRemove); + } + } + // ... add the new one! (in this order, to fill empty slots better) + // if it doesn't fit, throw it on the ground! + if (!minecraft->player->inventory->add(&resultItem)) { + minecraft->player->drop(new ItemInstance(resultItem), false); + } + + recheckRecipes(); } - // ... add the new one! (in this order, to fill empty slots better) - // if it doesn't fit, throw it on the ground! - if (!minecraft->player->inventory->add(&resultItem)) { - minecraft->player->drop(new ItemInstance(resultItem), false); - } - - recheckRecipes(); } } diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index d754b47..fc3a815 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -10,6 +10,7 @@ #include "../world/entity/player/Inventory.h" #include "../client/Minecraft.h" #include "../client/gamemode/GameMode.h" +#include "world/item/ItemInstance.h" #ifndef STANDALONE_SERVER #include "../client/gui/screens/DisconnectionScreen.h" #endif @@ -385,6 +386,38 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); } } +void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, TakeItemPacket* packet) { + if (!level) return; + + LOGI("TakeItemPacket\n"); + + ItemInstance* item; + + item->count = packet->count; + item->id = packet->itemId; + item->setAuxValue(packet->auxValue); + + // if (minecraft->player->entityId == packet->playerId) { + if (!minecraft->player->inventory->add(item)) { + minecraft->player->drop(new ItemInstance(*item), false); + } + // } +} + +void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RemoveItemPacket* packet) { + // Idk how it works... + if (!level) return; + + ItemInstance item; + + item.count = packet->count; + item.id = packet->itemId; + item.setAuxValue(packet->auxValue); + + // if (minecraft->player->entityId == packet->playerId) { + minecraft->player->inventory->removeResource(item); + // } +} void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MoveEntityPacket* packet) { @@ -782,6 +815,10 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, AnimateP } } +void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCreatePacket* packet) +{ +} + void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemPacket* packet) { } diff --git a/src/network/ClientSideNetworkHandler.h b/src/network/ClientSideNetworkHandler.h index 1505ec7..b0cb98f 100755 --- a/src/network/ClientSideNetworkHandler.h +++ b/src/network/ClientSideNetworkHandler.h @@ -77,6 +77,10 @@ public: virtual void handle(const RakNet::RakNetGUID& source, ChatPacket* packet); virtual void handle(const RakNet::RakNetGUID& source, AdventureSettingsPacket* packet); virtual void handle(const RakNet::RakNetGUID& source, SignUpdatePacket* packet); + virtual void handle(const RakNet::RakNetGUID& source, RemoveItemPacket* packet); + virtual void handle(const RakNet::RakNetGUID& source, TakeItemPacket* packet); + virtual void handle(const RakNet::RakNetGUID& source, WantCreatePacket* packet); + private: void requestNextChunk(); diff --git a/src/network/NetEventCallback.h b/src/network/NetEventCallback.h index 53e5fa4..db3e22b 100755 --- a/src/network/NetEventCallback.h +++ b/src/network/NetEventCallback.h @@ -18,6 +18,8 @@ class RemovePlayerPacket; class RemoveEntityPacket; class MoveEntityPacket; //class TeleportEntityPacket; +class RemoveItemPacket; +class TakeItemPacket; class MovePlayerPacket; class PlaceBlockPacket; class RemoveBlockPacket; @@ -48,6 +50,7 @@ class ContainerClosePacket; class ContainerSetSlotPacket; class ContainerSetDataPacket; class ContainerSetContentPacket; +class WantCreatePacket; class ChatPacket; class SignUpdatePacket; class Minecraft; @@ -119,6 +122,9 @@ public: virtual void handle(const RakNet::RakNetGUID& source, SignUpdatePacket* packet) {} virtual void handle(const RakNet::RakNetGUID& source, AdventureSettingsPacket* packet) {} virtual void handle(const RakNet::RakNetGUID& source, AnimatePacket* packet) {} + virtual void handle(const RakNet::RakNetGUID& source, RemoveItemPacket* packet) {} + virtual void handle(const RakNet::RakNetGUID& source, TakeItemPacket* packet) {} + virtual void handle(const RakNet::RakNetGUID& source, WantCreatePacket* packet) {} // // Common implementation for Client and Server diff --git a/src/network/Packet.cpp b/src/network/Packet.cpp index ca1b328..d060356 100755 --- a/src/network/Packet.cpp +++ b/src/network/Packet.cpp @@ -2,6 +2,7 @@ #include "Packet.h" #include "../world/level/chunk/LevelChunk.h" +#include "network/packet/TakeItemPacket.h" #include "packet/PacketInclude.h" Packet::Packet() @@ -41,10 +42,16 @@ Packet* MinecraftPackets::createPacket(int id) case PACKET_ADDITEMENTITY: packet = new AddItemEntityPacket(); break; + case PACKET_REMOVEITEM: + packet = new RemoveItemPacket(); + break; + case PACKET_TAKEITEM: + packet = new TakeItemPacket(); + break; case PACKET_TAKEITEMENTITY: packet = new TakeItemEntityPacket(); break; - case PACKET_ADDMOB: + case PACKET_ADDMOB: packet = new AddMobPacket(); break; case PACKET_ADDPLAYER: @@ -68,6 +75,9 @@ Packet* MinecraftPackets::createPacket(int id) case PACKET_RESPAWN: packet = new RespawnPacket(); break; + case PACKET_WANTCREATEITEM: + packet = new WantCreatePacket(); + break; case PACKET_REMOVEENTITY: packet = new RemoveEntityPacket(); break; diff --git a/src/network/Packet.h b/src/network/Packet.h index e872219..3525bd4 100755 --- a/src/network/Packet.h +++ b/src/network/Packet.h @@ -33,7 +33,10 @@ enum MinecraftPacketIds PACKET_REMOVEENTITY, PACKET_ADDITEMENTITY, PACKET_TAKEITEMENTITY, - + PACKET_TAKEITEM, + PACKET_REMOVEITEM, + PACKET_WANTCREATEITEM, + PACKET_MOVEENTITY, PACKET_MOVEENTITY_POS, PACKET_MOVEENTITY_ROT, diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 883d3a4..bd15ac5 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -5,6 +5,9 @@ #include "../world/entity/player/Inventory.h" #include "../world/Container.h" #include "../world/inventory/BaseContainerMenu.h" +#include "network/packet/RemoveItemPacket.h" +#include "network/packet/TakeItemPacket.h" +#include "network/packet/WantCreatePacket.h" #include "packet/PacketInclude.h" #include "RakNetInstance.h" @@ -14,6 +17,10 @@ #include "../raknet/RakPeerInterface.h" #include "../raknet/PacketPriority.h" #include "platform/log.h" +#include "world/item/ItemInstance.h" +#include "world/item/crafting/Recipe.h" +#include "world/item/crafting/Recipes.h" +#include #ifndef STANDALONE_SERVER #include "../client/sound/SoundEngine.h" #endif @@ -531,6 +538,63 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, AnimateP } redistributePacket(packet, source); } +void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCreatePacket* packet) { + LOGI("WantCreatePacket\n"); + Entity* entity = level->getEntity(packet->playerId); + + if (entity && entity->isPlayer()) { + Player* p = (Player*)entity; + + auto playerInv = p->inventory; + + ItemInstance wantCreate; + + wantCreate.id = packet->itemId; + wantCreate.count = packet->count; + wantCreate.setAuxValue(packet->auxValue); + + Recipe* recipe = Recipes::getInstance()->getRecipeFor(wantCreate); + + std::vector items = recipe->getItemPack().getItemInstances(); + + std::vector checkForExists = {}; + + for (int i = Inventory::MAX_SELECTION_SIZE; i < p->inventory->getContainerSize(); ++i) { + auto itm = p->inventory->getItem(i); + + if (itm != NULL) { + for (int y = 0; y < items.size(); y++) { + auto itmRecipe = items.at(y); + + if (itmRecipe.id == itm->id && itmRecipe.count == itm->count) { + checkForExists.push_back(itm->id); + } + } + } + } + + for (int i = 0; i < items.size(); i++) { + auto item = items.at(i); + + auto it = std::find(checkForExists.begin(), checkForExists.end(), item.id); + + if (it == checkForExists.end()) { + return; + } + } + + for (int i = 0; i < items.size(); i++) { + RemoveItemPacket removePacket(packet->playerId, items.at(i).count, items.at(i).getAuxValue(), items.at(i).id); + raknetInstance->send(source, removePacket); + + p->inventory->removeItem(new ItemInstance(items.at(i).id, items.at(i).count, items.at(i).getAuxValue())); + } + TakeItemPacket itemAdd(p->entityId, wantCreate.count, wantCreate.getAuxValue(), wantCreate.id); + raknetInstance->send(source, itemAdd); + + p->inventory->add(new ItemInstance(wantCreate.id, wantCreate.count, wantCreate.getAuxValue())); + } +} void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemPacket* packet) { diff --git a/src/network/ServerSideNetworkHandler.h b/src/network/ServerSideNetworkHandler.h index 51531cf..a65585a 100755 --- a/src/network/ServerSideNetworkHandler.h +++ b/src/network/ServerSideNetworkHandler.h @@ -58,7 +58,8 @@ public: virtual void handle(const RakNet::RakNetGUID& source, ContainerClosePacket* packet); virtual void handle(const RakNet::RakNetGUID& source, SignUpdatePacket* packet); virtual void handle(const RakNet::RakNetGUID& source, ChatPacket* packet); - + virtual void handle(const RakNet::RakNetGUID& source, WantCreatePacket* packet); + bool allowsIncomingConnections() { return _allowIncoming; } void allowIncomingConnections(bool doAllow); diff --git a/src/network/packet/PacketInclude.h b/src/network/packet/PacketInclude.h index 09aeae8..ff884d2 100755 --- a/src/network/packet/PacketInclude.h +++ b/src/network/packet/PacketInclude.h @@ -50,5 +50,7 @@ #include "TileEventPacket.h" #include "UpdateBlockPacket.h" #include "UseItemPacket.h" - +#include "RemoveItemPacket.h" +#include "WantCreatePacket.h" +#include "TakeItemPacket.h" #endif /*NET_MINECRAFT_NETWORK_PACKET__PacketInclude_H__*/ diff --git a/src/network/packet/RemoveItemPacket.h b/src/network/packet/RemoveItemPacket.h new file mode 100644 index 0000000..f4a1d0a --- /dev/null +++ b/src/network/packet/RemoveItemPacket.h @@ -0,0 +1,54 @@ +#ifndef NET_MINECRAFT_NETWORK_PACKET__RemoveItemPacket_H__ +#define NET_MINECRAFT_NETWORK_PACKET__RemoveItemPacket_H__ + +//package net.minecraft.network.packet; + +#include "../Packet.h" + +class RemoveItemPacket: public Packet +{ +public: + RemoveItemPacket() { + } + + RemoveItemPacket(int playerId, int count, int auxValue, int itemId) + : + playerId(playerId), + count(count), + auxValue(auxValue), + itemId(itemId) + { + } + + void write(RakNet::BitStream* bitStream) + { + bitStream->Write((RakNet::MessageID)(ID_USER_PACKET_ENUM + PACKET_REMOVEITEM)); + bitStream->Write(itemId); + bitStream->Write(count); + bitStream->Write(auxValue); + + bitStream->Write(playerId); + } + + void read(RakNet::BitStream* bitStream) + { + bitStream->Read(itemId); + bitStream->Read(count); + bitStream->Read(auxValue); + + bitStream->Read(playerId); + } + + void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) + { + callback->handle(source, (RemoveItemPacket*)this); + } + + int playerId; + + int itemId; + int count; + int auxValue; +}; + +#endif /*NET_MINECRAFT_NETWORK_PACKET__RemoveItemPacket_H__*/ diff --git a/src/network/packet/TakeItemPacket.h b/src/network/packet/TakeItemPacket.h new file mode 100644 index 0000000..17eee0f --- /dev/null +++ b/src/network/packet/TakeItemPacket.h @@ -0,0 +1,54 @@ +#ifndef NET_MINECRAFT_NETWORK_PACKET__TakeItemPacket_H__ +#define NET_MINECRAFT_NETWORK_PACKET__TakeItemPacket_H__ + +//package net.minecraft.network.packet; + +#include "../Packet.h" + +class TakeItemPacket: public Packet +{ +public: + TakeItemPacket() { + } + + TakeItemPacket(int playerId, int count, int auxValue, int itemId) + : + playerId(playerId), + count(count), + auxValue(auxValue), + itemId(itemId) + { + } + + void write(RakNet::BitStream* bitStream) + { + bitStream->Write((RakNet::MessageID)(ID_USER_PACKET_ENUM + PACKET_TAKEITEM)); + bitStream->Write(itemId); + bitStream->Write(count); + bitStream->Write(auxValue); + + bitStream->Write(playerId); + } + + void read(RakNet::BitStream* bitStream) + { + bitStream->Read(itemId); + bitStream->Read(count); + bitStream->Read(auxValue); + + bitStream->Read(playerId); + } + + void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) + { + callback->handle(source, (TakeItemPacket*)this); + } + + int playerId; + + int itemId; + int count; + int auxValue; +}; + +#endif /*NET_MINECRAFT_NETWORK_PACKET__TakeItemPacket_H__*/ diff --git a/src/network/packet/WantCreatePacket.h b/src/network/packet/WantCreatePacket.h new file mode 100644 index 0000000..48873c5 --- /dev/null +++ b/src/network/packet/WantCreatePacket.h @@ -0,0 +1,54 @@ +#ifndef NET_MINECRAFT_NETWORK_PACKET__WantCreatePacket_H__ +#define NET_MINECRAFT_NETWORK_PACKET__WantCreatePacket_H__ + +//package net.minecraft.network.packet; + +#include "../Packet.h" + +class WantCreatePacket: public Packet +{ +public: + WantCreatePacket() { + } + + WantCreatePacket(int playerId, int count, int auxValue, int itemId) + : + playerId(playerId), + count(count), + auxValue(auxValue), + itemId(itemId) + { + } + + void write(RakNet::BitStream* bitStream) + { + bitStream->Write((RakNet::MessageID)(ID_USER_PACKET_ENUM + PACKET_WANTCREATEITEM)); + bitStream->Write(itemId); + bitStream->Write(count); + bitStream->Write(auxValue); + + bitStream->Write(playerId); + } + + void read(RakNet::BitStream* bitStream) + { + bitStream->Read(itemId); + bitStream->Read(count); + bitStream->Read(auxValue); + + bitStream->Read(playerId); + } + + void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) + { + callback->handle(source, (WantCreatePacket*)this); + } + + int playerId; + + int itemId; + int count; + int auxValue; +}; + +#endif /*NET_MINECRAFT_NETWORK_PACKET__WantCreatePacket_H__*/ From 41c5bdf243b257199a4bd993521ae9b76f6fb2f2 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Fri, 27 Mar 2026 03:33:21 +0300 Subject: [PATCH 027/189] FIX: The end of item cheating --- src/client/Minecraft.cpp | 15 ++ src/client/player/LocalPlayer.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 165 +++++++++++++++++---- src/network/packet/PlayerEquipmentPacket.h | 12 +- src/world/entity/player/Inventory.cpp | 9 ++ src/world/entity/player/Inventory.h | 2 + src/world/item/ItemInstance.cpp | 4 + src/world/item/ItemInstance.h | 2 + 8 files changed, 182 insertions(+), 29 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index ccd9ba5..6487664 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -726,6 +726,21 @@ void Minecraft::tickInput() { if (key == Keyboard::KEY_F3) { options.toggle(OPTIONS_RENDER_DEBUG); } + + // TODO: replace it with client /give command :face_vomiting: + if (key == Keyboard::KEY_F4) { + player->inventory->add(new ItemInstance(Tile::redBrick)); + player->inventory->add(new ItemInstance(Item::ironIngot, 64)); + player->inventory->add(new ItemInstance(Item::ironIngot, 34)); + player->inventory->add(new ItemInstance(Tile::stonecutterBench)); + player->inventory->add(new ItemInstance(Tile::workBench)); + player->inventory->add(new ItemInstance(Tile::furnace)); + player->inventory->add(new ItemInstance(Tile::wood, 54)); + player->inventory->add(new ItemInstance(Item::stick, 14)); + player->inventory->add(new ItemInstance(Item::coal, 31)); + player->inventory->add(new ItemInstance(Tile::sand, 6)); + + } if (key == Keyboard::KEY_F5) { options.toggle(OPTIONS_THIRD_PERSON_VIEW); diff --git a/src/client/player/LocalPlayer.cpp b/src/client/player/LocalPlayer.cpp index 398edcd..a4d3b74 100755 --- a/src/client/player/LocalPlayer.cpp +++ b/src/client/player/LocalPlayer.cpp @@ -456,7 +456,7 @@ void LocalPlayer::tick() { { sentInventoryItemId = newItemId; sentInventoryItemData = newItemData; - PlayerEquipmentPacket packet(entityId, newItemId, newItemData); + PlayerEquipmentPacket packet(entityId, newItemId, newItemData, inventory->selected, inventory->getSlot(newItemId, newItemData)); minecraft->raknetInstance->send(packet); } } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 76007f3..136086a 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -5,6 +5,9 @@ #include "../world/entity/player/Inventory.h" #include "../world/Container.h" #include "../world/inventory/BaseContainerMenu.h" +#include "network/packet/ContainerSetSlotPacket.h" +#include "network/packet/RemoveBlockPacket.h" +#include "network/packet/UpdateBlockPacket.h" #include "packet/PacketInclude.h" #include "RakNetInstance.h" @@ -14,6 +17,8 @@ #include "../raknet/RakPeerInterface.h" #include "../raknet/PacketPriority.h" #include "platform/log.h" +#include "world/item/ItemInstance.h" +#include "world/phys/Vec3.h" #ifndef STANDALONE_SERVER #include "../client/sound/SoundEngine.h" #endif @@ -207,6 +212,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac newPlayer->name = packet->clientName.C_String(); _pendingPlayers.push_back(newPlayer); + LOGI("Adding new player... isCreative: %i\n", minecraft->isCreativeMode()); + // Reset the player so he doesn't spawn inside blocks while (newPlayer->y > 0) { newPlayer->setPos(newPlayer->x, newPlayer->y, newPlayer->z); @@ -441,29 +448,20 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, PlayerEq // override the player's inventory int slot = player->inventory->getSlot(packet->itemId, packet->itemAuxValue); - if (slot >= 0) { - // if (packet->itemId == 0) { - // player->inventory->clearSlot(slot); - // } else { - // // @note: 128 is an ugly hack for depletable items. - // // @todo: fix - // ItemInstance newItem(packet->itemId, 128, packet->itemAuxValue); - // player->inventory->replaceSlot(slot, &newItem); - // } + if (slot >= 0 && slot != packet->inventorySlot && packet->itemId != 0) { + LOGW("PlayerEquipmentPacket: Item in player inventory but slots doesn't match!"); + packet->inventorySlot = slot; + } - player->inventory->moveToSelectedSlot(slot, true); - } else if (packet->itemId == 0) { - player->inventory->linkEmptySlot(player->inventory->selected); - } else { - LOGW("Warning: Remote player doesn't have his thing (or crafted it)!\n"); + if (slot < 0 && packet->itemId != 0) { + LOGW("PlayerEquipmentPacket: Remote player doesn't have his thing (or crafted it)!\n"); return; } - LOGI("Inventory:\n"); - for (int i = 0; i < player->inventory->numTotalSlots; i++) { - auto item = player->inventory->getItem(i); - if (item) LOGI("\t %i: %s (%i)\n", i, item->getName().c_str(), item->count); - } + player->inventory->selectSlot(packet->selectedSlot); + player->inventory->linkSlot(packet->selectedSlot, packet->inventorySlot, true); + + player->inventory->print(); redistributePacket(packet, source); } @@ -535,7 +533,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemP { if (!level) return; - LOGI("UseItemPacket\n"); + LOGI("UseItemPacket: id %i data %i\n", packet->itemId, packet->itemData); Entity* entity = level->getEntity(packet->entityId); if (entity && entity->isPlayer()) { Player* player = (Player*) entity; @@ -546,7 +544,30 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemP if (t && t->use(level, x, y, z, player)) return; if (packet->item.isNull()) return; - ItemInstance* item = &packet->item; + ItemInstance* packetItem = &packet->item; + + int slot = player->inventory->getSlot(packet->itemId, packet->itemData); + + if (slot < 0) { + LOGW("UseItemPacket: Player doesn't have this item!\n"); + + auto pos = Vec3(packet->x, packet->y, packet->z); + + if (ItemInstance::isBlock(packetItem)) { + LOGI("UseItemPacket: This is even block!!!\n"); + + pos.x += packet->clickX; + pos.y += packet->clickY; + pos.z += packet->clickZ; + } + + UpdateBlockPacket refuse(pos.x, pos.y, pos.z, level->getTile(pos.x, pos.y, pos.z), level->getData(pos.x, pos.y, pos.z)); + raknetInstance->send(refuse); + + return; + } + + ItemInstance* item = player->inventory->getItem(slot); if(packet->face == 255) { // Special case: x,y,z means direction-of-action @@ -557,6 +578,10 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemP minecraft->gameMode->useItemOn(player, level, item, packet->x, packet->y, packet->z, packet->face, Vec3(packet->clickX + packet->x, packet->clickY + packet->y, packet->clickZ + packet->z)); } + + if (item && item->count <= 0) { + player->inventory->clearSlot(slot); + } //LOGW("Use Item not working! Out of synch?\n"); @@ -603,7 +628,7 @@ void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SendInv { if (!level) return; - LOGI("Sent inventory:\n"); + LOGI("SendInventoryPacket:\n"); for (int i = 0; i < packet->numItems; i++) { LOGI("\t %i: %s (%i)\n", i, packet->items.at(i).getName().c_str(), packet->items.at(i).count); } @@ -628,7 +653,16 @@ void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, DropIte Entity* entity = level->getEntity(packet->entityId); if (entity && entity->isPlayer()) { Player* p = (Player*)entity; - p->drop(new ItemInstance(packet->item), packet->dropType != 0); + // p->drop(new ItemInstance(packet->item), packet->dropType != 0); + + int slot = p->inventory->getSlot(packet->item.id, packet->item.getAuxValue()); + + if (slot < 0) { + LOGW("DropItemPacket: player doesn't have these items!\n"); + return; + } + + p->inventory->dropSlot(slot, false, packet->dropType != 0); } } @@ -645,7 +679,16 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ContainerSetSlotPacket* packet) { if (!level) return; - LOGI("ContainerSetSlot: slot %i item %s\n", packet->slot, packet->item.getName().c_str()); + + const char* type = "unknown"; + + switch (packet->setType) { + case ContainerSetSlotPacket::SETTYPE_ADD: type = "add"; break; + case ContainerSetSlotPacket::SETTYPE_SET: type = "set"; break; + case ContainerSetSlotPacket::SETTYPE_TAKE: type = "take"; break; + }; + + LOGI("ContainerSetSlot: slot %i item %s type %s\n", packet->slot, packet->item.getName().c_str(), type); Player* p = findPlayer(level, &source); if (!p) return; @@ -654,11 +697,79 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe LOGW("User has no container!\n"); return; } - if (p->containerMenu->containerId != packet->containerId) - { + + if (p->containerMenu->containerId != packet->containerId) { LOGW("Wrong container id: %d vs %d\n", p->containerMenu->containerId, packet->containerId); return; } + + if (packet->item.count > 64) { + LOGW("ContainerSetSlotPacket: player tried to put more than 64"); + return; + } + + auto contItems = p->containerMenu->getItems(); + + // find same item in player inventory (used not in all cases) + int invSlot = p->inventory->getSlot(packet->item.id, packet->item.getAuxValue()); + auto invItem = p->inventory->getItem(invSlot); + + if (contItems.at(packet->slot).id == 0 && packet->item.id != 0) { + LOGI("ContainerSetSlotPacket: player tried to put items to slot %i\n", packet->slot); + + if (invSlot < 0) { + LOGW("ContainerSetSlotPacket: player doesn't have this item\n"); + return; + } + + if (invItem->count < packet->item.count) { + LOGW("ContainerSetSlotPacket: player tried to put more than he have\n"); + packet->item.count = invItem->count; + } + + invItem->count -= packet->item.count; + + if (invItem->count <= 0) { + p->inventory->removeItem(invItem); + } + } else if(contItems.at(packet->slot).id == packet->item.id) { + int deltaItem = packet->item.count - contItems.at(packet->slot).count; + + if (deltaItem > 0) { + LOGI("ContainerSetSlotPacket: player tried to add %i items to slot %i\n", deltaItem, packet->slot); + + auto invItem = p->inventory->getItem(invSlot); + + if (invSlot < 0) { + LOGW("ContainerSetSlotPacket: player doesn't have this item\n"); + return; + } + + if (invItem->count < deltaItem) { + LOGW("ContainerSetSlotPacket: player tried to put more than he have"); + packet->item.count -= (deltaItem - invItem->count); + deltaItem = invItem->count; + } + + invItem->count -= deltaItem; + + if (invItem->count <= 0) { + p->inventory->removeItem(invItem); + } + } else if (deltaItem < 0) { + LOGW("ContainerSetSlotPacket: player tried to take %i items from slot %i\n", -deltaItem, packet->slot); + p->inventory->add(new ItemInstance(packet->item.getItem(), -deltaItem, contItems.at(packet->slot).getAuxValue())); + } + } else if(contItems.at(packet->slot).id && !packet->item.id) { + LOGI("ContainerSetSlotPacket: player tried to take all items from slot %i\n", packet->slot); + packet->item.count = 0; + packet->item.setAuxValue(0); + + p->inventory->add(new ItemInstance(contItems.at(packet->slot).getItem(), contItems.at(packet->slot).count, contItems.at(packet->slot).getAuxValue())); + } else { + LOGW("ContainerSetSlotPacket: illegal container operation in slot %i\n", packet->slot); + return; + } if (ContainerType::FURNACE == p->containerMenu->containerType) { //LOGI("Server:Setting slot %d: %s\n", packet->slot, packet->item.toString().c_str()); @@ -670,6 +781,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe p->containerMenu->setSlot(packet->slot, &packet->item); //p->containerMenu->setSlot(packet->slot, packet->item.isNull()? NULL : &packet->item); } + + p->inventory->print(); } void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SetHealthPacket* packet ) diff --git a/src/network/packet/PlayerEquipmentPacket.h b/src/network/packet/PlayerEquipmentPacket.h index 5dfb315..b49974c 100755 --- a/src/network/packet/PlayerEquipmentPacket.h +++ b/src/network/packet/PlayerEquipmentPacket.h @@ -9,15 +9,19 @@ public: int entityId; unsigned short itemId; unsigned short itemAuxValue; + unsigned char selectedSlot; + unsigned char inventorySlot; PlayerEquipmentPacket() { } - PlayerEquipmentPacket(int entityId, int itemId, int data) + PlayerEquipmentPacket(int entityId, int itemId, int data, int selSlot, int invSlot) : entityId(entityId), itemId(itemId), - itemAuxValue(data) + itemAuxValue(data), + selectedSlot(selSlot), + inventorySlot(invSlot) { } @@ -28,6 +32,8 @@ public: bitStream->Write(entityId); bitStream->Write(itemId); bitStream->Write(itemAuxValue); + bitStream->Write(selectedSlot); + bitStream->Write(inventorySlot); } void read(RakNet::BitStream* bitStream) @@ -35,6 +41,8 @@ public: bitStream->Read(entityId); bitStream->Read(itemId); bitStream->Read(itemAuxValue); + bitStream->Read(selectedSlot); + bitStream->Read(inventorySlot); } void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) diff --git a/src/world/entity/player/Inventory.cpp b/src/world/entity/player/Inventory.cpp index 5a46535..c1d6db4 100755 --- a/src/world/entity/player/Inventory.cpp +++ b/src/world/entity/player/Inventory.cpp @@ -357,3 +357,12 @@ bool Inventory::removeItem( const ItemInstance* samePtr ) { } return false; } + +void Inventory::print() { + LOGI("%s's Inventory:\n", player->name.c_str()); + + for (int i = 0; i < numTotalSlots; i++) { + auto item = getItem(i); + if (item) LOGI("\t %i: %s (%i) %s\n", i, item->getName().c_str(), item->count, (player->inventory->getLinked(i))? "(Linked)" : ""); + } +} \ No newline at end of file diff --git a/src/world/entity/player/Inventory.h b/src/world/entity/player/Inventory.h index 3e8696e..e1ad435 100755 --- a/src/world/entity/player/Inventory.h +++ b/src/world/entity/player/Inventory.h @@ -45,6 +45,8 @@ public: int getAttackDamage(Entity* entity); float getDestroySpeed(Tile* tile); bool canDestroy(Tile* tile); + + void print(); private: void setupDefault(); public: diff --git a/src/world/item/ItemInstance.cpp b/src/world/item/ItemInstance.cpp index 9d7d03f..d52d9f1 100755 --- a/src/world/item/ItemInstance.cpp +++ b/src/world/item/ItemInstance.cpp @@ -290,3 +290,7 @@ bool ItemInstance::isArmorItem( const ItemInstance* instance ) { return item->isArmor(); } + +bool ItemInstance::isBlock(const ItemInstance* instance) { + return instance->id < 256; +} \ No newline at end of file diff --git a/src/world/item/ItemInstance.h b/src/world/item/ItemInstance.h index b65a97d..9b1926d 100755 --- a/src/world/item/ItemInstance.h +++ b/src/world/item/ItemInstance.h @@ -81,6 +81,8 @@ public: static bool isArmorItem(const ItemInstance* instance); + static bool isBlock(const ItemInstance* instance); + /** * Checks if this item is the same item as the other one, disregarding the * 'count' value. From c234abe3aa4ecd9cbcfb3021da3fe6a45577b014 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 02:40:52 +0200 Subject: [PATCH 028/189] FIX: Item crafting --- src/network/ServerSideNetworkHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index bd15ac5..c92c834 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -566,7 +566,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCrea for (int y = 0; y < items.size(); y++) { auto itmRecipe = items.at(y); - if (itmRecipe.id == itm->id && itmRecipe.count == itm->count) { + if (itmRecipe.id == itm->id && itm->count >= itmRecipe.count) { checkForExists.push_back(itm->id); } } @@ -578,7 +578,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCrea auto it = std::find(checkForExists.begin(), checkForExists.end(), item.id); - if (it == checkForExists.end()) { + if (it == checkForExists.end() && checkForExists.size() > 1) { return; } } From f0cb6d0b7c6db61280d874fb2c5540f1f9ff7932 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 02:42:34 +0200 Subject: [PATCH 029/189] Fix compile errors --- src/network/ServerSideNetworkHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 5472b4d..50c5059 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -550,7 +550,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCrea wantCreate.count = packet->count; wantCreate.setAuxValue(packet->auxValue); - Recipe* recipe = Recipe::getInstance()->getRecipeFor(wantCreate); + Recipe* recipe = Recipes::getInstance()->getRecipeFor(wantCreate); std::vector items = recipe->getItemPack().getItemInstances(); From 8098ab890694461b7b07a3cd6e6ade39ade40b25 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 02:48:56 +0200 Subject: [PATCH 030/189] easy --- src/network/ServerSideNetworkHandler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 50c5059..593b848 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -569,10 +569,14 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCrea } } } - + + if (checkForExists.empty()) { + return; + } + for (int i = 0; i < items.size(); i++) { auto item = items.at(i); - + auto it = std::find(checkForExists.begin(), checkForExists.end(), item.id); if (it == checkForExists.end() && checkForExists.size() > 1) { From aeef442f7623e3c3bdf4fce270708fd39dae494e Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Fri, 27 Mar 2026 04:02:27 +0300 Subject: [PATCH 031/189] FIX: Server-side item remove when crafting --- src/network/ServerSideNetworkHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 593b848..36b1013 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -588,7 +588,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCrea RemoveItemPacket removePacket(packet->playerId, items.at(i).count, items.at(i).getAuxValue(), items.at(i).id); raknetInstance->send(source, removePacket); - p->inventory->removeItem(new ItemInstance(items.at(i).id, items.at(i).count, items.at(i).getAuxValue())); + p->inventory->removeResource(ItemInstance(items.at(i).id, items.at(i).count, items.at(i).getAuxValue())); } TakeItemPacket itemAdd(p->entityId, wantCreate.count, wantCreate.getAuxValue(), wantCreate.id); raknetInstance->send(source, itemAdd); From 28febb4e63e881d2f61e704a5ef14294d1a2c2aa Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Fri, 27 Mar 2026 14:01:49 +0300 Subject: [PATCH 032/189] FIX: tool durablity mismatch --- src/network/ServerSideNetworkHandler.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 36b1013..9228e0f 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -385,9 +385,24 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RemoveBl if (oldTile != NULL && changed) { level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, oldTile->soundType->getBreakSound(), (oldTile->soundType->getVolume() + 1) / 2, oldTile->soundType->getPitch() * 0.8f); - if (minecraft->gameMode->isSurvivalType() && player->canDestroy(oldTile)) + if (minecraft->gameMode->isSurvivalType() && player->canDestroy(oldTile)) { + // From SurvivalMode.cpp + // Why tf i have to copy this shit from SurvivalMode class + // Why SurvivalMode class locked to LOCAL MINECRAFT PLAYER :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: + // @fix @warn @ahtung @alert + ItemInstance* item = player->inventory->getSelected(); + if (item != NULL) { + item->mineBlock(oldTile->id, x, y, z); + if (item->count == 0) { + //item->snap(minecraft->player); + player->inventory->clearSlot(player->inventory->selected); + } + } + //oldTile->spawnResources(level, x, y, z, data, 1); //@todo oldTile->playerDestroy(level, player, x, y, z, data); + } + oldTile->destroy(level, x, y, z, data); } From f9d9a0f0f95fab778d36bfa23529cb8f4ecbab91 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 13:47:33 +0200 Subject: [PATCH 033/189] FIX: Recheck recipes in MP --- .../screens/crafting/PaneCraftingScreen.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index 4a23720..b07c1e6 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -19,6 +19,9 @@ #include "network/RakNetInstance.h" #include "network/packet/WantCreatePacket.h" #include "platform/input/Keyboard.h" +#include +#include +#include static NinePatchLayer* guiPaneFrame = NULL; @@ -195,6 +198,26 @@ void PaneCraftingScreen::setupPositions() { } void PaneCraftingScreen::tick() { + if (minecraft->isOnline()) { + // TODO: Make better algorithm + static std::map oldMap = {}; + std::map newMap = {}; + + for (int i = Inventory::MAX_SELECTION_SIZE; i < minecraft->player->inventory->getContainerSize(); ++i) { + auto itm = minecraft->player->inventory->getItem(i); + + if (itm != NULL) { + newMap[itm->id] += itm->count; + } + } + + if (oldMap != newMap) { + oldMap = newMap; + newMap = {}; + recheckRecipes(); + } + } + if (pane) pane->tick(); } From 6957f144e1e32e1228756907a1bcc6bccda2f6f2 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 17:05:50 +0200 Subject: [PATCH 034/189] FIX: Inventory change when cheating items (TODO: Linked slots) --- src/network/ClientSideNetworkHandler.cpp | 12 ++++++++++++ src/network/ClientSideNetworkHandler.h | 1 + src/network/ServerSideNetworkHandler.cpp | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index fc3a815..696e918 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -386,6 +386,18 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); } } + +void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, SendInventoryPacket* packet) { + if (!level) return; + + // TODO: Linked slots + if (packet->entityId == minecraft->player->entityId) { + auto items = packet->items; + + minecraft->player->inventory->replace(items); + } +} + void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, TakeItemPacket* packet) { if (!level) return; diff --git a/src/network/ClientSideNetworkHandler.h b/src/network/ClientSideNetworkHandler.h index b0cb98f..4847c74 100755 --- a/src/network/ClientSideNetworkHandler.h +++ b/src/network/ClientSideNetworkHandler.h @@ -80,6 +80,7 @@ public: virtual void handle(const RakNet::RakNetGUID& source, RemoveItemPacket* packet); virtual void handle(const RakNet::RakNetGUID& source, TakeItemPacket* packet); virtual void handle(const RakNet::RakNetGUID& source, WantCreatePacket* packet); + virtual void handle(const RakNet::RakNetGUID& source, SendInventoryPacket* packet); private: diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 9228e0f..c897591 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -7,6 +7,7 @@ #include "../world/inventory/BaseContainerMenu.h" #include "network/packet/ContainerSetSlotPacket.h" #include "network/packet/RemoveBlockPacket.h" +#include "network/packet/SendInventoryPacket.h" #include "network/packet/UpdateBlockPacket.h" #include "network/packet/RemoveItemPacket.h" #include "network/packet/TakeItemPacket.h" @@ -359,6 +360,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay //LOGI("MovePlayerPacket\n"); if (Entity* entity = level->getEntity(packet->entityId)) { + entity->xd = entity->yd = entity->zd = 0; entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); @@ -477,6 +479,10 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, PlayerEq if (slot < 0 && packet->itemId != 0) { LOGW("PlayerEquipmentPacket: Remote player doesn't have his thing (or crafted it)!\n"); + + SendInventoryPacket newInventory (player, false); + raknetInstance->send(newInventory); + return; } From 8be842a8ac9fe051069b1dfe5d54521caac2c82c Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 19:41:54 +0200 Subject: [PATCH 035/189] FEAT: player anticheat speed --- src/client/Minecraft.h | 5 ++- src/client/renderer/entity/PlayerRenderer.cpp | 4 +-- src/network/ServerSideNetworkHandler.cpp | 21 +++++++++--- src/server/ServerLevel.cpp | 32 ++++++++++++------- src/server/ServerPlayer.h | 5 +++ 5 files changed, 48 insertions(+), 19 deletions(-) diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index 1a90b12..a7f5abc 100755 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -120,6 +120,8 @@ public: void optionUpdated(OptionId option, bool value); void optionUpdated(OptionId option, float value); void optionUpdated(OptionId option, int value); + + int getTicks() { return ticks; } #ifdef __APPLE__ bool _isSuperFast; bool isSuperFast() { return _isSuperFast; } @@ -197,7 +199,8 @@ public: std::string externalCacheStoragePath; protected: Timer timer; - // @note @attn @warn: this is dangerous as fuck! + + // @note @attn @warn: this is dangerous as fuck! volatile bool isGeneratingLevel; bool _hasSignaledGeneratingLevelFinished; diff --git a/src/client/renderer/entity/PlayerRenderer.cpp b/src/client/renderer/entity/PlayerRenderer.cpp index 96ee2eb..092b9dc 100755 --- a/src/client/renderer/entity/PlayerRenderer.cpp +++ b/src/client/renderer/entity/PlayerRenderer.cpp @@ -77,10 +77,10 @@ void PlayerRenderer::render(Entity* mob_, float x, float y, float z, float rot, model = desired; humanoidModel = desired; } - LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", + /* LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), humanoidModel->texWidth, humanoidModel->texHeight, - (desired == playerModel64 ? "64" : "32")); + (desired == playerModel64 ? "64" : "32")); */ HumanoidMobRenderer::render(mob_, x, y, z, rot, a); } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index c897591..996a567 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -21,6 +21,7 @@ #include "../raknet/RakPeerInterface.h" #include "../raknet/PacketPriority.h" #include "platform/log.h" +#include "util/Mth.h" #include "world/item/ItemInstance.h" #include "world/phys/Vec3.h" #include "world/item/crafting/Recipe.h" @@ -360,12 +361,22 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay //LOGI("MovePlayerPacket\n"); if (Entity* entity = level->getEntity(packet->entityId)) { - - entity->xd = entity->yd = entity->zd = 0; - entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + ServerPlayer* player = (ServerPlayer*) getPlayer(source); - // broadcast this packet to other clients - redistributePacket(packet, source); + float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + + (packet->y - entity->y) * (packet->y - entity->y) + + (packet->z - entity->z) * (packet->z - entity->z)); + float speed = vectorDist / (minecraft->getTicks() - player->lastMoveTicks); + + if (speed < 2.5f) { + entity->xd = entity->yd = entity->zd = 0; + entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + + // broadcast this packet to other clients + redistributePacket(packet, source); + } + + player->lastMoveTicks = minecraft->getTicks(); } } diff --git a/src/server/ServerLevel.cpp b/src/server/ServerLevel.cpp index e57d6b8..d65ee86 100755 --- a/src/server/ServerLevel.cpp +++ b/src/server/ServerLevel.cpp @@ -12,16 +12,19 @@ ServerLevel::ServerLevel(LevelStorage* levelStorage, const std::string& levelNam void ServerLevel::updateSleepingPlayerList() { bool allPlayersWasSleeping = allPlayersAreSleeping; allPlayersAreSleeping = !players.empty(); - for(PlayerList::iterator it = players.begin(); it != players.end(); ++it) { + + for (PlayerList::iterator it = players.begin(); it != players.end(); ++it) { Player* player = *it; - if(!player->isSleeping()) { + + if (!player->isSleeping()) { allPlayersAreSleeping = false; break; } } - if(!allPlayersWasSleeping && allPlayersAreSleeping) { + if (!allPlayersWasSleeping && allPlayersAreSleeping) { levelEvent(NULL, LevelEvent::ALL_PLAYERS_SLEEPING, 0, 0, 0, 0); - for(PlayerList::iterator it = players.begin(); it != players.end(); ++it) { + + for (PlayerList::iterator it = players.begin(); it != players.end(); ++it) { (*it)->setAllPlayersSleeping(); } } @@ -29,23 +32,26 @@ void ServerLevel::updateSleepingPlayerList() { void ServerLevel::awakenAllPlayers() { allPlayersAreSleeping = false; - for(PlayerList::iterator it = players.begin(); it != players.end(); ++it) { + + for (PlayerList::iterator it = players.begin(); it != players.end(); ++it) { Player* player = *it; - if(player->isSleeping()) { + + if (player->isSleeping()) { player->stopSleepInBed(false, false, true); player->health = Player::MAX_HEALTH; player->lastHealth = Player::MAX_HEALTH; } } + SetHealthPacket packet(Player::MAX_HEALTH); raknetInstance->send(packet); } bool ServerLevel::allPlayersSleeping() { - if(allPlayersAreSleeping && !isClientSide) { + if (allPlayersAreSleeping && !isClientSide) { // all players are sleeping, but have they slept long enough? - for(PlayerList::iterator it = players.begin(); it != players.end(); ++it) { - if(!(*it)->isSleepingLongEnough()) { + for (PlayerList::iterator it = players.begin(); it != players.end(); ++it) { + if (!(*it)->isSleepingLongEnough()) { return false; } } @@ -55,13 +61,17 @@ bool ServerLevel::allPlayersSleeping() { return false; } -void ServerLevel::tick(){ +void ServerLevel::tick() { super::tick(); - if(allPlayersSleeping()) { + + if (allPlayersSleeping()) { long newTime = levelData.getTime() + TICKS_PER_DAY; + levelData.setTime(newTime - (newTime % TICKS_PER_DAY)); + SetTimePacket packet(levelData.getTime()); raknetInstance->send(packet); + awakenAllPlayers(); } } diff --git a/src/server/ServerPlayer.h b/src/server/ServerPlayer.h index de20661..c95a066 100755 --- a/src/server/ServerPlayer.h +++ b/src/server/ServerPlayer.h @@ -43,6 +43,11 @@ public: virtual void stopSleepInBed(bool forcefulWakeUp, bool updateLevelList, bool saveRespawnPoint); void completeUsingItem(); + + // Getter and setter? Doesnt hear about that + // TODO: Getter and setter :trollface: + int lastMoveTicks = 0; + int ticksInAir = 0; private: void nextContainerCounter(); void setContainerMenu( BaseContainerMenu* menu ); From 97b0fb4d4678f2948c71c7e3e6c95db336c7d496 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 20:16:59 +0200 Subject: [PATCH 036/189] FEAT: New proto check --- src/SharedConstants.h | 5 ++--- src/network/ClientSideNetworkHandler.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 15 +++++++++------ src/network/packet/LoginPacket.h | 15 ++++++++++++--- src/server/ServerPlayer.cpp | 5 +++-- src/server/ServerPlayer.h | 19 ++++++++++++++----- 6 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/SharedConstants.h b/src/SharedConstants.h index dcae293..f97ea36 100755 --- a/src/SharedConstants.h +++ b/src/SharedConstants.h @@ -16,9 +16,8 @@ namespace SharedConstants { // 0.5.0 uses NPv8 // 0.6.0 uses NPv9 - // TODO: Better proto check - const int NetworkProtocolVersion = 10; - const int NetworkProtocolLowestSupportedVersion = 10; + const int NetworkProtocolVersion = 9; + const int NetworkProtocolLowestSupportedVersion = 9; const int GameProtocolVersion = 1; const int GameProtocolLowestSupportedVersion = 1; diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 696e918..53570d5 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -87,7 +87,7 @@ void ClientSideNetworkHandler::onConnect(const RakNet::RakNetGUID& hostGuid) serverGuid = hostGuid; clearChunksLoaded(); - LoginPacket packet(minecraft->options.getStringValue(OPTIONS_USERNAME).c_str(), SharedConstants::NetworkProtocolVersion); + LoginPacket packet(minecraft->options.getStringValue(OPTIONS_USERNAME).c_str(), SharedConstants::NetworkProtocolVersion, true); raknetInstance->send(packet); } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 996a567..fbb9308 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -194,7 +194,6 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac LOGI("LoginPacket\n"); - printf("%d", packet->clientNetworkVersion); int loginStatus = LoginStatus::Success; // // Bad/incompatible client version @@ -204,6 +203,9 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac if (oldClient || oldServer) loginStatus = oldClient? LoginStatus::Failed_ClientOld : LoginStatus::Failed_ServerOld; + if (packet->newProto) { + printf("New proto! \n"); + } RakNet::BitStream bitStream; LoginStatusPacket(loginStatus).write(&bitStream); rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); @@ -214,8 +216,9 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac // // Valid client version // - Player* newPlayer = new ServerPlayer(minecraft, level); - + + Player* newPlayer = new ServerPlayer(minecraft, level, packet->newProto); + minecraft->gameMode->initAbilities(newPlayer->abilities); newPlayer->owner = source; newPlayer->name = packet->clientName.C_String(); @@ -366,7 +369,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + (packet->y - entity->y) * (packet->y - entity->y) + (packet->z - entity->z) * (packet->z - entity->z)); - float speed = vectorDist / (minecraft->getTicks() - player->lastMoveTicks); + float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); if (speed < 2.5f) { entity->xd = entity->yd = entity->zd = 0; @@ -376,7 +379,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay redistributePacket(packet, source); } - player->lastMoveTicks = minecraft->getTicks(); + player->setLastMoveTicks(minecraft->getTicks()); } } @@ -512,7 +515,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, PlayerAr if (!player) return; if (rakPeer->GetMyGUID() == player->owner) return; - LOGI("Equip armor: %i %i %i %i\n", packet->head, packet->torso, packet->legs, packet->feet); + // LOGI("Equip armor: %i %i %i %i\n", packet->head, packet->torso, packet->legs, packet->feet); packet->fillIn(player); redistributePacket(packet, source); diff --git a/src/network/packet/LoginPacket.h b/src/network/packet/LoginPacket.h index b44a44a..50caee3 100755 --- a/src/network/packet/LoginPacket.h +++ b/src/network/packet/LoginPacket.h @@ -9,17 +9,20 @@ public: RakNet::RakString clientName; int clientNetworkVersion; int clientNetworkLowestSupportedVersion; + bool newProto; LoginPacket() : clientNetworkVersion(-1), - clientNetworkLowestSupportedVersion(-1) + clientNetworkLowestSupportedVersion(-1), + newProto(false) { } - LoginPacket(const RakNet::RakString& clientName, int clientVersion) + LoginPacket(const RakNet::RakString& clientName, int clientVersion, bool newProto) : clientName(clientName), clientNetworkVersion(clientVersion), - clientNetworkLowestSupportedVersion(clientVersion) + clientNetworkLowestSupportedVersion(clientVersion), + newProto(newProto) { } @@ -29,6 +32,7 @@ public: bitStream->Write(clientName); bitStream->Write(clientNetworkVersion); bitStream->Write(clientNetworkLowestSupportedVersion); + bitStream->Write(newProto); } void read(RakNet::BitStream* bitStream) @@ -39,6 +43,11 @@ public: if (bitStream->GetNumberOfUnreadBits() > 0) { bitStream->Read(clientNetworkVersion); bitStream->Read(clientNetworkLowestSupportedVersion); + + // Checking for new proto + if (bitStream->GetNumberOfUnreadBits() > 0) { + bitStream->Read(newProto); + } } } diff --git a/src/server/ServerPlayer.cpp b/src/server/ServerPlayer.cpp index c27ae38..3f89033 100755 --- a/src/server/ServerPlayer.cpp +++ b/src/server/ServerPlayer.cpp @@ -22,11 +22,12 @@ #include "network/packet/SendInventoryPacket.h" #include "world/entity/player/Inventory.h" -ServerPlayer::ServerPlayer( Minecraft* minecraft, Level* level ) +ServerPlayer::ServerPlayer( Minecraft* minecraft, Level* level, bool proto) : super(level, minecraft->isCreativeMode()), _mc(minecraft), _prevHealth(-999), - _containerCounter(0) + _containerCounter(0), + isNewProto(proto) { // hasFakeInventory = true; footSize = 0; diff --git a/src/server/ServerPlayer.h b/src/server/ServerPlayer.h index c95a066..77579d9 100755 --- a/src/server/ServerPlayer.h +++ b/src/server/ServerPlayer.h @@ -15,7 +15,7 @@ class ServerPlayer: public Player, { typedef Player super; public: - ServerPlayer(Minecraft* minecraft, Level* level); + ServerPlayer(Minecraft* minecraft, Level* level, bool proto); ~ServerPlayer(); @@ -44,10 +44,14 @@ public: void completeUsingItem(); - // Getter and setter? Doesnt hear about that - // TODO: Getter and setter :trollface: - int lastMoveTicks = 0; - int ticksInAir = 0; + void setLastMoveTicks(int lastMoveTicks) { this->lastMoveTicks = lastMoveTicks; } + int getLastMoveTicks() { return lastMoveTicks; } + + void setTicksInAir(int ticksInAir) { this->ticksInAir = ticksInAir; } + int getTicksInAir() { return ticksInAir; } + + void setNewProto(bool proto) { isNewProto = proto; } + bool getProto() { return isNewProto; } private: void nextContainerCounter(); void setContainerMenu( BaseContainerMenu* menu ); @@ -55,6 +59,11 @@ private: Minecraft* _mc; int _prevHealth; int _containerCounter; + + int lastMoveTicks = 0; + int ticksInAir = 0; + + bool isNewProto = false; }; #endif /*ServerPlayer_H__*/ From eed3a6df6142e17ef7c4849259f45df8c44d753f Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 20:22:05 +0200 Subject: [PATCH 037/189] FEAT: Message for outdated clients --- src/network/ServerSideNetworkHandler.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index fbb9308..5fe00a4 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -203,9 +203,6 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac if (oldClient || oldServer) loginStatus = oldClient? LoginStatus::Failed_ClientOld : LoginStatus::Failed_ServerOld; - if (packet->newProto) { - printf("New proto! \n"); - } RakNet::BitStream bitStream; LoginStatusPacket(loginStatus).write(&bitStream); rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); @@ -252,6 +249,11 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac ).write(&bitStream); rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); + + if (!packet->newProto) { + MessagePacket packet("You're using outdated client. Some features disabled."); + raknetInstance->send(packet); + } } } From 61a2349b8bbd0cd67813d8d8ca39dfa90cd268b6 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Fri, 27 Mar 2026 21:26:25 +0300 Subject: [PATCH 038/189] FEAT: Player data saving/loading --- src/client/gamemode/SurvivalMode.cpp | 1 + src/network/ClientSideNetworkHandler.cpp | 5 ++ src/network/ServerSideNetworkHandler.cpp | 33 +++++++++ src/network/packet/SendInventoryPacket.h | 26 ++++++- .../storage/ExternalFileLevelStorage.cpp | 68 +++++++++++++++++++ .../level/storage/ExternalFileLevelStorage.h | 13 ++++ src/world/level/storage/LevelStorage.h | 3 + 7 files changed, 146 insertions(+), 3 deletions(-) diff --git a/src/client/gamemode/SurvivalMode.cpp b/src/client/gamemode/SurvivalMode.cpp index ac49fda..c53c198 100755 --- a/src/client/gamemode/SurvivalMode.cpp +++ b/src/client/gamemode/SurvivalMode.cpp @@ -68,6 +68,7 @@ bool SurvivalMode::destroyBlock( int x, int y, int z, int face ) { minecraft->player->inventory->clearSlot(minecraft->player->inventory->selected); } } + if (changed && couldDestroy) { ItemInstance instance(t, 1, data); Tile::tiles[t]->playerDestroy(minecraft->level, minecraft->player, x, y, z, data); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 696e918..aa15ed3 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -395,6 +395,11 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, SendInve auto items = packet->items; minecraft->player->inventory->replace(items); + + for (int i = 0; i < packet->linkedSlot.size(); i++) { + minecraft->player->inventory->linkSlot(i, packet->linkedSlot[i].inventorySlot, true); + LOGI("%i -> %i\n", packet->linkedSlot[i].inventorySlot, i); + } } } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index c897591..6032c0e 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -22,6 +22,7 @@ #include "../raknet/PacketPriority.h" #include "platform/log.h" #include "world/item/ItemInstance.h" +#include "world/level/storage/LevelStorage.h" #include "world/phys/Vec3.h" #include "world/item/crafting/Recipe.h" #include "world/item/crafting/Recipes.h" @@ -169,6 +170,8 @@ void ServerSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid) if (player->owner == guid) { + minecraft->level->getLevelStorage()->savePlayer(*player); + std::string message = player->name; message += " disconnected from the game"; displayGameMessage(message); @@ -319,6 +322,36 @@ void ServerSideNetworkHandler::onReady_ClientGeneration(const RakNet::RakNetGUID } } + if (!minecraft->level->getLevelStorage()->loadPlayer(*newPlayer)) { + LOGW("Failed to load %s data\n", newPlayer->name.c_str()); + } + + // Credits to EpikIzCool + bitStream.Reset(); + MovePlayerPacket mv(newPlayer->entityId, newPlayer->x, newPlayer->y - newPlayer->heightOffset, + newPlayer->z, newPlayer->xRot, newPlayer->yRot); + mv.write(&bitStream); + + rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); + + bitStream.Reset(); + SetHealthPacket hp(newPlayer->health); + hp.write(&bitStream); + + rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); + + if (newPlayer->hasRespawnPosition()) { + bitStream.Reset(); + SetSpawnPositionPacket sp(newPlayer->getRespawnPosition()); + sp.write(&bitStream); + rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); + } + + bitStream.Reset(); + SendInventoryPacket(newPlayer, false).write(&bitStream); + rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); + + // Additional packets // * set spawn /* diff --git a/src/network/packet/SendInventoryPacket.h b/src/network/packet/SendInventoryPacket.h index 482ef51..b744b58 100755 --- a/src/network/packet/SendInventoryPacket.h +++ b/src/network/packet/SendInventoryPacket.h @@ -3,13 +3,13 @@ #include "../Packet.h" #include "world/entity/player/Inventory.h" +#include "world/inventory/FillingContainer.h" +#include class SendInventoryPacket: public Packet { public: - SendInventoryPacket() - { - } + SendInventoryPacket() {} SendInventoryPacket(Player* player, bool dropItems) : entityId(player->entityId), @@ -22,10 +22,15 @@ public: ItemInstance* item = inv->getItem(i); items.push_back(item? *item : ItemInstance()); } + for (int i = 0; i < NumArmorItems; ++i) { ItemInstance* item = player->getArmor(i); items.push_back(item? *item : ItemInstance()); } + + for (int i = 0; i < inv->numLinkedSlots; ++i) { + linkedSlot[i] = inv->linkedSlots[i]; + } } void write(RakNet::BitStream* bitStream) @@ -40,6 +45,13 @@ public: // Armor for (int i = 0; i < NumArmorItems; ++i) PacketUtil::writeItemInstance(items[i + numItems], bitStream); + + int lSlots = Inventory::MAX_SELECTION_SIZE; + + // Linked slots + bitStream->Write(lSlots); + for (int i = 0; i < lSlots; ++i) + bitStream->Write(linkedSlot[i]); } void read(RakNet::BitStream* bitStream) @@ -51,6 +63,12 @@ public: // Inventory, Armor for (int i = 0; i < numItems + NumArmorItems; ++i) items.push_back(PacketUtil::readItemInstance(bitStream)); + + // Linked slots + int lSlots = 0; + bitStream->Read(lSlots); + for (int i = 0; i < lSlots; ++i) + bitStream->Read(linkedSlot[i]); } void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) @@ -63,6 +81,8 @@ public: short numItems; unsigned char extra; + std::array linkedSlot; + static const int ExtraDrop = 1; static const int NumArmorItems = 4; }; diff --git a/src/world/level/storage/ExternalFileLevelStorage.cpp b/src/world/level/storage/ExternalFileLevelStorage.cpp index 91bcf45..03cca08 100755 --- a/src/world/level/storage/ExternalFileLevelStorage.cpp +++ b/src/world/level/storage/ExternalFileLevelStorage.cpp @@ -1,3 +1,6 @@ +#include +#include +#include #if !defined(DEMO_MODE) && !defined(APPLE_DEMO_PROMOTION) #include "LevelData.h" @@ -88,6 +91,9 @@ ExternalFileLevelStorage::ExternalFileLevelStorage(const std::string& levelId, c { createFolderIfNotExists(levelPath.c_str()); + std::string playerFolder = levelPath + "/players"; + createFolderIfNotExists(playerFolder.c_str()); + std::string datFileName = levelPath + "/" + fnLevelDat; std::string levelFileName = levelPath + "/" + fnPlayerDat; loadedLevelData = new LevelData(); @@ -113,6 +119,7 @@ void ExternalFileLevelStorage::saveLevelData(LevelData& levelData, std::vector

* players ) { + // @todo: completely rewrite std::string directory = levelPath + "/"; std::string tmpFile = directory + fnLevelDatNew; std::string datFile = directory + fnLevelDat; @@ -141,6 +148,67 @@ void ExternalFileLevelStorage::saveLevelData( const std::string& levelPath, Leve // Remove the temporary save, if the rename didn't do it remove(tmpFile.c_str()); + + // Save players + // fuck mojang for that + if (!players || players->empty()) { + return; + } + + for (auto& player : *players) { + if (player != NULL) { + savePlayer(*player, directory); + } + } +} + +void ExternalFileLevelStorage::savePlayer(Player& player, const std::string& worldDir) { + std::string playerPath = worldDir + "/players/" + player.name + ".dat"; + + LOGI("Saving player %s to %s...\n", player.name.c_str(), playerPath.c_str()); + + RakNet::BitStream data; + RakDataOutput buf(data); + CompoundTag playerTag; + player.saveWithoutId(&playerTag); + + NbtIo::write(&playerTag, &buf); + + std::ofstream file(playerPath, std::ios::out | std::ios::binary); + file.write((const char*)data.GetData(), (size_t)data.GetNumberOfBytesUsed()); +} + +bool ExternalFileLevelStorage::loadPlayer(Player& player, const std::string& worldDir) { + std::string playerPath = worldDir + "/players/" + player.name + ".dat"; + + LOGI("Loading player %s from %s...\n", player.name.c_str(), playerPath.c_str()); + + std::ifstream file(playerPath, std::ios::in | std::ios::binary); + if (!file.is_open()) { + return false; + } + + std::vector data((std::istreambuf_iterator(file)), std::istreambuf_iterator()); + + RakNet::BitStream bitStream(data.data(), data.size(), false); + RakDataInput stream(bitStream); + + CompoundTag* tag = NbtIo::read(&stream); + if (tag) { + player.load(tag); + tag->deleteChildren(); + delete tag; + } + + return true; +} + +void ExternalFileLevelStorage::savePlayer(Player& player) { + ExternalFileLevelStorage::savePlayer(player, levelPath); +} + +bool ExternalFileLevelStorage::loadPlayer(Player& player) { + return ExternalFileLevelStorage::loadPlayer(player, levelPath); } LevelData* ExternalFileLevelStorage::prepareLevel(Level* _level) diff --git a/src/world/level/storage/ExternalFileLevelStorage.h b/src/world/level/storage/ExternalFileLevelStorage.h index b7dd960..9aad448 100755 --- a/src/world/level/storage/ExternalFileLevelStorage.h +++ b/src/world/level/storage/ExternalFileLevelStorage.h @@ -67,6 +67,19 @@ public: void saveGame(Level* level); void saveAll(Level* level, std::vector& levelChunks); + /** + * @brief Save player to /player/.dat file + */ + static void savePlayer(Player& player, const std::string& worldDir); + + /** + * @brief Load player from /player/.dat file + */ + static bool loadPlayer(Player& player, const std::string& worldDir); + + virtual void savePlayer(Player& player); + virtual bool loadPlayer(Player& player); + virtual void tick(); virtual void flush() {} private: diff --git a/src/world/level/storage/LevelStorage.h b/src/world/level/storage/LevelStorage.h index 84c0f62..d3098d2 100755 --- a/src/world/level/storage/LevelStorage.h +++ b/src/world/level/storage/LevelStorage.h @@ -32,6 +32,9 @@ public: virtual void saveGame(Level* level) {} virtual void loadEntities(Level* level, LevelChunk* levelChunk) {} + virtual void savePlayer(Player& player) = 0; + virtual bool loadPlayer(Player& player) = 0; + //void checkSession() throws LevelConflictException; //PlayerIO getPlayerIO(); }; From 6d696af2358a9f216934e6c8dce3edd73562393c Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 27 Mar 2026 21:08:17 +0200 Subject: [PATCH 039/189] FEAT: taken nickname --- src/network/ClientSideNetworkHandler.cpp | 7 +++++++ src/network/ServerSideNetworkHandler.cpp | 9 +++++++++ src/network/packet/LoginStatusPacket.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index c2eb5a7..df0a02d 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -1,6 +1,7 @@ #include "ClientSideNetworkHandler.h" #include "client/Options.h" +#include "network/packet/LoginStatusPacket.h" #include "packet/PacketInclude.h" #include "RakNetInstance.h" #include "../world/level/chunk/ChunkSource.h" @@ -131,6 +132,12 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginSta LOGI("Disconnect! Server is outdated!\n"); #ifndef STANDALONE_SERVER minecraft->setScreen(new DisconnectionScreen("Could not connect: Outdated server!")); +#endif + } + if (packet->status == LoginStatus::Failed_TakenNickname) { + LOGI("Disconnect! Nickname is taken!\n"); +#ifndef STANDALONE_SERVER + minecraft->setScreen(new DisconnectionScreen("Could not connect: Nickname is taken!")); #endif } } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 0a2fe13..a75b796 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -6,6 +6,7 @@ #include "../world/Container.h" #include "../world/inventory/BaseContainerMenu.h" #include "network/packet/ContainerSetSlotPacket.h" +#include "network/packet/LoginStatusPacket.h" #include "network/packet/RemoveBlockPacket.h" #include "network/packet/SendInventoryPacket.h" #include "network/packet/UpdateBlockPacket.h" @@ -206,6 +207,14 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac if (oldClient || oldServer) loginStatus = oldClient? LoginStatus::Failed_ClientOld : LoginStatus::Failed_ServerOld; + for (int i = 0; i < level->players.size(); i++) { + ServerPlayer* player = (ServerPlayer*) level->players.at(i); + + if (player->name == packet->clientName.C_String()) { + loginStatus = packet->newProto ? LoginStatus::Failed_TakenNickname : LoginStatus::Failed_ClientOld; + } + } + RakNet::BitStream bitStream; LoginStatusPacket(loginStatus).write(&bitStream); rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); diff --git a/src/network/packet/LoginStatusPacket.h b/src/network/packet/LoginStatusPacket.h index b194f8f..efa10f5 100755 --- a/src/network/packet/LoginStatusPacket.h +++ b/src/network/packet/LoginStatusPacket.h @@ -3,10 +3,12 @@ #include "../Packet.h" +// wtf why not enum namespace LoginStatus { const int Success = 0; const int Failed_ClientOld = 1; const int Failed_ServerOld = 2; + const int Failed_TakenNickname = 3; } class LoginStatusPacket : public Packet { From 77d02fcca23398d904d8420b9ecf8c909d4d08e9 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Fri, 27 Mar 2026 22:15:03 +0300 Subject: [PATCH 040/189] FIX: workbench compatibility --- .../screens/crafting/PaneCraftingScreen.cpp | 55 +++++++++---------- src/network/ServerSideNetworkHandler.cpp | 14 ++--- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index b07c1e6..6d6e407 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -467,35 +467,34 @@ void PaneCraftingScreen::craftSelectedItem() if (minecraft->isOnline()) { WantCreatePacket packet(minecraft->player->entityId, resultItem.count, resultItem.getAuxValue(), resultItem.id); minecraft->raknetInstance->send(packet); - } else { - // Remove all items required for the recipe and ... - for (unsigned int i = 0; i < currentItem->neededItems.size(); ++i) { - CItem::ReqItem& req = currentItem->neededItems[i]; - - // If the recipe allows any aux-value as ingredients, first deplete - // aux == 0 from inventory. Since I'm not sure if this always is - // correct, let's only do it for ingredient sandstone for now. - ItemInstance toRemove = req.item; - - if (Tile::sandStone->id == req.item.id - && Recipe::ANY_AUX_VALUE == req.item.getAuxValue()) { - toRemove.setAuxValue(0); - toRemove.count = minecraft->player->inventory->removeResource(toRemove, true); - toRemove.setAuxValue(Recipe::ANY_AUX_VALUE); - } - - if (toRemove.count > 0) { - minecraft->player->inventory->removeResource(toRemove); - } - } - // ... add the new one! (in this order, to fill empty slots better) - // if it doesn't fit, throw it on the ground! - if (!minecraft->player->inventory->add(&resultItem)) { - minecraft->player->drop(new ItemInstance(resultItem), false); - } - - recheckRecipes(); } + // Remove all items required for the recipe and ... + for (unsigned int i = 0; i < currentItem->neededItems.size(); ++i) { + CItem::ReqItem& req = currentItem->neededItems[i]; + + // If the recipe allows any aux-value as ingredients, first deplete + // aux == 0 from inventory. Since I'm not sure if this always is + // correct, let's only do it for ingredient sandstone for now. + ItemInstance toRemove = req.item; + + if (Tile::sandStone->id == req.item.id + && Recipe::ANY_AUX_VALUE == req.item.getAuxValue()) { + toRemove.setAuxValue(0); + toRemove.count = minecraft->player->inventory->removeResource(toRemove, true); + toRemove.setAuxValue(Recipe::ANY_AUX_VALUE); + } + + if (toRemove.count > 0) { + minecraft->player->inventory->removeResource(toRemove); + } + } + // ... add the new one! (in this order, to fill empty slots better) + // if it doesn't fit, throw it on the ground! + if (!minecraft->player->inventory->add(&resultItem)) { + minecraft->player->drop(new ItemInstance(resultItem), false); + } + + recheckRecipes(); } } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 0a2fe13..5ac2ebd 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -654,14 +654,14 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCrea } } - for (int i = 0; i < items.size(); i++) { - RemoveItemPacket removePacket(packet->playerId, items.at(i).count, items.at(i).getAuxValue(), items.at(i).id); - raknetInstance->send(source, removePacket); + // for (int i = 0; i < items.size(); i++) { + // RemoveItemPacket removePacket(packet->playerId, items.at(i).count, items.at(i).getAuxValue(), items.at(i).id); + // raknetInstance->send(source, removePacket); - p->inventory->removeResource(ItemInstance(items.at(i).id, items.at(i).count, items.at(i).getAuxValue())); - } - TakeItemPacket itemAdd(p->entityId, wantCreate.count, wantCreate.getAuxValue(), wantCreate.id); - raknetInstance->send(source, itemAdd); + // p->inventory->removeResource(ItemInstance(items.at(i).id, items.at(i).count, items.at(i).getAuxValue())); + // } + // TakeItemPacket itemAdd(p->entityId, wantCreate.count, wantCreate.getAuxValue(), wantCreate.id); + // raknetInstance->send(source, itemAdd); p->inventory->add(new ItemInstance(wantCreate.id, wantCreate.count, wantCreate.getAuxValue())); } From f1e8932fbd1e878bc62f161781a82e82da5f97c3 Mon Sep 17 00:00:00 2001 From: yefengeeeeeeeeeee Date: Sat, 28 Mar 2026 18:12:34 +0800 Subject: [PATCH 041/189] Add icon for win32 --- CMakeLists.txt | 1 + data/images/pe.ico | Bin 0 -> 64740 bytes data/images/pe.rc | 1 + 3 files changed, 2 insertions(+) create mode 100644 data/images/pe.ico create mode 100644 data/images/pe.rc diff --git a/CMakeLists.txt b/CMakeLists.txt index 1711d1c..7f9db5f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ if (${PLATFORM} STREQUAL "Desktop") endif() if (WIN32) + target_sources(MinecraftPE PRIVATE data/images/pe.rc) add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(misc/windows) set(EXTRA_LIBS ws2_32 winhttp) diff --git a/data/images/pe.ico b/data/images/pe.ico new file mode 100644 index 0000000000000000000000000000000000000000..b0e657be33202f153714f5de5954712d51c02d5b GIT binary patch literal 64740 zcmX`S1zc3m7dL!&Szze}iKSZ_7ErodKuQ!4q)|b-o25~@L8YXX2I=lnQaYujyLTUc z@B93pd(X|e^SLu~X3l(13;=*0_Ww2zzySQd0|4@e`;S^0$^^JnxDU4k&r}q2{!9Ju zfMPvdjGT+!{`chItf31U`R4H%0Fb~l1zBCsxxIT2*O$tv2Y3!L>tB;xe#g^b%B{12 z1{o4aNaRRFgDXLab`{UCf(JymR*-g4)yoHUYodM{SuU-I;%k|=BP|{abajUfbz7Gb z)l+jmYARq0kG4h0JbwS&+9~6lS1*4RZkBxiS=)8YcPH%ljJhvw!;Ypnzm#_1^tJfk z$k(F1ht|ttUdCUHaYF6n5+mpH*+%T^7#K$^@I*ex9Xbi|FRv+?2llPy1=W)8f6ZEZ z`_r37d}x(L!`do8rterZrVocDwZ=IiZJw$|C*eqxqdZx0w{O79j*e}M`PaLDX6@%M zaOaRyujVeCY|NVaFg9I%Br4Ke10*7bStXM?R5g2S1+&73cdtFSB~JZRiOXKB7b)YW z?=$_`clk_xzggoi;p(5-*G2A%AxUNBDNo)AHyFP??pDl+WqTP$O-}ik(@f*B$b=T# zT1Wk-l|G9>U;1}RH}$KfQLmc+@qh2$b!vPx(#K43p_uOKFJWr0oMh71hhe)JN2nU$ zdr)qD+jsxg15lsmu&$n$(%`ZQ_CC_mNvbWPCVD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h3CCGe zVoq+_<<96-q=Iby5ZPm7U|T}NWO2}P^N7&)=GOl{OfLLmJrn68cT3e+rm%Fj#08?^ zu*w1oC1W$@?p10DODg12?pga@NkEqXwrS+ot%&z*6tR_^_0TcWDRMYGcpelirsdic zBG$B8B^g&@cZHvzhqVPI>$KRydR<--_tu7J!l@VtcABsJ&Yt7u@X2poEWBy)5UB zM&gi~w`wu}L_=;B*cyW~Hh_```M!%$j(xSTL?{oNZ?UAz>fw^bkWE6aD=un4?%1Fl{6{Kmg!zpu_S ztF6fxRSGJ9JjmRtq|8NAx;OPic!e5`BXOvokX#8%uUPVPVc`$;DDCT$vlU<#&{i6Yq*--2Wn8-A4^LfOBAxYCnM*F>8*K=NwIL6x`*52g1fAl1e zHbdE8iu^au$aAzZ^53eO-5Mw_&pt`s)7;*y<$iSz4n(HCQ%tc*eJxBx#$2GznRoQr zkHiI-6GZ4ISm7ezijUez6{ipG!l+r`%9(Xv#|wI>7x!Pc0Yh8RuHqsU0aeRlmO~rn8sUOgBARJSHqPu+8+h@@F_^qaAvQ?Mt5q~1C8(_PMoE9 z$??>5ZZ{Xt`)1t66Amp!iuNX5Qt>sCwtGA?*>U={(yMX^>kS3@aLhul>fYTpn2)0YPqiC|L1ZPKrPX>Sc&n}C>Yp4(kfakvfO z5!;uf{9ewa)iKnrR2utE`Q7QqCr^Dl77pJ^eZAs?&u^(!XEemnCmO`r;7-zQzvB}{(k_CfXQ6| literal 0 HcmV?d00001 diff --git a/data/images/pe.rc b/data/images/pe.rc new file mode 100644 index 0000000..331c4ed --- /dev/null +++ b/data/images/pe.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON "pe.ico" \ No newline at end of file From bcf48eb5e3284d6bbfda72e9542c0052f16ae597 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 28 Mar 2026 16:41:00 +0200 Subject: [PATCH 042/189] FEAT: Damage on server --- src/client/Minecraft.cpp | 2 +- src/main_dedicated.cpp | 9 ++++++ src/network/ClientSideNetworkHandler.cpp | 2 ++ src/network/ServerSideNetworkHandler.cpp | 38 +++++++++++++----------- src/server/ArgumentsSettings.cpp | 8 +++++ src/server/ArgumentsSettings.h | 7 +++++ src/server/ServerPlayer.cpp | 1 + 7 files changed, 48 insertions(+), 19 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 6487664..51ad3a3 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -553,7 +553,7 @@ void Minecraft::tick(int nTick, int maxTick) { level->tickEntities(); level->tick(); #ifndef STANDALONE_SERVER - TIMER_POP_PUSH("animateTick"); + TIMER_POP_PUSH("animateTick"); if (player) { level->animateTick(Mth::floor(player->x), Mth::floor(player->y), Mth::floor(player->z)); } diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index 8aa14cb..9c0e812 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -30,20 +30,29 @@ void signal_callback_handler(int signum) { int main(int numArguments, char* pszArgs[]) { ArgumentsSettings aSettings(numArguments, pszArgs); if(aSettings.getShowHelp()) { + // TODO: Map with args and print it with std::cout and for loop + // TODO: World size setting + ArgumentsSettings defaultSettings(0, NULL); + printf("Minecraft Pockect Edition Server %s\n", Common::getGameVersionString("").c_str()); printf("-------------------------------------------------------\n"); + printf("--cachepath - Path to where the server can store temp stuff (not sure if this is used) [default: \"%s\"]\n", defaultSettings.getCachePath().c_str()); printf("--externalpath - The path to the place where the server should store the levels. [default: \"%s\"]\n", defaultSettings.getExternalPath().c_str()); printf("--levelname - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelName().c_str()); + printf("--gamemode - The name of the gamemode [default: \"%s\"]\n", defaultSettings.getGamemode().c_str()); printf("--leveldir - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelDir().c_str()); printf("--help - Shows this message.\n"); printf("--port - The port to run the server on. [default: %d]\n", defaultSettings.getPort()); printf("--serverkey - The key that the server should use for API calls. [default: \"%s\"]\n", defaultSettings.getServerKey().c_str()); + printf("-------------------------------------------------------\n"); + return 0; } printf("Level Name: %s\n", aSettings.getLevelName().c_str()); + AppContext appContext; appContext.platform = new AppPlatform(); App* app = new MAIN_CLASS(); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index df0a02d..213ff28 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -352,6 +352,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, AddItemE } void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, TakeItemEntityPacket* packet) { + printf("TakeItemEntityPacket \n"); if (!level) return; Entity* e = level->getEntity(packet->itemId); @@ -852,6 +853,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, SetHealt if (!level || !minecraft->player) return; + printf("SetHealthPacket \n"); minecraft->player->hurtTo(packet->health); } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index c2ae85c..78f02db 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -414,14 +414,16 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay (packet->y - entity->y) * (packet->y - entity->y) + (packet->z - entity->z) * (packet->z - entity->z)); float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); - - if (speed < 2.5f) { - entity->xd = entity->yd = entity->zd = 0; - entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + // TODO: Replace with Entity::move() + // if (speed < 2.5f) { + entity->xd = entity->yd = entity->zd = 0; + entity->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + // entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + // broadcast this packet to other clients redistributePacket(packet, source); - } + //} player->setLastMoveTicks(minecraft->getTicks()); } @@ -459,7 +461,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RemoveBl } } - //oldTile->spawnResources(level, x, y, z, data, 1); //@todo + oldTile->spawnResources(level, x, y, z, data, 1); //@todo oldTile->playerDestroy(level, player, x, y, z, data); } @@ -934,19 +936,19 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SetHealthPacket* packet ) { - LOGI("SetHealthPacket\n"); + LOGI("net idi nahui\n"); - for (unsigned int i = 0; i < level->players.size(); ++i) { - Player* p = level->players[i]; - if (p->owner == source) { - if (packet->health <= -32) { - int diff = packet->health - SetHealthPacket::HEALTH_MODIFY_OFFSET; - if (diff > 0) p->hurt(NULL, diff); - else if (diff < 0) p->heal(-diff); - } - break; - } - } + // for (unsigned int i = 0; i < level->players.size(); ++i) { + // Player* p = level->players[i]; + // if (p->owner == source) { + // if (packet->health <= -32) { + // int diff = packet->health - SetHealthPacket::HEALTH_MODIFY_OFFSET; + // if (diff > 0) p->hurt(NULL, diff); + // else if (diff < 0) p->heal(-diff); + // } + // break; + // } + // } } void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SignUpdatePacket* packet ) { diff --git a/src/server/ArgumentsSettings.cpp b/src/server/ArgumentsSettings.cpp index 88bcd51..d41633c 100755 --- a/src/server/ArgumentsSettings.cpp +++ b/src/server/ArgumentsSettings.cpp @@ -17,6 +17,11 @@ ArgumentsSettings::ArgumentsSettings(int numArguments, char** arguments) levelName = std::string(arguments[a+1]); a++; // Skip the next argument since it's part of this one. } + } else if(strcmp(arguments[a], "--gamemode") == 0) { + if(a + 1 < numArguments) { + gamemode = std::string(arguments[a+1]); + a++; // Skip the next argument since it's part of this one. + } } else if(strcmp(arguments[a], "--leveldir") == 0) { if(a + 1 < numArguments) { levelDir = std::string(arguments[a+1]); @@ -51,6 +56,9 @@ std::string ArgumentsSettings::getServerKey() { std::string ArgumentsSettings::getCachePath() { return cachePath; } +std::string ArgumentsSettings::getGamemode() { + return gamemode; +} std::string ArgumentsSettings::getLevelDir() { return levelDir; } diff --git a/src/server/ArgumentsSettings.h b/src/server/ArgumentsSettings.h index 0dcd781..2861b48 100755 --- a/src/server/ArgumentsSettings.h +++ b/src/server/ArgumentsSettings.h @@ -4,20 +4,27 @@ class ArgumentsSettings { public: ArgumentsSettings(int numArguments, char** arguments); + std::string getExternalPath(); std::string getLevelName(); std::string getServerKey(); std::string getCachePath(); std::string getLevelDir(); + std::string getGamemode(); + bool getShowHelp(); + int getPort(); private: std::string cachePath; std::string externalPath; std::string levelName; + std::string gamemode; std::string levelDir; std::string serverKey; + bool showHelp; + int port; }; diff --git a/src/server/ServerPlayer.cpp b/src/server/ServerPlayer.cpp index 3f89033..da47976 100755 --- a/src/server/ServerPlayer.cpp +++ b/src/server/ServerPlayer.cpp @@ -72,6 +72,7 @@ void ServerPlayer::take( Entity* e, int orgCount ) { TakeItemEntityPacket packet(e->entityId, entityId); // SendInventoryPacket packet(this, false); _mc->raknetInstance->send(packet); + printf("TakeItemEntityPacket \n"); LOGI("Inventory:\n"); for (int i = 0; i < inventory->numLinkedSlots; i++) { From 73fb2a2b3dd57cf9fdcfa4abd06923163649a367 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 28 Mar 2026 17:18:38 +0200 Subject: [PATCH 043/189] wtf --- src/server/ServerPlayer.cpp | 9 +++++++++ src/server/ServerPlayer.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/server/ServerPlayer.cpp b/src/server/ServerPlayer.cpp index da47976..9f4f1dc 100755 --- a/src/server/ServerPlayer.cpp +++ b/src/server/ServerPlayer.cpp @@ -175,3 +175,12 @@ void ServerPlayer::displayClientMessage( const std::string& messageId ) { ChatPacket package(messageId); _mc->raknetInstance->send(owner, package); } + +void ServerPlayer::causeFallDamage(float distance) { + int dmg = (int) ceil((distance - 3)); + if (dmg > 0) { + SetHealthPacket packet(SetHealthPacket::HEALTH_MODIFY_OFFSET + dmg); + _mc->raknetInstance->send(owner, packet); + } + super::causeFallDamage(distance); +} \ No newline at end of file diff --git a/src/server/ServerPlayer.h b/src/server/ServerPlayer.h index 77579d9..c578025 100755 --- a/src/server/ServerPlayer.h +++ b/src/server/ServerPlayer.h @@ -52,6 +52,8 @@ public: void setNewProto(bool proto) { isNewProto = proto; } bool getProto() { return isNewProto; } + + virtual void causeFallDamage(float distance); private: void nextContainerCounter(); void setContainerMenu( BaseContainerMenu* menu ); From 5783fb93f369d6d4e4999a7df21863eb296cbb41 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 28 Mar 2026 17:39:37 +0200 Subject: [PATCH 044/189] forgot to comment --- src/network/ServerSideNetworkHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 78f02db..c01677a 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -461,7 +461,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RemoveBl } } - oldTile->spawnResources(level, x, y, z, data, 1); //@todo + // oldTile->spawnResources(level, x, y, z, data, 1); //@todo oldTile->playerDestroy(level, player, x, y, z, data); } From ba3ed3b4dd4c373e9d8f7f5e5be90bbed9ddc51f Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 28 Mar 2026 18:37:02 +0200 Subject: [PATCH 045/189] i dont see reason of this error --- src/network/ClientSideNetworkHandler.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 213ff28..2ae545a 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -99,6 +99,7 @@ void ClientSideNetworkHandler::onUnableToConnect() void ClientSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid) { + // TODO: Good disconnecting LOGI("onDisconnect\n"); if (level) { @@ -398,7 +399,6 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, SendInventoryPacket* packet) { if (!level) return; - // TODO: Linked slots if (packet->entityId == minecraft->player->entityId) { auto items = packet->items; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index c01677a..22f54e1 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -29,6 +29,7 @@ #include "world/item/crafting/Recipe.h" #include "world/item/crafting/Recipes.h" #include +#include #ifndef STANDALONE_SERVER #include "../client/sound/SoundEngine.h" #endif @@ -410,17 +411,20 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay { ServerPlayer* player = (ServerPlayer*) getPlayer(source); - float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + - (packet->y - entity->y) * (packet->y - entity->y) + - (packet->z - entity->z) * (packet->z - entity->z)); - float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); + // float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + + // (packet->y - entity->y) * (packet->y - entity->y) + + // (packet->z - entity->z) * (packet->z - entity->z)); + // float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); // TODO: Replace with Entity::move() // if (speed < 2.5f) { - entity->xd = entity->yd = entity->zd = 0; - entity->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + printf("Packet do: %f, %f, %f \n", packet->x, packet->y, packet->z); + printf("Entity do: %f, %f, %f \n", entity->x, entity->y, entity->z); + printf("Delta: %f %f %f \n", packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + player->xd = player->yd = player->zd = 0; + player->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + printf("Entity after: %f, %f, %f \n", entity->x, entity->y, entity->z); // entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); - // broadcast this packet to other clients redistributePacket(packet, source); //} From 4363157cd90f2ba9bfe94930614a7c717bf36c16 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 28 Mar 2026 21:08:52 +0200 Subject: [PATCH 046/189] Delete useless class --- src/network/NATPunchHandler.cpp | 33 ------------------------ src/network/NATPunchHandler.h | 24 ----------------- src/network/ServerSideNetworkHandler.cpp | 4 +-- 3 files changed, 2 insertions(+), 59 deletions(-) delete mode 100755 src/network/NATPunchHandler.cpp delete mode 100755 src/network/NATPunchHandler.h diff --git a/src/network/NATPunchHandler.cpp b/src/network/NATPunchHandler.cpp deleted file mode 100755 index 35108b0..0000000 --- a/src/network/NATPunchHandler.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "NATPunchHandler.h" -#include "../raknet/TCPInterface.h" -#include "../raknet/HTTPConnection.h" -#include "PHPDirectoryServer2.h" - -using namespace RakNet; -NATPuchHandler::NATPuchHandler() { - tcpInterface = new TCPInterface; -} -NATPuchHandler::~NATPuchHandler() { - delete tcpInterface; -} - -void NATPuchHandler::initialize() { - tcpInterface->Start(0, 64); -} - -void NATPuchHandler::registerToGameList(const RakNet::RakString& serverName, int port) { - HTTPConnection httpConnection; - httpConnection.Init(tcpInterface, "johanbernhardsson.se"); - PHPDirectoryServer2 directoryServer; - directoryServer.Init(&httpConnection, "/DirectoryServer.php"); - directoryServer.UploadTable("", serverName, port, true); -} - -void NATPuchHandler::removeFromGameList() { - -} - -void NATPuchHandler::close() { - -} - diff --git a/src/network/NATPunchHandler.h b/src/network/NATPunchHandler.h deleted file mode 100755 index 0246c0d..0000000 --- a/src/network/NATPunchHandler.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _MINECRAFT_NETWORK_NATPUNCHHANDLER_H_ -#define _MINECRAFT_NETWORK_NATPUNCHHANDLER_H_ -#include "../raknet/TCPInterface.h" -#include "../raknet/RakString.h" -class NATPuchHandler { -public: - enum NATPuchHandlerStatus { - NATPuchInitilized = 0, - NATPuchFetchingServerList = 1, - NATPuchConnecting = 2, - NATPuchConnected = 3, - NATPuchDissconnected = 4 - }; - NATPuchHandler(); - ~NATPuchHandler(); - void initialize(); - void registerToGameList(const RakNet::RakString& serverName, int port); - void removeFromGameList(); - void close(); -private: - RakNet::TCPInterface *tcpInterface; -}; - -#endif /* _MINECRAFT_NETWORK_NATPUNCHHANDLER_H_ */ diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 22f54e1..1e999c8 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -418,8 +418,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay // TODO: Replace with Entity::move() // if (speed < 2.5f) { - printf("Packet do: %f, %f, %f \n", packet->x, packet->y, packet->z); - printf("Entity do: %f, %f, %f \n", entity->x, entity->y, entity->z); + printf("Packet before: %f, %f, %f \n", packet->x, packet->y, packet->z); + printf("Entity before: %f, %f, %f \n", entity->x, entity->y, entity->z); printf("Delta: %f %f %f \n", packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); player->xd = player->yd = player->zd = 0; player->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); From 470c28d83a1c4710220fa0beb398517a737bf02c Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sun, 29 Mar 2026 00:36:36 +0300 Subject: [PATCH 047/189] I dont know what im doin please help --- src/network/ServerSideNetworkHandler.cpp | 30 +++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 1e999c8..fa61054 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -7,6 +7,7 @@ #include "../world/inventory/BaseContainerMenu.h" #include "network/packet/ContainerSetSlotPacket.h" #include "network/packet/LoginStatusPacket.h" +#include "network/packet/MovePlayerPacket.h" #include "network/packet/RemoveBlockPacket.h" #include "network/packet/SendInventoryPacket.h" #include "network/packet/UpdateBlockPacket.h" @@ -411,23 +412,30 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay { ServerPlayer* player = (ServerPlayer*) getPlayer(source); - // float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + - // (packet->y - entity->y) * (packet->y - entity->y) + - // (packet->z - entity->z) * (packet->z - entity->z)); - // float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); + float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + + (packet->z - entity->z) * (packet->z - entity->z)); + float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); - // TODO: Replace with Entity::move() - // if (speed < 2.5f) { - printf("Packet before: %f, %f, %f \n", packet->x, packet->y, packet->z); - printf("Entity before: %f, %f, %f \n", entity->x, entity->y, entity->z); - printf("Delta: %f %f %f \n", packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + player->xRot = packet->xRot; + player->yRot = packet->yRot; + + packet->y += 1.62f; + + if (speed < 2.5f) { + LOGI("Packet before: %f, %f, %f \n", packet->x, packet->y, packet->z); + LOGI("Entity before: %f, %f, %f \n", entity->x, entity->y, entity->z); + LOGI("Delta: %f %f %f \n", packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); player->xd = player->yd = player->zd = 0; player->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); - printf("Entity after: %f, %f, %f \n", entity->x, entity->y, entity->z); + // player->travel(packet->x - entity->x, packet->z - entity->z); + LOGI("Entity after: %f, %f, %f \n", entity->x, entity->y, entity->z); // entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); // broadcast this packet to other clients redistributePacket(packet, source); - //} + } else { + MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); + raknetInstance->send(refuse); + } player->setLastMoveTicks(minecraft->getTicks()); } From f016f00eab485939cc07d53c12bb124f6f4cbfc0 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sun, 29 Mar 2026 00:16:19 +0200 Subject: [PATCH 048/189] idk?? --- src/client/player/LocalPlayer.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 31 ++++++++++++++---------- src/server/ServerPlayer.cpp | 1 + src/world/entity/Mob.cpp | 2 +- src/world/entity/Mob.h | 3 +++ 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/client/player/LocalPlayer.cpp b/src/client/player/LocalPlayer.cpp index a4d3b74..88f7835 100755 --- a/src/client/player/LocalPlayer.cpp +++ b/src/client/player/LocalPlayer.cpp @@ -438,7 +438,7 @@ void LocalPlayer::tick() { { if (std::abs(x - sentX) > .1f || std::abs(y - sentY) > .01f || std::abs(z - sentZ) > .1f || std::abs(sentRotX - xRot) > 1 || std::abs(sentRotY - yRot) > 1) { - MovePlayerPacket packet(entityId, x, y - heightOffset, z, xRot, yRot); + MovePlayerPacket packet(entityId, xxa, y - heightOffset, yya, xRot, yRot); minecraft->raknetInstance->send(packet); sentX = x; sentY = y; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index fa61054..1981b87 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -416,26 +416,31 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay (packet->z - entity->z) * (packet->z - entity->z)); float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); - player->xRot = packet->xRot; - player->yRot = packet->yRot; + player->xRot = player->xRotO = packet->xRot; + player->yRot = player->yRotO = packet->yRot; - packet->y += 1.62f; + // packet->y += 1.62f; - if (speed < 2.5f) { - LOGI("Packet before: %f, %f, %f \n", packet->x, packet->y, packet->z); + // if (speed < 2.5f) { + LOGI("Packets: %f, %f, %f \n", packet->x, packet->y, packet->z); LOGI("Entity before: %f, %f, %f \n", entity->x, entity->y, entity->z); - LOGI("Delta: %f %f %f \n", packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); - player->xd = player->yd = player->zd = 0; - player->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + LOGI("OnGround: %d \n", entity->onGround); + //player->xd = player->yd = player->zd = 0; + + player->setxxa(packet->x); + player->setYya(packet->z); + // player->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + // player->travel(packet->x - entity->x, packet->z - entity->z); - LOGI("Entity after: %f, %f, %f \n", entity->x, entity->y, entity->z); // entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + LOGI("Entity after: %f, %f, %f \n", entity->x, entity->y, entity->z); + // broadcast this packet to other clients redistributePacket(packet, source); - } else { - MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); - raknetInstance->send(refuse); - } + // } else { + //MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); + //raknetInstance->send(refuse); + // } player->setLastMoveTicks(minecraft->getTicks()); } diff --git a/src/server/ServerPlayer.cpp b/src/server/ServerPlayer.cpp index 9f4f1dc..085fa8b 100755 --- a/src/server/ServerPlayer.cpp +++ b/src/server/ServerPlayer.cpp @@ -49,6 +49,7 @@ void ServerPlayer::stopSleepInBed(bool forcefulWakeUp, bool updateLevelList, boo void ServerPlayer::aiStep() { updateAttackAnim(); super::aiStep(); + Mob::aiStep(); } void ServerPlayer::tick() { diff --git a/src/world/entity/Mob.cpp b/src/world/entity/Mob.cpp index cc784f0..aed03dd 100755 --- a/src/world/entity/Mob.cpp +++ b/src/world/entity/Mob.cpp @@ -728,8 +728,8 @@ bool Mob::isWaterMob() void Mob::aiStep() { + printf("%f %f \n", xxa, yya); //@todo? 30 lines of code here in java version - TIMER_PUSH("ai"); if (isImmobile()) { jumping = false; diff --git a/src/world/entity/Mob.h b/src/world/entity/Mob.h index 7e90196..50045cb 100755 --- a/src/world/entity/Mob.h +++ b/src/world/entity/Mob.h @@ -223,6 +223,9 @@ protected: double xc, yc, zc; public: + void setxxa(float xxa) { this->xxa = xxa; } + void setyya(float yya) { this->yya = yya; } + // Cape position accessors (for renderers) double getCapeX() const { return xCape; } double getCapeY() const { return yCape; } From 3cfa2d9ee7e9567503228e7e8f7a1384e7a9a43c Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sun, 29 Mar 2026 16:53:46 +0200 Subject: [PATCH 049/189] FIX IT AHTUNG AHTUNG ALL DOESNT WORK FIX IT FIX IT FIX IT FIX IT BIG WARNING BIG WARNING --- src/client/gui/Gui.cpp | 1 - src/network/ServerSideNetworkHandler.cpp | 41 ++++++++++++++---------- src/server/ServerPlayer.cpp | 1 - src/world/entity/Entity.h | 2 +- src/world/entity/Mob.cpp | 1 - 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index ccc9c26..7685813 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -730,7 +730,6 @@ void Gui::renderDebugInfo() { // Position float px = p->x, py = p->y - p->heightOffset, pz = p->z; - posTranslator.to(px, py, pz); int bx = (int)floorf(px), by = (int)floorf(py), bz = (int)floorf(pz); int cx = bx >> 4, cz = bz >> 4; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 1981b87..40ac4a1 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -406,38 +406,45 @@ void ServerSideNetworkHandler::onReady_RequestedChunks(const RakNet::RakNetGUID& void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlayerPacket* packet) { if (!level) return; - + //LOGI("MovePlayerPacket\n"); - if (Entity* entity = level->getEntity(packet->entityId)) - { + if (Entity* entity = level->getEntity(packet->entityId)) { ServerPlayer* player = (ServerPlayer*) getPlayer(source); float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + (packet->z - entity->z) * (packet->z - entity->z)); float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); - - player->xRot = player->xRotO = packet->xRot; - player->yRot = player->yRotO = packet->yRot; - // packet->y += 1.62f; - - // if (speed < 2.5f) { - LOGI("Packets: %f, %f, %f \n", packet->x, packet->y, packet->z); + if (speed < 1.f) { + LOGI("Packet: %f, %f, %f \n", packet->x, packet->y, packet->z); LOGI("Entity before: %f, %f, %f \n", entity->x, entity->y, entity->z); LOGI("OnGround: %d \n", entity->onGround); - //player->xd = player->yd = player->zd = 0; - player->setxxa(packet->x); - player->setYya(packet->z); - // player->move(packet->x - entity->x, packet->y - entity->y, packet->z - entity->z); + // @note: packet->y contains y with subtracted entity->heightOffset + float ya = packet->y - entity->y - entity->heightOffset; + + LOGI("y: %f \n", ya); + + float yaOrg = ya; + + // @BIGWARNING @fixme: blocks around work as shit + std::vector& aABBs = level->getCubes(entity, entity->bb.expand(0, ya, 0)); - // player->travel(packet->x - entity->x, packet->z - entity->z); - // entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + for (unsigned int i = 0; i < aABBs.size(); i++) + ya = aABBs[i].clipYCollide(entity->bb, ya); + + bool og = yaOrg != ya && yaOrg < 0; + + entity->onGround = og; + entity->checkFallDamage(ya, og); + entity->xd = entity->yd = entity->zd = 0; + entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + LOGI("Entity after: %f, %f, %f \n", entity->x, entity->y, entity->z); // broadcast this packet to other clients redistributePacket(packet, source); - // } else { + } // else { //MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); //raknetInstance->send(refuse); // } diff --git a/src/server/ServerPlayer.cpp b/src/server/ServerPlayer.cpp index 085fa8b..9f4f1dc 100755 --- a/src/server/ServerPlayer.cpp +++ b/src/server/ServerPlayer.cpp @@ -49,7 +49,6 @@ void ServerPlayer::stopSleepInBed(bool forcefulWakeUp, bool updateLevelList, boo void ServerPlayer::aiStep() { updateAttackAnim(); super::aiStep(); - Mob::aiStep(); } void ServerPlayer::tick() { diff --git a/src/world/entity/Entity.h b/src/world/entity/Entity.h index 23c229f..b865902 100755 --- a/src/world/entity/Entity.h +++ b/src/world/entity/Entity.h @@ -129,6 +129,7 @@ public: virtual bool isHangingEntity(); virtual int getAuxData(); + virtual void checkFallDamage(float ya, bool onGround); protected: virtual void setRot(float yRot, float xRot); @@ -137,7 +138,6 @@ protected: virtual void resetPos(bool clearMore); virtual void outOfWorld(); - virtual void checkFallDamage(float ya, bool onGround); virtual void causeFallDamage(float fallDamage2); virtual void markHurt(); diff --git a/src/world/entity/Mob.cpp b/src/world/entity/Mob.cpp index aed03dd..614ccdd 100755 --- a/src/world/entity/Mob.cpp +++ b/src/world/entity/Mob.cpp @@ -728,7 +728,6 @@ bool Mob::isWaterMob() void Mob::aiStep() { - printf("%f %f \n", xxa, yya); //@todo? 30 lines of code here in java version TIMER_PUSH("ai"); if (isImmobile()) { From 51945750925a827dd853e9d1c2d50d54797458a6 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 30 Mar 2026 14:04:16 +0300 Subject: [PATCH 050/189] FEAT: Meet the commands --- CMakeLists.txt | 3 + src/client/Minecraft.cpp | 12 ++- src/client/Minecraft.h | 7 ++ src/client/gui/screens/ConsoleScreen.cpp | 127 ++--------------------- src/client/gui/screens/ConsoleScreen.h | 1 - src/commands/Command.hpp | 25 +++++ src/commands/CommandHelp.cpp | 27 +++++ src/commands/CommandHelp.hpp | 9 ++ src/commands/CommandKick.cpp | 37 +++++++ src/commands/CommandKick.hpp | 9 ++ src/commands/CommandManager.cpp | 71 +++++++++++++ src/commands/CommandManager.hpp | 21 ++++ 12 files changed, 230 insertions(+), 119 deletions(-) create mode 100644 src/commands/Command.hpp create mode 100644 src/commands/CommandHelp.cpp create mode 100644 src/commands/CommandHelp.hpp create mode 100644 src/commands/CommandKick.cpp create mode 100644 src/commands/CommandKick.hpp create mode 100644 src/commands/CommandManager.cpp create mode 100644 src/commands/CommandManager.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c3acea..7650b9a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,6 +211,7 @@ file(GLOB SERVER_SOURCES "src/world/level/tile/entity/*.cpp" "src/world/phys/HitResult.cpp" + "src/commands/*.cpp" ) file(GLOB CLIENT_SOURCES @@ -292,6 +293,8 @@ file(GLOB CLIENT_SOURCES "src/AppPlatform_glfw.cpp" "src/main.cpp" + + "src/commands/*.cpp" ) if (${PLATFORM} STREQUAL "Desktop") diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 51ad3a3..2b0075e 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -2,6 +2,7 @@ #include "Options.h" #include "client/Options.h" #include "client/player/input/IBuildInput.h" +#include "commands/CommandManager.hpp" #include "platform/input/Keyboard.h" #include "world/item/Item.h" #include "world/item/ItemInstance.h" @@ -175,7 +176,8 @@ Minecraft::Minecraft() : _powerVr(false), commandPort(4711), reserved_d1(0),reserved_d2(0), - reserved_f1(0),reserved_f2(0), options(this) + reserved_f1(0),reserved_f2(0), options(this), + m_commandManager() { //#ifdef ANDROID @@ -1597,3 +1599,11 @@ void Minecraft::optionUpdated(OptionId option, int value ) { setSize(width, height); } } + +void Minecraft::addMessage(const std::string& msg) { +#ifndef STANDALONE_SERVER + gui.addMessage(msg); +#else + LOGI("%s", msg.c_str()); +#endif +} \ No newline at end of file diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index a7f5abc..61768cb 100755 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -2,6 +2,7 @@ #define NET_MINECRAFT_CLIENT__Minecraft_H__ #include "Options.h" +#include "commands/CommandManager.hpp" #ifndef STANDALONE_SERVER #include "MouseHandler.h" #include "gui/Gui.h" @@ -122,11 +123,15 @@ public: void optionUpdated(OptionId option, int value); int getTicks() { return ticks; } + + void addMessage(const std::string& msg); #ifdef __APPLE__ bool _isSuperFast; bool isSuperFast() { return _isSuperFast; } #endif + CommandManager& commandManager() { return m_commandManager; } + protected: void _levelGenerated(); @@ -227,6 +232,8 @@ private: PerfRenderer* _perfRenderer; CommandServer* _commandServer; + + CommandManager m_commandManager; }; #endif /*NET_MINECRAFT_CLIENT__Minecraft_H__*/ diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index 939cb74..6380f48 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -8,6 +8,7 @@ #include "../../../network/ServerSideNetworkHandler.h" #include "../../../network/packet/ChatPacket.h" #include "../../../platform/log.h" +#include "util/StringUtils.h" #include #include @@ -54,141 +55,33 @@ void ConsoleScreen::charPressed(char inputChar) _input += inputChar; } -// --------------------------------------------------------------------------- -// execute: run _input as a command, print result, close screen -// --------------------------------------------------------------------------- void ConsoleScreen::execute() { + if (!minecraft->level) return; + if (_input.empty()) { - minecraft->setScreen(NULL); - return; + return minecraft->setScreen(NULL); } if (_input[0] == '/') { // Command - std::string result = processCommand(_input); - if (!result.empty()) - minecraft->gui.addMessage(result); + _input = Util::stringTrim(_input.substr(1)); + minecraft->commandManager().execute(*minecraft, _input); } else { - // Chat message: message - std::string msg = std::string("<") + minecraft->player->name + "> " + _input; + // @ai @rewrite if (minecraft->netCallback && minecraft->raknetInstance->isServer()) { - // Hosting a LAN game: displayGameMessage shows locally + broadcasts MessagePacket to clients - static_cast(minecraft->netCallback)->displayGameMessage(msg); + static_cast(minecraft->netCallback)->displayGameMessage(_input); } else if (minecraft->netCallback) { - // Connected client: send ChatPacket to server; server echoes it back as MessagePacket - ChatPacket chatPkt(msg); + ChatPacket chatPkt(_input); minecraft->raknetInstance->send(chatPkt); } else { - // Singleplayer: show locally only - minecraft->gui.addMessage(msg); + minecraft->gui.addMessage(_input); } } minecraft->setScreen(NULL); } -// --------------------------------------------------------------------------- -// processCommand -// --------------------------------------------------------------------------- -static std::string trim(const std::string& s) { - size_t a = s.find_first_not_of(" \t"); - if (a == std::string::npos) return ""; - size_t b = s.find_last_not_of(" \t"); - return s.substr(a, b - a + 1); -} - -std::string ConsoleScreen::processCommand(const std::string& raw) -{ - // strip leading '/' - std::string line = raw; - if (!line.empty() && line[0] == '/') line = line.substr(1); - line = trim(line); - - // tokenise - std::vector args; - { - std::istringstream ss(line); - std::string tok; - while (ss >> tok) args.push_back(tok); - } - - if (args.empty()) return ""; - - Level* level = minecraft->level; - if (!level) return "No level loaded."; - - // ----------------------------------------------------------------------- - // /time ... - // ----------------------------------------------------------------------- - if (args[0] == "time") { - if (args.size() < 2) - return "Usage: /time ..."; - - const std::string& sub = args[1]; - - // -- time add ----------------------------------------------- - if (sub == "add") { - if (args.size() < 3) return "Usage: /time add "; - long delta = std::atol(args[2].c_str()); - long newTime = level->getTime() + delta; - level->setTime(newTime); - std::ostringstream out; - out << "Set the time to " << (newTime % Level::TICKS_PER_DAY); - return out.str(); - } - - // -- time set ----------------------- - if (sub == "set") { - if (args.size() < 3) return "Usage: /time set "; - const std::string& val = args[2]; - - long t = -1; - if (val == "day") t = 1000; - else if (val == "noon") t = 6000; - else if (val == "night") t = 13000; - else if (val == "midnight") t = 18000; - else { - // numeric — accept positive integers only - bool numeric = true; - for (char c : val) - if (!std::isdigit((unsigned char)c)) { numeric = false; break; } - if (!numeric) return std::string("Unknown value: ") + val; - t = std::atol(val.c_str()); - } - - // Preserve the total day count so only the time-of-day changes - long dayCount = level->getTime() / Level::TICKS_PER_DAY; - long newTime = dayCount * Level::TICKS_PER_DAY + (t % Level::TICKS_PER_DAY); - level->setTime(newTime); - std::ostringstream out; - out << "Set the time to " << t; - return out.str(); - } - - // -- time query ------------------------------ - if (sub == "query") { - if (args.size() < 3) return "Usage: /time query "; - const std::string& what = args[2]; - - long total = level->getTime(); - long daytime = total % Level::TICKS_PER_DAY; - long day = total / Level::TICKS_PER_DAY; - - std::ostringstream out; - if (what == "daytime") { out << "The time of day is " << daytime; } - else if (what == "gametime") { out << "The game time is " << total; } - else if (what == "day") { out << "The day is " << day; } - else return std::string("Unknown query: ") + what; - return out.str(); - } - - return "Unknown sub-command. Usage: /time ..."; - } - - return std::string("Unknown command: /") + args[0]; -} - // --------------------------------------------------------------------------- // render // --------------------------------------------------------------------------- diff --git a/src/client/gui/screens/ConsoleScreen.h b/src/client/gui/screens/ConsoleScreen.h index e0074b9..f0c1fd5 100644 --- a/src/client/gui/screens/ConsoleScreen.h +++ b/src/client/gui/screens/ConsoleScreen.h @@ -25,7 +25,6 @@ public: private: void execute(); - std::string processCommand(const std::string& cmd); std::string _input; int _cursorBlink; // tick counter for cursor blink diff --git a/src/commands/Command.hpp b/src/commands/Command.hpp new file mode 100644 index 0000000..ee2a5e2 --- /dev/null +++ b/src/commands/Command.hpp @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +enum CommandFlags { + COMMAND_FLAG_SINGLEPLAYER_ONLY = (1 << 1), + COMMAND_FLAG_NO_ARGS = (1 << 2), +}; + +class Minecraft; + +class Command { +public: + const std::string& getName() { return m_name; } + const CommandFlags getFlags() { return m_flags; } + + virtual void execute(Minecraft& mc, const std::vector& args) = 0; + virtual void printHelp(Minecraft& mc) = 0; + +protected: + Command(const std::string& name, CommandFlags flags = (CommandFlags)0) : m_name(name), m_flags(flags) {} + + const std::string m_name; + const CommandFlags m_flags; +}; \ No newline at end of file diff --git a/src/commands/CommandHelp.cpp b/src/commands/CommandHelp.cpp new file mode 100644 index 0000000..c922b4b --- /dev/null +++ b/src/commands/CommandHelp.cpp @@ -0,0 +1,27 @@ +#include "CommandHelp.hpp" +#include "commands/Command.hpp" +#include "CommandManager.hpp" +#include + +CommandHelp::CommandHelp() : Command("help") {} + +void CommandHelp::execute(Minecraft& mc, const std::vector& args) { + if (args.empty()) { + auto cmds = mc.commandManager().getListAllCommands(); + + mc.addMessage("Usage: /help "); + mc.addMessage("List of all commands:"); + + for (auto& cmd : cmds) { + mc.addMessage(" - " + cmd); + } + } else { + Command* cmd = mc.commandManager().getCommand(args[0]); + + if (cmd != nullptr) { + cmd->printHelp(mc); + } + } +} + +void CommandHelp::printHelp(Minecraft& mc) {} \ No newline at end of file diff --git a/src/commands/CommandHelp.hpp b/src/commands/CommandHelp.hpp new file mode 100644 index 0000000..88bee09 --- /dev/null +++ b/src/commands/CommandHelp.hpp @@ -0,0 +1,9 @@ +#include "Command.hpp" + +class CommandHelp : public Command { +public: + CommandHelp(); + + void execute(Minecraft& mc, const std::vector& args); + void printHelp(Minecraft& mc); +}; \ No newline at end of file diff --git a/src/commands/CommandKick.cpp b/src/commands/CommandKick.cpp new file mode 100644 index 0000000..ed167e4 --- /dev/null +++ b/src/commands/CommandKick.cpp @@ -0,0 +1,37 @@ +#include "CommandKick.hpp" +#include "commands/Command.hpp" +#include "network/RakNetInstance.h" +#include "raknet/RakPeer.h" +#include "world/level/Level.h" +#include +#include + + +CommandKick::CommandKick() : Command("kick") {} + +void CommandKick::execute(Minecraft& mc, const std::vector& args) { + if (args.empty()) { + return printHelp(mc); + } + + auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args] (auto& it) -> bool { + return it->name == args[0]; + }); + + if (it == mc.level->players.end()) { + return mc.addMessage("kick: can't find player with name " + args[0]); + } + + if (*it == (Player*)mc.player) { + return mc.addMessage("kick: you can't kick urself lol"); + } + + mc.level->removePlayer(*it); + (*it)->remove(); + mc.raknetInstance->getPeer()->CloseConnection((*it)->owner, true); + mc.addMessage("kick: successfully kicked player " + args[0]); +} + +void CommandKick::printHelp(Minecraft& mc) { + mc.addMessage("Usage: /kick "); +} \ No newline at end of file diff --git a/src/commands/CommandKick.hpp b/src/commands/CommandKick.hpp new file mode 100644 index 0000000..c743aa4 --- /dev/null +++ b/src/commands/CommandKick.hpp @@ -0,0 +1,9 @@ +#include "Command.hpp" + +class CommandKick : public Command { +public: + CommandKick(); + + void execute(Minecraft& mc, const std::vector& args); + void printHelp(Minecraft& mc); +}; \ No newline at end of file diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp new file mode 100644 index 0000000..8ed2d18 --- /dev/null +++ b/src/commands/CommandManager.cpp @@ -0,0 +1,71 @@ +#include "CommandManager.hpp" +#include +#include +#include +#include "client/Minecraft.h" +#include "commands/Command.hpp" +#include "commands/CommandHelp.hpp" +#include "commands/CommandKick.hpp" +#include "network/packet/ChatPacket.h" +#include "network/RakNetInstance.h" +#include "world/level/Level.h" + + + +CommandManager::CommandManager() { + registerAllCommands(); +} + +void CommandManager::registerAllCommands() { + m_commands.push_back(new CommandHelp()); + m_commands.push_back(new CommandKick()); +} + +std::vector CommandManager::getListAllCommands() { + std::vector ret; + + for (auto& cmd : m_commands) { + ret.push_back(cmd->getName()); + } + + return ret; +} + +void CommandManager::execute(Minecraft& mc, const std::string& input) { + std::istringstream ss(input); + std::string cmd; + + ss >> cmd; + + auto it = std::find_if(m_commands.begin(), m_commands.end(), [cmd](auto& it) -> bool { + return it->getName() == cmd; + }); + + if (it == m_commands.end()) { + return mc.addMessage("Command /" + cmd + " not found"); + } + + std::vector args; + + std::string tok; + while (ss >> tok) args.push_back(tok); + + if (!mc.level->isClientSide || (*it)->getFlags() & CommandFlags::COMMAND_FLAG_SINGLEPLAYER_ONLY) { + (*it)->execute(mc, args); + } else { + ChatPacket packet("/" + input); + mc.raknetInstance->send(packet); + } +} + +Command* CommandManager::getCommand(const std::string& name) { + auto it = std::find_if(m_commands.begin(), m_commands.end(), [name](auto& it) -> bool { + return it->getName() == name; + }); + + if (it == m_commands.end()) { + return *it; + } + + return nullptr; +} \ No newline at end of file diff --git a/src/commands/CommandManager.hpp b/src/commands/CommandManager.hpp new file mode 100644 index 0000000..1304877 --- /dev/null +++ b/src/commands/CommandManager.hpp @@ -0,0 +1,21 @@ +#pragma once +#include +#include + +#include "Command.hpp" + +class CommandManager { +public: + CommandManager(); + + std::vector getListAllCommands(); + + void execute(Minecraft& mc, const std::string& input); + + Command* getCommand(const std::string& name); + +private: + void registerAllCommands(); + + std::vector m_commands; +}; \ No newline at end of file From 1ec347d5d55934faf2a220d98b66c7796c379286 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Tue, 31 Mar 2026 00:40:10 +0300 Subject: [PATCH 051/189] FEAT: Server operators --- src/client/Minecraft.cpp | 2 ++ src/client/gui/screens/ConsoleScreen.cpp | 2 +- src/commands/Command.cpp | 7 +++++ src/commands/Command.hpp | 5 +++- src/commands/CommandHelp.cpp | 2 +- src/commands/CommandHelp.hpp | 2 +- src/commands/CommandKick.cpp | 6 +++- src/commands/CommandKick.hpp | 2 +- src/commands/CommandManager.cpp | 6 ++-- src/commands/CommandManager.hpp | 2 +- src/commands/CommandOp.cpp | 35 ++++++++++++++++++++++++ src/commands/CommandOp.hpp | 9 ++++++ src/world/level/Level.h | 3 ++ 13 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 src/commands/Command.cpp create mode 100644 src/commands/CommandOp.cpp create mode 100644 src/commands/CommandOp.hpp diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 2b0075e..05e397b 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -277,6 +277,8 @@ void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, Loc } } this->level = level; + // So uhhh + level->ops.emplace(options.getStringValue(OPTIONS_USERNAME)); _hasSignaledGeneratingLevelFinished = false; #ifdef STANDALONE_SERVER const bool threadedLevelCreation = false; diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index 6380f48..9821f99 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -66,7 +66,7 @@ void ConsoleScreen::execute() if (_input[0] == '/') { // Command _input = Util::stringTrim(_input.substr(1)); - minecraft->commandManager().execute(*minecraft, _input); + minecraft->commandManager().execute(*minecraft, *minecraft->player, _input); } else { // @ai @rewrite if (minecraft->netCallback && minecraft->raknetInstance->isServer()) { diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp new file mode 100644 index 0000000..ebcbf3d --- /dev/null +++ b/src/commands/Command.cpp @@ -0,0 +1,7 @@ +#include "Command.hpp" +#include "world/level/Level.h" +#include + +bool Command::isPlayerOp(Minecraft& mc, Player& player) { + return mc.level->ops.find(player.name) != mc.level->ops.end(); +} \ No newline at end of file diff --git a/src/commands/Command.hpp b/src/commands/Command.hpp index ee2a5e2..f44c3df 100644 --- a/src/commands/Command.hpp +++ b/src/commands/Command.hpp @@ -8,13 +8,16 @@ enum CommandFlags { }; class Minecraft; +class Player; class Command { public: const std::string& getName() { return m_name; } const CommandFlags getFlags() { return m_flags; } - virtual void execute(Minecraft& mc, const std::vector& args) = 0; + bool isPlayerOp(Minecraft& mc, Player& player); + + virtual void execute(Minecraft& mc, Player& player, const std::vector& args) = 0; virtual void printHelp(Minecraft& mc) = 0; protected: diff --git a/src/commands/CommandHelp.cpp b/src/commands/CommandHelp.cpp index c922b4b..18f7741 100644 --- a/src/commands/CommandHelp.cpp +++ b/src/commands/CommandHelp.cpp @@ -5,7 +5,7 @@ CommandHelp::CommandHelp() : Command("help") {} -void CommandHelp::execute(Minecraft& mc, const std::vector& args) { +void CommandHelp::execute(Minecraft& mc, Player& player, const std::vector& args) { if (args.empty()) { auto cmds = mc.commandManager().getListAllCommands(); diff --git a/src/commands/CommandHelp.hpp b/src/commands/CommandHelp.hpp index 88bee09..48e1f1f 100644 --- a/src/commands/CommandHelp.hpp +++ b/src/commands/CommandHelp.hpp @@ -4,6 +4,6 @@ class CommandHelp : public Command { public: CommandHelp(); - void execute(Minecraft& mc, const std::vector& args); + void execute(Minecraft& mc, Player& player, const std::vector& args); void printHelp(Minecraft& mc); }; \ No newline at end of file diff --git a/src/commands/CommandKick.cpp b/src/commands/CommandKick.cpp index ed167e4..b08ba86 100644 --- a/src/commands/CommandKick.cpp +++ b/src/commands/CommandKick.cpp @@ -9,7 +9,11 @@ CommandKick::CommandKick() : Command("kick") {} -void CommandKick::execute(Minecraft& mc, const std::vector& args) { +void CommandKick::execute(Minecraft& mc, Player& player, const std::vector& args) { + if (!isPlayerOp(mc, player)) { + return mc.addMessage("You aren't enough priveleged to run this command"); + } + if (args.empty()) { return printHelp(mc); } diff --git a/src/commands/CommandKick.hpp b/src/commands/CommandKick.hpp index c743aa4..80225a8 100644 --- a/src/commands/CommandKick.hpp +++ b/src/commands/CommandKick.hpp @@ -4,6 +4,6 @@ class CommandKick : public Command { public: CommandKick(); - void execute(Minecraft& mc, const std::vector& args); + void execute(Minecraft& mc, Player& player, const std::vector& args); void printHelp(Minecraft& mc); }; \ No newline at end of file diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index 8ed2d18..2b7f7f0 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -6,6 +6,7 @@ #include "commands/Command.hpp" #include "commands/CommandHelp.hpp" #include "commands/CommandKick.hpp" +#include "commands/CommandOp.hpp" #include "network/packet/ChatPacket.h" #include "network/RakNetInstance.h" #include "world/level/Level.h" @@ -19,6 +20,7 @@ CommandManager::CommandManager() { void CommandManager::registerAllCommands() { m_commands.push_back(new CommandHelp()); m_commands.push_back(new CommandKick()); + m_commands.push_back(new CommandOp()); } std::vector CommandManager::getListAllCommands() { @@ -31,7 +33,7 @@ std::vector CommandManager::getListAllCommands() { return ret; } -void CommandManager::execute(Minecraft& mc, const std::string& input) { +void CommandManager::execute(Minecraft& mc, Player& player, const std::string& input) { std::istringstream ss(input); std::string cmd; @@ -51,7 +53,7 @@ void CommandManager::execute(Minecraft& mc, const std::string& input) { while (ss >> tok) args.push_back(tok); if (!mc.level->isClientSide || (*it)->getFlags() & CommandFlags::COMMAND_FLAG_SINGLEPLAYER_ONLY) { - (*it)->execute(mc, args); + (*it)->execute(mc, player, args); } else { ChatPacket packet("/" + input); mc.raknetInstance->send(packet); diff --git a/src/commands/CommandManager.hpp b/src/commands/CommandManager.hpp index 1304877..28817ea 100644 --- a/src/commands/CommandManager.hpp +++ b/src/commands/CommandManager.hpp @@ -10,7 +10,7 @@ public: std::vector getListAllCommands(); - void execute(Minecraft& mc, const std::string& input); + void execute(Minecraft& mc, Player& player, const std::string& input); Command* getCommand(const std::string& name); diff --git a/src/commands/CommandOp.cpp b/src/commands/CommandOp.cpp new file mode 100644 index 0000000..b53646e --- /dev/null +++ b/src/commands/CommandOp.cpp @@ -0,0 +1,35 @@ +#include "CommandOp.hpp" +#include "commands/Command.hpp" +#include "network/RakNetInstance.h" +#include "raknet/RakPeer.h" +#include "world/level/Level.h" +#include +#include + + +CommandOp::CommandOp() : Command("op") {} + +void CommandOp::execute(Minecraft& mc, Player& player, const std::vector& args) { + if (!isPlayerOp(mc, player)) { + return mc.addMessage("You aren't enough priveleged to run this command"); + } + + if (args.empty()) { + return printHelp(mc); + } + + auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args] (auto& it) -> bool { + return it->name == args[0]; + }); + + if (mc.level->ops.find(args[0]) != mc.level->ops.end()) { + return mc.addMessage("op: player " + args[0] + " already opped"); + } + + mc.level->ops.emplace((*it)->name); + mc.addMessage("op: successfully opped player " + args[0]); +} + +void CommandOp::printHelp(Minecraft& mc) { + mc.addMessage("Usage: /op "); +} \ No newline at end of file diff --git a/src/commands/CommandOp.hpp b/src/commands/CommandOp.hpp new file mode 100644 index 0000000..ef5b30a --- /dev/null +++ b/src/commands/CommandOp.hpp @@ -0,0 +1,9 @@ +#include "Command.hpp" + +class CommandOp : public Command { +public: + CommandOp(); + + void execute(Minecraft& mc, Player& player, const std::vector& args); + void printHelp(Minecraft& mc); +}; \ No newline at end of file diff --git a/src/world/level/Level.h b/src/world/level/Level.h index fb76474..e6ea67c 100755 --- a/src/world/level/Level.h +++ b/src/world/level/Level.h @@ -307,6 +307,9 @@ public: Dimension* dimension; IRakNetInstance* raknetInstance; Random random; + + std::set ops; + protected: bool isFindingSpawn; From 4dc7055d9de9dcd3c6b9220a68d7d811621cbd4a Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Tue, 31 Mar 2026 23:34:41 +0300 Subject: [PATCH 052/189] FIX: make antispeedhack working --- src/client/player/LocalPlayer.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 50 ++++++++---------------- 2 files changed, 17 insertions(+), 35 deletions(-) diff --git a/src/client/player/LocalPlayer.cpp b/src/client/player/LocalPlayer.cpp index 88f7835..a4d3b74 100755 --- a/src/client/player/LocalPlayer.cpp +++ b/src/client/player/LocalPlayer.cpp @@ -438,7 +438,7 @@ void LocalPlayer::tick() { { if (std::abs(x - sentX) > .1f || std::abs(y - sentY) > .01f || std::abs(z - sentZ) > .1f || std::abs(sentRotX - xRot) > 1 || std::abs(sentRotY - yRot) > 1) { - MovePlayerPacket packet(entityId, xxa, y - heightOffset, yya, xRot, yRot); + MovePlayerPacket packet(entityId, x, y - heightOffset, z, xRot, yRot); minecraft->raknetInstance->send(packet); sentX = x; sentY = y; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 40ac4a1..a069b0f 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -411,45 +411,27 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay if (Entity* entity = level->getEntity(packet->entityId)) { ServerPlayer* player = (ServerPlayer*) getPlayer(source); - float vectorDist = sqrt( (packet->x - entity->x) * (packet->x - entity->x) + - (packet->z - entity->z) * (packet->z - entity->z)); - float speed = vectorDist / (minecraft->getTicks() - player->getLastMoveTicks()); + int timeElapsed = minecraft->getTicks() - player->getLastMoveTicks(); - if (speed < 1.f) { - LOGI("Packet: %f, %f, %f \n", packet->x, packet->y, packet->z); - LOGI("Entity before: %f, %f, %f \n", entity->x, entity->y, entity->z); - LOGI("OnGround: %d \n", entity->onGround); + if (timeElapsed > 0) { + float dist = player->distanceTo(packet->x, player->y, packet->z); + float speed = dist / (minecraft->getTicks() - player->getLastMoveTicks()); + player->setLastMoveTicks(minecraft->getTicks()); - // @note: packet->y contains y with subtracted entity->heightOffset - float ya = packet->y - entity->y - entity->heightOffset; + float maxSpeed = (minecraft->isCreativeMode()) ? 1.65f : 1.f; - LOGI("y: %f \n", ya); + if (speed > maxSpeed) { + MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); + return raknetInstance->send(refuse); + } + } - float yaOrg = ya; - - // @BIGWARNING @fixme: blocks around work as shit - std::vector& aABBs = level->getCubes(entity, entity->bb.expand(0, ya, 0)); - - for (unsigned int i = 0; i < aABBs.size(); i++) - ya = aABBs[i].clipYCollide(entity->bb, ya); - - bool og = yaOrg != ya && yaOrg < 0; - - entity->onGround = og; - entity->checkFallDamage(ya, og); - entity->xd = entity->yd = entity->zd = 0; - entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); - - LOGI("Entity after: %f, %f, %f \n", entity->x, entity->y, entity->z); - - // broadcast this packet to other clients - redistributePacket(packet, source); - } // else { - //MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); - //raknetInstance->send(refuse); - // } + entity->xd = entity->yd = entity->zd = 0; + entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); + + // broadcast this packet to other clients + redistributePacket(packet, source); - player->setLastMoveTicks(minecraft->getTicks()); } } From 109bbcfdb1aa165fbc1cc227806178046fd36954 Mon Sep 17 00:00:00 2001 From: Shredder Date: Wed, 1 Apr 2026 14:03:38 +0500 Subject: [PATCH 053/189] Added Rendering and Dynamic texture for Fire and it's behaviour --- src/client/Minecraft.cpp | 1 + src/client/renderer/TileRenderer.cpp | 298 +++++++++++++++++- src/client/renderer/TileRenderer.h | 2 + .../renderer/ptexture/DynamicTexture.cpp | 90 ++++++ src/client/renderer/ptexture/DynamicTexture.h | 17 + src/world/level/Level.cpp | 4 +- src/world/level/tile/FireTile.h | 20 +- 7 files changed, 414 insertions(+), 18 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index ccd9ba5..341bea9 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1125,6 +1125,7 @@ void Minecraft::init() textures = new Textures(&options, platform()); textures->addDynamicTexture(new WaterTexture()); textures->addDynamicTexture(new WaterSideTexture()); + textures->addDynamicTexture(new FireTexture()); gui.texturesLoaded(textures); levelRenderer = new LevelRenderer(this); diff --git a/src/client/renderer/TileRenderer.cpp b/src/client/renderer/TileRenderer.cpp index a98e82b..cdbdc7d 100755 --- a/src/client/renderer/TileRenderer.cpp +++ b/src/client/renderer/TileRenderer.cpp @@ -13,6 +13,7 @@ #include "../../world/level/tile/BedTile.h" #include "../../world/level/tile/StemTile.h" #include "../../world/level/tile/StairTile.h" +#include "../../world/level/tile/FireTile.h" #include "../../world/Direction.h" #include "../../world/Facing.h" #include "tileentity/TileEntityRenderer.h" @@ -157,8 +158,8 @@ bool TileRenderer::tesselateInWorld( Tile* tt, int x, int y, int z ) return tesselateRowInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_TORCH) { return tesselateTorchInWorld(tt, x, y, z); - //} else if (shape == Tile::SHAPE_FIRE) { - // return tesselateFireInWorld(tt, x, y, z); + } else if (shape == Tile::SHAPE_FIRE) { + return tesselateFireInWorld(tt, x, y, z); //} else if (shape == Tile::SHAPE_RED_DUST) { // return tesselateDustInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_LADDER) { @@ -222,6 +223,299 @@ bool TileRenderer::tesselateTorchInWorld( Tile* tt, int x, int y, int z ) return true; } +bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) +{ + Tesselator& t = Tesselator::instance; + + //Icon *firstTex = tt->getTextureLayer(0); + //Icon *secondTex = tt->getTextureLayer(1); + //Icon *tex = firstTex; + int tex = tt->getTexture(0); + +// if (hasFixedTexture()) tex = fixedTexture; + if (fixedTexture >= 0) tex = fixedTexture; + + +// t.color( 1.0f, 1.0f, 1.0f ); +// t.tex( getLightColor(tt, level, x, y, z ) ); + + + + + + + + + float br = tt->getBrightness( level, x, y, z ); + t.color( br, br, br ); + + int xt = ((tex & 0xf) << 4); + int yt = tex & 0xf0; + + float u0 = (xt) / 256.0f; + float u1 = (xt + 15.99f) / 256.0f; + float v0 = (yt) / 256.0f; + float v1 = (yt + 15.99f) / 256.0f; + float h = 1.4f; + + if ( level->isSolidBlockingTile( x, y - 1, z ) || Tile::fire->canBurn( level, x, y - 1, z ) ) + { + float x0 = x + 0.5f + 0.2f; + float x1 = x + 0.5f - 0.2f; + float z0 = z + 0.5f + 0.2f; + float z1 = z + 0.5f - 0.2f; + + float x0_ = x + 0.5f - 0.3f; + float x1_ = x + 0.5f + 0.3f; + float z0_ = z + 0.5f - 0.3f; + float z1_ = z + 0.5f + 0.3f; + + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); + + // tex = secondTex; +// u0 = tex->getU0(true); +// v0 = tex->getV0(true); +// u1 = tex->getU1(true); +// v1 = tex->getV1(true); + + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); + + x0 = x + 0.5f - 0.5f; + x1 = x + 0.5f + 0.5f; + z0 = z + 0.5f - 0.5f; + z1 = z + 0.5f + 0.5f; + + x0_ = x + 0.5f - 0.4f; + x1_ = x + 0.5f + 0.4f; + z0_ = z + 0.5f - 0.4f; + z1_ = z + 0.5f + 0.4f; + + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) ); + +// tex = firstTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); + } + else + { + float r = 0.2f; + float yo = 1 / 16.0f; + if ( ( ( x + y + z ) & 1 ) == 1 ) + { + // tex = secondTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + } + if ( ( ( x / 2 + y / 2 + z / 2 ) & 1 ) == 1 ) + { + float tmp = u1; + u1 = u0; + u0 = tmp; + } + if ( Tile::fire->canBurn( level, x - 1, y, z ) ) + { + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x + 1, y, z ) ) + { + t.vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 1.0f - r ), ( float )( y + h + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f - 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f - 0 ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f - r ), ( float )( y + h + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x, y, z - 1 ) ) + { + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u0 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + + r ), ( float )( u1 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x, y, z + 1 ) ) + { + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u0 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u1 ), ( float )( v0 ) ); + + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - + r ), ( float )( u0 ), ( float )( v0 ) ); + } + if ( Tile::fire->canBurn( level, x, y + 1.0f, z ) ) + { + double x0 = x + 0.5f + 0.5f; + double x1 = x + 0.5f - 0.5f; + double z0 = z + 0.5f + 0.5f; + double z1 = z + 0.5f - 0.5f; + + double x0_ = x + 0.5f - 0.5f; + double x1_ = x + 0.5f + 0.5f; + double z0_ = z + 0.5f - 0.5f; + double z1_ = z + 0.5f + 0.5f; + + // tex = firstTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + y += 1; + h = -0.2f; + + if ( ( ( x + y + z ) & 1 ) == 0 ) + { + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + + 0 ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + + 0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + + 1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + + 1 ), ( float )( u0 ), ( float )( v0 ) ); + +// tex = secondTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z + + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z + + 0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + + 0 ), ( float )( u0 ), ( float )( v0 ) ); + } + else + { + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + 0.0f ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + 0.0f ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); + +// tex = secondTex; + u0 = (xt) / 256.0f; + u1 = (xt + 15.99f) / 256.0f; + v0 = (yt) / 256.0f; + v1 = (yt + 15.99f) / 256.0f; + + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); + t.vertexUV( ( float )( x + 1.0f ), ( float )( y + + 0.0f ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + 0.0f ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); + t.vertexUV( ( float )( x + 0.0f ), ( float )( y + + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); + } + } + } + + return true; + +} + + bool TileRenderer::tesselateLadderInWorld( Tile* tt, int x, int y, int z ) { Tesselator& t = Tesselator::instance; diff --git a/src/client/renderer/TileRenderer.h b/src/client/renderer/TileRenderer.h index 02420dd..83351bd 100755 --- a/src/client/renderer/TileRenderer.h +++ b/src/client/renderer/TileRenderer.h @@ -34,6 +34,8 @@ public: bool tesselateFenceGateInWorld(FenceGateTile* tt, int x, int y, int z); bool tesselateBedInWorld(Tile *tt, int x, int y, int z); bool tesselateRowInWorld(Tile* tt, int x, int y, int z); + bool tesselateFireInWorld(Tile* tt, int x, int y, int z); + void tesselateTorch(Tile* tt, float x, float y, float z, float xxa, float zza); void tesselateCrossTexture(Tile* tt, int data, float x, float y, float z); diff --git a/src/client/renderer/ptexture/DynamicTexture.cpp b/src/client/renderer/ptexture/DynamicTexture.cpp index e3b7b47..c3436e4 100755 --- a/src/client/renderer/ptexture/DynamicTexture.cpp +++ b/src/client/renderer/ptexture/DynamicTexture.cpp @@ -206,3 +206,93 @@ void WaterSideTexture::tick() { pixels[i * 4 + 3] = a; } } + +FireTexture::FireTexture() +: super(((Tile*)Tile::fire)->tex), + _tick(0), + _frame(0) +{ + current = new float[16*20]; + next = new float[16*20]; + heat = new float[16*20]; + heata = new float[16*20]; + + for (int i = 0; i < 256; ++i) { + current[i] = 0; + next[i] = 0; + heat[i] = 0; + heata[i] = 0; + } +} + +FireTexture::~FireTexture() { + delete[] current; + delete[] next; + delete[] heat; + delete[] heata; +} + + +// oh boy time to implement fire textures, i am so fucked - shredder + +void FireTexture::tick() { +// loop generates fire texture on the empty texture grid, hopefully shouldnt be too taxing on older hardware - shredder + for (int x = 0; x < 16; x++) { + for (int y = 0; y < 20; y++) { + int count = 18; + float pow = this->current[x + (y + 1) % 20 * 16] * (float)(count); + for (int xx = x - 1; xx <= x + 1; xx++) { + for (int yy = y; yy <= y + 1; yy++) { + if (xx >= 0 && yy >= 0 && xx < 16 && yy < 20) { + pow += this->current[xx + yy * 16]; + } + count++; + } + } + this->next[x + y * 16] = pow / (float(count) * 1.06f); + if (y >= 19) { + this->next[x + y * 16] = float(Mth::random() * Mth::random() * Mth::random() * 4.0 + Mth::random() * 0.1f + 0.2f); + } + } + } + + // hopefully this doesn't cause any mysterious issues - shredder + float* tmp = next; + next = current; + current = tmp; + + for (int i = 0; i < 256; i++) { + float pow = this->current[i] * 1.8f; + if (pow > 1.0f) { + pow = 1.0f; + } + if (pow < 0.0f) { + pow = 0.0f; + } + + + int r = (int) (pow * 155.0f + 100.0f); + int g = (int)(pow * pow * 255.0f); + int b = (int)(pow * pow * pow * pow * pow * pow * pow * pow * pow * pow * 255.0f); + int a = 255; + if (pow < 0.5f) { + a = 0; + } + + // @TODO: cant be arsed rn to implement the anaglyph3d check would be nice to check if it does - shredder + //if (this->anaglyph3d) { + // float rr = (r * 30 + g * 59 + b * 11) / 100; + // float gg = (r * 30 + g * 70) / 100; + // float bb = (r * 30 + b * 70) / 100; + // r = rr; + // g = gg; + // b = bb; + //} + + pixels[i * 4 + 0] = r; + pixels[i * 4 + 1] = g; + pixels[i * 4 + 2] = b; + pixels[i * 4 + 3] = a; + + } +} \ No newline at end of file diff --git a/src/client/renderer/ptexture/DynamicTexture.h b/src/client/renderer/ptexture/DynamicTexture.h index c95b3d7..a28f75a 100755 --- a/src/client/renderer/ptexture/DynamicTexture.h +++ b/src/client/renderer/ptexture/DynamicTexture.h @@ -56,4 +56,21 @@ public: void tick(); }; +class FireTexture: public DynamicTexture +{ + typedef DynamicTexture super; + int _tick; + int _frame; + + float* current; + float* next; + float* heat; + float* heata; + +public: + FireTexture(); + ~FireTexture(); + + void tick(); +}; #endif /*NET_MINECRAFT_CLIENT_RENDERER_PTEXTURE__DynamicTexture_H__*/ diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index 96255eb..c9132f5 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -1599,8 +1599,8 @@ bool Level::containsFireTile(const AABB& box) { for (int z = z0; z < z1; z++) { int t = getTile(x, y, z); - if (/*t == ((Tile*)(Tile::fire))->id - ||*/ t == Tile::lava->id + if (t == ((Tile*)(Tile::fire))->id + || t == Tile::lava->id || t == Tile::calmLava->id) { return true; } diff --git a/src/world/level/tile/FireTile.h b/src/world/level/tile/FireTile.h index fb815c4..5dab2f0 100755 --- a/src/world/level/tile/FireTile.h +++ b/src/world/level/tile/FireTile.h @@ -38,7 +38,7 @@ public: setFlammable(Tile::tnt->id, FLAME_MEDIUM, BURN_INSTANT); setFlammable(Tile::cloth->id, FLAME_EASY, BURN_EASY); - //setTicking(true); //@fire + setTicking(true); //@fire } AABB* getAABB(Level* level, int x, int y, int z) { @@ -70,9 +70,9 @@ public: } void tick(Level* level, int x, int y, int z, Random* random) { - return; //@fire + - bool infiniBurn = false;//level->getTile(x, y - 1, z) == Tile::hellRock->id; + bool infiniBurn = level->getTile(x, y - 1, z) == Tile::netherrack->id; int age = level->getData(x, y, z); if (age < 15) { @@ -148,7 +148,6 @@ public: } void neighborChanged(Level* level, int x, int y, int z, int type) { - return; //@fire if (!level->isSolidBlockingTile(x, y - 1, z) && !isValidFireLocation(level, x, y, z)) { level->setTile(x, y, z, 0); return; @@ -156,7 +155,6 @@ public: } void onPlace(Level* level, int x, int y, int z) { - return; //@fire if (!level->isSolidBlockingTile(x, y - 1, z) && !isValidFireLocation(level, x, y, z)) { level->setTile(x, y, z, 0); return; @@ -169,7 +167,6 @@ public: } void ignite(Level* level, int x, int y, int z) { - return; //@fire bool lit = false; if (!lit) lit = tryIgnite(level, x, y + 1, z); @@ -184,11 +181,10 @@ public: } void animateTick(Level* level, int x, int y, int z, Random* random) { - return; //@fire - //if (random.nextInt(24) == 0) { - // level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "fire.fire", 1 + random.nextFloat(), random.nextFloat() * 0.7f + 0.3f); - //} + if (random->nextInt(24) == 0) { + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "fire.fire", 1 + random->nextFloat(), random->nextFloat() * 0.7f + 0.3f); + } if (level->isSolidBlockingTile(x, y - 1, z) || Tile::fire->canBurn(level, x, y - 1, z)) { for (int i = 0; i < 3; i++) { @@ -248,7 +244,6 @@ private: } void checkBurn(Level* level, int x, int y, int z, int chance, Random* random) { - return; //@fire int odds = burnOdds[level->getTile(x, y, z)]; if (random->nextInt(chance) < odds) { @@ -265,7 +260,6 @@ private: } bool isValidFireLocation(Level* level, int x, int y, int z) { - return false; //@fire if (canBurn(level, x + 1, y, z)) return true; if (canBurn(level, x - 1, y, z)) return true; @@ -278,7 +272,6 @@ private: } int getFireOdds(Level* level, int x, int y, int z) { - return 0; //@fire int odds = 0; if (!level->isEmptyTile(x, y, z)) return 0; @@ -294,7 +287,6 @@ private: } bool tryIgnite(Level* level, int x, int y, int z) { - return false; //@fire int t = level->getTile(x, y, z); if (t == Tile::fire->id) return true; From 27f0287986332175f9f19176efeb7d5fd9acb709 Mon Sep 17 00:00:00 2001 From: Shredder Date: Wed, 1 Apr 2026 23:31:15 +0500 Subject: [PATCH 054/189] Ported over Spooner Trees (Fancy Trees), Flint and Steel can be used to ignite fire now and modified Forest and Rainforest to generate spooner trees. --- src/world/level/levelgen/feature/BasicTree.h | 593 +++++++++++++++++++ 1 file changed, 593 insertions(+) create mode 100644 src/world/level/levelgen/feature/BasicTree.h diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h new file mode 100644 index 0000000..7b6db51 --- /dev/null +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -0,0 +1,593 @@ +#ifndef NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE__BasicTree_H__ +#define NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE__BasicTree_H__ + +//package net.minecraft.world.level.levelgen.feature; + +#include "Feature.h" + +#include "../../../../util/Random.h" +#include "../../Level.h" + +#include "../../tile/TreeTile.h" + +class Level; + +class BasicTree : public Feature +{ + typedef Feature super; +private: + + + + // The axisConversionArray, when given a primary index, allows easy + // access to the indices of the other two axies. Access the data at the + // primary index location to get the horizontal secondary axis. + // Access the data at the primary location plus three to get the + // remaining, tertiary, axis. + // All directions are specified by an index, 0, 1, or 2 which + // correspond to x, y, and z. + // The axisConversionArray is used in several places + // notably the crossection and taperedLimb methods. + // Example: + // If the primary axis is z, then the primary index is 2. + // The secondary index is axisConversionArray[2] which is 0, + // the index for the x axis. + // The remaining axis is axisConversionArray[2 + 3] which is 1, + // the index for the y axis. + // Using this method, the secondary axis will always be horizontal (x or z), + // and the tertiary always vertical (y), if possible. + unsigned char axisConversionArray[6]; + + // Set up the pseudorandom number generator + Random *rnd; + + // Make fields to hold the level data and the random seed + Level *thisLevel; + + // Field to hold the tree origin, x y and z. + int origin[3]; + // Field to hold the tree height. + int height; + // Other important tree information. + int trunkHeight; + double trunkHeightScale; + double branchDensity; + double branchSlope; + double widthScale; + double foliageDensity; + int trunkWidth; + int heightVariance; + int foliageHeight; + // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster + int **foliageCoords; + int foliageCoordsLength; + void prepare(){ + // Initialize the instance variables. + // Populate the list of foliage cluster locations. + // Designed to be overridden in child classes to change basic + // tree properties (trunk width, branch angle, foliage density, etc..). + trunkHeight = (int) (height * trunkHeightScale); + if (trunkHeight >= height) trunkHeight = height - 1; + int clustersPerY = (int) (1.382 + pow(foliageDensity * height / 13.0, 2)); + if (clustersPerY < 1) clustersPerY = 1; + // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster + int **tempFoliageCoords = new int *[clustersPerY * height]; + for( int i = 0; i < clustersPerY * height; i++ ) + { + tempFoliageCoords[i] = new int[4]; + } + int y = origin[1] + height - foliageHeight; + int clusterCount = 1; + int trunkTop = origin[1] + trunkHeight; + int relativeY = y - origin[1]; + + tempFoliageCoords[0][0] = origin[0]; + tempFoliageCoords[0][1] = y; + tempFoliageCoords[0][2] = origin[2]; + tempFoliageCoords[0][3] = trunkTop; + y--; + + while (relativeY >= 0) + { + int num = 0; + + float shapefac = treeShape(relativeY); + if (shapefac < 0) + { + y--; + relativeY--; + continue; + } + + // The originOffset is to put the value in the middle of the block. + double originOffset = 0.5; + while (num < clustersPerY) + { + double radius = widthScale * (shapefac * (rnd->nextFloat() + 0.328)); + double angle = rnd->nextFloat() * 2.0 * 3.14159; + int x = Mth::floor(radius * sin(angle) + origin[0] + originOffset); + int z = Mth::floor(radius * cos(angle) + origin[2] + originOffset); + int checkStart[] = { x, y, z }; + int checkEnd[] = { x, y + foliageHeight, z }; + // check the center column of the cluster for obstructions. + if (checkLine(checkStart, checkEnd) == -1) { + // If the cluster can be created, check the branch path + // for obstructions. + int checkBranchBase[] = { origin[0], origin[1], origin[2] }; + double distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0) + pow(abs(origin[2] - checkStart[2]), 2.0)); + double branchHeight = distance * branchSlope; + if ((checkStart[1] - branchHeight) > trunkTop) + { + checkBranchBase[1] = trunkTop; + } + else + { + checkBranchBase[1] = (int) (checkStart[1] - branchHeight); + } + // Now check the branch path + if (checkLine(checkBranchBase, checkStart) == -1) + { + // If the branch path is clear, add the position to the list + // of foliage positions + tempFoliageCoords[clusterCount][0] = x; + tempFoliageCoords[clusterCount][1] = y; + tempFoliageCoords[clusterCount][2] = z; + tempFoliageCoords[clusterCount][3] = checkBranchBase[1]; + clusterCount++; + } + } + num++; + } + y--; + relativeY--; + } + // 4J Stu - Rather than copying the array, we are storing the number of valid elements in the array + foliageCoordsLength = clusterCount; + foliageCoords = tempFoliageCoords; + // Delete the rest of the array whilst we still know how big it was + for( int i = clusterCount; i < clustersPerY * height; i++ ) + { + delete [] tempFoliageCoords[i]; + tempFoliageCoords[i] = NULL; + } + // 4J - original code for above is the following, it isn't obvious to me why it is doing a copy of the array, so let's not for now + // foliageCoords = new int[clusterCount][4]; + // System.arraycopy(tempFoliageCoords, 0, foliageCoords, 0, clusterCount); + + } + + void crossection(int x, int y, int z, float radius, byte direction, int material) + { + + // Create a circular cross section. + // + // Used to nearly everything in the foliage, branches, and trunk. + // This is a good target for performance optimization. + + // Passed values: + // x,y,z is the center location of the cross section + // radius is the radius of the section from the center + // direction is the direction the cross section is pointed, 0 for x, 1 for y, 2 for z + // material is the index number for the material to use + int rad = (int) (radius + 0.618); + byte secidx1 = axisConversionArray[direction]; + byte secidx2 = axisConversionArray[direction + 3]; + int center[] = { x, y, z }; + int position[] = { 0, 0, 0 }; + int offset1 = -rad; + int offset2 = -rad; + int thismat; + position[direction] = center[direction]; + while (offset1 <= rad) + { + position[secidx1] = center[secidx1] + offset1; + offset2 = -rad; + while (offset2 <= rad) + { + double thisdistance = pow(abs(offset1) + 0.5, 2) + pow(abs(offset2) + 0.5, 2); + if (thisdistance > radius * radius) + { + offset2++; + continue; + } + position[secidx2] = center[secidx2] + offset2; + + thismat = thisLevel->getTile(position[0], position[1], position[2]); + + if (!((thismat == 0) || (thismat == Tile::leaves->id))) + { + // If the material of the checked block is anything other than + // air or foliage, skip this tile. + offset2++; + continue; + } + + placeBlock(thisLevel, position[0], position[1], position[2], material, 0); + + offset2++; + } + offset1++; + } + + } + float treeShape(int y){ + // Take the y position relative to the base of the tree. + // Return the distance the foliage should be from the trunk axis. + // Return a negative number if foliage should not be created at this height. + // This method is intended for overriding in child classes, allowing + // different shaped trees. + // This method should return a consistent value for each y (don't randomize). + if (y < (((float) height) * 0.3)) return (float) -1.618; + float radius = ((float) height) / ((float) 2.0); + float adjacent = (((float) height) / ((float) 2.0)) - y; + float distance; + if (adjacent == 0) distance = radius; + else if (abs(adjacent) >= radius) distance = (float) 0.0; + else distance = (float) sqrt(pow(abs(radius), 2) - pow(abs(adjacent), 2)); + // Alter this factor to change the overall width of the tree. + distance *= (float) 0.5; + return distance; + } + float foliageShape(int y){ + // Take the y position relative to the base of the foliage cluster. + // Return the radius of the cluster at this y + // Return a negative number if no foliage should be created at this level + // this method is intended for overriding in child classes, allowing + // foliage of different sizes and shapes. + if ((y < 0) || (y >= foliageHeight)) return (float) -1; + else if ((y == 0) || (y == (foliageHeight - 1))) return (float) 2; + else return (float) 3; + } + void foliageCluster(int x, int y, int z){ + + // Generate a cluster of foliage, with the base at x, y, z. + // The shape of the cluster is derived from foliageShape + // crossection is called to make each level. + int topy = y + foliageHeight; + int cury = topy - 1; + float radius; + // 4J Stu - Generate foliage from the top down so that we don't keep recalculating heightmaps + while (cury >= y) + { + radius = foliageShape(cury - y); + crossection(x, cury, z, radius, (byte) 1, Tile::leaves->id); + cury--; + } + + } + void limb(int *start, int *end, int material) + { + // Create a limb from the start position to the end position. + // Used for creating the branches and trunk. + + // Populate delta, the difference between start and end for all three axies. + // Set primidx to the index with the largest overall distance traveled. + int delta[] = { 0, 0, 0 }; + byte idx = 0; + byte primidx = 0; + while (idx < 3) + { + delta[idx] = end[idx] - start[idx]; + if (abs(delta[idx]) > abs(delta[primidx])) + { + primidx = idx; + } + idx++; + } + // If the largest distance is zero, don't bother to do anything else. + if (delta[primidx] == 0) return; + // set up the other two axis indices. + byte secidx1 = axisConversionArray[primidx]; + byte secidx2 = axisConversionArray[primidx + 3]; + // primsign is digit 1 or -1 depending on whether the limb is headed + // along the positive or negative primidx axis. + char primsign; + if (delta[primidx] > 0) primsign = 1; + else primsign = -1; + // Initilize the per-step movement for the non-primary axies. + double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); + double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); + // Initialize the coordinates. + int coordinate[] = { 0, 0, 0 }; + // Loop through each crossection along the primary axis, from start to end + int primoffset = 0; + int endoffset = delta[primidx] + primsign; + while (primoffset != endoffset) + { + coordinate[primidx] = Mth::floor(start[primidx] + primoffset + 0.5); + coordinate[secidx1] = Mth::floor(start[secidx1] + (primoffset * secfac1) + 0.5); + coordinate[secidx2] = Mth::floor(start[secidx2] + (primoffset * secfac2) + 0.5); + + int dir = 0; + int xdiff = abs(coordinate[0] - start[0]); + int zdiff = abs(coordinate[2] - start[2]); + int maxdiff = max(xdiff, zdiff); + + if (maxdiff > 0) + { + if (xdiff == maxdiff) + { + dir = 0; + } + else if (zdiff == maxdiff) + { + dir = 0; + } + } + placeBlock(thisLevel, coordinate[0], coordinate[1], coordinate[2], material, dir); + primoffset += primsign; + } + } + void makeFoliage(){ + // Create the tree foliage. + // Call foliageCluster at the correct locations + int idx = 0; + int finish = foliageCoordsLength; + while (idx < finish) + { + int x = foliageCoords[idx][0]; + int y = foliageCoords[idx][1]; + int z = foliageCoords[idx][2]; + foliageCluster(x, y, z); + idx++; + } + } + bool trimBranches(int localY){ + // For larger trees, randomly "prune" the branches so there + // aren't too many. + // Return true if the branch should be created. + // This method is intended for overriding in child classes, allowing + // decent amounts of branches on very large trees. + // Can also be used to disable branches on some tree types, or + // make branches more sparse. + if (localY < (height * 0.2)) return false; + else return true; + } + void makeTrunk(){ + // Create the trunk of the tree. + int x = origin[0]; + int startY = origin[1]; + int topY = origin[1] + trunkHeight; + int z = origin[2]; + int startCoord[] = { x, startY, z }; + int endCoord[] = { x, topY, z }; + limb(startCoord, endCoord, Tile::treeTrunk->id); + if (trunkWidth == 2) + { + startCoord[0] += 1; + endCoord[0] += 1; + limb(startCoord, endCoord, Tile::treeTrunk->id); + startCoord[2] += 1; + endCoord[2] += 1; + limb(startCoord, endCoord, Tile::treeTrunk->id); + startCoord[0] += -1; + endCoord[0] += -1; + limb(startCoord, endCoord, Tile::treeTrunk->id); + } + } + void makeBranches(){ + // Create the tree branches. + // Call trimBranches for each branch to see if you should create it. + // Call taperedLimb to the correct locations + int idx = 0; + int finish = foliageCoordsLength; + int baseCoord[] = { origin[0], origin[1], origin[2] }; + while (idx < finish) + { + int *coordValues = foliageCoords[idx]; + int endCoord[] = { coordValues[0], coordValues[1], coordValues[2] }; + baseCoord[1] = coordValues[3]; + int localY = baseCoord[1] - origin[1]; + if (trimBranches(localY)) + { + limb(baseCoord, endCoord, Tile::treeTrunk->id); + } + idx++; + } + } + int checkLine(int *start, int *end){ + // Check from coordinates start to end (both inclusive) for blocks other than air and foliage + // If a block other than air and foliage is found, return the number of steps taken. + // If no block other than air and foliage is found, return -1. + // Examples: + // If the third block searched is stone, return 2 + // If the first block searched is lava, return 0 + + int delta[] = { 0, 0, 0 }; + byte idx = 0; + byte primidx = 0; + while (idx < 3) + { + delta[idx] = end[idx] - start[idx]; + if (abs(delta[idx]) > abs(delta[primidx])) + { + primidx = idx; + } + idx++; + } + // If the largest distance is zero, don't bother to do anything else. + if (delta[primidx] == 0) return -1; + // set up the other two axis indices. + byte secidx1 = axisConversionArray[primidx]; + byte secidx2 = axisConversionArray[primidx + 3]; + // primsign is digit 1 or -1 depending on whether the limb is headed + // along the positive or negative primidx axis. + char primsign; // 4J Stu - Was byte, but we use in a sum below and byte=unsigned char so we were setting endoffset incorrectly + if (delta[primidx] > 0) primsign = 1; + else primsign = -1; + // Initilize the per-step movement for the non-primary axies. + double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); + double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); + // Initialize the coordinates. + int coordinate[] = { 0, 0, 0 }; + // Loop through each crossection along the primary axis, from start to end + int primoffset = 0; + int endoffset = delta[primidx] + primsign; + int thismat; + while (primoffset != endoffset) + { + coordinate[primidx] = start[primidx] + primoffset; + coordinate[secidx1] = Mth::floor(start[secidx1] + (primoffset * secfac1)); + coordinate[secidx2] = Mth::floor(start[secidx2] + (primoffset * secfac2)); + thismat = thisLevel->getTile(coordinate[0], coordinate[1], coordinate[2]); + if (!((thismat == 0) || (thismat == Tile::leaves->id))) + { + // If the material of the checked block is anything other than + // air or foliage, stop looking. + break; + } + primoffset += primsign; + } + // If you reached the end without finding anything, return -1. + if (primoffset == endoffset) + { + return -1; + } + // Otherwise, return the number of steps you took. + else + { + return abs(primoffset); + } + } + bool checkLocation(){ + // Return true if the tree can be placed here. + // Return false if the tree can not be placed here. + + // Examine the square under the trunk. Is it grass or dirt? + // If not, return false + // Examine center column for how tall the tree can be. + // If the checked height is shorter than height, but taller + // than 4, set the tree to the maximum height allowed. + // If the space is too short, return false. + int startPosition[] = { origin[0], origin[1], origin[2] }; + int endPosition[] = { origin[0], origin[1] + height - 1, origin[2] }; + + + // Check the location it is resting on + int baseMaterial = thisLevel->getTile(origin[0], origin[1] - 1, origin[2]); + if (!((baseMaterial == 2) || (baseMaterial == 3))) + { + return false; + } + int allowedHeight = checkLine(startPosition, endPosition); + // If the set height is good, go with that + if (allowedHeight == -1) + { + return true; + } + // If the space is too short, tell the build to abort + else if (allowedHeight < 6) + { + return false; + } + // If the space is shorter than the set height, but not too short + // shorten the height, and tell the build to continue + else + { + height = allowedHeight; + //System.out.println("Shortened the tree"); + return true; + } + } + +public: + BasicTree(bool doUpdate){ + axisConversionArray[0] = 2; + axisConversionArray[1] = 0; + axisConversionArray[2] = 0; + axisConversionArray[3] = 1; + axisConversionArray[4] = 2; + axisConversionArray[5] = 1; + rnd = new Random(); + origin[0] = 0; + origin[1] = 0; + origin[2] = 0; + // Field to hold the tree height. + height = 0; + // Other important tree information. + trunkHeight = 0; + trunkHeightScale = 0.618; + branchDensity = 1.0; + branchSlope = 0.381; + widthScale = 1.0; + foliageDensity = 1.0; + trunkWidth = 1; + heightVariance = 12; + foliageHeight = 4; + foliageCoords = NULL; + foliageCoordsLength = 0; + } + virtual ~BasicTree(){ + delete rnd; + + for( int i = 0; i < foliageCoordsLength; i++ ) + { + delete [] foliageCoords[i]; + } + delete [] foliageCoords; + } + + virtual void init(double heightInit, double widthInit, double foliageDensityInit){ + // all of the parameters should be from 0.0 to 1.0 + // heightInit scales the maximum overall height of the tree (still randomizes height within the possible range) + // widthInit scales the maximum overall width of the tree (keep this above 0.3 or so) + // foliageDensityInit scales how many foliage clusters are created. + // + // Note, you can call "place" without calling "init". + // This is the same as calling init(1.0,1.0,1.0) and then calling place. + heightVariance = (int) (heightInit * 12); + if (heightInit > 0.5) foliageHeight = 5; + widthScale = widthInit; + foliageDensity = foliageDensityInit; + } + virtual bool place(Level *level, Random *random, int x, int y, int z){ + // Note to Markus. + // currently the following fields are set randomly. If you like, make them + // parameters passed into "place". + // + // height: so the map generator can intelligently set the height of the tree, + // and make forests with large trees in the middle and smaller ones on the edges. + + // Initialize the instance fields for the level and the seed. + thisLevel = level; + __int64 seed = random->nextLong(); + rnd->setSeed(seed); + // Initialize the origin of the tree trunk + origin[0] = x; + origin[1] = y; + origin[2] = z; + // Sets the height. Take out this line if height is passed as a parameter + if (height == 0) + { + height = 5 + rnd->nextInt(heightVariance); + } + if (!(checkLocation())) + { + //System.out.println("Tree location failed"); + return false; + } + + //System.out.println("The height is"); + //System.out.println(height); + //System.out.println("Trunk Height check done"); + + prepare(); + + //System.out.println("Prepare done"); + + makeFoliage(); + + //System.out.println("Foliage done"); + + makeTrunk(); + + //System.out.println("Trunk done"); + + makeBranches(); + + //System.out.println("Branches done"); + + return true; + } +}; +#endif /*NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE__BasicTree_H__*/ \ No newline at end of file From 84e874438777bc762eb7522e902d77c73fc04896 Mon Sep 17 00:00:00 2001 From: Shredder Date: Wed, 1 Apr 2026 23:37:37 +0500 Subject: [PATCH 055/189] oops forgot to include the other files. --- src/client/renderer/TileRenderer.cpp | 35 +--- src/world/item/FlintAndSteelItem.h | 8 +- src/world/level/biome/Biome.cpp | 12 +- src/world/level/biome/Biome.h | 1 + src/world/level/biome/ForestBiome.h | 3 +- src/world/level/biome/RainforestBiome.h | 3 +- .../level/levelgen/RandomLevelSource.cpp | 12 ++ src/world/level/levelgen/feature/BasicTree.h | 171 ++---------------- 8 files changed, 51 insertions(+), 194 deletions(-) diff --git a/src/client/renderer/TileRenderer.cpp b/src/client/renderer/TileRenderer.cpp index cdbdc7d..0e53915 100755 --- a/src/client/renderer/TileRenderer.cpp +++ b/src/client/renderer/TileRenderer.cpp @@ -225,29 +225,16 @@ bool TileRenderer::tesselateTorchInWorld( Tile* tt, int x, int y, int z ) bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) { + // @todo: fire alpha transparency seems to be scuffed, also it seems i might have messed up the second layer while porting from lce/java , need to look into it - shredder + Tesselator& t = Tesselator::instance; - //Icon *firstTex = tt->getTextureLayer(0); - //Icon *secondTex = tt->getTextureLayer(1); - //Icon *tex = firstTex; int tex = tt->getTexture(0); -// if (hasFixedTexture()) tex = fixedTexture; if (fixedTexture >= 0) tex = fixedTexture; - -// t.color( 1.0f, 1.0f, 1.0f ); -// t.tex( getLightColor(tt, level, x, y, z ) ); - - - - - - - - - float br = tt->getBrightness( level, x, y, z ); - t.color( br, br, br ); + float br = tt->getBrightness( level, x, y, z ); + t.color( br, br, br ); int xt = ((tex & 0xf) << 4); int yt = tex & 0xf0; @@ -256,7 +243,7 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) float u1 = (xt + 15.99f) / 256.0f; float v0 = (yt) / 256.0f; float v1 = (yt + 15.99f) / 256.0f; - float h = 1.4f; + float h = 1.4f; if ( level->isSolidBlockingTile( x, y - 1, z ) || Tile::fire->canBurn( level, x, y - 1, z ) ) { @@ -280,11 +267,7 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); - // tex = secondTex; -// u0 = tex->getU0(true); -// v0 = tex->getV0(true); -// u1 = tex->getU1(true); -// v1 = tex->getV1(true); + u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; @@ -321,7 +304,7 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) ); -// tex = firstTex; + u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -343,7 +326,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) float yo = 1 / 16.0f; if ( ( ( x + y + z ) & 1 ) == 1 ) { - // tex = secondTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -447,7 +429,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) double z0_ = z + 0.5f - 0.5f; double z1_ = z + 0.5f + 0.5f; - // tex = firstTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -467,7 +448,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) ); -// tex = secondTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; @@ -493,7 +473,6 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); -// tex = secondTex; u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; v0 = (yt) / 256.0f; diff --git a/src/world/item/FlintAndSteelItem.h b/src/world/item/FlintAndSteelItem.h index 45458e7..701fc96 100755 --- a/src/world/item/FlintAndSteelItem.h +++ b/src/world/item/FlintAndSteelItem.h @@ -19,7 +19,7 @@ public: setMaxDamage(64); } - /* + bool useOn(ItemInstance* instance, Player* player, Level* level, int x, int y, int z, int face, float clickX, float clickY, float clickZ) { if (face == 0) y--; if (face == 1) y++; @@ -30,14 +30,14 @@ public: int targetType = level->getTile(x, y, z); if (targetType == 0) { - level->playSound(x + 0.5, y + 0.5, z + 0.5, "fire.ignite", 1, sharedRandom.nextFloat() * 0.4f + 0.8f); - level->setTile(x, y, z, Tile::fire->id); + level->playSound(x + 0.5, y + 0.5, z + 0.5, "fire.ignite", 1, random.nextFloat() * 0.4f + 0.8f); + level->setTile(x, y, z, ((Tile*)Tile::fire)->id); } instance->hurt(1); return true; } - */ + }; #endif /*NET_MINECRAFT_WORLD_ITEM__FlintAndSteelItem_H__*/ diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index d0a842a..7ccbdfe 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -2,6 +2,7 @@ #include "../levelgen/feature/TreeFeature.h" #include "../levelgen/feature/TallgrassFeature.h" +#include "../levelgen/feature/BasicTree.h" #include "../../entity/EntityTypes.h" #include "../../entity/MobCategory.h" @@ -140,7 +141,7 @@ void Biome::teardownBiomes() { Feature* Biome::getTreeFeature( Random* random ) { if (random->nextInt(10) == 0) { - //return /*new*/ BasicTree(); + return new BasicTree(false); } return new TreeFeature(false); } @@ -148,6 +149,15 @@ Feature* Biome::getGrassFeature( Random* random ) { return new TallgrassFeature(Tile::tallgrass->id, TallGrass::TALL_GRASS); } +Feature* Biome::getBasicTreeFeature( Random* random ) +{ + if (random->nextInt(10) == 0) { + return new BasicTree(false); + } + +} + + Biome* Biome::getBiome( float temperature, float downfall ) { int a = (int) (temperature * 63); diff --git a/src/world/level/biome/Biome.h b/src/world/level/biome/Biome.h index 48a49d5..23fd495 100755 --- a/src/world/level/biome/Biome.h +++ b/src/world/level/biome/Biome.h @@ -71,6 +71,7 @@ public: virtual Feature* getTreeFeature(Random* random); virtual Feature* getGrassFeature(Random* random); + virtual Feature* getBasicTreeFeature(Random* random); static Biome* getBiome(float temperature, float downfall); static Biome* _getBiome(float temperature, float downfall); diff --git a/src/world/level/biome/ForestBiome.h b/src/world/level/biome/ForestBiome.h index dbc38e5..fa47dc0 100755 --- a/src/world/level/biome/ForestBiome.h +++ b/src/world/level/biome/ForestBiome.h @@ -6,6 +6,7 @@ #include "Biome.h" #include "../levelgen/feature/TreeFeature.h" #include "../levelgen/feature/BirchFeature.h" +#include "../levelgen/feature/BasicTree.h" class ForestBiome: public Biome { @@ -15,7 +16,7 @@ public: return new BirchFeature(); } if (random->nextInt(3) == 0) { - //return new BasicTree(); + return new BasicTree(false); } return new TreeFeature(false); } diff --git a/src/world/level/biome/RainforestBiome.h b/src/world/level/biome/RainforestBiome.h index 153ed61..cc80e84 100755 --- a/src/world/level/biome/RainforestBiome.h +++ b/src/world/level/biome/RainforestBiome.h @@ -6,13 +6,14 @@ #include "Biome.h" #include "../../../util/Random.h" #include "../levelgen/feature/TreeFeature.h" +#include "../levelgen/feature/BasicTree.h" class RainforestBiome: public Biome { public: Feature* getTreeFeature(Random* random) { if (random->nextInt(3) == 0) { - //return new BasicTree(); + return new BasicTree(false); } return new TreeFeature(false); } diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 7ef40e3..56f5b8b 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -370,6 +370,18 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { } //printf("placing tree at %d, %d, %d\n", x, y, z); } + // for (int i = 0; i < forests; i++) { + // int x = xo + random.nextInt(16) + 8; + // int z = zo + random.nextInt(16) + 8; + //int y = level->getHeightmap(x, z); + // Feature* tree = biome->getBasicTreeFeature(&random); + //if (tree) { + // tree->init(1, 1, 1); + // tree->place(level, &random, x, y, z); + // delete tree; + //} + ////printf("placing tree at %d, %d, %d\n", x, y, z); + // } for (int i = 0; i < 2; i++) { int x = xo + random.nextInt(16) + 8; diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h index 7b6db51..48f80e7 100644 --- a/src/world/level/levelgen/feature/BasicTree.h +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -19,36 +19,11 @@ private: - // The axisConversionArray, when given a primary index, allows easy - // access to the indices of the other two axies. Access the data at the - // primary index location to get the horizontal secondary axis. - // Access the data at the primary location plus three to get the - // remaining, tertiary, axis. - // All directions are specified by an index, 0, 1, or 2 which - // correspond to x, y, and z. - // The axisConversionArray is used in several places - // notably the crossection and taperedLimb methods. - // Example: - // If the primary axis is z, then the primary index is 2. - // The secondary index is axisConversionArray[2] which is 0, - // the index for the x axis. - // The remaining axis is axisConversionArray[2 + 3] which is 1, - // the index for the y axis. - // Using this method, the secondary axis will always be horizontal (x or z), - // and the tertiary always vertical (y), if possible. unsigned char axisConversionArray[6]; - - // Set up the pseudorandom number generator Random *rnd; - - // Make fields to hold the level data and the random seed Level *thisLevel; - - // Field to hold the tree origin, x y and z. int origin[3]; - // Field to hold the tree height. int height; - // Other important tree information. int trunkHeight; double trunkHeightScale; double branchDensity; @@ -58,19 +33,13 @@ private: int trunkWidth; int heightVariance; int foliageHeight; - // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster int **foliageCoords; int foliageCoordsLength; void prepare(){ - // Initialize the instance variables. - // Populate the list of foliage cluster locations. - // Designed to be overridden in child classes to change basic - // tree properties (trunk width, branch angle, foliage density, etc..). trunkHeight = (int) (height * trunkHeightScale); if (trunkHeight >= height) trunkHeight = height - 1; int clustersPerY = (int) (1.382 + pow(foliageDensity * height / 13.0, 2)); if (clustersPerY < 1) clustersPerY = 1; - // The foliage coordinates are a list of [x,y,z,y of branch base] values for each cluster int **tempFoliageCoords = new int *[clustersPerY * height]; for( int i = 0; i < clustersPerY * height; i++ ) { @@ -99,7 +68,6 @@ private: continue; } - // The originOffset is to put the value in the middle of the block. double originOffset = 0.5; while (num < clustersPerY) { @@ -109,10 +77,7 @@ private: int z = Mth::floor(radius * cos(angle) + origin[2] + originOffset); int checkStart[] = { x, y, z }; int checkEnd[] = { x, y + foliageHeight, z }; - // check the center column of the cluster for obstructions. if (checkLine(checkStart, checkEnd) == -1) { - // If the cluster can be created, check the branch path - // for obstructions. int checkBranchBase[] = { origin[0], origin[1], origin[2] }; double distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0) + pow(abs(origin[2] - checkStart[2]), 2.0)); double branchHeight = distance * branchSlope; @@ -124,11 +89,8 @@ private: { checkBranchBase[1] = (int) (checkStart[1] - branchHeight); } - // Now check the branch path if (checkLine(checkBranchBase, checkStart) == -1) { - // If the branch path is clear, add the position to the list - // of foliage positions tempFoliageCoords[clusterCount][0] = x; tempFoliageCoords[clusterCount][1] = y; tempFoliageCoords[clusterCount][2] = z; @@ -141,34 +103,22 @@ private: y--; relativeY--; } - // 4J Stu - Rather than copying the array, we are storing the number of valid elements in the array + foliageCoordsLength = clusterCount; foliageCoords = tempFoliageCoords; - // Delete the rest of the array whilst we still know how big it was + for( int i = clusterCount; i < clustersPerY * height; i++ ) { delete [] tempFoliageCoords[i]; tempFoliageCoords[i] = NULL; } - // 4J - original code for above is the following, it isn't obvious to me why it is doing a copy of the array, so let's not for now - // foliageCoords = new int[clusterCount][4]; - // System.arraycopy(tempFoliageCoords, 0, foliageCoords, 0, clusterCount); + } void crossection(int x, int y, int z, float radius, byte direction, int material) { - // Create a circular cross section. - // - // Used to nearly everything in the foliage, branches, and trunk. - // This is a good target for performance optimization. - - // Passed values: - // x,y,z is the center location of the cross section - // radius is the radius of the section from the center - // direction is the direction the cross section is pointed, 0 for x, 1 for y, 2 for z - // material is the index number for the material to use int rad = (int) (radius + 0.618); byte secidx1 = axisConversionArray[direction]; byte secidx2 = axisConversionArray[direction + 3]; @@ -196,8 +146,6 @@ private: if (!((thismat == 0) || (thismat == Tile::leaves->id))) { - // If the material of the checked block is anything other than - // air or foliage, skip this tile. offset2++; continue; } @@ -211,12 +159,6 @@ private: } float treeShape(int y){ - // Take the y position relative to the base of the tree. - // Return the distance the foliage should be from the trunk axis. - // Return a negative number if foliage should not be created at this height. - // This method is intended for overriding in child classes, allowing - // different shaped trees. - // This method should return a consistent value for each y (don't randomize). if (y < (((float) height) * 0.3)) return (float) -1.618; float radius = ((float) height) / ((float) 2.0); float adjacent = (((float) height) / ((float) 2.0)) - y; @@ -224,29 +166,19 @@ private: if (adjacent == 0) distance = radius; else if (abs(adjacent) >= radius) distance = (float) 0.0; else distance = (float) sqrt(pow(abs(radius), 2) - pow(abs(adjacent), 2)); - // Alter this factor to change the overall width of the tree. distance *= (float) 0.5; return distance; } float foliageShape(int y){ - // Take the y position relative to the base of the foliage cluster. - // Return the radius of the cluster at this y - // Return a negative number if no foliage should be created at this level - // this method is intended for overriding in child classes, allowing - // foliage of different sizes and shapes. if ((y < 0) || (y >= foliageHeight)) return (float) -1; else if ((y == 0) || (y == (foliageHeight - 1))) return (float) 2; else return (float) 3; } void foliageCluster(int x, int y, int z){ - // Generate a cluster of foliage, with the base at x, y, z. - // The shape of the cluster is derived from foliageShape - // crossection is called to make each level. int topy = y + foliageHeight; int cury = topy - 1; float radius; - // 4J Stu - Generate foliage from the top down so that we don't keep recalculating heightmaps while (cury >= y) { radius = foliageShape(cury - y); @@ -257,11 +189,6 @@ private: } void limb(int *start, int *end, int material) { - // Create a limb from the start position to the end position. - // Used for creating the branches and trunk. - - // Populate delta, the difference between start and end for all three axies. - // Set primidx to the index with the largest overall distance traveled. int delta[] = { 0, 0, 0 }; byte idx = 0; byte primidx = 0; @@ -274,22 +201,15 @@ private: } idx++; } - // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return; - // set up the other two axis indices. byte secidx1 = axisConversionArray[primidx]; byte secidx2 = axisConversionArray[primidx + 3]; - // primsign is digit 1 or -1 depending on whether the limb is headed - // along the positive or negative primidx axis. char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; - // Initilize the per-step movement for the non-primary axies. double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); - // Initialize the coordinates. int coordinate[] = { 0, 0, 0 }; - // Loop through each crossection along the primary axis, from start to end int primoffset = 0; int endoffset = delta[primidx] + primsign; while (primoffset != endoffset) @@ -319,8 +239,6 @@ private: } } void makeFoliage(){ - // Create the tree foliage. - // Call foliageCluster at the correct locations int idx = 0; int finish = foliageCoordsLength; while (idx < finish) @@ -333,18 +251,10 @@ private: } } bool trimBranches(int localY){ - // For larger trees, randomly "prune" the branches so there - // aren't too many. - // Return true if the branch should be created. - // This method is intended for overriding in child classes, allowing - // decent amounts of branches on very large trees. - // Can also be used to disable branches on some tree types, or - // make branches more sparse. if (localY < (height * 0.2)) return false; else return true; } void makeTrunk(){ - // Create the trunk of the tree. int x = origin[0]; int startY = origin[1]; int topY = origin[1] + trunkHeight; @@ -366,9 +276,6 @@ private: } } void makeBranches(){ - // Create the tree branches. - // Call trimBranches for each branch to see if you should create it. - // Call taperedLimb to the correct locations int idx = 0; int finish = foliageCoordsLength; int baseCoord[] = { origin[0], origin[1], origin[2] }; @@ -386,12 +293,6 @@ private: } } int checkLine(int *start, int *end){ - // Check from coordinates start to end (both inclusive) for blocks other than air and foliage - // If a block other than air and foliage is found, return the number of steps taken. - // If no block other than air and foliage is found, return -1. - // Examples: - // If the third block searched is stone, return 2 - // If the first block searched is lava, return 0 int delta[] = { 0, 0, 0 }; byte idx = 0; @@ -405,22 +306,15 @@ private: } idx++; } - // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return -1; - // set up the other two axis indices. byte secidx1 = axisConversionArray[primidx]; byte secidx2 = axisConversionArray[primidx + 3]; - // primsign is digit 1 or -1 depending on whether the limb is headed - // along the positive or negative primidx axis. - char primsign; // 4J Stu - Was byte, but we use in a sum below and byte=unsigned char so we were setting endoffset incorrectly + char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; - // Initilize the per-step movement for the non-primary axies. double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); - // Initialize the coordinates. int coordinate[] = { 0, 0, 0 }; - // Loop through each crossection along the primary axis, from start to end int primoffset = 0; int endoffset = delta[primidx] + primsign; int thismat; @@ -432,60 +326,46 @@ private: thismat = thisLevel->getTile(coordinate[0], coordinate[1], coordinate[2]); if (!((thismat == 0) || (thismat == Tile::leaves->id))) { - // If the material of the checked block is anything other than - // air or foliage, stop looking. + break; } primoffset += primsign; } - // If you reached the end without finding anything, return -1. + if (primoffset == endoffset) { return -1; } - // Otherwise, return the number of steps you took. + else { return abs(primoffset); } } bool checkLocation(){ - // Return true if the tree can be placed here. - // Return false if the tree can not be placed here. - - // Examine the square under the trunk. Is it grass or dirt? - // If not, return false - // Examine center column for how tall the tree can be. - // If the checked height is shorter than height, but taller - // than 4, set the tree to the maximum height allowed. - // If the space is too short, return false. + int startPosition[] = { origin[0], origin[1], origin[2] }; int endPosition[] = { origin[0], origin[1] + height - 1, origin[2] }; - // Check the location it is resting on int baseMaterial = thisLevel->getTile(origin[0], origin[1] - 1, origin[2]); if (!((baseMaterial == 2) || (baseMaterial == 3))) { return false; } int allowedHeight = checkLine(startPosition, endPosition); - // If the set height is good, go with that if (allowedHeight == -1) { return true; } - // If the space is too short, tell the build to abort + else if (allowedHeight < 6) { return false; } - // If the space is shorter than the set height, but not too short - // shorten the height, and tell the build to continue else { height = allowedHeight; - //System.out.println("Shortened the tree"); return true; } } @@ -502,9 +382,7 @@ public: origin[0] = 0; origin[1] = 0; origin[2] = 0; - // Field to hold the tree height. height = 0; - // Other important tree information. trunkHeight = 0; trunkHeightScale = 0.618; branchDensity = 1.0; @@ -528,65 +406,40 @@ public: } virtual void init(double heightInit, double widthInit, double foliageDensityInit){ - // all of the parameters should be from 0.0 to 1.0 - // heightInit scales the maximum overall height of the tree (still randomizes height within the possible range) - // widthInit scales the maximum overall width of the tree (keep this above 0.3 or so) - // foliageDensityInit scales how many foliage clusters are created. - // - // Note, you can call "place" without calling "init". - // This is the same as calling init(1.0,1.0,1.0) and then calling place. + heightVariance = (int) (heightInit * 12); if (heightInit > 0.5) foliageHeight = 5; widthScale = widthInit; foliageDensity = foliageDensityInit; } virtual bool place(Level *level, Random *random, int x, int y, int z){ - // Note to Markus. - // currently the following fields are set randomly. If you like, make them - // parameters passed into "place". - // - // height: so the map generator can intelligently set the height of the tree, - // and make forests with large trees in the middle and smaller ones on the edges. - // Initialize the instance fields for the level and the seed. thisLevel = level; __int64 seed = random->nextLong(); rnd->setSeed(seed); - // Initialize the origin of the tree trunk origin[0] = x; origin[1] = y; origin[2] = z; - // Sets the height. Take out this line if height is passed as a parameter if (height == 0) { height = 5 + rnd->nextInt(heightVariance); } if (!(checkLocation())) { - //System.out.println("Tree location failed"); + return false; } - //System.out.println("The height is"); - //System.out.println(height); - //System.out.println("Trunk Height check done"); + prepare(); - //System.out.println("Prepare done"); - makeFoliage(); - //System.out.println("Foliage done"); - makeTrunk(); - //System.out.println("Trunk done"); - makeBranches(); - //System.out.println("Branches done"); - return true; } }; From fa249728e515d1db1a6ce1cb324f2f099bd26237 Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 2 Apr 2026 01:19:47 +0500 Subject: [PATCH 056/189] hopefully fixes broken build --- src/world/level/levelgen/feature/BasicTree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h index 48f80e7..4985811 100644 --- a/src/world/level/levelgen/feature/BasicTree.h +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -221,7 +221,7 @@ private: int dir = 0; int xdiff = abs(coordinate[0] - start[0]); int zdiff = abs(coordinate[2] - start[2]); - int maxdiff = max(xdiff, zdiff); + int maxdiff = (std::max)(xdiff, zdiff); if (maxdiff > 0) { From eac71a93d14b6a8f66067649a9edf397acc4affc Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 2 Apr 2026 01:35:06 +0500 Subject: [PATCH 057/189] ok this should finally work now --- src/world/level/levelgen/feature/BasicTree.h | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h index 4985811..46f3f7e 100644 --- a/src/world/level/levelgen/feature/BasicTree.h +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -116,12 +116,12 @@ private: } - void crossection(int x, int y, int z, float radius, byte direction, int material) + void crossection(int x, int y, int z, float radius, unsigned char direction, int material) { int rad = (int) (radius + 0.618); - byte secidx1 = axisConversionArray[direction]; - byte secidx2 = axisConversionArray[direction + 3]; + unsigned char secidx1 = axisConversionArray[direction]; + unsigned char secidx2 = axisConversionArray[direction + 3]; int center[] = { x, y, z }; int position[] = { 0, 0, 0 }; int offset1 = -rad; @@ -182,7 +182,7 @@ private: while (cury >= y) { radius = foliageShape(cury - y); - crossection(x, cury, z, radius, (byte) 1, Tile::leaves->id); + crossection(x, cury, z, radius, (unsigned char) 1, Tile::leaves->id); cury--; } @@ -190,8 +190,8 @@ private: void limb(int *start, int *end, int material) { int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + unsigned char idx = 0; + unsigned char primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -202,8 +202,8 @@ private: idx++; } if (delta[primidx] == 0) return; - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + unsigned char secidx1 = axisConversionArray[primidx]; + unsigned char secidx2 = axisConversionArray[primidx + 3]; char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; @@ -295,8 +295,8 @@ private: int checkLine(int *start, int *end){ int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + unsigned char idx = 0; + unsigned char primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -307,8 +307,8 @@ private: idx++; } if (delta[primidx] == 0) return -1; - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + unsigned char secidx1 = axisConversionArray[primidx]; + unsigned char secidx2 = axisConversionArray[primidx + 3]; char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; @@ -415,7 +415,7 @@ public: virtual bool place(Level *level, Random *random, int x, int y, int z){ thisLevel = level; - __int64 seed = random->nextLong(); + int seed = random->nextLong(); rnd->setSeed(seed); origin[0] = x; origin[1] = y; From ff5c57f6ba1bd450d76a692c9ca1f8e452a4b3c7 Mon Sep 17 00:00:00 2001 From: Shredder Date: Fri, 3 Apr 2026 14:55:33 +0500 Subject: [PATCH 058/189] Added Foliage and Grass Color tinting, Started Basic Work on restoring ravines, New Option to Toggle Tinting. --- data/images/environment/foliagecolor.png | Bin 0 -> 17693 bytes data/images/environment/grasscolor.png | Bin 0 -> 25237 bytes data/lang/en_US.lang | 1 + src/client/Minecraft.cpp | 19 ++++++ src/client/Options.cpp | 5 ++ src/client/Options.h | 1 + src/client/gui/screens/OptionsScreen.cpp | 3 +- src/client/renderer/Chunk.cpp | 7 +++ src/client/renderer/LevelRenderer.cpp | 11 ++++ src/client/renderer/Textures.cpp | 31 ++++++++++ src/client/renderer/Textures.h | 2 + src/world/level/FoliageColor.cpp | 13 ++++ src/world/level/FoliageColor.h | 58 ++++++++++++------ src/world/level/GrassColor.cpp | 13 ++++ src/world/level/GrassColor.h | 42 +++++++++++++ src/world/level/LevelSource.h | 5 +- src/world/level/Region.h | 2 + src/world/level/biome/Biome.cpp | 8 +-- src/world/level/biome/Biome.h | 1 - src/world/level/biome/BiomeSource.cpp | 22 +++---- src/world/level/biome/BiomeSource.h | 6 +- src/world/level/levelgen/CanyonFeature.cpp | 7 ++- src/world/level/levelgen/CanyonFeature.h | 6 +- .../level/levelgen/RandomLevelSource.cpp | 2 +- src/world/level/tile/GrassTile.cpp | 20 ++++-- src/world/level/tile/GrassTile.h | 1 + src/world/level/tile/LeafTile.h | 12 +++- 27 files changed, 241 insertions(+), 57 deletions(-) create mode 100644 data/images/environment/foliagecolor.png create mode 100644 data/images/environment/grasscolor.png create mode 100644 src/world/level/FoliageColor.cpp create mode 100644 src/world/level/GrassColor.cpp create mode 100644 src/world/level/GrassColor.h diff --git a/data/images/environment/foliagecolor.png b/data/images/environment/foliagecolor.png new file mode 100644 index 0000000000000000000000000000000000000000..81673caee3a2d26227d88215e08d7df8d9ccfe0b GIT binary patch literal 17693 zcmXtA1ymK!+uj>+=@RK~q?OJ~g9wsJr%1O*!v&;7LRzGe?rykrhqQ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K0eWHP5wZ0$i zSg4^M%bZceci1w&(D3e|BQGiIYMomR5jbl__&J2W#rrP+@0nH`(YJ=KYe5@QqPPh9 z(+Q1NUj+LpfOf1_q}}>nq>}*)0$%fk+;ZZencvcT(ID$J1b@_tfhDiybYV*WAG>gD U)zFOe5dZ)H07*qoM6N<$f@-qCsQ>@~ literal 0 HcmV?d00001 diff --git a/data/images/environment/grasscolor.png b/data/images/environment/grasscolor.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d9c2090c4d5723c3f01ffc3559ab248e9fcbc1 GIT binary patch literal 25237 zcmZ_02{=^k9|ruKGm9AvgY0^3rLu=CZH6M1N}Hu*NTMiP@0&{Ij3o-Gw-hy@SD{iA zl@?|!sVJ06i_A#2>SctCF*E0TruYAC*LQu_HC;7lX3lxe^Zb7I@4oNncRKE~eicno zPZ0n>TkW-S695SOCjuyB_*Y3r}_)V+a!L2rfVfcm^?zYYifZI7rk`NMnPmS>k zhzCHWQT_*c8eO&v9@IVH;eTLr^zH)(L*l}KPspDA2dvk7Y%%)F-g=SsqSYrP0swZB zRctWNRB!d2ON@xE`9vrnKmYHrP34|x06{YPIPJhfNUSHk&tS2^o#bWsxF-)XX5 zCLQy^uk#sF^2brySF~(yM-ndlURaYv$bRC@8pPj3Ur8cN>PHkiVL+ye+RAP|_=-!n z>q|wGIor7GU+{Z#Q~A^P2R0Fn-f+J;`Ec1!ahk(96Y!K&Ie|-O`tZ&!*ARGm39Wl8 zxJ&#fIk-yN=lUyJPynwce2@Q8#^O1`(_F>RYZ?vmFSN=k#zr~zvMJY(BF(q1ho$5{ z`0(QIXH0)~z`-+sE+sg?iv4uzpquo}-GB8XL`_}K`Sox7WR1p>*&Wkd{KGw)>$3Xq zPD1B8_KX%|5SM+6O;nw1-@;|zOC)5Uw4J=PzJ%M*&4?oN#pYa(cb>HN@Z-)1h2st10 zBMwMMxoZ3S_|z%Z*=fTDLk7T8fO?WNul8^8(`$Uj%wu-pO0W#yyte3QQtKPn;l2s7 z-e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- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -153,6 +153,7 @@ options.group.tweaks=Tweaks options.allowSprint=Allow sprint options.barOnTop=HUD above inventory options.rpiCursor=Show Raspberry PI cursor +options.foliageTint=Tint Grass and Leaves options.autoJump=Auto Jump options.thirdperson=Third Person options.servervisible=Server Visible diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 341bea9..1127246 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -90,6 +90,7 @@ #include "../network/command/CommandServer.h" #include "gamemode/CreatorMode.h" +#include "../world/level/GrassColor.h" static void checkGlError(const char* tag) { #ifdef GLDEBUG while (1) { @@ -1132,6 +1133,24 @@ void Minecraft::init() gameRenderer = new GameRenderer(this); particleEngine = new ParticleEngine(level, textures); + // 4j's code for reference +// FoliageColor::init(textures->loadTexturePixels(L"misc/foliagecolor.png")); + + + // my code + TextureId foliageId = (textures->loadTexture("environment/foliagecolor.png")); // loading the uh png for foliage color + int* foliagePixels = textures->loadTexturePixels(foliageId, "environment/foliagecolor.png"); + // now i can finally initialize foliage color, probably not the best way to handle this but i cant be arsed rn + FoliageColor::init(foliagePixels); + + TextureId grassId = (textures->loadTexture("environment/grasscolor.png")); // loading the uh png for foliage color + int* grassPixels = textures->loadTexturePixels(grassId, "environment/grasscolor.png"); + GrassColor::init(grassPixels); + + bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color + FoliageColor::setUseTint(tint); + GrassColor::setUseTint(tint); + // Platform specific initialization here font = new Font(&options, "font/default8.png", textures); diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 2cacca0..68d6bae 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -60,6 +60,8 @@ OptionBool useTouchscreen("useTouchscreen", true); OptionBool serverVisible("servervisible", true); +OptionBool foliageTint("foliagetint", false); + OptionInt keyForward("key.forward", Keyboard::KEY_W); OptionInt keyLeft("key.left", Keyboard::KEY_A); OptionInt keyBack("key.back", Keyboard::KEY_S); @@ -136,6 +138,8 @@ void Options::initTable() { m_options[OPTIONS_USE_TOUCHSCREEN] = &useTouchscreen; + + m_options[OPTIONS_SERVER_VISIBLE] = &serverVisible; m_options[OPTIONS_KEY_FORWARD] = &keyForward; @@ -160,6 +164,7 @@ void Options::initTable() { m_options[OPTIONS_BAR_ON_TOP] = &barOnTop; m_options[OPTIONS_ALLOW_SPRINT] = &allowSprint; m_options[OPTIONS_RPI_CURSOR] = &rpiCursor; + m_options[OPTIONS_FOLIAGE_TINT] = &foliageTint; m_options[OPTIONS_AUTOJUMP] = &autoJump; m_options[OPTIONS_LAST_IP] = &lastIp; diff --git a/src/client/Options.h b/src/client/Options.h index f5a4393..96d6f3b 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -84,6 +84,7 @@ enum OptionId { OPTIONS_LAST_IP, OPTIONS_RPI_CURSOR, + OPTIONS_FOLIAGE_TINT, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 11b87c1..02a7a62 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -225,7 +225,8 @@ void OptionsScreen::generateOptionScreens() { optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft) .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) - .addOptionItem(OPTIONS_RPI_CURSOR, minecraft); + .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) + .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft); } void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { diff --git a/src/client/renderer/Chunk.cpp b/src/client/renderer/Chunk.cpp index 13ac27c..2d28324 100755 --- a/src/client/renderer/Chunk.cpp +++ b/src/client/renderer/Chunk.cpp @@ -7,6 +7,10 @@ #include "../../world/level/Region.h" #include "../../world/level/chunk/LevelChunk.h" #include "../../util/Mth.h" + +#include "../../world/level/biome/BiomeSource.h" + +#include "../../world/level/Level.h" //#include "../../platform/time.h" /*static*/ int Chunk::updates = 0; @@ -260,3 +264,6 @@ void Chunk::resetUpdates() updates = 0; //swRebuild.reset(); } +BiomeSource* Region::getBiomeSource() { + return level->getBiomeSource(); +} \ No newline at end of file diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 3520732..73670cd 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -25,6 +25,8 @@ #include "../../client/player/LocalPlayer.h" +#include "../../world/level/GrassColor.h" + #ifdef GFX_SMALLER_CHUNKS /* static */ const int LevelRenderer::CHUNK_SIZE = 8; #else @@ -143,6 +145,10 @@ void LevelRenderer::setLevel( Level* level ) level->addListener(this); allChanged(); } + if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { + mc->useAmbientOcclusion = !mc->useAmbientOcclusion; + allChanged(); + } } void LevelRenderer::allChanged() @@ -155,6 +161,11 @@ void LevelRenderer::allChanged() Tile::leaves_carried->setFancy(fancy); lastViewDistance = mc->options.getIntValue(OPTIONS_VIEW_DISTANCE); + bool tint = mc->options.getBooleanValue(OPTIONS_FOLIAGE_TINT); + FoliageColor::setUseTint(tint); + GrassColor::setUseTint(tint); + + int dist = (512 >> 3) << (3 - lastViewDistance); if (lastViewDistance <= 2 && mc->isPowerVR()) dist = (int)((float)dist * 0.8f); diff --git a/src/client/renderer/Textures.cpp b/src/client/renderer/Textures.cpp index 9fce411..b4b1676 100755 --- a/src/client/renderer/Textures.cpp +++ b/src/client/renderer/Textures.cpp @@ -249,6 +249,37 @@ int Textures::crispBlend( int c0, int c1 ) return (a << 24) | (r << 16) | (g << 8) | b; } +// shredder here, moved the code from minecraft.cpp bcus that isnt the right place +// had to implement this because i couldn't find a similar function in the code to do this +int* Textures::loadTexturePixels(TextureId texId, const std::string& resourceName){ + + const TextureData* texture = getTemporaryTextureData(texId); // storing raw pixels + + int size = texture->w * texture->h; // gets the size of our funny lil guy + int* pixels = new int[size]; // memory leaks be galore + unsigned char* raw = texture->data; // storing raw data into our beloved variable + for (int i = 0; i < (texture->w * texture->h); i++){ + // my head hurts i hate working with this + + + // uh since each pixel stores r g b a, aka the color channels which are each one byte, we multiply them by 4 to move from one pixel to another + + int r = raw[i * 4 + 0]; // gets us the first channel aka red + int g = raw[i * 4 + 1]; // gets us the second channel green + int b = raw[i * 4 + 2]; // gets us the third channel blue + int a = raw[i * 4 + 3]; // gets us the alpha channel + + // woohoo pixels uh should have been seperated into their colors now hopefully + + // r g b a + // ugh we now got to turn it into the AA RR GGBB format aak 0xAARRGGBB + // b gets 0 - 7 (8 bits), g gets 7 - 15 (8 bits), r gets 16 - 23 (8 bits), alpha gets the last ones 24 - 31 (8 bits), + pixels[i] = (a << 24) | (r << 16) | (g << 8) | (b); // shuld combine them into one 32 bit int unless i did something dumb + } + return pixels; // your meal has been prepared john colors +} + + ///*public*/ int loadHttpTexture(std::string url, std::string backup) { // HttpTexture texture = httpTextures.get(url); // if (texture != NULL) { diff --git a/src/client/renderer/Textures.h b/src/client/renderer/Textures.h index f5e2113..f4ab36e 100755 --- a/src/client/renderer/Textures.h +++ b/src/client/renderer/Textures.h @@ -44,6 +44,8 @@ public: TextureId assignTexture(const std::string& resourceName, const TextureData& img); const TextureData* getTemporaryTextureData(TextureId id); + int* loadTexturePixels(TextureId texId, const std::string& resourceName); + void tick(bool uploadToGraphicsCard); void clear(); diff --git a/src/world/level/FoliageColor.cpp b/src/world/level/FoliageColor.cpp new file mode 100644 index 0000000..018cd1f --- /dev/null +++ b/src/world/level/FoliageColor.cpp @@ -0,0 +1,13 @@ +#include "FoliageColor.h" + +// TODO: Probably move all the stuff from the header into here so it's a bit cleaner +bool FoliageColor::useTint = true; + +int FoliageColor::get(float temp, float rain) { + rain *= temp; + int x = (int) ((1 - temp) * 255); + int y = (int) ((1 - rain) * 255); + return pixels[y << 8 | x]; +} + +int* FoliageColor::pixels = nullptr; \ No newline at end of file diff --git a/src/world/level/FoliageColor.h b/src/world/level/FoliageColor.h index 6d7d024..98d77b7 100755 --- a/src/world/level/FoliageColor.h +++ b/src/world/level/FoliageColor.h @@ -6,31 +6,49 @@ class FoliageColor { public: -// static void init(int[] pixels) { -// FoliageColor::pixels = pixels; -// } -// -// static int get(float temp, float rain) { -// rain *= temp; -// int x = (int) ((1 - temp) * 255); -// int y = (int) ((1 - rain) * 255); -// return pixels[y << 8 | x]; -// } + static bool useTint; - static int getEvergreenColor() { - return 0x619961; - } + static void setUseTint(bool value) { + useTint = value; + } + /* + Shredder here, Ive converted the unused commented out code into their correct syntax, though if i did something incorrectly feel free to take reference from the + commented out code + */ - static int getBirchColor() { - return 0x80a755; - } + // static void init(int[] pixels) { + // FoliageColor::pixels = pixels; + // } + // + // static int get(float temp, float rain) { + // rain *= temp; + // int x = (int) ((1 - temp) * 255); + // int y = (int) ((1 - rain) * 255); + // return pixels[y << 8 | x]; + // } - static int getDefaultColor() { - return 0x48b518; - } + + static void init(int* p) { + pixels = p; + } + + static int get(float temp, float rain); + + static int getEvergreenColor() { + return 0x619961; + } + + static int getBirchColor() { + return 0x80a755; + } + + static int getDefaultColor() { + return 0xFFFFFF; + } private: - //static int pixels[256*256]; + // static int pixels[256*256]; + static int* pixels; }; #endif /*NET_MINECRAFT_WORLD_LEVEL__FoliageColor_H__*/ diff --git a/src/world/level/GrassColor.cpp b/src/world/level/GrassColor.cpp new file mode 100644 index 0000000..eb05bd4 --- /dev/null +++ b/src/world/level/GrassColor.cpp @@ -0,0 +1,13 @@ +#include "GrassColor.h" + +// TODO: Probably move all the stuff from the header into here so it's a bit cleaner +bool GrassColor::useTint = true; + +int GrassColor::get(float temp, float rain) { + rain *= temp; + int x = (int) ((1 - temp) * 255); + int y = (int) ((1 - rain) * 255); + return pixels[y << 8 | x]; +} + +int* GrassColor::pixels = nullptr; \ No newline at end of file diff --git a/src/world/level/GrassColor.h b/src/world/level/GrassColor.h new file mode 100644 index 0000000..08903c7 --- /dev/null +++ b/src/world/level/GrassColor.h @@ -0,0 +1,42 @@ +#ifndef NET_MINECRAFT_WORLD_LEVEL__GrassColor_H__ +#define NET_MINECRAFT_WORLD_LEVEL__GrassColor_H__ + +//package net.minecraft.world.level; + +class GrassColor +{ +public: + static bool useTint; + + static void setUseTint(bool value) { + useTint = value; + } +/* +Shredder here, Ive converted the unused commented out code into their correct syntax, though if i did something incorrectly feel free to take reference from the +commented out code +*/ + +// static void init(int[] pixels) { +// GrassColor::pixels = pixels; +// } +// +// static int get(float temp, float rain) { +// rain *= temp; +// int x = (int) ((1 - temp) * 255); +// int y = (int) ((1 - rain) * 255); +// return pixels[y << 8 | x]; +// } + + + static void init(int* p) { + pixels = p; + } + + static int get(float temp, float rain); + +private: + // static int pixels[256*256]; + static int* pixels; +}; + +#endif /*NET_MINECRAFT_WORLD_LEVEL__GrassColor_H__*/ diff --git a/src/world/level/LevelSource.h b/src/world/level/LevelSource.h index 5dc5896..a130ec1 100755 --- a/src/world/level/LevelSource.h +++ b/src/world/level/LevelSource.h @@ -3,8 +3,9 @@ //package net.minecraft.world.level; -/* + class BiomeSource; +/* class TileEntity; */ class Material; @@ -29,7 +30,7 @@ public: virtual bool isSolidRenderTile(int x, int i, int z) = 0; virtual bool isSolidBlockingTile(int x, int i, int z) = 0; - //virtual BiomeSource* getBiomeSource() = 0; + virtual BiomeSource* getBiomeSource() = 0; virtual Biome* getBiome(int x, int z) = 0; }; diff --git a/src/world/level/Region.h b/src/world/level/Region.h index b4c3e58..d699099 100755 --- a/src/world/level/Region.h +++ b/src/world/level/Region.h @@ -5,6 +5,7 @@ #include "LevelSource.h" + class Level; class Material; class LevelChunk; @@ -27,6 +28,7 @@ public: int getData(int x, int y, int z); const Material* getMaterial(int x, int y, int z); Biome* getBiome(int x, int z); + BiomeSource* getBiomeSource() override; private: int xc1, zc1; LevelChunk*** chunks; diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index 7ccbdfe..609ed52 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -149,13 +149,7 @@ Feature* Biome::getGrassFeature( Random* random ) { return new TallgrassFeature(Tile::tallgrass->id, TallGrass::TALL_GRASS); } -Feature* Biome::getBasicTreeFeature( Random* random ) -{ - if (random->nextInt(10) == 0) { - return new BasicTree(false); - } - -} + Biome* Biome::getBiome( float temperature, float downfall ) diff --git a/src/world/level/biome/Biome.h b/src/world/level/biome/Biome.h index 23fd495..48a49d5 100755 --- a/src/world/level/biome/Biome.h +++ b/src/world/level/biome/Biome.h @@ -71,7 +71,6 @@ public: virtual Feature* getTreeFeature(Random* random); virtual Feature* getGrassFeature(Random* random); - virtual Feature* getBasicTreeFeature(Random* random); static Biome* getBiome(float temperature, float downfall); static Biome* _getBiome(float temperature, float downfall); diff --git a/src/world/level/biome/BiomeSource.cpp b/src/world/level/biome/BiomeSource.cpp index ab7c3a4..395b5a9 100755 --- a/src/world/level/biome/BiomeSource.cpp +++ b/src/world/level/biome/BiomeSource.cpp @@ -69,11 +69,11 @@ Biome* BiomeSource::getBiome( int x, int z ) return getBiomeBlock(x, z, 1, 1)[0]; } -//float BiomeSource::getTemperature( int x, int z ) -//{ -// temperatures = temperatureMap->getRegion(temperatures, x, z, 1, 1, tempScale, tempScale, 0.5f); -// return temperatures[0]; -//} +float BiomeSource::getTemperature( int x, int z ) +{ + temperatures = temperatureMap->getRegion(temperatures, x, z, 1, 1, tempScale, tempScale, 0.5f); + return temperatures[0]; +} Biome** BiomeSource::getBiomeBlock( int x, int z, int w, int h ) { @@ -123,7 +123,7 @@ Biome** BiomeSource::getBiomeBlock( Biome** biomes__, int x, int z, int w, int h return biomes; } -float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z, int w, int h ) +float* BiomeSource::getTemperatureBlock( float* temperatures__, int x, int z, int w, int h ) { //LOGI("gTempBlock: 1\n"); //const int size = w * h; @@ -164,8 +164,8 @@ float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z return temperatures; } -//float* BiomeSource::getDownfallBlock( /*float* downfalls__,*/ int x, int z, int w, int h ) -//{ +float* BiomeSource::getDownfallBlock( float* downfalls__, int x, int z, int w, int h ) +{ // //const int size = w * h; // //if (lenDownfalls < size) { // // delete[] downfalls; @@ -173,6 +173,6 @@ float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z // // lenDownfalls = size; // //} // -// downfalls = downfallMap->getRegion(downfalls, x, z, w, w, downfallScale, downfallScale, 0.5f); -// return downfalls; -//} + downfalls = downfallMap->getRegion(downfalls, x, z, w, w, downfallScale, downfallScale, 0.5f); + return downfalls; +} diff --git a/src/world/level/biome/BiomeSource.h b/src/world/level/biome/BiomeSource.h index fb540c1..25a3e5f 100755 --- a/src/world/level/biome/BiomeSource.h +++ b/src/world/level/biome/BiomeSource.h @@ -31,13 +31,13 @@ public: virtual Biome* getBiome(const ChunkPos& chunk); virtual Biome* getBiome(int x, int z); - //virtual float getTemperature(int x, int z); + virtual float getTemperature(int x, int z); // Note: The arrays returned here are temporary in the meaning that their // contents might change in the future. If you need to SAVE the // values, do a shallow copy to an array of your own. - virtual float* getTemperatureBlock(/*float* temperatures, */ int x, int z, int w, int h); - //virtual float* getDownfallBlock(/*float* downfalls, */int x, int z, int w, int h); + virtual float* getTemperatureBlock(float* temperatures, int x, int z, int w, int h); + virtual float* getDownfallBlock(float* downfalls, int x, int z, int w, int h); virtual Biome** getBiomeBlock(int x, int z, int w, int h); private: diff --git a/src/world/level/levelgen/CanyonFeature.cpp b/src/world/level/levelgen/CanyonFeature.cpp index f7d9ca3..095cd30 100755 --- a/src/world/level/levelgen/CanyonFeature.cpp +++ b/src/world/level/levelgen/CanyonFeature.cpp @@ -1,4 +1,4 @@ -#if 0 + #include "CanyonFeature.h" @@ -138,7 +138,7 @@ void CanyonFeature::addTunnel( int xOffs, int zOffs, unsigned char* blocks, floa } } -void CanyonFeature::addFeature( Level level, int x, int z, int xOffs, int zOffs, char* blocks ) +void CanyonFeature::addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks) { if (random.nextInt(15) != 0) return; @@ -151,6 +151,7 @@ void CanyonFeature::addFeature( Level level, int x, int z, int xOffs, int zOffs, float thickness = (random.nextFloat() * 2 + random.nextFloat()) + 1; addTunnel(xOffs, zOffs, blocks, xCave, yCave, zCave, thickness, yRot, xRot, 0, 0, 5.0); + } /* //private @@ -165,4 +166,4 @@ void CanyonFeature::addFeature( Level level, int x, int z, int xOffs, int zOffs, for (int z = zOffs - r; z <= zOffs + r; z++) { random.setSeed((x * xScale + z * zScale) ^ level.seed);*/ -#endif + diff --git a/src/world/level/levelgen/CanyonFeature.h b/src/world/level/levelgen/CanyonFeature.h index bd60c71..a187681 100755 --- a/src/world/level/levelgen/CanyonFeature.h +++ b/src/world/level/levelgen/CanyonFeature.h @@ -1,7 +1,7 @@ #ifndef NET_MINECRAFT_WORLD_LEVEL_LEVELGEN__CanyonFeature_H__ #define NET_MINECRAFT_WORLD_LEVEL_LEVELGEN__CanyonFeature_H__ -#if 0 + //package net.minecraft.world.level.levelgen; @@ -12,8 +12,8 @@ class CanyonFeature: public LargeFeature { /*protected*/ void addTunnel(int xOffs, int zOffs, unsigned char* blocks, float xCave, float yCave, float zCave, float thickness, float yRot, float xRot, int step, int dist, float yScale); /*protected*/ - void addFeature(Level level, int x, int z, int xOffs, int zOffs, char* blocks); + void addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks); }; -#endif + #endif /*NET_MINECRAFT_WORLD_LEVEL_LEVELGEN__CanyonFeature_H__*/ diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 56f5b8b..99f8ce7 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -473,7 +473,7 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { MobSpawner::postProcessSpawnMobs(level, biome, xo + 8, zo + 8, 16, 16, &random); //LOGI("Reading temp: 1\n"); - float* temperatures = level->getBiomeSource()->getTemperatureBlock(/*NULL,*/ xo + 8, zo + 8, 16, 16); + float* temperatures = level->getBiomeSource()->getTemperatureBlock(NULL, xo + 8, zo + 8, 16, 16); for (int x = xo + 8; x < xo + 8 + 16; x++) for (int z = zo + 8; z < zo + 8 + 16; z++) { int xp = x - (xo + 8); diff --git a/src/world/level/tile/GrassTile.cpp b/src/world/level/tile/GrassTile.cpp index 7a293ea..1828966 100755 --- a/src/world/level/tile/GrassTile.cpp +++ b/src/world/level/tile/GrassTile.cpp @@ -1,6 +1,11 @@ #include "GrassTile.h" #include "../material/Material.h" #include "../../entity/item/ItemEntity.h" +#include "../GrassColor.h" +#include "../Level.h" +#include "../LevelSource.h" +#include "../biome/BiomeSource.h" +#include "../../../client/Minecraft.h" GrassTile::GrassTile(int id) : super(id, Material::dirt) @@ -24,11 +29,18 @@ int GrassTile::getTexture( int face, int data ) { } int GrassTile::getColor( LevelSource* level, int x, int y, int z ) { - //level.getBiomeSource().getBiomeBlock(x, z, 1, 1); - //float temp = level.getBiomeSource().temperatures[0]; - //float rain = level.getBiomeSource().downfalls[0]; - return 0x339933;//GrassColor.get(temp, rain); + if(!GrassColor::useTint){ + return 0x339933; + } + + level->getBiomeSource()->getBiomeBlock(x, z, 1, 1); + float temp = level->getBiomeSource()->temperatures[0]; + float rain = level->getBiomeSource()->downfalls[0]; + +// return 0x339933;//GrassColor.get(temp, rain); // we need to hook this up with OPTION_FOLIAGE_TINT + + return GrassColor::get(temp, rain); } void GrassTile::tick( Level* level, int x, int y, int z, Random* random ) { diff --git a/src/world/level/tile/GrassTile.h b/src/world/level/tile/GrassTile.h index bc62825..c97db84 100755 --- a/src/world/level/tile/GrassTile.h +++ b/src/world/level/tile/GrassTile.h @@ -14,6 +14,7 @@ class GrassTile: public Tile { typedef Tile super; public: + static const int MIN_BRIGHTNESS = 4; GrassTile(int id); diff --git a/src/world/level/tile/LeafTile.h b/src/world/level/tile/LeafTile.h index e1102ca..53d9884 100755 --- a/src/world/level/tile/LeafTile.h +++ b/src/world/level/tile/LeafTile.h @@ -9,6 +9,8 @@ #include "../../item/Item.h" #include "../../item/ItemInstance.h" #include "../FoliageColor.h" +#include "../LevelSource.h" +#include "../biome/BiomeSource.h" class Entity; @@ -54,8 +56,16 @@ public: if (data == BIRCH_LEAF) { return FoliageColor::getBirchColor(); } + if (!FoliageColor::useTint){ + return FoliageColor::getDefaultColor(); + } - return FoliageColor::getDefaultColor(); + // return FoliageColor::getDefaultColor(); we need to hook this up with OPTION_FOLIAGE_TINT + level->getBiomeSource()->getBiomeBlock(x, z, 1, 1); + float temperature = level->getBiomeSource()->temperatures[0]; + float rainfall = level->getBiomeSource()->downfalls[0]; + return FoliageColor::get(temperature, rainfall); + } void onRemove(Level* level, int x, int y, int z) { From 61f0124beb52a77da67fa345b9d577d93f0841d0 Mon Sep 17 00:00:00 2001 From: Shredder Date: Fri, 3 Apr 2026 15:37:15 +0500 Subject: [PATCH 059/189] oops forgot to define some things --- project/android/jni/Android.mk | 2 ++ project/android_java/jni/Android.mk | 2 ++ src/world/level/Region.cpp | 7 ++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 9bff609..596be52 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -209,6 +209,8 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/world/level/MobSpawner.cpp \ ../../../src/world/level/Region.cpp \ ../../../src/world/level/TickNextTickData.cpp \ +../../../src/world/level/FoliageColor.cpp \ +../../../src/world/level/GrassColor.cpp \ ../../../src/world/level/biome/Biome.cpp \ ../../../src/world/level/biome/BiomeSource.cpp \ ../../../src/world/level/chunk/LevelChunk.cpp \ diff --git a/project/android_java/jni/Android.mk b/project/android_java/jni/Android.mk index 04720a6..86856d7 100755 --- a/project/android_java/jni/Android.mk +++ b/project/android_java/jni/Android.mk @@ -183,6 +183,8 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/world/level/MobSpawner.cpp \ ../../../src/world/level/Region.cpp \ ../../../src/world/level/TickNextTickData.cpp \ +../../../src/world/level/FoliageColor.cpp \ +../../../src/world/level/GrassColor.cpp \ ../../../src/world/level/biome/Biome.cpp \ ../../../src/world/level/biome/BiomeSource.cpp \ ../../../src/world/level/chunk/LevelChunk.cpp \ diff --git a/src/world/level/Region.cpp b/src/world/level/Region.cpp index c501912..c2104b3 100755 --- a/src/world/level/Region.cpp +++ b/src/world/level/Region.cpp @@ -4,6 +4,7 @@ #include "tile/Tile.h" #include "Level.h" + Region::Region(Level* level, int x1, int y1, int z1, int x2, int y2, int z2) { this->level = level; @@ -135,6 +136,6 @@ Biome* Region::getBiome( int x, int z ) { return level->getBiome(x, z); } -//BiomeSource getBiomeSource() { -// return level.getBiomeSource(); -//} +BiomeSource* Region::getBiomeSource() { + return level->getBiomeSource(); +} From 378dfe8e22b9e66edb970318d588a3d9705e4ec8 Mon Sep 17 00:00:00 2001 From: Shredder Date: Fri, 3 Apr 2026 15:54:48 +0500 Subject: [PATCH 060/189] award for brain of a goldfish goes to me --- src/client/renderer/Chunk.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/client/renderer/Chunk.cpp b/src/client/renderer/Chunk.cpp index 2d28324..527508a 100755 --- a/src/client/renderer/Chunk.cpp +++ b/src/client/renderer/Chunk.cpp @@ -263,7 +263,4 @@ void Chunk::resetUpdates() { updates = 0; //swRebuild.reset(); -} -BiomeSource* Region::getBiomeSource() { - return level->getBiomeSource(); } \ No newline at end of file From 4023d7068784549bdfb02e9d080feaadfea66ee7 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 4 Apr 2026 01:13:56 +0300 Subject: [PATCH 061/189] FEAT: server-side commands --- src/client/gui/screens/ConsoleScreen.cpp | 8 +++++-- src/commands/Command.hpp | 4 ++-- src/commands/CommandHelp.cpp | 28 +++++++++++++++--------- src/commands/CommandHelp.hpp | 4 ++-- src/commands/CommandKick.cpp | 14 ++++++------ src/commands/CommandKick.hpp | 4 ++-- src/commands/CommandManager.cpp | 8 ++++--- src/commands/CommandManager.hpp | 2 +- src/commands/CommandOp.cpp | 14 ++++++------ src/commands/CommandOp.hpp | 4 ++-- src/network/ClientSideNetworkHandler.cpp | 6 ++++- src/network/ServerSideNetworkHandler.cpp | 21 +++++++++++++++++- src/network/ServerSideNetworkHandler.h | 6 +++++ 13 files changed, 83 insertions(+), 40 deletions(-) diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index 9821f99..42f47ee 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -66,7 +66,11 @@ void ConsoleScreen::execute() if (_input[0] == '/') { // Command _input = Util::stringTrim(_input.substr(1)); - minecraft->commandManager().execute(*minecraft, *minecraft->player, _input); + + std::istringstream iss(minecraft->commandManager().execute(*minecraft, *minecraft->player, _input)); + for (std::string line; std::getline(iss, line); ) { + minecraft->gui.addMessage(line); + } } else { // @ai @rewrite if (minecraft->netCallback && minecraft->raknetInstance->isServer()) { @@ -75,7 +79,7 @@ void ConsoleScreen::execute() ChatPacket chatPkt(_input); minecraft->raknetInstance->send(chatPkt); } else { - minecraft->gui.addMessage(_input); + minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); } } diff --git a/src/commands/Command.hpp b/src/commands/Command.hpp index f44c3df..fb3fdd0 100644 --- a/src/commands/Command.hpp +++ b/src/commands/Command.hpp @@ -17,8 +17,8 @@ public: bool isPlayerOp(Minecraft& mc, Player& player); - virtual void execute(Minecraft& mc, Player& player, const std::vector& args) = 0; - virtual void printHelp(Minecraft& mc) = 0; + virtual std::string execute(Minecraft& mc, Player& player, const std::vector& args) = 0; + virtual std::string help(Minecraft& mc) = 0; protected: Command(const std::string& name, CommandFlags flags = (CommandFlags)0) : m_name(name), m_flags(flags) {} diff --git a/src/commands/CommandHelp.cpp b/src/commands/CommandHelp.cpp index 18f7741..9f09da4 100644 --- a/src/commands/CommandHelp.cpp +++ b/src/commands/CommandHelp.cpp @@ -2,26 +2,34 @@ #include "commands/Command.hpp" #include "CommandManager.hpp" #include +#include CommandHelp::CommandHelp() : Command("help") {} -void CommandHelp::execute(Minecraft& mc, Player& player, const std::vector& args) { +std::string CommandHelp::execute(Minecraft& mc, Player& player, const std::vector& args) { if (args.empty()) { auto cmds = mc.commandManager().getListAllCommands(); - mc.addMessage("Usage: /help "); - mc.addMessage("List of all commands:"); + std::ostringstream output; + + output << "List of all commands:" << std::endl; for (auto& cmd : cmds) { - mc.addMessage(" - " + cmd); + output << " - " + cmd << std::endl;; } - } else { - Command* cmd = mc.commandManager().getCommand(args[0]); - if (cmd != nullptr) { - cmd->printHelp(mc); - } + return output.str(); } + + Command* cmd = mc.commandManager().getCommand(args[0]); + + if (cmd != nullptr) { + return cmd->help(mc); + } + + return "help: command " + args[0] + " not found"; } -void CommandHelp::printHelp(Minecraft& mc) {} \ No newline at end of file +std::string CommandHelp::help(Minecraft& mc) { + return "Usage: /help "; +} \ No newline at end of file diff --git a/src/commands/CommandHelp.hpp b/src/commands/CommandHelp.hpp index 48e1f1f..4c2349a 100644 --- a/src/commands/CommandHelp.hpp +++ b/src/commands/CommandHelp.hpp @@ -4,6 +4,6 @@ class CommandHelp : public Command { public: CommandHelp(); - void execute(Minecraft& mc, Player& player, const std::vector& args); - void printHelp(Minecraft& mc); + std::string execute(Minecraft& mc, Player& player, const std::vector& args); + std::string help(Minecraft& mc); }; \ No newline at end of file diff --git a/src/commands/CommandKick.cpp b/src/commands/CommandKick.cpp index b08ba86..2dad690 100644 --- a/src/commands/CommandKick.cpp +++ b/src/commands/CommandKick.cpp @@ -9,13 +9,13 @@ CommandKick::CommandKick() : Command("kick") {} -void CommandKick::execute(Minecraft& mc, Player& player, const std::vector& args) { +std::string CommandKick::execute(Minecraft& mc, Player& player, const std::vector& args) { if (!isPlayerOp(mc, player)) { - return mc.addMessage("You aren't enough priveleged to run this command"); + return "You aren't enough priveleged to run this command"; } if (args.empty()) { - return printHelp(mc); + return help(mc); } auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args] (auto& it) -> bool { @@ -23,11 +23,11 @@ void CommandKick::execute(Minecraft& mc, Player& player, const std::vectorplayers.end()) { - return mc.addMessage("kick: can't find player with name " + args[0]); + return "kick: can't find player with name " + args[0]; } if (*it == (Player*)mc.player) { - return mc.addMessage("kick: you can't kick urself lol"); + return "kick: you can't kick urself lol"; } mc.level->removePlayer(*it); @@ -36,6 +36,6 @@ void CommandKick::execute(Minecraft& mc, Player& player, const std::vector"); +std::string CommandKick::help(Minecraft& mc) { + return "Usage: /kick "; } \ No newline at end of file diff --git a/src/commands/CommandKick.hpp b/src/commands/CommandKick.hpp index 80225a8..5b94819 100644 --- a/src/commands/CommandKick.hpp +++ b/src/commands/CommandKick.hpp @@ -4,6 +4,6 @@ class CommandKick : public Command { public: CommandKick(); - void execute(Minecraft& mc, Player& player, const std::vector& args); - void printHelp(Minecraft& mc); + std::string execute(Minecraft& mc, Player& player, const std::vector& args); + std::string help(Minecraft& mc); }; \ No newline at end of file diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index 2b7f7f0..f92f380 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -33,7 +33,7 @@ std::vector CommandManager::getListAllCommands() { return ret; } -void CommandManager::execute(Minecraft& mc, Player& player, const std::string& input) { +std::string CommandManager::execute(Minecraft& mc, Player& player, const std::string& input) { std::istringstream ss(input); std::string cmd; @@ -44,7 +44,7 @@ void CommandManager::execute(Minecraft& mc, Player& player, const std::string& i }); if (it == m_commands.end()) { - return mc.addMessage("Command /" + cmd + " not found"); + return "Command /" + cmd + " not found"; } std::vector args; @@ -53,11 +53,13 @@ void CommandManager::execute(Minecraft& mc, Player& player, const std::string& i while (ss >> tok) args.push_back(tok); if (!mc.level->isClientSide || (*it)->getFlags() & CommandFlags::COMMAND_FLAG_SINGLEPLAYER_ONLY) { - (*it)->execute(mc, player, args); + return (*it)->execute(mc, player, args); } else { ChatPacket packet("/" + input); mc.raknetInstance->send(packet); } + + return ""; } Command* CommandManager::getCommand(const std::string& name) { diff --git a/src/commands/CommandManager.hpp b/src/commands/CommandManager.hpp index 28817ea..c33b363 100644 --- a/src/commands/CommandManager.hpp +++ b/src/commands/CommandManager.hpp @@ -10,7 +10,7 @@ public: std::vector getListAllCommands(); - void execute(Minecraft& mc, Player& player, const std::string& input); + std::string execute(Minecraft& mc, Player& player, const std::string& input); Command* getCommand(const std::string& name); diff --git a/src/commands/CommandOp.cpp b/src/commands/CommandOp.cpp index b53646e..df28db5 100644 --- a/src/commands/CommandOp.cpp +++ b/src/commands/CommandOp.cpp @@ -9,13 +9,13 @@ CommandOp::CommandOp() : Command("op") {} -void CommandOp::execute(Minecraft& mc, Player& player, const std::vector& args) { +std::string CommandOp::execute(Minecraft& mc, Player& player, const std::vector& args) { if (!isPlayerOp(mc, player)) { - return mc.addMessage("You aren't enough priveleged to run this command"); + return "You aren't enough priveleged to run this command"; } if (args.empty()) { - return printHelp(mc); + return help(mc); } auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args] (auto& it) -> bool { @@ -23,13 +23,13 @@ void CommandOp::execute(Minecraft& mc, Player& player, const std::vectorops.find(args[0]) != mc.level->ops.end()) { - return mc.addMessage("op: player " + args[0] + " already opped"); + return "op: player " + args[0] + " already opped"; } mc.level->ops.emplace((*it)->name); - mc.addMessage("op: successfully opped player " + args[0]); + return "op: successfully opped player " + args[0]; } -void CommandOp::printHelp(Minecraft& mc) { - mc.addMessage("Usage: /op "); +std::string CommandOp::help(Minecraft& mc) { + return "Usage: /op "; } \ No newline at end of file diff --git a/src/commands/CommandOp.hpp b/src/commands/CommandOp.hpp index ef5b30a..e91eea9 100644 --- a/src/commands/CommandOp.hpp +++ b/src/commands/CommandOp.hpp @@ -4,6 +4,6 @@ class CommandOp : public Command { public: CommandOp(); - void execute(Minecraft& mc, Player& player, const std::vector& args); - void printHelp(Minecraft& mc); + std::string execute(Minecraft& mc, Player& player, const std::vector& args); + std::string help(Minecraft& mc); }; \ No newline at end of file diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 2ae545a..ecfc12d 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -949,7 +949,11 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe void ClientSideNetworkHandler::handle( const RakNet::RakNetGUID& source, ChatPacket* packet ) { #ifndef STANDALONE_SERVER - minecraft->gui.displayClientMessage(packet->message); + // minecraft->gui.displayClientMessage(packet->message); + std::istringstream iss(packet->message); + for (std::string line; std::getline(iss, line); ) { + minecraft->gui.addMessage(line); + } #endif } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index a069b0f..69793b4 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -5,6 +5,7 @@ #include "../world/entity/player/Inventory.h" #include "../world/Container.h" #include "../world/inventory/BaseContainerMenu.h" +#include "network/packet/ChatPacket.h" #include "network/packet/ContainerSetSlotPacket.h" #include "network/packet/LoginStatusPacket.h" #include "network/packet/MovePlayerPacket.h" @@ -24,6 +25,7 @@ #include "../raknet/PacketPriority.h" #include "platform/log.h" #include "util/Mth.h" +#include "util/StringUtils.h" #include "world/item/ItemInstance.h" #include "world/level/storage/LevelStorage.h" #include "world/phys/Vec3.h" @@ -154,7 +156,18 @@ void ServerSideNetworkHandler::displayGameMessage(const std::string& message) void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChatPacket* packet) { - displayGameMessage(packet->message); + auto player = getPlayer(source); + + if (player == nullptr) return; // TODO maybe kick? + + if (packet->message[0] == '/') { + // This is a command + + ChatPacket resp(minecraft->commandManager().execute(*minecraft, *player, Util::stringTrim(packet->message.substr(1)))); + return sendPrivate(resp, source); + } + + displayGameMessage("<" + player->name + "> " + packet->message); } void ServerSideNetworkHandler::onNewClient(const RakNet::RakNetGUID& clientGuid) @@ -1020,3 +1033,9 @@ Player* ServerSideNetworkHandler::getPlayer( const RakNet::RakNetGUID& source ) if (source == level->players[i]->owner) return level->players[i]; return NULL; } + +void ServerSideNetworkHandler::sendPrivate(Packet& packet, const RakNet::RakNetGUID& source) { + RakNet::BitStream bitStream; + packet.write(&bitStream); + rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); +} \ No newline at end of file diff --git a/src/network/ServerSideNetworkHandler.h b/src/network/ServerSideNetworkHandler.h index a65585a..1e9585d 100755 --- a/src/network/ServerSideNetworkHandler.h +++ b/src/network/ServerSideNetworkHandler.h @@ -71,6 +71,12 @@ private: * @brief Send packet to all players */ void redistributePacket(Packet* packet, const RakNet::RakNetGUID& fromPlayer); + + /** + * @brief Send packer private with GUID + */ + void sendPrivate(Packet& packet, const RakNet::RakNetGUID& source); + Player* getPlayer(const RakNet::RakNetGUID& source); Minecraft* minecraft; From 055f00be499a61f42be973706ea376258b892fbe Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 01:52:27 +0500 Subject: [PATCH 062/189] A bit big of a commit but Added 3 Fog Choices (Pocket) (Java) (Unknown that was unused) Restored Java Beta Sky Color code that was unused that depends on biome temperature (choosable using Java fog) Tile Shadows and Entity Shadows that appear beneath them have been restored and fixed from the unused code, toggleable by turning fancy graphics on or off Entities will now render flames on themselves when on fire, including the player Added option to use Java Style Item Count text and position in tweaks - fileshredder --- .../{environment => misc}/foliagecolor.png | Bin .../{environment => misc}/grasscolor.png | Bin data/images/misc/shadow.png | Bin 0 -> 868 bytes data/images/misc/vignette.png | Bin 0 -> 24157 bytes src/client/Minecraft.cpp | 14 +- src/client/Options.cpp | 9 + src/client/Options.h | 2 + src/client/gui/Gui.cpp | 262 +-- src/client/gui/screens/OptionsScreen.cpp | 11 +- src/client/renderer/LevelRenderer.cpp | 290 +-- src/client/renderer/LevelRenderer.h | 3 + .../entity/EntityRenderDispatcher.cpp | 14 +- src/client/renderer/entity/EntityRenderer.cpp | 241 +-- src/client/renderer/entity/EntityRenderer.h | 7 + src/client/renderer/entity/ItemRenderer.cpp | 35 +- src/client/renderer/entity/ItemRenderer.h | 2 +- src/client/renderer/entity/MobRenderer.cpp | 2 +- src/util/Color.cpp | 98 + src/util/Color.h | 15 + src/world/entity/player/Inventory.cpp | 1 + src/world/level/Level.cpp | 1804 +++++++++-------- src/world/level/biome/Biome.cpp | 12 +- src/world/level/chunk/LevelChunk.cpp | 14 +- src/world/level/dimension/Dimension.cpp | 18 +- src/world/level/dimension/Dimension.h | 5 +- .../level/dimension/NormalDayCycleDimension.h | 15 +- 26 files changed, 1574 insertions(+), 1300 deletions(-) rename data/images/{environment => misc}/foliagecolor.png (100%) rename data/images/{environment => misc}/grasscolor.png (100%) create mode 100644 data/images/misc/shadow.png create mode 100644 data/images/misc/vignette.png create mode 100644 src/util/Color.cpp create mode 100644 src/util/Color.h diff --git a/data/images/environment/foliagecolor.png b/data/images/misc/foliagecolor.png similarity index 100% rename from data/images/environment/foliagecolor.png rename to data/images/misc/foliagecolor.png diff --git a/data/images/environment/grasscolor.png b/data/images/misc/grasscolor.png similarity index 100% rename from data/images/environment/grasscolor.png rename to data/images/misc/grasscolor.png diff --git a/data/images/misc/shadow.png b/data/images/misc/shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..06d999b20896dcc2ee077cb94f6afa3c8162895a GIT binary patch literal 868 zcmV-q1DpJbP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qu=Q#NQ00PuWL_t(|UhSK&SHmz6$0w1K$Vp@+vJyFo ztVB*C=a5L`{)9>7Boc|7L?V%JAJM(FOP4fhvs}7+FJiCxb>I8m<#O$2v#Uf$U?D4( z9qlgqZbn`ZWh-eLX`j;m9NU-l+e%wWD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)FMKf~L@r8ysL@^MEq32mXj9ttP)Jl=niN1O1hWDhX z!AH*5C(OsP|K#Bsa(8^0!6Duo<`NWh14TbO|)U0`Hf;(0>+3NqI zi#M{^Yl~e^Q%l+2llBLVH&gk)vr`f)LJ?3jb7;R2Cx!7_?>eZ(5_*C$sgSE^Tlvo9 zfdyz%TG|p2m`+%jcIaoy`^hJoZ%LnUz`xiC>~`I5k9=*sYXQXx@UXT5Q}1C)em?ZJM#w{ARhZBp zzHBv)O9kusDc6mpV0%053OXw|FxnmV1h+;$aawQb4|zx8tn!2vYw!^;@R8n?DNQ(? z#@Ckp literal 0 HcmV?d00001 diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 1127246..1bd68de 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1138,13 +1138,13 @@ void Minecraft::init() // my code - TextureId foliageId = (textures->loadTexture("environment/foliagecolor.png")); // loading the uh png for foliage color - int* foliagePixels = textures->loadTexturePixels(foliageId, "environment/foliagecolor.png"); + TextureId foliageId = (textures->loadTexture("misc/foliagecolor.png")); // loading the uh png for foliage color + int* foliagePixels = textures->loadTexturePixels(foliageId, "misc/foliagecolor.png"); // now i can finally initialize foliage color, probably not the best way to handle this but i cant be arsed rn FoliageColor::init(foliagePixels); - TextureId grassId = (textures->loadTexture("environment/grasscolor.png")); // loading the uh png for foliage color - int* grassPixels = textures->loadTexturePixels(grassId, "environment/grasscolor.png"); + TextureId grassId = (textures->loadTexture("misc/foliagecolor.png")); // loading the uh png for foliage color + int* grassPixels = textures->loadTexturePixels(grassId, "misc/foliagecolor.png"); GrassColor::init(grassPixels); bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color @@ -1401,6 +1401,12 @@ void Minecraft::_levelGenerated() player->resetPos(false); } + if (level && level->dimension) { + // For example, if you want FogType or any other option + level->dimension->FogType = options.getBooleanValue(OPTIONS_FOG_TYPE); + } + + this->cameraTargetPlayer = player; std::string serverName = options.getStringValue(OPTIONS_USERNAME) + " - " + level->getLevelData()->levelName; diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 68d6bae..cf719b0 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -62,6 +62,10 @@ OptionBool serverVisible("servervisible", true); OptionBool foliageTint("foliagetint", false); +OptionInt fogType("fogType", 0, 0, 2); + +OptionBool javaHud("javaHud", false); + OptionInt keyForward("key.forward", Keyboard::KEY_W); OptionInt keyLeft("key.left", Keyboard::KEY_A); OptionInt keyBack("key.back", Keyboard::KEY_S); @@ -166,6 +170,11 @@ void Options::initTable() { m_options[OPTIONS_RPI_CURSOR] = &rpiCursor; m_options[OPTIONS_FOLIAGE_TINT] = &foliageTint; + // more options yay + m_options[OPTIONS_FOG_TYPE] = &fogType; + + m_options[OPTIONS_JAVA_HUD] = &javaHud; + m_options[OPTIONS_AUTOJUMP] = &autoJump; m_options[OPTIONS_LAST_IP] = &lastIp; } diff --git a/src/client/Options.h b/src/client/Options.h index 96d6f3b..9852d48 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -85,6 +85,8 @@ enum OptionId { OPTIONS_RPI_CURSOR, OPTIONS_FOLIAGE_TINT, + OPTIONS_FOG_TYPE, + OPTIONS_JAVA_HUD, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index ccc9c26..8df59f0 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -36,7 +36,7 @@ const float Gui::DropTicks = 40.0f; //#include Gui::Gui(Minecraft* minecraft) -: minecraft(minecraft), + : minecraft(minecraft), tickCount(0), progress(0), overlayMessageTime(0), @@ -77,7 +77,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { Font* font = minecraft->font; const bool isTouchInterface = minecraft->useTouchscreen(); - + const int screenWidth = (int)(minecraft->width * InvGuiScale); const int screenHeight = (int)(minecraft->height * InvGuiScale); blitOffset = -90; @@ -86,9 +86,9 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { glColor4f2(1, 1, 1, 1); // H: 4 - // T: 7 - // L: 6 - // F: 3 + // T: 7 + // L: 6 + // F: 3 int ySlot = screenHeight - 16 - 3; if (!minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { @@ -103,6 +103,12 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { } } + // @todo - Shredder: I added this here but currently viginette is broken so i cant do much about it. + // if (minecraft->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)){ + // this->renderVignette(this->minecraft->player->getBrightness(a), screenWidth, screenHeight); + // } + // shredder end + if(minecraft->player->getSleepTimer() > 0) { glDisable(GL_DEPTH_TEST); glDisable(GL_ALPHA_TEST); @@ -113,38 +119,38 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { glEnable(GL_DEPTH_TEST); } if (!minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { - renderToolBar(a, ySlot, screenWidth); + renderToolBar(a, ySlot, screenWidth); - glEnable(GL_BLEND); - bool isChatting = (minecraft->screen && (dynamic_cast(minecraft->screen) || dynamic_cast(minecraft->screen))); - unsigned int max = 10; - if (isChatting) { - int lineHeight = 9; - max = (screenHeight - 48) / lineHeight; - if (max < 1) max = 1; - int maxScroll = (int)guiMessages.size() - (int)max; - if (maxScroll < 0) maxScroll = 0; - if (chatScrollOffset > maxScroll) chatScrollOffset = maxScroll; - } else { - chatScrollOffset = 0; - } - renderChatMessages(screenHeight, max, isChatting, font); + glEnable(GL_BLEND); + bool isChatting = (minecraft->screen && (dynamic_cast(minecraft->screen) || dynamic_cast(minecraft->screen))); + unsigned int max = 10; + if (isChatting) { + int lineHeight = 9; + max = (screenHeight - 48) / lineHeight; + if (max < 1) max = 1; + int maxScroll = (int)guiMessages.size() - (int)max; + if (maxScroll < 0) maxScroll = 0; + if (chatScrollOffset > maxScroll) chatScrollOffset = maxScroll; + } else { + chatScrollOffset = 0; + } + renderChatMessages(screenHeight, max, isChatting, font); #if !defined(RPI) - renderOnSelectItemNameText(screenWidth, font, ySlot); + renderOnSelectItemNameText(screenWidth, font, ySlot); #endif #if defined(RPI) - renderDebugInfo(); + renderDebugInfo(); #endif - if (Keyboard::isKeyDown(Keyboard::KEY_TAB)) { - renderPlayerList(font, screenWidth, screenHeight); + if (Keyboard::isKeyDown(Keyboard::KEY_TAB)) { + renderPlayerList(font, screenWidth, screenHeight); + } + + if (minecraft->options.getBooleanValue(OPTIONS_RENDER_DEBUG)) + renderDebugInfo(); } - if (minecraft->options.getBooleanValue(OPTIONS_RENDER_DEBUG)) - renderDebugInfo(); - } - - glDisable(GL_BLEND); + glDisable(GL_BLEND); glEnable2(GL_ALPHA_TEST); } @@ -183,7 +189,7 @@ void Gui::getSlotPos(int slot, int& posX, int& posY) { int screenWidth = (int)(minecraft->width * InvGuiScale); int screenHeight = (int)(minecraft->height * InvGuiScale); posX = screenWidth / 2 - getNumSlots() * 10 + slot * 20, - posY = screenHeight - 22; + posY = screenHeight - 22; } RectangleArea Gui::getRectangleArea(int extendSide) { @@ -196,7 +202,7 @@ RectangleArea Gui::getRectangleArea(int extendSide) { return RectangleArea(0, (float)minecraft->height-pHeight, pCenterX+pHalfWidth+2, (float)minecraft->height); if (extendSide > 0) return RectangleArea(pCenterX-pHalfWidth, (float)minecraft->height-pHeight, (float)minecraft->width, (float)minecraft->height); - + return RectangleArea(pCenterX-pHalfWidth, (float)minecraft->height-pHeight, pCenterX+pHalfWidth+2, (float)minecraft->height); } @@ -242,7 +248,7 @@ void Gui::handleKeyPressed(int key) if (key == Keyboard::KEY_F1) { minecraft->options.toggle(OPTIONS_HIDEGUI); } - + if (key == 99) { if (minecraft->player->inventory->selected > 0) @@ -290,11 +296,11 @@ void Gui::tick() { if(itemNameOverlayTime < 2) itemNameOverlayTime += 1.0f / SharedConstants::TicksPerSecond; for (unsigned int i = 0; i < guiMessages.size(); i++) { - guiMessages.at(i).ticks++; + guiMessages.at(i).ticks++; } - if (!minecraft->isCreativeMode()) - tickItemDrop(); + if (!minecraft->isCreativeMode()) + tickItemDrop(); } void Gui::addMessage(const std::string& _string) { @@ -344,6 +350,8 @@ void Gui::displayClientMessage(const std::string& messageId) { addMessage(messageId); } + +// @todo - shredder: Function seems to be completely fine and ported over from java beta, but renders opaque??? need to investigate void Gui::renderVignette(float br, int w, int h) { br = 1 - br; if (br < 0) br = 0; @@ -354,7 +362,10 @@ void Gui::renderVignette(float br, int w, int h) { glDepthMask(false); glBlendFunc2(GL_ZERO, GL_ONE_MINUS_SRC_COLOR); glColor4f2(tbr, tbr, tbr, 1); + minecraft->textures->loadAndBindTexture("misc/vignette.png"); + glTexParameteri2(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri2(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); Tesselator& t = Tesselator::instance; t.begin(); @@ -407,7 +418,7 @@ void Gui::inventoryUpdated() { } void Gui::onGraphicsReset() { - inventoryUpdated(); + inventoryUpdated(); } void Gui::texturesLoaded( Textures* textures ) { @@ -585,12 +596,12 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen bool bowEquipped = currentItem != NULL ? currentItem->getItem() == Item::bow : false; bool itemInUse = currentItem != NULL ? currentItem->getItem() == minecraft->player->getUseItem()->getItem() : false; if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA) - || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { - minecraft->textures->loadAndBindTexture("gui/icons.png"); - glEnable(GL_BLEND); - glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); - blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16); - glDisable(GL_BLEND); + || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { + minecraft->textures->loadAndBindTexture("gui/icons.png"); + glEnable(GL_BLEND); + glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); + blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16); + glDisable(GL_BLEND); } else if(!bowEquipped) { const float tprogress = minecraft->gameMode->destroyProgress; const float alpha = Mth::clamp(minecraft->inputHolder->alpha, 0.0f, 1.0f); @@ -665,10 +676,10 @@ void Gui::renderHearts() { int ip2 = i + i + 1; if (armor > 0) { - int xo = xx + 80 + i * 8 + 4; - if (ip2 < armor) blit(xo, yo, 16 + 2 * 9, 9 * 1, 9, 9); - else if (ip2 == armor) blit(xo, yo, 16 + 4 * 9, 9 * 1, 9, 9); - else if (ip2 > armor) blit(xo, yo, 16 + 0 * 9, 9 * 1, 9, 9); + int xo = xx + 80 + i * 8 + 4; + if (ip2 < armor) blit(xo, yo, 16 + 2 * 9, 9 * 1, 9, 9); + else if (ip2 == armor) blit(xo, yo, 16 + 4 * 9, 9 * 1, 9, 9); + else if (ip2 > armor) blit(xo, yo, 16 + 0 * 9, 9 * 1, 9, 9); } int bg = 0; @@ -691,7 +702,7 @@ void Gui::renderBubbles() { if (minecraft->player->isUnderLiquid(Material::water)) { int screenWidth = (int)(minecraft->width * InvGuiScale); int screenHeight = (int)(minecraft->height * InvGuiScale); - + int xx = (minecraft->options.getBooleanValue(OPTIONS_BAR_ON_TOP)) ? screenWidth / 2 - getNumSlots() * 10 - 1 : 2; int yo = (minecraft->options.getBooleanValue(OPTIONS_BAR_ON_TOP)) ? screenHeight - 42 : 12; int count = (int) std::ceil((minecraft->player->airSupply - 2) * 10.0f / Player::TOTAL_AIR_SUPPLY); @@ -910,64 +921,64 @@ void Gui::renderOnSelectItemNameText( const int screenWidth, Font* font, int ySl // helper structure used by drawColoredString struct ColorSegment { - std::string text; - uint32_t color; + std::string text; + uint32_t color; }; // parse [tag] and [/tag] markers; tags may contain a color name (gold, green, etc.) static void parseColorTags(const std::string& in, std::vector& out) { - uint32_t curColor = 0xffffff; - size_t pos = 0; - while (pos < in.size()) { - size_t open = in.find('[', pos); - if (open == std::string::npos) { - out.push_back({in.substr(pos), curColor}); - break; - } - if (open > pos) { - out.push_back({in.substr(pos, open - pos), curColor}); - } - size_t close = in.find(']', open); - if (close == std::string::npos) { - out.push_back({in.substr(open), curColor}); - break; - } - std::string tag = in.substr(open + 1, close - open - 1); - if (!tag.empty() && tag[0] == '/') { - curColor = 0xffffff; - } else { - std::string lower; - lower.resize(tag.size()); - std::transform(tag.begin(), tag.end(), lower.begin(), ::tolower); - if (lower.find("gold") != std::string::npos) curColor = 0xffd700; - else if (lower.find("green") != std::string::npos) curColor = 0x00ff00; - else if (lower.find("yellow") != std::string::npos) curColor = 0xffff00; - else if (lower.find("red") != std::string::npos) curColor = 0xff0000; - else if (lower.find("blue") != std::string::npos) curColor = 0x0000ff; - } - pos = close + 1; - } + uint32_t curColor = 0xffffff; + size_t pos = 0; + while (pos < in.size()) { + size_t open = in.find('[', pos); + if (open == std::string::npos) { + out.push_back({in.substr(pos), curColor}); + break; + } + if (open > pos) { + out.push_back({in.substr(pos, open - pos), curColor}); + } + size_t close = in.find(']', open); + if (close == std::string::npos) { + out.push_back({in.substr(open), curColor}); + break; + } + std::string tag = in.substr(open + 1, close - open - 1); + if (!tag.empty() && tag[0] == '/') { + curColor = 0xffffff; + } else { + std::string lower; + lower.resize(tag.size()); + std::transform(tag.begin(), tag.end(), lower.begin(), ::tolower); + if (lower.find("gold") != std::string::npos) curColor = 0xffd700; + else if (lower.find("green") != std::string::npos) curColor = 0x00ff00; + else if (lower.find("yellow") != std::string::npos) curColor = 0xffff00; + else if (lower.find("red") != std::string::npos) curColor = 0xff0000; + else if (lower.find("blue") != std::string::npos) curColor = 0x0000ff; + } + pos = close + 1; + } } void Gui::drawColoredString(Font* font, const std::string& text, float x, float y, int alpha) { - std::vector segs; - parseColorTags(text, segs); - float cx = x; - for (auto &s : segs) { - int color = s.color + (alpha << 24); - font->drawShadow(s.text, cx, y, color); - cx += font->width(s.text); - } + std::vector segs; + parseColorTags(text, segs); + float cx = x; + for (auto &s : segs) { + int color = s.color + (alpha << 24); + font->drawShadow(s.text, cx, y, color); + cx += font->width(s.text); + } } float Gui::getColoredWidth(Font* font, const std::string& text) { - std::vector segs; - parseColorTags(text, segs); - float w = 0; - for (auto &s : segs) { - w += font->width(s.text); - } - return w; + std::vector segs; + parseColorTags(text, segs); + float w = 0; + for (auto &s : segs) { + w += font->width(s.text); + } + return w; } void Gui::renderChatMessages( const int screenHeight, unsigned int max, bool isChatting, Font* font ) { @@ -1011,13 +1022,13 @@ void Gui::renderChatMessages( const int screenHeight, unsigned int max, bool isC glEnable(GL_BLEND); // special-case join/leave announcements - int baseColor = 0xffffff; - if (msg.find(" joined the game") != std::string::npos || - msg.find(" left the game") != std::string::npos) { - baseColor = 0xffff00; // yellow - } - // replace previous logic; allow full colour tags now - Gui::drawColoredString(font, msg, x, y, alpha); + int baseColor = 0xffffff; + if (msg.find(" joined the game") != std::string::npos || + msg.find(" left the game") != std::string::npos) { + baseColor = 0xffff00; // yellow + } + // replace previous logic; allow full colour tags now + Gui::drawColoredString(font, msg, x, y, alpha); } } } @@ -1105,22 +1116,41 @@ void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) { // Draw count //Tesselator& t = Tesselator::instance; - glPushMatrix2(); - glScalef2(InvGuiScale + InvGuiScale, InvGuiScale + InvGuiScale, 1); + const float k = 0.5f * GuiScale; - - t.beginOverride(); - if (minecraft->gameMode->isSurvivalType()) { - x = baseItemX; - for (int i = 0; i < slots; i++) { - ItemInstance* item = minecraft->player->inventory->getItem(i); - if (item && item->count >= 0) - renderSlotText(item, k*x, k*ySlot + 1, true, true); - x += 20; + if (minecraft->options.getBooleanValue(OPTIONS_JAVA_HUD)) // if true enables the java beta item count size and color and calls the java items decorations + { + t.beginOverride(); + if (minecraft->gameMode->isSurvivalType()) { + x = baseItemX; + for (int i = 0; i < slots; i++) { + ItemInstance* item = minecraft->player->inventory->getItem(i); + if (item && item->count >= 0) + ItemRenderer::renderGuiItemDecorations(minecraft->font, minecraft->textures, minecraft->player->inventory->getItem(i), x, (float)ySlot); + x += 20; + } } + minecraft->textures->loadAndBindTexture("font/default8.png"); + t.endOverrideAndDraw(); + } + else { // otherwise uses the normal pocket edition one + glPushMatrix2(); + glScalef2(InvGuiScale + InvGuiScale, InvGuiScale + InvGuiScale, 1); + t.beginOverride(); + if (minecraft->gameMode->isSurvivalType()) { + x = baseItemX; + for (int i = 0; i < slots; i++) { + ItemInstance* item = minecraft->player->inventory->getItem(i); + if (item && item->count >= 0) + renderSlotText(item, k*x, k*ySlot, true, true); + x += 20; + } + } + + minecraft->textures->loadAndBindTexture("font/default8.png"); + t.endOverrideAndDraw(); + + glPopMatrix2(); } - minecraft->textures->loadAndBindTexture("font/default8.png"); - t.endOverrideAndDraw(); - glPopMatrix2(); } diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 02a7a62..328a207 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -138,7 +138,7 @@ void OptionsScreen::render(int xm, int ym, float a) { if (currentOptionsGroup != NULL) currentOptionsGroup->render(minecraft, xmm, ymm); - + super::render(xm, ym, a); } @@ -222,11 +222,14 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_ANAGLYPH_3D, minecraft) .addOptionItem(OPTIONS_VIEW_BOBBING, minecraft) .addOptionItem(OPTIONS_AMBIENT_OCCLUSION, minecraft); - + optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft) .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) - .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft); + .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) + .addOptionItem(OPTIONS_JAVA_HUD, minecraft) + .addOptionItem(OPTIONS_FOG_TYPE, minecraft); + } void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { @@ -248,7 +251,7 @@ void OptionsScreen::keyPressed(int eventKey) { currentOptionsGroup->keyPressed(minecraft, eventKey); if (eventKey == Keyboard::KEY_ESCAPE) minecraft->options.save(); - + super::keyPressed(eventKey); } diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 73670cd..439a443 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -34,7 +34,7 @@ #endif LevelRenderer::LevelRenderer( Minecraft* mc) -: mc(mc), + : mc(mc), textures(mc->textures), level(NULL), cullStep(0), @@ -49,6 +49,7 @@ LevelRenderer::LevelRenderer( Minecraft* mc) xMaxChunk(0), yMaxChunk(0), zMaxChunk(0), lastViewDistance(-1), + lastFogType(-1), noEntityRenderFrames(2), totalEntities(0), @@ -145,10 +146,10 @@ void LevelRenderer::setLevel( Level* level ) level->addListener(this); allChanged(); } - if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { - mc->useAmbientOcclusion = !mc->useAmbientOcclusion; - allChanged(); - } + if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { + mc->useAmbientOcclusion = !mc->useAmbientOcclusion; + allChanged(); + } } void LevelRenderer::allChanged() @@ -161,6 +162,8 @@ void LevelRenderer::allChanged() Tile::leaves_carried->setFancy(fancy); lastViewDistance = mc->options.getIntValue(OPTIONS_VIEW_DISTANCE); + lastFogType = mc->options.getIntValue(OPTIONS_FOG_TYPE); + bool tint = mc->options.getBooleanValue(OPTIONS_FOLIAGE_TINT); FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); @@ -171,9 +174,9 @@ void LevelRenderer::allChanged() dist = (int)((float)dist * 0.8f); LOGI("last: %d, power: %d\n", lastViewDistance, mc->isPowerVR()); - #if defined(RPI) - dist *= 0.6f; - #endif +#if defined(RPI) + dist *= 0.6f; +#endif if (dist > 400) dist = 400; /* @@ -238,17 +241,17 @@ void LevelRenderer::allChanged() void LevelRenderer::deleteChunks() { for (int z = 0; z < zChunks; ++z) - for (int y = 0; y < yChunks; ++y) - for (int x = 0; x < xChunks; ++x) { - int c = getLinearCoord(x, y, z); - delete chunks[c]; - } + for (int y = 0; y < yChunks; ++y) + for (int x = 0; x < xChunks; ++x) { + int c = getLinearCoord(x, y, z); + delete chunks[c]; + } - delete[] chunks; - chunks = NULL; + delete[] chunks; + chunks = NULL; - delete[] sortedChunks; - sortedChunks = NULL; + delete[] sortedChunks; + sortedChunks = NULL; } void LevelRenderer::resortChunks( int xc, int yc, int zc ) @@ -312,6 +315,17 @@ int LevelRenderer::render( Mob* player, int layer, float alpha ) allChanged(); } + int currentFogType = mc->options.getIntValue(OPTIONS_FOG_TYPE); + if (currentFogType != lastFogType) { + lastFogType = currentFogType; + + if (level && level->dimension) { + level->dimension->FogType = currentFogType; // use new fog stuff + } + + allChanged(); + } + TIMER_PUSH("sortchunks"); for (int i = 0; i < 10; i++) { chunkFixOffs = (chunkFixOffs + 1) % chunksLength; @@ -580,11 +594,11 @@ int LevelRenderer::renderChunks( int from, int to, int layer, float alpha ) for (unsigned int i = 0; i < _renderChunks.size(); ++i) { Chunk* chunk = _renderChunks[i]; - #ifdef USE_VBO - renderList.addR(chunk->getRenderChunk(layer)); - #else - renderList.add(chunk->getList(layer)); - #endif +#ifdef USE_VBO + renderList.addR(chunk->getRenderChunk(layer)); +#else + renderList.add(chunk->getList(layer)); +#endif renderList.next(); } @@ -735,20 +749,20 @@ bool LevelRenderer::updateDirtyChunks( Mob* player, bool force ) Chunk* chunk = dirtyChunks[cursor]; if (chunk != NULL) { bool remove = false; - for (int i = 0; i < count && !remove; i++) - if (chunk == toAdd[i]) { - remove = true; - } - - if (!remove) { - //if (chunk == toAdd[0] || chunk == toAdd[1] || chunk == toAdd[2]) { - // ; // this chunk was rendered and should be removed - //} else { - if (target != cursor) { - dirtyChunks[target] = chunk; + for (int i = 0; i < count && !remove; i++) + if (chunk == toAdd[i]) { + remove = true; + } + + if (!remove) { + //if (chunk == toAdd[0] || chunk == toAdd[1] || chunk == toAdd[2]) { + // ; // this chunk was rendered and should be removed + //} else { + if (target != cursor) { + dirtyChunks[target] = chunk; + } + target++; } - target++; - } } cursor++; } @@ -922,23 +936,23 @@ bool entityRenderPredicate(const Entity* a, const Entity* b) { } void LevelRenderer::renderEntities(Vec3 cam, Culler* culler, float a) { - if (noEntityRenderFrames > 0) { - noEntityRenderFrames--; - return; - } + if (noEntityRenderFrames > 0) { + noEntityRenderFrames--; + return; + } TIMER_PUSH("prepare"); - TileEntityRenderDispatcher::getInstance()->prepare(level, textures, mc->font, mc->cameraTargetPlayer, a); - EntityRenderDispatcher::getInstance()->prepare(level, mc->font, mc->cameraTargetPlayer, &mc->options, a); + TileEntityRenderDispatcher::getInstance()->prepare(level, textures, mc->font, mc->cameraTargetPlayer, a); + EntityRenderDispatcher::getInstance()->prepare(level, mc->font, mc->cameraTargetPlayer, &mc->options, a); - totalEntities = 0; - renderedEntities = 0; - culledEntities = 0; + totalEntities = 0; + renderedEntities = 0; + culledEntities = 0; Entity* player = mc->cameraTargetPlayer; - EntityRenderDispatcher::xOff = TileEntityRenderDispatcher::xOff = (player->xOld + (player->x - player->xOld) * a); - EntityRenderDispatcher::yOff = TileEntityRenderDispatcher::yOff = (player->yOld + (player->y - player->yOld) * a); - EntityRenderDispatcher::zOff = TileEntityRenderDispatcher::zOff = (player->zOld + (player->z - player->zOld) * a); + EntityRenderDispatcher::xOff = TileEntityRenderDispatcher::xOff = (player->xOld + (player->x - player->xOld) * a); + EntityRenderDispatcher::yOff = TileEntityRenderDispatcher::yOff = (player->yOld + (player->y - player->yOld) * a); + EntityRenderDispatcher::zOff = TileEntityRenderDispatcher::zOff = (player->zOld + (player->z - player->zOld) * a); glEnableClientState2(GL_VERTEX_ARRAY); glEnableClientState2(GL_TEXTURE_COORD_ARRAY); @@ -977,10 +991,10 @@ void LevelRenderer::renderEntities(Vec3 cam, Culler* culler, float a) { delete[] toRender; } - TIMER_POP_PUSH("tileentities"); - for (unsigned int i = 0; i < level->tileEntities.size(); i++) { - TileEntityRenderDispatcher::getInstance()->render(level->tileEntities[i], a); - } + TIMER_POP_PUSH("tileentities"); + for (unsigned int i = 0; i < level->tileEntities.size(); i++) { + TileEntityRenderDispatcher::getInstance()->render(level->tileEntities[i], a); + } glDisableClientState2(GL_VERTEX_ARRAY); glDisableClientState2(GL_TEXTURE_COORD_ARRAY); @@ -991,7 +1005,7 @@ void LevelRenderer::renderEntities(Vec3 cam, Culler* culler, float a) { std::string LevelRenderer::gatherStats1() { std::stringstream ss; ss << "C: " << renderedChunks << "/" << totalChunks << ". F: " << offscreenChunks << ", O: " << occludedChunks << ", E: " << emptyChunks << "\n"; - return ss.str(); + return ss.str(); } // @@ -1003,34 +1017,34 @@ std::string LevelRenderer::gatherStats1() { // IntBuffer resultBuffer = MemoryTracker.createIntBuffer(64); void LevelRenderer::renderSky(float alpha) { - if (mc->level->dimension->foggy) return; + if (mc->level->dimension->foggy) return; - glDisable2(GL_TEXTURE_2D); - Vec3 sc = level->getSkyColor(mc->cameraTargetPlayer, alpha); - float sr = (float) sc.x; - float sg = (float) sc.y; - float sb = (float) sc.z;// + 0.5f; + glDisable2(GL_TEXTURE_2D); + Vec3 sc = level->getSkyColor(mc->cameraTargetPlayer, alpha); + float sr = (float) sc.x; + float sg = (float) sc.y; + float sb = (float) sc.z;// + 0.5f; - if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { - float srr = (sr * 30.0f + sg * 59.0f + sb * 11.0f) / 100.0f; - float sgg = (sr * 30.0f + sg * 70.0f) / (100.0f); - float sbb = (sr * 30.0f + sb * 70.0f) / (100.0f); + if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { + float srr = (sr * 30.0f + sg * 59.0f + sb * 11.0f) / 100.0f; + float sgg = (sr * 30.0f + sg * 70.0f) / (100.0f); + float sbb = (sr * 30.0f + sb * 70.0f) / (100.0f); - sr = srr; - sg = sgg; - sb = sbb; - } - glColor4f2(sr, sg, Mth::Min(1.0f, sb), 1); + sr = srr; + sg = sgg; + sb = sbb; + } + glColor4f2(sr, sg, Mth::Min(1.0f, sb), 1); - //Tesselator& t = Tesselator::instance; + //Tesselator& t = Tesselator::instance; - glEnable2(GL_FOG); - glColor4f2(sr, sg, sb, 1.0f); + glEnable2(GL_FOG); + glColor4f2(sr, sg, sb, 1.0f); #ifdef OPENGL_ES drawArrayVT(skyBuffer, skyVertexCount); #endif - glEnable2(GL_TEXTURE_2D); + glEnable2(GL_TEXTURE_2D); } void LevelRenderer::renderClouds( float alpha ) { @@ -1044,7 +1058,7 @@ void LevelRenderer::renderClouds( float alpha ) { //glBindTexture(GL_TEXTURE_2D, texturesloadTexture("/environment/clouds.png")); textures->loadAndBindTexture("environment/clouds.png"); - + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1087,17 +1101,17 @@ void LevelRenderer::playSound(const std::string& name, float x, float y, float z // @todo: deny sounds here if sound is off (rather than waiting 'til SoundEngine) float dd = 16; - if (volume > 1) dd *= volume; - if (mc->cameraTargetPlayer->distanceToSqr(x, y, z) < dd * dd) { - mc->soundEngine->play(name, x, y, z, volume, pitch); - } + if (volume > 1) dd *= volume; + if (mc->cameraTargetPlayer->distanceToSqr(x, y, z) < dd * dd) { + mc->soundEngine->play(name, x, y, z, volume, pitch); + } } void LevelRenderer::addParticle(const std::string& name, float x, float y, float z, float xa, float ya, float za, int data) { float xd = mc->cameraTargetPlayer->x - x; - float yd = mc->cameraTargetPlayer->y - y; - float zd = mc->cameraTargetPlayer->z - z; + float yd = mc->cameraTargetPlayer->y - y; + float zd = mc->cameraTargetPlayer->z - z; float distanceSquared = xd * xd + yd * yd + zd * zd; //Particle* p = NULL; @@ -1111,27 +1125,27 @@ void LevelRenderer::addParticle(const std::string& name, float x, float y, float // return; //} - const float particleDistance = 16; - if (distanceSquared > particleDistance * particleDistance) return; + const float particleDistance = 16; + if (distanceSquared > particleDistance * particleDistance) return; //static Stopwatch sw; //sw.start(); - if (name == "bubble") mc->particleEngine->add(new BubbleParticle(level, x, y, z, xa, ya, za)); + if (name == "bubble") mc->particleEngine->add(new BubbleParticle(level, x, y, z, xa, ya, za)); else if (name == "crit") mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za)); else if (name == "smoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za)); - //else if (name == "note") mc->particleEngine->add(new NoteParticle(level, x, y, z, xa, ya, za)); - else if (name == "explode") mc->particleEngine->add(new ExplodeParticle(level, x, y, z, xa, ya, za)); - else if (name == "flame") mc->particleEngine->add(new FlameParticle(level, x, y, z, xa, ya, za)); - else if (name == "lava") mc->particleEngine->add(new LavaParticle(level, x, y, z)); - //else if (name == "splash") mc->particleEngine->add(new SplashParticle(level, x, y, z, xa, ya, za)); + //else if (name == "note") mc->particleEngine->add(new NoteParticle(level, x, y, z, xa, ya, za)); + else if (name == "explode") mc->particleEngine->add(new ExplodeParticle(level, x, y, z, xa, ya, za)); + else if (name == "flame") mc->particleEngine->add(new FlameParticle(level, x, y, z, xa, ya, za)); + else if (name == "lava") mc->particleEngine->add(new LavaParticle(level, x, y, z)); + //else if (name == "splash") mc->particleEngine->add(new SplashParticle(level, x, y, z, xa, ya, za)); else if (name == "largesmoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f)); - else if (name == "reddust") mc->particleEngine->add(new RedDustParticle(level, x, y, z, xa, ya, za)); + else if (name == "reddust") mc->particleEngine->add(new RedDustParticle(level, x, y, z, xa, ya, za)); else if (name == "iconcrack") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data])); else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); - //else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); - //else if (name == "slime") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::slimeBall)); - //else if (name == "heart") mc->particleEngine->add(new HeartParticle(level, x, y, z, xa, ya, za)); + //else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); + //else if (name == "slime") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::slimeBall)); + //else if (name == "heart") mc->particleEngine->add(new HeartParticle(level, x, y, z, xa, ya, za)); //sw.stop(); //sw.printEvery(50, "add-particle-string"); @@ -1139,53 +1153,53 @@ void LevelRenderer::addParticle(const std::string& name, float x, float y, float /* void LevelRenderer::addParticle(ParticleType::Id name, float x, float y, float z, float xa, float ya, float za, int data) { - float xd = mc->cameraTargetPlayer->x - x; - float yd = mc->cameraTargetPlayer->y - y; - float zd = mc->cameraTargetPlayer->z - z; +float xd = mc->cameraTargetPlayer->x - x; +float yd = mc->cameraTargetPlayer->y - y; +float zd = mc->cameraTargetPlayer->z - z; - const float particleDistance = 16; - if (xd * xd + yd * yd + zd * zd > particleDistance * particleDistance) return; +const float particleDistance = 16; +if (xd * xd + yd * yd + zd * zd > particleDistance * particleDistance) return; - //static Stopwatch sw; - //sw.start(); +//static Stopwatch sw; +//sw.start(); - //Particle* p = NULL; +//Particle* p = NULL; - if (name == ParticleType::bubble) mc->particleEngine->add( new BubbleParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::crit) mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::smoke) mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::explode) mc->particleEngine->add( new ExplodeParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::flame) mc->particleEngine->add( new FlameParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::lava) mc->particleEngine->add( new LavaParticle(level, x, y, z) ); - else if (name == ParticleType::largesmoke) mc->particleEngine->add( new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f) ); - else if (name == ParticleType::reddust) mc->particleEngine->add( new RedDustParticle(level, x, y, z, xa, ya, za) ); - else if (name == ParticleType::iconcrack) mc->particleEngine->add( new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]) ); +if (name == ParticleType::bubble) mc->particleEngine->add( new BubbleParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::crit) mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::smoke) mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::explode) mc->particleEngine->add( new ExplodeParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::flame) mc->particleEngine->add( new FlameParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::lava) mc->particleEngine->add( new LavaParticle(level, x, y, z) ); +else if (name == ParticleType::largesmoke) mc->particleEngine->add( new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f) ); +else if (name == ParticleType::reddust) mc->particleEngine->add( new RedDustParticle(level, x, y, z, xa, ya, za) ); +else if (name == ParticleType::iconcrack) mc->particleEngine->add( new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]) ); - //switch (name) { - // case ParticleType::bubble: p = new BubbleParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::crit: p = new CritParticle2(level, x, y, z, xa, ya, za); break; - // case ParticleType::smoke: p = new SmokeParticle(level, x, y, z, xa, ya, za); break; - // //case ParticleType::note: p = new NoteParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::explode: p = new ExplodeParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::flame: p = new FlameParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::lava: p = new LavaParticle(level, x, y, z); break; - // //case ParticleType::splash: p = new SplashParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::largesmoke: p = new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f); break; - // case ParticleType::reddust: p = new RedDustParticle(level, x, y, z, xa, ya, za); break; - // case ParticleType::iconcrack: p = new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]); break; - // //case ParticleType::snowballpoof: p = new BreakingItemParticle(level, x, y, z, Item::snowBall); break; - // //case ParticleType::slime: p = new BreakingItemParticle(level, x, y, z, Item::slimeBall); break; - // //case ParticleType::heart: p = new HeartParticle(level, x, y, z, xa, ya, za); break; - // default: - // LOGW("Couldn't find particle of type: %d\n", name); - // break; - //} - //if (p) { - // mc->particleEngine->add(p); - //} +//switch (name) { +// case ParticleType::bubble: p = new BubbleParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::crit: p = new CritParticle2(level, x, y, z, xa, ya, za); break; +// case ParticleType::smoke: p = new SmokeParticle(level, x, y, z, xa, ya, za); break; +// //case ParticleType::note: p = new NoteParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::explode: p = new ExplodeParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::flame: p = new FlameParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::lava: p = new LavaParticle(level, x, y, z); break; +// //case ParticleType::splash: p = new SplashParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::largesmoke: p = new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f); break; +// case ParticleType::reddust: p = new RedDustParticle(level, x, y, z, xa, ya, za); break; +// case ParticleType::iconcrack: p = new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data]); break; +// //case ParticleType::snowballpoof: p = new BreakingItemParticle(level, x, y, z, Item::snowBall); break; +// //case ParticleType::slime: p = new BreakingItemParticle(level, x, y, z, Item::slimeBall); break; +// //case ParticleType::heart: p = new HeartParticle(level, x, y, z, xa, ya, za); break; +// default: +// LOGW("Couldn't find particle of type: %d\n", name); +// break; +//} +//if (p) { +// mc->particleEngine->add(p); +//} - //sw.stop(); - //sw.printEvery(50, "add-particle-enum"); +//sw.stop(); +//sw.printEvery(50, "add-particle-enum"); } */ @@ -1203,7 +1217,7 @@ void LevelRenderer::renderHitSelect( Player* player, const HitResult& h, int mod glEnable2(GL_DEPTH_TEST); textures->loadAndBindTexture("terrain.png"); - + int tileId = level->getTile(h.x, h.y, h.z); Tile* tile = tileId > 0 ? Tile::tiles[tileId] : NULL; glDisable2(GL_ALPHA_TEST); @@ -1300,11 +1314,11 @@ void LevelRenderer::takePicture( TripodCamera* cam, Entity* entity ) void LevelRenderer::levelEvent(Player* player, int type, int x, int y, int z, int data) { switch (type) { case LevelEvent::SOUND_OPEN_DOOR: - if (Mth::random() < 0.5f) { - level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_open", 1, level->random.nextFloat() * 0.1f + 0.9f); - } else { - level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_close", 1, level->random.nextFloat() * 0.1f + 0.9f); - } - break; + if (Mth::random() < 0.5f) { + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_open", 1, level->random.nextFloat() * 0.1f + 0.9f); + } else { + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.door_close", 1, level->random.nextFloat() * 0.1f + 0.9f); + } + break; } } diff --git a/src/client/renderer/LevelRenderer.h b/src/client/renderer/LevelRenderer.h index df43de1..2a9c7e2 100755 --- a/src/client/renderer/LevelRenderer.h +++ b/src/client/renderer/LevelRenderer.h @@ -113,6 +113,9 @@ private: bool occlusionCheck; int lastViewDistance; + // shredder added again... + int lastFogType; + int ticks; int starList, skyList, darkList; diff --git a/src/client/renderer/entity/EntityRenderDispatcher.cpp b/src/client/renderer/entity/EntityRenderDispatcher.cpp index a3148fc..b0edea7 100755 --- a/src/client/renderer/entity/EntityRenderDispatcher.cpp +++ b/src/client/renderer/entity/EntityRenderDispatcher.cpp @@ -40,18 +40,18 @@ EntityRenderDispatcher::EntityRenderDispatcher() { //@note: The Models (model/armor) will be deleted by resp. MobRenderer assign( ER_ITEM_RENDERER, new ItemRenderer()); - assign( ER_HUMANOID_RENDERER, new HumanoidMobRenderer(new HumanoidModel(), 0)); - assign( ER_PIG_RENDERER, new PigRenderer(new PigModel(), NULL/*new PigModel(0.5f)*/, 0)); - assign( ER_COW_RENDERER, new MobRenderer(new CowModel(), 0)); - assign( ER_CHICKEN_RENDERER, new ChickenRenderer( new ChickenModel(), 0)); - assign( ER_SHEEP_RENDERER, new SheepRenderer(new SheepModel(), new SheepFurModel(), 0)); + assign( ER_HUMANOID_RENDERER, new HumanoidMobRenderer(new HumanoidModel(), 0.5)); + assign( ER_PIG_RENDERER, new PigRenderer(new PigModel(0.5), NULL/*new PigModel(0.5f)*/, 0.7)); + assign( ER_COW_RENDERER, new MobRenderer(new CowModel(), 0.7)); + assign( ER_CHICKEN_RENDERER, new ChickenRenderer( new ChickenModel(), 0.3)); + assign( ER_SHEEP_RENDERER, new SheepRenderer(new SheepModel(), new SheepFurModel(), 0.7)); assign( ER_SKELETON_RENDERER, new HumanoidMobRenderer(new SkeletonModel(), 0.5f)); assign( ER_ZOMBIE_RENDERER, new HumanoidMobRenderer(new ZombieModel(), 0.5f)); assign( ER_CREEPER_RENDERER, new CreeperRenderer()); assign( ER_SPIDER_RENDERER, new SpiderRenderer()); assign( ER_TNT_RENDERER, new TntRenderer()); assign( ER_ARROW_RENDERER, new ArrowRenderer()); - assign( ER_PLAYER_RENDERER, new PlayerRenderer(new HumanoidModel(0, 0, 64, 64), 0)); + assign( ER_PLAYER_RENDERER, new PlayerRenderer(new HumanoidModel(0, 0, 64, 64), 0.5)); assign( ER_THROWNEGG_RENDERER, new ItemSpriteRenderer(Item::egg->getIcon(0))); assign( ER_SNOWBALL_RENDERER, new ItemSpriteRenderer(Item::snowBall->getIcon(0))); assign( ER_PAINTING_RENDERER, new PaintingRenderer()); @@ -133,7 +133,7 @@ void EntityRenderDispatcher::render( Entity* entity, float x, float y, float z, EntityRenderer* renderer = getRenderer(entity); if (renderer != NULL) { renderer->render(entity, x, y, z, rot, a); - //renderer->postRender(entity, x, y, z, rot, a); + renderer->postRender(entity, x, y, z, rot, a); } } diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index 641581b..ad500b2 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -5,11 +5,17 @@ #include "../gles.h" #include "../../../world/phys/AABB.h" #include "EntityRenderDispatcher.h" +#include "../../../util/Mth.h" +#include "../../../world/level/Level.h" +#include "../../../world/level/tile/Tile.h" + +#include "../../Minecraft.h" +#include "../../Option.h" EntityRenderDispatcher* EntityRenderer::entityRenderDispatcher = NULL; EntityRenderer::EntityRenderer() -: shadowRadius(0), + : shadowRadius(0), shadowStrength(1.0f) {} @@ -36,37 +42,37 @@ void EntityRenderer::render(const AABB& bb, float xo, float yo, float zo) { glColor4f2(1, 1, 1, 1); t.begin(); t.offset(xo, yo, zo); - //t.normal(0, 0, -1); + t.normal(0, 0, -1); t.vertex(bb.x0, bb.y1, bb.z0); t.vertex(bb.x1, bb.y1, bb.z0); t.vertex(bb.x1, bb.y0, bb.z0); t.vertex(bb.x0, bb.y0, bb.z0); - //t.normal(0, 0, 1); + t.normal(0, 0, 1); t.vertex(bb.x0, bb.y0, bb.z1); t.vertex(bb.x1, bb.y0, bb.z1); t.vertex(bb.x1, bb.y1, bb.z1); t.vertex(bb.x0, bb.y1, bb.z1); - //t.normal(0, -1, 0); + t.normal(0, -1, 0); t.vertex(bb.x0, bb.y0, bb.z0); t.vertex(bb.x1, bb.y0, bb.z0); t.vertex(bb.x1, bb.y0, bb.z1); t.vertex(bb.x0, bb.y0, bb.z1); - //t.normal(0, 1, 0); + t.normal(0, 1, 0); t.vertex(bb.x0, bb.y1, bb.z1); t.vertex(bb.x1, bb.y1, bb.z1); t.vertex(bb.x1, bb.y1, bb.z0); t.vertex(bb.x0, bb.y1, bb.z0); - //t.normal(-1, 0, 0); + t.normal(-1, 0, 0); t.vertex(bb.x0, bb.y0, bb.z1); t.vertex(bb.x0, bb.y1, bb.z1); t.vertex(bb.x0, bb.y1, bb.z0); t.vertex(bb.x0, bb.y0, bb.z0); - //t.normal(1, 0, 0); + t.normal(1, 0, 0); t.vertex(bb.x1, bb.y0, bb.z0); t.vertex(bb.x1, bb.y1, bb.z0); t.vertex(bb.x1, bb.y1, bb.z1); @@ -116,134 +122,139 @@ Font* EntityRenderer::getFont() { return entityRenderDispatcher->getFont(); } -//void postRender(Entity entity, float x, float y, float z, float rot, float a) { -// if (entityRenderDispatcher.options.fancyGraphics && shadowRadius > 0) { -// float dist = entityRenderDispatcher.distanceToSqr(entity.x, entity.y, entity.z); -// float pow = (float) ((1 - dist / (16.0f * 16.0f)) * shadowStrength); -// if (pow > 0) { -// renderShadow(entity, x, y, z, pow, a); -// } -// } -// if (entity.isOnFire()) renderFlame(entity, x, y, z, a); -//} +void EntityRenderer::postRender(Entity* entity, float x, float y, float z, float rot, float a) { + if (/*entityRenderDispatcher.options.fancyGraphics &&*/entityRenderDispatcher->minecraft->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS) && shadowRadius > 0) { + float dist = entityRenderDispatcher->distanceToSqr(entity->x, entity->y, entity->z); + float pow = (float) ((1 - dist / (16.0f * 16.0f)) * shadowStrength); + if (pow > 0) { + renderShadow(entity, x, y, z, pow, a); + } + //} + if (entity->isOnFire()) renderFlame(entity, x, y, z, a); + } +} +void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) { -//void renderFlame(Entity e, float x, float y, float z, float a) { -// glDisable2(GL_LIGHTING); -// int tex = Tile.fire.tex; + int tex = ((Tile*)Tile::fire)->tex; -// int xt = (tex & 0xf) << 4; -// int yt = tex & 0xf0; + int xt = (tex & 0xf) << 4; + int yt = tex & 0xf0; -// float u0 = (xt) / 256.0f; -// float u1 = (xt + 15.99f) / 256.0f; -// float v0 = (yt) / 256.0f; -// float v1 = (yt + 15.99f) / 256.0f; + float u0 = (xt) / 256.0f; + float u1 = (xt + 15.99f) / 256.0f; + float v0 = (yt) / 256.0f; + float v1 = (yt + 15.99f) / 256.0f; -// glPushMatrix2(); -// glTranslatef2((float) x, (float) y, (float) z); + glPushMatrix2(); + glTranslatef2((float) x, (float) y, (float) z); -// float s = e.bbWidth * 1.4f; -// glScalef2(s, s, s); -// bindTexture("terrain.png"); -// Tesselator t = Tesselator.instance; + float s = e->bbWidth * 1.4f; + glScalef2(s, s, s); + bindTexture("terrain.png"); + Tesselator& t = Tesselator::instance; -// float r = 1.0f; -// float xo = 0.5f; -// float yo = 0.0f; + float r = 1.0f; + float xo = 0.5f; + float yo = 0.0f; -// float h = e.bbHeight / e.bbWidth; + float h = e->bbHeight / e->bbWidth; -// glRotatef2(-entityRenderDispatcher.playerRotY, 0, 1, 0); -// glTranslatef2(0, 0, -0.4f + ((int) h) * 0.02f); -// glColor4f2(1, 1, 1, 1); -// // glRotatef2(-playerRotX, 1, 0, 0); -// t.begin(); -// while (h > 0) { -// t.vertexUV(r - xo, 0 - yo, 0, u1, v1); -// t.vertexUV(0 - xo, 0 - yo, 0, u0, v1); -// t.vertexUV(0 - xo, 1.4f - yo, 0, u0, v0); -// t.vertexUV(r - xo, 1.4f - yo, 0, u1, v0); -// h -= 1; -// yo -= 1; -// r *= 0.9f; -// glTranslatef2(0, 0, -0.04f); -// } -// t.end(); -// glPopMatrix2(); -// glEnable2(GL_LIGHTING); -//} + glRotatef2(-entityRenderDispatcher->playerRotY, 0, 1, 0); + glTranslatef2(0, 0, -0.4f + ((int) h) * 0.02f); + glColor4f2(1, 1, 1, 1); + // glRotatef2(-playerRotX, 1, 0, 0); + t.begin(); + while (h > 0) { + t.vertexUV(r - xo, 0 - yo, 0, u1, v1); + t.vertexUV(0 - xo, 0 - yo, 0, u0, v1); + t.vertexUV(0 - xo, 1.4f - yo, 0, u0, v0); + t.vertexUV(r - xo, 1.4f - yo, 0, u1, v0); + h -= 1; + yo -= 1; + r *= 0.9f; + glTranslatef2(0, 0, -0.04f); + } + t.draw(); + glPopMatrix2(); + // glEnable2(GL_LIGHTING); +} -//void renderShadow(Entity e, float x, float y, float z, float pow, float a) { -// glEnable2(GL_BLEND); -// glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float pow, float a) { // + glEnable2(GL_BLEND); + glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -// Textures textures = entityRenderDispatcher.textures; -// textures.bind(textures.loadTexture("%clamp%/misc/shadow.png")); + //Textures* textures = entityRenderDispatcher->textures; + //textures->bind(textures->loadTexture("%clamp%/environment/shadow.png")); + Textures* textures = entityRenderDispatcher->textures; + textures->bind(textures->loadTexture("/misc/shadow.png")); -// Level level = getLevel(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -// glDepthMask(false); -// float r = shadowRadius; + Level* level = getLevel(); -// float ex = e.xOld + (e.x - e.xOld) * a; -// float ey = e.yOld + (e.y - e.yOld) * a + e.getShadowHeightOffs(); -// float ez = e.zOld + (e.z - e.zOld) * a; + glDepthMask(false); + float r = shadowRadius; -// int x0 = Mth.floor(ex - r); -// int x1 = Mth.floor(ex + r); -// int y0 = Mth.floor(ey - r); -// int y1 = Mth.floor(ey); -// int z0 = Mth.floor(ez - r); -// int z1 = Mth.floor(ez + r); + float ex = e->xOld + (e->x - e->xOld) * a; + float ey = e->yOld + (e->y - e->yOld) * a + e->getShadowHeightOffs(); + float ez = e->zOld + (e->z - e->zOld) * a; -// float xo = x - ex; -// float yo = y - ey; -// float zo = z - ez; + int x0 = Mth::floor(ex - r); + int x1 = Mth::floor(ex + r); + int y0 = Mth::floor(ey - r); + int y1 = Mth::floor(ey); + int z0 = Mth::floor(ez - r); + int z1 = Mth::floor(ez + r); -// Tesselator tt = Tesselator.instance; -// tt.begin(); -// for (int xt = x0; xt <= x1; xt++) -// for (int yt = y0; yt <= y1; yt++) -// for (int zt = z0; zt <= z1; zt++) { -// int t = level.getTile(xt, yt - 1, zt); -// if (t > 0 && level.getRawBrightness(xt, yt, zt) > 3) { -// renderTileShadow(Tile.tiles[t], x, y + e.getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e.getShadowHeightOffs(), zo); -// } -// } -// tt.end(); + float xo = x - ex; + float yo = y - ey; + float zo = z - ez; -// glColor4f2(1, 1, 1, 1); -// glDisable2(GL_BLEND); -// glDepthMask(true); -//} + Tesselator& tt = Tesselator::instance; + tt.begin(); + for (int xt = x0; xt <= x1; xt++) + for (int yt = y0; yt <= y1; yt++) + for (int zt = z0; zt <= z1; zt++) { + int t = level->getTile(xt, yt - 1, zt); + if (t > 0 && level->getRawBrightness(xt, yt, zt) > 3) { + renderTileShadow(Tile::tiles[t], x, y + e->getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e->getShadowHeightOffs(), zo); + } + } + tt.draw(); -//Level* getLevel() { -// return entityRenderDispatcher.level; -//} + glColor4f2(1, 1, 1, 1); + glDisable2(GL_BLEND); + glDepthMask(true); +} -//void renderTileShadow(Tile tt, float x, float y, float z, int xt, int yt, int zt, float pow, float r, float xo, float yo, float zo) { -// Tesselator t = Tesselator.instance; -// if (!tt.isCubeShaped()) return; +Level* EntityRenderer::getLevel() { + return entityRenderDispatcher->level; +} -// float a = ((pow - (y - (yt + yo)) / 2) * 0.5f) * getLevel().getBrightness(xt, yt, zt); -// if (a < 0) return; -// if (a > 1) a = 1; -// t.color(1, 1, 1, (float) a); -// // glColor4f2(1, 1, 1, (float) a); +void EntityRenderer::renderTileShadow(Tile* tt, float x, float y, float z, int xt, int yt, int zt, float pow, float r, float xo, float yo, float zo) { + Tesselator& t = Tesselator::instance; + if (!tt->isCubeShaped()) return; -// float x0 = xt + tt.xx0 + xo; -// float x1 = xt + tt.xx1 + xo; -// float y0 = yt + tt.yy0 + yo + 1.0 / 64.0f; -// float z0 = zt + tt.zz0 + zo; -// float z1 = zt + tt.zz1 + zo; + float a = ((pow - (y - (yt + yo)) / 2) * 0.5f) * getLevel()->getBrightness(xt, yt, zt); + if (a < 0) return; + if (a > 1) a = 1; + // t.color(1, 1, 1, (float) a); + glColor4f2(1, 1, 1, (float) a); -// float u0 = (float) ((x - (x0)) / 2 / r + 0.5f); -// float u1 = (float) ((x - (x1)) / 2 / r + 0.5f); -// float v0 = (float) ((z - (z0)) / 2 / r + 0.5f); -// float v1 = (float) ((z - (z1)) / 2 / r + 0.5f); + float x0 = xt + tt->xx0 + xo; + float x1 = xt + tt->xx1 + xo; + float y0 = yt + tt->yy0 + yo + 1.0 / 64.0f; + float z0 = zt + tt->zz0 + zo; + float z1 = zt + tt->zz1 + zo; -// t.vertexUV(x0, y0, z0, u0, v0); -// t.vertexUV(x0, y0, z1, u0, v1); -// t.vertexUV(x1, y0, z1, u1, v1); -// t.vertexUV(x1, y0, z0, u1, v0); -//} + float u0 = (float) ((x - (x0)) / 2 / r + 0.5f); + float u1 = (float) ((x - (x1)) / 2 / r + 0.5f); + float v0 = (float) ((z - (z0)) / 2 / r + 0.5f); + float v1 = (float) ((z - (z1)) / 2 / r + 0.5f); + + t.vertexUV(x0, y0, z0, u0, v0); + t.vertexUV(x0, y0, z1, u0, v1); + t.vertexUV(x1, y0, z1, u1, v1); + t.vertexUV(x1, y0, z0, u1, v0); +} diff --git a/src/client/renderer/entity/EntityRenderer.h b/src/client/renderer/entity/EntityRenderer.h index 318f7f2..699c82d 100755 --- a/src/client/renderer/entity/EntityRenderer.h +++ b/src/client/renderer/entity/EntityRenderer.h @@ -12,6 +12,8 @@ class EntityRenderDispatcher; class Entity; class AABB; class Font; +class Tile; +class Level; class EntityRenderer { @@ -24,6 +26,11 @@ public: virtual void render(Entity* entity, float x, float y, float z, float rot, float a) = 0; static void render(const AABB& bb, float xo, float yo, float zo); static void renderFlat(const AABB& bb); + void renderShadow(Entity* e, float x, float y, float z, float pow, float a); + void renderTileShadow(Tile* tt, float x, float y, float z, int xt, int yt, int zt, float pow, float r, float xo, float yo, float zo); + void renderFlame(Entity* e, float x, float y, float z, float a); + void postRender(Entity* entity, float x, float y, float z, float rot, float a); + Level* getLevel(); Font* getFont(); diff --git a/src/client/renderer/entity/ItemRenderer.cpp b/src/client/renderer/entity/ItemRenderer.cpp index 15e63d1..eaf29b4 100755 --- a/src/client/renderer/entity/ItemRenderer.cpp +++ b/src/client/renderer/entity/ItemRenderer.cpp @@ -226,7 +226,40 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, const ItemInsta t.draw(); } -void ItemRenderer::renderGuiItemDecorations(const ItemInstance* item, float x, float y) { + +void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y){ // this is normally unused in the header but i ported it from java beta - shredder + if (item != NULL) { + if (item->count > 1) { + std::string countStr = std::to_string(item->count); + // glDisable(GL_LIGHTING); + // glDisable(GL_DEPTH_TEST); + font->drawShadow(countStr, x + 19 - 2 - font->width(countStr), + y + 6 + 3, 0xFFFFFF); + // glEnable(GL_LIGHTING); + // glEnable(GL_DEPTH_TEST); + } + if (item->isDamaged()) { + float p = std::floor(13.5f - (float) item->getDamageValue() * 13.0f / (float) item->getMaxDamage() + 0.5); + int cc = (int) std::floor(255.5f - (float) item->getDamageValue() * 255.0f / (float) item->getMaxDamage() + 0.5); + // glDisable(GL_LIGHTING); + // glDisable(GL_DEPTH_TEST); + // glDisable(GL_TEXTURE_2D); + // auto var8 = ::net::minecraft::client::renderer::Tesselator::instance(); + Tesselator& t = Tesselator::instance; + int ca = 255 - cc << 16 | cc << 8; + int cb = (255 - cc) / 4 << 16 | 16128; + fillRect(t, x + 2, y + 13, 13, 2, 0); + fillRect(t, x + 2, y + 13, 12, 1, cb); + fillRect(t, x + 2, y + 13, p, 1, ca); + // glEnable(GL_TEXTURE_2D); + // glEnable(GL_LIGHTING); + // glEnable(GL_DEPTH_TEST); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + } +} + +void ItemRenderer::renderGuiItemDecorations(const ItemInstance* item, float x, float y) { // nothing changed here this is the normal pocket edition one. if (!item) return; if (item->count > 0 && item->isDamaged()) { float p = std::floor(13.5f - (float) item->getDamageValue() * 13.0f / (float) item->getMaxDamage()); diff --git a/src/client/renderer/entity/ItemRenderer.h b/src/client/renderer/entity/ItemRenderer.h index 9fb88f6..a104dc7 100755 --- a/src/client/renderer/entity/ItemRenderer.h +++ b/src/client/renderer/entity/ItemRenderer.h @@ -22,7 +22,7 @@ public: static void renderGuiItem(Font* font, Textures* textures, const ItemInstance* item, float x, float y, bool fancy); static void renderGuiItem(Font* font, Textures* textures, const ItemInstance* item, float x, float y, float w, float h, bool fancy); static void renderGuiItemCorrect(Font* font, Textures* textures, const ItemInstance* item, int x, int y); - //void renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y); + static void renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y); static void renderGuiItemDecorations(const ItemInstance* item, float x, float y); static void blit(float x, float y, float sx, float sy, float w, float h); diff --git a/src/client/renderer/entity/MobRenderer.cpp b/src/client/renderer/entity/MobRenderer.cpp index 51ccee9..3d6b3d9 100755 --- a/src/client/renderer/entity/MobRenderer.cpp +++ b/src/client/renderer/entity/MobRenderer.cpp @@ -135,7 +135,7 @@ void MobRenderer::render(Entity* e, float x, float y, float z, float rot, float //glEnable2(GL_DEPTH_TEST); glPopMatrix2(); - + postRender(mob, x, y, z, rot, a); renderName(mob, x, y, z); } diff --git a/src/util/Color.cpp b/src/util/Color.cpp new file mode 100644 index 0000000..9afaa5c --- /dev/null +++ b/src/util/Color.cpp @@ -0,0 +1,98 @@ +#include "Mth.h" + +#include "Color.h" +#include + +//Creates an opaque sRGB color with the specified red, green, and blue values in the range (0.0 - 1.0). +//Alpha is defaulted to 1.0. The actual color used in rendering depends on finding the best match given the color space +//available for a particular output device. +//Parameters: +//r - the red component +//g - the green component +//b - the blue component +//Throws: +//IllegalArgumentException - if r, g or b are outside of the range 0.0 to 1.0, inclusive +Color::Color( float r, float g, float b) +{ + assert( r >= 0.0f && r <= 1.0f ); + assert( g >= 0.0f && g <= 1.0f ); + assert( b >= 0.0f && b <= 1.0f ); + + //argb + colour = ( (0xFF<<24) | ( (int)(r*255)<<16 ) | ( (int)(g*255)<<8 ) | ( (int)(b*255) ) ); +} + +Color::Color( int r, int g, int b) +{ + colour = ( (0xFF<<24) | ( (r&0xff)<<16 ) | ( (g&0xff)<<8 ) | ( (b&0xff) ) ); +} + + +//Creates a Color object based on the specified values for the HSB color model. +//The s and b components should be floating-point values between zero and one (numbers in the range 0.0-1.0). +//The h component can be any floating-point number. The floor of this number is subtracted from it to create a fraction between 0 and 1. +//This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model. +// +//Parameters: +//h - the hue component +//s - the saturation of the color +//b - the brightness of the color +//Returns: +//a Color object with the specified hue, saturation, and brightness. +Color Color::getHSBColor(float hue, float saturation, float brightness) +{ + int r = 0, g = 0, b = 0; + if (saturation == 0) + { + r = g = b = (int) (brightness * 255.0f + 0.5f); + } + else + { + float h = (hue - (float)floor(hue)) * 6.0f; + float f = h - (float)floor(h); + float p = brightness * (1.0f - saturation); + float q = brightness * (1.0f - saturation * f); + float t = brightness * (1.0f - (saturation * (1.0f - f))); + switch ((int) h) + { + case 0: + r = (int) (brightness * 255.0f + 0.5f); + g = (int) (t * 255.0f + 0.5f); + b = (int) (p * 255.0f + 0.5f); + break; + case 1: + r = (int) (q * 255.0f + 0.5f); + g = (int) (brightness * 255.0f + 0.5f); + b = (int) (p * 255.0f + 0.5f); + break; + case 2: + r = (int) (p * 255.0f + 0.5f); + g = (int) (brightness * 255.0f + 0.5f); + b = (int) (t * 255.0f + 0.5f); + break; + case 3: + r = (int) (p * 255.0f + 0.5f); + g = (int) (q * 255.0f + 0.5f); + b = (int) (brightness * 255.0f + 0.5f); + break; + case 4: + r = (int) (t * 255.0f + 0.5f); + g = (int) (p * 255.0f + 0.5f); + b = (int) (brightness * 255.0f + 0.5f); + break; + case 5: + r = (int) (brightness * 255.0f + 0.5f); + g = (int) (p * 255.0f + 0.5f); + b = (int) (q * 255.0f + 0.5f); + break; + } + } + + + return Color( r, g, b ); +} + +int Color::getRGB() +{ + return colour; +} \ No newline at end of file diff --git a/src/util/Color.h b/src/util/Color.h new file mode 100644 index 0000000..a9d31ec --- /dev/null +++ b/src/util/Color.h @@ -0,0 +1,15 @@ +#pragma once + +class Color +{ +private: + int colour; + +public: + //Creates an opaque sRGB color with the specified red, green, and blue values in the range (0.0 - 1.0). + Color( float r, float g, float b); + Color( int r, int g, int b); + + static Color getHSBColor(float h, float s, float b); + int getRGB(); +}; \ No newline at end of file diff --git a/src/world/entity/player/Inventory.cpp b/src/world/entity/player/Inventory.cpp index 5a46535..480627b 100755 --- a/src/world/entity/player/Inventory.cpp +++ b/src/world/entity/player/Inventory.cpp @@ -245,6 +245,7 @@ void Inventory::setupDefault() { addItem(new ItemInstance(Item::seeds_melon)); addItem(new ItemInstance(Item::dye_powder, 1, DyePowderItem::WHITE)); addItem(new ItemInstance(Item::hoe_iron)); + addItem(new ItemInstance(Item::flintAndSteel)); #ifdef RPI Sel[0] = addItem(new ItemInstance(Item::sword_iron)); #else diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index c9132f5..bb5ac0e 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -30,7 +30,7 @@ #include "../../network/packet/ExplodePacket.h" Level::Level(LevelStorage* levelStorage, const std::string& levelName, const LevelSettings& settings, int generatorVersion, Dimension* fixedDimension /* = NULL */) -: levelStorage(levelStorage), + : levelStorage(levelStorage), isClientSide(false), isFindingSpawn(false), noNeighborUpdate(false), @@ -52,7 +52,7 @@ Level::Level(LevelStorage* levelStorage, const std::string& levelName, const Lev allPlayersAreSleeping(false), _nightMode(false) { - _init(levelName, settings, generatorVersion, fixedDimension); + _init(levelName, settings, generatorVersion, fixedDimension); } Level::~Level() { @@ -85,14 +85,14 @@ void Level::_init(const std::string& levelName, const LevelSettings& settings, i isGeneratingTerrain = false; LevelData* preparedData = levelStorage->prepareLevel(this); - _isNew = (preparedData == NULL); + _isNew = (preparedData == NULL); - if (preparedData == NULL) { - levelData = LevelData(settings, levelName, generatorVersion); - } else { + if (preparedData == NULL) { + levelData = LevelData(settings, levelName, generatorVersion); + } else { levelData = *preparedData; - levelData.setLevelName(levelName); - } + levelData.setLevelName(levelName); + } if (fixedDimension != NULL) { dimension = fixedDimension; @@ -100,12 +100,12 @@ void Level::_init(const std::string& levelName, const LevelSettings& settings, i dimension = DimensionFactory::createDefaultDimension( &levelData ); } - dimension->init(this); - _chunkSource = createChunkSource(); + dimension->init(this); + _chunkSource = createChunkSource(); _pathFinder = new PathFinder(); _nightMode = false; - updateSkyBrightness(); + updateSkyBrightness(); } /*protected*/ @@ -121,63 +121,63 @@ ChunkSource* Level::createChunkSource() { /*public*/ bool Level::checkAndHandleWater(const AABB& box, const Material* material, Entity* e) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - if (!hasChunksAt(x0, y0, z0, x1, y1, z1)) { - return false; - } + if (!hasChunksAt(x0, y0, z0, x1, y1, z1)) { + return false; + } - bool ok = false; - Vec3 current(0,0,0); - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material == material) { - float yt0 = y + 1 - LiquidTile::getHeight(getData(x, y, z)); - if (y1 >= yt0) { - ok = true; - tile->handleEntityInside(this, x, y, z, e, current); - } - } - } - float len = current.length(); - if (len > 0) { - const float pow = 0.004f / len; - e->xd += current.x * pow; - e->yd += current.y * pow; - e->zd += current.z * pow; - } - return ok; + bool ok = false; + Vec3 current(0,0,0); + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material == material) { + float yt0 = y + 1 - LiquidTile::getHeight(getData(x, y, z)); + if (y1 >= yt0) { + ok = true; + tile->handleEntityInside(this, x, y, z, e, current); + } + } + } + float len = current.length(); + if (len > 0) { + const float pow = 0.004f / len; + e->xd += current.x * pow; + e->yd += current.y * pow; + e->zd += current.z * pow; + } + return ok; } /*public*/ Player* Level::getNearestPlayer(Entity* source, float maxDist) { - return getNearestPlayer(source->x, source->y, source->z, maxDist); + return getNearestPlayer(source->x, source->y, source->z, maxDist); } /*public*/ Player* Level::getNearestPlayer(float x, float y, float z, float maxDist) { - float maxDistSqr = maxDist * maxDist; + float maxDistSqr = maxDist * maxDist; float best = -1; - Player* result = NULL; - for (unsigned int i = 0; i < players.size(); i++) { - Player* p = players[i]; + Player* result = NULL; + for (unsigned int i = 0; i < players.size(); i++) { + Player* p = players[i]; if (p->removed) continue; float dist = p->distanceToSqr(x, y, z); - if ((maxDist < 0 || dist < maxDistSqr) && (best == -1 || dist < best)) { - best = dist; - result = p; - } - } - return result; + if ((maxDist < 0 || dist < maxDistSqr) && (best == -1 || dist < best)) { + best = dist; + result = p; + } + } + return result; } /*public*/ @@ -189,7 +189,7 @@ void Level::tick() { _mobSpawnTick = 0; TIMER_PUSH("mobSpawner"); MobSpawner::tick(this, _spawnEnemies && difficulty > Difficulty::PEACEFUL, - _spawnFriendlies && (levelData.getTime() % 400) < MobSpawnInterval); + _spawnFriendlies && (levelData.getTime() % 400) < MobSpawnInterval); TIMER_POP(); } } @@ -231,7 +231,7 @@ void Level::tick() { tickPendingTicks(false); TIMER_POP_PUSH("tickTiles"); - tickTiles(); + tickTiles(); TIMER_POP_PUSH("sendEntityData"); for (unsigned int i = 0; i < entities.size(); ++i) { @@ -255,7 +255,7 @@ void Level::tick() { /*protected*/ void Level::tickTiles() { - _chunksToPoll.clear(); + _chunksToPoll.clear(); static const int pollChunkOffsets[] = { -1,-4, 0,-4, 1,-4, -2,-3, -1,-3, 0,-3, 1,-3, 2,-3, -3,-2, @@ -270,10 +270,10 @@ void Level::tickTiles() { TIMER_PUSH("buildList"); //static Stopwatch w; //w.start(); - for (size_t i = 0; i < players.size(); i++) { - Player* player = players[i]; - int xx = Mth::floor(player->x / 16); - int zz = Mth::floor(player->z / 16); + for (size_t i = 0; i < players.size(); i++) { + Player* player = players[i]; + int xx = Mth::floor(player->x / 16); + int zz = Mth::floor(player->z / 16); for (int i = 0; i < pollChunkOffsetsSize; i += 2) { const int xp = xx + pollChunkOffsets[i]; @@ -282,114 +282,114 @@ void Level::tickTiles() { zp >= 0 && zp < CHUNK_CACHE_WIDTH) _chunksToPoll.insert(ChunkPos(xp, zp)); } - } + } TIMER_POP(); - //if (delayUntilNextMoodSound > 0) delayUntilNextMoodSound--; + //if (delayUntilNextMoodSound > 0) delayUntilNextMoodSound--; TIMER_PUSH("loop"); - for (ChunkPosSet::iterator it = _chunksToPoll.begin(); it != _chunksToPoll.end(); ++it) { + for (ChunkPosSet::iterator it = _chunksToPoll.begin(); it != _chunksToPoll.end(); ++it) { const ChunkPos& cp = *it; - int xo = cp.x * 16; - int zo = cp.z * 16; - // LevelSource region = new Region(this, xo, 0, zo, xo + 16, 128, zo + 16); + int xo = cp.x * 16; + int zo = cp.z * 16; + // LevelSource region = new Region(this, xo, 0, zo, xo + 16, 128, zo + 16); TIMER_PUSH("getChunk"); - LevelChunk* lc = this->getChunk(cp.x, cp.z); + LevelChunk* lc = this->getChunk(cp.x, cp.z); TIMER_POP_PUSH("tickChunk"); //lc->tick(); - //if (delayUntilNextMoodSound == 0) { - // randValue = randValue * 3 + addend; - // int val = (randValue >> 2); - // int x = (val & 15); - // int z = ((val >> 8) & 15); - // int y = ((val >> 16) & 127); + //if (delayUntilNextMoodSound == 0) { + // randValue = randValue * 3 + addend; + // int val = (randValue >> 2); + // int x = (val & 15); + // int z = ((val >> 8) & 15); + // int y = ((val >> 16) & 127); - // int id = lc->getTile(x, y, z); - // x += xo; - // z += zo; - // if (id == 0 && getRawBrightness(x, y, z) <= random.nextInt(8) && getBrightness(LightLayer::Sky, x, y, z) <= 0) { - // Player* player = getNearestPlayer(x + 0.5, y + 0.5, z + 0.5, 8); - // if (player != NULL && player.distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 2 * 2) { - // //this.playSound(x + 0.5, y + 0.5, z + 0.5, "ambient.cave.cave", 0.7f, 0.8f + random.nextFloat() * 0.2f); - // delayUntilNextMoodSound = random.nextInt(20 * 60 * 10) + 20 * 60 * 5; - // } - // } - //} + // int id = lc->getTile(x, y, z); + // x += xo; + // z += zo; + // if (id == 0 && getRawBrightness(x, y, z) <= random.nextInt(8) && getBrightness(LightLayer::Sky, x, y, z) <= 0) { + // Player* player = getNearestPlayer(x + 0.5, y + 0.5, z + 0.5, 8); + // if (player != NULL && player.distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 2 * 2) { + // //this.playSound(x + 0.5, y + 0.5, z + 0.5, "ambient.cave.cave", 0.7f, 0.8f + random.nextFloat() * 0.2f); + // delayUntilNextMoodSound = random.nextInt(20 * 60 * 10) + 20 * 60 * 5; + // } + // } + //} TIMER_POP_PUSH("tickTiles"); - for (int i = 0; i < 20; i++) { //@todo: CHUNK_TILE_TICK_COUNT - _randValue = _randValue * 3 + _addend; - int val = (_randValue >> 2); - int x = (val & 15); - int z = ((val >> 8) & 15); - int y = ((val >> 16) & 127); + for (int i = 0; i < 20; i++) { //@todo: CHUNK_TILE_TICK_COUNT + _randValue = _randValue * 3 + _addend; + int val = (_randValue >> 2); + int x = (val & 15); + int z = ((val >> 8) & 15); + int y = ((val >> 16) & 127); - int id = lc->getTile(x, y, z); - if (Tile::shouldTick[id]) { - Tile::tiles[id]->tick(this, x + xo, y, z + zo, &random); - } - } + int id = lc->getTile(x, y, z); + if (Tile::shouldTick[id]) { + Tile::tiles[id]->tick(this, x + xo, y, z + zo, &random); + } + } TIMER_POP(); - } + } TIMER_POP(); //w.stop(); //w.printEvery(30, "ticktiles"); } bool Level::tickPendingTicks(bool force) { - int count = _tickNextTickSet.size(); - if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK; - for (int i = 0; i < count; i++) { + int count = _tickNextTickSet.size(); + if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK; + for (int i = 0; i < count; i++) { TickDataSet::iterator td = _tickNextTickSet.begin(); - if (!force && td->delay > levelData.getTime()) { - break; - } + if (!force && td->delay > levelData.getTime()) { + break; + } int r = 8; - if (hasChunksAt(td->x - r, td->y - r, td->z - r, td->x + r, td->y + r, td->z + r)) { - int id = getTile(td->x, td->y, td->z); - if (id == td->tileId && id > 0) { - Tile::tiles[id]->tick(this, td->x, td->y, td->z, &random); - } - } - _tickNextTickSet.erase(td); - } - return _tickNextTickSet.size() != 0; + if (hasChunksAt(td->x - r, td->y - r, td->z - r, td->x + r, td->y + r, td->z + r)) { + int id = getTile(td->x, td->y, td->z); + if (id == td->tileId && id > 0) { + Tile::tiles[id]->tick(this, td->x, td->y, td->z, &random); + } + } + _tickNextTickSet.erase(td); + } + return _tickNextTickSet.size() != 0; } /*public*/ void Level::loadPlayer(Player* player, bool doAddPlayer /*= true*/) { if (player) { CompoundTag* loadedPlayerTag = levelData.getLoadedPlayerTag(); - if (loadedPlayerTag != NULL) { - player->load(loadedPlayerTag); - levelData.setLoadedPlayerTag(NULL); - } else { + if (loadedPlayerTag != NULL) { + player->load(loadedPlayerTag); + levelData.setLoadedPlayerTag(NULL); + } else { levelData.setLoadedPlayerTo(player); } if (doAddPlayer) addEntity(player); } - //} catch (Exception e) { - // e.printStackTrace(); - //} + //} catch (Exception e) { + // e.printStackTrace(); + //} } bool Level::findPath(Path* path, Entity* from, Entity* to, float maxDist, bool canOpenDoors, bool avoidWater) { - TIMER_PUSH("pathfind"); + TIMER_PUSH("pathfind"); int x = Mth::floor(from->x); - int y = Mth::floor(from->y); - int z = Mth::floor(from->z); + int y = Mth::floor(from->y); + int z = Mth::floor(from->z); - int r = (int) (maxDist + 16); - int x1 = x - r; - int y1 = y - r; - int z1 = z - r; - int x2 = x + r; - int y2 = y + r; - int z2 = z + r; + int r = (int) (maxDist + 16); + int x1 = x - r; + int y1 = y - r; + int z1 = z - r; + int x2 = x + r; + int y2 = y + r; + int z2 = z + r; //LOGI("trying to move! 1: %ld\n", levelData.getTime()); - Region region(this, x1, y1, z1, x2, y2, z2); + Region region(this, x1, y1, z1, x2, y2, z2); _pathFinder->setLevelSource(®ion); _pathFinder->canOpenDoors = canOpenDoors; _pathFinder->avoidWater = avoidWater; @@ -399,24 +399,24 @@ bool Level::findPath(Path* path, Entity* from, Entity* to, float maxDist, bool c } bool Level::findPath(Path* path, Entity* from, int xBest, int yBest, int zBest, float maxDist, bool canOpenDoors, bool avoidWater) { - TIMER_PUSH("pathfind"); + TIMER_PUSH("pathfind"); int x = Mth::floor(from->x); - int y = Mth::floor(from->y); - int z = Mth::floor(from->z); + int y = Mth::floor(from->y); + int z = Mth::floor(from->z); - int r = (int) (maxDist + 8); - int x1 = x - r; - int y1 = y - r; - int z1 = z - r; - int x2 = x + r; - int y2 = y + r; - int z2 = z + r; - Region region(this, x1, y1, z1, x2, y2, z2); + int r = (int) (maxDist + 8); + int x1 = x - r; + int y1 = y - r; + int z1 = z - r; + int x2 = x + r; + int y2 = y + r; + int z2 = z + r; + Region region(this, x1, y1, z1, x2, y2, z2); //LOGI("trying to move! 2: %ld\n", levelData.getTime()); _pathFinder->setLevelSource(®ion); _pathFinder->canOpenDoors = canOpenDoors; _pathFinder->avoidWater = avoidWater; - _pathFinder->findPath(path, from, xBest, yBest, zBest, maxDist); + _pathFinder->findPath(path, from, xBest, yBest, zBest, maxDist); TIMER_POP(); return true; } @@ -427,57 +427,57 @@ bool Level::findPath(Path* path, Entity* from, int xBest, int yBest, int zBest, */ /*protected*/ void Level::setInitialSpawn() { - isFindingSpawn = true; - int xSpawn = CHUNK_CACHE_WIDTH * CHUNK_WIDTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; - int ySpawn = 64; - int zSpawn = CHUNK_CACHE_WIDTH * CHUNK_DEPTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; - while (!dimension->isValidSpawn(xSpawn, zSpawn)) { - xSpawn += random.nextInt(32) - random.nextInt(32); - zSpawn += random.nextInt(32) - random.nextInt(32); + isFindingSpawn = true; + int xSpawn = CHUNK_CACHE_WIDTH * CHUNK_WIDTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; + int ySpawn = 64; + int zSpawn = CHUNK_CACHE_WIDTH * CHUNK_DEPTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; + while (!dimension->isValidSpawn(xSpawn, zSpawn)) { + xSpawn += random.nextInt(32) - random.nextInt(32); + zSpawn += random.nextInt(32) - random.nextInt(32); if (xSpawn < 4) xSpawn += 32; if (xSpawn >= LEVEL_WIDTH-4) xSpawn -= 32; if (zSpawn < 4) zSpawn += 32; if (zSpawn >= LEVEL_DEPTH-4) zSpawn -= 32; - } - levelData.setSpawn(xSpawn, ySpawn, zSpawn); - isFindingSpawn = false; + } + levelData.setSpawn(xSpawn, ySpawn, zSpawn); + isFindingSpawn = false; } /*public*/ void Level::validateSpawn() { - if (levelData.getYSpawn() <= 0) { - levelData.setYSpawn(64); - } - int xSpawn = levelData.getXSpawn(); - int zSpawn = levelData.getZSpawn(); - while (getTopTile(xSpawn, zSpawn) == 0 || getTopTile(xSpawn, zSpawn) == Tile::invisible_bedrock->id) { - xSpawn += random.nextInt(8) - random.nextInt(8); - zSpawn += random.nextInt(8) - random.nextInt(8); + if (levelData.getYSpawn() <= 0) { + levelData.setYSpawn(64); + } + int xSpawn = levelData.getXSpawn(); + int zSpawn = levelData.getZSpawn(); + while (getTopTile(xSpawn, zSpawn) == 0 || getTopTile(xSpawn, zSpawn) == Tile::invisible_bedrock->id) { + xSpawn += random.nextInt(8) - random.nextInt(8); + zSpawn += random.nextInt(8) - random.nextInt(8); if (xSpawn < 4) xSpawn += 8; if (xSpawn >= LEVEL_WIDTH-4) xSpawn -= 8; if (zSpawn < 4) zSpawn += 8; if (zSpawn >= LEVEL_DEPTH-4) zSpawn -= 8; - } - levelData.setXSpawn(xSpawn); - levelData.setZSpawn(zSpawn); + } + levelData.setXSpawn(xSpawn); + levelData.setZSpawn(zSpawn); } int Level::getTopTile(int x, int z) { - int y = 63; - while (!isEmptyTile(x, y + 1, z)) { - y++; - } - return getTile(x, y, z); + int y = 63; + while (!isEmptyTile(x, y + 1, z)) { + y++; + } + return getTile(x, y, z); } int Level::getTopTileY(int x, int z) { - int y = 63; - while (!isEmptyTile(x, y + 1, z)) { - y++; - } - return y; + int y = 63; + while (!isEmptyTile(x, y + 1, z)) { + y++; + } + return y; } // // void clearLoadedPlayerData() { @@ -513,101 +513,101 @@ void Level::saveLevelData() { //} int Level::getTile(int x, int y, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return 0; - //} - if (y < 0) return 0; - if (y >= DEPTH) return 0; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return 0; + //} + if (y < 0) return 0; + if (y >= DEPTH) return 0; //if (z == 128) { // int a = 0; //} //LOGI("%d ", z); - return getChunk(x >> 4, z >> 4)->getTile(x & 15, y, z & 15); + return getChunk(x >> 4, z >> 4)->getTile(x & 15, y, z & 15); } bool Level::isEmptyTile(int x, int y, int z) { - return getTile(x, y, z) == 0; + return getTile(x, y, z) == 0; } bool Level::hasChunkAt(int x, int y, int z) { - if (y < 0 || y >= Level::DEPTH) return false; - return hasChunk(x >> 4, z >> 4); + if (y < 0 || y >= Level::DEPTH) return false; + return hasChunk(x >> 4, z >> 4); } bool Level::hasChunksAt(int x, int y, int z, int r) { - return hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r); + return hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r); } bool Level::hasChunksAt(int x0, int y0, int z0, int x1, int y1, int z1) { - if (y1 < 0 || y0 >= Level::DEPTH) return false; + if (y1 < 0 || y0 >= Level::DEPTH) return false; - x0 >>= 4; - z0 >>= 4; - x1 >>= 4; - z1 >>= 4; + x0 >>= 4; + z0 >>= 4; + x1 >>= 4; + z1 >>= 4; - for (int x = x0; x <= x1; x++) - for (int z = z0; z <= z1; z++) - if (!hasChunk(x, z)) return false; + for (int x = x0; x <= x1; x++) + for (int z = z0; z <= z1; z++) + if (!hasChunk(x, z)) return false; - return true; + return true; } bool Level::hasChunk(int x, int z) { - return _chunkSource->hasChunk(x, z); + return _chunkSource->hasChunk(x, z); } LevelChunk* Level::getChunkAt(int x, int z) { - return getChunk(x >> 4, z >> 4); + return getChunk(x >> 4, z >> 4); } LevelChunk* Level::getChunk(int x, int z) { - return _chunkSource->getChunk(x, z); + return _chunkSource->getChunk(x, z); } bool Level::setTileAndDataNoUpdate(int x, int y, int z, int tile, int data) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - return c->setTileAndData(x & 15, y, z & 15, tile, data); + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return false; + LevelChunk* c = getChunk(x >> 4, z >> 4); + return c->setTileAndData(x & 15, y, z & 15, tile, data); } bool Level::setTileNoUpdate(int x, int y, int z, int tile) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - return c->setTile(x & 15, y, z & 15, tile); + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return false; + LevelChunk* c = getChunk(x >> 4, z >> 4); + return c->setTile(x & 15, y, z & 15, tile); } const Material* Level::getMaterial(int x, int y, int z) { - int t = getTile(x, y, z); - if (t == 0) return Material::air; - return Tile::tiles[t]->material; + int t = getTile(x, y, z); + if (t == 0) return Material::air; + return Tile::tiles[t]->material; } int Level::getData(int x, int y, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return 0; - //} - if (y < 0) return 0; - if (y >= DEPTH) return 0; - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; - return c->getData(x, y, z); + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return 0; + //} + if (y < 0) return 0; + if (y >= DEPTH) return 0; + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; + return c->getData(x, y, z); } void Level::setData(int x, int y, int z, int data) { //// @newway //if (setDataNoUpdate(x, y, z, data)) { - // int t = getTile(x, y, z); + // int t = getTile(x, y, z); // if (Tile::sendTileData[t]) { // tileUpdated(x, y, z, t); // } else { @@ -616,20 +616,20 @@ void Level::setData(int x, int y, int z, int data) { //} // @oldway - if (setDataNoUpdate(x, y, z, data)) { - tileUpdated(x, y, z, getTile(x, y, z)); - } + if (setDataNoUpdate(x, y, z, data)) { + tileUpdated(x, y, z, getTile(x, y, z)); + } } bool Level::setDataNoUpdate(int x, int y, int z, int data) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return false; + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; //return c->setData(x, y, z, data); @@ -641,148 +641,148 @@ bool Level::setDataNoUpdate(int x, int y, int z, int data) { } bool Level::setTile(int x, int y, int z, int tile) { - if (setTileNoUpdate(x, y, z, tile)) { + if (setTileNoUpdate(x, y, z, tile)) { //printf("TILE UPDATED %d, %d, %d\n", x, y, z); - tileUpdated(x, y, z, tile); - return true; - } - return false; + tileUpdated(x, y, z, tile); + return true; + } + return false; } bool Level::setTileAndData(int x, int y, int z, int tile, int data) { - if (setTileAndDataNoUpdate(x, y, z, tile, data)) { - tileUpdated(x, y, z, tile); - return true; - } - return false; + if (setTileAndDataNoUpdate(x, y, z, tile, data)) { + tileUpdated(x, y, z, tile); + return true; + } + return false; } void Level::sendTileUpdated(int x, int y, int z) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->tileChanged(x, y, z); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->tileChanged(x, y, z); + } } /*protected*/ void Level::tileUpdated(int x, int y, int z, int tile) { - sendTileUpdated(x, y, z); - this->updateNeighborsAt(x, y, z, tile); + sendTileUpdated(x, y, z); + this->updateNeighborsAt(x, y, z, tile); } void Level::lightColumnChanged(int x, int z, int y0, int y1) { - if (y0 > y1) { - int tmp = y1; - y1 = y0; - y0 = tmp; - } - setTilesDirty(x, y0, z, x, y1, z); + if (y0 > y1) { + int tmp = y1; + y1 = y0; + y0 = tmp; + } + setTilesDirty(x, y0, z, x, y1, z); } void Level::setTileDirty(int x, int y, int z) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->setTilesDirty(x, y, z, x, y, z); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->setTilesDirty(x, y, z, x, y, z); + } } void Level::setTilesDirty(int x0, int y0, int z0, int x1, int y1, int z1) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->setTilesDirty(x0, y0, z0, x1, y1, z1); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->setTilesDirty(x0, y0, z0, x1, y1, z1); + } } void Level::swap(int x1, int y1, int z1, int x2, int y2, int z2) { - int t1 = getTile(x1, y1, z1); - int d1 = getData(x1, y1, z1); - int t2 = getTile(x2, y2, z2); - int d2 = getData(x2, y2, z2); + int t1 = getTile(x1, y1, z1); + int d1 = getData(x1, y1, z1); + int t2 = getTile(x2, y2, z2); + int d2 = getData(x2, y2, z2); - setTileAndDataNoUpdate(x1, y1, z1, t2, d2); - setTileAndDataNoUpdate(x2, y2, z2, t1, d1); + setTileAndDataNoUpdate(x1, y1, z1, t2, d2); + setTileAndDataNoUpdate(x2, y2, z2, t1, d1); - updateNeighborsAt(x1, y1, z1, t2); - updateNeighborsAt(x2, y2, z2, t1); + updateNeighborsAt(x1, y1, z1, t2); + updateNeighborsAt(x2, y2, z2, t1); } void Level::updateNeighborsAt(int x, int y, int z, int tile) { - neighborChanged(x - 1, y, z, tile); - neighborChanged(x + 1, y, z, tile); - neighborChanged(x, y - 1, z, tile); - neighborChanged(x, y + 1, z, tile); - neighborChanged(x, y, z - 1, tile); - neighborChanged(x, y, z + 1, tile); + neighborChanged(x - 1, y, z, tile); + neighborChanged(x + 1, y, z, tile); + neighborChanged(x, y - 1, z, tile); + neighborChanged(x, y + 1, z, tile); + neighborChanged(x, y, z - 1, tile); + neighborChanged(x, y, z + 1, tile); } /*private*/ void Level::neighborChanged(int x, int y, int z, int type) { - if (noNeighborUpdate || isClientSide) return; - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL) tile->neighborChanged(this, x, y, z, type); + if (noNeighborUpdate || isClientSide) return; + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL) tile->neighborChanged(this, x, y, z, type); } bool Level::canSeeSky(int x, int y, int z) { - return getChunk(x >> 4, z >> 4)->isSkyLit(x & 15, y, z & 15); + return getChunk(x >> 4, z >> 4)->isSkyLit(x & 15, y, z & 15); } int Level::getRawBrightness(int x, int y, int z) { - return getRawBrightness(x, y, z, true); + return getRawBrightness(x, y, z, true); } int Level::getRawBrightness(int x, int y, int z, bool propagate) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return MAX_BRIGHTNESS; - //} + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return MAX_BRIGHTNESS; + //} - if (propagate) { - int id = getTile(x, y, z); - if (id == Tile::stoneSlabHalf->id || id == Tile::farmland->id) { - int br = getRawBrightness(x, y + 1, z, false); - int br1 = getRawBrightness(x + 1, y, z, false); - int br2 = getRawBrightness(x - 1, y, z, false); - int br3 = getRawBrightness(x, y, z + 1, false); - int br4 = getRawBrightness(x, y, z - 1, false); - if (br1 > br) br = br1; - if (br2 > br) br = br2; - if (br3 > br) br = br3; - if (br4 > br) br = br4; - return br; - } - } + if (propagate) { + int id = getTile(x, y, z); + if (id == Tile::stoneSlabHalf->id || id == Tile::farmland->id) { + int br = getRawBrightness(x, y + 1, z, false); + int br1 = getRawBrightness(x + 1, y, z, false); + int br2 = getRawBrightness(x - 1, y, z, false); + int br3 = getRawBrightness(x, y, z + 1, false); + int br4 = getRawBrightness(x, y, z - 1, false); + if (br1 > br) br = br1; + if (br2 > br) br = br2; + if (br3 > br) br = br3; + if (br4 > br) br = br4; + return br; + } + } - if (y < 0) return 0; - if (y >= DEPTH) { - int br = MAX_BRIGHTNESS - skyDarken; - if (br < 0) br = 0; - return br; - } + if (y < 0) return 0; + if (y >= DEPTH) { + int br = MAX_BRIGHTNESS - skyDarken; + if (br < 0) br = 0; + return br; + } - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; - return c->getRawBrightness(x, y, z, skyDarken); + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; + return c->getRawBrightness(x, y, z, skyDarken); } bool Level::isSkyLit(int x, int y, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return false; - //} - if (y < 0) return false; - if (y >= DEPTH) return true; - if (!hasChunk(x >> 4, z >> 4)) return false; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return false; + //} + if (y < 0) return false; + if (y >= DEPTH) return true; + if (!hasChunk(x >> 4, z >> 4)) return false; - LevelChunk* c = getChunk(x >> 4, z >> 4); - x &= 15; - z &= 15; + LevelChunk* c = getChunk(x >> 4, z >> 4); + x &= 15; + z &= 15; return c->isSkyLit(x, y, z); } int Level::getHeightmap(int x, int z) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return 0; - //} - if (!hasChunk(x >> 4, z >> 4)) return 0; + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return 0; + //} + if (!hasChunk(x >> 4, z >> 4)) return 0; - LevelChunk* c = getChunk(x >> 4, z >> 4); - return c->getHeightmap(x & 15, z & 15); + LevelChunk* c = getChunk(x >> 4, z >> 4); + return c->getHeightmap(x & 15, z & 15); } BiomeSource* Level::getBiomeSource() { @@ -793,45 +793,45 @@ Biome* Level::getBiome( int x, int z ) { } void Level::updateLightIfOtherThan(const LightLayer& layer, int x, int y, int z, int expected) { - if (dimension->hasCeiling && (&layer) == &LightLayer::Sky) return; + if (dimension->hasCeiling && (&layer) == &LightLayer::Sky) return; - if (!hasChunkAt(x, y, z)) return; + if (!hasChunkAt(x, y, z)) return; - if (&layer == &LightLayer::Sky) { - if (isSkyLit(x, y, z)) expected = 15; - } else if (&layer == &LightLayer::Block) { - int t = getTile(x, y, z); - if (Tile::lightEmission[t] > expected) expected = Tile::lightEmission[t]; - } + if (&layer == &LightLayer::Sky) { + if (isSkyLit(x, y, z)) expected = 15; + } else if (&layer == &LightLayer::Block) { + int t = getTile(x, y, z); + if (Tile::lightEmission[t] > expected) expected = Tile::lightEmission[t]; + } - if (getBrightness(layer, x, y, z) != expected) { - updateLight(layer, x, y, z, x, y, z); - } + if (getBrightness(layer, x, y, z) != expected) { + updateLight(layer, x, y, z, x, y, z); + } } int Level::getBrightness(const LightLayer& layer, int x, int y, int z) { - if (y < 0 || y >= DEPTH/* || x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE*/) { - return layer.surrounding; - } - int xc = x >> 4; - int zc = z >> 4; - if (!hasChunk(xc, zc)) return 0; - LevelChunk* c = getChunk(xc, zc); - return c->getBrightness(layer, x & 15, y, z & 15); + if (y < 0 || y >= DEPTH/* || x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE*/) { + return layer.surrounding; + } + int xc = x >> 4; + int zc = z >> 4; + if (!hasChunk(xc, zc)) return 0; + LevelChunk* c = getChunk(xc, zc); + return c->getBrightness(layer, x & 15, y, z & 15); } void Level::setBrightness(const LightLayer& layer, int x, int y, int z, int brightness) { - //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { - // return; - //} - if (y < 0) return; - if (y >= DEPTH) return; - if (!hasChunk(x >> 4, z >> 4)) return; - LevelChunk* c = getChunk(x >> 4, z >> 4); - c->setBrightness(layer, x & 15, y, z & 15, brightness); - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->tileBrightnessChanged(x, y, z); - } + //if (x < -MAX_LEVEL_SIZE || z < -MAX_LEVEL_SIZE || x >= MAX_LEVEL_SIZE || z > MAX_LEVEL_SIZE) { + // return; + //} + if (y < 0) return; + if (y >= DEPTH) return; + if (!hasChunk(x >> 4, z >> 4)) return; + LevelChunk* c = getChunk(x >> 4, z >> 4); + c->setBrightness(layer, x & 15, y, z & 15, brightness); + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->tileBrightnessChanged(x, y, z); + } } float Level::getBrightness(int x, int y, int z) { @@ -839,7 +839,7 @@ float Level::getBrightness(int x, int y, int z) { } bool Level::isDay() { - return this->skyDarken < 4; + return this->skyDarken < 4; } //HitResult Level::clip(const Vec3& a, const Vec3& b) { @@ -847,99 +847,99 @@ bool Level::isDay() { //} HitResult Level::clip(const Vec3& A, const Vec3& b, bool liquid /*= false*/, bool solidOnly /*= false*/) { - static Stopwatch sw; - //sw.printEvery(1000, "clip"); - SwStartStopper w(sw); + static Stopwatch sw; + //sw.printEvery(1000, "clip"); + SwStartStopper w(sw); - if (A.x != A.x || A.y != A.y || A.z != A.z) return HitResult(); //@kludge This is actually a way to do it + if (A.x != A.x || A.y != A.y || A.z != A.z) return HitResult(); //@kludge This is actually a way to do it if (b.x != b.x || b.y != b.y || b.z != b.z) return HitResult(); Vec3 a(A); - int xTile1 = Mth::floor(b.x); - int yTile1 = Mth::floor(b.y); - int zTile1 = Mth::floor(b.z); + int xTile1 = Mth::floor(b.x); + int yTile1 = Mth::floor(b.y); + int zTile1 = Mth::floor(b.z); - int xTile0 = Mth::floor(a.x); - int yTile0 = Mth::floor(a.y); - int zTile0 = Mth::floor(a.z); + int xTile0 = Mth::floor(a.x); + int yTile0 = Mth::floor(a.y); + int zTile0 = Mth::floor(a.z); - int maxIterations = 200; - while (maxIterations-- >= 0) { + int maxIterations = 200; + while (maxIterations-- >= 0) { if (a.x != a.x || a.y != a.y || a.z != a.z) return HitResult(); - if (xTile0 == xTile1 && yTile0 == yTile1 && zTile0 == zTile1) + if (xTile0 == xTile1 && yTile0 == yTile1 && zTile0 == zTile1) return HitResult(); - float xClip = 999; - float yClip = 999; - float zClip = 999; + float xClip = 999; + float yClip = 999; + float zClip = 999; - if (xTile1 > xTile0) xClip = xTile0 + 1.000f; - if (xTile1 < xTile0) xClip = xTile0 + 0.000f; + if (xTile1 > xTile0) xClip = xTile0 + 1.000f; + if (xTile1 < xTile0) xClip = xTile0 + 0.000f; - if (yTile1 > yTile0) yClip = yTile0 + 1.000f; - if (yTile1 < yTile0) yClip = yTile0 + 0.000f; + if (yTile1 > yTile0) yClip = yTile0 + 1.000f; + if (yTile1 < yTile0) yClip = yTile0 + 0.000f; - if (zTile1 > zTile0) zClip = zTile0 + 1.000f; - if (zTile1 < zTile0) zClip = zTile0 + 0.000f; + if (zTile1 > zTile0) zClip = zTile0 + 1.000f; + if (zTile1 < zTile0) zClip = zTile0 + 0.000f; - float xDist = 999; - float yDist = 999; - float zDist = 999; + float xDist = 999; + float yDist = 999; + float zDist = 999; - float xd = b.x - a.x; - float yd = b.y - a.y; - float zd = b.z - a.z; + float xd = b.x - a.x; + float yd = b.y - a.y; + float zd = b.z - a.z; - if (xClip != 999) xDist = (xClip - a.x) / xd; - if (yClip != 999) yDist = (yClip - a.y) / yd; - if (zClip != 999) zDist = (zClip - a.z) / zd; + if (xClip != 999) xDist = (xClip - a.x) / xd; + if (yClip != 999) yDist = (yClip - a.y) / yd; + if (zClip != 999) zDist = (zClip - a.z) / zd; - int face = 0; - if (xDist < yDist && xDist < zDist) { - if (xTile1 > xTile0) face = 4; - else face = 5; + int face = 0; + if (xDist < yDist && xDist < zDist) { + if (xTile1 > xTile0) face = 4; + else face = 5; - a.x = xClip; - a.y += yd * xDist; - a.z += zd * xDist; - } else if (yDist < zDist) { - if (yTile1 > yTile0) face = 0; - else face = 1; + a.x = xClip; + a.y += yd * xDist; + a.z += zd * xDist; + } else if (yDist < zDist) { + if (yTile1 > yTile0) face = 0; + else face = 1; - a.x += xd * yDist; - a.y = yClip; - a.z += zd * yDist; - } else { - if (zTile1 > zTile0) face = 2; - else face = 3; + a.x += xd * yDist; + a.y = yClip; + a.z += zd * yDist; + } else { + if (zTile1 > zTile0) face = 2; + else face = 3; - a.x += xd * zDist; - a.y += yd * zDist; - a.z = zClip; - } + a.x += xd * zDist; + a.y += yd * zDist; + a.z = zClip; + } - Vec3 tPos(a.x, a.y, a.z); - xTile0 = (int) (tPos.x = (float)Mth::floor(a.x)); - if (face == 5) { - xTile0--; - tPos.x++; - } - yTile0 = (int) (tPos.y = (float)Mth::floor(a.y)); - if (face == 1) { - yTile0--; - tPos.y++; - } - zTile0 = (int) (tPos.z = (float)Mth::floor(a.z)); - if (face == 3) { - zTile0--; - tPos.z++; - } + Vec3 tPos(a.x, a.y, a.z); + xTile0 = (int) (tPos.x = (float)Mth::floor(a.x)); + if (face == 5) { + xTile0--; + tPos.x++; + } + yTile0 = (int) (tPos.y = (float)Mth::floor(a.y)); + if (face == 1) { + yTile0--; + tPos.y++; + } + zTile0 = (int) (tPos.z = (float)Mth::floor(a.z)); + if (face == 3) { + zTile0--; + tPos.z++; + } - int t = getTile(xTile0, yTile0, zTile0); - int data = getData(xTile0, yTile0, zTile0); - Tile* tile = Tile::tiles[t]; + int t = getTile(xTile0, yTile0, zTile0); + int data = getData(xTile0, yTile0, zTile0); + Tile* tile = Tile::tiles[t]; if (solidOnly && tile != NULL && tile->getAABB(this, xTile0, yTile0, zTile0) == NULL) { // No collision @@ -948,27 +948,27 @@ HitResult Level::clip(const Vec3& A, const Vec3& b, bool liquid /*= false*/, boo HitResult r = tile->clip(this, xTile0, yTile0, zTile0, a, b); if (r.isHit()) return r; } - } - } - return HitResult(); + } + } + return HitResult(); } void Level::playSound(Entity* entity, const std::string& name, float volume, float pitch) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->playSound(name, entity->x, entity->y - entity->heightOffset, entity->z, volume, pitch); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->playSound(name, entity->x, entity->y - entity->heightOffset, entity->z, volume, pitch); + } } void Level::playSound(float x, float y, float z, const std::string& name, float volume, float pitch) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->playSound(name, x, y, z, volume, pitch); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->playSound(name, x, y, z, volume, pitch); + } } void Level::levelEvent(Player* source, int type, int x, int y, int z, int data) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->levelEvent(source, type, x, y, z, data); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->levelEvent(source, type, x, y, z, data); + } } void Level::tileEvent(int x, int y, int z, int b0, int b1) { @@ -993,7 +993,7 @@ void Level::tileEvent(int x, int y, int z, int b0, int b1) { void Level::addParticle(const std::string& id, float x, float y, float z, float xd, float yd, float zd, int data /* = 0 */) { for (unsigned int i = 0; i < _listeners.size(); i++) - _listeners[i]->addParticle(id, x, y, z, xd, yd, zd, data); + _listeners[i]->addParticle(id, x, y, z, xd, yd, zd, data); } void Level::addParticle(ParticleType::Id id, float x, float y, float z, float xd, float yd, float zd, int data /* = 0 */) { @@ -1006,13 +1006,13 @@ bool Level::addEntity(Entity* e) { if (prev) removeEntity(prev); - int xc = Mth::floor(e->x / 16.f); - int zc = Mth::floor(e->z / 16.f); + int xc = Mth::floor(e->x / 16.f); + int zc = Mth::floor(e->z / 16.f); - //bool forced = false; - //if (e->isPlayer()) { - // forced = true; - //} + //bool forced = false; + //if (e->isPlayer()) { + // forced = true; + //} bool forced = true; if (forced/* || hasChunk(xc, zc)*/) { @@ -1034,10 +1034,10 @@ Entity* Level::getEntity(int entityId) // TODO: Lookup map /*for (unsigned int i = 0; i < entities.size(); i++) { - if (entities[i]->entityId == entityId) - { - return entities[i]; - } + if (entities[i]->entityId == entityId) + { + return entities[i]; + } } return NULL;*/ EntityMap::const_iterator cit = entityIdLookup.find(entityId); @@ -1046,16 +1046,16 @@ Entity* Level::getEntity(int entityId) /*protected*/ void Level::entityAdded(Entity* e) { - for (unsigned int i = 0; i < _listeners.size(); i++) { - _listeners[i]->entityAdded(e); - } + for (unsigned int i = 0; i < _listeners.size(); i++) { + _listeners[i]->entityAdded(e); + } } /*protected*/ void Level::entityRemoved(Entity* e) { - for (unsigned int j = 0; j < _listeners.size(); j++) { - _listeners[j]->entityRemoved(e); - } + for (unsigned int j = 0; j < _listeners.size(); j++) { + _listeners[j]->entityRemoved(e); + } } Mob* Level::getMob(int entityId) @@ -1065,10 +1065,10 @@ Mob* Level::getMob(int entityId) } void Level::removeEntity(Entity* e) { - e->remove(); + e->remove(); if (e->isPlayer() && e->reallyRemoveIfPlayer) { Util::remove(players, (Player*) e); - } + } } void Level::tileEntityChanged(int x, int y, int z, TileEntity* te) { @@ -1099,16 +1099,16 @@ void Level::tileEntityChanged(int x, int y, int z, TileEntity* te) { Biome::MobSpawnerData Level::getRandomMobSpawnAt(const MobCategory& mobCategory, int x, int y, int z) { Biome::MobList mobList = _chunkSource->getMobsAt(mobCategory, x, y, z); - if (mobList.empty()) return Biome::MobSpawnerData(); + if (mobList.empty()) return Biome::MobSpawnerData(); Biome::MobSpawnerData* data = (Biome::MobSpawnerData*) WeighedRandom::getRandomItem(&random, mobList); if (!data) return Biome::MobSpawnerData(); - return *data; + return *data; } void Level::addListener(LevelListener* listener) { - _listeners.push_back(listener); + _listeners.push_back(listener); } void Level::removeListener(LevelListener* listener) { @@ -1119,76 +1119,86 @@ void Level::removeListener(LevelListener* listener) { std::vector& Level::getCubes(const Entity* source, const AABB& box_) { //@attn: check the AABB* new/delete stuff boxes.clear(); const AABB* box = &box_; - int x0 = Mth::floor(box->x0); - int x1 = Mth::floor(box->x1 + 1); - int y0 = Mth::floor(box->y0); - int y1 = Mth::floor(box->y1 + 1); - int z0 = Mth::floor(box->z0); - int z1 = Mth::floor(box->z1 + 1); + int x0 = Mth::floor(box->x0); + int x1 = Mth::floor(box->x1 + 1); + int y0 = Mth::floor(box->y0); + int y1 = Mth::floor(box->y1 + 1); + int z0 = Mth::floor(box->z0); + int z1 = Mth::floor(box->z1 + 1); - for (int x = x0; x < x1; x++) - for (int z = z0; z < z1; z++) { - if (hasChunkAt(x, Level::DEPTH / 2, z)) { - for (int y = y0 - 1; y < y1; y++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL) { - tile->addAABBs(this, x, y, z, box, boxes); - } - } - } + for (int x = x0; x < x1; x++) + for (int z = z0; z < z1; z++) { + if (hasChunkAt(x, Level::DEPTH / 2, z)) { + for (int y = y0 - 1; y < y1; y++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL) { + tile->addAABBs(this, x, y, z, box, boxes); + } + } + } else { //int breakPoint = 0; } - } - /* - float r = 0.25; - List ee = getEntities(source, box.grow(r, r, r)); - for (int i = 0; i < ee.size(); i++) { - AABB collideBox = ee.get(i).getCollideBox(); - if (collideBox != NULL && collideBox.intersects(box)) { - boxes.add(collideBox); - } + } + /* + float r = 0.25; + List ee = getEntities(source, box.grow(r, r, r)); + for (int i = 0; i < ee.size(); i++) { + AABB collideBox = ee.get(i).getCollideBox(); + if (collideBox != NULL && collideBox.intersects(box)) { + boxes.add(collideBox); + } - collideBox = source.getCollideAgainstBox(ee.get(i)); - if (collideBox != NULL && collideBox.intersects(box)) { - boxes.add(collideBox); - } - } - */ + collideBox = source.getCollideAgainstBox(ee.get(i)); + if (collideBox != NULL && collideBox.intersects(box)) { + boxes.add(collideBox); + } + } + */ - return boxes; + return boxes; } int Level::getSkyDarken(float a) { - float td = getTimeOfDay(a); + float td = getTimeOfDay(a); - float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.5f); - if (br < 0.0f) br = 0.0f; - if (br > 0.80f) br = 0.80f; //@note; was 1.0f - return ((int) (br * 11)); + float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.5f); + if (br < 0.0f) br = 0.0f; + if (br > 0.80f) br = 0.80f; //@note; was 1.0f + return ((int) (br * 11)); } Vec3 Level::getSkyColor(Entity* source, float a) { - float td = getTimeOfDay(a); + float td = getTimeOfDay(a); float br = Mth::cos(td * Mth::PI * 2) * 2 + 0.5f; - if (br < 0.0f) br = 0.0f; - if (br > 0.75f) br = 0.75f; //@note; was 1.0f + if (br < 0.0f) br = 0.0f; + if (br > 0.75f) br = 0.75f; //@note; was 1.0f -// int xx = Mth::floor(source->x); -// int zz = Mth::floor(source->z); -// float temp = 0.5;//(float) getBiomeSource().getTemperature(xx, zz); - int skyColor = 0x3070ff;//getBiomeSource().getBiome(xx, zz).getSkyColor(temp); + int xx = Mth::floor(source->x); + int zz = Mth::floor(source->z); + // float temp = 0.5;//(float) getBiomeSource().getTemperature(xx, zz); // unused in normal pe too, just hardcoded temp values for some reason. + float temp = (float) getBiomeSource()->getTemperature(xx, zz); + int skyColor; + if (dimension->FogType == 1){ // 1 is java styled fog which should use temperatures! + skyColor = getBiomeSource()->getBiome(xx, zz)->getSkyColor(temp); + } + else { // otherwise default to the normal pocket edition skycolor - float r = ((skyColor >> 16) & 0xff) / 255.0f; - float g = ((skyColor >> 8) & 0xff) / 255.0f; - float b = ((skyColor) & 0xff) / 255.0f; - r *= br; - g *= br; - b *= br; + skyColor = 0x3070ff; + } - return Vec3(r, g, b); + // int skyColor = 0x3070ff;//getBiomeSource().getBiome(xx, zz).getSkyColor(temp); // This is the vanilla way, add it as OPTION_SKY - shredder + + float r = ((skyColor >> 16) & 0xff) / 255.0f; + float g = ((skyColor >> 8) & 0xff) / 255.0f; + float b = ((skyColor) & 0xff) / 255.0f; + r *= br; + g *= br; + b *= br; + + return Vec3(r, g, b); } Vec3 Level::getCloudColor( float a ) { @@ -1238,8 +1248,8 @@ float Level::getTimeOfDay(float a) { } float Level::getSunAngle(float a) { - float td = getTimeOfDay(a); - return td * Mth::PI * 2; + float td = getTimeOfDay(a); + return td * Mth::PI * 2; } //Vec3 Level::getCloudColor(float a) { @@ -1261,70 +1271,70 @@ float Level::getSunAngle(float a) { //} Vec3 Level::getFogColor(float a) { - float td = getTimeOfDay(a); - return dimension->getFogColor(td, a); + float td = getTimeOfDay(a); + return dimension->getFogColor(td, a); } int Level::getTopSolidBlock(int x, int z) { - LevelChunk* levelChunk = getChunkAt(x, z); + LevelChunk* levelChunk = getChunkAt(x, z); - int y = Level::DEPTH - 1; + int y = Level::DEPTH - 1; - while (getMaterial(x, y, z)->blocksMotion() && y > 0) { - y--; - } + while (getMaterial(x, y, z)->blocksMotion() && y > 0) { + y--; + } - x &= 15; - z &= 15; + x &= 15; + z &= 15; - while (y > 0) { - int t = levelChunk->getTile(x, y, z); - if (t == 0 /*|| !(Tile::tiles[t]->material->blocksMotion() || Tile::tiles[t]->material->isLiquid())*/ + while (y > 0) { + int t = levelChunk->getTile(x, y, z); + if (t == 0 /*|| !(Tile::tiles[t]->material->blocksMotion() || Tile::tiles[t]->material->isLiquid())*/ || !(Tile::tiles[t]->material->blocksMotion()) || Tile::tiles[t]->material == Material::leaves) { - y--; - } else { - return y + 1; - } - } - return -1; + y--; + } else { + return y + 1; + } + } + return -1; } int Level::getLightDepth(int x, int z) { - return getChunkAt(x, z)->getHeightmap(x & 15, z & 15); + return getChunkAt(x, z)->getHeightmap(x & 15, z & 15); } float Level::getStarBrightness(float a) { - float td = getTimeOfDay(a); + float td = getTimeOfDay(a); - float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.75f); - if (br < 0.f) br = 0; - if (br > 1.f) br = 1; + float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.75f); + if (br < 0.f) br = 0; + if (br > 1.f) br = 1; - return br * br * 0.5f; + return br * br * 0.5f; } void Level::addToTickNextTick(int x, int y, int z, int tileId, int tickDelay) { TickNextTickData td(x, y, z, tileId); - int r = 8; - if (instaTick) { - if (hasChunksAt(td.x - r, td.y - r, td.z - r, td.x + r, td.y + r, td.z + r)) { - int id = getTile(td.x, td.y, td.z); - if (id == td.tileId && id > 0) { - Tile::tiles[id]->tick(this, td.x, td.y, td.z, &random); - } - } - return; - } + int r = 8; + if (instaTick) { + if (hasChunksAt(td.x - r, td.y - r, td.z - r, td.x + r, td.y + r, td.z + r)) { + int id = getTile(td.x, td.y, td.z); + if (id == td.tileId && id > 0) { + Tile::tiles[id]->tick(this, td.x, td.y, td.z, &random); + } + } + return; + } - if (hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r)) { - if (tileId > 0) { - td.setDelay(tickDelay + levelData.getTime()); - } + if (hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r)) { + if (tileId > 0) { + td.setDelay(tickDelay + levelData.getTime()); + } if (_tickNextTickSet.find(td) == _tickNextTickSet.end()) { _tickNextTickSet.insert(td); - } - } + } + } } void Level::tickEntities() { @@ -1332,52 +1342,52 @@ void Level::tickEntities() { TIMER_PUSH("remove"); //Util::removeAll(entities, _entitiesToRemove); - // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { - // Entity* e = _entitiesToRemove[j]; - // int xc = e->xChunk; - // int zc = e->zChunk; - // if (e->inChunk && hasChunk(xc, zc)) { - // getChunk(xc, zc)->removeEntity(e); - // } - // } - // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { - // entityRemoved(_entitiesToRemove[j]); + // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { + // Entity* e = _entitiesToRemove[j]; + // int xc = e->xChunk; + // int zc = e->zChunk; + // if (e->inChunk && hasChunk(xc, zc)) { + // getChunk(xc, zc)->removeEntity(e); + // } + // } + // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { + // entityRemoved(_entitiesToRemove[j]); // //LOGI("a1 &e@delt: %p", _entitiesToRemove[j]); // delete _entitiesToRemove[j]; // //LOGI("a2"); - // } - // _entitiesToRemove.clear(); + // } + // _entitiesToRemove.clear(); EntityList pendingRemovedEntities; std::vector zombies; TIMER_POP_PUSH("regular"); - for (unsigned int i = 0; i < entities.size(); i++) { - Entity* e = entities[i]; + for (unsigned int i = 0; i < entities.size(); i++) { + Entity* e = entities[i]; - if (!e->removed) { - tick(e); + if (!e->removed) { + tick(e); if (e->getEntityTypeId() == MobTypes::Zombie) { zombies.push_back((Zombie*)e); ((Zombie*)e)->setUseNewAi(false); // @note: this is set under } - } + } TIMER_PUSH("remove"); - if (e->removed && (!e->isPlayer() || e->reallyRemoveIfPlayer)) { - int xc = e->xChunk; - int zc = e->zChunk; - if (e->inChunk && hasChunk(xc, zc)) { - getChunk(xc, zc)->removeEntity(e); - } + if (e->removed && (!e->isPlayer() || e->reallyRemoveIfPlayer)) { + int xc = e->xChunk; + int zc = e->zChunk; + if (e->inChunk && hasChunk(xc, zc)) { + getChunk(xc, zc)->removeEntity(e); + } entityIdLookup.erase(e->entityId); entities.erase(entities.begin() + (i--)); - entityRemoved(e); + entityRemoved(e); pendingRemovedEntities.push_back(e); - } + } TIMER_POP(); - } - + } + TIMER_POP_PUSH("remove"); for (unsigned int i = 0; i < pendingRemovedEntities.size(); ++i) { Entity* e = pendingRemovedEntities[i]; @@ -1498,51 +1508,51 @@ void Level::setZombieAi(std::vector& zombies) { } void Level::tick(Entity* e) { - tick(e, true); + tick(e, true); } void Level::tick(Entity* e, bool actual) { - int xc = Mth::floor(e->x); - int zc = Mth::floor(e->z); - int r = 32; - if (actual && !hasChunksAt(xc - r, 0, zc - r, xc + r, 128, zc + r)) { - return; - } + int xc = Mth::floor(e->x); + int zc = Mth::floor(e->z); + int r = 32; + if (actual && !hasChunksAt(xc - r, 0, zc - r, xc + r, 128, zc + r)) { + return; + } - e->xOld = e->x; - e->yOld = e->y; - e->zOld = e->z; - e->yRotO = e->yRot; - e->xRotO = e->xRot; + e->xOld = e->x; + e->yOld = e->y; + e->zOld = e->z; + e->yRotO = e->yRot; + e->xRotO = e->xRot; - if (actual && e->inChunk) { - e->tick(); - } + if (actual && e->inChunk) { + e->tick(); + } TIMER_PUSH("chunkCheck"); - // SANITY!! + // SANITY!! if (e->x != e->x) e->x = e->xOld; // @note: checking for NaN, not sure about Infinite if (e->y != e->y) e->y = e->yOld; if (e->z != e->z) e->z = e->zOld; if (e->xRot != e->xRot) e->xRot = e->xRotO; if (e->yRot != e->yRot) e->yRot = e->yRotO; - int xcn = Mth::floor(e->x / 16.0f); - int ycn = Mth::floor(e->y / 16.0f); - int zcn = Mth::floor(e->z / 16.0f); + int xcn = Mth::floor(e->x / 16.0f); + int ycn = Mth::floor(e->y / 16.0f); + int zcn = Mth::floor(e->z / 16.0f); - if (!e->inChunk || (e->xChunk != xcn || e->yChunk != ycn || e->zChunk != zcn)) { - if (e->inChunk && hasChunk(e->xChunk, e->zChunk)) { - getChunk(e->xChunk, e->zChunk)->removeEntity(e, e->yChunk); - } + if (!e->inChunk || (e->xChunk != xcn || e->yChunk != ycn || e->zChunk != zcn)) { + if (e->inChunk && hasChunk(e->xChunk, e->zChunk)) { + getChunk(e->xChunk, e->zChunk)->removeEntity(e, e->yChunk); + } - if (hasChunk(xcn, zcn)) { - e->inChunk = true; - getChunk(xcn, zcn)->addEntity(e); - } else { - e->inChunk = false; - } - } + if (hasChunk(xcn, zcn)) { + e->inChunk = true; + getChunk(xcn, zcn)->addEntity(e); + } else { + e->inChunk = false; + } + } TIMER_POP(); // Save player info every n:th second @@ -1554,109 +1564,109 @@ void Level::tick(Entity* e, bool actual) { } bool Level::isUnobstructed(const AABB& aabb) { - EntityList& entities = getEntities(NULL, aabb); - for (unsigned int i = 0; i < entities.size(); i++) { - Entity* e = entities[i]; - if (!e->removed && e->blocksBuilding) return false; - } - return true; + EntityList& entities = getEntities(NULL, aabb); + for (unsigned int i = 0; i < entities.size(); i++) { + Entity* e = entities[i]; + if (!e->removed && e->blocksBuilding) return false; + } + return true; } bool Level::containsAnyLiquid(const AABB& box) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - if (box.x0 < 0) x0--; - if (box.y0 < 0) y0--; - if (box.z0 < 0) z0--; + if (box.x0 < 0) x0--; + if (box.y0 < 0) y0--; + if (box.z0 < 0) z0--; - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material->isLiquid()) { - return true; - } - } - return false; + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material->isLiquid()) { + return true; + } + } + return false; } bool Level::containsFireTile(const AABB& box) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - if (hasChunksAt(x0, y0, z0, x1, y1, z1)) { - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - int t = getTile(x, y, z); + if (hasChunksAt(x0, y0, z0, x1, y1, z1)) { + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + int t = getTile(x, y, z); - if (t == ((Tile*)(Tile::fire))->id - || t == Tile::lava->id - || t == Tile::calmLava->id) { - return true; + if (t == ((Tile*)(Tile::fire))->id + || t == Tile::lava->id + || t == Tile::calmLava->id) { + return true; } - } - } - return false; + } + } + return false; } bool Level::containsMaterial(const AABB& box, const Material* material) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material == material) { - return true; - } - } - return false; + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material == material) { + return true; + } + } + return false; } bool Level::containsLiquid(const AABB& box, const Material* material) { - int x0 = Mth::floor(box.x0); - int x1 = Mth::floor(box.x1 + 1); - int y0 = Mth::floor(box.y0); - int y1 = Mth::floor(box.y1 + 1); - int z0 = Mth::floor(box.z0); - int z1 = Mth::floor(box.z1 + 1); + int x0 = Mth::floor(box.x0); + int x1 = Mth::floor(box.x1 + 1); + int y0 = Mth::floor(box.y0); + int y1 = Mth::floor(box.y1 + 1); + int z0 = Mth::floor(box.z0); + int z1 = Mth::floor(box.z1 + 1); - for (int x = x0; x < x1; x++) - for (int y = y0; y < y1; y++) - for (int z = z0; z < z1; z++) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile != NULL && tile->material == material) { - int data = getData(x, y, z); - float yh1 = (float)(y + 1); - if (data < 8) { - yh1 = (float)y + 1.0f - (float)data / 8.0f; - } - if (yh1 >= box.y0) { - return true; - } - } - } - return false; + for (int x = x0; x < x1; x++) + for (int y = y0; y < y1; y++) + for (int z = z0; z < z1; z++) { + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile != NULL && tile->material == material) { + int data = getData(x, y, z); + float yh1 = (float)(y + 1); + if (data < 8) { + yh1 = (float)y + 1.0f - (float)data / 8.0f; + } + if (yh1 >= box.y0) { + return true; + } + } + } + return false; } /* in java, this returns an Explosion */ void Level::explode(Entity* source, float x, float y, float z, float r) { - explode(source, x, y, z, r, false); + explode(source, x, y, z, r, false); } /* in java, this returns an Explosion */ @@ -1672,29 +1682,29 @@ void Level::explode(Entity* source, float x, float y, float z, float r, bool fir } float Level::getSeenPercent(const Vec3& center, const AABB& bb) { - float xs = 1.0f / ((bb.x1 - bb.x0) * 2 + 1); - float ys = 1.0f / ((bb.y1 - bb.y0) * 2 + 1); - float zs = 1.0f / ((bb.z1 - bb.z0) * 2 + 1); - int hits = 0; - int count = 0; - for (float xx = 0; xx <= 1; xx += xs) - for (float yy = 0; yy <= 1; yy += ys) - for (float zz = 0; zz <= 1; zz += zs) { - float x = bb.x0 + (bb.x1 - bb.x0) * xx; - float y = bb.y0 + (bb.y1 - bb.y0) * yy; - float z = bb.z0 + (bb.z1 - bb.z0) * zz; + float xs = 1.0f / ((bb.x1 - bb.x0) * 2 + 1); + float ys = 1.0f / ((bb.y1 - bb.y0) * 2 + 1); + float zs = 1.0f / ((bb.z1 - bb.z0) * 2 + 1); + int hits = 0; + int count = 0; + for (float xx = 0; xx <= 1; xx += xs) + for (float yy = 0; yy <= 1; yy += ys) + for (float zz = 0; zz <= 1; zz += zs) { + float x = bb.x0 + (bb.x1 - bb.x0) * xx; + float y = bb.y0 + (bb.y1 - bb.y0) * yy; + float z = bb.z0 + (bb.z1 - bb.z0) * zz; if (!clip(Vec3(x, y, z), center).isHit()) hits++; - count++; - } + count++; + } - return hits / (float) count; + return hits / (float) count; } bool Level::isSolidBlockingTile(int x, int y, int z) { - Tile* tile = Tile::tiles[getTile(x, y, z)]; - if (tile == NULL) return false; - return tile->material->isSolidBlocking() && tile->isCubeShaped(); + Tile* tile = Tile::tiles[getTile(x, y, z)]; + if (tile == NULL) return false; + return tile->material->isSolidBlocking() && tile->isCubeShaped(); } bool Level::isSolidRenderTile(int x, int y, int z) { @@ -1705,18 +1715,18 @@ bool Level::isSolidRenderTile(int x, int y, int z) { void Level::extinguishFire(int x, int y, int z, int face) { switch (face) { - case Facing::DOWN : y--; break; - case Facing::UP : y++; break; - case Facing::NORTH: z--; break; - case Facing::SOUTH: z++; break; - case Facing::WEST : x--; break; - case Facing::EAST : x++; break; + case Facing::DOWN : y--; break; + case Facing::UP : y++; break; + case Facing::NORTH: z--; break; + case Facing::SOUTH: z++; break; + case Facing::WEST : x--; break; + case Facing::EAST : x++; break; } - if (getTile(x, y, z) == ((Tile*)Tile::fire)->id) { - //playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.fizz", 0.5f, 2.6f + (random.nextFloat() - random.nextFloat()) * 0.8f); - setTile(x, y, z, 0); - } + if (getTile(x, y, z) == ((Tile*)Tile::fire)->id) { + //playSound(x + 0.5f, y + 0.5f, z + 0.5f, "random.fizz", 0.5f, 2.6f + (random.nextFloat() - random.nextFloat()) * 0.8f); + setTile(x, y, z, 0); + } } // String gatherStats() { // return "All: " + this.entities.size(); @@ -1783,37 +1793,37 @@ void Level::removeTileEntity(int x, int y, int z) { // int Level::getLightsToUpdate() { - return _lightUpdates.size(); + return _lightUpdates.size(); } bool Level::updateLights() { - if (_maxRecurse >= 50) { - return false; - } + if (_maxRecurse >= 50) { + return false; + } //static int _MaxSize = 0; - _maxRecurse++; - //try { - int max = 500; - while ((int)_lightUpdates.size() > 0) { - if (--max <= 0) - { - _maxRecurse--; - return true; - } - LightUpdate l = _lightUpdates.back(); - _lightUpdates.pop_back(); - l.update(this); - //if ((int)_lightUpdates.size() > _MaxSize) - //{ - // LOGI("MAX_updsize_light: %d (%d)\n", _lightUpdates.size(), _MaxSize); - // _MaxSize = _lightUpdates.size(); - //} - } - _maxRecurse--; - return false; - //} finally { - //maxRecurse--; - //} + _maxRecurse++; + //try { + int max = 500; + while ((int)_lightUpdates.size() > 0) { + if (--max <= 0) + { + _maxRecurse--; + return true; + } + LightUpdate l = _lightUpdates.back(); + _lightUpdates.pop_back(); + l.update(this); + //if ((int)_lightUpdates.size() > _MaxSize) + //{ + // LOGI("MAX_updsize_light: %d (%d)\n", _lightUpdates.size(), _MaxSize); + // _MaxSize = _lightUpdates.size(); + //} + } + _maxRecurse--; + return false; + //} finally { + //maxRecurse--; + //} } void Level::setUpdateLights(bool doUpdate) { @@ -1821,96 +1831,96 @@ void Level::setUpdateLights(bool doUpdate) { } void Level::updateLight(const LightLayer& layer, int x0, int y0, int z0, int x1, int y1, int z1) { - updateLight(layer, x0, y0, z0, x1, y1, z1, true); + updateLight(layer, x0, y0, z0, x1, y1, z1, true); } static int maxLoop = 0; void Level::updateLight(const LightLayer& layer, int x0, int y0, int z0, int x1, int y1, int z1, bool join) { - if ((dimension->hasCeiling && &layer == &LightLayer::Sky) || !_updateLights) return; + if ((dimension->hasCeiling && &layer == &LightLayer::Sky) || !_updateLights) return; - maxLoop++; + maxLoop++; //if (x0 < -5 || z0 < -5) LOGI("x, z: %d, %d\n", x0, z0); - if (maxLoop == 50) { - maxLoop--; - return; - } - int xm = (x1 + x0) / 2; - int zm = (z1 + z0) / 2; - if (!hasChunkAt(xm, Level::DEPTH / 2, zm)) { - maxLoop--; - return; - } - if (getChunkAt(xm, zm)->isEmpty()) + if (maxLoop == 50) { + maxLoop--; + return; + } + int xm = (x1 + x0) / 2; + int zm = (z1 + z0) / 2; + if (!hasChunkAt(xm, Level::DEPTH / 2, zm)) { + maxLoop--; + return; + } + if (getChunkAt(xm, zm)->isEmpty()) { maxLoop--; return; } - int count = _lightUpdates.size(); - if (join) { - int toCheck = 5; - if (toCheck > count) toCheck = count; - for (int i = 0; i < toCheck; i++) { - LightUpdate& last = _lightUpdates[_lightUpdates.size() - i - 1]; - if (last.layer == &layer && last.expandToContain(x0, y0, z0, x1, y1, z1)) { - maxLoop--; - return; - } - } - } - _lightUpdates.push_back(LightUpdate(layer, x0, y0, z0, x1, y1, z1)); - int max = 1000000; - if ((int)_lightUpdates.size() > max) { - LOGI("More than %d updates, aborting lighting updates\n", max); - _lightUpdates.clear(); - } - maxLoop--; + int count = _lightUpdates.size(); + if (join) { + int toCheck = 5; + if (toCheck > count) toCheck = count; + for (int i = 0; i < toCheck; i++) { + LightUpdate& last = _lightUpdates[_lightUpdates.size() - i - 1]; + if (last.layer == &layer && last.expandToContain(x0, y0, z0, x1, y1, z1)) { + maxLoop--; + return; + } + } + } + _lightUpdates.push_back(LightUpdate(layer, x0, y0, z0, x1, y1, z1)); + int max = 1000000; + if ((int)_lightUpdates.size() > max) { + LOGI("More than %d updates, aborting lighting updates\n", max); + _lightUpdates.clear(); + } + maxLoop--; } // // // int xxo, yyo, zzo; // bool Level::updateSkyBrightness() { - int newDark = this->getSkyDarken(1); - if (newDark != skyDarken) { - skyDarken = newDark; + int newDark = this->getSkyDarken(1); + if (newDark != skyDarken) { + skyDarken = newDark; return true; - } + } return false; } void Level::setSpawnSettings(bool spawnEnemies, bool spawnFriendlies) { - //this->spawnEnemies = spawnEnemies; - //this->spawnFriendlies = spawnFriendlies; + //this->spawnEnemies = spawnEnemies; + //this->spawnFriendlies = spawnFriendlies; } void Level::animateTick(int xt, int yt, int zt) { - int r = 16; - Random animateRandom; + int r = 16; + Random animateRandom; - for (int i = 0; i < 100; i++) { - int x = xt + random.nextInt(r) - random.nextInt(r); - int y = yt + random.nextInt(r) - random.nextInt(r); - int z = zt + random.nextInt(r) - random.nextInt(r); - int t = getTile(x, y, z); - if (t > 0) { - Tile::tiles[t]->animateTick(this, x, y, z, &animateRandom); - } - } + for (int i = 0; i < 100; i++) { + int x = xt + random.nextInt(r) - random.nextInt(r); + int y = yt + random.nextInt(r) - random.nextInt(r); + int z = zt + random.nextInt(r) - random.nextInt(r); + int t = getTile(x, y, z); + if (t > 0) { + Tile::tiles[t]->animateTick(this, x, y, z, &animateRandom); + } + } } EntityList& Level::getEntities(Entity* except, const AABB& bb) { - _es.clear(); - int xc0 = Mth::floor((bb.x0 - 2) / 16); - int xc1 = Mth::floor((bb.x1 + 2) / 16); - int zc0 = Mth::floor((bb.z0 - 2) / 16); - int zc1 = Mth::floor((bb.z1 + 2) / 16); - for (int xc = xc0; xc <= xc1; xc++) - for (int zc = zc0; zc <= zc1; zc++) { - if (hasChunk(xc, zc)) { - getChunk(xc, zc)->getEntities(except, bb, _es); - } - } - return _es; + _es.clear(); + int xc0 = Mth::floor((bb.x0 - 2) / 16); + int xc1 = Mth::floor((bb.x1 + 2) / 16); + int zc0 = Mth::floor((bb.z0 - 2) / 16); + int zc1 = Mth::floor((bb.z1 + 2) / 16); + for (int xc = xc0; xc <= xc1; xc++) + for (int zc = zc0; zc <= zc1; zc++) { + if (hasChunk(xc, zc)) { + getChunk(xc, zc)->getEntities(except, bb, _es); + } + } + return _es; } // List getEntitiesOfClass(Class baseClass, AABB bb) { @@ -1929,7 +1939,7 @@ EntityList& Level::getEntities(Entity* except, const AABB& bb) { // } const EntityList& Level::getAllEntities() { - return entities; + return entities; } // int countInstanceOf(Class clas) { @@ -1943,10 +1953,10 @@ const EntityList& Level::getAllEntities() { // /* void Level::addEntities(const EntityList& list) { - entities.insert(entities.end(), list.begin(), list.end()); - for (int j = 0; j < (int)list.size(); j++) { - entityAdded(list[j]); - } +entities.insert(entities.end(), list.begin(), list.end()); +for (int j = 0; j < (int)list.size(); j++) { +entityAdded(list[j]); +} } */ @@ -1955,65 +1965,65 @@ void Level::addEntities(const EntityList& list) { //} void Level::prepare() { - while (_chunkSource->tick()) - ; + while (_chunkSource->tick()) + ; } bool Level::mayPlace(int tileId, int x, int y, int z, bool ignoreEntities,unsigned char face) { - int targetType = getTile(x, y, z); - const Tile* targetTile = Tile::tiles[targetType]; - Tile* tile = Tile::tiles[tileId]; + int targetType = getTile(x, y, z); + const Tile* targetTile = Tile::tiles[targetType]; + Tile* tile = Tile::tiles[tileId]; - AABB* aabb = tile->getAABB(this, x, y, z); - if (ignoreEntities) aabb = NULL; - if (aabb != NULL && !isUnobstructed(*aabb)) return false; - if (targetTile == Tile::water || targetTile == Tile::calmWater || targetTile == Tile::lava || targetTile == Tile::calmLava || targetTile == (Tile*)(Tile::fire) || targetTile == Tile::topSnow) targetTile = NULL; - if (tileId > 0 && targetTile == NULL) { - if (tile->mayPlace(this, x, y, z, face)) { - return true; - } - } + AABB* aabb = tile->getAABB(this, x, y, z); + if (ignoreEntities) aabb = NULL; + if (aabb != NULL && !isUnobstructed(*aabb)) return false; + if (targetTile == Tile::water || targetTile == Tile::calmWater || targetTile == Tile::lava || targetTile == Tile::calmLava || targetTile == (Tile*)(Tile::fire) || targetTile == Tile::topSnow) targetTile = NULL; + if (tileId > 0 && targetTile == NULL) { + if (tile->mayPlace(this, x, y, z, face)) { + return true; + } + } - return false; + return false; } int Level::getSeaLevel() { - return SEA_LEVEL; + return SEA_LEVEL; } bool Level::getDirectSignal(int x, int y, int z, int dir) { - int t = getTile(x, y, z); - if (t == 0) return false; - return Tile::tiles[t]->getDirectSignal(this, x, y, z, dir); + int t = getTile(x, y, z); + if (t == 0) return false; + return Tile::tiles[t]->getDirectSignal(this, x, y, z, dir); } bool Level::hasDirectSignal(int x, int y, int z) { - if (getDirectSignal(x, y - 1, z, 0)) return true; - if (getDirectSignal(x, y + 1, z, 1)) return true; - if (getDirectSignal(x, y, z - 1, 2)) return true; - if (getDirectSignal(x, y, z + 1, 3)) return true; - if (getDirectSignal(x - 1, y, z, 4)) return true; - if (getDirectSignal(x + 1, y, z, 5)) return true; - return false; + if (getDirectSignal(x, y - 1, z, 0)) return true; + if (getDirectSignal(x, y + 1, z, 1)) return true; + if (getDirectSignal(x, y, z - 1, 2)) return true; + if (getDirectSignal(x, y, z + 1, 3)) return true; + if (getDirectSignal(x - 1, y, z, 4)) return true; + if (getDirectSignal(x + 1, y, z, 5)) return true; + return false; } bool Level::getSignal(int x, int y, int z, int dir) { - if (isSolidBlockingTile(x, y, z)) { - return hasDirectSignal(x, y, z); - } - int t = getTile(x, y, z); - if (t == 0) return false; - return Tile::tiles[t]->getSignal(this, x, y, z, dir); + if (isSolidBlockingTile(x, y, z)) { + return hasDirectSignal(x, y, z); + } + int t = getTile(x, y, z); + if (t == 0) return false; + return Tile::tiles[t]->getSignal(this, x, y, z, dir); } bool Level::hasNeighborSignal(int x, int y, int z) { - if (getSignal(x, y - 1, z, 0)) return true; - if (getSignal(x, y + 1, z, 1)) return true; - if (getSignal(x, y, z - 1, 2)) return true; - if (getSignal(x, y, z + 1, 3)) return true; - if (getSignal(x - 1, y, z, 4)) return true; - if (getSignal(x + 1, y, z, 5)) return true; - return false; + if (getSignal(x, y - 1, z, 0)) return true; + if (getSignal(x, y + 1, z, 1)) return true; + if (getSignal(x, y, z - 1, 2)) return true; + if (getSignal(x, y, z + 1, 3)) return true; + if (getSignal(x - 1, y, z, 4)) return true; + if (getSignal(x + 1, y, z, 5)) return true; + return false; } // void checkSession() { @@ -2021,44 +2031,44 @@ bool Level::hasNeighborSignal(int x, int y, int z) { // } // void Level::setTime(long time) { - this->levelData.setTime(time); + this->levelData.setTime(time); } long Level::getSeed() { - return levelData.getSeed(); + return levelData.getSeed(); } long Level::getTime() { - return levelData.getTime(); + return levelData.getTime(); } Pos Level::getSharedSpawnPos() { - return Pos(levelData.getXSpawn(), levelData.getYSpawn(), levelData.getZSpawn()); + return Pos(levelData.getXSpawn(), levelData.getYSpawn(), levelData.getZSpawn()); } void Level::setSpawnPos(Pos spawnPos) { - levelData.setSpawn(spawnPos.x, spawnPos.y, spawnPos.z); + levelData.setSpawn(spawnPos.x, spawnPos.y, spawnPos.z); } /* void Level::ensureAdded(Entity* entity) { - int xc = Mth::floor(entity->x / 16); - int zc = Mth::floor(entity->z / 16); - int r = 2; - for (int x = xc - r; x <= xc + r; x++) { - for (int z = zc - r; z <= zc + r; z++) { - this->getChunk(x, z); - } - } +int xc = Mth::floor(entity->x / 16); +int zc = Mth::floor(entity->z / 16); +int r = 2; +for (int x = xc - r; x <= xc + r; x++) { +for (int z = zc - r; z <= zc + r; z++) { +this->getChunk(x, z); +} +} - if (std::find(entities.begin(), entities.end(), entity) == entities.end()) { - entities.push_back(entity); - } +if (std::find(entities.begin(), entities.end(), entity) == entities.end()) { +entities.push_back(entity); +} } */ bool Level::mayInteract(Player* player, int xt, int yt, int zt) { - return true; + return true; } void Level::broadcastEntityEvent(Entity* e, char eventId) { @@ -2070,40 +2080,40 @@ void Level::broadcastEntityEvent(Entity* e, char eventId) { /* void Level::removeAllPendingEntityRemovals() { - //Util::removeAll(entities, _entitiesToRemove); - // //entities.removeAll(entitiesToRemove); - // for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { - // Entity* e = _entitiesToRemove[j]; - // int xc = e->xChunk; - // int zc = e->zChunk; - // if (e->inChunk && hasChunk(xc, zc)) { - // getChunk(xc, zc)->removeEntity(e); - // } - // } +//Util::removeAll(entities, _entitiesToRemove); +// //entities.removeAll(entitiesToRemove); +// for (int j = 0; j < (int)_entitiesToRemove.size(); j++) { +// Entity* e = _entitiesToRemove[j]; +// int xc = e->xChunk; +// int zc = e->zChunk; +// if (e->inChunk && hasChunk(xc, zc)) { +// getChunk(xc, zc)->removeEntity(e); +// } +// } - // for (unsigned int j = 0; j < _entitiesToRemove.size(); j++) { - // entityRemoved(_entitiesToRemove[j]); - // } - // _entitiesToRemove.clear(); +// for (unsigned int j = 0; j < _entitiesToRemove.size(); j++) { +// entityRemoved(_entitiesToRemove[j]); +// } +// _entitiesToRemove.clear(); - for (unsigned int i = 0; i < entities.size(); i++) { - Entity* e = entities[i]; +for (unsigned int i = 0; i < entities.size(); i++) { +Entity* e = entities[i]; - if (e->removed) { - int xc = e->xChunk; - int zc = e->zChunk; - if (e->inChunk && hasChunk(xc, zc)) { - getChunk(xc, zc)->removeEntity(e); - } - entities.erase( entities.begin() + (i--) ); - entityRemoved(e); - } - } +if (e->removed) { +int xc = e->xChunk; +int zc = e->zChunk; +if (e->inChunk && hasChunk(xc, zc)) { +getChunk(xc, zc)->removeEntity(e); +} +entities.erase( entities.begin() + (i--) ); +entityRemoved(e); +} +} } */ ChunkSource* Level::getChunkSource() { - return _chunkSource; + return _chunkSource; } // void tileEvent(int x, int y, int z, int b0, int b1) { @@ -2112,11 +2122,11 @@ ChunkSource* Level::getChunkSource() { // } LevelStorage* Level::getLevelStorage() { - return levelStorage; + return levelStorage; } LevelData* Level::getLevelData() { - return &levelData; + return &levelData; } void Level::takePicture( TripodCamera* cam, Entity* e ) @@ -2138,7 +2148,7 @@ int Level::getEntitiesOfType( int entityType, const AABB& bb, EntityList& list ) getChunk(xc, zc)->getEntitiesOfType(entityType, bb, list); } } - return list.size() - count; + return list.size() - count; } int Level::getEntitiesOfClass( int type, const AABB& bb, EntityList& list ) { @@ -2208,9 +2218,9 @@ void Level::updateSkyDarken() void Level::removePlayer( Player* player ) { for (unsigned int i = 0; i < players.size(); ++i) - if (players[i] == player) { - players.erase( players.begin() + i ); - } + if (players[i] == player) { + players.erase( players.begin() + i ); + } } int Level::isNightMode() { @@ -2231,7 +2241,7 @@ bool Level::inRange( int x, int y, int z ) { // AdventureSettings // AdventureSettings::AdventureSettings() -: doTickTime(true), + : doTickTime(true), noPvP(false), noPvM(false), noMvP(false), diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index 609ed52..f97cab8 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -8,6 +8,8 @@ #include "../../entity/MobCategory.h" #include "../../level/tile/TallGrass.h" +#include "../../../util/Color.h" + Biome* Biome::rainForest = NULL; Biome* Biome::swampland = NULL; Biome* Biome::seasonalForest = NULL; @@ -208,11 +210,11 @@ float Biome::adjustDepth( float depth ) int Biome::getSkyColor( float temp ) { -// temp /= 3.f; -// if (temp < -1) temp = -1; -// if (temp > 1) temp = 1; - return 0x80808080; - //return Color.getHSBColor(224 / 360.0f - temp * 0.05f, 0.50f + temp * 0.1f, 1.0f).getRGB(); + temp /= 3.f; + if (temp < -1) temp = -1; + if (temp > 1) temp = 1; +// return 0x80808080;This is the vanilla way, add it as OPTION_SKY or leave it like this bcus this function literally never gets used anyways if level has vanilla sky color - shredder + return Color::getHSBColor(224 / 360.0f - temp * 0.05f, 0.50f + temp * 0.1f, 1.0f).getRGB(); } Biome::MobList& Biome::getMobs(const MobCategory& category) diff --git a/src/world/level/chunk/LevelChunk.cpp b/src/world/level/chunk/LevelChunk.cpp index bb373fb..ef13d1b 100755 --- a/src/world/level/chunk/LevelChunk.cpp +++ b/src/world/level/chunk/LevelChunk.cpp @@ -262,14 +262,14 @@ void LevelChunk::recalcHeight(int x, int yStart, int z) { /*public*/ void LevelChunk::skyBrightnessChanged() { -// int x0 = xt; -// int y0 = this->minHeight - 16; -// int z0 = zt; -// int x1 = xt + 16; -// int y1 = Level::DEPTH - 1; -// int z1 = zt + 16; + int x0 = xt; + int y0 = this->minHeight - 16; + int z0 = zt; + int x1 = xt + 16; + int y1 = Level::DEPTH - 1; + int z1 = zt + 16; - //level->setTilesDirty(x0, y0, z0, x1, y1, z1); + level->setTilesDirty(x0, y0, z0, x1, y1, z1); } /*public*/ diff --git a/src/world/level/dimension/Dimension.cpp b/src/world/level/dimension/Dimension.cpp index 1345c07..c565409 100755 --- a/src/world/level/dimension/Dimension.cpp +++ b/src/world/level/dimension/Dimension.cpp @@ -15,7 +15,8 @@ Dimension::Dimension() ultraWarm(false), hasCeiling(false), biomeSource(NULL), - id(0) + id(0), + fogColor(0x80daff) { } @@ -93,6 +94,18 @@ float* Dimension::getSunriseColor( float td, float a ) Vec3 Dimension::getFogColor( float td, float a ) { + if (FogType == 1) + { + fogColor = 0xc0d8ff; // 1 returns java beta styled fog color. + } + else if (FogType == 2) + { + fogColor = 0x406fe5; // 2 returns some type of unused fog color IDK what this one was used for possibly early pe?? + } + else // otherwise as default we return the mcpe fog color + { + fogColor = 0x80daff; + } float br = Mth::cos(td * Mth::PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; @@ -104,7 +117,8 @@ Vec3 Dimension::getFogColor( float td, float a ) g *= br * 0.94f + 0.06f; b *= br * 0.91f + 0.09f; return Vec3(r, g, b); - //return Vec3(0.752941f, 0.847059f, 1); + + // } bool Dimension::mayRespawn() diff --git a/src/world/level/dimension/Dimension.h b/src/world/level/dimension/Dimension.h index e77dbe3..b33861c 100755 --- a/src/world/level/dimension/Dimension.h +++ b/src/world/level/dimension/Dimension.h @@ -49,8 +49,11 @@ public: bool hasCeiling; float brightnessRamp[16];//Level::MAX_BRIGHTNESS + 1]; int id; + + // shredder added + int FogType; // lets us choose between what fog we want ig protected: - static const long fogColor = 0x80daff;//0x406fe5;//0xc0d8ff; + long fogColor; //= 0x80daff;//0x406fe5;//0xc0d8ff; float sunriseCol[4]; }; diff --git a/src/world/level/dimension/NormalDayCycleDimension.h b/src/world/level/dimension/NormalDayCycleDimension.h index 8e44a1a..321b10a 100755 --- a/src/world/level/dimension/NormalDayCycleDimension.h +++ b/src/world/level/dimension/NormalDayCycleDimension.h @@ -9,6 +9,7 @@ class NormalDayCycleDimension: public Dimension { public: + float getTimeOfDay(long time, float a) { int dayStep = (int) (time % Level::TICKS_PER_DAY); float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f; @@ -20,6 +21,18 @@ public: } Vec3 getFogColor( float td, float a ) { + if (FogType == 1) + { + fogColor = 0xc0d8ff; // 1 returns java beta styled fog color. + } + else if (FogType == 2) + { + fogColor = 0x406fe5; // 2 returns some type of unused fog color IDK what this one was used for possibly early pe?? + } + else // otherwise as default we return the mcpe fog color + { + fogColor = 0x80daff; + } float br = cos(td * Mth::PI * 2) * 2 + 0.5f; if (br < 0) br = 0; if (br > 1.f) br = 1.f; @@ -35,7 +48,7 @@ public: return Vec3(r, g, b); } - + }; #endif /*NET_MINECRAFT_WORLD_LEVEL_DIMENSION__NormalDayCycleDimension_H__*/ From e272991159e231e71ec2ce8906433d604ce05ca5 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 02:05:23 +0500 Subject: [PATCH 063/189] fileshredder - minor goof up --- project/android/jni/Android.mk | 1 + project/android_java/jni/Android.mk | 1 + src/client/renderer/entity/ItemRenderer.cpp | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 596be52..07772aa 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -146,6 +146,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/util/StringUtils.cpp \ ../../../src/util/PerfTimer.cpp \ ../../../src/util/PerfRenderer.cpp \ +../../../src/util/Color.cpp \ ../../../src/world/Direction.cpp \ ../../../src/world/entity/AgableMob.cpp \ ../../../src/world/entity/Entity.cpp \ diff --git a/project/android_java/jni/Android.mk b/project/android_java/jni/Android.mk index 86856d7..d472e34 100755 --- a/project/android_java/jni/Android.mk +++ b/project/android_java/jni/Android.mk @@ -122,6 +122,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/util/StringUtils.cpp \ ../../../src/util/PerfTimer.cpp \ ../../../src/util/PerfRenderer.cpp \ +../../../src/util/Color.cpp \ ../../../src/world/Direction.cpp \ ../../../src/world/entity/AgableMob.cpp \ ../../../src/world/entity/Entity.cpp \ diff --git a/src/client/renderer/entity/ItemRenderer.cpp b/src/client/renderer/entity/ItemRenderer.cpp index eaf29b4..72ace60 100755 --- a/src/client/renderer/entity/ItemRenderer.cpp +++ b/src/client/renderer/entity/ItemRenderer.cpp @@ -230,7 +230,9 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, const ItemInsta void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, ItemInstance* item, int x, int y){ // this is normally unused in the header but i ported it from java beta - shredder if (item != NULL) { if (item->count > 1) { - std::string countStr = std::to_string(item->count); + char buf[16]; + sprintf(buf, "%d", item->count); + std::string countStr = buf; // glDisable(GL_LIGHTING); // glDisable(GL_DEPTH_TEST); font->drawShadow(countStr, x + 19 - 2 - font->width(countStr), @@ -246,8 +248,8 @@ void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, Item // glDisable(GL_TEXTURE_2D); // auto var8 = ::net::minecraft::client::renderer::Tesselator::instance(); Tesselator& t = Tesselator::instance; - int ca = 255 - cc << 16 | cc << 8; - int cb = (255 - cc) / 4 << 16 | 16128; + int ca = ((255 - cc)<< 16 | (cc << 8)); + int cb = (((255 - cc) / 4) << 16 | 16128); fillRect(t, x + 2, y + 13, 13, 2, 0); fillRect(t, x + 2, y + 13, 12, 1, cb); fillRect(t, x + 2, y + 13, p, 1, ca); From 22375157933ac2d76f36451d43ed6922165fc126 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 02:15:35 +0500 Subject: [PATCH 064/189] fileshredder - linux compile fix --- src/util/Color.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/Color.cpp b/src/util/Color.cpp index 9afaa5c..4cc9fba 100644 --- a/src/util/Color.cpp +++ b/src/util/Color.cpp @@ -48,8 +48,8 @@ Color Color::getHSBColor(float hue, float saturation, float brightness) } else { - float h = (hue - (float)floor(hue)) * 6.0f; - float f = h - (float)floor(h); + float h = (hue - (float)Mth::floor(hue)) * 6.0f; + float f = h - (float)Mth::floor(h); float p = brightness * (1.0f - saturation); float q = brightness * (1.0f - saturation * f); float t = brightness * (1.0f - (saturation * (1.0f - f))); From ef32fcfe088636a30aaffe66c208101d72866624 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 02:26:46 +0500 Subject: [PATCH 065/189] attempt again --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1711d1c..08bb158 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,6 +199,9 @@ file(GLOB SERVER_SOURCES "src/world/level/dimension/Dimension.cpp" + "src/world/level/dimension/FoliageColor.cpp" + "src/world/level/GrassColor.cpp" + "src/world/level/levelgen/*.cpp" "src/world/level/levelgen/feature/Feature.cpp" "src/world/level/levelgen/synth/*.cpp" @@ -258,6 +261,8 @@ file(GLOB CLIENT_SOURCES "src/util/**.cpp" + "src/util/Color.cpp" + "src/world/*.cpp" "src/world/phys/*.cpp" "src/world/entity/*.cpp" From 59ba8bfb7cc324d09e4a756f56c76581157f6b6c Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 6 Apr 2026 10:00:12 +0500 Subject: [PATCH 066/189] my bad should be fixed now --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08bb158..cdd27f0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,7 @@ file(GLOB SERVER_SOURCES "src/util/Mth.cpp" "src/util/PerfTimer.cpp" "src/util/StringUtils.cpp" + "src/util/Color.cpp" "src/world/Direction.cpp" From 72b68389b2e8906d00c34e42e4fff3f175a8a87a Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 17 Mar 2026 02:22:17 -0400 Subject: [PATCH 067/189] Started to port to iOS; fixing compiler errors here and there --- .../minecraftpe.xcodeproj/project.pbxproj | 96 ++++++++++++------- .../minecraftpe/minecraftpe-Info.plist | 2 +- src/AppPlatform_iOS.h | 3 +- src/client/Option.h | 4 +- src/client/renderer/gles.h | 8 +- src/platform/audio/SoundSystemAL.h | 10 +- 6 files changed, 79 insertions(+), 44 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index b4f42b6..29b0f86 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -4527,10 +4527,16 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 0420; + TargetAttributes = { + D5CF9C41144C225000E4244F = { + DevelopmentTeam = PZUVNW8F2U; + ProvisioningStyle = Automatic; + }; + }; }; buildConfigurationList = D5CF9C3C144C225000E4244F /* Build configuration list for PBXProject "minecraftpe" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -5736,24 +5742,26 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = PUBLISH; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; VALIDATE_PRODUCT = YES; }; name = "Ad-Hoc"; @@ -5765,15 +5773,17 @@ GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ""; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = "Ad-Hoc"; @@ -5847,23 +5857,25 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; VALIDATE_PRODUCT = YES; }; name = AppStore; @@ -5876,11 +5888,13 @@ GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = PUBLISH; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", "-DANDROID_PUBLISH", @@ -5888,8 +5902,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "1B194957-98CF-49B7-A0E7-76692B4B722D"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = AppStore; @@ -5923,7 +5936,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -5935,17 +5948,20 @@ "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + VALIDATE_PRODUCT = YES; }; name = Debug; }; @@ -5953,23 +5969,25 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = PUBLISH; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5977,19 +5995,25 @@ D5CF9C6F144C225000E4244F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PZUVNW8F2U; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = Debug; @@ -5997,19 +6021,25 @@ D5CF9C70144C225000E4244F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PZUVNW8F2U; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ""; "GCC_THUMB_SUPPORT[arch=armv7]" = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 14; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = iphoneos6.0; - VALID_ARCHS = "i386 armv6 armv7"; + SDKROOT = iphoneos; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/project/iosproj/minecraftpe/minecraftpe-Info.plist b/project/iosproj/minecraftpe/minecraftpe-Info.plist index 30bd23f..3f1a803 100755 --- a/project/iosproj/minecraftpe/minecraftpe-Info.plist +++ b/project/iosproj/minecraftpe/minecraftpe-Info.plist @@ -37,7 +37,7 @@ CFBundleIdentifier - com.mojang.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/src/AppPlatform_iOS.h b/src/AppPlatform_iOS.h index 55a786d..a2206b6 100755 --- a/src/AppPlatform_iOS.h +++ b/src/AppPlatform_iOS.h @@ -52,11 +52,10 @@ public: virtual StringVector getOptionStrings(); - virtual bool isPowerVR() { return false; } + virtual bool isPowerVR(); virtual bool isSuperFast(); virtual void showKeyboard(); virtual void hideKeyboard(); - virtual void isPowerVR(); private: std::string _basePath; diff --git a/src/client/Option.h b/src/client/Option.h index cc6547a..0b9aed1 100644 --- a/src/client/Option.h +++ b/src/client/Option.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include "Mth.h" /* template struct is_option_type : std::false_type {}; @@ -104,4 +104,4 @@ public: private: std::string m_value; -}; \ No newline at end of file +}; diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index 7b7e4fd..9a74c07 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -14,11 +14,11 @@ #define USE_VBO #define GL_QUADS 0x0007 #if defined(__APPLE__) - #import - #import + #import + #import #elif defined(ANDROID) || defined(__EMSCRIPTEN__) - #include - #include + #import + #import #else #include diff --git a/src/platform/audio/SoundSystemAL.h b/src/platform/audio/SoundSystemAL.h index ca0ac7f..a7c225f 100755 --- a/src/platform/audio/SoundSystemAL.h +++ b/src/platform/audio/SoundSystemAL.h @@ -3,8 +3,14 @@ #include "SoundSystem.h" -#include -#include +// If audio breaks for other platforms, this is probably why. Here, I'm just calling where Apple's OpenAL headers live (they arent in just "AL" +#if defined(__APPLE__) + #include + #include +#else + #include + #include +#endif #include #include From ab5f1772082c94950a8c6e14cf2c7c9216c01b16 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 17 Mar 2026 02:31:41 -0400 Subject: [PATCH 068/189] added needed missing files --- src/client/KeyMapping.h | 21 ++++ src/client/gui/components/OptionsPane.cpp | 63 +++++++++++ src/client/gui/components/OptionsPane.h | 30 +++++ src/client/gui/components/SmallButton.cpp | 24 ++++ src/client/gui/components/SmallButton.h | 23 ++++ src/client/gui/screens/BuyGameScreen.h | 26 +++++ src/client/gui/screens/InvalidLicenseScreen.h | 107 ++++++++++++++++++ 7 files changed, 294 insertions(+) create mode 100644 src/client/KeyMapping.h create mode 100644 src/client/gui/components/OptionsPane.cpp create mode 100644 src/client/gui/components/OptionsPane.h create mode 100644 src/client/gui/components/SmallButton.cpp create mode 100644 src/client/gui/components/SmallButton.h create mode 100644 src/client/gui/screens/BuyGameScreen.h create mode 100644 src/client/gui/screens/InvalidLicenseScreen.h diff --git a/src/client/KeyMapping.h b/src/client/KeyMapping.h new file mode 100644 index 0000000..06740c8 --- /dev/null +++ b/src/client/KeyMapping.h @@ -0,0 +1,21 @@ +#ifndef NET_MINECRAFT_CLIENT__KeyMapping_H__ +#define NET_MINECRAFT_CLIENT__KeyMapping_H__ + +//package net.minecraft.client; +#include + +class KeyMapping +{ +public: + std::string name; + int key; + + KeyMapping() {} + + KeyMapping(const std::string& name_, int key_) + : name(name_), + key(key_) + {} +}; + +#endif /*NET_MINECRAFT_CLIENT__KeyMapping_H__*/ diff --git a/src/client/gui/components/OptionsPane.cpp b/src/client/gui/components/OptionsPane.cpp new file mode 100644 index 0000000..8cc5d70 --- /dev/null +++ b/src/client/gui/components/OptionsPane.cpp @@ -0,0 +1,63 @@ +#include "OptionsPane.h" +#include "OptionsGroup.h" +#include "OptionsItem.h" +#include "ImageButton.h" +#include "Slider.h" +#include "../../Minecraft.h" + +OptionsPane::OptionsPane() { + +} + +void OptionsPane::setupPositions() { + int currentHeight = y + 1; + for(std::vector::iterator it = children.begin(); it != children.end(); ++it ) { + (*it)->width = width; + (*it)->y = currentHeight; + (*it)->x = x; + currentHeight += (*it)->height + 1; + } + height = currentHeight; + super::setupPositions(); +} + +OptionsGroup& OptionsPane::createOptionsGroup( std::string label ) { + OptionsGroup* newGroup = new OptionsGroup(label); + children.push_back(newGroup); + // create and return a new group index + return *newGroup; +} + +void OptionsPane::createToggle( unsigned int group, std::string label, const Options::Option* option ) { + if(group > children.size()) return; + ImageDef def; + def.setSrc(IntRectangle(160, 206, 39, 20)); + def.name = "gui/touchgui.png"; + def.width = 39 * 0.7f; + def.height = 20 * 0.7f; + OptionButton* element = new OptionButton(option); + element->setImageDef(def, true); + OptionsItem* item = new OptionsItem(label, element); + ((OptionsGroup*)children[group])->addChild(item); + setupPositions(); +} + +void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { + if(group > children.size()) return; + Slider* element = new Slider(minecraft, option, progressMin, progressMax); + element->width = 100; + element->height = 20; + OptionsItem* item = new OptionsItem(label, element); + ((OptionsGroup*)children[group])->addChild(item); + setupPositions(); +} + +void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ) { + if(group > children.size()) return; + Slider* element = new Slider(minecraft, option, stepVec); + element->width = 100; + element->height = 20; + OptionsItem* item = new OptionsItem(label, element); + ((OptionsGroup*)children[group])->addChild(item); + setupPositions(); +} \ No newline at end of file diff --git a/src/client/gui/components/OptionsPane.h b/src/client/gui/components/OptionsPane.h new file mode 100644 index 0000000..5eb9652 --- /dev/null +++ b/src/client/gui/components/OptionsPane.h @@ -0,0 +1,30 @@ +#ifndef ITEMPANE_H__ +#define ITEMPANE_H__ + +#include +#include +#include "GuiElementContainer.h" +#include "../../../world/item/ItemInstance.h" +#include "../../../client/Options.h" +class Font; +class Textures; +class NinePatchLayer; +class ItemPane; +class OptionButton; +class Button; +class OptionsGroup; +class Slider; +class Minecraft; +class OptionsPane: public GuiElementContainer +{ + typedef GuiElementContainer super; +public: + OptionsPane(); + OptionsGroup& createOptionsGroup( std::string label ); + void createToggle( unsigned int group, std::string label, const Options::Option* option ); + void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin=1.0f, float progressMax=1.0f ); + void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ); + void setupPositions(); +}; + +#endif /*ITEMPANE_H__*/ diff --git a/src/client/gui/components/SmallButton.cpp b/src/client/gui/components/SmallButton.cpp new file mode 100644 index 0000000..e2ebfaa --- /dev/null +++ b/src/client/gui/components/SmallButton.cpp @@ -0,0 +1,24 @@ +#include "SmallButton.h" + +SmallButton::SmallButton( int id, int x, int y, const std::string& msg ) +: super(id, x, y, 150, 20, msg), + option(NULL) +{ +} + +SmallButton::SmallButton( int id, int x, int y, int width, int height, const std::string& msg ) +: super(id, x, y, width, height, msg), + option(NULL) +{ +} + +SmallButton::SmallButton( int id, int x, int y, Options::Option* item, const std::string& msg ) +: super(id, x, y, 150, 20, msg), + option(item) +{ +} + +Options::Option* SmallButton::getOption() +{ + return option; +} diff --git a/src/client/gui/components/SmallButton.h b/src/client/gui/components/SmallButton.h new file mode 100644 index 0000000..05ae378 --- /dev/null +++ b/src/client/gui/components/SmallButton.h @@ -0,0 +1,23 @@ +#ifndef NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__ +#define NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__ + +//package net.minecraft.client.gui; + +#include +#include "Button.h" +#include "../../Options.h" + +class SmallButton: public Button +{ + typedef Button super; +public: + SmallButton(int id, int x, int y, const std::string& msg); + SmallButton(int id, int x, int y, int width, int height, const std::string& msg); + SmallButton(int id, int x, int y, Options::Option* item, const std::string& msg); + + Options::Option* getOption(); +private: + Options::Option* option; +}; + +#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__*/ diff --git a/src/client/gui/screens/BuyGameScreen.h b/src/client/gui/screens/BuyGameScreen.h new file mode 100644 index 0000000..228cdba --- /dev/null +++ b/src/client/gui/screens/BuyGameScreen.h @@ -0,0 +1,26 @@ +#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__ +#define NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__ + +#include "../Screen.h" +#include "../components/Button.h" + +class BuyGameScreen: public Screen +{ +public: + BuyGameScreen() {} + virtual ~BuyGameScreen() {} + + void init(); + + void render(int xm, int ym, float a); + + void buttonClicked(Button* button) { + //if (button->id == bQuit.id) + } + +private: + //Button bQuit; + //Button bBuyGame; +}; + +#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__*/ diff --git a/src/client/gui/screens/InvalidLicenseScreen.h b/src/client/gui/screens/InvalidLicenseScreen.h new file mode 100644 index 0000000..2801521 --- /dev/null +++ b/src/client/gui/screens/InvalidLicenseScreen.h @@ -0,0 +1,107 @@ +#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__ +#define NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__ + +#include "../Screen.h" +#include "../components/Button.h" +#include "../../Minecraft.h" +#include "../../../LicenseCodes.h" + +class InvalidLicenseScreen: public Screen +{ +public: + InvalidLicenseScreen(int id, bool hasBuyButton) + : _id(id), + _hasBuyButton(hasBuyButton), + _baseY(0), + bOk(0), + bBuy(0) + { + } + + virtual ~InvalidLicenseScreen() { + delete bOk; + delete bBuy; + } + + void init() { + if (minecraft->useTouchscreen()) { + bOk = new Touch::TButton(1, "Ok"); + bBuy = new Touch::TButton(2, "Buy"); + } else { + bOk = new Button(1, "Ok"); + bBuy = new Button(2, "Buy"); + } + + if (_hasBuyButton) + bOk->msg = "Quit"; + + if (!LicenseCodes::isOk(_id)) { + char buf[20] = {0}; + sprintf(buf, "%d", _id); + + desc1 = "License verification failed (error "; + desc1 += buf; + desc1 += ")"; + desc2 = "Try again later."; + hint = "You need to be connected to the internet\n"; + hint += "once while you start the game."; + } + + buttons.push_back(bOk); + tabButtons.push_back(bOk); + + if (_hasBuyButton) { + buttons.push_back(bBuy); + tabButtons.push_back(bBuy); + } + } + + void setupPositions() { + _baseY = height/5 + 6; + //if (_hasBuyButton) + _baseY -= 24; + + bOk->width = bBuy->width = 200; + bOk->x = bBuy->x = (width - bOk->width) / 2; + bBuy->y = _baseY + 84; + bOk->y = bBuy->y + bBuy->height + 4; + + if (!_hasBuyButton) + bOk->y -= 24; + } + + void tick() {} + + //void keyPressed(int eventKey) {} + + void render(int xm, int ym, float a) { + renderDirtBackground(0); + drawCenteredString(minecraft->font, desc1, width/2, _baseY, 0xffffff); + drawCenteredString(minecraft->font, desc2, width/2, _baseY + 24, 0xffffff); + + drawCenteredString(minecraft->font, hint, width/2, _baseY + 60, 0xffffff); + + Screen::render(xm, ym, a); + } + + void buttonClicked(Button* button) { + if (button->id == bOk->id) { + minecraft->quit(); + } + if (button->id == bBuy->id) { + minecraft->platform()->buyGame(); + } + }; +private: + int _id; + std::string desc1; + std::string desc2; + std::string hint; + + Button* bOk; + Button* bBuy; + bool _hasBuyButton; + int _baseY; +}; + +#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__*/ From b658132dac9d7e228f86eb89010180abe9b362cd Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 17 Mar 2026 02:48:31 -0400 Subject: [PATCH 069/189] fix missing file, commiting now because what im about to do might break Option class --- .../iosproj/minecraftpe.xcodeproj/project.pbxproj | 14 +++++++++----- src/client/gui/screens/UsernameScreen.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 29b0f86..64c2c75 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1211,7 +1211,7 @@ 042A91A916B17517007ABBC6 /* OptionsPane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsPane.cpp; sourceTree = ""; }; 042A91AA16B17517007ABBC6 /* OptionsPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsPane.h; sourceTree = ""; }; 042A91AB16B17517007ABBC6 /* TextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBox.cpp; sourceTree = ""; }; - 042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextBox.h; sourceTree = ""; }; + 042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextBox.h; path = ../../src/client/gui/components/TextBox.h; sourceTree = SOURCE_ROOT; }; 044129061682FF9600B70EE6 /* MouseHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseHandler.cpp; sourceTree = ""; }; 9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CreateNewWorld_iphone.xib; path = minecraftpe/dialogs/CreateNewWorld_iphone.xib; sourceTree = ""; }; 9D293CEA160720D6000305C8 /* worldname_iphone5_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = worldname_iphone5_3.png; sourceTree = ""; }; @@ -5754,6 +5754,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5761,7 +5762,7 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = "Ad-Hoc"; @@ -5868,6 +5869,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5875,7 +5877,7 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = AppStore; @@ -5955,12 +5957,13 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = Debug; @@ -5981,13 +5984,14 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\..\\..\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/src/client/gui/screens/UsernameScreen.h b/src/client/gui/screens/UsernameScreen.h index c1d750e..38db252 100644 --- a/src/client/gui/screens/UsernameScreen.h +++ b/src/client/gui/screens/UsernameScreen.h @@ -3,7 +3,7 @@ #include "../Screen.h" #include "../components/Button.h" -#include "client/gui/components/TextBox.h" +#include "/client/gui/components/TextBox.h" #include class UsernameScreen : public Screen From 59898ca504f5ef3cd5a6e51ca1cef22eea56fda4 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Thu, 19 Mar 2026 11:06:55 -0400 Subject: [PATCH 070/189] more header fixes --- .../minecraftpe.xcodeproj/project.pbxproj | 50 ++++++++++++++++--- src/client/Options.h | 4 ++ src/client/gui/components/Slider.h | 2 +- src/client/gui/components/SmallButton.cpp | 4 +- src/client/gui/components/SmallButton.h | 6 +-- src/client/gui/screens/JoinByIPScreen.h | 6 +-- src/client/gui/screens/ScreenChooser.cpp | 2 +- src/client/gui/screens/UsernameScreen.h | 3 +- .../screens/crafting/PaneCraftingScreen.cpp | 2 +- 9 files changed, 59 insertions(+), 20 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 64c2c75..6cdc467 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1147,6 +1147,7 @@ D5F3B7DD14548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C814548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib */; }; D5F3B7DE14548E7900D25470 /* IASKSpecifierValuesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */; }; D5F3B7E51454930400D25470 /* InAppSettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7E41454930400D25470 /* InAppSettings.bundle */; }; + F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AC16B17517007ABBC6 /* TextBox.h */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -5345,6 +5346,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */, D5CF9C57144C225000E4244F /* main.mm in Sources */, D5CF9C5B144C225000E4244F /* minecraftpeAppDelegate.mm in Sources */, D5CF9C65144C225000E4244F /* EAGLView.m in Sources */, @@ -5754,7 +5756,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5776,7 +5782,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; @@ -5869,7 +5879,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5892,7 +5906,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; @@ -5957,7 +5975,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; @@ -5984,7 +6006,11 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/**", + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + ); IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -6008,7 +6034,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; @@ -6034,7 +6064,11 @@ "GCC_THUMB_SUPPORT[arch=armv7]" = NO; GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/src/client/gui/components/**", + "$(SRCROOT)/src/client/gui/**", + "$(SRCROOT)/src/**", + ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 14; diff --git a/src/client/Options.h b/src/client/Options.h index 9852d48..f81734d 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -97,6 +97,10 @@ typedef std::vector StringVector; class Options { public: + // deepfriedwaffles: for iOS, was getting compile errors saying: No member named 'sound' in 'Options' and No member named 'music' in 'Options' so I floated them here. 1.0f means full volume out of the box, but if everything is too loud, you might want to try adjusting this + float sound = 1.0f; + float music = 1.0f; + static bool debugGl; Options(Minecraft* minecraft, const std::string& workingDirectory = "") diff --git a/src/client/gui/components/Slider.h b/src/client/gui/components/Slider.h index 73c009a..107ec98 100755 --- a/src/client/gui/components/Slider.h +++ b/src/client/gui/components/Slider.h @@ -3,7 +3,7 @@ #include "GuiElement.h" #include "../../../client/Options.h" -#include +#include "OptionsPane.h" // was originally Option.h, shouldn't it be this? class Slider : public GuiElement { typedef GuiElement super; diff --git a/src/client/gui/components/SmallButton.cpp b/src/client/gui/components/SmallButton.cpp index e2ebfaa..e154736 100644 --- a/src/client/gui/components/SmallButton.cpp +++ b/src/client/gui/components/SmallButton.cpp @@ -12,13 +12,13 @@ SmallButton::SmallButton( int id, int x, int y, int width, int height, const std { } -SmallButton::SmallButton( int id, int x, int y, Options::Option* item, const std::string& msg ) +SmallButton::SmallButton( int id, int x, int y, Option* item, const std::string& msg ) : super(id, x, y, 150, 20, msg), option(item) { } -Options::Option* SmallButton::getOption() +Option* SmallButton::getOption() { return option; } diff --git a/src/client/gui/components/SmallButton.h b/src/client/gui/components/SmallButton.h index 05ae378..2fd6372 100644 --- a/src/client/gui/components/SmallButton.h +++ b/src/client/gui/components/SmallButton.h @@ -13,11 +13,11 @@ class SmallButton: public Button public: SmallButton(int id, int x, int y, const std::string& msg); SmallButton(int id, int x, int y, int width, int height, const std::string& msg); - SmallButton(int id, int x, int y, Options::Option* item, const std::string& msg); + SmallButton(int id, int x, int y, Option* item, const std::string& msg); - Options::Option* getOption(); + Option* getOption(); private: - Options::Option* option; + Option* option; }; #endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__*/ diff --git a/src/client/gui/screens/JoinByIPScreen.h b/src/client/gui/screens/JoinByIPScreen.h index 5ee2b16..4b17543 100644 --- a/src/client/gui/screens/JoinByIPScreen.h +++ b/src/client/gui/screens/JoinByIPScreen.h @@ -2,8 +2,8 @@ #include "../Screen.h" #include "../components/Button.h" #include "../../Minecraft.h" -#include "client/gui/components/ImageButton.h" -#include "client/gui/components/TextBox.h" +#include "ImageButton.h" +#include "TextBox.h" class JoinByIPScreen: public Screen { @@ -25,4 +25,4 @@ private: Touch::THeader bHeader; Touch::TButton bJoin; ImageButton bBack; -}; \ No newline at end of file +}; diff --git a/src/client/gui/screens/ScreenChooser.cpp b/src/client/gui/screens/ScreenChooser.cpp index b423524..610a209 100755 --- a/src/client/gui/screens/ScreenChooser.cpp +++ b/src/client/gui/screens/ScreenChooser.cpp @@ -14,7 +14,7 @@ #include "../../Minecraft.h" -#include +#include "UsernameScreen.h" Screen* ScreenChooser::createScreen( ScreenId id ) { diff --git a/src/client/gui/screens/UsernameScreen.h b/src/client/gui/screens/UsernameScreen.h index 38db252..592998f 100644 --- a/src/client/gui/screens/UsernameScreen.h +++ b/src/client/gui/screens/UsernameScreen.h @@ -3,7 +3,8 @@ #include "../Screen.h" #include "../components/Button.h" -#include "/client/gui/components/TextBox.h" +// this is cursed lol +#include "../../../client/gui/components/TextBox.h" #include class UsernameScreen : public Screen diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index 4e3d025..c0ec6a9 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -16,7 +16,7 @@ #include "../../../../world/level/Level.h" #include "../../../../world/item/DyePowderItem.h" #include "../../../../world/item/crafting/Recipe.h" -#include "platform/input/Keyboard.h" +#include "Keyboard.h" static NinePatchLayer* guiPaneFrame = NULL; From 705c4154ee7c0675af2a93a5270977786f03533d Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Thu, 19 Mar 2026 11:10:19 -0400 Subject: [PATCH 071/189] gonna try changing all Options::Option* in the whole project to just Option* not sure if this works but it gets the compiler to shut up. if this breaks everything change all 'Option*' to 'Options::Option*' as it once was. --- src/client/Minecraft.cpp | 2 +- src/client/gui/components/OptionsPane.cpp | 8 ++++---- src/client/gui/components/OptionsPane.h | 6 +++--- src/client/gui/screens/OptionsScreen.cpp | 5 ++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 1bd68de..97f1bc8 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1212,7 +1212,7 @@ void Minecraft::setSize(int w, int h) { int screenHeight = (int)(height * Gui::InvGuiScale); // if (platform()) { - // float pixelsPerMillimeter = options.getProgressValue(&Options::Option::PIXELS_PER_MILLIMETER); + // float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER); // pixelCalc.setPixelsPerMillimeter(pixelsPerMillimeter); // pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale); // } diff --git a/src/client/gui/components/OptionsPane.cpp b/src/client/gui/components/OptionsPane.cpp index 8cc5d70..e7e6aa2 100644 --- a/src/client/gui/components/OptionsPane.cpp +++ b/src/client/gui/components/OptionsPane.cpp @@ -28,7 +28,7 @@ OptionsGroup& OptionsPane::createOptionsGroup( std::string label ) { return *newGroup; } -void OptionsPane::createToggle( unsigned int group, std::string label, const Options::Option* option ) { +void OptionsPane::createToggle( unsigned int group, std::string label, const Option* option ) { if(group > children.size()) return; ImageDef def; def.setSrc(IntRectangle(160, 206, 39, 20)); @@ -42,7 +42,7 @@ void OptionsPane::createToggle( unsigned int group, std::string label, const Opt setupPositions(); } -void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { +void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { if(group > children.size()) return; Slider* element = new Slider(minecraft, option, progressMin, progressMax); element->width = 100; @@ -52,7 +52,7 @@ void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group setupPositions(); } -void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ) { +void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ) { if(group > children.size()) return; Slider* element = new Slider(minecraft, option, stepVec); element->width = 100; @@ -60,4 +60,4 @@ void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, st OptionsItem* item = new OptionsItem(label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); -} \ No newline at end of file +} diff --git a/src/client/gui/components/OptionsPane.h b/src/client/gui/components/OptionsPane.h index 5eb9652..cf16b26 100644 --- a/src/client/gui/components/OptionsPane.h +++ b/src/client/gui/components/OptionsPane.h @@ -21,9 +21,9 @@ class OptionsPane: public GuiElementContainer public: OptionsPane(); OptionsGroup& createOptionsGroup( std::string label ); - void createToggle( unsigned int group, std::string label, const Options::Option* option ); - void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, float progressMin=1.0f, float progressMax=1.0f ); - void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Options::Option* option, const std::vector& stepVec ); + void createToggle( unsigned int group, std::string label, const Option* option ); + void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin=1.0f, float progressMax=1.0f ); + void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ); void setupPositions(); }; diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 328a207..afa5a8e 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -216,6 +216,9 @@ void OptionsScreen::generateOptionScreens() { // // Graphics Pane optionPanes[3]->addOptionItem(OPTIONS_FANCY_GRAPHICS, minecraft) + // .addOptionItem(&Option::VIEW_BOBBING, minecraft) + // .addOptionItem(&Option::AMBIENT_OCCLUSION, minecraft) + // .addOptionItem(&Option::ANAGLYPH, minecraft) .addOptionItem(OPTIONS_LIMIT_FRAMERATE, minecraft) .addOptionItem(OPTIONS_VSYNC, minecraft) .addOptionItem(OPTIONS_RENDER_DEBUG, minecraft) @@ -268,4 +271,4 @@ void OptionsScreen::tick() { currentOptionsGroup->tick(minecraft); super::tick(); -} \ No newline at end of file +} From 22b59bd2cc9ff19e2db31e82430c6a03ace6230a Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 23 Mar 2026 15:05:47 -0400 Subject: [PATCH 072/189] Synced options UI files from main branch --- src/client/gui/components/Slider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/gui/components/Slider.h b/src/client/gui/components/Slider.h index 107ec98..77c8894 100755 --- a/src/client/gui/components/Slider.h +++ b/src/client/gui/components/Slider.h @@ -3,7 +3,7 @@ #include "GuiElement.h" #include "../../../client/Options.h" -#include "OptionsPane.h" // was originally Option.h, shouldn't it be this? +#include "Option.h" class Slider : public GuiElement { typedef GuiElement super; From 44ece561e81f86b3745e764464f0c05643d722cd Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 23 Mar 2026 16:07:02 -0400 Subject: [PATCH 073/189] fixed slider for hopefully the final fucking time. Nether Reactor fix: Need to make the array for building it all unsigned integers as now Xcode is strict about the new C++ Standards as they have changed since 2011 --- src/client/gui/components/Slider.h | 1 - src/world/level/tile/NetherReactorPattern.cpp | 21 ++++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client/gui/components/Slider.h b/src/client/gui/components/Slider.h index 77c8894..8168741 100755 --- a/src/client/gui/components/Slider.h +++ b/src/client/gui/components/Slider.h @@ -3,7 +3,6 @@ #include "GuiElement.h" #include "../../../client/Options.h" -#include "Option.h" class Slider : public GuiElement { typedef GuiElement super; diff --git a/src/world/level/tile/NetherReactorPattern.cpp b/src/world/level/tile/NetherReactorPattern.cpp index 8181e41..51958f4 100755 --- a/src/world/level/tile/NetherReactorPattern.cpp +++ b/src/world/level/tile/NetherReactorPattern.cpp @@ -6,23 +6,24 @@ NetherReactorPattern::NetherReactorPattern( ) { const int netherCoreId = Tile::netherReactor->id; const unsigned int types[3][3][3] = { - // Level 0 + // Changing all of these values to be unsigned is needed to get the nether reactor pattern to compile. In the past having them be normal ints was fine but the c++ convention has changed + // Level 0 { - {goldId, stoneId, goldId}, - {stoneId, stoneId, stoneId}, - {goldId, stoneId, goldId} + {static_cast(goldId), static_cast(stoneId), static_cast(goldId)}, + {static_cast(stoneId), static_cast(stoneId), static_cast(stoneId)}, + {static_cast(goldId), static_cast(stoneId), static_cast(goldId)} }, // Level 1 { - {stoneId, 0, stoneId}, - {0, netherCoreId, 0}, - {stoneId, 0, stoneId} + {static_cast(stoneId), 0, static_cast(stoneId)}, + {0, static_cast(netherCoreId), 0}, + {static_cast(stoneId), 0, static_cast(stoneId)} }, // Level 2 { - {0, stoneId, 0}, - {stoneId, stoneId, stoneId}, - {0, stoneId, 0} + {0, static_cast(stoneId), 0}, + {static_cast(stoneId), static_cast(stoneId), static_cast(stoneId)}, + {0, static_cast(stoneId), 0} } }; for(int setLevel = 0; setLevel <= 2; ++setLevel) { From 8867878ccfa95fb50816390cf248871597889fb5 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 23 Mar 2026 17:53:17 -0400 Subject: [PATCH 074/189] more refactoring for iOS --- .../iosproj/minecraftpe.xcodeproj/project.pbxproj | 6 ------ src/client/Minecraft.cpp | 15 ++++++++++----- src/client/Minecraft.h | 1 + src/client/Options.h | 7 +++---- src/client/gui/Gui.cpp | 4 ++-- src/client/gui/components/ImageButton.cpp | 2 +- src/client/gui/components/KeyOption.h | 4 ++-- src/client/gui/components/TextOption.h | 4 ++-- src/client/player/input/XperiaPlayInput.h | 2 ++ 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 6cdc467..c8f656c 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -41,7 +41,6 @@ 042A91AE16B17517007ABBC6 /* GuiElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A316B17517007ABBC6 /* GuiElement.cpp */; }; 042A91AF16B17517007ABBC6 /* NinePatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A516B17517007ABBC6 /* NinePatch.cpp */; }; 042A91B016B17517007ABBC6 /* OptionsGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A716B17517007ABBC6 /* OptionsGroup.cpp */; }; - 042A91B116B17517007ABBC6 /* OptionsPane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A916B17517007ABBC6 /* OptionsPane.cpp */; }; 042A91B216B17517007ABBC6 /* TextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AB16B17517007ABBC6 /* TextBox.cpp */; }; 044129071682FF9600B70EE6 /* MouseHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 044129061682FF9600B70EE6 /* MouseHandler.cpp */; }; 9D293CE716071C08000305C8 /* CreateNewWorld_iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */; }; @@ -1209,8 +1208,6 @@ 042A91A616B17517007ABBC6 /* NinePatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NinePatch.h; sourceTree = ""; }; 042A91A716B17517007ABBC6 /* OptionsGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsGroup.cpp; sourceTree = ""; }; 042A91A816B17517007ABBC6 /* OptionsGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsGroup.h; sourceTree = ""; }; - 042A91A916B17517007ABBC6 /* OptionsPane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsPane.cpp; sourceTree = ""; }; - 042A91AA16B17517007ABBC6 /* OptionsPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsPane.h; sourceTree = ""; }; 042A91AB16B17517007ABBC6 /* TextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBox.cpp; sourceTree = ""; }; 042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextBox.h; path = ../../src/client/gui/components/TextBox.h; sourceTree = SOURCE_ROOT; }; 044129061682FF9600B70EE6 /* MouseHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseHandler.cpp; sourceTree = ""; }; @@ -3227,8 +3224,6 @@ 042A91A616B17517007ABBC6 /* NinePatch.h */, 042A91A716B17517007ABBC6 /* OptionsGroup.cpp */, 042A91A816B17517007ABBC6 /* OptionsGroup.h */, - 042A91A916B17517007ABBC6 /* OptionsPane.cpp */, - 042A91AA16B17517007ABBC6 /* OptionsPane.h */, 042A91AB16B17517007ABBC6 /* TextBox.cpp */, 042A91AC16B17517007ABBC6 /* TextBox.h */, D5B50C2814CFF66F005F7284 /* Button.cpp */, @@ -5705,7 +5700,6 @@ 042A91AE16B17517007ABBC6 /* GuiElement.cpp in Sources */, 042A91AF16B17517007ABBC6 /* NinePatch.cpp in Sources */, 042A91B016B17517007ABBC6 /* OptionsGroup.cpp in Sources */, - 042A91B116B17517007ABBC6 /* OptionsPane.cpp in Sources */, 042A91B216B17517007ABBC6 /* TextBox.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 97f1bc8..3170504 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1,10 +1,11 @@ #include "Minecraft.h" #include "Options.h" -#include "client/Options.h" -#include "client/player/input/IBuildInput.h" -#include "platform/input/Keyboard.h" -#include "world/item/Item.h" -#include "world/item/ItemInstance.h" +#include "IBuildInput.h" +#include "Keyboard.h" +#include "Item.h" +#include "ItemInstance.h" +#include "XperiaPlayInput.h" +#include "ControllerTurnInput.h" #include #include @@ -24,9 +25,13 @@ #include "../world/level/storage/LevelStorageSource.h" #include "../world/level/storage/LevelStorage.h" #include "player/input/KeyboardInput.h" +<<<<<<< HEAD #include "player/input/ControllerTurnInput.h" #include "player/input/XperiaPlayInput.h" #include "world/level/chunk/ChunkSource.h" +======= +#include "ChunkSource.h" +>>>>>>> abfb9e0 (more refactoring for iOS) #ifndef STANDALONE_SERVER #include "player/input/touchscreen/TouchInputHolder.h" diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index 1a90b12..22b7ec7 100755 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -221,6 +221,7 @@ private: bool _isCreativeMode; //int _respawnPlayerTicks; Player* _pendingRemovePlayer; // @attn @todo @fix: remove this shait and fix the respawn behaviour + // shit* lmao PerfRenderer* _perfRenderer; CommandServer* _commandServer; diff --git a/src/client/Options.h b/src/client/Options.h index f81734d..c2b0b1f 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -97,9 +97,6 @@ typedef std::vector StringVector; class Options { public: - // deepfriedwaffles: for iOS, was getting compile errors saying: No member named 'sound' in 'Options' and No member named 'music' in 'Options' so I floated them here. 1.0f means full volume out of the box, but if everything is too loud, you might want to try adjusting this - float sound = 1.0f; - float music = 1.0f; static bool debugGl; @@ -164,7 +161,9 @@ private: if (m_options[key] == nullptr) return nullptr; return dynamic_cast(m_options[key]); } - +// apple stuff + float sound; + float music; std::array m_options; OptionsFile optionsFile; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index 8df59f0..c54cce5 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -1,7 +1,7 @@ #include "Gui.h" #include "Font.h" -#include "client/Options.h" -#include "platform/input/Keyboard.h" +#include "Options.h" +#include "Keyboard.h" #include "screens/IngameBlockSelectionScreen.h" #include "screens/ChatScreen.h" #include "screens/ConsoleScreen.h" diff --git a/src/client/gui/components/ImageButton.cpp b/src/client/gui/components/ImageButton.cpp index 3d95acc..f686dcd 100755 --- a/src/client/gui/components/ImageButton.cpp +++ b/src/client/gui/components/ImageButton.cpp @@ -4,7 +4,7 @@ #include "../../../platform/log.h" #include "../../../util/Mth.h" #include "../../renderer/Textures.h" -#include +#include "../../Option.h" ImageButton::ImageButton(int id, const std::string& msg) diff --git a/src/client/gui/components/KeyOption.h b/src/client/gui/components/KeyOption.h index fabdc7a..cc86958 100644 --- a/src/client/gui/components/KeyOption.h +++ b/src/client/gui/components/KeyOption.h @@ -1,6 +1,6 @@ #pragma once #include "Button.h" -#include +#include "Options.h" class KeyOption : public Touch::TButton { public: @@ -11,4 +11,4 @@ public: virtual void keyPressed(Minecraft* minecraft, int key); protected: bool m_captureMode; -}; \ No newline at end of file +}; diff --git a/src/client/gui/components/TextOption.h b/src/client/gui/components/TextOption.h index 89c545c..b93a79c 100644 --- a/src/client/gui/components/TextOption.h +++ b/src/client/gui/components/TextOption.h @@ -1,10 +1,10 @@ #pragma once #include "TextBox.h" -#include +#include "Options.h" class TextOption : public TextBox { public: TextOption(Minecraft* minecraft, OptionId optId); virtual bool loseFocus(Minecraft* minecraft); -}; \ No newline at end of file +}; diff --git a/src/client/player/input/XperiaPlayInput.h b/src/client/player/input/XperiaPlayInput.h index 0b3afc5..bbebab5 100755 --- a/src/client/player/input/XperiaPlayInput.h +++ b/src/client/player/input/XperiaPlayInput.h @@ -1,5 +1,7 @@ #ifndef NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ #define NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ +#include "Player.h" +#include "Controller.h" //package net.minecraft.client.player; From aec534d948af3b37970b7f90336d2cb108979c12 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 24 Mar 2026 19:51:01 -0400 Subject: [PATCH 075/189] restore include paths for cross-platform builds because i messed absolutely every #include up. --- src/client/Minecraft.cpp | 15 +++++---------- src/client/Options.h | 7 ++++--- src/client/gui/Gui.cpp | 4 ++-- src/client/gui/components/ImageButton.cpp | 2 +- src/client/gui/components/KeyOption.h | 4 ++-- src/client/gui/components/TextOption.h | 4 ++-- src/client/gui/screens/OptionsScreen.cpp | 2 +- src/client/player/input/XperiaPlayInput.h | 2 -- 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 3170504..97f1bc8 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1,11 +1,10 @@ #include "Minecraft.h" #include "Options.h" -#include "IBuildInput.h" -#include "Keyboard.h" -#include "Item.h" -#include "ItemInstance.h" -#include "XperiaPlayInput.h" -#include "ControllerTurnInput.h" +#include "client/Options.h" +#include "client/player/input/IBuildInput.h" +#include "platform/input/Keyboard.h" +#include "world/item/Item.h" +#include "world/item/ItemInstance.h" #include #include @@ -25,13 +24,9 @@ #include "../world/level/storage/LevelStorageSource.h" #include "../world/level/storage/LevelStorage.h" #include "player/input/KeyboardInput.h" -<<<<<<< HEAD #include "player/input/ControllerTurnInput.h" #include "player/input/XperiaPlayInput.h" #include "world/level/chunk/ChunkSource.h" -======= -#include "ChunkSource.h" ->>>>>>> abfb9e0 (more refactoring for iOS) #ifndef STANDALONE_SERVER #include "player/input/touchscreen/TouchInputHolder.h" diff --git a/src/client/Options.h b/src/client/Options.h index c2b0b1f..f81734d 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -97,6 +97,9 @@ typedef std::vector StringVector; class Options { public: + // deepfriedwaffles: for iOS, was getting compile errors saying: No member named 'sound' in 'Options' and No member named 'music' in 'Options' so I floated them here. 1.0f means full volume out of the box, but if everything is too loud, you might want to try adjusting this + float sound = 1.0f; + float music = 1.0f; static bool debugGl; @@ -161,9 +164,7 @@ private: if (m_options[key] == nullptr) return nullptr; return dynamic_cast(m_options[key]); } -// apple stuff - float sound; - float music; + std::array m_options; OptionsFile optionsFile; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index c54cce5..8df59f0 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -1,7 +1,7 @@ #include "Gui.h" #include "Font.h" -#include "Options.h" -#include "Keyboard.h" +#include "client/Options.h" +#include "platform/input/Keyboard.h" #include "screens/IngameBlockSelectionScreen.h" #include "screens/ChatScreen.h" #include "screens/ConsoleScreen.h" diff --git a/src/client/gui/components/ImageButton.cpp b/src/client/gui/components/ImageButton.cpp index f686dcd..3d95acc 100755 --- a/src/client/gui/components/ImageButton.cpp +++ b/src/client/gui/components/ImageButton.cpp @@ -4,7 +4,7 @@ #include "../../../platform/log.h" #include "../../../util/Mth.h" #include "../../renderer/Textures.h" -#include "../../Option.h" +#include ImageButton::ImageButton(int id, const std::string& msg) diff --git a/src/client/gui/components/KeyOption.h b/src/client/gui/components/KeyOption.h index cc86958..fabdc7a 100644 --- a/src/client/gui/components/KeyOption.h +++ b/src/client/gui/components/KeyOption.h @@ -1,6 +1,6 @@ #pragma once #include "Button.h" -#include "Options.h" +#include class KeyOption : public Touch::TButton { public: @@ -11,4 +11,4 @@ public: virtual void keyPressed(Minecraft* minecraft, int key); protected: bool m_captureMode; -}; +}; \ No newline at end of file diff --git a/src/client/gui/components/TextOption.h b/src/client/gui/components/TextOption.h index b93a79c..89c545c 100644 --- a/src/client/gui/components/TextOption.h +++ b/src/client/gui/components/TextOption.h @@ -1,10 +1,10 @@ #pragma once #include "TextBox.h" -#include "Options.h" +#include class TextOption : public TextBox { public: TextOption(Minecraft* minecraft, OptionId optId); virtual bool loseFocus(Minecraft* minecraft); -}; +}; \ No newline at end of file diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index afa5a8e..ce5db38 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -271,4 +271,4 @@ void OptionsScreen::tick() { currentOptionsGroup->tick(minecraft); super::tick(); -} +} \ No newline at end of file diff --git a/src/client/player/input/XperiaPlayInput.h b/src/client/player/input/XperiaPlayInput.h index bbebab5..0b3afc5 100755 --- a/src/client/player/input/XperiaPlayInput.h +++ b/src/client/player/input/XperiaPlayInput.h @@ -1,7 +1,5 @@ #ifndef NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ #define NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__ -#include "Player.h" -#include "Controller.h" //package net.minecraft.client.player; From d5547673098ceabbee8df49b2223883149018698 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 24 Mar 2026 21:38:31 -0400 Subject: [PATCH 076/189] IT COMPILESgit add .! also added full screen support. see issues. --- project/iosproj/Launch Screen.storyboard | 48 +++++ .../minecraftpe.xcodeproj/project.pbxproj | 192 ++++++++++++++---- .../minecraftpe/minecraftpe-Info.plist | 2 + src/AppPlatform_iOS.mm | 6 +- src/client/Option.h | 2 +- 5 files changed, 206 insertions(+), 44 deletions(-) create mode 100644 project/iosproj/Launch Screen.storyboard diff --git a/project/iosproj/Launch Screen.storyboard b/project/iosproj/Launch Screen.storyboard new file mode 100644 index 0000000..4ee7abe --- /dev/null +++ b/project/iosproj/Launch Screen.storyboard @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index c8f656c..6fcf382 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1147,6 +1147,32 @@ D5F3B7DE14548E7900D25470 /* IASKSpecifierValuesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */; }; D5F3B7E51454930400D25470 /* InAppSettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7E41454930400D25470 /* InAppSettings.bundle */; }; F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AC16B17517007ABBC6 /* TextBox.h */; }; + F99D341F2F736AA100DC153E /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D341E2F736AA100DC153E /* HttpClient.cpp */; }; + F99D34202F736AA100DC153E /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D341E2F736AA100DC153E /* HttpClient.cpp */; }; + F99D34232F736AD400DC153E /* TextOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34222F736AD400DC153E /* TextOption.cpp */; }; + F99D34242F736AD400DC153E /* TextOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34222F736AD400DC153E /* TextOption.cpp */; }; + F99D34272F736AFB00DC153E /* OptionsFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34262F736AFB00DC153E /* OptionsFile.cpp */; }; + F99D34282F736AFB00DC153E /* OptionsFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34262F736AFB00DC153E /* OptionsFile.cpp */; }; + F99D342B2F736B6F00DC153E /* OptionsItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342A2F736B6F00DC153E /* OptionsItem.cpp */; }; + F99D342C2F736B6F00DC153E /* OptionsItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342A2F736B6F00DC153E /* OptionsItem.cpp */; }; + F99D342F2F736BAD00DC153E /* ConsoleScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */; }; + F99D34302F736BAD00DC153E /* ConsoleScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */; }; + F99D34332F736BDA00DC153E /* CreditsScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34322F736BDA00DC153E /* CreditsScreen.cpp */; }; + F99D34342F736BDA00DC153E /* CreditsScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34322F736BDA00DC153E /* CreditsScreen.cpp */; }; + F99D34372F736C1000DC153E /* JoinByIPScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */; }; + F99D34382F736C1000DC153E /* JoinByIPScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */; }; + F99D343B2F736C3B00DC153E /* UsernameScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */; }; + F99D343C2F736C3B00DC153E /* UsernameScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */; }; + F99D343F2F736C8400DC153E /* GuiElementContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */; }; + F99D34402F736C8400DC153E /* GuiElementContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */; }; + F99D34432F736F9400DC153E /* Option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34422F736F9400DC153E /* Option.cpp */; }; + F99D34442F736F9400DC153E /* Option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34422F736F9400DC153E /* Option.cpp */; }; + F99D34472F736FE800DC153E /* KeyOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34462F736FE800DC153E /* KeyOption.cpp */; }; + F99D34482F736FE800DC153E /* KeyOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D34462F736FE800DC153E /* KeyOption.cpp */; }; + F99D344B2F7370CF00DC153E /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D344A2F7370CF00DC153E /* Slider.cpp */; }; + F99D344C2F7370CF00DC153E /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D344A2F7370CF00DC153E /* Slider.cpp */; }; + F99D344E2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; + F99D344F2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -2015,7 +2041,7 @@ D5B50D6914CFF66F005F7284 /* Multitouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Multitouch.h; sourceTree = ""; }; D5B50D6A14CFF66F005F7284 /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = ""; }; D5B50D6B14CFF66F005F7284 /* time.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = time.cpp; sourceTree = ""; }; - D5B50D6C14CFF66F005F7284 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + D5B50D6C14CFF66F005F7284 /* time.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = time.h; sourceTree = ""; }; D5B50E5614CFF66F005F7284 /* SharedConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedConstants.h; sourceTree = ""; }; D5B50E5714CFF66F005F7284 /* terrain_4444.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = terrain_4444.h; sourceTree = ""; }; D5B50E5814CFF66F005F7284 /* terrain_5551.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = terrain_5551.h; sourceTree = ""; }; @@ -2406,6 +2432,31 @@ D5F3B7C814548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKPSToggleSwitchSpecifierViewCell.xib; sourceTree = ""; }; D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKSpecifierValuesView.xib; sourceTree = ""; }; D5F3B7E41454930400D25470 /* InAppSettings.bundle */ = {isa = PBXFileReference; explicitFileType = "wrapper.installer-pkg"; path = InAppSettings.bundle; sourceTree = ""; }; + F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.h"; sourceTree = ""; }; + F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.cpp"; sourceTree = ""; }; + F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.h"; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.cpp"; sourceTree = ""; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.h"; sourceTree = ""; }; + F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.cpp"; sourceTree = ""; }; + F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.h"; sourceTree = ""; }; + F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.cpp"; sourceTree = ""; }; + F99D342D2F736BAD00DC153E /* ConsoleScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConsoleScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.h"; sourceTree = ""; }; + F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ConsoleScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.cpp"; sourceTree = ""; }; + F99D34312F736BDA00DC153E /* CreditsScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CreditsScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.h"; sourceTree = ""; }; + F99D34322F736BDA00DC153E /* CreditsScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CreditsScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.cpp"; sourceTree = ""; }; + F99D34352F736C1000DC153E /* JoinByIPScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JoinByIPScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.h"; sourceTree = ""; }; + F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JoinByIPScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.cpp"; sourceTree = ""; }; + F99D34392F736C3B00DC153E /* UsernameScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UsernameScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.h"; sourceTree = ""; }; + F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = UsernameScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.cpp"; sourceTree = ""; }; + F99D343D2F736C8400DC153E /* GuiElementContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GuiElementContainer.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.h"; sourceTree = ""; }; + F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GuiElementContainer.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.cpp"; sourceTree = ""; }; + F99D34412F736F9400DC153E /* Option.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Option.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.h"; sourceTree = ""; }; + F99D34422F736F9400DC153E /* Option.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.cpp"; sourceTree = ""; }; + F99D34452F736FE800DC153E /* KeyOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KeyOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.h"; sourceTree = ""; }; + F99D34462F736FE800DC153E /* KeyOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = KeyOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.cpp"; sourceTree = ""; }; + F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.h"; sourceTree = ""; }; + F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.cpp"; sourceTree = ""; }; + F99D344D2F7372A100DC153E /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -4252,6 +4303,7 @@ D5CF9C37144C225000E4244F = { isa = PBXGroup; children = ( + F99D344D2F7372A100DC153E /* Launch Screen.storyboard */, D5E1BA9A1451C8A0007DCC4F /* Default@2x.png */, 9D959AFF16036BEE00E23A6F /* Default-568h@2x.png */, D5F07744145EF79B00EC30FB /* Default-Landscape~ipad.png */, @@ -4263,6 +4315,30 @@ D5CF9C45144C225000E4244F /* Frameworks */, D5CF9C43144C225000E4244F /* Products */, D5B50C1614CFF66F005F7284 /* src */, + F99D341D2F736AA100DC153E /* HttpClient.h */, + F99D341E2F736AA100DC153E /* HttpClient.cpp */, + F99D34212F736AD400DC153E /* TextOption.h */, + F99D34222F736AD400DC153E /* TextOption.cpp */, + F99D34252F736AFB00DC153E /* OptionsFile.h */, + F99D34262F736AFB00DC153E /* OptionsFile.cpp */, + F99D34292F736B6F00DC153E /* OptionsItem.h */, + F99D342A2F736B6F00DC153E /* OptionsItem.cpp */, + F99D342D2F736BAD00DC153E /* ConsoleScreen.h */, + F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */, + F99D34312F736BDA00DC153E /* CreditsScreen.h */, + F99D34322F736BDA00DC153E /* CreditsScreen.cpp */, + F99D34352F736C1000DC153E /* JoinByIPScreen.h */, + F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */, + F99D34392F736C3B00DC153E /* UsernameScreen.h */, + F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */, + F99D343D2F736C8400DC153E /* GuiElementContainer.h */, + F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */, + F99D34412F736F9400DC153E /* Option.h */, + F99D34422F736F9400DC153E /* Option.cpp */, + F99D34452F736FE800DC153E /* KeyOption.h */, + F99D34462F736FE800DC153E /* KeyOption.cpp */, + F99D34492F7370CF00DC153E /* Slider.h */, + F99D344A2F7370CF00DC153E /* Slider.cpp */, ); sourceTree = ""; }; @@ -4601,6 +4677,7 @@ D5B50A5614CFF492005F7284 /* pig.png in Resources */, D5B50A5814CFF492005F7284 /* sheep_fur.png in Resources */, D5B50A5A14CFF492005F7284 /* sheep.png in Resources */, + F99D344F2F7372A100DC153E /* Launch Screen.storyboard in Resources */, D5B50A5C14CFF492005F7284 /* skeleton.png in Resources */, D5B50A5E14CFF492005F7284 /* spider.png in Resources */, D5B50A6014CFF492005F7284 /* zombie.png in Resources */, @@ -4937,6 +5014,7 @@ D5ACF26F15C03DBF00E21C22 /* sand2.m4a in Resources */, D5ACF27115C03DBF00E21C22 /* sand3.m4a in Resources */, D5ACF27315C03DBF00E21C22 /* sand4.m4a in Resources */, + F99D344E2F7372A100DC153E /* Launch Screen.storyboard in Resources */, D5ACF27515C03DBF00E21C22 /* snow1.m4a in Resources */, D5ACF27715C03DBF00E21C22 /* snow2.m4a in Resources */, D5ACF27915C03DBF00E21C22 /* snow3.m4a in Resources */, @@ -5013,18 +5091,22 @@ D58BB544146A0B910002C9F5 /* IASKSettingsStore.m in Sources */, D58BB545146A0B910002C9F5 /* IASKSettingsStoreFile.m in Sources */, D58BB546146A0B910002C9F5 /* IASKSettingsStoreUserDefaults.m in Sources */, + F99D34232F736AD400DC153E /* TextOption.cpp in Sources */, D58BB547146A0B910002C9F5 /* IASKSpecifier.m in Sources */, D58BB548146A0B910002C9F5 /* IASKPSSliderSpecifierViewCell.m in Sources */, D58BB549146A0B910002C9F5 /* IASKPSTextFieldSpecifierViewCell.m in Sources */, D58BB54A146A0B910002C9F5 /* IASKPSTitleValueSpecifierViewCell.m in Sources */, D58BB54B146A0B910002C9F5 /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */, + F99D343B2F736C3B00DC153E /* UsernameScreen.cpp in Sources */, D58BB54C146A0B910002C9F5 /* IASKSlider.m in Sources */, D58BB54D146A0B910002C9F5 /* IASKSwitch.m in Sources */, + F99D34302F736BAD00DC153E /* ConsoleScreen.cpp in Sources */, D58BB54E146A0B910002C9F5 /* IASKTextField.m in Sources */, D58BB550146A0B910002C9F5 /* PVRTexture.m in Sources */, D5D43CC9146AF4B4002ED842 /* RenameMPWorldViewController.mm in Sources */, D5B50F7014CFF670005F7284 /* AppPlatform_iOS.mm in Sources */, D5B50F7414CFF670005F7284 /* CreativeMode.cpp in Sources */, + F99D34432F736F9400DC153E /* Option.cpp in Sources */, D5B50F7614CFF670005F7284 /* GameMode.cpp in Sources */, D5B50F7814CFF670005F7284 /* Button.cpp in Sources */, D5B50F7A14CFF670005F7284 /* ImageButton.cpp in Sources */, @@ -5069,6 +5151,7 @@ D5B50FC814CFF670005F7284 /* KeyboardInput.cpp in Sources */, D5B50FCA14CFF670005F7284 /* TouchscreenInput.cpp in Sources */, D5B50FCC14CFF670005F7284 /* LocalPlayer.cpp in Sources */, + F99D34482F736FE800DC153E /* KeyOption.cpp in Sources */, D5B50FCE14CFF670005F7284 /* Chunk.cpp in Sources */, D5B50FD014CFF670005F7284 /* Frustum.cpp in Sources */, D5B50FD214CFF670005F7284 /* ChickenRenderer.cpp in Sources */, @@ -5127,6 +5210,7 @@ D5B5113014CFF670005F7284 /* TripodCamera.cpp in Sources */, D5B5113214CFF670005F7284 /* Mob.cpp in Sources */, D5B5113414CFF670005F7284 /* MobCategory.cpp in Sources */, + F99D34282F736AFB00DC153E /* OptionsFile.cpp in Sources */, D5B5113814CFF670005F7284 /* PathFinderMob.cpp in Sources */, D5B5113A14CFF670005F7284 /* Inventory.cpp in Sources */, D5B5113C14CFF670005F7284 /* Player.cpp in Sources */, @@ -5138,6 +5222,7 @@ D5B5114814CFF670005F7284 /* Item.cpp in Sources */, D5B5114A14CFF670005F7284 /* ItemInstance.cpp in Sources */, D5B5114C14CFF670005F7284 /* PickaxeItem.cpp in Sources */, + F99D344B2F7370CF00DC153E /* Slider.cpp in Sources */, D5B5114E14CFF670005F7284 /* ShovelItem.cpp in Sources */, D5B5115014CFF670005F7284 /* Biome.cpp in Sources */, D5B5115214CFF670005F7284 /* BiomeSource.cpp in Sources */, @@ -5188,6 +5273,7 @@ D5251DBA1538192700FC82C8 /* CloudServer.cpp in Sources */, D5251DBE1538192700FC82C8 /* CommandParserInterface.cpp in Sources */, D5251DC01538192700FC82C8 /* ConnectionGraph2.cpp in Sources */, + F99D34402F736C8400DC153E /* GuiElementContainer.cpp in Sources */, D5251DC21538192700FC82C8 /* ConsoleServer.cpp in Sources */, D5251DC41538192700FC82C8 /* DataCompressor.cpp in Sources */, D5251DC61538192700FC82C8 /* DirectoryDeltaTransfer.cpp in Sources */, @@ -5212,6 +5298,8 @@ D5251DEC1538192700FC82C8 /* HTTPConnection.cpp in Sources */, D5251DEE1538192700FC82C8 /* IncrementalReadInterface.cpp in Sources */, D5251DF01538192700FC82C8 /* Itoa.cpp in Sources */, + F99D34202F736AA100DC153E /* HttpClient.cpp in Sources */, + F99D34382F736C1000DC153E /* JoinByIPScreen.cpp in Sources */, D5251DF21538192700FC82C8 /* LinuxStrings.cpp in Sources */, D5251DF41538192700FC82C8 /* LocklessTypes.cpp in Sources */, D5251DF61538192700FC82C8 /* LogCommandParser.cpp in Sources */, @@ -5240,6 +5328,7 @@ D5251E2A1538192700FC82C8 /* RakSleep.cpp in Sources */, D5251E2C1538192700FC82C8 /* RakString.cpp in Sources */, D5251E2E1538192700FC82C8 /* RakThread.cpp in Sources */, + F99D34332F736BDA00DC153E /* CreditsScreen.cpp in Sources */, D5251E301538192700FC82C8 /* RakWString.cpp in Sources */, D5251E321538192700FC82C8 /* Rand.cpp in Sources */, D5251E341538192700FC82C8 /* rdlmalloc.cpp in Sources */, @@ -5282,6 +5371,7 @@ D5951EEB159349100043A12A /* TileEntity.cpp in Sources */, D5951EEF159349680043A12A /* FurnaceScreen.cpp in Sources */, D5951EF215934A2D0043A12A /* Feature.cpp in Sources */, + F99D342C2F736B6F00DC153E /* OptionsItem.cpp in Sources */, D5951EF815934AC50043A12A /* BaseContainerMenu.cpp in Sources */, D5951EFA15934AC50043A12A /* FurnaceMenu.cpp in Sources */, D5D381F315A1A1CF00B6C50E /* FillingContainer.cpp in Sources */, @@ -5344,6 +5434,7 @@ F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */, D5CF9C57144C225000E4244F /* main.mm in Sources */, D5CF9C5B144C225000E4244F /* minecraftpeAppDelegate.mm in Sources */, + F99D343C2F736C3B00DC153E /* UsernameScreen.cpp in Sources */, D5CF9C65144C225000E4244F /* EAGLView.m in Sources */, D5CFA01D144C453900E4244F /* minecraftpeViewController.mm in Sources */, D5A55E4914500EDE00A7571B /* CreateNewWorldViewController.mm in Sources */, @@ -5357,6 +5448,7 @@ D5F3B7D014548E7900D25470 /* IASKSettingsStoreUserDefaults.m in Sources */, D5F3B7D114548E7900D25470 /* IASKSpecifier.m in Sources */, D5F3B7D214548E7900D25470 /* IASKPSSliderSpecifierViewCell.m in Sources */, + F99D34472F736FE800DC153E /* KeyOption.cpp in Sources */, D5F3B7D314548E7900D25470 /* IASKPSTextFieldSpecifierViewCell.m in Sources */, D5F3B7D414548E7900D25470 /* IASKPSTitleValueSpecifierViewCell.m in Sources */, D5F3B7D514548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */, @@ -5468,11 +5560,13 @@ D5B5112D14CFF670005F7284 /* PrimedTnt.cpp in Sources */, D5B5112F14CFF670005F7284 /* TripodCamera.cpp in Sources */, D5B5113114CFF670005F7284 /* Mob.cpp in Sources */, + F99D34442F736F9400DC153E /* Option.cpp in Sources */, D5B5113314CFF670005F7284 /* MobCategory.cpp in Sources */, D5B5113714CFF670005F7284 /* PathFinderMob.cpp in Sources */, D5B5113914CFF670005F7284 /* Inventory.cpp in Sources */, D5B5113B14CFF670005F7284 /* Player.cpp in Sources */, D5B5113D14CFF670005F7284 /* Arrow.cpp in Sources */, + F99D343F2F736C8400DC153E /* GuiElementContainer.cpp in Sources */, D5B5113F14CFF670005F7284 /* Recipes.cpp in Sources */, D5B5114114CFF670005F7284 /* ToolRecipes.cpp in Sources */, D5B5114314CFF670005F7284 /* WeaponRecipes.cpp in Sources */, @@ -5510,10 +5604,12 @@ D5B5118514CFF670005F7284 /* HitResult.cpp in Sources */, D5B5118B14D03342005F7284 /* SynchedEntityData.cpp in Sources */, D5B5118E14DEA27F005F7284 /* DeathScreen.cpp in Sources */, + F99D34242F736AD400DC153E /* TextOption.cpp in Sources */, D5B5119114DEA2B7005F7284 /* LevelData.cpp in Sources */, D5B5119414DEA2EF005F7284 /* DyePowderItem.cpp in Sources */, D584926D14FD234400741128 /* SharedConstants.cpp in Sources */, D584927314FD236700741128 /* MoveControl.cpp in Sources */, + F99D344C2F7370CF00DC153E /* Slider.cpp in Sources */, D584928614FD240D00741128 /* IConfigListener.cpp in Sources */, D584928914FD2FAF00741128 /* Path.cpp in Sources */, D5B86281153810BD00F3238A /* I18n.cpp in Sources */, @@ -5565,6 +5661,7 @@ D5251E011538192700FC82C8 /* NatTypeDetectionServer.cpp in Sources */, D5251E031538192700FC82C8 /* NetworkIDManager.cpp in Sources */, D5251E051538192700FC82C8 /* NetworkIDObject.cpp in Sources */, + F99D34372F736C1000DC153E /* JoinByIPScreen.cpp in Sources */, D5251E071538192700FC82C8 /* PacketConsoleLogger.cpp in Sources */, D5251E091538192700FC82C8 /* PacketFileLogger.cpp in Sources */, D5251E0B1538192700FC82C8 /* PacketizedTCP.cpp in Sources */, @@ -5594,11 +5691,13 @@ D5251E411538192700FC82C8 /* SendToThread.cpp in Sources */, D5251E431538192700FC82C8 /* SHA1.cpp in Sources */, D5251E451538192700FC82C8 /* SignaledEvent.cpp in Sources */, + F99D34342F736BDA00DC153E /* CreditsScreen.cpp in Sources */, D5251E471538192700FC82C8 /* SimpleMutex.cpp in Sources */, D5251E491538192700FC82C8 /* SocketLayer.cpp in Sources */, D5251E4B1538192700FC82C8 /* StringCompressor.cpp in Sources */, D5251E4D1538192700FC82C8 /* StringTable.cpp in Sources */, D5251E4F1538192700FC82C8 /* SuperFastHash.cpp in Sources */, + F99D342B2F736B6F00DC153E /* OptionsItem.cpp in Sources */, D5251E511538192700FC82C8 /* TableSerializer.cpp in Sources */, D5251E531538192700FC82C8 /* TCPInterface.cpp in Sources */, D5251E551538192700FC82C8 /* TeamBalancer.cpp in Sources */, @@ -5621,6 +5720,7 @@ D5951EDD159348C50043A12A /* ItemPane.cpp in Sources */, D5951EE3159349000043A12A /* FurnaceTile.cpp in Sources */, D5951EE8159349100043A12A /* FurnaceTileEntity.cpp in Sources */, + F99D342F2F736BAD00DC153E /* ConsoleScreen.cpp in Sources */, D5951EEA159349100043A12A /* TileEntity.cpp in Sources */, D5951EEE159349680043A12A /* FurnaceScreen.cpp in Sources */, D5951EF115934A2D0043A12A /* Feature.cpp in Sources */, @@ -5657,6 +5757,7 @@ D544941E15D13F45005FA9B0 /* PlayerRenderer.cpp in Sources */, D544942215D13F5E005FA9B0 /* RemotePlayer.cpp in Sources */, D5B17ED515E226F50056E751 /* Throwable.cpp in Sources */, + F99D341F2F736AA100DC153E /* HttpClient.cpp in Sources */, D5B17ED915E2273F0056E751 /* SurvivalMode.cpp in Sources */, D5B17EDD15E227670056E751 /* TrapDoorTile.cpp in Sources */, D5B17EE115E260910056E751 /* MoveFolder.mm in Sources */, @@ -5692,6 +5793,7 @@ 0400453A16A4125C003EB6FA /* FallingTileRenderer.cpp in Sources */, 0413970716A82E1E008A9F1A /* ArmorItem.cpp in Sources */, 0413970D16A82E6B008A9F1A /* CraftingFilters.cpp in Sources */, + F99D34272F736AFB00DC153E /* OptionsFile.cpp in Sources */, 0413970E16A82E6B008A9F1A /* StonecutterScreen.cpp in Sources */, 0413971116A82E7B008A9F1A /* ArmorScreen.cpp in Sources */, 0413971516A82EB9008A9F1A /* ArmorRecipes.cpp in Sources */, @@ -5737,7 +5839,7 @@ D50BE20815EE05B8008AA75E /* Ad-Hoc */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; @@ -5750,11 +5852,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5762,7 +5860,8 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = "Ad-Hoc"; @@ -5777,9 +5876,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -5789,6 +5890,9 @@ PRODUCT_NAME = "$(TARGET_NAME)"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = "Ad-Hoc"; @@ -5861,7 +5965,7 @@ D5A20ADB146AAD9C00A52FEC /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB"; COPY_PHASE_STRIP = YES; @@ -5873,11 +5977,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -5885,7 +5985,8 @@ RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = AppStore; @@ -5901,9 +6002,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -5917,6 +6020,9 @@ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "1B194957-98CF-49B7-A0E7-76692B4B722D"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = AppStore; @@ -5949,7 +6055,7 @@ D5CF9C6C144C225000E4244F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; @@ -5969,17 +6075,14 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = Debug; @@ -5987,7 +6090,7 @@ D5CF9C6D144C225000E4244F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; @@ -6000,18 +6103,15 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/**", - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - ); + HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; + USE_HEADERMAP = NO; VALIDATE_PRODUCT = YES; }; name = Release; @@ -6029,9 +6129,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -6042,6 +6144,9 @@ PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = Debug; @@ -6059,9 +6164,11 @@ GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/src/client/gui/components/**", - "$(SRCROOT)/src/client/gui/**", - "$(SRCROOT)/src/**", + "$(SRCROOT)/../../src", + "$(SRCROOT)/../../src/client/gui/components", + "$(SRCROOT)/../../src/world", + "$(SRCROOT)/../../src/platform/input", + "$(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views", ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; @@ -6072,6 +6179,9 @@ PROVISIONING_PROFILE_SPECIFIER = ""; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src $(SRCROOT)/../lib_projects/InAppSettingsKit/Models $(SRCROOT)/../../src/client/gui/components $(SRCROOT)/../../src/world $(SRCROOT)/../../src/platform/input $(SRCROOT)/../../project/lib_projects/InAppSettingsKit/Views"; + USE_HEADERMAP = NO; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/project/iosproj/minecraftpe/minecraftpe-Info.plist b/project/iosproj/minecraftpe/minecraftpe-Info.plist index 3f1a803..b0ae914 100755 --- a/project/iosproj/minecraftpe/minecraftpe-Info.plist +++ b/project/iosproj/minecraftpe/minecraftpe-Info.plist @@ -58,6 +58,8 @@ minecraft.ttf + UILaunchStoryboardName + Launch Screen UIPrerenderedIcon UIRequiresPersistentWiFi diff --git a/src/AppPlatform_iOS.mm b/src/AppPlatform_iOS.mm index 68f0d12..a98fc76 100755 --- a/src/AppPlatform_iOS.mm +++ b/src/AppPlatform_iOS.mm @@ -275,8 +275,10 @@ void AppPlatform_iOS::hideKeyboard() { [_viewController hideKeyboard]; super::hideKeyboard(); } -void AppPlatform_iOS::isPowerVR() { + +// this was originally void but i changed it to bool because void cant return values +bool AppPlatform_iOS::isPowerVR() { const char* s = (const char*)glGetString(GL_RENDERER); if (!s) return false; return strstr(s, "SGX") != NULL; -} \ No newline at end of file +} diff --git a/src/client/Option.h b/src/client/Option.h index 0b9aed1..7c813c1 100644 --- a/src/client/Option.h +++ b/src/client/Option.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include "Mth.h" +#include /* template struct is_option_type : std::false_type {}; From aeb8e45879ea3c09cf8598742c8b80bafdf12c8b Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Tue, 24 Mar 2026 23:53:26 -0400 Subject: [PATCH 077/189] fixed button not pressable on ios --- src/client/gui/screens/UsernameScreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/gui/screens/UsernameScreen.cpp b/src/client/gui/screens/UsernameScreen.cpp index 82f4bca..cb05cf6 100644 --- a/src/client/gui/screens/UsernameScreen.cpp +++ b/src/client/gui/screens/UsernameScreen.cpp @@ -35,8 +35,8 @@ void UsernameScreen::setupPositions() // Make the done button match the touch-style option tabs _btnDone.width = 66; _btnDone.height = 26; - _btnDone.x = (width - _btnDone.width) / 2; - _btnDone.y = height / 2 + 52; + _btnDone.x = cx - (_btnDone.width / 2); + _btnDone.y = cy + 52; tUsername.width = 120; tUsername.height = 20; From 7cc33b011d19b44bca6df37cd3ecbefc59721c4f Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Wed, 25 Mar 2026 17:54:01 -0400 Subject: [PATCH 078/189] Fixed bugs in starting the game. ALso added build job for iOS ipa unsigned --- .github/workflows/build.yml | 28 ++++++++++- .../minecraftpe.xcodeproj/project.pbxproj | 48 +++++++++---------- src/client/Minecraft.cpp | 4 +- 3 files changed, 53 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eba5db7..419cca1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,6 +72,30 @@ jobs: ${{github.workspace}}/build/OpenAL32.dll ${{github.workspace}}/build/libz.dll + build-ios: + # credit to pengubow from deepfriedwaffles repo + name: Build iOS + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Build + run: | + cd project/iosproj + xcodebuild -scheme minecraftpe -derivedDataPath build -destination 'generic/platform=iOS' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO + mkdir -p Payload + cp -R build/Build/Products/Debug-iphoneos/minecraftpe.app Payload/ + zip -r minecraftpe.ipa Payload + rm -rf Payload + + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: minecraftpe-ios + path: project/iosproj/minecraftpe.ipa + build-linux: name: Build Linux runs-on: ubuntu-latest @@ -266,7 +290,7 @@ jobs: publish: name: Publish runs-on: ubuntu-latest - needs: [ build-windows, build-linux, build-android, build-web ] + needs: [ build-windows, build-linux, build-android, build-web, build-ios ] if: github.ref == 'refs/heads/main' steps: - name: Checkout @@ -340,4 +364,4 @@ jobs: ./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip - ./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip \ No newline at end of file + ./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 6fcf382..795e57f 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2432,30 +2432,30 @@ D5F3B7C814548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKPSToggleSwitchSpecifierViewCell.xib; sourceTree = ""; }; D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKSpecifierValuesView.xib; sourceTree = ""; }; D5F3B7E41454930400D25470 /* InAppSettings.bundle */ = {isa = PBXFileReference; explicitFileType = "wrapper.installer-pkg"; path = InAppSettings.bundle; sourceTree = ""; }; - F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.h"; sourceTree = ""; }; - F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/platform/HttpClient.cpp"; sourceTree = ""; }; - F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.h"; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/TextOption.cpp"; sourceTree = ""; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.h"; sourceTree = ""; }; - F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/OptionsFile.cpp"; sourceTree = ""; }; - F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.h"; sourceTree = ""; }; - F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/OptionsItem.cpp"; sourceTree = ""; }; - F99D342D2F736BAD00DC153E /* ConsoleScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConsoleScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.h"; sourceTree = ""; }; - F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ConsoleScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/ConsoleScreen.cpp"; sourceTree = ""; }; - F99D34312F736BDA00DC153E /* CreditsScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CreditsScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.h"; sourceTree = ""; }; - F99D34322F736BDA00DC153E /* CreditsScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CreditsScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/CreditsScreen.cpp"; sourceTree = ""; }; - F99D34352F736C1000DC153E /* JoinByIPScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JoinByIPScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.h"; sourceTree = ""; }; - F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JoinByIPScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/JoinByIPScreen.cpp"; sourceTree = ""; }; - F99D34392F736C3B00DC153E /* UsernameScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UsernameScreen.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.h"; sourceTree = ""; }; - F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = UsernameScreen.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/screens/UsernameScreen.cpp"; sourceTree = ""; }; - F99D343D2F736C8400DC153E /* GuiElementContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GuiElementContainer.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.h"; sourceTree = ""; }; - F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GuiElementContainer.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/GuiElementContainer.cpp"; sourceTree = ""; }; - F99D34412F736F9400DC153E /* Option.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Option.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.h"; sourceTree = ""; }; - F99D34422F736F9400DC153E /* Option.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/Option.cpp"; sourceTree = ""; }; - F99D34452F736FE800DC153E /* KeyOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KeyOption.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.h"; sourceTree = ""; }; - F99D34462F736FE800DC153E /* KeyOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = KeyOption.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/KeyOption.cpp"; sourceTree = ""; }; - F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.h"; sourceTree = ""; }; - F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = "/Users/vasili/Documents/Repositories/minecraft-pe-0.6.1/src/client/gui/components/Slider.cpp"; sourceTree = ""; }; + F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; + F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; + F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; + F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; + F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; + F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; + F99D342D2F736BAD00DC153E /* ConsoleScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConsoleScreen.h; path = ../../src/client/gui/screens/ConsoleScreen.h; sourceTree = ""; }; + F99D342E2F736BAD00DC153E /* ConsoleScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ConsoleScreen.cpp; path = ../../src/client/gui/screens/ConsoleScreen.cpp; sourceTree = ""; }; + F99D34312F736BDA00DC153E /* CreditsScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CreditsScreen.h; path = ../../src/client/gui/screens/CreditsScreen.h; sourceTree = ""; }; + F99D34322F736BDA00DC153E /* CreditsScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CreditsScreen.cpp; path = ../../src/client/gui/screens/CreditsScreen.cpp; sourceTree = ""; }; + F99D34352F736C1000DC153E /* JoinByIPScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JoinByIPScreen.h; path = ../../src/client/gui/screens/JoinByIPScreen.h; sourceTree = ""; }; + F99D34362F736C1000DC153E /* JoinByIPScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JoinByIPScreen.cpp; path = ../../src/client/gui/screens/JoinByIPScreen.cpp; sourceTree = ""; }; + F99D34392F736C3B00DC153E /* UsernameScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UsernameScreen.h; path = ../../src/client/gui/screens/UsernameScreen.h; sourceTree = ""; }; + F99D343A2F736C3B00DC153E /* UsernameScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = UsernameScreen.cpp; path = ../../src/client/gui/screens/UsernameScreen.cpp; sourceTree = ""; }; + F99D343D2F736C8400DC153E /* GuiElementContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GuiElementContainer.h; path = ../../src/client/gui/components/GuiElementContainer.h; sourceTree = ""; }; + F99D343E2F736C8400DC153E /* GuiElementContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GuiElementContainer.cpp; path = ../../src/client/gui/components/GuiElementContainer.cpp; sourceTree = ""; }; + F99D34412F736F9400DC153E /* Option.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Option.h; path = ../../src/client/Option.h; sourceTree = ""; }; + F99D34422F736F9400DC153E /* Option.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = ../../src/client/Option.cpp; sourceTree = ""; }; + F99D34452F736FE800DC153E /* KeyOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KeyOption.h; path = ../../src/client/gui/components/KeyOption.h; sourceTree = ""; }; + F99D34462F736FE800DC153E /* KeyOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = KeyOption.cpp; path = ../../src/client/gui/components/KeyOption.cpp; sourceTree = ""; }; + F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = ../../src/client/gui/components/Slider.h; sourceTree = ""; }; + F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = ../../src/client/gui/components/Slider.cpp; sourceTree = ""; }; F99D344D2F7372A100DC153E /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; /* End PBXFileReference section */ diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 97f1bc8..ae8ba6b 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1106,7 +1106,9 @@ void Minecraft::releaseMouse() } bool Minecraft::useTouchscreen() { -#ifdef RPI +#if TARGET_OS_IPHONE + return true; +#elif RPI return false; #endif return options.getBooleanValue(OPTIONS_USE_TOUCHSCREEN) && !_supportsNonTouchscreen; From 6f0c485a9f0fb22ca70268d4704db1e84d5fb82d Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Wed, 25 Mar 2026 19:39:24 -0400 Subject: [PATCH 079/189] removed if line from publish to always run it. can we not skip publish thanks --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 419cca1..43827e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -291,7 +291,6 @@ jobs: name: Publish runs-on: ubuntu-latest needs: [ build-windows, build-linux, build-android, build-web, build-ios ] - if: github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4 From 98dd53e2f5c75f2140dad3cdac9cbb99eb4a5457 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Thu, 26 Mar 2026 01:59:43 +0200 Subject: [PATCH 080/189] Update .github/workflows/build.yml I keep messing this up. For now I am removing all the needs for publish except iOS --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43827e3..901b0a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -290,7 +290,7 @@ jobs: publish: name: Publish runs-on: ubuntu-latest - needs: [ build-windows, build-linux, build-android, build-web, build-ios ] + needs: [ build-ios ] steps: - name: Checkout uses: actions/checkout@v4 From 412a34562fa03fc241a98beb15477ea6ae23c3aa Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 30 Mar 2026 10:54:25 -0400 Subject: [PATCH 081/189] Lowered minimum deployment to iOS 12, rather than iOS 14 --- .../minecraftpe.xcodeproj/project.pbxproj | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 795e57f..ea9ef74 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2435,8 +2435,8 @@ F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; sourceTree = ""; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; }; F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; @@ -5853,7 +5853,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; @@ -5884,7 +5884,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5978,7 +5978,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; @@ -6010,7 +6010,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", @@ -6076,7 +6076,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; @@ -6104,7 +6104,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; @@ -6137,7 +6137,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6172,7 +6172,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; From c476153231f31134c29256a44d0a0260cd910367 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 4 Apr 2026 12:11:33 +0300 Subject: [PATCH 082/189] FIX: other platforms compilation --- src/client/gui/components/OptionsPane.cpp | 17 +++++++++-------- src/client/gui/components/OptionsPane.h | 6 +++--- src/client/gui/screens/JoinByIPScreen.h | 4 ++-- .../gui/screens/crafting/PaneCraftingScreen.cpp | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/client/gui/components/OptionsPane.cpp b/src/client/gui/components/OptionsPane.cpp index e7e6aa2..217a8b2 100644 --- a/src/client/gui/components/OptionsPane.cpp +++ b/src/client/gui/components/OptionsPane.cpp @@ -4,6 +4,7 @@ #include "ImageButton.h" #include "Slider.h" #include "../../Minecraft.h" +#include "client/Options.h" OptionsPane::OptionsPane() { @@ -28,7 +29,7 @@ OptionsGroup& OptionsPane::createOptionsGroup( std::string label ) { return *newGroup; } -void OptionsPane::createToggle( unsigned int group, std::string label, const Option* option ) { +void OptionsPane::createToggle( unsigned int group, std::string label, OptionId option ) { if(group > children.size()) return; ImageDef def; def.setSrc(IntRectangle(160, 206, 39, 20)); @@ -37,27 +38,27 @@ void OptionsPane::createToggle( unsigned int group, std::string label, const Opt def.height = 20 * 0.7f; OptionButton* element = new OptionButton(option); element->setImageDef(def, true); - OptionsItem* item = new OptionsItem(label, element); + OptionsItem* item = new OptionsItem(option, label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); } -void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { +void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, OptionId option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) { if(group > children.size()) return; - Slider* element = new Slider(minecraft, option, progressMin, progressMax); + Slider* element = new SliderFloat(minecraft, option); element->width = 100; element->height = 20; - OptionsItem* item = new OptionsItem(label, element); + OptionsItem* item = new OptionsItem(option, label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); } -void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ) { +void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, OptionId option, const std::vector& stepVec ) { if(group > children.size()) return; - Slider* element = new Slider(minecraft, option, stepVec); + Slider* element = new SliderInt(minecraft, option); element->width = 100; element->height = 20; - OptionsItem* item = new OptionsItem(label, element); + OptionsItem* item = new OptionsItem(option, label, element); ((OptionsGroup*)children[group])->addChild(item); setupPositions(); } diff --git a/src/client/gui/components/OptionsPane.h b/src/client/gui/components/OptionsPane.h index cf16b26..e6f7607 100644 --- a/src/client/gui/components/OptionsPane.h +++ b/src/client/gui/components/OptionsPane.h @@ -21,9 +21,9 @@ class OptionsPane: public GuiElementContainer public: OptionsPane(); OptionsGroup& createOptionsGroup( std::string label ); - void createToggle( unsigned int group, std::string label, const Option* option ); - void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin=1.0f, float progressMax=1.0f ); - void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector& stepVec ); + void createToggle( unsigned int group, std::string label, OptionId option ); + void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, OptionId option, float progressMin=1.0f, float progressMax=1.0f ); + void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, OptionId option, const std::vector& stepVec ); void setupPositions(); }; diff --git a/src/client/gui/screens/JoinByIPScreen.h b/src/client/gui/screens/JoinByIPScreen.h index 4b17543..7333b39 100644 --- a/src/client/gui/screens/JoinByIPScreen.h +++ b/src/client/gui/screens/JoinByIPScreen.h @@ -2,8 +2,8 @@ #include "../Screen.h" #include "../components/Button.h" #include "../../Minecraft.h" -#include "ImageButton.h" -#include "TextBox.h" +#include "../components/ImageButton.h" +#include "../components/TextBox.h" class JoinByIPScreen: public Screen { diff --git a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp index c0ec6a9..4e3d025 100755 --- a/src/client/gui/screens/crafting/PaneCraftingScreen.cpp +++ b/src/client/gui/screens/crafting/PaneCraftingScreen.cpp @@ -16,7 +16,7 @@ #include "../../../../world/level/Level.h" #include "../../../../world/item/DyePowderItem.h" #include "../../../../world/item/crafting/Recipe.h" -#include "Keyboard.h" +#include "platform/input/Keyboard.h" static NinePatchLayer* guiPaneFrame = NULL; From a96b942c17098047391416e8f36bf9ea0273c834 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 4 Apr 2026 14:26:57 +0300 Subject: [PATCH 083/189] FIX: web and android compilation --- src/client/renderer/gles.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index 9a74c07..c6d4bec 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -17,8 +17,8 @@ #import #import #elif defined(ANDROID) || defined(__EMSCRIPTEN__) - #import - #import + #import + #import #else #include From 13fd8303615a6314a9e96ce60697d01707a94a27 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Sat, 4 Apr 2026 20:44:22 -0400 Subject: [PATCH 084/189] fixed the possible broken header search and added all jobs including ios to publish --- .github/workflows/build.yml | 2 +- .../minecraftpe.xcodeproj/project.pbxproj | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 901b0a3..7506661 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -290,7 +290,7 @@ jobs: publish: name: Publish runs-on: ubuntu-latest - needs: [ build-ios ] + needs: [ build-windows, build-ios, build-linux, build-android, build-web ] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index ea9ef74..795e57f 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2435,8 +2435,8 @@ F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; sourceTree = ""; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; @@ -5853,7 +5853,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; @@ -5884,7 +5884,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5978,7 +5978,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; @@ -6010,7 +6010,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", @@ -6076,7 +6076,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; @@ -6104,7 +6104,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; @@ -6137,7 +6137,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6172,7 +6172,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 12; + IPHONEOS_DEPLOYMENT_TARGET = 14; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; From d7a02bfc9060509dd67c3b4ac8379fae87b14539 Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Sun, 5 Apr 2026 14:22:14 -0400 Subject: [PATCH 085/189] Added iOS comppiling instructions to README --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec0b870..ebdc8cb 100644 --- a/README.md +++ b/README.md @@ -197,4 +197,39 @@ cmake --build . 3. Run game: ``` emrun --port 8080 . - ``` \ No newline at end of file + ``` +## iOS +### Xcode +> [Note!] +> There's a precompiled IPA artifact in the GitHub mirror under Actions for those who either don't have Macs or don't want to build themself. But if you want to build youself, you'll need a Mac with Xcode. Download Xcode from the Mac App Store. + +### 1. Clone +Open your terminal and clone the repository +```bash +git clone https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git +cd minecraft-pe-0.6.1 +``` +You can also build from the ios-support branch by checking out to it +``` +git checkout ios-support +``` + +### 2. Open in Xcode + +The project file is in `minecraft-pe-0.6.1/project/iosproj/minecraftpe.xcodeproj`. Open it. + +### 3. Configure Code Signing + +Before you can deploy to an iPhone, you must sign the app with your own Apple Developer account: + +1. Select the **minecraftpe** project in the left sidebar. +2. Go to **Signing & Capabilities**. +3. Change the **Bundle Identifier** to something unique (e.g., `com.yourname.mcpe`). +4. Select your **Team** from the dropdown menu. + +### 4. Build and Run + +1. Connect your iPhone via USB or LAN. +2. Select your device from the run destination menu at the top of Xcode. +3. Press **Cmd + R** (or the Play button). +4. **Note:** If you encounter a "Developer Mode" or "Untrusted Developer" error on your phone, go to **Settings > General > VPN & Device Management** to trust your certificate. From 845d721b1eac6007a05e9e6f79e5fe4cfa854bbd Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 6 Apr 2026 14:48:46 -0400 Subject: [PATCH 086/189] fixed compile issues from main rebase and lowered ios minimum deployment back to 12 --- .../minecraftpe.xcodeproj/project.pbxproj | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 795e57f..aa8a96c 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1173,6 +1173,12 @@ F99D344C2F7370CF00DC153E /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99D344A2F7370CF00DC153E /* Slider.cpp */; }; F99D344E2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; F99D344F2F7372A100DC153E /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F99D344D2F7372A100DC153E /* Launch Screen.storyboard */; }; + F99F0FA92F84369F00F2B29A /* GrassColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FA82F84369F00F2B29A /* GrassColor.cpp */; }; + F99F0FAA2F84369F00F2B29A /* GrassColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FA82F84369F00F2B29A /* GrassColor.cpp */; }; + F99F0FAC2F8436CE00F2B29A /* FoliageColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */; }; + F99F0FAD2F8436CE00F2B29A /* FoliageColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */; }; + F99F0FAF2F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; + F99F0FB02F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -2435,8 +2441,8 @@ F99D341D2F736AA100DC153E /* HttpClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HttpClient.h; path = ../../src/platform/HttpClient.h; sourceTree = ""; }; F99D341E2F736AA100DC153E /* HttpClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HttpClient.cpp; path = ../../src/platform/HttpClient.cpp; sourceTree = ""; }; F99D34212F736AD400DC153E /* TextOption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TextOption.h; path = ../../src/client/gui/components/TextOption.h; sourceTree = ""; }; - F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; }; - F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; sourceTree = ""; }; + F99D34222F736AD400DC153E /* TextOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TextOption.cpp; path = ../../src/client/gui/components/TextOption.cpp; sourceTree = ""; }; + F99D34252F736AFB00DC153E /* OptionsFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsFile.h; path = ../../src/client/OptionsFile.h; sourceTree = ""; }; F99D34262F736AFB00DC153E /* OptionsFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsFile.cpp; path = ../../src/client/OptionsFile.cpp; sourceTree = ""; }; F99D34292F736B6F00DC153E /* OptionsItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionsItem.h; path = ../../src/client/gui/components/OptionsItem.h; sourceTree = ""; }; F99D342A2F736B6F00DC153E /* OptionsItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionsItem.cpp; path = ../../src/client/gui/components/OptionsItem.cpp; sourceTree = ""; }; @@ -2457,6 +2463,9 @@ F99D34492F7370CF00DC153E /* Slider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = ../../src/client/gui/components/Slider.h; sourceTree = ""; }; F99D344A2F7370CF00DC153E /* Slider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = ../../src/client/gui/components/Slider.cpp; sourceTree = ""; }; F99D344D2F7372A100DC153E /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; + F99F0FA82F84369F00F2B29A /* GrassColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GrassColor.cpp; sourceTree = ""; }; + F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FoliageColor.cpp; sourceTree = ""; }; + F99F0FAE2F8436EB00F2B29A /* Color.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3761,6 +3770,7 @@ D5B50E6914CFF66F005F7284 /* StringUtils.cpp */, D5B50E6A14CFF66F005F7284 /* StringUtils.h */, D5B50E6B14CFF66F005F7284 /* WeighedRandom.h */, + F99F0FAE2F8436EB00F2B29A /* Color.cpp */, ); path = util; sourceTree = ""; @@ -4025,6 +4035,8 @@ D5B50F3714CFF66F005F7284 /* TickNextTickData.h */, D5B50F3814CFF66F005F7284 /* tile */, D5B50F6814CFF66F005F7284 /* TilePos.h */, + F99F0FA82F84369F00F2B29A /* GrassColor.cpp */, + F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */, ); path = level; sourceTree = ""; @@ -5194,6 +5206,7 @@ D5B5111014CFF670005F7284 /* Mth.cpp in Sources */, D5B5111214CFF670005F7284 /* PerfRenderer.cpp in Sources */, D5B5111414CFF670005F7284 /* PerfTimer.cpp in Sources */, + F99F0FA92F84369F00F2B29A /* GrassColor.cpp in Sources */, D5B5111614CFF670005F7284 /* StringUtils.cpp in Sources */, D5B5111814CFF670005F7284 /* Direction.cpp in Sources */, D5B5111A14CFF670005F7284 /* Animal.cpp in Sources */, @@ -5214,12 +5227,14 @@ D5B5113814CFF670005F7284 /* PathFinderMob.cpp in Sources */, D5B5113A14CFF670005F7284 /* Inventory.cpp in Sources */, D5B5113C14CFF670005F7284 /* Player.cpp in Sources */, + F99F0FB02F8436EB00F2B29A /* Color.cpp in Sources */, D5B5113E14CFF670005F7284 /* Arrow.cpp in Sources */, D5B5114014CFF670005F7284 /* Recipes.cpp in Sources */, D5B5114214CFF670005F7284 /* ToolRecipes.cpp in Sources */, D5B5114414CFF670005F7284 /* WeaponRecipes.cpp in Sources */, D5B5114614CFF670005F7284 /* HatchetItem.cpp in Sources */, D5B5114814CFF670005F7284 /* Item.cpp in Sources */, + F99F0FAC2F8436CE00F2B29A /* FoliageColor.cpp in Sources */, D5B5114A14CFF670005F7284 /* ItemInstance.cpp in Sources */, D5B5114C14CFF670005F7284 /* PickaxeItem.cpp in Sources */, F99D344B2F7370CF00DC153E /* Slider.cpp in Sources */, @@ -5528,6 +5543,7 @@ D5B5102F14CFF670005F7284 /* main.cpp in Sources */, D5B5103514CFF670005F7284 /* Tag.cpp in Sources */, D5B5103714CFF670005F7284 /* ClientSideNetworkHandler.cpp in Sources */, + F99F0FAF2F8436EB00F2B29A /* Color.cpp in Sources */, D5B5103914CFF670005F7284 /* NetEventCallback.cpp in Sources */, D5B5103B14CFF670005F7284 /* Packet.cpp in Sources */, D5B5103D14CFF670005F7284 /* RakNetInstance.cpp in Sources */, @@ -5548,6 +5564,7 @@ D5B5111514CFF670005F7284 /* StringUtils.cpp in Sources */, D5B5111714CFF670005F7284 /* Direction.cpp in Sources */, D5B5111914CFF670005F7284 /* Animal.cpp in Sources */, + F99F0FAD2F8436CE00F2B29A /* FoliageColor.cpp in Sources */, D5B5111B14CFF670005F7284 /* Chicken.cpp in Sources */, D5B5111D14CFF670005F7284 /* Cow.cpp in Sources */, D5B5111F14CFF670005F7284 /* Pig.cpp in Sources */, @@ -5598,6 +5615,7 @@ D5B5117714CFF670005F7284 /* ExternalFileLevelStorageSource.cpp in Sources */, D5B5117914CFF670005F7284 /* RegionFile.cpp in Sources */, D5B5117B14CFF670005F7284 /* TickNextTickData.cpp in Sources */, + F99F0FAA2F84369F00F2B29A /* GrassColor.cpp in Sources */, D5B5117D14CFF670005F7284 /* DoorTile.cpp in Sources */, D5B5118114CFF670005F7284 /* StoneSlabTile.cpp in Sources */, D5B5118314CFF670005F7284 /* Tile.cpp in Sources */, @@ -5853,7 +5871,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0"; @@ -5884,7 +5902,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5978,7 +5996,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023"; @@ -6010,7 +6028,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", @@ -6076,7 +6094,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = NO; SDKROOT = iphoneos; @@ -6104,7 +6122,7 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/../../src"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; RUN_CLANG_STATIC_ANALYZER = NO; @@ -6137,7 +6155,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6172,7 +6190,7 @@ ); INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - IPHONEOS_DEPLOYMENT_TARGET = 14; + IPHONEOS_DEPLOYMENT_TARGET = 12; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64"; PRODUCT_NAME = "$(TARGET_NAME)"; From fe73853a640883d671a69b3ab829b31de6e652fe Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 6 Apr 2026 22:49:54 +0300 Subject: [PATCH 087/189] defined() would be better ig --- src/client/Minecraft.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index ae8ba6b..9146abe 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1106,9 +1106,9 @@ void Minecraft::releaseMouse() } bool Minecraft::useTouchscreen() { -#if TARGET_OS_IPHONE +#if defined(TARGET_OS_IPHONE) return true; -#elif RPI +#elif defined(RPI) return false; #endif return options.getBooleanValue(OPTIONS_USE_TOUCHSCREEN) && !_supportsNonTouchscreen; @@ -1149,8 +1149,8 @@ void Minecraft::init() int* grassPixels = textures->loadTexturePixels(grassId, "misc/foliagecolor.png"); GrassColor::init(grassPixels); - bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color - FoliageColor::setUseTint(tint); + bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color + FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); // Platform specific initialization here From 58b7724ba2004aef3ab88310fc9102a3d3549fbf Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 9 Apr 2026 04:34:10 +0500 Subject: [PATCH 088/189] fileshredder - fixed fire tile's alpha transparency and fixed vanilla bug where hotbar slots are not rendered transparent like how they are in Beta Java --- src/client/gui/Gui.cpp | 5 ++++- src/world/level/tile/FireTile.h | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index 8df59f0..0c5646e 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -1035,7 +1035,10 @@ void Gui::renderChatMessages( const int screenHeight, unsigned int max, bool isC } void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) { - glColor4f2(1, 1, 1, .5); + glColor4f2(1, 1, 1, 1); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + minecraft->textures->loadAndBindTexture("gui/gui.png"); Inventory* inventory = minecraft->player->inventory; diff --git a/src/world/level/tile/FireTile.h b/src/world/level/tile/FireTile.h index 5dab2f0..577db4b 100755 --- a/src/world/level/tile/FireTile.h +++ b/src/world/level/tile/FireTile.h @@ -131,6 +131,10 @@ public: return false; } + int getRenderLayer() { + return Tile::RENDERLAYER_ALPHATEST; + } + bool canBurn(LevelSource* level, int x, int y, int z) { return flameOdds[level->getTile(x, y, z)] > 0; } From 6049239303d1a1634865bfcd27d2aec74b3eabe7 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Fri, 10 Apr 2026 23:53:18 +0300 Subject: [PATCH 089/189] why tf apks in releases are zipped --- .github/workflows/build.yml | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7506661..4454eba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -216,16 +216,6 @@ jobs: distribution: temurin java-version: 25 - - name: Validate environment - run: | - echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - echo "ANDROID_NDK_PATH=$ANDROID_NDK_PATH" - echo "JAVA_HOME=$JAVA_HOME" - echo "MATRIX_ABI=$MATRIX_ABI" - $ANDROID_SDK_ROOT/platform-tools/adb version || true - java -version - javac -version - - name: Run Android build script run: | chmod +x ./build.sh @@ -322,17 +312,10 @@ jobs: files: mcpe-linux/MinecraftPE-server dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.zip - - name: Zip Android arm64-v8a Artifact - uses: vimtor/action-zip@v1.2 - with: - files: minecraftpe-apk-arm64-v8a/minecraftpe-v8a-debug.apk - dest: minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip - - - name: Zip Android armeabi-v7a Artifact - uses: vimtor/action-zip@v1.2 - with: - files: minecraftpe-apk-armeabi-v7a/minecraftpe-v7a-debug.apk - dest: minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip + - name: Rename Android Artifacts + run: | + mv minecraftpe-apk-arm64-v8a/minecraftpe-v8a-debug.apk minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.apk + mv minecraftpe-apk-armeabi-v7a/minecraftpe-v7a-debug.apk minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.apk - name: Zip Web Artifact uses: vimtor/action-zip@v1.2 @@ -358,9 +341,9 @@ jobs: MinecraftPE development release for commit ${{ github.sha }}. files: | ./data.zip + ./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip - ./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip - ./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip - ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip + ./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.apk + ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.apk ./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip From aa9fa659df31c8de4c88875e03d1e23252e35f4f Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 11 Apr 2026 14:45:47 +0500 Subject: [PATCH 090/189] Extremely Big Update - fileshredder (MAJOR)Added Java Beta/Normal Shading, toggleble in settings Fixed and restored the unused Item Switching Animation, toggleble in tweaks too Added Dynamic Texture for Lava Added option to use Block Outline Selection which was unused normally Added Split Touch Controls into Options Mobs will now drop cooked variants of their meat if they died by fire Fixed Untranslated Strings in Settings (MAJOR) Ravines and Lava/Water pools have been fixed and renabled Tweaked BasicTree to hopefully speed up generation a bit, might disable them temporarily if they keep being slow You can now grow Fancy Oak Trees using saplings. --- data/lang/en_US.lang | 15 +- project/android/jni/Android.mk | 1 + project/android_java/jni/Android.mk | 1 + src/client/Minecraft.cpp | 3 + src/client/Options.cpp | 14 +- src/client/Options.h | 3 + src/client/gui/Gui.cpp | 6 +- src/client/gui/components/OptionsItem.cpp | 10 + src/client/gui/screens/CreditsScreen.cpp | 1 + .../screens/IngameBlockSelectionScreen.cpp | 9 +- src/client/gui/screens/OptionsScreen.cpp | 10 +- src/client/model/geom/ModelPart.cpp | 2 +- src/client/model/geom/Polygon.cpp | 12 + src/client/renderer/GameRenderer.cpp | 868 +++++++++-------- src/client/renderer/ItemInHandRenderer.cpp | 89 +- src/client/renderer/LevelRenderer.cpp | 8 +- src/client/renderer/Lighting.cpp | 48 + src/client/renderer/Lighting.h | 12 + src/client/renderer/Tesselator.cpp | 30 +- src/client/renderer/Tesselator.h | 2 +- src/client/renderer/TileRenderer.cpp | 117 ++- src/client/renderer/entity/EntityRenderer.cpp | 5 +- src/client/renderer/entity/ItemRenderer.cpp | 6 +- src/client/renderer/entity/PlayerRenderer.cpp | 8 +- src/client/renderer/gles.cpp | 35 + src/client/renderer/gles.h | 14 +- .../renderer/ptexture/DynamicTexture.cpp | 420 +++++--- src/client/renderer/ptexture/DynamicTexture.h | 38 + src/world/entity/animal/Chicken.cpp | 4 +- src/world/entity/animal/Cow.cpp | 8 +- src/world/entity/animal/Pig.cpp | 4 +- src/world/level/levelgen/CanyonFeature.cpp | 2 +- src/world/level/levelgen/CanyonFeature.h | 6 +- .../level/levelgen/RandomLevelSource.cpp | 918 +++++++++--------- src/world/level/levelgen/RandomLevelSource.h | 3 + src/world/level/levelgen/feature/BasicTree.h | 66 +- src/world/level/tile/Sapling.h | 7 +- 37 files changed, 1671 insertions(+), 1134 deletions(-) create mode 100644 src/client/renderer/Lighting.cpp create mode 100644 src/client/renderer/Lighting.h diff --git a/data/lang/en_US.lang b/data/lang/en_US.lang index 97ceaa2..46866c8 100755 --- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -153,7 +153,20 @@ options.group.tweaks=Tweaks options.allowSprint=Allow sprint options.barOnTop=HUD above inventory options.rpiCursor=Show Raspberry PI cursor -options.foliageTint=Tint Grass and Leaves +options.foliagetint=Foliage Tinting +options.javaHud=Beta Java hotbar tweaks +options.blockOutline=Block Outline Selection +options.fogType=Fog/Sky Color +options.fogType.vanilla=Vanilla +options.fogType.java=Beta Java +options.fogType.unused=Unused + +options.restoredAnims=Restored Animations + +options.normalLighting=Java Beta/Normals Shading + +options.isJoyTouchArea=Use Split Controls + options.autoJump=Auto Jump options.thirdperson=Third Person options.servervisible=Server Visible diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 07772aa..551ee31 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -98,6 +98,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/client/player/RemotePlayer.cpp \ ../../../src/client/player/input/KeyboardInput.cpp \ ../../../src/client/player/input/touchscreen/TouchscreenInput.cpp \ +../../../src/client/renderer/Lighting.cpp \ ../../../src/client/renderer/Chunk.cpp \ ../../../src/client/renderer/EntityTileRenderer.cpp \ ../../../src/client/renderer/GameRenderer.cpp \ diff --git a/project/android_java/jni/Android.mk b/project/android_java/jni/Android.mk index d472e34..a654801 100755 --- a/project/android_java/jni/Android.mk +++ b/project/android_java/jni/Android.mk @@ -75,6 +75,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/client/player/RemotePlayer.cpp \ ../../../src/client/player/input/KeyboardInput.cpp \ ../../../src/client/player/input/touchscreen/TouchscreenInput.cpp \ +../../../src/client/renderer/Lighting.cpp \ ../../../src/client/renderer/Chunk.cpp \ ../../../src/client/renderer/EntityTileRenderer.cpp \ ../../../src/client/renderer/GameRenderer.cpp \ diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 9146abe..0ea8e9d 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -745,6 +745,7 @@ void Minecraft::tickInput() { int dst = options.getIntValue(OPTIONS_VIEW_DISTANCE); options.set(OPTIONS_VIEW_DISTANCE, (dst + 1) % 4); } + #ifdef CHEATS if (key == Keyboard::KEY_U) { onGraphicsReset(); @@ -1128,6 +1129,8 @@ void Minecraft::init() textures = new Textures(&options, platform()); textures->addDynamicTexture(new WaterTexture()); textures->addDynamicTexture(new WaterSideTexture()); + textures->addDynamicTexture(new LavaTexture()); + textures->addDynamicTexture(new LavaSideTexture()); textures->addDynamicTexture(new FireTexture()); gui.texturesLoaded(textures); diff --git a/src/client/Options.cpp b/src/client/Options.cpp index cf719b0..78cef1a 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -54,18 +54,24 @@ OptionBool limitFramerate("limitFramerate", false); OptionBool vsync("vsync", true); OptionBool fancyGraphics("fancyGraphics", true); OptionBool viewBobbing("viewBobbing", true); -OptionBool ambientOcclusion("ao", false); +OptionBool ambientOcclusion("ao", true); + +OptionBool useNormalLighting("normalLighting", true); OptionBool useTouchscreen("useTouchscreen", true); OptionBool serverVisible("servervisible", true); -OptionBool foliageTint("foliagetint", false); +OptionBool foliageTint("foliagetint", true); OptionInt fogType("fogType", 0, 0, 2); OptionBool javaHud("javaHud", false); +OptionBool blockOutline("blockOutline", false); + +OptionBool restoredAnims("restoredAnims", true); + OptionInt keyForward("key.forward", Keyboard::KEY_W); OptionInt keyLeft("key.left", Keyboard::KEY_A); OptionInt keyBack("key.back", Keyboard::KEY_S); @@ -142,7 +148,11 @@ void Options::initTable() { m_options[OPTIONS_USE_TOUCHSCREEN] = &useTouchscreen; + m_options[OPTIONS_BLOCK_OUTLINE] = &blockOutline; + m_options[OPTIONS_NORMAL_LIGHTING] = &useNormalLighting; + + m_options[OPTIONS_RESTORED_ANIMS] = &restoredAnims; m_options[OPTIONS_SERVER_VISIBLE] = &serverVisible; diff --git a/src/client/Options.h b/src/client/Options.h index f81734d..7d1d3b4 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -49,6 +49,7 @@ enum OptionId { OPTIONS_LIMIT_FRAMERATE, OPTIONS_VSYNC, OPTIONS_FANCY_GRAPHICS, + OPTIONS_NORMAL_LIGHTING, // Cheats / debug OPTIONS_FLY_SPEED, @@ -56,6 +57,7 @@ enum OptionId { OPTIONS_IS_FLYING, // Control + OPTIONS_BLOCK_OUTLINE, OPTIONS_USE_MOUSE_FOR_DIGGING, OPTIONS_IS_LEFT_HANDED, OPTIONS_IS_JOY_TOUCH_AREA, @@ -87,6 +89,7 @@ enum OptionId { OPTIONS_FOLIAGE_TINT, OPTIONS_FOG_TYPE, OPTIONS_JAVA_HUD, + OPTIONS_RESTORED_ANIMS, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index 0c5646e..c6e786a 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -382,6 +382,7 @@ void Gui::renderVignette(float br, int w, int h) { void Gui::renderSlot(int slot, int x, int y, float a) { ItemInstance* item = minecraft->player->inventory->getItem(slot); + if (!item) { //LOGW("Warning: item @ Gui::renderSlot is NULL\n"); return; @@ -595,8 +596,11 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen ItemInstance* currentItem = minecraft->player->inventory->getSelected(); bool bowEquipped = currentItem != NULL ? currentItem->getItem() == Item::bow : false; bool itemInUse = currentItem != NULL ? currentItem->getItem() == minecraft->player->getUseItem()->getItem() : false; + //if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA) + // || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA) - || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { +|| (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) + { minecraft->textures->loadAndBindTexture("gui/icons.png"); glEnable(GL_BLEND); glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); diff --git a/src/client/gui/components/OptionsItem.cpp b/src/client/gui/components/OptionsItem.cpp index 1ee48e3..b9d5bbb 100755 --- a/src/client/gui/components/OptionsItem.cpp +++ b/src/client/gui/components/OptionsItem.cpp @@ -36,6 +36,16 @@ void OptionsItem::render( Minecraft* minecraft, int xm, int ym ) { } text += ": " + scaleText; } + if (m_optionId == OPTIONS_FOG_TYPE) { + int value = minecraft->options.getIntValue(OPTIONS_FOG_TYPE); + std::string scaleText; + switch (value) { + case 0: scaleText = I18n::get("options.fogType.vanilla"); break; + case 1: scaleText = I18n::get("options.fogType.java"); break; + case 2: scaleText = I18n::get("options.fogType.unused"); break; + } + text += ": " + scaleText; + } minecraft->font->draw(text, (float)x, (float)y + yOffset, 0x909090, false); super::render(minecraft, xm, ym); diff --git a/src/client/gui/screens/CreditsScreen.cpp b/src/client/gui/screens/CreditsScreen.cpp index 02114da..f0820af 100644 --- a/src/client/gui/screens/CreditsScreen.cpp +++ b/src/client/gui/screens/CreditsScreen.cpp @@ -41,6 +41,7 @@ void CreditsScreen::init() { _lines.push_back("karson"); _lines.push_back("deepfriedwaffles"); _lines.push_back("EpikIzCool"); + _lines.push_back("fileshredder"); _lines.push_back(""); // avoid color tags around the URL so it isn't mangled by the parser please _lines.push_back("Join our Discord server: https://discord.gg/c58YesBxve"); diff --git a/src/client/gui/screens/IngameBlockSelectionScreen.cpp b/src/client/gui/screens/IngameBlockSelectionScreen.cpp index 863b1f8..c1b72c7 100755 --- a/src/client/gui/screens/IngameBlockSelectionScreen.cpp +++ b/src/client/gui/screens/IngameBlockSelectionScreen.cpp @@ -1,5 +1,6 @@ #include "IngameBlockSelectionScreen.h" #include "../../renderer/TileRenderer.h" +#include "../../renderer/Lighting.h" #include "../../player/LocalPlayer.h" #include "../../renderer/gles.h" #include "../../Minecraft.h" @@ -80,10 +81,10 @@ void IngameBlockSelectionScreen::renderSlots() blitOffset = -90; - //glEnable2(GL_RESCALE_NORMAL); + glEnable2(GL_RESCALE_NORMAL); //glPushMatrix2(); //glRotatef2(180, 1, 0, 0); - //Lighting::turnOn(); + Lighting::turnOn(minecraft); //glPopMatrix2(); minecraft->textures->loadAndBindTexture("gui/gui.png"); @@ -122,8 +123,8 @@ void IngameBlockSelectionScreen::renderSlots() //w.stop(); //w.printEvery(1000, "render-blocksel"); - //glDisable2(GL_RESCALE_NORMAL); - //Lighting::turnOn(); + glDisable2(GL_RESCALE_NORMAL); + Lighting::turnOn(minecraft); } int IngameBlockSelectionScreen::getSlotPosX(int slotX) { diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index ce5db38..88fbb63 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -208,7 +208,9 @@ void OptionsScreen::generateOptionScreens() { // // Controls Pane optionPanes[2]->addOptionItem(OPTIONS_INVERT_Y_MOUSE, minecraft) .addOptionItem(OPTIONS_USE_TOUCHSCREEN, minecraft) - .addOptionItem(OPTIONS_AUTOJUMP, minecraft); + .addOptionItem(OPTIONS_AUTOJUMP, minecraft) + .addOptionItem(OPTIONS_BLOCK_OUTLINE, minecraft) + .addOptionItem(OPTIONS_IS_JOY_TOUCH_AREA, minecraft); for (int i = OPTIONS_KEY_FORWARD; i <= OPTIONS_KEY_USE; i++) { optionPanes[2]->addOptionItem((OptionId)i, minecraft); @@ -224,14 +226,16 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_RENDER_DEBUG, minecraft) .addOptionItem(OPTIONS_ANAGLYPH_3D, minecraft) .addOptionItem(OPTIONS_VIEW_BOBBING, minecraft) - .addOptionItem(OPTIONS_AMBIENT_OCCLUSION, minecraft); + .addOptionItem(OPTIONS_AMBIENT_OCCLUSION, minecraft) + .addOptionItem(OPTIONS_NORMAL_LIGHTING, minecraft); optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft) .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) .addOptionItem(OPTIONS_JAVA_HUD, minecraft) - .addOptionItem(OPTIONS_FOG_TYPE, minecraft); + .addOptionItem(OPTIONS_FOG_TYPE, minecraft) + .addOptionItem(OPTIONS_RESTORED_ANIMS, minecraft); } diff --git a/src/client/model/geom/ModelPart.cpp b/src/client/model/geom/ModelPart.cpp index 7fa8f70..86ab82c 100755 --- a/src/client/model/geom/ModelPart.cpp +++ b/src/client/model/geom/ModelPart.cpp @@ -203,7 +203,7 @@ void ModelPart::compile( float scale ) void ModelPart::draw() { #ifdef OPENGL_ES - drawArrayVT_NoState(vboId, cubes.size() * 2 * 3 * 6, 24); + drawArrayVTN_NoState(vboId, cubes.size() * 2 * 3 * 6, 28); #else glCallList(list); #endif diff --git a/src/client/model/geom/Polygon.cpp b/src/client/model/geom/Polygon.cpp index bfb1467..b826f39 100755 --- a/src/client/model/geom/Polygon.cpp +++ b/src/client/model/geom/Polygon.cpp @@ -43,6 +43,18 @@ void PolygonQuad::mirror() { } void PolygonQuad::render(Tesselator& t, float scale, int vboId /* = -1 */) { + Vec3 v0 = vertices[0].pos - vertices[1].pos; + Vec3 v1 = vertices[2].pos - vertices[1].pos; + Vec3 n = v1.cross(v0).normalized(); + if (_flipNormal == true) + { + t.normal(-n.x , -n.y , -n.z ); + } + else + { + t.normal(n.x , n.y , n.z ); + } + for (int i = 0; i < 4; i++) { VertexPT& v = vertices[i]; t.vertexUV(v.pos.x * scale, v.pos.y * scale, v.pos.z * scale, v.u, v.v); diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index 1aa6a15..aab7f2a 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -1,7 +1,7 @@ #include "GameRenderer.h" #include "client/Options.h" #include "gles.h" - +#include "Lighting.h" #include "../../util/PerfTimer.h" #include "LevelRenderer.h" @@ -32,7 +32,7 @@ static int _shTicks = -1; GameRenderer::GameRenderer( Minecraft* mc ) -: mc(mc), + : mc(mc), renderDistance(0), _tick(0), _lastTickT(0), @@ -90,32 +90,32 @@ void renderCursor(float x, float y, Minecraft* minecraft) { /*private*/ void GameRenderer::setupCamera(float a, int eye) { - renderDistance = (float) (16 * 16 >> (mc->options.getIntValue(OPTIONS_VIEW_DISTANCE))); + renderDistance = (float) (16 * 16 >> (mc->options.getIntValue(OPTIONS_VIEW_DISTANCE))); #if defined(ANDROID) - if (mc->isPowerVR() && mc->options.getIntValue(OPTIONS_VIEW_DISTANCE) <= 2) + if (mc->isPowerVR() && mc->options.getIntValue(OPTIONS_VIEW_DISTANCE) <= 2) renderDistance *= 0.8f; #endif glMatrixMode(GL_PROJECTION); - glLoadIdentity2(); + glLoadIdentity2(); - float stereoScale = 0.07f; - if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) glTranslatef2(-(eye * 2 - 1) * stereoScale, 0, 0); - if (zoom != 1) { - glTranslatef2((float) zoom_x, (float) -zoom_y, 0); + float stereoScale = 0.07f; + if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) glTranslatef2(-(eye * 2 - 1) * stereoScale, 0, 0); + if (zoom != 1) { + glTranslatef2((float) zoom_x, (float) -zoom_y, 0); glScalef2(zoom, zoom, 1); - gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); - } else { - gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); - } + gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); + } else { + gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); + } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity2(); - if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) glTranslatef2((eye * 2 - 1) * 0.10f, 0, 0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity2(); + if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) glTranslatef2((eye * 2 - 1) * 0.10f, 0, 0); + + bobHurt(a); + if (mc->options.getBooleanValue(OPTIONS_VIEW_BOBBING)) bobView(a); - bobHurt(a); - if (mc->options.getBooleanValue(OPTIONS_VIEW_BOBBING)) bobView(a); - moveCameraToPlayer(a); } @@ -125,13 +125,13 @@ extern int _t_keepPic; void GameRenderer::render(float a) { TIMER_PUSH("mouse"); if (mc->player && mc->mouseGrabbed) { - mc->mouseHandler.poll(); - //printf("Controller.x,y : %f,%f\n", Controller::getX(0), Controller::getY(0)); + mc->mouseHandler.poll(); + //printf("Controller.x,y : %f,%f\n", Controller::getX(0), Controller::getY(0)); - float ss = mc->options.getProgressValue(OPTIONS_SENSITIVITY) * 0.6f + 0.2f; - float sens = (ss * ss * ss) * 8; - float xo = mc->mouseHandler.xd * sens * 4.f; - float yo = mc->mouseHandler.yd * sens * 4.f; + float ss = mc->options.getProgressValue(OPTIONS_SENSITIVITY) * 0.6f + 0.2f; + float sens = (ss * ss * ss) * 8; + float xo = mc->mouseHandler.xd * sens * 4.f; + float yo = mc->mouseHandler.yd * sens * 4.f; const float now = _tick + a; float deltaT = now - _lastTickT; @@ -141,20 +141,20 @@ void GameRenderer::render(float a) { _rotX += xo; _rotY += yo; - int yAxis = -1; - if (mc->options.getBooleanValue(OPTIONS_INVERT_Y_MOUSE)) yAxis = 1; + int yAxis = -1; + if (mc->options.getBooleanValue(OPTIONS_INVERT_Y_MOUSE)) yAxis = 1; bool screenCovering = mc->screen && !mc->screen->passEvents; if (!screenCovering) { mc->player->turn(deltaT * _rotXlast, deltaT * _rotYlast * yAxis); } - } + } int xMouse = (int)(Mouse::getX() * Gui::InvGuiScale); int yMouse = (int)(Mouse::getY() * Gui::InvGuiScale); - if (mc->useTouchscreen()) { + if (mc->useTouchscreen()) { const int pid = Multitouch::getFirstActivePointerIdExThisUpdate(); if (pid >= 0) { xMouse = (int)(Multitouch::getX(pid) * Gui::InvGuiScale); @@ -173,33 +173,33 @@ void GameRenderer::render(float a) { TIMER_PUSH("level"); if (_t_keepPic < 0) { - if (!(mc->screen && !mc->screen->renderGameBehind())) { + if (!(mc->screen && !mc->screen->renderGameBehind())) { - if (mc->screen && mc->screen->hasClippingArea(screenScissorArea)) - useScreenScissor = true; + if (mc->screen && mc->screen->hasClippingArea(screenScissorArea)) + useScreenScissor = true; - renderLevel(a); - hasClearedColorBuffer = true; + renderLevel(a); + hasClearedColorBuffer = true; - if (!mc->options.getBooleanValue(OPTIONS_HIDEGUI)) { - TIMER_POP_PUSH("gui"); - setupGuiScreen(false); - hasSetupGuiScreen = true; - mc->gui.render(a, mc->screen != NULL, xMouse, yMouse); - } - }} + if (!mc->options.getBooleanValue(OPTIONS_HIDEGUI)) { + TIMER_POP_PUSH("gui"); + setupGuiScreen(false); + hasSetupGuiScreen = true; + mc->gui.render(a, mc->screen != NULL, xMouse, yMouse); + } + }} TIMER_POP(); } else { - glViewport(0, 0, mc->width, mc->height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity2(); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity2(); - setupGuiScreen(true); + glViewport(0, 0, mc->width, mc->height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity2(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity2(); + setupGuiScreen(true); hasSetupGuiScreen = true; hasClearedColorBuffer = true; - } + } //@todo if (!hasSetupGuiScreen) setupGuiScreen(!hasClearedColorBuffer); @@ -209,26 +209,26 @@ void GameRenderer::render(float a) { if (mc->player->input) mc->player->input->render(a); } - if (mc->screen != NULL) { + if (mc->screen != NULL) { if (useScreenScissor) glDisable2(GL_SCISSOR_TEST); mc->screen->render(xMouse, yMouse, a); - mc->platform()->hideCursor(!mc->options.getBooleanValue(OPTIONS_RPI_CURSOR)); - if (mc->options.getBooleanValue(OPTIONS_RPI_CURSOR)) - renderCursor(xMouse, yMouse, mc); - - // Screen might have been removed, so check it again - if (mc->screen && !mc->screen->isInGameScreen()) - sleepMs(15); - } + mc->platform()->hideCursor(!mc->options.getBooleanValue(OPTIONS_RPI_CURSOR)); + if (mc->options.getBooleanValue(OPTIONS_RPI_CURSOR)) + renderCursor(xMouse, yMouse, mc); + + // Screen might have been removed, so check it again + if (mc->screen && !mc->screen->isInGameScreen()) + sleepMs(15); + } } /*public*/ void GameRenderer::renderLevel(float a) { - if (mc->cameraTargetPlayer == NULL) { + if (mc->cameraTargetPlayer == NULL) { if (mc->player) { mc->cameraTargetPlayer = mc->player; @@ -237,156 +237,162 @@ void GameRenderer::renderLevel(float a) { { return; } - } + } TIMER_PUSH("pick"); - pick(a); + pick(a); - Mob* cameraEntity = mc->cameraTargetPlayer; - LevelRenderer* levelRenderer = mc->levelRenderer; - ParticleEngine* particleEngine = mc->particleEngine; - float xOff = cameraEntity->xOld + (cameraEntity->x - cameraEntity->xOld) * a; - float yOff = cameraEntity->yOld + (cameraEntity->y - cameraEntity->yOld) * a; - float zOff = cameraEntity->zOld + (cameraEntity->z - cameraEntity->zOld) * a; + Mob* cameraEntity = mc->cameraTargetPlayer; + LevelRenderer* levelRenderer = mc->levelRenderer; + ParticleEngine* particleEngine = mc->particleEngine; + float xOff = cameraEntity->xOld + (cameraEntity->x - cameraEntity->xOld) * a; + float yOff = cameraEntity->yOld + (cameraEntity->y - cameraEntity->yOld) * a; + float zOff = cameraEntity->zOld + (cameraEntity->z - cameraEntity->zOld) * a; - for (int i = 0; i < 2; i++) { - if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { - if (i == 0) glColorMask(false, true, true, false); - else glColorMask(true, false, false, false); - } + for (int i = 0; i < 2; i++) { + if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { + if (i == 0) glColorMask(false, true, true, false); + else glColorMask(true, false, false, false); + } TIMER_POP_PUSH("clear"); glViewport(0, 0, mc->width, mc->height); setupClearColor(a); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable2(GL_CULL_FACE); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glEnable2(GL_CULL_FACE); TIMER_POP_PUSH("camera"); - setupCamera(a, i); + setupCamera(a, i); saveMatrices(); if (useScreenScissor) { glEnable2(GL_SCISSOR_TEST); glScissor( screenScissorArea.x, screenScissorArea.y, - screenScissorArea.w, screenScissorArea.h); + screenScissorArea.w, screenScissorArea.h); } - - if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { + + if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { setupFog(-1); TIMER_POP_PUSH("sky"); glFogf(GL_FOG_START, renderDistance * 0.2f); glFogf(GL_FOG_END, renderDistance *0.75); - levelRenderer->renderSky(a); + levelRenderer->renderSky(a); glFogf(GL_FOG_START, renderDistance * 0.6f); glFogf(GL_FOG_END, renderDistance); - } - glEnable2(GL_FOG); - setupFog(1); - - if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { - glShadeModel2(GL_SMOOTH); } - + glEnable2(GL_FOG); + setupFog(1); + + if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { + glShadeModel2(GL_SMOOTH); + } + TIMER_POP_PUSH("frustrum"); FrustumCuller frustum; - frustum.prepare(xOff, yOff, zOff); + frustum.prepare(xOff, yOff, zOff); TIMER_POP_PUSH("culling"); - mc->levelRenderer->cull(&frustum, a); - mc->levelRenderer->updateDirtyChunks(cameraEntity, false); + mc->levelRenderer->cull(&frustum, a); + mc->levelRenderer->updateDirtyChunks(cameraEntity, false); if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { prepareAndRenderClouds(levelRenderer, a); } - setupFog(0); - glEnable2(GL_FOG); + setupFog(0); + glEnable2(GL_FOG); mc->textures->loadAndBindTexture("terrain.png"); - glDisable2(GL_ALPHA_TEST); - glDisable2(GL_BLEND); - glEnable2(GL_CULL_FACE); + Lighting::turnOff(); + + glDisable2(GL_ALPHA_TEST); + glDisable2(GL_BLEND); + glEnable2(GL_CULL_FACE); TIMER_POP_PUSH("terrain-0"); - levelRenderer->render(cameraEntity, 0, a); + levelRenderer->render(cameraEntity, 0, a); TIMER_POP_PUSH("terrain-1"); - glEnable2(GL_ALPHA_TEST); - levelRenderer->render(cameraEntity, 1, a); - - glShadeModel2(GL_FLAT); + glEnable2(GL_ALPHA_TEST); + levelRenderer->render(cameraEntity, 1, a); + + glShadeModel2(GL_FLAT); + Lighting::turnOn(mc); TIMER_POP_PUSH("entities"); mc->levelRenderer->renderEntities(cameraEntity->getPos(a), &frustum, a); -// setupFog(0); + // setupFog(0); TIMER_POP_PUSH("particles"); - particleEngine->render(cameraEntity, a); - + particleEngine->render(cameraEntity, a); + Lighting::turnOff(); glDisable2(GL_BLEND); - glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - setupFog(0); - glEnable2(GL_BLEND); - glDisable2(GL_CULL_FACE); + glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + setupFog(0); + glEnable2(GL_BLEND); + glDisable2(GL_CULL_FACE); glDepthMask(GL_FALSE); - glDisable2(GL_ALPHA_TEST); + glDisable2(GL_ALPHA_TEST); mc->textures->loadAndBindTexture("terrain.png"); - //if (mc->options.fancyGraphics) { - // glColorMask(false, false, false, false); - // int visibleWaterChunks = levelRenderer->render(cameraEntity, 1, a); - // glColorMask(true, true, true, true); - // if (mc->options.anaglyph3d) { - // if (i == 0) glColorMask(false, true, true, false); - // else glColorMask(true, false, false, false); - // } - // if (visibleWaterChunks > 0) { - // levelRenderer->renderSameAsLast(1, a); - // } - //} else + //if (mc->options.fancyGraphics) { + // glColorMask(false, false, false, false); + // int visibleWaterChunks = levelRenderer->render(cameraEntity, 1, a); + // glColorMask(true, true, true, true); + // if (mc->options.anaglyph3d) { + // if (i == 0) glColorMask(false, true, true, false); + // else glColorMask(true, false, false, false); + // } + // if (visibleWaterChunks > 0) { + // levelRenderer->renderSameAsLast(1, a); + // } + //} else { //glDepthRangef(0.1f, 1.0f); //glDepthMask(GL_FALSE); TIMER_POP_PUSH("terrain-water"); glEnable2(GL_DEPTH_TEST); - levelRenderer->render(cameraEntity, 2, a); + levelRenderer->render(cameraEntity, 2, a); //glDepthRangef(0, 1); - } - + } + glDepthMask(GL_TRUE); - glEnable2(GL_CULL_FACE); - glDisable2(GL_BLEND); - glEnable2(GL_ALPHA_TEST); + glEnable2(GL_CULL_FACE); + glDisable2(GL_BLEND); + glEnable2(GL_ALPHA_TEST); if (/*!Minecraft::FLYBY_MODE &&*/ zoom == 1 && cameraEntity->isPlayer()) { if (mc->hitResult.isHit() && !cameraEntity->isUnderLiquid(Material::water)) { TIMER_POP_PUSH("select"); Player* player = (Player*) cameraEntity; // if (mc->useTouchscreen()) { - levelRenderer->renderHitSelect(player, mc->hitResult, 0, NULL, a); //player.inventory->getSelected(), a); - // } + if (mc->options.getBooleanValue(OPTIONS_BLOCK_OUTLINE)){ + levelRenderer->renderHitOutline(player, mc->hitResult, 0, NULL, a); //player.inventory->getSelected(), a); // java block outline one + } else { + levelRenderer->renderHitSelect(player, mc->hitResult, 0, NULL, a); //player.inventory->getSelected(), a); // normal pe one - shredder + } levelRenderer->renderHit(player, mc->hitResult, 0, NULL, a);//player->inventory.getSelected(), a); } } glDisable2(GL_FOG); -// -// setupFog(0); -// glEnable2(GL_FOG); -//// levelRenderer->renderClouds(a); -// glDisable2(GL_FOG); - setupFog(1); + // + // setupFog(0); + // glEnable2(GL_FOG); + //// levelRenderer->renderClouds(a); + // glDisable2(GL_FOG); + setupFog(1); - if (zoom == 1 && !mc->options.getBooleanValue(OPTIONS_HIDEGUI)) { + if (zoom == 1 && !mc->options.getBooleanValue(OPTIONS_HIDEGUI)) { TIMER_POP_PUSH("hand"); - glClear(GL_DEPTH_BUFFER_BIT); - renderItemInHand(a, i); - } + glClear(GL_DEPTH_BUFFER_BIT); + renderItemInHand(a, i); + } - if (!mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { + if (!mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { TIMER_POP(); - return; - } - } - glColorMask(true, true, true, false); + return; + } + } + glColorMask(true, true, true, false); TIMER_POP(); } @@ -400,34 +406,34 @@ void GameRenderer::tickFov() { /*private*/ float GameRenderer::getFov(float a, bool applyEffects) { - Mob* player = mc->cameraTargetPlayer; - float fov = 70; + Mob* player = mc->cameraTargetPlayer; + float fov = 70; if (applyEffects) fov *= this->oFov + (this->fov - this->oFov) * a; - if (player->isUnderLiquid(Material::water)) fov = 60; - if (player->health <= 0) { - float duration = player->deathTime + a; + if (player->isUnderLiquid(Material::water)) fov = 60; + if (player->health <= 0) { + float duration = player->deathTime + a; - fov /= ((1 - 500 / (duration + 500)) * 2.0f + 1); - } - return fov + fovOffsetO + (fovOffset - fovOffsetO) * a; + fov /= ((1 - 500 / (duration + 500)) * 2.0f + 1); + } + return fov + fovOffsetO + (fovOffset - fovOffsetO) * a; } /*private*/ void GameRenderer::moveCameraToPlayer(float a) { - Entity* player = mc->cameraTargetPlayer; + Entity* player = mc->cameraTargetPlayer; - float heightOffset = player->heightOffset - 1.62f; + float heightOffset = player->heightOffset - 1.62f; - float x = player->xo + (player->x - player->xo) * a; - float y = player->yo + (player->y - player->yo) * a - heightOffset; + float x = player->xo + (player->x - player->xo) * a; + float y = player->yo + (player->y - player->yo) * a - heightOffset; //printf("camera y: %f\n", y); - float z = player->zo + (player->z - player->zo) * a; + float z = player->zo + (player->z - player->zo) * a; //printf("rot: %f %f\n", cameraRollO, cameraRoll); - glRotatef2(cameraRollO + (cameraRoll - cameraRollO) * a, 0, 0, 1); + glRotatef2(cameraRollO + (cameraRoll - cameraRollO) * a, 0, 0, 1); //LOGI("player. alive, removed: %d, %d\n", player->isAlive(), player->removed); if(player->isPlayer() && ((Player*)player)->isSleeping()) { @@ -445,282 +451,282 @@ void GameRenderer::moveCameraToPlayer(float a) { glRotatef(player->xRotO + (player->xRot - player->xRotO) * a, -1, 0, 0); } } else if (mc->options.getBooleanValue(OPTIONS_THIRD_PERSON_VIEW)/* || (player->isPlayer() && !player->isAlive())*/) { - float cameraDist = thirdDistanceO + (thirdDistance - thirdDistanceO) * a; + float cameraDist = thirdDistanceO + (thirdDistance - thirdDistanceO) * a; - if (mc->options.getBooleanValue(OPTIONS_FIXED_CAMERA)) { + if (mc->options.getBooleanValue(OPTIONS_FIXED_CAMERA)) { - float rotationY = thirdRotationO + (thirdRotation - thirdRotationO) * a; - float xRot = thirdTiltO + (thirdTilt - thirdTiltO) * a; + float rotationY = thirdRotationO + (thirdRotation - thirdRotationO) * a; + float xRot = thirdTiltO + (thirdTilt - thirdTiltO) * a; - glTranslatef2(0, 0, (float) -cameraDist); - glRotatef2(xRot, 1, 0, 0); - glRotatef2(rotationY, 0, 1, 0); - } else { - float yRot = player->yRot; - float xRot = player->xRot/* + 180.0f*/; - float xd = -Mth::sin(yRot / 180 * Mth::PI) * Mth::cos(xRot / 180 * Mth::PI) * cameraDist; - float zd = Mth::cos(yRot / 180 * Mth::PI) * Mth::cos(xRot / 180 * Mth::PI) * cameraDist; - float yd = -Mth::sin(xRot / 180 * Mth::PI) * cameraDist; + glTranslatef2(0, 0, (float) -cameraDist); + glRotatef2(xRot, 1, 0, 0); + glRotatef2(rotationY, 0, 1, 0); + } else { + float yRot = player->yRot; + float xRot = player->xRot/* + 180.0f*/; + float xd = -Mth::sin(yRot / 180 * Mth::PI) * Mth::cos(xRot / 180 * Mth::PI) * cameraDist; + float zd = Mth::cos(yRot / 180 * Mth::PI) * Mth::cos(xRot / 180 * Mth::PI) * cameraDist; + float yd = -Mth::sin(xRot / 180 * Mth::PI) * cameraDist; - for (int i = 0; i < 8; i++) { - float xo = (float)((i & 1) * 2 - 1); - float yo = (float)(((i >> 1) & 1) * 2 - 1); - float zo = (float)(((i >> 2) & 1) * 2 - 1); + for (int i = 0; i < 8; i++) { + float xo = (float)((i & 1) * 2 - 1); + float yo = (float)(((i >> 1) & 1) * 2 - 1); + float zo = (float)(((i >> 2) & 1) * 2 - 1); - xo *= 0.1f; - yo *= 0.1f; - zo *= 0.1f; + xo *= 0.1f; + yo *= 0.1f; + zo *= 0.1f; - HitResult hr = mc->level->clip(Vec3(x + xo, y + yo, z + zo), Vec3(x - xd + xo + zo, y - yd + yo, z - zd + zo)); // newTemp + HitResult hr = mc->level->clip(Vec3(x + xo, y + yo, z + zo), Vec3(x - xd + xo + zo, y - yd + yo, z - zd + zo)); // newTemp if (hr.type != NO_HIT) { - float dist = hr.pos.distanceTo(Vec3(x, y, z)); // newTemp - if (dist < cameraDist) cameraDist = dist; - } - } + float dist = hr.pos.distanceTo(Vec3(x, y, z)); // newTemp + if (dist < cameraDist) cameraDist = dist; + } + } //glRotatef2(180, 0, 1, 0); glRotatef2(player->xRot - xRot, 1, 0, 0); - glRotatef2(player->yRot - yRot, 0, 1, 0); - glTranslatef2(0, 0, (float) -cameraDist); - glRotatef2(yRot - player->yRot, 0, 1, 0); - glRotatef2(xRot - player->xRot, 1, 0, 0); - } - } else { - glTranslatef2(0, 0, -0.1f); - } + glRotatef2(player->yRot - yRot, 0, 1, 0); + glTranslatef2(0, 0, (float) -cameraDist); + glRotatef2(yRot - player->yRot, 0, 1, 0); + glRotatef2(xRot - player->xRot, 1, 0, 0); + } + } else { + glTranslatef2(0, 0, -0.1f); + } - if (!mc->options.getBooleanValue(OPTIONS_FIXED_CAMERA)) { - glRotatef2(player->xRotO + (player->xRot - player->xRotO) * a, 1.0f, 0.0f, 0.0f); - glRotatef2(player->yRotO + (player->yRot - player->yRotO) * a + 180, 0, 1, 0); + if (!mc->options.getBooleanValue(OPTIONS_FIXED_CAMERA)) { + glRotatef2(player->xRotO + (player->xRot - player->xRotO) * a, 1.0f, 0.0f, 0.0f); + glRotatef2(player->yRotO + (player->yRot - player->yRotO) * a + 180, 0, 1, 0); //if (_t_keepPic > 0) } - glTranslatef2(0, heightOffset, 0); + glTranslatef2(0, heightOffset, 0); } /*private*/ void GameRenderer::bobHurt(float a) { - Mob* player = mc->cameraTargetPlayer; + Mob* player = mc->cameraTargetPlayer; - float hurt = player->hurtTime - a; + float hurt = player->hurtTime - a; - if (player->health <= 0) { - float duration = player->deathTime + a; - glRotatef2(40 - (40 * 200) / (duration + 200), 0, 0, 1); - } + if (player->health <= 0) { + float duration = player->deathTime + a; + glRotatef2(40 - (40 * 200) / (duration + 200), 0, 0, 1); + } - if (player->hurtTime <= 0) return; + if (player->hurtTime <= 0) return; hurt /= player->hurtDuration; - hurt = (float) Mth::sin(hurt * hurt * hurt * hurt * Mth::PI); + hurt = (float) Mth::sin(hurt * hurt * hurt * hurt * Mth::PI); - float rr = player->hurtDir; + float rr = player->hurtDir; - glRotatef2(-rr, 0, 1, 0); - glRotatef2(-hurt * 14, 0, 0, 1); - glRotatef2(+rr, 0, 1, 0); + glRotatef2(-rr, 0, 1, 0); + glRotatef2(-hurt * 14, 0, 0, 1); + glRotatef2(+rr, 0, 1, 0); } /*private*/ void GameRenderer::bobView(float a) { - //if (mc->options.thirdPersonView) return; + //if (mc->options.thirdPersonView) return; if (!(mc->cameraTargetPlayer->isPlayer())) { - return; - } - Player* player = (Player*) mc->cameraTargetPlayer; + return; + } + Player* player = (Player*) mc->cameraTargetPlayer; - float wda = player->walkDist - player->walkDistO; - float b = -(player->walkDist + wda * a); - float bob = player->oBob + (player->bob - player->oBob) * a; - float tilt = player->oTilt + (player->tilt - player->oTilt) * a; - glTranslatef2((float) Mth::sin(b * Mth::PI) * bob * 0.5f, -(float) std::abs(Mth::cos(b * Mth::PI) * bob), 0); - glRotatef2((float) Mth::sin(b * Mth::PI) * bob * 3, 0, 0, 1); - glRotatef2((float) std::abs(Mth::cos(b * Mth::PI - 0.2f) * bob) * 5, 1, 0, 0); - glRotatef2((float) tilt, 1, 0, 0); + float wda = player->walkDist - player->walkDistO; + float b = -(player->walkDist + wda * a); + float bob = player->oBob + (player->bob - player->oBob) * a; + float tilt = player->oTilt + (player->tilt - player->oTilt) * a; + glTranslatef2((float) Mth::sin(b * Mth::PI) * bob * 0.5f, -(float) std::abs(Mth::cos(b * Mth::PI) * bob), 0); + glRotatef2((float) Mth::sin(b * Mth::PI) * bob * 3, 0, 0, 1); + glRotatef2((float) std::abs(Mth::cos(b * Mth::PI - 0.2f) * bob) * 5, 1, 0, 0); + glRotatef2((float) tilt, 1, 0, 0); } /*private*/ void GameRenderer::setupFog(int i) { - Mob* player = mc->cameraTargetPlayer; + Mob* player = mc->cameraTargetPlayer; float fogBuffer[4] = {fr, fg, fb, 1}; - glFogfv(GL_FOG_COLOR, (GLfloat*)fogBuffer); - glColor4f2(1, 1, 1, 1); + glFogfv(GL_FOG_COLOR, (GLfloat*)fogBuffer); + glColor4f2(1, 1, 1, 1); - if (player->isUnderLiquid(Material::water)) { - glFogx(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06 + if (player->isUnderLiquid(Material::water)) { + glFogx(GL_FOG_MODE, GL_EXP); + glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06 -// float rr = 0.4f; -// float gg = 0.4f; -// float bb = 0.9f; -// -// if (mc->options.anaglyph3d) { -// float rrr = (rr * 30 + gg * 59 + bb * 11) / 100; -// float ggg = (rr * 30 + gg * 70) / (100); -// float bbb = (rr * 30 + bb * 70) / (100); -// -// rr = rrr; -// gg = ggg; -// bb = bbb; -// } - } else if (player->isUnderLiquid(Material::lava)) { - glFogx(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 2.f); // was 0.06 -// float rr = 0.4f; -// float gg = 0.3f; -// float bb = 0.3f; -// -// if (mc->options.anaglyph3d) { -// float rrr = (rr * 30 + gg * 59 + bb * 11) / 100; -// float ggg = (rr * 30 + gg * 70) / (100); -// float bbb = (rr * 30 + bb * 70) / (100); -// -// rr = rrr; -// gg = ggg; -// bb = bbb; -// } - } else { - glFogx(GL_FOG_MODE, GL_LINEAR); - glFogf(GL_FOG_START, renderDistance * 0.6f); - glFogf(GL_FOG_END, renderDistance); - if (i < 0) { - glFogf(GL_FOG_START, 0); - glFogf(GL_FOG_END, renderDistance * 1.0f); - } + // float rr = 0.4f; + // float gg = 0.4f; + // float bb = 0.9f; + // + // if (mc->options.anaglyph3d) { + // float rrr = (rr * 30 + gg * 59 + bb * 11) / 100; + // float ggg = (rr * 30 + gg * 70) / (100); + // float bbb = (rr * 30 + bb * 70) / (100); + // + // rr = rrr; + // gg = ggg; + // bb = bbb; + // } + } else if (player->isUnderLiquid(Material::lava)) { + glFogx(GL_FOG_MODE, GL_EXP); + glFogf(GL_FOG_DENSITY, 2.f); // was 0.06 + // float rr = 0.4f; + // float gg = 0.3f; + // float bb = 0.3f; + // + // if (mc->options.anaglyph3d) { + // float rrr = (rr * 30 + gg * 59 + bb * 11) / 100; + // float ggg = (rr * 30 + gg * 70) / (100); + // float bbb = (rr * 30 + bb * 70) / (100); + // + // rr = rrr; + // gg = ggg; + // bb = bbb; + // } + } else { + glFogx(GL_FOG_MODE, GL_LINEAR); + glFogf(GL_FOG_START, renderDistance * 0.6f); + glFogf(GL_FOG_END, renderDistance); + if (i < 0) { + glFogf(GL_FOG_START, 0); + glFogf(GL_FOG_END, renderDistance * 1.0f); + } - if (mc->level->dimension->foggy) { - glFogf(GL_FOG_START, 0); - } - } + if (mc->level->dimension->foggy) { + glFogf(GL_FOG_START, 0); + } + } - glEnable2(GL_COLOR_MATERIAL); - //glColorMaterial(GL_FRONT, GL_AMBIENT); + glEnable2(GL_COLOR_MATERIAL); + //glColorMaterial(GL_FRONT, GL_AMBIENT); } void GameRenderer::updateAllChunks() { - mc->levelRenderer->updateDirtyChunks(mc->cameraTargetPlayer, true); + mc->levelRenderer->updateDirtyChunks(mc->cameraTargetPlayer, true); } bool GameRenderer::updateFreeformPickDirection(float a, Vec3& outDir) { - if (!mc->inputHolder->allowPicking()) { - _shTicks = 1; - return false; - } + if (!mc->inputHolder->allowPicking()) { + _shTicks = 1; + return false; + } - Vec3 c = mc->cameraTargetPlayer->getPos(a); + Vec3 c = mc->cameraTargetPlayer->getPos(a); - bool firstPerson = !mc->options.getBooleanValue(OPTIONS_THIRD_PERSON_VIEW); - const float PickingDistance = firstPerson? 6.0f : 12.0f; + bool firstPerson = !mc->options.getBooleanValue(OPTIONS_THIRD_PERSON_VIEW); + const float PickingDistance = firstPerson? 6.0f : 12.0f; - _shTicks = -1; + _shTicks = -1; - int vp[4] = {0, 0, mc->width, mc->height}; - float pt[3]; - float x = mc->inputHolder->mousex; - float y = mc->height - mc->inputHolder->mousey; + int vp[4] = {0, 0, mc->width, mc->height}; + float pt[3]; + float x = mc->inputHolder->mousex; + float y = mc->height - mc->inputHolder->mousey; - //sw.start(); + //sw.start(); - if (!glhUnProjectf(x, y, 1, lastModelMatrix, lastProjMatrix, vp, pt)) { - return false; - } - Vec3 p1(pt[0] + c.x, pt[1] + c.y, pt[2] + c.z); + if (!glhUnProjectf(x, y, 1, lastModelMatrix, lastProjMatrix, vp, pt)) { + return false; + } + Vec3 p1(pt[0] + c.x, pt[1] + c.y, pt[2] + c.z); - glhUnProjectf(x, y, 0, lastModelMatrix, lastProjMatrix, vp, pt); - Vec3 p0(pt[0] + c.x, pt[1] + c.y, pt[2] + c.z); + glhUnProjectf(x, y, 0, lastModelMatrix, lastProjMatrix, vp, pt); + Vec3 p0(pt[0] + c.x, pt[1] + c.y, pt[2] + c.z); - outDir = (p1 - p0).normalized(); - p1 = p0 + outDir * PickingDistance; + outDir = (p1 - p0).normalized(); + p1 = p0 + outDir * PickingDistance; - //sw.stop(); - //sw.printEvery(30, "unproject "); + //sw.stop(); + //sw.printEvery(30, "unproject "); - const HitResult& hit = mc->hitResult = mc->level->clip(p0, p1, false); + const HitResult& hit = mc->hitResult = mc->level->clip(p0, p1, false); - // If in 3rd person view - verify that the hit target is within range - if (!firstPerson && hit.isHit()) { - const float MaxSqrDist = PickingDistance*PickingDistance; - if (mc->cameraTargetPlayer->distanceToSqr((float)hit.x, (float)hit.y, (float)hit.z) > MaxSqrDist) - mc->hitResult.type = NO_HIT; - } - return true; + // If in 3rd person view - verify that the hit target is within range + if (!firstPerson && hit.isHit()) { + const float MaxSqrDist = PickingDistance*PickingDistance; + if (mc->cameraTargetPlayer->distanceToSqr((float)hit.x, (float)hit.y, (float)hit.z) > MaxSqrDist) + mc->hitResult.type = NO_HIT; + } + return true; } /*public*/ void GameRenderer::pick(float a) { if (mc->level == NULL) return; - if (mc->cameraTargetPlayer == NULL) return; + if (mc->cameraTargetPlayer == NULL) return; if (!mc->cameraTargetPlayer->isAlive()) return; - float range = mc->gameMode->getPickRange(); - bool isPicking = true; + float range = mc->gameMode->getPickRange(); + bool isPicking = true; - bool freeform = mc->useTouchscreen(); //&& !mc->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA); - - if (freeform) { - isPicking = updateFreeformPickDirection(a, pickDirection); - } else { - mc->hitResult = mc->cameraTargetPlayer->pick(range, a); - pickDirection = mc->cameraTargetPlayer->getViewVector(a); - } + bool freeform = mc->useTouchscreen(); //&& !mc->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA); - Vec3 from = mc->cameraTargetPlayer->getPos(a); - float dist = range; + if (freeform) { + isPicking = updateFreeformPickDirection(a, pickDirection); + } else { + mc->hitResult = mc->cameraTargetPlayer->pick(range, a); + pickDirection = mc->cameraTargetPlayer->getViewVector(a); + } + + Vec3 from = mc->cameraTargetPlayer->getPos(a); + float dist = range; if (mc->hitResult.isHit()) { - dist = mc->hitResult.pos.distanceTo(from); - } + dist = mc->hitResult.pos.distanceTo(from); + } if (mc->gameMode->isCreativeType()) { - /*dist =*/ range = 12; - } else { - if (dist > 3) dist = 3; - range = dist; - } + /*dist =*/ range = 12; + } else { + if (dist > 3) dist = 3; + range = dist; + } - Vec3 pv = (pickDirection * range); - Vec3 to = from + pv; - mc->cameraTargetPlayer->aimDirection = pickDirection; + Vec3 pv = (pickDirection * range); + Vec3 to = from + pv; + mc->cameraTargetPlayer->aimDirection = pickDirection; - Entity* hovered = NULL; - const float g = 1; - AABB aabb = mc->cameraTargetPlayer->bb.expand(pv.x, pv.y, pv.z).grow(g, g, g); + Entity* hovered = NULL; + const float g = 1; + AABB aabb = mc->cameraTargetPlayer->bb.expand(pv.x, pv.y, pv.z).grow(g, g, g); EntityList& objects = mc->level->getEntities(mc->cameraTargetPlayer, aabb); - float nearest = 0; - for (unsigned int i = 0; i < objects.size(); i++) { - Entity* e = objects[i]; - if (!e->isPickable()) continue; + float nearest = 0; + for (unsigned int i = 0; i < objects.size(); i++) { + Entity* e = objects[i]; + if (!e->isPickable()) continue; - float rr = e->getPickRadius(); - AABB bb = e->bb.grow(rr, rr, rr); - HitResult p = bb.clip(from, to); + float rr = e->getPickRadius(); + AABB bb = e->bb.grow(rr, rr, rr); + HitResult p = bb.clip(from, to); //printf("Clip Hitresult %d (%d)\n", p.type, p.isHit()); - if (bb.contains(from)) { - //@todo: hovered = e; break; ? - if (nearest >= 0) { - hovered = e; - nearest = 0; - } + if (bb.contains(from)) { + //@todo: hovered = e; break; ? + if (nearest >= 0) { + hovered = e; + nearest = 0; + } } else if (p.isHit()) { - float dd = from.distanceTo(p.pos); - if (dd < nearest || nearest == 0) { - hovered = e; - nearest = dd; - } - } - } + float dd = from.distanceTo(p.pos); + if (dd < nearest || nearest == 0) { + hovered = e; + nearest = dd; + } + } + } - if (hovered != NULL) { + if (hovered != NULL) { if(nearest < dist) { mc->hitResult = HitResult(hovered); } - } + } else if (isPicking && !mc->hitResult.isHit()) { // if we don't have a hit result, attempt to hit the edge of the block we are standing on // (this is an pocket edition simplification to help building floors) - //LOGI("hovered : %d (%f)\n", mc->hitResult.type, viewVec.y); + //LOGI("hovered : %d (%f)\n", mc->hitResult.type, viewVec.y); if (pickDirection.y < -.7f) { // looking down by more than roughly 45 degrees, fetch a hit to the block standing on Vec3 to = from.add(0, -2.0f, 0); @@ -731,9 +737,9 @@ void GameRenderer::pick(float a) { mc->hitResult.indirectHit = true; // change face (not up) if (std::abs(pickDirection.x) > std::abs(pickDirection.z)) { - mc->hitResult.f = (pickDirection.x < 0)? 4 : 5; + mc->hitResult.f = (pickDirection.x < 0)? 4 : 5; } else { - mc->hitResult.f = (pickDirection.z < 0)? 2 : 3; + mc->hitResult.f = (pickDirection.z < 0)? 2 : 3; } } } @@ -756,93 +762,93 @@ void GameRenderer::tick(int nTick, int maxTick) { //LOGI("x: %f\n", _rotX); - if (nTick == maxTick) { - const float tickMult = 1.0f / (float)(1 + maxTick); - _rotXlast = 0.4f * std::pow(std::abs(_rotX), 1.2f) * tickMult; - if (_rotX < 0) _rotXlast = -_rotXlast; + if (nTick == maxTick) { + const float tickMult = 1.0f / (float)(1 + maxTick); + _rotXlast = 0.4f * std::pow(std::abs(_rotX), 1.2f) * tickMult; + if (_rotX < 0) _rotXlast = -_rotXlast; - _rotYlast = 0.4f * std::pow(std::abs(_rotY), 1.2f) * tickMult; - if (_rotY < 0) _rotYlast = -_rotYlast; + _rotYlast = 0.4f * std::pow(std::abs(_rotY), 1.2f) * tickMult; + if (_rotY < 0) _rotYlast = -_rotYlast; - _rotX = 0; - _rotY = 0; - } + _rotX = 0; + _rotY = 0; + } - fogBrO = fogBr; - thirdDistanceO = thirdDistance; - thirdRotationO = thirdRotation; - thirdTiltO = thirdTilt; - fovOffsetO = fovOffset; - cameraRollO = cameraRoll; + fogBrO = fogBr; + thirdDistanceO = thirdDistance; + thirdRotationO = thirdRotation; + thirdTiltO = thirdTilt; + fovOffsetO = fovOffset; + cameraRollO = cameraRoll; - if (mc->cameraTargetPlayer == NULL) { - mc->cameraTargetPlayer = mc->player; - } + if (mc->cameraTargetPlayer == NULL) { + mc->cameraTargetPlayer = mc->player; + } tickFov(); - float brr = mc->level->getBrightness( Mth::floor(mc->cameraTargetPlayer->x), - Mth::floor(mc->cameraTargetPlayer->y), - Mth::floor(mc->cameraTargetPlayer->z)); + float brr = mc->level->getBrightness( Mth::floor(mc->cameraTargetPlayer->x), + Mth::floor(mc->cameraTargetPlayer->y), + Mth::floor(mc->cameraTargetPlayer->z)); float whiteness = (3 - mc->options.getIntValue(OPTIONS_VIEW_DISTANCE)) / 3.0f; - float fogBrT = brr * (1 - whiteness) + whiteness; - fogBr += (fogBrT - fogBr) * 0.1f; + float fogBrT = brr * (1 - whiteness) + whiteness; + fogBr += (fogBrT - fogBr) * 0.1f; - _tick++; + _tick++; - itemInHandRenderer->tick(); -// if (mc->isRaining) tickRain(); + itemInHandRenderer->tick(); + // if (mc->isRaining) tickRain(); } /*private*/ void GameRenderer::setupClearColor(float a) { - Level* level = mc->level; - Mob* player = mc->cameraTargetPlayer; + Level* level = mc->level; + Mob* player = mc->cameraTargetPlayer; - float whiteness = 1.0f / (4 - mc->options.getIntValue(OPTIONS_VIEW_DISTANCE)); - whiteness = 1 - (float) pow(whiteness, 0.25f); + float whiteness = 1.0f / (4 - mc->options.getIntValue(OPTIONS_VIEW_DISTANCE)); + whiteness = 1 - (float) pow(whiteness, 0.25f); - Vec3 skyColor = level->getSkyColor(mc->cameraTargetPlayer, a); - float sr = (float) skyColor.x; - float sg = (float) skyColor.y; - float sb = (float) skyColor.z; + Vec3 skyColor = level->getSkyColor(mc->cameraTargetPlayer, a); + float sr = (float) skyColor.x; + float sg = (float) skyColor.y; + float sb = (float) skyColor.z; - Vec3 fogColor = level->getFogColor(a); - fr = (float) fogColor.x; - fg = (float) fogColor.y; - fb = (float) fogColor.z; + Vec3 fogColor = level->getFogColor(a); + fr = (float) fogColor.x; + fg = (float) fogColor.y; + fb = (float) fogColor.z; - fr += (sr - fr) * whiteness; - fg += (sg - fg) * whiteness; - fb += (sb - fb) * whiteness; + fr += (sr - fr) * whiteness; + fg += (sg - fg) * whiteness; + fb += (sb - fb) * whiteness; - if (player->isUnderLiquid(Material::water)) { - fr = 0.02f; - fg = 0.02f; - fb = 0.2f; - } else if (player->isUnderLiquid(Material::lava)) { - fr = 0.6f; - fg = 0.1f; - fb = 0.00f; - } + if (player->isUnderLiquid(Material::water)) { + fr = 0.02f; + fg = 0.02f; + fb = 0.2f; + } else if (player->isUnderLiquid(Material::lava)) { + fr = 0.6f; + fg = 0.1f; + fb = 0.00f; + } - float brr = fogBrO + (fogBr - fogBrO) * a; - fr *= brr; - fg *= brr; - fb *= brr; + float brr = fogBrO + (fogBr - fogBrO) * a; + fr *= brr; + fg *= brr; + fb *= brr; - if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { - float frr = (fr * 30 + fg * 59 + fb * 11) / 100; - float fgg = (fr * 30 + fg * 70) / (100); - float fbb = (fr * 30 + fb * 70) / (100); + if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) { + float frr = (fr * 30 + fg * 59 + fb * 11) / 100; + float fgg = (fr * 30 + fg * 70) / (100); + float fbb = (fr * 30 + fb * 70) / (100); - fr = frr; - fg = fgg; - fb = fbb; - } + fr = frr; + fg = fgg; + fb = fbb; + } - glClearColor(fr, fg, fb, 1.0f); + glClearColor(fr, fg, fb, 1.0f); } void GameRenderer::zoomRegion( float zoom, float xa, float ya ) @@ -864,7 +870,7 @@ void GameRenderer::setupGuiScreen( bool clearColorBuffer ) // Setup GUI render mode GLbitfield clearBits = clearColorBuffer? - GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT : GL_DEPTH_BUFFER_BIT; glClear(clearBits); glMatrixMode(GL_PROJECTION); @@ -877,15 +883,15 @@ void GameRenderer::setupGuiScreen( bool clearColorBuffer ) /*private*/ void GameRenderer::renderItemInHand(float a, int eye) { - glLoadIdentity2(); - if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) glTranslatef2((eye * 2 - 1) * 0.10f, 0, 0); + glLoadIdentity2(); + if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) glTranslatef2((eye * 2 - 1) * 0.10f, 0, 0); - glPushMatrix2(); - bobHurt(a); - if (mc->options.getBooleanValue(OPTIONS_VIEW_BOBBING)) bobView(a); + glPushMatrix2(); + bobHurt(a); + if (mc->options.getBooleanValue(OPTIONS_VIEW_BOBBING)) bobView(a); - if (!mc->options.getBooleanValue(OPTIONS_THIRD_PERSON_VIEW) && (mc->cameraTargetPlayer->isPlayer() && !((Player*)mc->cameraTargetPlayer)->isSleeping())) { - if (!mc->options.getBooleanValue(OPTIONS_HIDEGUI)) { + if (!mc->options.getBooleanValue(OPTIONS_THIRD_PERSON_VIEW) && (mc->cameraTargetPlayer->isPlayer() && !((Player*)mc->cameraTargetPlayer)->isSleeping())) { + if (!mc->options.getBooleanValue(OPTIONS_HIDEGUI)) { float fov = getFov(a, false); if (fov != _setupCameraFov) { glMatrixMode(GL_PROJECTION); @@ -893,16 +899,16 @@ void GameRenderer::renderItemInHand(float a, int eye) { gluPerspective(fov, mc->width / (float) mc->height, 0.05f, renderDistance); glMatrixMode(GL_MODELVIEW); } - itemInHandRenderer->render(a); - } - } + itemInHandRenderer->render(a); + } + } - glPopMatrix2(); - if (!mc->options.getBooleanValue(OPTIONS_THIRD_PERSON_VIEW) && (mc->cameraTargetPlayer->isPlayer() && !((Player*)mc->cameraTargetPlayer)->isSleeping())) { - itemInHandRenderer->renderScreenEffect(a); - bobHurt(a); - } - if (mc->options.getBooleanValue(OPTIONS_VIEW_BOBBING)) bobView(a); + glPopMatrix2(); + if (!mc->options.getBooleanValue(OPTIONS_THIRD_PERSON_VIEW) && (mc->cameraTargetPlayer->isPlayer() && !((Player*)mc->cameraTargetPlayer)->isSleeping())) { + itemInHandRenderer->renderScreenEffect(a); + bobHurt(a); + } + if (mc->options.getBooleanValue(OPTIONS_VIEW_BOBBING)) bobView(a); } void GameRenderer::onGraphicsReset() @@ -912,9 +918,9 @@ void GameRenderer::onGraphicsReset() void GameRenderer::saveMatrices() { - #if defined(RPI) - return; - #endif +#if defined(RPI) + return; +#endif static bool saved = false; //if (saved) return; diff --git a/src/client/renderer/ItemInHandRenderer.cpp b/src/client/renderer/ItemInHandRenderer.cpp index f279a9c..fdd495b 100755 --- a/src/client/renderer/ItemInHandRenderer.cpp +++ b/src/client/renderer/ItemInHandRenderer.cpp @@ -21,11 +21,12 @@ #include "../../world/item/BowItem.h" #include "../../world/level/tile/LeafTile.h" #include "entity/HumanoidMobRenderer.h" +#include "Lighting.h" //static StopwatchHandler handler; ItemInHandRenderer::ItemInHandRenderer( Minecraft* mc ) -: mc(mc), + : mc(mc), lastSlot(-1), height(0), oHeight(0), @@ -49,21 +50,47 @@ ItemInHandRenderer::ItemInHandRenderer( Minecraft* mc ) void ItemInHandRenderer::tick() { oHeight = height; - item.id = 0; + //item.id = 0; ItemInstance* itemInHand = mc->player->inventory->getSelected(); - if (itemInHand && itemInHand->count > 0) { - item.id = itemInHand->id; - item.setAuxValue(itemInHand->getAuxValue()); + bool sameItem = (itemInHand && item.id == itemInHand->id && item.getAuxValue() == itemInHand->getAuxValue()); + + + + if (mc->options.getBooleanValue(OPTIONS_RESTORED_ANIMS)) // if enabled, restores and fixes item switching animation + { + if (!itemInHand && item.id == 0) sameItem = true; + float max = 0.4f; + float tHeight = sameItem ? 1 : 0; + float dd = tHeight - height; + if (dd < -max) dd = -max; + if (dd > max) dd = max; + + height += dd; + + if (height < 0.1){ + if (itemInHand && itemInHand->count > 0) { + item.id = itemInHand->id; + item.setAuxValue(itemInHand->getAuxValue()); + } else { + item.id = 0; + } + } + } else // otherwise use vanilla broken behaviour where it instantly switches items/blocks + { + if (itemInHand && itemInHand->count > 0) { + item.id = itemInHand->id; + item.setAuxValue(itemInHand->getAuxValue()); + } + + float max = 0.4f; + float tHeight = 1;//matches ? 1 : 0; + float dd = tHeight - height; + if (dd < -max) dd = -max; + if (dd > max) dd = max; + + height += dd; } - - float max = 0.4f; - float tHeight = 1;//matches ? 1 : 0; - float dd = tHeight - height; - if (dd < -max) dd = -max; - if (dd > max) dd = max; - - height += dd; } void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) @@ -92,7 +119,7 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) if(mob != NULL) { itemIcon = mob->getItemInHandIcon(item, 0); } - + bool reTesselate(false); if(itemIcon != lastIconRendered && lastItemRendered == itemId) reTesselate = true; @@ -139,9 +166,9 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) float v1 = (vp * 16 + 15.99f) / 256.0f; float r = 1.0f; -// float xo = 0.0f; -// float yo = 0.3f; -/* + // float xo = 0.0f; + // float yo = 0.3f; + /* //glEnable2(GL_RESCALE_NORMAL); glTranslatef2(-xo, -yo, 0); float s = 1.5f; @@ -150,19 +177,28 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) glRotatef2(50, 0, 1, 0); glRotatef2(45 + 290, 0, 0, 1); glTranslatef2(-15 / 16.0f, -1 / 16.0f, 0); -*/ + */ float dd = 1 / 16.0f; + float col = 1.0f; + float br = mc->player->getBrightness(0); + + t.color(col*br,col*br,col*br,1.0f); + t.normal(0.0f, 0.0f, 1.0f); t.vertexUV(0, 0, 0, u0, v1); t.vertexUV(r, 0, 0, u1, v1); t.vertexUV(r, 1, 0, u1, v0); t.vertexUV(0, 1, 0, u0, v0); + t.normal(0.0f, 0.0f, -1.0f); t.vertexUV(0, 1, 0 - dd, u0, v0); t.vertexUV(r, 1, 0 - dd, u1, v0); t.vertexUV(r, 0, 0 - dd, u1, v1); t.vertexUV(0, 0, 0 - dd, u0, v1); + col = 0.8f; + t.color(col*br,col*br,col*br,1.0f); + t.normal(-1.0f, 0.0f, 0.0f); for (int i = 0; i < 16; i++) { float p = i / 16.0f; float uu = u0 + (u1 - u0) * p - 0.5f / 256.0f; @@ -172,6 +208,7 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) t.vertexUV(xx, 1, 0, uu, v0); t.vertexUV(xx, 1, 0 - dd, uu, v0); } + t.normal(1.0f, 0.0f, 0.0f); for (int i = 0; i < 16; i++) { float p = i / 16.0f; float uu = u0 + (u1 - u0) * p - 0.5f / 256.0f; @@ -181,6 +218,10 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) t.vertexUV(xx, 0, 0, uu, v1); t.vertexUV(xx, 0, 0 - dd, uu, v1); } + + col = 0.6f; + t.color(col*br,col*br,col*br,1.0f); + t.normal(0.0f, 1.0f, 0.0f); for (int i = 0; i < 16; i++) { float p = i / 16.0f; float vv = v1 + (v0 - v1) * p - 0.5f / 256.0f; @@ -190,6 +231,7 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) t.vertexUV(r, yy, 0 - dd, u1, vv); t.vertexUV(0, yy, 0 - dd, u0, vv); } + t.normal(0.0f, -1.0f, 0.0f); for (int i = 0; i < 16; i++) { float p = i / 16.0f; float vv = v1 + (v0 - v1) * p - 0.5f / 256.0f; @@ -219,7 +261,7 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) } mc->textures->loadAndBindTexture(renderObject.texture); - drawArrayVT_NoState(renderObject.chunk.vboId, renderObject.chunk.vertexCount); + drawArrayVTN_NoState(renderObject.chunk.vboId, renderObject.chunk.vertexCount); if (renderObject.isFlat) glPopMatrix2(); } @@ -227,6 +269,7 @@ void ItemInHandRenderer::renderItem(Mob* mob, ItemInstance* item ) //handler.printEvery(100); } + void ItemInHandRenderer::render( float a ) { //return; @@ -241,6 +284,8 @@ void ItemInHandRenderer::render( float a ) glPushMatrix2(); glRotatef2(player->xRotO + (player->xRot - player->xRotO) * a, 1, 0, 0); glRotatef2(player->yRotO + (player->yRot - player->yRotO) * a, 0, 1, 0); + glEnable(GL_RESCALE_NORMAL); + Lighting::turnOn(mc); glPopMatrix2(); float br = mc->level->getBrightness(Mth::floor(player->x), Mth::floor(player->y), Mth::floor(player->z)); @@ -356,7 +401,7 @@ void ItemInHandRenderer::render( float a ) mc->textures->loadAndBindTexture(player->getTexture()); glTranslatef2(-1.0f, +3.6f, +3.5f); - glRotatef2(120, 0, 0, 1); + glRotatef2(120, 0, 0, 1); glRotatef2(180 + 20, 1, 0, 0); glRotatef2(-90 - 45, 0, 1, 0); glScalef2(1.5f / 24.0f * 16, 1.5f / 24.0f * 16, 1.5f / 24.0f * 16); @@ -369,8 +414,8 @@ void ItemInHandRenderer::render( float a ) playerRenderer->renderHand(); glPopMatrix2(); } - //glDisable2(GL_RESCALE_NORMAL); - //Lighting.turnOff(); + glDisable2(GL_RESCALE_NORMAL); + Lighting::turnOff(); //w.stop(); } diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 439a443..0c77682 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -513,14 +513,14 @@ void LevelRenderer::render(const AABB& b) const { Tesselator& t = Tesselator::instance; - glColor4f2(1, 1, 1, 1); +// glColor4f2(1, 1, 1, 1); - textures->loadAndBindTexture("terrain.png"); +// textures->loadAndBindTexture("terrain.png"); // uh need to check java - shredder //t.begin(); - t.color(255, 255, 255, 255); +// t.color(255, 255, 255, 255); // again not needed, for some reason the vanilla source code tints it... white? maybe this was used for something else in MCPE's dev at one point? - shredder - t.offset(((Mob*)mc->player)->getPos(0).negated()); +// t.offset(((Mob*)mc->player)->getPos(0).negated()); // why does this even exist normally, it just makes the thing... not render t.begin(GL_LINE_STRIP); t.vertex(b.x0, b.y0, b.z0); diff --git a/src/client/renderer/Lighting.cpp b/src/client/renderer/Lighting.cpp new file mode 100644 index 0000000..5633f78 --- /dev/null +++ b/src/client/renderer/Lighting.cpp @@ -0,0 +1,48 @@ +#include "Lighting.h" +#include "gles.h" +#include "../Minecraft.h" + +void Lighting::turnOff() { + glDisable(GL_LIGHTING); + glDisable(GL_LIGHT0); + glDisable(GL_LIGHT1); + glDisable(GL_COLOR_MATERIAL); +} + +void Lighting::turnOn(Minecraft* minecraft) { + if (!minecraft->options.getBooleanValue(OPTIONS_NORMAL_LIGHTING)){ // if normal lighting is false, then just dont use the lighting system at all like in vanilla - shredder + turnOff(); + return; + } + // if normal lighting is true then enable GLES/OpenGL states to setup lighting + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); + glEnable(GL_COLOR_MATERIAL); + glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); + + constexpr float a = 0.4f; + constexpr float d = 0.6f; + constexpr float s = 0.0f; + + + //Vec3 l = world::phys::Vec3{0.2, 1.0, -0.7}.normalize(); + constexpr float lightmodel_ambient[] = {a, a, a, 1.0f}; + constexpr float diffuse[] = {d, d, d, 1.0f}; + constexpr float ambient[] = {0.0f, 0.0f, 0.0f, 1.0f}; + constexpr float specular[] = {s, s, s, 1.0f}; + + constexpr float pos0[] = {(float)(0.16169041989141428), (float)(0.8084520874101966), (float)(-0.5659164515496377), 0.0f}; + glLightfv(GL_LIGHT0, GL_POSITION, pos0); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_SPECULAR, specular); + + constexpr float pos1[] = {(float)(-0.16169041989141428), (float)(0.8084520874101966), (float)(0.5659164515496377), 0.0f}; + glLightfv(GL_LIGHT1, GL_POSITION, pos1); + glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT1, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT1, GL_SPECULAR, specular); + glShadeModel(GL_FLAT); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lightmodel_ambient); +} diff --git a/src/client/renderer/Lighting.h b/src/client/renderer/Lighting.h new file mode 100644 index 0000000..8dc5610 --- /dev/null +++ b/src/client/renderer/Lighting.h @@ -0,0 +1,12 @@ +#ifndef NET_MINECRAFT_CLIENT_RENDERER__Lighting_H__ +#define NET_MINECRAFT_CLIENT_RENDERER__Lighting_H__ + +class Minecraft; +class Lighting +{ +public: + static void turnOff(); + static void turnOn(Minecraft* minecraft); + +}; +#endif /*NET_MINECRAFT_CLIENT_RENDERER__Lighting_H__*/ \ No newline at end of file diff --git a/src/client/renderer/Tesselator.cpp b/src/client/renderer/Tesselator.cpp index dedaca3..7feff29 100755 --- a/src/client/renderer/Tesselator.cpp +++ b/src/client/renderer/Tesselator.cpp @@ -278,9 +278,9 @@ void Tesselator::vertex( float x, float y, float z ) if (hasColor) { dst.color = src.color; } - //if (hasNormal) { - // dst.normal = src.normal; - //} + if (hasNormal) { + dst.normal = src.normal; + } dst.x = src.x; dst.y = src.y; @@ -301,9 +301,9 @@ void Tesselator::vertex( float x, float y, float z ) if (hasColor) { vertex.color = _color; } - //if (hasNormal) { - // vertex.normal = _normal; - //} + if (hasNormal) { + vertex.normal = _normal; + } vertex.x = _sx * (x + xo); vertex.y = _sy * (y + yo); @@ -332,10 +332,10 @@ void Tesselator::setAccessMode(int mode) void Tesselator::normal( float x, float y, float z ) { - static int _warn_t = 0; - if ((++_warn_t & 32767) == 1) - LOGI("WARNING: Can't use normals (Tesselator::normal)\n"); - return; + //static int _warn_t = 0; + //if ((++_warn_t & 32767) == 1) + // LOGI("WARNING: Can't use normals (Tesselator::normal)\n"); + //return; if (!tesselating) printf("But.."); hasNormal = true; @@ -404,10 +404,10 @@ void Tesselator::draw() //glColorPointer2(4, GL_UNSIGNED_BYTE, VertexSizeBytes, (GLvoid*) &_varray->color); glEnableClientState2(GL_COLOR_ARRAY); } - //if (hasNormal) { - // glNormalPointer(GL_BYTE, VertexSizeBytes, (GLvoid*) (6 * 4)); - // glEnableClientState2(GL_NORMAL_ARRAY); - //} + if (hasNormal) { + glNormalPointer(GL_BYTE, VertexSizeBytes, (GLvoid*) (6 * 4)); + glEnableClientState2(GL_NORMAL_ARRAY); + } //glVertexPointer2(3, GL_FLOAT, VertexSizeBytes, (GLvoid*)&_varray); glVertexPointer2(3, GL_FLOAT, VertexSizeBytes, 0); glEnableClientState2(GL_VERTEX_ARRAY); @@ -421,7 +421,7 @@ void Tesselator::draw() glDisableClientState2(GL_VERTEX_ARRAY); if (hasTexture) glDisableClientState2(GL_TEXTURE_COORD_ARRAY); if (hasColor) glDisableClientState2(GL_COLOR_ARRAY); - //if (hasNormal) glDisableClientState2(GL_NORMAL_ARRAY); + if (hasNormal) glDisableClientState2(GL_NORMAL_ARRAY); } clear(); diff --git a/src/client/renderer/Tesselator.h b/src/client/renderer/Tesselator.h index 85bad5f..3ad1a64 100755 --- a/src/client/renderer/Tesselator.h +++ b/src/client/renderer/Tesselator.h @@ -10,7 +10,7 @@ extern const int VertexSizeBytes; -typedef VertexDeclPTC VERTEX; +typedef VertexDeclPTCN VERTEX; typedef std::map IntGLMap; diff --git a/src/client/renderer/TileRenderer.cpp b/src/client/renderer/TileRenderer.cpp index 0e53915..8c1c91c 100755 --- a/src/client/renderer/TileRenderer.cpp +++ b/src/client/renderer/TileRenderer.cpp @@ -225,7 +225,7 @@ bool TileRenderer::tesselateTorchInWorld( Tile* tt, int x, int y, int z ) bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) { - // @todo: fire alpha transparency seems to be scuffed, also it seems i might have messed up the second layer while porting from lce/java , need to look into it - shredder + // fire transparency has been fixed - shredder Tesselator& t = Tesselator::instance; @@ -2308,30 +2308,54 @@ void TileRenderer::renderEast( Tile* tt, float x, float y, float z, int tex ) void TileRenderer::renderTile( Tile* tile, int data ) { Tesselator& t = Tesselator::instance; - - t.color(0xff, 0xff, 0xff); + + t.color(0xff, 0xff, 0xff); // i disabled this, this is normally enabled in normal mcpe see if this fits OPTION_NORMAL_LIGHTING - shredder int shape = tile->getRenderShape(); if (shape == Tile::SHAPE_BLOCK) { tile->updateDefaultShape(); t.addOffset(-0.5f, -0.5f, -0.5f); t.begin(); + + t.normal(0.0f, -1.0f, 0.0f);// most normal calls in this file has been added me since they existed in java - shredder + renderFaceDown(tile, 0, 0, 0, tile->getTexture(0, data)); + + t.normal(0.0f, 1.0f, 0.0f); + renderFaceUp(tile, 0, 0, 0, tile->getTexture(1, data)); + + t.normal(0.0f, 0.0f, -1.0f); + renderNorth(tile, 0, 0, 0, tile->getTexture(2, data)); + + t.normal(0.0f, 0.0f, 1.0f); + renderSouth(tile, 0, 0, 0, tile->getTexture(3, data)); + + t.normal(-1.0f, 0.0f, 0.0f); + renderWest(tile, 0, 0, 0, tile->getTexture(4, data)); + + t.normal(1.0f, 0.0f, 0.0f); + renderEast(tile, 0, 0, 0, tile->getTexture(5, data)); t.draw(); t.addOffset(0.5f, 0.5f, 0.5f); - } else if (shape == Tile::SHAPE_CROSS_TEXTURE) { + } else if (shape == Tile::SHAPE_CROSS_TEXTURE) { // uhh java has this but is this even ever used??? - shredder t.begin(); + + t.normal(0.0f, -1.0f, 0.0f); + tesselateCrossTexture(tile, data, -0.5f, -0.5f, -0.5f); t.draw(); } else if(shape == Tile::SHAPE_STEM) { t.begin(); + + t.normal(0.0f, -1.0f, 0.0f); + tile->updateDefaultShape(); tesselateStemTexture(tile, data, tile->yy1, -0.5f, -0.5f, -0.5f); t.draw(); @@ -2340,16 +2364,39 @@ void TileRenderer::renderTile( Tile* tile, int data ) t.offset(-0.5f, -0.5f, -0.5f); float s = 1 / 16.0f; t.begin(); + + t.normal(0.0f, -1.0f, 0.0f); + renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); + + t.normal(0.0f, 1.0f, 0.0f); + renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); + + t.normal(0.0f, 0.0f, -1.0f); + t.addOffset(0, 0, s); + + renderNorth(tile, 0, 0, 0, tile->getTexture(2)); + + t.normal(0.0f, 0.0f, 1.0f); + t.addOffset(0, 0, -s); t.addOffset(0, 0, -s); + + + renderSouth(tile, 0, 0, 0, tile->getTexture(3)); + + t.normal(-1.0f, 0.0f, 0.0f); + t.addOffset(0, 0, s); t.addOffset(s, 0, 0); renderWest(tile, 0, 0, 0, tile->getTexture(4)); + + t.normal(1.0f, 0.0f, 0.0f); + t.addOffset(-s, 0, 0); t.addOffset(-s, 0, 0); renderEast(tile, 0, 0, 0, tile->getTexture(5)); @@ -2363,7 +2410,7 @@ void TileRenderer::renderTile( Tile* tile, int data ) //} else if (shape == Tile::SHAPE_TORCH) { //// t.begin(); //// t.normal(0, -1, 0); - //// tesselateTorch(tile, -0.5f, -0.5f, -0.5f, 0, 0); + /// tesselateTorch(tile, -0.5f, -0.5f, -0.5f, 0, 0); //// t.end(); } else if (shape == Tile::SHAPE_ENTITYTILE_ANIMATED) { EntityTileRenderer::instance->render(tile, data, 1.0f); @@ -2375,11 +2422,23 @@ void TileRenderer::renderTile( Tile* tile, int data ) if (i == 0) tile->setShape(0, 0, 0, 1, 1, 0.5f); if (i == 1) tile->setShape(0, 0, 0.5f, 1, 0.5f, 1); + + t.normal(0.0f, -1.0f, 0.0f); renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); + + t.normal(0.0f, 1.0f, 0.0f); renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); + + t.normal(0.0f, 0.0f, -1.0f); renderNorth(tile, 0, 0, 0, tile->getTexture(2)); + + t.normal(0.0f, 0.0f, 1.0f); renderSouth(tile, 0, 0, 0, tile->getTexture(3)); + + t.normal(-1.0f, 0.0f, 0.0f); renderWest(tile, 0, 0, 0, tile->getTexture(4)); + + t.normal(1.0f, 0.0f, 0.0f); renderEast(tile, 0, 0, 0, tile->getTexture(5)); } t.draw(); @@ -2396,12 +2455,23 @@ void TileRenderer::renderTile( Tile* tile, int data ) if (i == 2) tile->setShape(0.5f - w, 1 - w * 3, -w * 2, 0.5f + w, 1 - w, 1 + w * 2); if (i == 3) tile->setShape(0.5f - w, 0.5f - w * 3, -w * 2, 0.5f + w, 0.5f - w, 1 + w * 2); - renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); - renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); - renderNorth(tile, 0, 0, 0, tile->getTexture(2)); - renderSouth(tile, 0, 0, 0, tile->getTexture(3)); - renderWest(tile, 0, 0, 0, tile->getTexture(4)); - renderEast(tile, 0, 0, 0, tile->getTexture(5)); + t.normal(0.0f, -1.0f, 0.0f); + renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); + + t.normal(0.0f, 1.0f, 0.0f); + renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); + + t.normal(0.0f, 0.0f, -1.0f); + renderNorth(tile, 0, 0, 0, tile->getTexture(2)); + + t.normal(0.0f, 0.0f, 1.0f); + renderSouth(tile, 0, 0, 0, tile->getTexture(3)); + + t.normal(-1.0f, 0.0f, 0.0f); + renderWest(tile, 0, 0, 0, tile->getTexture(4)); + + t.normal(1.0f, 0.0f, 0.0f); + renderEast(tile, 0, 0, 0, tile->getTexture(5)); } t.draw(); t.addOffset(0.5f, 0.5f, 0.5f); @@ -2415,12 +2485,23 @@ void TileRenderer::renderTile( Tile* tile, int data ) if (i == 1) tile->setShape(0.5f - w, .3f, 1 - w * 2, 0.5f + w, 1, 1); if (i == 2) tile->setShape(0.5f - w, .5f, w * 2, 0.5f + w, 1 - w, 1 - w * 2); - renderFaceUp(tile, 0, 0, 0, tile->getTexture(0)); - renderFaceDown(tile, 0, 0, 0, tile->getTexture(1)); - renderNorth(tile, 0, 0, 0, tile->getTexture(2)); - renderSouth(tile, 0, 0, 0, tile->getTexture(3)); - renderWest(tile, 0, 0, 0, tile->getTexture(4)); - renderEast(tile, 0, 0, 0, tile->getTexture(5)); + t.normal(0.0f, -1.0f, 0.0f); + renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); + + t.normal(0.0f, 1.0f, 0.0f); + renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); + + t.normal(0.0f, 0.0f, -1.0f); + renderNorth(tile, 0, 0, 0, tile->getTexture(2)); + + t.normal(0.0f, 0.0f, 1.0f); + renderSouth(tile, 0, 0, 0, tile->getTexture(3)); + + t.normal(-1.0f, 0.0f, 0.0f); + renderWest(tile, 0, 0, 0, tile->getTexture(4)); + + t.normal(1.0f, 0.0f, 0.0f); + renderEast(tile, 0, 0, 0, tile->getTexture(5)); } t.draw(); t.addOffset(0.5f, 0.5f, 0.5f); @@ -2469,7 +2550,7 @@ void TileRenderer::renderGuiTile( Tile* tile, int data ) } else if (shape == Tile::SHAPE_CROSS_TEXTURE) { t.begin(); - //t.normal(0, -1, 0); + t.normal(0, -1, 0); tesselateCrossTexture(tile, data, -0.5f, -0.5f, -0.5f); //t.end(); t.draw(); diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index ad500b2..5538fda 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -12,6 +12,7 @@ #include "../../Minecraft.h" #include "../../Option.h" +#include "../Lighting.h" EntityRenderDispatcher* EntityRenderer::entityRenderDispatcher = NULL; EntityRenderer::EntityRenderer() @@ -134,7 +135,7 @@ void EntityRenderer::postRender(Entity* entity, float x, float y, float z, float } } void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) { - + glDisable(GL_LIGHTING); int tex = ((Tile*)Tile::fire)->tex; int xt = (tex & 0xf) << 4; @@ -176,7 +177,7 @@ void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) } t.draw(); glPopMatrix2(); - // glEnable2(GL_LIGHTING); + glEnable2(GL_LIGHTING); } void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float pow, float a) { // diff --git a/src/client/renderer/entity/ItemRenderer.cpp b/src/client/renderer/entity/ItemRenderer.cpp index 72ace60..d103fcc 100755 --- a/src/client/renderer/entity/ItemRenderer.cpp +++ b/src/client/renderer/entity/ItemRenderer.cpp @@ -45,7 +45,7 @@ void ItemRenderer::render(Entity* itemEntity_, float x, float y, float z, float else if (item->count > 1) count = 2; glTranslatef2((float) x, (float) y + bob, (float) z); - //glEnable2(GL_RESCALE_NORMAL); + glEnable2(GL_RESCALE_NORMAL); if (item->id < 256 && TileRenderer::canRender(Tile::tiles[item->id]->getRenderShape())) { glRotatef2(spin, 0, 1, 0); @@ -107,7 +107,7 @@ void ItemRenderer::render(Entity* itemEntity_, float x, float y, float z, float } glRotatef2(180 - entityRenderDispatcher->playerRotY, 0, 1, 0); t.begin(); - //t.normal(0, 1, 0); + t.normal(0, 1, 0); t.vertexUV(0 - xo, 0 - yo, 0, u0, v1); t.vertexUV(r - xo, 0 - yo, 0, u1, v1); t.vertexUV(r - xo, 1 - yo, 0, u1, v0); @@ -118,7 +118,7 @@ void ItemRenderer::render(Entity* itemEntity_, float x, float y, float z, float glPopMatrix2(); } } - //glDisable2(GL_RESCALE_NORMAL); + glDisable2(GL_RESCALE_NORMAL); glPopMatrix2(); } diff --git a/src/client/renderer/entity/PlayerRenderer.cpp b/src/client/renderer/entity/PlayerRenderer.cpp index 96ee2eb..13b2b3f 100755 --- a/src/client/renderer/entity/PlayerRenderer.cpp +++ b/src/client/renderer/entity/PlayerRenderer.cpp @@ -77,10 +77,10 @@ void PlayerRenderer::render(Entity* mob_, float x, float y, float z, float rot, model = desired; humanoidModel = desired; } - LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", - ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), - humanoidModel->texWidth, humanoidModel->texHeight, - (desired == playerModel64 ? "64" : "32")); +// LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", // don't log it always, only for debug - shredder +// ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), +// humanoidModel->texWidth, humanoidModel->texHeight, +// (desired == playerModel64 ? "64" : "32")); HumanoidMobRenderer::render(mob_, x, y, z, rot, a); } diff --git a/src/client/renderer/gles.cpp b/src/client/renderer/gles.cpp index 04ae3d3..6b06488 100755 --- a/src/client/renderer/gles.cpp +++ b/src/client/renderer/gles.cpp @@ -115,6 +115,41 @@ void drawArrayVTC_NoState(int bufferId, int vertices, int vertexSize /* = 24 */) } #endif +void drawArrayVTN(int bufferId, int vertices, int vertexSize /* = 24 */) { + //if (Options::debugGl) LOGI("drawArray\n"); + //LOGI("draw-vtc: %d, %d, %d\n", bufferId, vertices, vertexSize); + glEnableClientState2(GL_VERTEX_ARRAY); + glEnableClientState2(GL_TEXTURE_COORD_ARRAY); + //glEnableClientState2(GL_COLOR_ARRAY); + glEnableClientState2(GL_NORMAL_ARRAY); + + glBindBuffer2(GL_ARRAY_BUFFER, bufferId); + + glVertexPointer2( 3, GL_FLOAT, vertexSize, 0); + glTexCoordPointer2(2, GL_FLOAT, vertexSize, (GLvoid*) (3 * 4)); + //glColorPointer2(4, GL_UNSIGNED_BYTE, vertexSize, (GLvoid*) (5*4)); + glNormalPointer(GL_BYTE, vertexSize, (GLvoid*) (6 * 4)); + + glDrawArrays2(GL_TRIANGLES, 0, vertices); + + glDisableClientState2(GL_VERTEX_ARRAY); + glDisableClientState2(GL_TEXTURE_COORD_ARRAY); + //glDisableClientState2(GL_COLOR_ARRAY); + glDisableClientState2(GL_NORMAL_ARRAY); +} + +#ifndef drawArrayVTN_NoState +void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize /* = 24 */) { + glBindBuffer2(GL_ARRAY_BUFFER, bufferId); + + glVertexPointer2( 3, GL_FLOAT, vertexSize, 0); + glTexCoordPointer2(2, GL_FLOAT, vertexSize, (GLvoid*) (3 * 4)); + //glColorPointer2(4, GL_UNSIGNED_BYTE, vertexSize, (GLvoid*) (5*4)); + glNormalPointer(GL_BYTE, vertexSize, (GLvoid*) (6 * 4)); + + glDrawArrays2(GL_TRIANGLES, 0, vertices); +} +#endif #endif diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index c6d4bec..adb36e5 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -55,13 +55,18 @@ void anGenBuffers(GLsizei n, GLuint* buffer); #ifdef USE_VBO #define drawArrayVT_NoState drawArrayVT #define drawArrayVTC_NoState drawArrayVTC -void drawArrayVT(int bufferId, int vertices, int vertexSize = 24, unsigned int mode = GL_TRIANGLES); +#define drawArrayVTN_NoState drawArrayVTN +void drawArrayVT(int bufferId, int vertices, int vertexSize = 28, unsigned int mode = GL_TRIANGLES); #ifndef drawArrayVT_NoState -//void drawArrayVT_NoState(int bufferId, int vertices, int vertexSize = 24); +//void drawArrayVT_NoState(int bufferId, int vertices, int vertexSize = 28); #endif -void drawArrayVTC(int bufferId, int vertices, int vertexSize = 24); +void drawArrayVTC(int bufferId, int vertices, int vertexSize = 28); #ifndef drawArrayVTC_NoState -void drawArrayVTC_NoState(int bufferId, int vertices, int vertexSize = 24); +void drawArrayVTC_NoState(int bufferId, int vertices, int vertexSize = 28); +#endif +void drawArrayVTN(int bufferId, int vertices, int vertexSize = 28); +#ifndef drawArrayVTN_NoState +void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize = 28); #endif #endif @@ -114,6 +119,7 @@ int glhUnProjectf( float winx, float winy, float winz, #define glVertexPointer2 glVertexPointer #define glColorPointer2 glColorPointer #define glTexCoordPointer2 glTexCoordPointer + #define glNormalPointer2 glNormalPointer #define glEnableClientState2 glEnableClientState #define glDisableClientState2 glDisableClientState #define glDrawArrays2 glDrawArrays diff --git a/src/client/renderer/ptexture/DynamicTexture.cpp b/src/client/renderer/ptexture/DynamicTexture.cpp index c3436e4..23a6464 100755 --- a/src/client/renderer/ptexture/DynamicTexture.cpp +++ b/src/client/renderer/ptexture/DynamicTexture.cpp @@ -9,7 +9,7 @@ // DynamicTexture // DynamicTexture::DynamicTexture(int tex_) -: tex(tex_), + : tex(tex_), replicate(1) { memset(pixels, 0, 16*16*4); @@ -29,8 +29,8 @@ void DynamicTexture::bindTexture(Textures* tex) { /* WaterTexture::WaterTexture() : super(Tile::water->tex), - _tick(0), - _frame(0) +_tick(0), +_frame(0) { } @@ -39,7 +39,7 @@ void WaterTexture::tick() { */ WaterTexture::WaterTexture() -: super(Tile::water->tex), + : super(Tile::water->tex), _tick(0), _frame(0) { @@ -76,55 +76,55 @@ void WaterTexture::tick() next[x + y * 16] = pow / 3.3f + heat[x + y * 16] * 0.8f; } - for (int x = 0; x < 16; x++) - for (int y = 0; y < 16; y++) { - heat[x + y * 16] += heata[x + y * 16] * 0.05f; + for (int x = 0; x < 16; x++) + for (int y = 0; y < 16; y++) { + heat[x + y * 16] += heata[x + y * 16] * 0.05f; - if (heat[x + y * 16] < 0) heat[x + y * 16] = 0; - heata[x + y * 16] -= 0.1f; - if (Mth::random() < 0.05f) { - heata[x + y * 16] = 0.5f; + if (heat[x + y * 16] < 0) heat[x + y * 16] = 0; + heata[x + y * 16] -= 0.1f; + if (Mth::random() < 0.05f) { + heata[x + y * 16] = 0.5f; + } } - } - float* tmp = next; - next = current; - current = tmp; + float* tmp = next; + next = current; + current = tmp; - for (int i = 0; i < 256; i++) { - float pow = current[i]; - if (pow > 1) pow = 1; - if (pow < 0) pow = 0; + for (int i = 0; i < 256; i++) { + float pow = current[i]; + if (pow > 1) pow = 1; + if (pow < 0) pow = 0; - float pp = pow * pow; + float pp = pow * pow; - int r = (int) (32 + pp * 32); - int g = (int) (50 + pp * 64); - int b = (int) (255); - int a = (int) (146 + pp * 50); + int r = (int) (32 + pp * 32); + int g = (int) (50 + pp * 64); + int b = (int) (255); + int a = (int) (146 + pp * 50); - //if (anaglyph3d) { - // int rr = (r * 30 + g * 59 + b * 11) / 100; - // int gg = (r * 30 + g * 70) / (100); - // int bb = (r * 30 + b * 70) / (100); + //if (anaglyph3d) { + // int rr = (r * 30 + g * 59 + b * 11) / 100; + // int gg = (r * 30 + g * 70) / (100); + // int bb = (r * 30 + b * 70) / (100); - // r = rr; - // g = gg; - // b = bb; - //} + // r = rr; + // g = gg; + // b = bb; + //} - pixels[i * 4 + 0] = r; - pixels[i * 4 + 1] = g; - pixels[i * 4 + 2] = b; - pixels[i * 4 + 3] = a; - } + pixels[i * 4 + 0] = r; + pixels[i * 4 + 1] = g; + pixels[i * 4 + 2] = b; + pixels[i * 4 + 3] = a; + } } // // WaterSideTexture // WaterSideTexture::WaterSideTexture() -: super(Tile::water->tex + 1), + : super(Tile::water->tex + 1), _tick(0), _frame(0), _tickCount(0) @@ -164,51 +164,237 @@ void WaterSideTexture::tick() { next[x + y * 16] = pow / 3.2f + heat[x + y * 16] * 0.8f; } - for (int x = 0; x < 16; x++) - for (int y = 0; y < 16; y++) { - heat[x + y * 16] += heata[x + y * 16] * 0.05f; + for (int x = 0; x < 16; x++) + for (int y = 0; y < 16; y++) { + heat[x + y * 16] += heata[x + y * 16] * 0.05f; - if (heat[x + y * 16] < 0) heat[x + y * 16] = 0; - heata[x + y * 16] -= 0.3f; - if (Mth::random() < 0.2) { - heata[x + y * 16] = 0.5f; + if (heat[x + y * 16] < 0) heat[x + y * 16] = 0; + heata[x + y * 16] -= 0.3f; + if (Mth::random() < 0.2) { + heata[x + y * 16] = 0.5f; + } } - } - float* tmp = next; - next = current; - current = tmp; + float* tmp = next; + next = current; + current = tmp; - for (int i = 0; i < 256; i++) { - float pow = current[(i - _tickCount * 16) & 255]; - if (pow > 1) pow = 1; - if (pow < 0) pow = 0; + for (int i = 0; i < 256; i++) { + float pow = current[(i - _tickCount * 16) & 255]; + if (pow > 1) pow = 1; + if (pow < 0) pow = 0; - float pp = pow * pow; + float pp = pow * pow; - int r = (int) (32 + pp * 32); - int g = (int) (50 + pp * 64); - int b = (int) (255); - int a = (int) (146 + pp * 50); + int r = (int) (32 + pp * 32); + int g = (int) (50 + pp * 64); + int b = (int) (255); + int a = (int) (146 + pp * 50); - //if (anaglyph3d) { - // int rr = (r * 30 + g * 59 + b * 11) / 100; - // int gg = (r * 30 + g * 70) / (100); - // int bb = (r * 30 + b * 70) / (100); + //if (anaglyph3d) { + // int rr = (r * 30 + g * 59 + b * 11) / 100; + // int gg = (r * 30 + g * 70) / (100); + // int bb = (r * 30 + b * 70) / (100); - // r = rr; - // g = gg; - // b = bb; - //} + // r = rr; + // g = gg; + // b = bb; + //} - pixels[i * 4 + 0] = r; - pixels[i * 4 + 1] = g; - pixels[i * 4 + 2] = b; - pixels[i * 4 + 3] = a; + pixels[i * 4 + 0] = r; + pixels[i * 4 + 1] = g; + pixels[i * 4 + 2] = b; + pixels[i * 4 + 3] = a; + } +} + +/// +/// Lava Texture +/// + +LavaTexture::LavaTexture() + : super(Tile::lava->tex), + _tick(0), + _frame(0) +{ + current = new float[16*16]; + next = new float[16*16]; + heat = new float[16*16]; + heata = new float[16*16]; + + for (int i = 0; i < 256; ++i) { + current[i] = 0; + next[i] = 0; + heat[i] = 0; + heata[i] = 0; } } +LavaTexture::~LavaTexture() { + delete[] current; + delete[] next; + delete[] heat; + delete[] heata; +} + +void LavaTexture::tick() +{ + for (int x = 0; x < 16; x++) + for (int y = 0; y < 16; y++) { + float pow = 0; + int xxo = (int)(Mth::sin((float)(y) * (float)(Mth::PI) * 2.0f / 16.0f) * 1.2f); + int yyo = (int)(Mth::sin((float)(x) * (float)(Mth::PI) * 2.0f / 16.0f) * 1.2f); + for (int xx = x - 1; xx <= x + 1; xx++) { + for (int yy = y - 1; yy <= y + 1; yy++) { + int xi = xx + xxo & 15; + int yi = yy + yyo & 15; + pow += current[xi + yi * 16]; + } + } + next[x + y * 16] = pow / 10.0f + (heat[(x + 0 & 15) + (y + 0 & 15) * 16] + heat[(x + 1 & 15) + (y + 0 & 15) * 16] + heat[(x + 1 & 15) + (y + 1 & 15) * 16] + heat[(x + 0 & 15) + (y + 1 & 15) * 16]) / 4.0f * 0.8f; + heat[x + y * 16] = heat[x + y * 16] + heata[x + y * 16] * 0.01f; + if (heat[x + y * 16] < 0.0f) { + heat[x + y * 16] = 0.0f; + } + heata[x + y * 16] = heata[x + y * 16] - 0.06f; + if (Mth::random() < 0.005) { + heata[x + y * 16] = 1.5f; + } + } + + + float* tmp = next; + next = current; + current = tmp; + + for (int i = 0; i < 256; i++) { + float pow = current[i] * 2.0f; + if (pow > 1) pow = 1; + if (pow < 0) pow = 0; + + float pp = pow * pow; + + int r = (int) (pow * 100.0f + 155.0f); + int g = (int) (pp * 255.0f); + int b = (int) (pp * pp * 128.0f); + + //if (anaglyph3d) { + // int rr = (r * 30 + g * 59 + b * 11) / 100; + // int gg = (r * 30 + g * 70) / (100); + // int bb = (r * 30 + b * 70) / (100); + + // r = rr; + // g = gg; + // b = bb; + //} + + pixels[i * 4 + 0] = r; + pixels[i * 4 + 1] = g; + pixels[i * 4 + 2] = b; + pixels[i * 4 + 3] = -1; + } +} + +/// +/// Lava Side Texture +/// + +LavaSideTexture::LavaSideTexture() + : super(Tile::lava->tex + 1), + _tick(0), + _frame(0), + _tickCount(0) +{ + replicate = 2; + + current = new float[16*16]; + next = new float[16*16]; + heat = new float[16*16]; + heata = new float[16*16]; + + for (int i = 0; i < 256; ++i) { + current[i] = 0; + next[i] = 0; + heat[i] = 0; + heata[i] = 0; + } +} + +LavaSideTexture::~LavaSideTexture() { + delete[] current; + delete[] next; + delete[] heat; + delete[] heata; +} + +void LavaSideTexture::tick() { + ++_tickCount; + for (int x = 0; x < 16; x++) + for (int y = 0; y < 16; y++) { + float pow = 0; + int yl = (int)(Mth::sin((float)(y) * (float)(Mth::PI)* 2.0f / 16.0f) * 1.2f); // var2 is y + int xl = (int)(Mth::sin((float)(x) * (float)(Mth::PI)* 2.0f / 16.0f) * 1.2f); // var1 is x + for (int yy = x - 1; yy <= x + 1; yy++) { + for (int xx = y - 1; xx <= y + 1; xx++) { + int xi = (yy + yl) & 15; // var8 + int yi = (xx + xl) & 15; //var9 + pow += current[xi + yi * 16]; + } + } + next[x + y * 16] = + next[x + y * 16] = + pow / 10.0f + ( + heat[(x + 0 & 15) + (y + 0 & 15) * + 16] + heat[ + (x + 1 & 15) + (y + 0 & 15) * 16] + heat[(x + 1 & 15) + (y + 1 & 15) * + 16] + heat[ + (x + 0 & 15) + (y + 1 & 15) * 16]) / 4.0f + * 0.8f; + heat[x + y * 16] = heat[x + y * 16] + heata[x + y * 16] * 0.01f; + + if (heat[x + y * 16] < 0.0f) { + heat[x + y * 16] = 0.0f; + } + heata[x + y * 16] = heata[x + y * 16] - 0.06f; + + if (Mth::random() < 0.005) { + heata[x + y * 16] = 1.5f; + } + } + float* tmp = next; + next = current; + current = tmp; + + for (int i = 0; i < 256; i++) { + float pow = current[(i - _tickCount / 3 * 16) & 255] * 2.0f; + if (pow > 1) pow = 1; + if (pow < 0) pow = 0; + + float pp = pow * pow; + + int r = (int) (pow * 100.0f + 155.0f); + int g = (int) (pow * pow * 255.0f); + int b = (int) (pow * pow * pow * pow * 128.0f); +// int a = (int) (146 + pp * 50); + + //if (anaglyph3d) { + // int rr = (r * 30 + g * 59 + b * 11) / 100; + // int gg = (r * 30 + g * 70) / (100); + // int bb = (r * 30 + b * 70) / (100); + + // r = rr; + // g = gg; + // b = bb; + //} + + pixels[i * 4 + 0] = r; + pixels[i * 4 + 1] = g; + pixels[i * 4 + 2] = b; + pixels[i * 4 + 3] = -1; + } +} + FireTexture::FireTexture() -: super(((Tile*)Tile::fire)->tex), + : super(((Tile*)Tile::fire)->tex), _tick(0), _frame(0) { @@ -236,63 +422,63 @@ FireTexture::~FireTexture() { // oh boy time to implement fire textures, i am so fucked - shredder void FireTexture::tick() { -// loop generates fire texture on the empty texture grid, hopefully shouldnt be too taxing on older hardware - shredder - for (int x = 0; x < 16; x++) { - for (int y = 0; y < 20; y++) { - int count = 18; - float pow = this->current[x + (y + 1) % 20 * 16] * (float)(count); - for (int xx = x - 1; xx <= x + 1; xx++) { - for (int yy = y; yy <= y + 1; yy++) { - if (xx >= 0 && yy >= 0 && xx < 16 && yy < 20) { - pow += this->current[xx + yy * 16]; - } - count++; - } - } - this->next[x + y * 16] = pow / (float(count) * 1.06f); - if (y >= 19) { - this->next[x + y * 16] = float(Mth::random() * Mth::random() * Mth::random() * 4.0 + Mth::random() * 0.1f + 0.2f); - } - } - } + // loop generates fire texture on the empty texture grid, hopefully shouldnt be too taxing on older hardware - shredder + for (int x = 0; x < 16; x++) { + for (int y = 0; y < 20; y++) { + int count = 18; + float pow = this->current[x + (y + 1) % 20 * 16] * (float)(count); + for (int xx = x - 1; xx <= x + 1; xx++) { + for (int yy = y; yy <= y + 1; yy++) { + if (xx >= 0 && yy >= 0 && xx < 16 && yy < 20) { + pow += this->current[xx + yy * 16]; + } + count++; + } + } + this->next[x + y * 16] = pow / (float(count) * 1.06f); + if (y >= 19) { + this->next[x + y * 16] = float(Mth::random() * Mth::random() * Mth::random() * 4.0 + Mth::random() * 0.1f + 0.2f); + } + } + } - // hopefully this doesn't cause any mysterious issues - shredder + // hopefully this doesn't cause any mysterious issues - shredder float* tmp = next; next = current; current = tmp; - for (int i = 0; i < 256; i++) { - float pow = this->current[i] * 1.8f; - if (pow > 1.0f) { - pow = 1.0f; - } - if (pow < 0.0f) { - pow = 0.0f; - } - - - int r = (int) (pow * 155.0f + 100.0f); - int g = (int)(pow * pow * 255.0f); - int b = (int)(pow * pow * pow * pow * pow * pow * pow * pow * pow * pow * 255.0f); - int a = 255; - if (pow < 0.5f) { - a = 0; - } + for (int i = 0; i < 256; i++) { + float pow = this->current[i] * 1.8f; + if (pow > 1.0f) { + pow = 1.0f; + } + if (pow < 0.0f) { + pow = 0.0f; + } + + + int r = (int) (pow * 155.0f + 100.0f); + int g = (int)(pow * pow * 255.0f); + int b = (int)(pow * pow * pow * pow * pow * pow * pow * pow * pow * pow * 255.0f); + int a = 255; + if (pow < 0.5f) { + a = 0; + } // @TODO: cant be arsed rn to implement the anaglyph3d check would be nice to check if it does - shredder - //if (this->anaglyph3d) { - // float rr = (r * 30 + g * 59 + b * 11) / 100; - // float gg = (r * 30 + g * 70) / 100; - // float bb = (r * 30 + b * 70) / 100; - // r = rr; - // g = gg; - // b = bb; - //} + //if (this->anaglyph3d) { + // float rr = (r * 30 + g * 59 + b * 11) / 100; + // float gg = (r * 30 + g * 70) / 100; + // float bb = (r * 30 + b * 70) / 100; + // r = rr; + // g = gg; + // b = bb; + //} pixels[i * 4 + 0] = r; pixels[i * 4 + 1] = g; pixels[i * 4 + 2] = b; pixels[i * 4 + 3] = a; - } + } } \ No newline at end of file diff --git a/src/client/renderer/ptexture/DynamicTexture.h b/src/client/renderer/ptexture/DynamicTexture.h index a28f75a..84b902e 100755 --- a/src/client/renderer/ptexture/DynamicTexture.h +++ b/src/client/renderer/ptexture/DynamicTexture.h @@ -56,6 +56,44 @@ public: void tick(); }; +class LavaTexture: public DynamicTexture +{ + typedef DynamicTexture super; + int _tick; + int _frame; + + float* current; + float* next; + float* heat; + float* heata; + +public: + LavaTexture(); + ~LavaTexture(); + + void tick(); +}; + +class LavaSideTexture: public DynamicTexture +{ + typedef DynamicTexture super; + int _tick; + int _frame; + int _tickCount; + + float* current; + float* next; + float* heat; + float* heata; + +public: + LavaSideTexture(); + ~LavaSideTexture(); + + void tick(); +}; + + class FireTexture: public DynamicTexture { typedef DynamicTexture super; diff --git a/src/world/entity/animal/Chicken.cpp b/src/world/entity/animal/Chicken.cpp index df331e3..ca08fa1 100755 --- a/src/world/entity/animal/Chicken.cpp +++ b/src/world/entity/animal/Chicken.cpp @@ -102,8 +102,8 @@ void Chicken::dropDeathLoot( /*bool wasKilledByPlayer, int playerBonusLevel*/ ) spawnAtLocation(Item::feather->id, 1); } //// and some meat - //if (isOnFire()) spawnAtLocation(Item::chicken_cooked->id, 1); //@fire - //else + if (isOnFire()) spawnAtLocation(Item::chicken_cooked->id, 1); //@fire + else spawnAtLocation(Item::chicken_raw->id, 1); } diff --git a/src/world/entity/animal/Cow.cpp b/src/world/entity/animal/Cow.cpp index 49df047..a08d39e 100755 --- a/src/world/entity/animal/Cow.cpp +++ b/src/world/entity/animal/Cow.cpp @@ -66,11 +66,11 @@ void Cow::dropDeathLoot( /*bool wasKilledByPlayer, int playerBonusLevel*/ ) { // and some meat count = random.nextInt(3) + 1; for (int i = 0; i < count; i++) { - // if (isOnFire()) { //@fire - // spawnAtLocation(Item::beef_cooked->id, 1); - // } else { + if (isOnFire()) { //@fire + spawnAtLocation(Item::beef_cooked->id, 1); + } else { spawnAtLocation(Item::beef_raw->id, 1); - // } + } } } diff --git a/src/world/entity/animal/Pig.cpp b/src/world/entity/animal/Pig.cpp index b6eb4c0..4c18b01 100755 --- a/src/world/entity/animal/Pig.cpp +++ b/src/world/entity/animal/Pig.cpp @@ -54,8 +54,8 @@ std::string Pig::getDeathSound() int Pig::getDeathLoot() { //@fire - //if (isOnFire()) - // return Item::porkChop_cooked->id; + if (isOnFire()) + return Item::porkChop_cooked->id; return Item::porkChop_raw->id; } diff --git a/src/world/level/levelgen/CanyonFeature.cpp b/src/world/level/levelgen/CanyonFeature.cpp index 095cd30..63f61d2 100755 --- a/src/world/level/levelgen/CanyonFeature.cpp +++ b/src/world/level/levelgen/CanyonFeature.cpp @@ -138,7 +138,7 @@ void CanyonFeature::addTunnel( int xOffs, int zOffs, unsigned char* blocks, floa } } -void CanyonFeature::addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks) +void CanyonFeature::addFeature(Level* level, int x, int z, int xOffs, int zOffs, unsigned char* blocks, int blocksSize) { if (random.nextInt(15) != 0) return; diff --git a/src/world/level/levelgen/CanyonFeature.h b/src/world/level/levelgen/CanyonFeature.h index a187681..6b264a5 100755 --- a/src/world/level/levelgen/CanyonFeature.h +++ b/src/world/level/levelgen/CanyonFeature.h @@ -11,8 +11,12 @@ class CanyonFeature: public LargeFeature { /*protected*/ void addTunnel(int xOffs, int zOffs, unsigned char* blocks, float xCave, float yCave, float zCave, float thickness, float yRot, float xRot, int step, int dist, float yScale); + /*protected*/ - void addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks); + void addFeature(Level* level, int x, int z, int xOffs, int zOffs, unsigned char* blocks, int blocksSize); + + + }; diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 99f8ce7..3868faa 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -17,7 +17,7 @@ const float RandomLevelSource::SNOW_SCALE = 0.3f; static const int MAX_BUFFER_SIZE = 1024; RandomLevelSource::RandomLevelSource(Level* level, long seed, int version, bool spawnMobs) -: random(seed), + : random(seed), level(level), lperlinNoise1(&random, 16), lperlinNoise2(&random, 16), @@ -32,8 +32,8 @@ RandomLevelSource::RandomLevelSource(Level* level, long seed, int version, bool //biomes(NULL) { for (int i=0; i<32; ++i) - for (int j=0; j<32; ++j) - waterDepths[i][j] = 0; + for (int j=0; j<32; ++j) + waterDepths[i][j] = 0; buffer = new float[MAX_BUFFER_SIZE]; @@ -63,155 +63,155 @@ RandomLevelSource::~RandomLevelSource() { /*public*/ void RandomLevelSource::prepareHeights(int xOffs, int zOffs, unsigned char* blocks, /*Biome*/void* biomes, float* temperatures) { - + int xChunks = 16 / CHUNK_WIDTH; - int waterHeight = Level::DEPTH - 64; + int waterHeight = Level::DEPTH - 64; - int xSize = xChunks + 1; - int ySize = 128 / CHUNK_HEIGHT + 1; - int zSize = xChunks + 1; - buffer = getHeights(buffer, xOffs * xChunks, 0, zOffs * xChunks, xSize, ySize, zSize); + int xSize = xChunks + 1; + int ySize = 128 / CHUNK_HEIGHT + 1; + int zSize = xChunks + 1; + buffer = getHeights(buffer, xOffs * xChunks, 0, zOffs * xChunks, xSize, ySize, zSize); - for (int xc = 0; xc < xChunks; xc++) { - for (int zc = 0; zc < xChunks; zc++) { - for (int yc = 0; yc < 128 / CHUNK_HEIGHT; yc++) { - float yStep = 1 / (float) CHUNK_HEIGHT; - float s0 = buffer[((xc + 0) * zSize + (zc + 0)) * ySize + (yc + 0)]; - float s1 = buffer[((xc + 0) * zSize + (zc + 1)) * ySize + (yc + 0)]; - float s2 = buffer[((xc + 1) * zSize + (zc + 0)) * ySize + (yc + 0)]; - float s3 = buffer[((xc + 1) * zSize + (zc + 1)) * ySize + (yc + 0)]; + for (int xc = 0; xc < xChunks; xc++) { + for (int zc = 0; zc < xChunks; zc++) { + for (int yc = 0; yc < 128 / CHUNK_HEIGHT; yc++) { + float yStep = 1 / (float) CHUNK_HEIGHT; + float s0 = buffer[((xc + 0) * zSize + (zc + 0)) * ySize + (yc + 0)]; + float s1 = buffer[((xc + 0) * zSize + (zc + 1)) * ySize + (yc + 0)]; + float s2 = buffer[((xc + 1) * zSize + (zc + 0)) * ySize + (yc + 0)]; + float s3 = buffer[((xc + 1) * zSize + (zc + 1)) * ySize + (yc + 0)]; - float s0a = (buffer[((xc + 0) * zSize + (zc + 0)) * ySize + (yc + 1)] - s0) * yStep; - float s1a = (buffer[((xc + 0) * zSize + (zc + 1)) * ySize + (yc + 1)] - s1) * yStep; - float s2a = (buffer[((xc + 1) * zSize + (zc + 0)) * ySize + (yc + 1)] - s2) * yStep; - float s3a = (buffer[((xc + 1) * zSize + (zc + 1)) * ySize + (yc + 1)] - s3) * yStep; + float s0a = (buffer[((xc + 0) * zSize + (zc + 0)) * ySize + (yc + 1)] - s0) * yStep; + float s1a = (buffer[((xc + 0) * zSize + (zc + 1)) * ySize + (yc + 1)] - s1) * yStep; + float s2a = (buffer[((xc + 1) * zSize + (zc + 0)) * ySize + (yc + 1)] - s2) * yStep; + float s3a = (buffer[((xc + 1) * zSize + (zc + 1)) * ySize + (yc + 1)] - s3) * yStep; - for (int y = 0; y < CHUNK_HEIGHT; y++) { - float xStep = 1 / (float) CHUNK_WIDTH; + for (int y = 0; y < CHUNK_HEIGHT; y++) { + float xStep = 1 / (float) CHUNK_WIDTH; - float _s0 = s0; - float _s1 = s1; - float _s0a = (s2 - s0) * xStep; - float _s1a = (s3 - s1) * xStep; + float _s0 = s0; + float _s1 = s1; + float _s0a = (s2 - s0) * xStep; + float _s1a = (s3 - s1) * xStep; - for (int x = 0; x < CHUNK_WIDTH; x++) { - int offs = (x + xc * CHUNK_WIDTH) << 11 | (0 + zc * CHUNK_WIDTH) << 7 | (yc * CHUNK_HEIGHT + y); - int step = 1 << 7; - float zStep = 1 / (float) CHUNK_WIDTH; + for (int x = 0; x < CHUNK_WIDTH; x++) { + int offs = (x + xc * CHUNK_WIDTH) << 11 | (0 + zc * CHUNK_WIDTH) << 7 | (yc * CHUNK_HEIGHT + y); + int step = 1 << 7; + float zStep = 1 / (float) CHUNK_WIDTH; - float val = _s0; - float vala = (_s1 - _s0) * zStep; - for (int z = 0; z < CHUNK_WIDTH; z++) { -// + (zc * CHUNK_WIDTH + z)]; - float temp = temperatures[(xc * CHUNK_WIDTH + x) * 16 + (zc * CHUNK_WIDTH + z)]; - int tileId = 0; - if (yc * CHUNK_HEIGHT + y < waterHeight) { - if (temp < SNOW_CUTOFF && yc * CHUNK_HEIGHT + y >= waterHeight - 1) { - tileId = Tile::ice->id; - } else { - tileId = Tile::calmWater->id; - } - } - if (val > 0) { - tileId = Tile::rock->id; - } else { - } + float val = _s0; + float vala = (_s1 - _s0) * zStep; + for (int z = 0; z < CHUNK_WIDTH; z++) { + // + (zc * CHUNK_WIDTH + z)]; + float temp = temperatures[(xc * CHUNK_WIDTH + x) * 16 + (zc * CHUNK_WIDTH + z)]; + int tileId = 0; + if (yc * CHUNK_HEIGHT + y < waterHeight) { + if (temp < SNOW_CUTOFF && yc * CHUNK_HEIGHT + y >= waterHeight - 1) { + tileId = Tile::ice->id; + } else { + tileId = Tile::calmWater->id; + } + } + if (val > 0) { + tileId = Tile::rock->id; + } else { + } - blocks[offs] = (unsigned char) tileId; - offs += step; - val += vala; - } - _s0 += _s0a; - _s1 += _s1a; - } + blocks[offs] = (unsigned char) tileId; + offs += step; + val += vala; + } + _s0 += _s0a; + _s1 += _s1a; + } - s0 += s0a; - s1 += s1a; - s2 += s2a; - s3 += s3a; - } - } - } - } + s0 += s0a; + s1 += s1a; + s2 += s2a; + s3 += s3a; + } + } + } + } } void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, unsigned char* blocks, Biome** biomes) { - int waterHeight = Level::DEPTH - 64; + int waterHeight = Level::DEPTH - 64; - float s = 1 / 32.0f; - perlinNoise2.getRegion(sandBuffer, (float)(xOffs * 16), (float)(zOffs * 16), 0, 16, 16, 1, s, s, 1); - perlinNoise2.getRegion(gravelBuffer, (float)(xOffs * 16), 109.01340f, (float)(zOffs * 16), 16, 1, 16, s, 1, s); - perlinNoise3.getRegion(depthBuffer, (float)(xOffs * 16), (float)(zOffs * 16), 0, 16, 16, 1, s * 2, s * 2, s * 2); + float s = 1 / 32.0f; + perlinNoise2.getRegion(sandBuffer, (float)(xOffs * 16), (float)(zOffs * 16), 0, 16, 16, 1, s, s, 1); + perlinNoise2.getRegion(gravelBuffer, (float)(xOffs * 16), 109.01340f, (float)(zOffs * 16), 16, 1, 16, s, 1, s); + perlinNoise3.getRegion(depthBuffer, (float)(xOffs * 16), (float)(zOffs * 16), 0, 16, 16, 1, s * 2, s * 2, s * 2); - for (int x = 0; x < 16; x++) { - for (int z = 0; z < 16; z++) { + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { float temp = 1; // @todo: read temp from BiomeSource - Biome* b = biomes[x + z * 16]; - bool sand = (sandBuffer[x + z * 16] + random.nextFloat() * 0.2f) > 0; - bool gravel = (gravelBuffer[x + z * 16] + random.nextFloat() * 0.2f) > 3; - int runDepth = (int) (depthBuffer[x + z * 16] / 3 + 3 + random.nextFloat() * 0.25f); + Biome* b = biomes[x + z * 16]; + bool sand = (sandBuffer[x + z * 16] + random.nextFloat() * 0.2f) > 0; + bool gravel = (gravelBuffer[x + z * 16] + random.nextFloat() * 0.2f) > 3; + int runDepth = (int) (depthBuffer[x + z * 16] / 3 + 3 + random.nextFloat() * 0.25f); - int run = -1; + int run = -1; char top = b->topMaterial; - char material = b->material; + char material = b->material; - for (int y = 127; y >= 0; y--) { - int offs = (z * 16 + x) * 128 + y; + for (int y = 127; y >= 0; y--) { + int offs = (z * 16 + x) * 128 + y; - if (y <= 0 + random.nextInt(5)) { - blocks[offs] = (char) Tile::unbreakable->id; - } else { - int old = blocks[offs]; + if (y <= 0 + random.nextInt(5)) { + blocks[offs] = (char) Tile::unbreakable->id; + } else { + int old = blocks[offs]; - if (old == 0) { - run = -1; - } else if (old == Tile::rock->id) { - if (run == -1) { - if (runDepth <= 0) { - top = 0; - material = (char) Tile::rock->id; - } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { - top = b->topMaterial; + if (old == 0) { + run = -1; + } else if (old == Tile::rock->id) { + if (run == -1) { + if (runDepth <= 0) { + top = 0; + material = (char) Tile::rock->id; + } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { + top = b->topMaterial; material = b->material; - + //@attn: ? - if (gravel) { + if (gravel) { top = 0; material = (char) Tile::gravel->id; } - if (sand) { + if (sand) { top = (char) Tile::sand->id; material = (char) Tile::sand->id; } - } + } - if (y < waterHeight && top == 0) { + if (y < waterHeight && top == 0) { if (temp < 0.15f) top = (char) Tile::ice->id; else top = (char) Tile::calmWater->id; } - run = runDepth; - if (y >= waterHeight - 1) blocks[offs] = top; - else blocks[offs] = material; - } else if (run > 0) { - run--; - blocks[offs] = material; + run = runDepth; + if (y >= waterHeight - 1) blocks[offs] = top; + else blocks[offs] = material; + } else if (run > 0) { + run--; + blocks[offs] = material; - // place a few sandstone blocks beneath sand - // runs - if (run == 0 && material == Tile::sand->id) { - run = random.nextInt(4); - material = (char) Tile::sandStone->id; - } - } - } - } - } - } - } + // place a few sandstone blocks beneath sand + // runs + if (run == 0 && material == Tile::sand->id) { + run = random.nextInt(4); + material = (char) Tile::sandStone->id; + } + } + } + } + } + } + } } @@ -220,286 +220,291 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { level->isGeneratingTerrain = true; - HeavyTile::instaFall = true; - int xo = xt * 16; - int zo = zt * 16; + HeavyTile::instaFall = true; + int xo = xt * 16; + int zo = zt * 16; - Biome* biome = level->getBiomeSource()->getBiome(xo + 16, zo + 16); - // Biome* biome = Biome::forest; + Biome* biome = level->getBiomeSource()->getBiome(xo + 16, zo + 16); + // Biome* biome = Biome::forest; - random.setSeed(level->getSeed()); - int xScale = random.nextInt() / 2 * 2 + 1; - int zScale = random.nextInt() / 2 * 2 + 1; - random.setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); + random.setSeed(level->getSeed()); + int xScale = random.nextInt() / 2 * 2 + 1; + int zScale = random.nextInt() / 2 * 2 + 1; + random.setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); + + + // @todo - add generation options to enable or disable extra features like lava lakes or water lakes as they affect seed parity with the original vanilla game - shredder // //@todo: hide those chunks if they are aren't visible -// if (random.nextInt(4) == 0) { -// int x = xo + random.nextInt(16) + 8; -// int y = random.nextInt(128); -// int z = zo + random.nextInt(16) + 8; -// LakeFeature feature(Tile::calmWater->id); -// feature.place(level, &random, x, y, z); -// LOGI("Adding underground lake @ (%d,%d,%d)\n", x, y, z); -// } + if (random.nextInt(4) == 0) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; + LakeFeature feature(Tile::calmWater->id); + feature.place(level, &random, x, y, z); + // LOGI("Adding underground lake @ (%d,%d,%d)\n", x, y, z); + } ////@todo: hide those chunks if they are aren't visible - // if (random.nextInt(8) == 0) { - // int x = xo + random.nextInt(16) + 8; - // int y = random.nextInt(random.nextInt(120) + 8); - // int z = zo + random.nextInt(16) + 8; - // if (y < 64 || random.nextInt(10) == 0) { - // LakeFeature feature(Tile::calmLava->id); - // feature.place(level, &random, x, y, z); - // } - // } + if (random.nextInt(8) == 0) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(random.nextInt(120) + 8); + int z = zo + random.nextInt(16) + 8; + if (y < 64 || random.nextInt(10) == 0) { + LakeFeature feature(Tile::calmLava->id); + feature.place(level, &random, x, y, z); + } + } static float totalTime = 0; const float st = getTimeS(); - //for (int i = 0; i < 8; i++) { - // int x = xo + random.nextInt(16) + 8; - // int y = random.nextInt(128); - // int z = zo + random.nextInt(16) + 8; - // MonsterRoomFeature().place(level, random, x, y, z); - //} + //for (int i = 0; i < 8; i++) { + // int x = xo + random.nextInt(16) + 8; + // int y = random.nextInt(128); + // int z = zo + random.nextInt(16) + 8; + // MonsterRoomFeature().place(level, random, x, y, z); + //} - for (int i = 0; i < 10; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(128); - int z = zo + random.nextInt(16); - ClayFeature feature(32); + for (int i = 0; i < 10; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(128); + int z = zo + random.nextInt(16); + ClayFeature feature(32); feature.place(level, &random, x, y, z); - } + } - for (int i = 0; i < 20; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(128); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::dirt->id, 32); + for (int i = 0; i < 20; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(128); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::dirt->id, 32); feature.place(level, &random, x, y, z); - } + } - for (int i = 0; i < 10; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(128); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::gravel->id, 32); + for (int i = 0; i < 10; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(128); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::gravel->id, 32); feature.place(level, &random, x, y, z); - } + } - // Coal: common, wide Y range, moderate vein size - for (int i = 0; i < 16; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(128); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::coalOre->id, 14); - feature.place(level, &random, x, y, z); - } + // @todo - add generation options to enable or disable adjusted ore spawn rates as they affect seed parity with the original vanilla game - shredder - // Iron: common, limited to upper underground - for (int i = 0; i < 14; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(64); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::ironOre->id, 10); - feature.place(level, &random, x, y, z); - } + // Coal: common, wide Y range, moderate vein size + for (int i = 0; i < 16; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(128); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::coalOre->id, 14); + feature.place(level, &random, x, y, z); + } - // Gold: rarer and deeper - for (int i = 0; i < 2; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(32); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::goldOre->id, 9); - feature.place(level, &random, x, y, z); - } + // Iron: common, limited to upper underground + for (int i = 0; i < 14; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(64); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::ironOre->id, 10); + feature.place(level, &random, x, y, z); + } - // Redstone: somewhat common at low depths - for (int i = 0; i < 6; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(16); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::redStoneOre->id, 8); - feature.place(level, &random, x, y, z); - } + // Gold: rarer and deeper + for (int i = 0; i < 2; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(32); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::goldOre->id, 9); + feature.place(level, &random, x, y, z); + } - // Emerald (diamond-equivalent): still rare but slightly more than vanilla - for (int i = 0; i < 3; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(16); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::emeraldOre->id, 6); - feature.place(level, &random, x, y, z); - } + // Redstone: somewhat common at low depths + for (int i = 0; i < 6; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(16); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::redStoneOre->id, 8); + feature.place(level, &random, x, y, z); + } - // Lapis: rare and not in very high Y - for (int i = 0; i < 1; i++) { - int x = xo + random.nextInt(16); - int y = random.nextInt(16) + random.nextInt(16); - int z = zo + random.nextInt(16); - OreFeature feature(Tile::lapisOre->id, 6); - feature.place(level, &random, x, y, z); - } + // Emerald (diamond-equivalent): still rare but slightly more than vanilla + for (int i = 0; i < 3; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(16); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::emeraldOre->id, 6); + feature.place(level, &random, x, y, z); + } - const float ss = 0.5f; - int oFor = (int) ((forestNoise.getValue(xo * ss, zo * ss) / 8 + random.nextFloat() * 4 + 4) / 3); - int forests = 0;//1; (java: 0) - if (random.nextInt(10) == 0) forests += 1; + // Lapis: rare and not in very high Y + for (int i = 0; i < 1; i++) { + int x = xo + random.nextInt(16); + int y = random.nextInt(16) + random.nextInt(16); + int z = zo + random.nextInt(16); + OreFeature feature(Tile::lapisOre->id, 6); + feature.place(level, &random, x, y, z); + } - if (biome == Biome::forest) forests += oFor + 2; // + 5 - if (biome == Biome::rainForest) forests += oFor + 2; //+ 5 - if (biome == Biome::seasonalForest) forests += oFor + 1; // 2 - if (biome == Biome::taiga) { + const float ss = 0.5f; + int oFor = (int) ((forestNoise.getValue(xo * ss, zo * ss) / 8 + random.nextFloat() * 4 + 4) / 3); + int forests = 0;//1; (java: 0) + if (random.nextInt(10) == 0) forests += 1; + + if (biome == Biome::forest) forests += oFor + 2; // + 5 + if (biome == Biome::rainForest) forests += oFor + 2; //+ 5 + if (biome == Biome::seasonalForest) forests += oFor + 1; // 2 + if (biome == Biome::taiga) { forests += oFor + 1; // + 5 //LOGI("Biome is taiga!\n"); } - if (biome == Biome::desert) forests -= 20; - if (biome == Biome::tundra) forests -= 20; - if (biome == Biome::plains) forests -= 20; + if (biome == Biome::desert) forests -= 20; + if (biome == Biome::tundra) forests -= 20; + if (biome == Biome::plains) forests -= 20; - for (int i = 0; i < forests; i++) { - int x = xo + random.nextInt(16) + 8; - int z = zo + random.nextInt(16) + 8; + for (int i = 0; i < forests; i++) { + int x = xo + random.nextInt(16) + 8; + int z = zo + random.nextInt(16) + 8; int y = level->getHeightmap(x, z); - Feature* tree = biome->getTreeFeature(&random); + Feature* tree = biome->getTreeFeature(&random); if (tree) { - tree->init(1, 1, 1); - tree->place(level, &random, x, y, z); + tree->init(1, 1, 1); + tree->place(level, &random, x, y, z); delete tree; } //printf("placing tree at %d, %d, %d\n", x, y, z); - } - // for (int i = 0; i < forests; i++) { - // int x = xo + random.nextInt(16) + 8; - // int z = zo + random.nextInt(16) + 8; - //int y = level->getHeightmap(x, z); - // Feature* tree = biome->getBasicTreeFeature(&random); - //if (tree) { - // tree->init(1, 1, 1); - // tree->place(level, &random, x, y, z); - // delete tree; - //} - ////printf("placing tree at %d, %d, %d\n", x, y, z); - // } + } + // for (int i = 0; i < forests; i++) { + // int x = xo + random.nextInt(16) + 8; + // int z = zo + random.nextInt(16) + 8; + //int y = level->getHeightmap(x, z); + // Feature* tree = biome->getBasicTreeFeature(&random); + //if (tree) { + // tree->init(1, 1, 1); + // tree->place(level, &random, x, y, z); + // delete tree; + //} + ////printf("placing tree at %d, %d, %d\n", x, y, z); + // } - for (int i = 0; i < 2; i++) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = zo + random.nextInt(16) + 8; - FlowerFeature feature(Tile::flower->id); + for (int i = 0; i < 2; i++) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; + FlowerFeature feature(Tile::flower->id); feature.place(level, &random, x, y, z); - } + } - if (random.nextInt(2) == 0) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = zo + random.nextInt(16) + 8; + if (random.nextInt(2) == 0) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; FlowerFeature feature(Tile::rose->id); - feature.place(level, &random, x, y, z); - } - - if (random.nextInt(4) == 0) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = zo + random.nextInt(16) + 8; - FlowerFeature feature(Tile::mushroom1->id); feature.place(level, &random, x, y, z); - } + } - if (random.nextInt(8) == 0) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = zo + random.nextInt(16) + 8; - FlowerFeature feature(Tile::mushroom2->id); + if (random.nextInt(4) == 0) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; + FlowerFeature feature(Tile::mushroom1->id); feature.place(level, &random, x, y, z); - } + } + + if (random.nextInt(8) == 0) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; + FlowerFeature feature(Tile::mushroom2->id); + feature.place(level, &random, x, y, z); + } /*int grassCount = 1; for (int i = 0; i < grassCount; i++) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(Level::genDepth); - int z = zo + random.nextInt(16) + 8; - Feature* grassFeature = biome->getGrassFeature(&random); - if (grassFeature) { - grassFeature->place(level, &random, x, y, z); - delete grassFeature; - } + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(Level::genDepth); + int z = zo + random.nextInt(16) + 8; + Feature* grassFeature = biome->getGrassFeature(&random); + if (grassFeature) { + grassFeature->place(level, &random, x, y, z); + delete grassFeature; + } }*/ - for (int i = 0; i < 10; i++) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = zo + random.nextInt(16) + 8; - ReedsFeature feature; + for (int i = 0; i < 10; i++) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; + ReedsFeature feature; feature.place(level, &random, x, y, z); - } - + } - //if (random.nextInt(32) == 0) { - // int x = xo + random.nextInt(16) + 8; - // int y = random.nextInt(128); - // int z = zo + random.nextInt(16) + 8; - // PumpkinFeature().place(level, random, x, y, z); - //} - int cacti = 0; - if (biome == Biome::desert) cacti += 5; + //if (random.nextInt(32) == 0) { + // int x = xo + random.nextInt(16) + 8; + // int y = random.nextInt(128); + // int z = zo + random.nextInt(16) + 8; + // PumpkinFeature().place(level, random, x, y, z); + //} - for (int i = 0; i < cacti; i++) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = zo + random.nextInt(16) + 8; - CactusFeature feature; - //LOGI("Tried creating a cactus at %d, %d, %d\n", x, y, z); - feature.place(level, &random, x, y, z); - } + int cacti = 0; + if (biome == Biome::desert) cacti += 5; - for (int i = 0; i < 50; i++) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(random.nextInt(120) + 8); - int z = zo + random.nextInt(16) + 8; - SpringFeature feature(Tile::water->id); + for (int i = 0; i < cacti; i++) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; + CactusFeature feature; + //LOGI("Tried creating a cactus at %d, %d, %d\n", x, y, z); feature.place(level, &random, x, y, z); - } + } - for (int i = 0; i < 20; i++) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(random.nextInt(random.nextInt(112) + 8) + 8); - int z = zo + random.nextInt(16) + 8; - SpringFeature feature(Tile::lava->id); + for (int i = 0; i < 50; i++) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(random.nextInt(120) + 8); + int z = zo + random.nextInt(16) + 8; + SpringFeature feature(Tile::water->id); feature.place(level, &random, x, y, z); - } + } + + for (int i = 0; i < 20; i++) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(random.nextInt(random.nextInt(112) + 8) + 8); + int z = zo + random.nextInt(16) + 8; + SpringFeature feature(Tile::lava->id); + feature.place(level, &random, x, y, z); + } if (spawnMobs && !level->isClientSide) MobSpawner::postProcessSpawnMobs(level, biome, xo + 8, zo + 8, 16, 16, &random); //LOGI("Reading temp: 1\n"); - float* temperatures = level->getBiomeSource()->getTemperatureBlock(NULL, xo + 8, zo + 8, 16, 16); - for (int x = xo + 8; x < xo + 8 + 16; x++) - for (int z = zo + 8; z < zo + 8 + 16; z++) { - int xp = x - (xo + 8); - int zp = z - (zo + 8); - int y = level->getTopSolidBlock(x, z); - float temp = temperatures[xp * 16 + zp] - (y - 64) / 64.0f * SNOW_SCALE; - if (temp < SNOW_CUTOFF) { - if (y > 0 && y < 128 && level->isEmptyTile(x, y, z) && level->getMaterial(x, y - 1, z)->blocksMotion()) { - if (level->getMaterial(x, y - 1, z) != Material::ice) level->setTile(x, y, z, Tile::topSnow->id); - } - } - } - //LOGI("Reading temp: 0 END\n"); + float* temperatures = level->getBiomeSource()->getTemperatureBlock(NULL, xo + 8, zo + 8, 16, 16); + for (int x = xo + 8; x < xo + 8 + 16; x++) + for (int z = zo + 8; z < zo + 8 + 16; z++) { + int xp = x - (xo + 8); + int zp = z - (zo + 8); + int y = level->getTopSolidBlock(x, z); + float temp = temperatures[xp * 16 + zp] - (y - 64) / 64.0f * SNOW_SCALE; + if (temp < SNOW_CUTOFF) { + if (y > 0 && y < 128 && level->isEmptyTile(x, y, z) && level->getMaterial(x, y - 1, z)->blocksMotion()) { + if (level->getMaterial(x, y - 1, z) != Material::ice) level->setTile(x, y, z, Tile::topSnow->id); + } + } + } + //LOGI("Reading temp: 0 END\n"); - const float et = getTimeS(); - totalTime += (et-st); + const float et = getTimeS(); + totalTime += (et-st); - //printf("Time to place features: %f. Total %f\n", et - st, totalTime); + //printf("Time to place features: %f. Total %f\n", et - st, totalTime); - HeavyTile::instaFall = false; + HeavyTile::instaFall = false; - level->isGeneratingTerrain = false; + level->isGeneratingTerrain = false; } LevelChunk* RandomLevelSource::create(int x, int z) { - return getChunk(x, z); + return getChunk(x, z); } LevelChunk* RandomLevelSource::getChunk(int xOffs, int zOffs) { @@ -510,22 +515,23 @@ LevelChunk* RandomLevelSource::getChunk(int xOffs, int zOffs) { if (it != chunkMap.end()) return it->second; - random.setSeed((long)(xOffs * 341872712l + zOffs * 132899541l)); //@fix + random.setSeed((long)(xOffs * 341872712l + zOffs * 132899541l)); //@fix - unsigned char* blocks = new unsigned char[LevelChunk::ChunkBlockCount]; - LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); + unsigned char* blocks = new unsigned char[LevelChunk::ChunkBlockCount]; + LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); chunkMap.insert(std::make_pair(hashedPos, levelChunk)); Biome** biomes = level->getBiomeSource()->getBiomeBlock(/*biomes, */xOffs * 16, zOffs * 16, 16, 16); - float* temperatures = level->getBiomeSource()->temperatures; - prepareHeights(xOffs, zOffs, blocks, 0, temperatures);//biomes, temperatures); - buildSurfaces(xOffs, zOffs, blocks, biomes); + float* temperatures = level->getBiomeSource()->temperatures; + prepareHeights(xOffs, zOffs, blocks, 0, temperatures);//biomes, temperatures); + buildSurfaces(xOffs, zOffs, blocks, biomes); // Carve caves into the chunk caveFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); - levelChunk->recalcHeightmap(); + canyonFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); + levelChunk->recalcHeightmap(); - return levelChunk; + return levelChunk; } /*private*/ @@ -535,138 +541,138 @@ float* RandomLevelSource::getHeights(float* buffer, int x, int y, int z, int xSi LOGI("RandomLevelSource::getHeights: TOO LARGE BUFFER REQUESTED: %d (max %d)\n", size, MAX_BUFFER_SIZE); } - float s = 1 * 684.412f; - float hs = 1 * 684.412f; + float s = 1 * 684.412f; + float hs = 1 * 684.412f; - float* temperatures = level->getBiomeSource()->temperatures; - float* downfalls = level->getBiomeSource()->downfalls; - sr = scaleNoise.getRegion(sr, x, z, xSize, zSize, 1.121f, 1.121f, 0.5f); - dr = depthNoise.getRegion(dr, x, z, xSize, zSize, 200.0f, 200.0f, 0.5f); + float* temperatures = level->getBiomeSource()->temperatures; + float* downfalls = level->getBiomeSource()->downfalls; + sr = scaleNoise.getRegion(sr, x, z, xSize, zSize, 1.121f, 1.121f, 0.5f); + dr = depthNoise.getRegion(dr, x, z, xSize, zSize, 200.0f, 200.0f, 0.5f); - pnr = perlinNoise1.getRegion(pnr, (float)x, (float)y, (float)z, xSize, ySize, zSize, s / 80.0f, hs / 160.0f, s / 80.0f); - ar = lperlinNoise1.getRegion(ar, (float)x, (float)y, (float)z, xSize, ySize, zSize, s, hs, s); - br = lperlinNoise2.getRegion(br, (float)x, (float)y, (float)z, xSize, ySize, zSize, s, hs, s); + pnr = perlinNoise1.getRegion(pnr, (float)x, (float)y, (float)z, xSize, ySize, zSize, s / 80.0f, hs / 160.0f, s / 80.0f); + ar = lperlinNoise1.getRegion(ar, (float)x, (float)y, (float)z, xSize, ySize, zSize, s, hs, s); + br = lperlinNoise2.getRegion(br, (float)x, (float)y, (float)z, xSize, ySize, zSize, s, hs, s); - int p = 0; - int pp = 0; + int p = 0; + int pp = 0; - int wScale = 16 / xSize; - for (int xx = 0; xx < xSize; xx++) { - int xp = xx * wScale + wScale / 2; + int wScale = 16 / xSize; + for (int xx = 0; xx < xSize; xx++) { + int xp = xx * wScale + wScale / 2; - for (int zz = 0; zz < zSize; zz++) { - int zp = zz * wScale + wScale / 2; - float temperature = temperatures[xp * 16 + zp]; - float downfall = downfalls[xp * 16 + zp] * temperature; - float dd = 1 - downfall; - dd = dd * dd; - dd = dd * dd; - dd = 1 - dd; + for (int zz = 0; zz < zSize; zz++) { + int zp = zz * wScale + wScale / 2; + float temperature = temperatures[xp * 16 + zp]; + float downfall = downfalls[xp * 16 + zp] * temperature; + float dd = 1 - downfall; + dd = dd * dd; + dd = dd * dd; + dd = 1 - dd; - float scale = ((sr[pp] + 256.0f) / 512); - scale *= dd; - if (scale > 1) scale = 1; + float scale = ((sr[pp] + 256.0f) / 512); + scale *= dd; + if (scale > 1) scale = 1; - float depth = (dr[pp] / 8000.0f); - if (depth < 0) depth = -depth * 0.3f; - depth = depth * 3.0f - 2.0f; + float depth = (dr[pp] / 8000.0f); + if (depth < 0) depth = -depth * 0.3f; + depth = depth * 3.0f - 2.0f; - if (depth < 0) { - depth = depth / 2; - if (depth < -1) depth = -1; - depth = depth / 1.4f; - depth /= 2; - scale = 0; - } else { - if (depth > 1) depth = 1; - depth = depth / 8; - } + if (depth < 0) { + depth = depth / 2; + if (depth < -1) depth = -1; + depth = depth / 1.4f; + depth /= 2; + scale = 0; + } else { + if (depth > 1) depth = 1; + depth = depth / 8; + } - if (scale < 0) scale = 0; - scale = (scale) + 0.5f; - depth = depth * ySize / 16; + if (scale < 0) scale = 0; + scale = (scale) + 0.5f; + depth = depth * ySize / 16; - float yCenter = ySize / 2.0f + depth * 4; + float yCenter = ySize / 2.0f + depth * 4; - pp++; + pp++; - for (int yy = 0; yy < ySize; yy++) { - float val = 0; + for (int yy = 0; yy < ySize; yy++) { + float val = 0; - float yOffs = (yy - (yCenter)) * 12 / scale; - if (yOffs < 0) yOffs *= 4; + float yOffs = (yy - (yCenter)) * 12 / scale; + if (yOffs < 0) yOffs *= 4; - float bb = ar[p] / 512; - float cc = br[p] / 512; + float bb = ar[p] / 512; + float cc = br[p] / 512; - float v = (pnr[p] / 10 + 1) / 2; - if (v < 0) val = bb; - else if (v > 1) val = cc; - else val = bb + (cc - bb) * v; - val -= yOffs; + float v = (pnr[p] / 10 + 1) / 2; + if (v < 0) val = bb; + else if (v > 1) val = cc; + else val = bb + (cc - bb) * v; + val -= yOffs; - if (yy > ySize - 4) { - float slide = (yy - (ySize - 4)) / (4 - 1.0f); - val = val * (1 - slide) + -10 * slide; - } + if (yy > ySize - 4) { + float slide = (yy - (ySize - 4)) / (4 - 1.0f); + val = val * (1 - slide) + -10 * slide; + } - buffer[p] = val; - p++; - } - } - } - return buffer; + buffer[p] = val; + p++; + } + } + } + return buffer; } /*private*/ void RandomLevelSource::calcWaterDepths(ChunkSource* parent, int xt, int zt) { - int xo = xt * 16; - int zo = zt * 16; - for (int x = 0; x < 16; x++) { - int y = level->getSeaLevel(); - for (int z = 0; z < 16; z++) { - int xp = xo + x + 7; - int zp = zo + z + 7; - int h = level->getHeightmap(xp, zp); - if (h <= 0) { - if (level->getHeightmap(xp - 1, zp) > 0 || level->getHeightmap(xp + 1, zp) > 0 || level->getHeightmap(xp, zp - 1) > 0 || level->getHeightmap(xp, zp + 1) > 0) { - bool hadWater = false; - if (hadWater || (level->getTile(xp - 1, y, zp) == Tile::calmWater->id && level->getData(xp - 1, y, zp) < 7)) hadWater = true; - if (hadWater || (level->getTile(xp + 1, y, zp) == Tile::calmWater->id && level->getData(xp + 1, y, zp) < 7)) hadWater = true; - if (hadWater || (level->getTile(xp, y, zp - 1) == Tile::calmWater->id && level->getData(xp, y, zp - 1) < 7)) hadWater = true; - if (hadWater || (level->getTile(xp, y, zp + 1) == Tile::calmWater->id && level->getData(xp, y, zp + 1) < 7)) hadWater = true; - if (hadWater) { - for (int x2 = -5; x2 <= 5; x2++) { - for (int z2 = -5; z2 <= 5; z2++) { - int d = (x2 > 0 ? x2 : -x2) + (z2 > 0 ? z2 : -z2); + int xo = xt * 16; + int zo = zt * 16; + for (int x = 0; x < 16; x++) { + int y = level->getSeaLevel(); + for (int z = 0; z < 16; z++) { + int xp = xo + x + 7; + int zp = zo + z + 7; + int h = level->getHeightmap(xp, zp); + if (h <= 0) { + if (level->getHeightmap(xp - 1, zp) > 0 || level->getHeightmap(xp + 1, zp) > 0 || level->getHeightmap(xp, zp - 1) > 0 || level->getHeightmap(xp, zp + 1) > 0) { + bool hadWater = false; + if (hadWater || (level->getTile(xp - 1, y, zp) == Tile::calmWater->id && level->getData(xp - 1, y, zp) < 7)) hadWater = true; + if (hadWater || (level->getTile(xp + 1, y, zp) == Tile::calmWater->id && level->getData(xp + 1, y, zp) < 7)) hadWater = true; + if (hadWater || (level->getTile(xp, y, zp - 1) == Tile::calmWater->id && level->getData(xp, y, zp - 1) < 7)) hadWater = true; + if (hadWater || (level->getTile(xp, y, zp + 1) == Tile::calmWater->id && level->getData(xp, y, zp + 1) < 7)) hadWater = true; + if (hadWater) { + for (int x2 = -5; x2 <= 5; x2++) { + for (int z2 = -5; z2 <= 5; z2++) { + int d = (x2 > 0 ? x2 : -x2) + (z2 > 0 ? z2 : -z2); - if (d <= 5) { - d = 6 - d; - if (level->getTile(xp + x2, y, zp + z2) == Tile::calmWater->id) { - int od = level->getData(xp + x2, y, zp + z2); - if (od < 7 && od < d) { - level->setData(xp + x2, y, zp + z2, d); - } - } - } - } - } - if (hadWater) { - level->setTileAndDataNoUpdate(xp, y, zp, Tile::calmWater->id, 7); - for (int y2 = 0; y2 < y; y2++) { - level->setTileAndDataNoUpdate(xp, y2, zp, Tile::calmWater->id, 8); - } - } - } - } - } - } - } + if (d <= 5) { + d = 6 - d; + if (level->getTile(xp + x2, y, zp + z2) == Tile::calmWater->id) { + int od = level->getData(xp + x2, y, zp + z2); + if (od < 7 && od < d) { + level->setData(xp + x2, y, zp + z2, d); + } + } + } + } + } + if (hadWater) { + level->setTileAndDataNoUpdate(xp, y, zp, Tile::calmWater->id, 7); + for (int y2 = 0; y2 < y; y2++) { + level->setTileAndDataNoUpdate(xp, y2, zp, Tile::calmWater->id, 8); + } + } + } + } + } + } + } } bool RandomLevelSource::hasChunk(int x, int y) { - //return x >= 0 && x < 16 && y >= 0 && y < 16; + //return x >= 0 && x < 16 && y >= 0 && y < 16; return true; } @@ -687,18 +693,18 @@ std::string RandomLevelSource::gatherStats() { //} Biome::MobList RandomLevelSource::getMobsAt(const MobCategory& mobCategory, int x, int y, int z) { - BiomeSource* biomeSource = level->getBiomeSource(); - if (biomeSource == NULL) { - return Biome::MobList(); - } -// static Stopwatch sw; sw.start(); - Biome* biome = biomeSource->getBiome(x, z); -// sw.stop(); -// sw.printEvery(10, "getBiome::"); - if (biome == NULL) { - return Biome::MobList(); - } - return biome->getMobs(mobCategory); + BiomeSource* biomeSource = level->getBiomeSource(); + if (biomeSource == NULL) { + return Biome::MobList(); + } + // static Stopwatch sw; sw.start(); + Biome* biome = biomeSource->getBiome(x, z); + // sw.stop(); + // sw.printEvery(10, "getBiome::"); + if (biome == NULL) { + return Biome::MobList(); + } + return biome->getMobs(mobCategory); } diff --git a/src/world/level/levelgen/RandomLevelSource.h b/src/world/level/levelgen/RandomLevelSource.h index 7082990..e8b88e4 100755 --- a/src/world/level/levelgen/RandomLevelSource.h +++ b/src/world/level/levelgen/RandomLevelSource.h @@ -25,6 +25,7 @@ class LevelChunk; #include "../chunk/ChunkSource.h" #include "LargeCaveFeature.h" +#include "CanyonFeature.h" #include "synth/PerlinNoise.h" #include "../../../SharedConstants.h" @@ -63,6 +64,7 @@ private: public: //Biome** biomes; LargeCaveFeature caveFeature; + CanyonFeature canyonFeature; int waterDepths[16+16][16+16]; private: ChunkMap chunkMap; @@ -92,6 +94,7 @@ private: float* fi; float* fis; ///*private*/ float[] temperatures; + float* temperatures; // normally unused like above, but restored this maybe might come handy - shredder }; class PerformanceTestChunkSource : public ChunkSource diff --git a/src/world/level/levelgen/feature/BasicTree.h b/src/world/level/levelgen/feature/BasicTree.h index 46f3f7e..16c15ca 100644 --- a/src/world/level/levelgen/feature/BasicTree.h +++ b/src/world/level/levelgen/feature/BasicTree.h @@ -17,7 +17,7 @@ class BasicTree : public Feature typedef Feature super; private: - + unsigned char axisConversionArray[6]; Random *rnd; @@ -25,11 +25,11 @@ private: int origin[3]; int height; int trunkHeight; - double trunkHeightScale; - double branchDensity; - double branchSlope; - double widthScale; - double foliageDensity; + float trunkHeightScale; + float branchDensity; + float branchSlope; + float widthScale; + float foliageDensity; int trunkWidth; int heightVariance; int foliageHeight; @@ -38,7 +38,7 @@ private: void prepare(){ trunkHeight = (int) (height * trunkHeightScale); if (trunkHeight >= height) trunkHeight = height - 1; - int clustersPerY = (int) (1.382 + pow(foliageDensity * height / 13.0, 2)); + int clustersPerY = (int) (1.382f + pow(foliageDensity * height / 13.0, 2)); if (clustersPerY < 1) clustersPerY = 1; int **tempFoliageCoords = new int *[clustersPerY * height]; for( int i = 0; i < clustersPerY * height; i++ ) @@ -68,19 +68,19 @@ private: continue; } - double originOffset = 0.5; + float originOffset = 0.5f; while (num < clustersPerY) { - double radius = widthScale * (shapefac * (rnd->nextFloat() + 0.328)); - double angle = rnd->nextFloat() * 2.0 * 3.14159; + float radius = widthScale * (shapefac * (rnd->nextFloat() + 0.328f)); + float angle = rnd->nextFloat() * 2.0f * 3.14159f; int x = Mth::floor(radius * sin(angle) + origin[0] + originOffset); int z = Mth::floor(radius * cos(angle) + origin[2] + originOffset); int checkStart[] = { x, y, z }; int checkEnd[] = { x, y + foliageHeight, z }; if (checkLine(checkStart, checkEnd) == -1) { int checkBranchBase[] = { origin[0], origin[1], origin[2] }; - double distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0) + pow(abs(origin[2] - checkStart[2]), 2.0)); - double branchHeight = distance * branchSlope; + float distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0f) + pow(abs(origin[2] - checkStart[2]), 2.0f)); + float branchHeight = distance * branchSlope; if ((checkStart[1] - branchHeight) > trunkTop) { checkBranchBase[1] = trunkTop; @@ -134,7 +134,9 @@ private: offset2 = -rad; while (offset2 <= rad) { - double thisdistance = pow(abs(offset1) + 0.5, 2) + pow(abs(offset2) + 0.5, 2); + float off1 = (float)offset1 + 0.5f; + float off2 = (float)offset2 + 0.5f; + float thisdistance = (off1 * off1) + (off2 * off2); if (thisdistance > radius * radius) { offset2++; @@ -159,14 +161,14 @@ private: } float treeShape(int y){ - if (y < (((float) height) * 0.3)) return (float) -1.618; - float radius = ((float) height) / ((float) 2.0); - float adjacent = (((float) height) / ((float) 2.0)) - y; + if (y < (((float) height) * 0.3f)) return (float) -1.618f; + float radius = ((float) height) / ((float) 2.0f); + float adjacent = (((float) height) / ((float) 2.0f)) - y; float distance; if (adjacent == 0) distance = radius; - else if (abs(adjacent) >= radius) distance = (float) 0.0; + else if (abs(adjacent) >= radius) distance = (float) 0.0f; else distance = (float) sqrt(pow(abs(radius), 2) - pow(abs(adjacent), 2)); - distance *= (float) 0.5; + distance *= (float) 0.5f; return distance; } float foliageShape(int y){ @@ -207,8 +209,8 @@ private: char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; - double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); - double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); + float secfac1 = ((float) delta[secidx1]) / ((float) delta[primidx]); + float secfac2 = ((float) delta[secidx2]) / ((float) delta[primidx]); int coordinate[] = { 0, 0, 0 }; int primoffset = 0; int endoffset = delta[primidx] + primsign; @@ -312,8 +314,8 @@ private: char primsign; if (delta[primidx] > 0) primsign = 1; else primsign = -1; - double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]); - double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]); + float secfac1 = ((float) delta[secidx1]) / ((float) delta[primidx]); + float secfac2 = ((float) delta[secidx2]) / ((float) delta[primidx]); int coordinate[] = { 0, 0, 0 }; int primoffset = 0; int endoffset = delta[primidx] + primsign; @@ -331,19 +333,19 @@ private: } primoffset += primsign; } - + if (primoffset == endoffset) { return -1; } - + else { return abs(primoffset); } } bool checkLocation(){ - + int startPosition[] = { origin[0], origin[1], origin[2] }; int endPosition[] = { origin[0], origin[1] + height - 1, origin[2] }; @@ -373,11 +375,11 @@ private: public: BasicTree(bool doUpdate){ axisConversionArray[0] = 2; - axisConversionArray[1] = 0; - axisConversionArray[2] = 0; - axisConversionArray[3] = 1; - axisConversionArray[4] = 2; - axisConversionArray[5] = 1; + axisConversionArray[1] = 0; + axisConversionArray[2] = 0; + axisConversionArray[3] = 1; + axisConversionArray[4] = 2; + axisConversionArray[5] = 1; rnd = new Random(); origin[0] = 0; origin[1] = 0; @@ -405,7 +407,7 @@ public: delete [] foliageCoords; } - virtual void init(double heightInit, double widthInit, double foliageDensityInit){ + virtual void init(float heightInit, float widthInit, float foliageDensityInit){ heightVariance = (int) (heightInit * 12); if (heightInit > 0.5) foliageHeight = 5; @@ -430,7 +432,7 @@ public: return false; } - + prepare(); diff --git a/src/world/level/tile/Sapling.h b/src/world/level/tile/Sapling.h index d6fae0e..15877d7 100755 --- a/src/world/level/tile/Sapling.h +++ b/src/world/level/tile/Sapling.h @@ -8,6 +8,7 @@ #include "../levelgen/feature/SpruceFeature.h" #include "../levelgen/feature/BirchFeature.h" #include "../levelgen/feature/TreeFeature.h" +#include "../levelgen/feature/BasicTree.h" class Sapling: public Bush { @@ -90,9 +91,9 @@ public: // f = new TreeFeature(true, 4 + random.nextInt(7), TreeTile::JUNGLE_TRUNK, LeafTile::JUNGLE_LEAF, false); // } } else { - //if (random->nextInt(10) == 0) { - // f = new BasicTree(true); - //} else + if (random->nextInt(10) == 0) { + f = new BasicTree(true); + } else f = new TreeFeature(true); } From e1b81a7cc3afd67e42a365101fd48450bf4240b8 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 11 Apr 2026 15:21:21 +0500 Subject: [PATCH 091/189] another attempt... i hate gles... --- src/client/renderer/Lighting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/renderer/Lighting.cpp b/src/client/renderer/Lighting.cpp index 5633f78..4151cb2 100644 --- a/src/client/renderer/Lighting.cpp +++ b/src/client/renderer/Lighting.cpp @@ -19,7 +19,7 @@ void Lighting::turnOn(Minecraft* minecraft) { glEnable(GL_LIGHT0); glEnable(GL_LIGHT1); glEnable(GL_COLOR_MATERIAL); - glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); + // glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); constexpr float a = 0.4f; constexpr float d = 0.6f; From f19c2d24a30f2eacd069bb6051366112af7beac0 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 11 Apr 2026 19:39:46 +0500 Subject: [PATCH 092/189] Attempt to fix Normal Shading on Android and fix IOS compile, also hopefully fixes the millions of errors in the ios logs --- src/client/renderer/ItemInHandRenderer.cpp | 4 ++-- src/client/renderer/Lighting.cpp | 1 + src/client/renderer/entity/PaintingRenderer.cpp | 4 ++-- src/client/renderer/gles.h | 6 +++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/renderer/ItemInHandRenderer.cpp b/src/client/renderer/ItemInHandRenderer.cpp index fdd495b..3bd90bc 100755 --- a/src/client/renderer/ItemInHandRenderer.cpp +++ b/src/client/renderer/ItemInHandRenderer.cpp @@ -338,7 +338,7 @@ void ItemInHandRenderer::render( float a ) glTranslatef2(0.7f * d, -0.65f * d - (1 - h) * 0.6f, -0.9f * d); glRotatef2(45, 0, 1, 0); - //glEnable2(GL_RESCALE_NORMAL); + glEnable2(GL_RESCALE_NORMAL); glRotatef2(-swing3 * 20, 0, 1, 0); glRotatef2(-swing2 * 20, 0, 0, 1); glRotatef2(-swing2 * 80, 1, 0, 0); @@ -394,7 +394,7 @@ void ItemInHandRenderer::render( float a ) glTranslatef2(0.8f * d, -0.75f * d - (1 - h) * 0.6f, -0.9f * d); glRotatef2(45, 0, 1, 0); - //glEnable2(GL_RESCALE_NORMAL); + glEnable2(GL_RESCALE_NORMAL); glRotatef2(swing2 * 70, 0, 1, 0); glRotatef2(-swing3 * 20, 0, 0, 1); // glRotatef2(-swing2 * 80, 1, 0, 0); diff --git a/src/client/renderer/Lighting.cpp b/src/client/renderer/Lighting.cpp index 4151cb2..db0d93e 100644 --- a/src/client/renderer/Lighting.cpp +++ b/src/client/renderer/Lighting.cpp @@ -14,6 +14,7 @@ void Lighting::turnOn(Minecraft* minecraft) { turnOff(); return; } + glEnable(GL_NORMALIZE); // if normal lighting is true then enable GLES/OpenGL states to setup lighting glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); diff --git a/src/client/renderer/entity/PaintingRenderer.cpp b/src/client/renderer/entity/PaintingRenderer.cpp index 1513e95..6c8bf0d 100755 --- a/src/client/renderer/entity/PaintingRenderer.cpp +++ b/src/client/renderer/entity/PaintingRenderer.cpp @@ -9,7 +9,7 @@ void PaintingRenderer::render( Entity* entity, float x, float y, float z, float glPushMatrix(); glTranslatef(float(x), float(y), float(z)); glRotatef(rot, 0, 1.0f, 0); - //glEnable(GL_RESCALE_NORMAL); + glEnable(GL_RESCALE_NORMAL); bindTexture("art/kz.png"); Painting* painting = (Painting*)entity; const Motive* motive = painting->motive; @@ -17,7 +17,7 @@ void PaintingRenderer::render( Entity* entity, float x, float y, float z, float float s = 1.0f / 16.0f; glScalef(s, s, s); renderPainting(painting, motive->w, motive->h, motive->uo, motive->vo, a); - //glDisable(GL_RESCALE_NORMAL); + glDisable(GL_RESCALE_NORMAL); glPopMatrix(); } diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index adb36e5..e557b1a 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -4,6 +4,10 @@ #include "../../platform/log.h" #include "../Options.h" +#if defined(__APPLE__) + #define GLES_SILENCE_DEPRECATION +#endif + // Android should always run OPENGL_ES #if defined(ANDROID) || defined(__APPLE__) || defined(RPI) #define OPENGL_ES @@ -143,7 +147,7 @@ int glhUnProjectf( float winx, float winy, float winz, // // Extensions // -#ifdef WIN32 +#ifdef WIN32 #define glGetProcAddress(a) wglGetProcAddress(a) #else #define glGetProcAddress(a) (void*(0)) From 95a193323c3eaae16c9e429c1db87c1765cb8159 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 11 Apr 2026 20:28:00 +0500 Subject: [PATCH 093/189] ios compile fix attempt again.... xcode my behated --- project/iosproj/minecraftpe.xcodeproj/project.pbxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index aa8a96c..3dd94db 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -1179,6 +1179,8 @@ F99F0FAD2F8436CE00F2B29A /* FoliageColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */; }; F99F0FAF2F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; F99F0FB02F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; + BEEF202614CFF670005F0002 /* Lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEEF202614CFF670005F0001 /* Lighting.cpp */; }; + BEEF202614CFF670005F0003 /* Lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEEF202614CFF670005F0001 /* Lighting.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -2466,6 +2468,7 @@ F99F0FA82F84369F00F2B29A /* GrassColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GrassColor.cpp; sourceTree = ""; }; F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FoliageColor.cpp; sourceTree = ""; }; F99F0FAE2F8436EB00F2B29A /* Color.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = ""; }; + BEEF202614CFF670005F0001 /* Lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Lighting.cpp; path = ../../src/client/renderer/Lighting.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3533,6 +3536,7 @@ D5B50CF114CFF66F005F7284 /* TileRenderer.cpp */, D5B50CF214CFF66F005F7284 /* TileRenderer.h */, D5B50CF314CFF66F005F7284 /* VertecDecl.h */, + BEEF202614CFF670005F0001 /* Lighting.cpp */, ); path = renderer; sourceTree = ""; @@ -5439,6 +5443,7 @@ D5D8C4C41639341100FD35F0 /* Motive.cpp in Sources */, D5D8C4C8163934BB00FD35F0 /* HangingEntityItem.cpp in Sources */, D5D8C4CC1639362F00FD35F0 /* NetherReactorPattern.cpp in Sources */, + BEEF202614CFF670005F0002 /* Lighting.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5821,6 +5826,7 @@ 042A91AF16B17517007ABBC6 /* NinePatch.cpp in Sources */, 042A91B016B17517007ABBC6 /* OptionsGroup.cpp in Sources */, 042A91B216B17517007ABBC6 /* TextBox.cpp in Sources */, + BEEF202614CFF670005F0003 /* Lighting.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From db7a8899626f0e29c80256840619d43dfecb08a1 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 11 Apr 2026 20:33:14 +0500 Subject: [PATCH 094/189] please xcode work with me here --- project/iosproj/minecraftpe.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 3dd94db..1bd42e1 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2468,7 +2468,7 @@ F99F0FA82F84369F00F2B29A /* GrassColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GrassColor.cpp; sourceTree = ""; }; F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FoliageColor.cpp; sourceTree = ""; }; F99F0FAE2F8436EB00F2B29A /* Color.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = ""; }; - BEEF202614CFF670005F0001 /* Lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Lighting.cpp; path = ../../src/client/renderer/Lighting.cpp; sourceTree = ""; }; + BEEF202614CFF670005F0001 /* Lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Lighting.cpp; path = client/renderer/Lighting.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ From 9db9f469cc59ba35f46a4a7ce7f08be6b238129c Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 11 Apr 2026 20:40:56 +0500 Subject: [PATCH 095/189] xcode attempt 2 --- project/iosproj/minecraftpe.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 1bd42e1..9e371ea 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -2468,7 +2468,7 @@ F99F0FA82F84369F00F2B29A /* GrassColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GrassColor.cpp; sourceTree = ""; }; F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FoliageColor.cpp; sourceTree = ""; }; F99F0FAE2F8436EB00F2B29A /* Color.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = ""; }; - BEEF202614CFF670005F0001 /* Lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Lighting.cpp; path = client/renderer/Lighting.cpp; sourceTree = ""; }; + BEEF202614CFF670005F0001 /* Lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Lighting.cpp; path = Lighting.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ From c188fa0ce2dfbaa0939908d18c977745bf057af9 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sun, 12 Apr 2026 01:12:17 +0500 Subject: [PATCH 096/189] Attempt to fix Normal Lighting and Shadows on Android, also disabled fancy trees temporarily due to performance issues on android. --- src/client/renderer/ItemInHandRenderer.cpp | 5 ++++- src/client/renderer/entity/EntityRenderer.cpp | 2 +- src/client/renderer/gles.h | 2 +- src/world/level/biome/Biome.cpp | 2 +- src/world/level/biome/ForestBiome.h | 2 +- src/world/level/biome/RainforestBiome.h | 2 +- src/world/level/tile/Sapling.h | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/client/renderer/ItemInHandRenderer.cpp b/src/client/renderer/ItemInHandRenderer.cpp index 3bd90bc..b45d837 100755 --- a/src/client/renderer/ItemInHandRenderer.cpp +++ b/src/client/renderer/ItemInHandRenderer.cpp @@ -375,7 +375,9 @@ void ItemInHandRenderer::render( float a ) } glEnableClientState2(GL_VERTEX_ARRAY); glEnableClientState2(GL_TEXTURE_COORD_ARRAY); + glEnableClientState2(GL_NORMAL_ARRAY); renderItem(player, item); + glDisableClientState2(GL_NORMAL_ARRAY); glDisableClientState2(GL_VERTEX_ARRAY); glDisableClientState2(GL_TEXTURE_COORD_ARRAY); glPopMatrix2(); @@ -394,7 +396,8 @@ void ItemInHandRenderer::render( float a ) glTranslatef2(0.8f * d, -0.75f * d - (1 - h) * 0.6f, -0.9f * d); glRotatef2(45, 0, 1, 0); - glEnable2(GL_RESCALE_NORMAL); +// glEnable2(GL_RESCALE_NORMAL); + glEnable(GL_NORMALIZE); glRotatef2(swing2 * 70, 0, 1, 0); glRotatef2(-swing3 * 20, 0, 0, 1); // glRotatef2(-swing2 * 80, 1, 0, 0); diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index 5538fda..1f745d2 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -187,7 +187,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po //Textures* textures = entityRenderDispatcher->textures; //textures->bind(textures->loadTexture("%clamp%/environment/shadow.png")); Textures* textures = entityRenderDispatcher->textures; - textures->bind(textures->loadTexture("/misc/shadow.png")); + textures->loadAndBindTexture(("/misc/shadow.png")); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index e557b1a..bd69eeb 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -12,7 +12,7 @@ #if defined(ANDROID) || defined(__APPLE__) || defined(RPI) #define OPENGL_ES #endif - +#define GLES_SILENCE_DEPRECATION // Other systems might run it, if they #define OPENGL_ES // #if defined(OPENGL_ES) // || defined(ANDROID) #define USE_VBO diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index f97cab8..2c8638f 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -143,7 +143,7 @@ void Biome::teardownBiomes() { Feature* Biome::getTreeFeature( Random* random ) { if (random->nextInt(10) == 0) { - return new BasicTree(false); + // return new BasicTree(false); // temporarily disabled } return new TreeFeature(false); } diff --git a/src/world/level/biome/ForestBiome.h b/src/world/level/biome/ForestBiome.h index fa47dc0..b28d49d 100755 --- a/src/world/level/biome/ForestBiome.h +++ b/src/world/level/biome/ForestBiome.h @@ -16,7 +16,7 @@ public: return new BirchFeature(); } if (random->nextInt(3) == 0) { - return new BasicTree(false); + // return new BasicTree(false); // temporarily disabled } return new TreeFeature(false); } diff --git a/src/world/level/biome/RainforestBiome.h b/src/world/level/biome/RainforestBiome.h index cc80e84..ac94272 100755 --- a/src/world/level/biome/RainforestBiome.h +++ b/src/world/level/biome/RainforestBiome.h @@ -13,7 +13,7 @@ class RainforestBiome: public Biome public: Feature* getTreeFeature(Random* random) { if (random->nextInt(3) == 0) { - return new BasicTree(false); + // return new BasicTree(false); // temporarily disabled } return new TreeFeature(false); } diff --git a/src/world/level/tile/Sapling.h b/src/world/level/tile/Sapling.h index 15877d7..6f697f4 100755 --- a/src/world/level/tile/Sapling.h +++ b/src/world/level/tile/Sapling.h @@ -92,7 +92,7 @@ public: // } } else { if (random->nextInt(10) == 0) { - f = new BasicTree(true); +// f = new BasicTree(true); // temporarily disabled } else f = new TreeFeature(true); } From e1c2210621004eb37376e78a8444920f092715c2 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sun, 12 Apr 2026 02:09:42 +0500 Subject: [PATCH 097/189] sigh, another attempt at fixing normal shading for android --- src/client/gui/Gui.cpp | 2 +- src/client/model/geom/ModelPart.cpp | 2 +- src/client/renderer/Tesselator.cpp | 34 ++++++++++++++++++----------- src/client/renderer/Tesselator.h | 4 +++- src/client/renderer/VertecDecl.h | 3 ++- src/client/renderer/gles.cpp | 4 ++-- src/client/renderer/gles.h | 12 +++++----- 7 files changed, 36 insertions(+), 25 deletions(-) diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index c6e786a..afdb7cb 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -606,7 +606,7 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16); glDisable(GL_BLEND); - } else if(!bowEquipped) { + } else if((!bowEquipped) || (!minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA))) { const float tprogress = minecraft->gameMode->destroyProgress; const float alpha = Mth::clamp(minecraft->inputHolder->alpha, 0.0f, 1.0f); //LOGI("alpha: %f\n", alpha); diff --git a/src/client/model/geom/ModelPart.cpp b/src/client/model/geom/ModelPart.cpp index 86ab82c..d0bc00d 100755 --- a/src/client/model/geom/ModelPart.cpp +++ b/src/client/model/geom/ModelPart.cpp @@ -203,7 +203,7 @@ void ModelPart::compile( float scale ) void ModelPart::draw() { #ifdef OPENGL_ES - drawArrayVTN_NoState(vboId, cubes.size() * 2 * 3 * 6, 28); + drawArrayVTN_NoState(vboId, cubes.size() * 2 * 3 * 6, 36); #else glCallList(list); #endif diff --git a/src/client/renderer/Tesselator.cpp b/src/client/renderer/Tesselator.cpp index 7feff29..e2a9fa8 100755 --- a/src/client/renderer/Tesselator.cpp +++ b/src/client/renderer/Tesselator.cpp @@ -8,7 +8,7 @@ Tesselator Tesselator::instance(sizeof(GLfloat) * MAX_FLOATS); // max size in by const int VertexSizeBytes = sizeof(VERTEX); Tesselator::Tesselator( int size ) -: size(size), + : size(size), vertices(0), u(0), v(0), _color(0), @@ -20,7 +20,7 @@ Tesselator::Tesselator( int size ) _noColor(false), mode(0), xo(0), yo(0), zo(0), - _normal(0), + _nx(0), _ny(0), _nz(0), _sx(1), _sy(1), tesselating(false), @@ -97,9 +97,9 @@ RenderChunk Tesselator::end( bool useMine, int bufferId ) int access = GL_STATIC_DRAW;//(accessMode==ACCESS_DYNAMIC) ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW; glBindBuffer2(GL_ARRAY_BUFFER, bufferId); glBufferData2(GL_ARRAY_BUFFER, bytes, _varray, access); // GL_STREAM_DRAW - + totalSize += bytes; - + #ifndef USE_VBO // 0 1 2 3 4 5 6 7 // x y z u v c @@ -112,7 +112,7 @@ RenderChunk Tesselator::end( bool useMine, int bufferId ) glEnableClientState2(GL_COLOR_ARRAY); } if (hasNormal) { - glNormalPointer(GL_BYTE, VertexSizeBytes, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, VertexSizeBytes, (GLvoid*) (6 * 4)); glEnableClientState2(GL_NORMAL_ARRAY); } glVertexPointer2(3, GL_FLOAT, VertexSizeBytes, 0); @@ -279,7 +279,9 @@ void Tesselator::vertex( float x, float y, float z ) dst.color = src.color; } if (hasNormal) { - dst.normal = src.normal; + dst.nx = src.nx; + dst.ny = src.ny; + dst.nz = src.nz; } dst.x = src.x; @@ -302,7 +304,9 @@ void Tesselator::vertex( float x, float y, float z ) vertex.color = _color; } if (hasNormal) { - vertex.normal = _normal; + vertex.nx = _nx; + vertex.ny = _ny; + vertex.nz = _nz; } vertex.x = _sx * (x + xo); @@ -339,11 +343,15 @@ void Tesselator::normal( float x, float y, float z ) if (!tesselating) printf("But.."); hasNormal = true; - char xx = (char) (x * 128); - char yy = (char) (y * 127); - char zz = (char) (z * 127); + //char xx = (char) (x * 128); + //char yy = (char) (y * 127); + //char zz = (char) (z * 127); - _normal = xx | (yy << 8) | (zz << 16); + //_normal = xx | (yy << 8) | (zz << 16); + // trying a new thing hopefully works + this->_nx = x; + this->_ny = y; + this->_nz = z; } void Tesselator::offset( float xo, float yo, float zo ) { @@ -389,7 +397,7 @@ void Tesselator::draw() vboId = 0; int bufferId = vboIds[vboId]; - + int access = GL_DYNAMIC_DRAW;//(accessMode==ACCESS_DYNAMIC) ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW; glBindBuffer2(GL_ARRAY_BUFFER, bufferId); glBufferData2(GL_ARRAY_BUFFER, bytes, _varray, access); // GL_STREAM_DRAW @@ -405,7 +413,7 @@ void Tesselator::draw() glEnableClientState2(GL_COLOR_ARRAY); } if (hasNormal) { - glNormalPointer(GL_BYTE, VertexSizeBytes, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, VertexSizeBytes, (GLvoid*) (6 * 4)); glEnableClientState2(GL_NORMAL_ARRAY); } //glVertexPointer2(3, GL_FLOAT, VertexSizeBytes, (GLvoid*)&_varray); diff --git a/src/client/renderer/Tesselator.h b/src/client/renderer/Tesselator.h index 3ad1a64..1f0192b 100755 --- a/src/client/renderer/Tesselator.h +++ b/src/client/renderer/Tesselator.h @@ -98,7 +98,9 @@ private: float xo, yo, zo; float u, v; unsigned int _color; - int _normal; +// int _normal; // trying a new thing + float _nx, _ny, _nz; + float _sx, _sy; bool hasColor; diff --git a/src/client/renderer/VertecDecl.h b/src/client/renderer/VertecDecl.h index 8abc1d3..cd48104 100755 --- a/src/client/renderer/VertecDecl.h +++ b/src/client/renderer/VertecDecl.h @@ -14,7 +14,8 @@ typedef struct VertexDeclPTCN GLfloat x, y, z; GLfloat u, v; GLuint color; - GLuint normal; +// GLuint normal; // trying a new thing + GLfloat nx, ny, nz; } VertexDeclPTCN; diff --git a/src/client/renderer/gles.cpp b/src/client/renderer/gles.cpp index 6b06488..df44d20 100755 --- a/src/client/renderer/gles.cpp +++ b/src/client/renderer/gles.cpp @@ -128,7 +128,7 @@ void drawArrayVTN(int bufferId, int vertices, int vertexSize /* = 24 */) { glVertexPointer2( 3, GL_FLOAT, vertexSize, 0); glTexCoordPointer2(2, GL_FLOAT, vertexSize, (GLvoid*) (3 * 4)); //glColorPointer2(4, GL_UNSIGNED_BYTE, vertexSize, (GLvoid*) (5*4)); - glNormalPointer(GL_BYTE, vertexSize, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, vertexSize, (GLvoid*) (6 * 4)); glDrawArrays2(GL_TRIANGLES, 0, vertices); @@ -145,7 +145,7 @@ void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize /* = 24 */ glVertexPointer2( 3, GL_FLOAT, vertexSize, 0); glTexCoordPointer2(2, GL_FLOAT, vertexSize, (GLvoid*) (3 * 4)); //glColorPointer2(4, GL_UNSIGNED_BYTE, vertexSize, (GLvoid*) (5*4)); - glNormalPointer(GL_BYTE, vertexSize, (GLvoid*) (6 * 4)); + glNormalPointer(GL_FLOAT, vertexSize, (GLvoid*) (6 * 4)); glDrawArrays2(GL_TRIANGLES, 0, vertices); } diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index bd69eeb..a82c35c 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -60,17 +60,17 @@ void anGenBuffers(GLsizei n, GLuint* buffer); #define drawArrayVT_NoState drawArrayVT #define drawArrayVTC_NoState drawArrayVTC #define drawArrayVTN_NoState drawArrayVTN -void drawArrayVT(int bufferId, int vertices, int vertexSize = 28, unsigned int mode = GL_TRIANGLES); +void drawArrayVT(int bufferId, int vertices, int vertexSize = 36, unsigned int mode = GL_TRIANGLES); #ifndef drawArrayVT_NoState -//void drawArrayVT_NoState(int bufferId, int vertices, int vertexSize = 28); +//void drawArrayVT_NoState(int bufferId, int vertices, int vertexSize = 36); #endif -void drawArrayVTC(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTC(int bufferId, int vertices, int vertexSize = 36); #ifndef drawArrayVTC_NoState -void drawArrayVTC_NoState(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTC_NoState(int bufferId, int vertices, int vertexSize = 36); #endif -void drawArrayVTN(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTN(int bufferId, int vertices, int vertexSize = 36); #ifndef drawArrayVTN_NoState -void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize = 28); +void drawArrayVTCN_NoState(int bufferId, int vertices, int vertexSize = 36); #endif #endif From 4d68c4dff8c9f50be16a5135eed69ff78895b934 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sun, 12 Apr 2026 02:26:54 +0500 Subject: [PATCH 098/189] forgot to change vertex size for touch circle, also shadow attempt fix again --- src/client/gui/Gui.cpp | 13 +++++-------- src/client/renderer/entity/EntityRenderer.cpp | 5 +++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index afdb7cb..0489236 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -382,7 +382,6 @@ void Gui::renderVignette(float br, int w, int h) { void Gui::renderSlot(int slot, int x, int y, float a) { ItemInstance* item = minecraft->player->inventory->getItem(slot); - if (!item) { //LOGW("Warning: item @ Gui::renderSlot is NULL\n"); return; @@ -596,17 +595,15 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen ItemInstance* currentItem = minecraft->player->inventory->getSelected(); bool bowEquipped = currentItem != NULL ? currentItem->getItem() == Item::bow : false; bool itemInUse = currentItem != NULL ? currentItem->getItem() == minecraft->player->getUseItem()->getItem() : false; - //if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA) - // || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA) -|| (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) + || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { minecraft->textures->loadAndBindTexture("gui/icons.png"); glEnable(GL_BLEND); glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16); glDisable(GL_BLEND); - } else if((!bowEquipped) || (!minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA))) { + } else if(!bowEquipped) { const float tprogress = minecraft->gameMode->destroyProgress; const float alpha = Mth::clamp(minecraft->inputHolder->alpha, 0.0f, 1.0f); //LOGI("alpha: %f\n", alpha); @@ -624,7 +621,7 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen const float x = InvGuiScale * minecraft->inputHolder->mousex; const float y = InvGuiScale * minecraft->inputHolder->mousey; glTranslatef2(x, y, 0); - drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 24); + drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 36); glTranslatef2(-x, -y, 0); glEnable2(GL_TEXTURE_2D); @@ -645,12 +642,12 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen const float y = InvGuiScale * minecraft->inputHolder->mousey; glPushMatrix2(); glTranslatef2(x, y, 0); - drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 24); + drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 36); glScalef2(0.5f + progress, 0.5f + progress, 1); //glDisable2(GL_CULL_FACE); glColor4f2(1, 1, 1, 1); glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR); - drawArrayVT(rcFeedbackInner.vboId, rcFeedbackInner.vertexCount, 24, GL_TRIANGLE_FAN); + drawArrayVT(rcFeedbackInner.vboId, rcFeedbackInner.vertexCount, 36, GL_TRIANGLE_FAN); glPopMatrix2(); glDisable(GL_BLEND); diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index 1f745d2..6a3c64d 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -135,7 +135,7 @@ void EntityRenderer::postRender(Entity* entity, float x, float y, float z, float } } void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) { - glDisable(GL_LIGHTING); + glDisable(GL_LIGHTING); int tex = ((Tile*)Tile::fire)->tex; int xt = (tex & 0xf) << 4; @@ -187,7 +187,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po //Textures* textures = entityRenderDispatcher->textures; //textures->bind(textures->loadTexture("%clamp%/environment/shadow.png")); Textures* textures = entityRenderDispatcher->textures; - textures->loadAndBindTexture(("/misc/shadow.png")); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); @@ -222,6 +222,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po renderTileShadow(Tile::tiles[t], x, y + e->getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e->getShadowHeightOffs(), zo); } } + textures->loadAndBindTexture(("/misc/shadow.png")); tt.draw(); glColor4f2(1, 1, 1, 1); From d6a3e477c12bd3963008196bafd9206cd320adc0 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sun, 12 Apr 2026 02:29:27 +0500 Subject: [PATCH 099/189] forgot to move the clamp calls below --- src/client/renderer/entity/EntityRenderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index 6a3c64d..692a967 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -189,8 +189,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po Textures* textures = entityRenderDispatcher->textures; - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + Level* level = getLevel(); @@ -223,6 +222,8 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po } } textures->loadAndBindTexture(("/misc/shadow.png")); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); tt.draw(); glColor4f2(1, 1, 1, 1); From 3a0f4c364750158a337d0bfb6df3f91fdd96f863 Mon Sep 17 00:00:00 2001 From: Dram27 Date: Mon, 13 Apr 2026 17:42:19 +0200 Subject: [PATCH 100/189] Fix upper sky cut when using fancy graphics --- src/client/renderer/GameRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index aab7f2a..f650867 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -277,7 +277,7 @@ void GameRenderer::renderLevel(float a) { TIMER_POP_PUSH("sky"); glFogf(GL_FOG_START, renderDistance * 0.2f); glFogf(GL_FOG_END, renderDistance *0.75); - levelRenderer->renderSky(a); + // levelRenderer->renderSky(a); // Removed duplicate call glFogf(GL_FOG_START, renderDistance * 0.6f); glFogf(GL_FOG_END, renderDistance); } From bc82f5c091a6e411d705bf2e179f74443c2433df Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Wed, 15 Apr 2026 01:06:48 +0300 Subject: [PATCH 101/189] FIX: Completely remove renderSky() codeblock --- src/client/renderer/GameRenderer.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index f650867..32068f8 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -272,15 +272,6 @@ void GameRenderer::renderLevel(float a) { screenScissorArea.w, screenScissorArea.h); } - if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { - setupFog(-1); - TIMER_POP_PUSH("sky"); - glFogf(GL_FOG_START, renderDistance * 0.2f); - glFogf(GL_FOG_END, renderDistance *0.75); - // levelRenderer->renderSky(a); // Removed duplicate call - glFogf(GL_FOG_START, renderDistance * 0.6f); - glFogf(GL_FOG_END, renderDistance); - } glEnable2(GL_FOG); setupFog(1); From 31d80aedf866e68b86cc93c3bd5d46e87dd5bad1 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 25 Apr 2026 04:47:07 +0500 Subject: [PATCH 102/189] Massive Java Parity Update - fileshredder 3D/Fancy Clouds have been ported over Sky Rendering is now an option between Java and PE Java Sky/Fog color option is now accurate using the original color ramp instead of PE's slightly lower one Grass Sides are now tinted, and can be toggled in settings Added stars, the sun, and the moon in the daylight cycle Sunset color has been added, appears when the sun is rising or falling, buggy on PE's sky rendering option. Fixed leaves being rendered bright green when foliage tinting was turned off. Enabled Tall Grass generation code Tall Grass is now tinted. Other compile options have to be tested --- data/images/misc/water.png | Bin 0 -> 306 bytes data/images/terrain/moon.png | Bin 0 -> 910 bytes data/images/terrain/sun.png | Bin 0 -> 799 bytes src/client/Minecraft.cpp | 6 +- src/client/Options.cpp | 8 + src/client/Options.h | 2 + src/client/gui/Gui.cpp | 3 + src/client/gui/screens/OptionsScreen.cpp | 2 + src/client/renderer/GameRenderer.cpp | 49 +- src/client/renderer/LevelRenderer.cpp | 365 +++++++++- src/client/renderer/LevelRenderer.h | 11 + src/client/renderer/TileRenderer.cpp | 681 ++++++++++-------- src/client/renderer/TileRenderer.h | 6 + src/world/entity/animal/Sheep.cpp | 9 +- src/world/item/DyePowderItem.cpp | 7 +- src/world/item/ShearsItem.h | 2 +- src/world/level/FoliageColor.h | 2 +- src/world/level/Level.cpp | 9 +- src/world/level/biome/Biome.cpp | 21 + src/world/level/biome/Biome.h | 8 + .../level/levelgen/RandomLevelSource.cpp | 4 +- src/world/level/tile/LeafTile.h | 1 + src/world/level/tile/TallGrass.cpp | 25 +- 23 files changed, 864 insertions(+), 357 deletions(-) create mode 100644 data/images/misc/water.png create mode 100644 data/images/terrain/moon.png create mode 100644 data/images/terrain/sun.png diff --git a/data/images/misc/water.png b/data/images/misc/water.png new file mode 100644 index 0000000000000000000000000000000000000000..8b92f9bcf74590e50f4eed14ad30e63b634705ea GIT binary patch literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6-MC9V-A z!TD(=<%vb93;~Imc_n&&t|1C##(KtPE1y471*$pf>Eak-;oloIy5((r`rAv< z+c(9?XYS$6bXla_IG_8G!ZR-Ei5>qJ9zM@q;p6#$jXy|5W&vyOTxIw5Yd*+^`W>j% zEV*H7cz-5e>s(WdEJOal?E(i=<@KTjTqdtyczccEtI6y#iU(r1vfkaj_|Auf{Mz() z;WiyBWDGwE9F$X@x^d>I^q10tJe;SKS8ZHt)-753^V_VsAG1LoV(@hJb6Mw<&;$T3 C&3H)w literal 0 HcmV?d00001 diff --git a/data/images/terrain/moon.png b/data/images/terrain/moon.png new file mode 100644 index 0000000000000000000000000000000000000000..61cebbc7e37dab2eabff7bb7256ae17c549c20c0 GIT binary patch literal 910 zcmV;919AL`P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+xt=~>kP00RC=L_t(oN6nW_a??N%g=Oo*3a}$luTRk-u@kfv%D>o1?2`5RF(INJj>+E8F*e=--vSCi?1z`!OI#;S zsUK%Nxkf)81W{kd{Zt?grcx~csUR8voII=+lWD>@$tg~Ulw<`T!_aF(8H2G3)B;jL z1OTr3Ah}j7iCxkp8&NtKQ<_iOgYRLC!Kg|K5~vYEfTRY{fm$`H!DN2oY&fGqvCtTu zX}I6GCvZLp&tYm{Zn2{kz*P_LKwT#*Z$1*ofsk0QHN zzNTXGge!d}$tKH}99x>KUTNT*ui+lXV5~ui9nuqpdpgixtU}!f4B+Iiy|?NYPWB5g z`Ie^ZHyl?qJHM8|Ij#Z3AXEvqgL^`)U=>_1G;B}+Uw*3|O$A>?cBya`9i3M0F?rK6L zvW~Z^{cA@xp{;`Z9z#otV-w`4#}JFdaSIVIMyuBkT!^||iuG;S;mhbhc^&Iwq_5;| zK1ke(*xe^twItj3|D%4Ch99OKe3p9vl@+)52mg3u(tv1yJi^v&&mJ+@Hyp4*efZ{d k-Px# literal 0 HcmV?d00001 diff --git a/data/images/terrain/sun.png b/data/images/terrain/sun.png new file mode 100644 index 0000000000000000000000000000000000000000..d3433441fbed6519f5925436583ac2a6b518f211 GIT binary patch literal 799 zcmV+)1K|9LP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+xt=~>kP00NImL_t(oN7a|vR^mVqh7%GX5J245qaO9B z&oYnd`*<-=Q8f>q7JdUmamq??j%VP+egwgvG2$}J~ujl18fU48YQ-m zY_s12)c|x26)ekAb4e`E)188j^kv`m+W~QaSg9S@gO10kO(vsC_)Tp(9koR3=%9;@ zVERBJh&BMqakd`V0~SSQvsq^Id0q*>vE*S79dxnj15u(a04>JBl`+l~v@CO5F2}Z7 z^$UCG0Emr)ctzrBbRe4YJ3z82cN((6SsZx1p4iFBG|1_xi~eR0xEKTsL z=^fMxzF6eJsREy!6?T4J*yZJ{C9JUrj6kp@0f!iE<|3^j>empWID1Nmp@JVDd!`C} zb2GQw+p-dV{h2kO&_Nd)zy*O%wL(>B0Wf%;eH!{l*>RxY7Z-(HUClzk`}>7GJS^<- zaT$bX*4RS_-53I2_{6ur9cgGo08l?zgizVjM@oq!9A00~?e4A&!JeL0_WZoEmlqeF zSz`|!bOnJAd{NP+3Jwq;;_|Ea%AS5wQnFHTg1x>T+1uNZy}z%6@XQ)}g1`n_d{9Yz zY8K*QtO4TkD|?2DzEWBo6Tm)y?G!;^gDpN(g}4p%9H;^Upi~emdxnetQev_U0QS)@ z)gC(NVuNj51$=7`dI7xuSq`U(#68uD=%>_f!2V6acIj$?!UGZMhy z|BeSgkaQ0vyb%XIk~IK+fIR4-G`<%MaxDK57n3f8TGCYHA79Pl``Tca(_L5U?_AC6 d6Ym~Z|3Byt_NjE?O~U{H002ovPDHLkV1jmmUEcrz literal 0 HcmV?d00001 diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 0ea8e9d..2a05eb2 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1156,6 +1156,10 @@ void Minecraft::init() FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); + bool sideTint = options.getBooleanValue(OPTIONS_TINTED_SIDE); + TileRenderer::setUseTint(sideTint); + + // Platform specific initialization here font = new Font(&options, "font/default8.png", textures); @@ -1408,7 +1412,7 @@ void Minecraft::_levelGenerated() if (level && level->dimension) { // For example, if you want FogType or any other option - level->dimension->FogType = options.getBooleanValue(OPTIONS_FOG_TYPE); + level->dimension->FogType = options.getIntValue(OPTIONS_FOG_TYPE); } diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 78cef1a..ee9aced 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -68,6 +68,10 @@ OptionInt fogType("fogType", 0, 0, 2); OptionBool javaHud("javaHud", false); +OptionBool betaSky("betaSky", false); + +OptionBool tintedSide("tintedSide", false); + OptionBool blockOutline("blockOutline", false); OptionBool restoredAnims("restoredAnims", true); @@ -183,6 +187,10 @@ void Options::initTable() { // more options yay m_options[OPTIONS_FOG_TYPE] = &fogType; + m_options[OPTIONS_BETA_SKY] = &betaSky; + + m_options[OPTIONS_TINTED_SIDE] = &tintedSide; + m_options[OPTIONS_JAVA_HUD] = &javaHud; m_options[OPTIONS_AUTOJUMP] = &autoJump; diff --git a/src/client/Options.h b/src/client/Options.h index 7d1d3b4..826bfb3 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -90,6 +90,8 @@ enum OptionId { OPTIONS_FOG_TYPE, OPTIONS_JAVA_HUD, OPTIONS_RESTORED_ANIMS, + OPTIONS_TINTED_SIDE, + OPTIONS_BETA_SKY, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index 0489236..c9f63ea 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -121,6 +121,9 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { if (!minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { renderToolBar(a, ySlot, screenWidth); + font->drawShadow("Minecraft - Pocket Edition ", 2, 2, 0xffffffff); +// font->drawShadow("This is a demo, not the finished product", 2, 10 + 2, 0xffffffff); + glEnable(GL_BLEND); bool isChatting = (minecraft->screen && (dynamic_cast(minecraft->screen) || dynamic_cast(minecraft->screen))); unsigned int max = 10; diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 88fbb63..9e53721 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -233,8 +233,10 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) + .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) .addOptionItem(OPTIONS_JAVA_HUD, minecraft) .addOptionItem(OPTIONS_FOG_TYPE, minecraft) + .addOptionItem(OPTIONS_BETA_SKY, minecraft) .addOptionItem(OPTIONS_RESTORED_ANIMS, minecraft); } diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index aab7f2a..aab253a 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -272,17 +272,6 @@ void GameRenderer::renderLevel(float a) { screenScissorArea.w, screenScissorArea.h); } - if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { - setupFog(-1); - TIMER_POP_PUSH("sky"); - glFogf(GL_FOG_START, renderDistance * 0.2f); - glFogf(GL_FOG_END, renderDistance *0.75); - levelRenderer->renderSky(a); - glFogf(GL_FOG_START, renderDistance * 0.6f); - glFogf(GL_FOG_END, renderDistance); - } - glEnable2(GL_FOG); - setupFog(1); if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { glShadeModel2(GL_SMOOTH); @@ -295,10 +284,29 @@ void GameRenderer::renderLevel(float a) { TIMER_POP_PUSH("culling"); mc->levelRenderer->cull(&frustum, a); mc->levelRenderer->updateDirtyChunks(cameraEntity, false); - + // this sky rendering code below was originally before the frustrum and culling stuff but sunset color breaks for some reason in that place, so i moved i after those two - shredder if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { + setupFog(-1); + TIMER_POP_PUSH("sky"); + // @TODO - EXTREME JANK BELOW, it works but i have to do heavy cleanup here, also to test if the glfogf commands even affect fog in anyway. + if(mc->options.getBooleanValue(OPTIONS_BETA_SKY) && (mc->options.getIntValue(OPTIONS_VIEW_DISTANCE) < 2)){ + levelRenderer->renderSky(a); // how java renders the sky instead of how pe doing prepareandrenderclouds. + } else if (!mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ + glFogf(GL_FOG_START, renderDistance * 0.2f); + glFogf(GL_FOG_END, renderDistance *0.75); + + glFogf(GL_FOG_START, renderDistance * 0.6f); + glFogf(GL_FOG_END, renderDistance); + } + } + glEnable2(GL_FOG); + setupFog(1); + // MCPE renders clouds using this, but this method breaks 3d clouds and also breaks 2d clouds transparency viewed from above, add as a Legacy Sky or Fast Sky option. - shredder + if(!mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ + if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { prepareAndRenderClouds(levelRenderer, a); } + } setupFog(0); glEnable2(GL_FOG); @@ -306,7 +314,9 @@ void GameRenderer::renderLevel(float a) { mc->textures->loadAndBindTexture("terrain.png"); Lighting::turnOff(); - glDisable2(GL_ALPHA_TEST); +// glDisable2(GL_ALPHA_TEST); // vanilla pe disables alpha test here, i renable it so grass side textures dont become opaque - shredder + glEnable2(GL_ALPHA_TEST); // + glDisable2(GL_BLEND); glEnable2(GL_CULL_FACE); TIMER_POP_PUSH("terrain-0"); @@ -374,11 +384,14 @@ void GameRenderer::renderLevel(float a) { } glDisable2(GL_FOG); - // - // setupFog(0); - // glEnable2(GL_FOG); - //// levelRenderer->renderClouds(a); - // glDisable2(GL_FOG); + // Normally this is commented out, but this is how java does it and should fix both 2d/3d clouds, a + if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ + setupFog(0); + glEnable2(GL_FOG); + levelRenderer->renderClouds(a); + glDisable2(GL_FOG); + } + // SHREDDER END setupFog(1); if (zoom == 1 && !mc->options.getBooleanValue(OPTIONS_HIDEGUI)) { diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 0c77682..6ce0d9b 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -76,6 +76,9 @@ LevelRenderer::LevelRenderer( Minecraft* mc) //for (int i = 0; i < numListsOrBuffers; ++i) printf("bufId %d: %d\t", i, chunkBuffers[i]); glGenBuffers2(1, &skyBuffer); + glGenBuffers2(1, &voidBuffer); + glGenBuffers2(1, &starBuffer); + generateStars(); generateSky(); #else int maxChunksWidth = 1024 / CHUNK_SIZE; @@ -94,6 +97,8 @@ LevelRenderer::~LevelRenderer() #ifdef OPENGL_ES glDeleteBuffers(numListsOrBuffers, chunkBuffers); glDeleteBuffers(1, &skyBuffer); + glDeleteBuffers(1, &voidBuffer); + glDeleteBuffers(1, &starBuffer); delete[] chunkBuffers; #else glDeleteLists(numListsOrBuffers, chunkLists); @@ -121,6 +126,25 @@ void LevelRenderer::generateSky() { } t.end(true, skyBuffer); + + yy = (float) (-16); + t.begin(); + + // pretty much the same thing as the sky one above except uses inverted values to generate the void plane. + + voidVertexCount = 0; + for (int xx = -s * d; xx <= s * d; xx += s) { + for (int zz = -s * d; zz <= s * d; zz += s) { + t.vertex((float) xx + 0, yy, (float) zz + s); + t.vertex((float)(xx + s), yy, (float) zz + s); + t.vertex((float)(xx + s), yy, (float)(zz + 0)); + t.vertex((float) xx + 0, yy, (float)(zz + 0)); + //LOGI("x, z: %d, %d\n", xx, zz); + voidVertexCount += 4; + } + } + + t.end(true, voidBuffer); //LOGI("skyvertexcount: %d\n", skyVertexCount); //glEndList(); } @@ -146,10 +170,6 @@ void LevelRenderer::setLevel( Level* level ) level->addListener(this); allChanged(); } - if (mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION)) { - mc->useAmbientOcclusion = !mc->useAmbientOcclusion; - allChanged(); - } } void LevelRenderer::allChanged() @@ -168,6 +188,9 @@ void LevelRenderer::allChanged() FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); + bool sideTint = mc->options.getBooleanValue(OPTIONS_TINTED_SIDE); + TileRenderer::setUseTint(sideTint); + int dist = (512 >> 3) << (3 - lastViewDistance); if (lastViewDistance <= 2 && mc->isPowerVR()) @@ -325,6 +348,37 @@ int LevelRenderer::render( Mob* player, int layer, float alpha ) allChanged(); } + bool SmoothLightState = mc->options.getBooleanValue(OPTIONS_AMBIENT_OCCLUSION); + if (SmoothLightState != mc->useAmbientOcclusion){ + mc->useAmbientOcclusion = SmoothLightState; + allChanged(); + } + + + bool tint = mc->options.getBooleanValue(OPTIONS_FOLIAGE_TINT); + if (tint != LastTint) { + LastTint = tint; + + + FoliageColor::setUseTint(tint); + GrassColor::setUseTint(tint); + + allChanged(); + } + + + bool sideTint = mc->options.getBooleanValue(OPTIONS_TINTED_SIDE); + + if (sideTint != LastSideTint) { + LastSideTint = sideTint; + + + TileRenderer::setUseTint(sideTint); + + allChanged(); + } + + TIMER_PUSH("sortchunks"); for (int i = 0; i < 10; i++) { @@ -513,14 +567,14 @@ void LevelRenderer::render(const AABB& b) const { Tesselator& t = Tesselator::instance; -// glColor4f2(1, 1, 1, 1); + // glColor4f2(1, 1, 1, 1); -// textures->loadAndBindTexture("terrain.png"); // uh need to check java - shredder + // textures->loadAndBindTexture("terrain.png"); // uh need to check java - shredder //t.begin(); -// t.color(255, 255, 255, 255); // again not needed, for some reason the vanilla source code tints it... white? maybe this was used for something else in MCPE's dev at one point? - shredder + // t.color(255, 255, 255, 255); // again not needed, for some reason the vanilla source code tints it... white? maybe this was used for something else in MCPE's dev at one point? - shredder -// t.offset(((Mob*)mc->player)->getPos(0).negated()); // why does this even exist normally, it just makes the thing... not render + // t.offset(((Mob*)mc->player)->getPos(0).negated()); // why does this even exist normally, it just makes the thing... not render t.begin(GL_LINE_STRIP); t.vertex(b.x0, b.y0, b.z0); @@ -1016,6 +1070,57 @@ std::string LevelRenderer::gatherStats1() { // int[] toRender = new int[50000]; // IntBuffer resultBuffer = MemoryTracker.createIntBuffer(64); + void LevelRenderer::generateStars() { + // ported from java beta again, + // converted the doubles into floats to be consistent, shouldnt affect much - shredder + + Random random = Random(10842L); + Tesselator& t = Tesselator::instance; + t.begin(); + starVertexCount = 0; + + for (int i = 0; i < 1500; i++) { + float d = random.nextFloat() * 2.0F - 1.0F; + float e = random.nextFloat() * 2.0F - 1.0F; + float f = random.nextFloat() * 2.0F - 1.0F; + float g = 0.25F + random.nextFloat() * 0.25F; + float h = d * d + e * e + f * f; + if (h < 1.0 && h > 0.01) { + h = 1.0 / Mth::sqrt(h); + d *= h; + e *= h; + f *= h; + float j = d * 100.0; + float k = e * 100.0; + float l = f * 100.0; + float m = Mth::atan2(d, f); + float n = Mth::sin(m); + float o = Mth::cos(m); + float p = Mth::atan2(Mth::sqrt(d * d + f * f), e); + float q = Mth::sin(p); + float r = Mth::cos(p); + float s = random.nextDouble() * Mth::PI * 2.0; + float t2 = Mth::sin(s); + float u = Mth::cos(s); + + for (int v = 0; v < 4; v++) { + float w = 0.0; + float x = ((v & 2) - 1) * g; + float y = ((v + 1 & 2) - 1) * g; + float aa = x * u - y * t2; + float ab = y * u + x * t2; + float ad = aa * q + w * r; + float ae = w * q - aa * r; + float af = ae * n - ab * o; + float ah = ab * n + ae * o; + t.vertex(j + af, k + ad, l + ah); + } + starVertexCount += 4; + } + } + + t.end(true, starBuffer); + } void LevelRenderer::renderSky(float alpha) { if (mc->level->dimension->foggy) return; @@ -1036,19 +1141,120 @@ void LevelRenderer::renderSky(float alpha) { } glColor4f2(sr, sg, Mth::Min(1.0f, sb), 1); - //Tesselator& t = Tesselator::instance; - + Tesselator& t = Tesselator::instance; + // @TODO shredder - should not enable or disable depth mask if using legacy sky because mcpe sky rendering is awful and will render clouds above terrain + if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ + glDepthMask(false); + } glEnable2(GL_FOG); glColor4f2(sr, sg, sb, 1.0f); #ifdef OPENGL_ES drawArrayVT(skyBuffer, skyVertexCount); #endif - glEnable2(GL_TEXTURE_2D); + glDisable(GL_FOG); + glDisable(GL_ALPHA_TEST); + + // thanks to the mcpe 0.1 decomp project a bit for this part, was not getting the gl states correctly, gles is painful - shredder + + // Sunrise + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + float* c = level->dimension->getSunriseColor(level->getTimeOfDay(alpha), alpha); + if (c != nullptr) + { + glDisable(GL_TEXTURE_2D); + + + glPushMatrix(); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glRotatef(level->getTimeOfDay(alpha) > 0.5f ? 180 : 0, 0.0f, 0.0f, 1.0f); + + t.begin(GL_TRIANGLE_FAN); + t.color(c[0], c[1], c[2], c[3]); + t.vertex(0.0f, 100.0f, 0.0f); + t.color(c[0], c[1], c[2], 0.0f); + + int steps = 16; + for (int i = 0; i <= steps; i++) + { + float a = i * 3.1415927f * 2.0f / steps; + float sin = Mth::sin(a); + float cos = Mth::cos(a); + t.vertex((sin * 120.0f), (cos * 120.0f), (-cos * 40.0f * c[3])); + } + + t.draw(); + glPopMatrix(); + } + + // gets the time of day and rotates the sun and moon png based on the time + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_ONE, GL_ONE); + glPushMatrix(); + + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glTranslatef(sc.x, sc.y, sc.z); + glRotatef(0.0f, 0.0f, 0.0f, 1.0f); + glRotatef(level->getTimeOfDay(alpha) * 360.0f, 1.0f, 0.0f, 0.0f); + + float ss = 30.0f; + + + textures->loadAndBindTexture("terrain/sun.png"); + t.begin(); + t.vertexUV(-ss, 100.0f, -ss, 0.0f, 0.0f); + t.vertexUV(ss, 100.0f, -ss, 1.0f, 0.0f); + t.vertexUV(ss, 100.0f, ss, 1.0f, 1.0f); + t.vertexUV(-ss, 100.0f, ss, 0.0f, 1.0f); + t.draw(); + + ss = 20.0f; + textures->loadAndBindTexture("terrain/moon.png"); + t.begin(); + t.vertexUV(-ss, -100.0f, ss, 1.0f, 1.0f); + t.vertexUV(ss, -100.0f, ss, 0.0f, 1.0f); + t.vertexUV(ss, -100.0f, -ss, 0.0f, 0.0f); + t.vertexUV(-ss, -100.0f, -ss, 1.0f, 0.0f); + t.draw(); + + + glDisable(GL_TEXTURE_2D); + + float a = level->getStarBrightness(alpha); + if (a > 0.0f) + { + glColor4f(a, a, a, a); + drawArrayVT(starBuffer, starVertexCount); + } + + + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glDisable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glEnable(GL_FOG); + glPopMatrix(); + + // ported over void plane (the blue bottom plane seen in java) because pocket edition lacks it @TODO test if it's buggy - shredder + + glColor3f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f); + glDisable(GL_TEXTURE_2D); + drawArrayVT(voidBuffer, voidVertexCount); + glEnable(GL_TEXTURE_2D); + + // @TODO shredder - should not enable or disable depth mask if using legacy sky because mcpe sky rendering is awful and will render clouds above terrain + if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ + glDepthMask(true); + } } void LevelRenderer::renderClouds( float alpha ) { //if (!mc->level->dimension->isNaturalDimension()) return; + if (mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)){ + renderAdvancedClouds(alpha); + return; + } glEnable2(GL_TEXTURE_2D); glDisable(GL_CULL_FACE); float yOffs = (float) (mc->player->yOld + (mc->player->y - mc->player->yOld) * alpha); @@ -1097,6 +1303,142 @@ void LevelRenderer::renderClouds( float alpha ) { glEnable(GL_CULL_FACE); } +void LevelRenderer::renderAdvancedClouds(float alpha) { + + // ported from java beta, tesselation code for the 3d clouds, renders broken if mcpe sky rendering option is used - shredder + + glDisable(GL_CULL_FACE); + + float px = mc->player->xOld + (mc->player->x - mc->player->xOld) * alpha; + float py = mc->player->yOld + (mc->player->y - mc->player->yOld) * alpha; + float pz = mc->player->zOld + (mc->player->z - mc->player->zOld) * alpha; + + Tesselator& t = Tesselator::instance; + float ss = 12.0f; + float h = 4.0f; + + float cloudTime = (float)ticks + alpha; + + double xo = (px + cloudTime * 0.03f) / ss; + double zo = pz / ss + 0.33f; + + float yy = 108.0f - py + 0.33f; + + int xWraps = Mth::floor(xo / 2048.0); + int zWraps = Mth::floor(zo / 2048.0); + xo -= xWraps * 2048; + zo -= zWraps * 2048; + + textures->loadAndBindTexture("environment/clouds.png"); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + Vec3 cc = level->getCloudColor(alpha); + float cr = cc.x; + float cg = cc.y; + float cb = cc.z; + + float uvScale = 1.0f / 256.0f; + float uo = (float)Mth::floor(xo) * uvScale; + float vo = (float)Mth::floor(zo) * uvScale; + + float xOffs = (float)(xo - Mth::floor(xo)); + float zOffs = (float)(zo - Mth::floor(zo)); + + int D = 8; + int radius = 3; + float e = 1.0f / 1024.0f; + + glPushMatrix(); + glScalef(ss, 1.0f, ss); + + for (int pass = 0; pass < 2; pass++) { + + if (pass == 0) glColorMask(false, false, false, false); + else glColorMask(true, true, true, true); + + for (int xPos = -radius + 1; xPos <= radius; xPos++) { + for (int zPos = -radius + 1; zPos <= radius; zPos++) { + t.begin(); + float xx = (float)(xPos * D); + float zz = (float)(zPos * D); + float xp = xx - xOffs; + float zp = zz - zOffs; + + + if (yy > -h - 1.0f) { + t.color(cr * 0.7f, cg * 0.7f, cb * 0.7f, 0.8f); + t.normal(0.0f, -1.0f, 0.0f); + t.vertexUV(xp + 0, yy + 0, zp + D, (xx + 0) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + D, yy + 0, zp + D, (xx + D) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + D, yy + 0, zp + 0, (xx + D) * uvScale + uo, (zz + 0) * uvScale + vo); + t.vertexUV(xp + 0, yy + 0, zp + 0, (xx + 0) * uvScale + uo, (zz + 0) * uvScale + vo); + } + + + if (yy <= h + 1.0f) { + t.color(cr, cg, cb, 0.8f); + t.normal(0.0f, 1.0f, 0.0f); + t.vertexUV(xp + 0, yy + h - e, zp + D, (xx + 0) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + D, yy + h - e, zp + D, (xx + D) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + D, yy + h - e, zp + 0, (xx + D) * uvScale + uo, (zz + 0) * uvScale + vo); + t.vertexUV(xp + 0, yy + h - e, zp + 0, (xx + 0) * uvScale + uo, (zz + 0) * uvScale + vo); + } + + t.color(cr * 0.9f, cg * 0.9f, cb * 0.9f, 0.8f); + + + if (xPos > -1) { + t.normal(-1.0f, 0.0f, 0.0f); + for (int i = 0; i < D; i++) { + t.vertexUV(xp + i + 0, yy + 0, zp + D, (xx + i + 0.5f) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + i + 0, yy + h, zp + D, (xx + i + 0.5f) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + i + 0, yy + h, zp + 0, (xx + i + 0.5f) * uvScale + uo, (zz + 0) * uvScale + vo); + t.vertexUV(xp + i + 0, yy + 0, zp + 0, (xx + i + 0.5f) * uvScale + uo, (zz + 0) * uvScale + vo); + } + } + if (xPos <= 1) { + t.normal(1.0f, 0.0f, 0.0f); + for (int i = 0; i < D; i++) { + t.vertexUV(xp + i + 1 - e, yy + 0, zp + D, (xx + i + 0.5f) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + i + 1 - e, yy + h, zp + D, (xx + i + 0.5f) * uvScale + uo, (zz + D) * uvScale + vo); + t.vertexUV(xp + i + 1 - e, yy + h, zp + 0, (xx + i + 0.5f) * uvScale + uo, (zz + 0) * uvScale + vo); + t.vertexUV(xp + i + 1 - e, yy + 0, zp + 0, (xx + i + 0.5f) * uvScale + uo, (zz + 0) * uvScale + vo); + } + } + + t.color(cr * 0.8f, cg * 0.8f, cb * 0.8f, 0.8f); + + + if (zPos > -1) { + t.normal(0.0f, 0.0f, -1.0f); + for (int i = 0; i < D; i++) { + t.vertexUV(xp + 0, yy + h, zp + i + 0, (xx + 0) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + t.vertexUV(xp + D, yy + h, zp + i + 0, (xx + D) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + t.vertexUV(xp + D, yy + 0, zp + i + 0, (xx + D) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + t.vertexUV(xp + 0, yy + 0, zp + i + 0, (xx + 0) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + } + } + if (zPos <= 1) { + t.normal(0.0f, 0.0f, 1.0f); + for (int i = 0; i < D; i++) { + t.vertexUV(xp + 0, yy + h, zp + i + 1 - e, (xx + 0) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + t.vertexUV(xp + D, yy + h, zp + i + 1 - e, (xx + D) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + t.vertexUV(xp + D, yy + 0, zp + i + 1 - e, (xx + D) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + t.vertexUV(xp + 0, yy + 0, zp + i + 1 - e, (xx + 0) * uvScale + uo, (zz + i + 0.5f) * uvScale + vo); + } + } + t.endOverrideAndDraw(); + } + } + } + + glPopMatrix(); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glDisable(GL_BLEND); + glEnable(GL_CULL_FACE); +} + void LevelRenderer::playSound(const std::string& name, float x, float y, float z, float volume, float pitch) { // @todo: deny sounds here if sound is off (rather than waiting 'til SoundEngine) float dd = 16; @@ -1259,6 +1601,7 @@ void LevelRenderer::renderHitSelect( Player* player, const HitResult& h, int mod void LevelRenderer::onGraphicsReset() { + generateStars(); generateSky(); // Get new buffers diff --git a/src/client/renderer/LevelRenderer.h b/src/client/renderer/LevelRenderer.h index 2a9c7e2..2fa29c8 100755 --- a/src/client/renderer/LevelRenderer.h +++ b/src/client/renderer/LevelRenderer.h @@ -43,7 +43,9 @@ public: void renderDebug(const AABB& b, float a) const; void renderSky(float alpha); + void generateStars(); void renderClouds(float alpha); + void renderAdvancedClouds(float alpha); void renderEntities(Vec3 cam, Culler* culler, float a); void renderSameAsLast(int layer, float alpha); void renderHit(Player* player, const HitResult& h, int mode, /*ItemInstance*/void* inventoryItem, float a); @@ -116,6 +118,9 @@ private: // shredder added again... int lastFogType; + bool LastTint; + bool LastSideTint; + int ticks; int starList, skyList, darkList; @@ -124,6 +129,12 @@ private: GLuint skyBuffer; int skyVertexCount; + GLuint voidBuffer; + int voidVertexCount; + + GLuint starBuffer; + int starVertexCount; + // /*public*/ std::vector renderableTileEntities; Textures* textures; // /*private*/ TileRenderer tileRenderer; diff --git a/src/client/renderer/TileRenderer.cpp b/src/client/renderer/TileRenderer.cpp index 8c1c91c..e61334c 100755 --- a/src/client/renderer/TileRenderer.cpp +++ b/src/client/renderer/TileRenderer.cpp @@ -19,8 +19,10 @@ #include "tileentity/TileEntityRenderer.h" #include "EntityTileRenderer.h" -TileRenderer::TileRenderer( LevelSource* level /* = NULL */ ) -: level(level), +bool TileRenderer::sideTinting = false; + +TileRenderer::TileRenderer(LevelSource* level /* = NULL */ ) + : level(level), fixedTexture(-1), xFlipTexture(false), noCulling(false), @@ -58,6 +60,11 @@ bool TileRenderer::tesselateBlockInWorld( Tile* tt, int x, int y, int z, float r float c2 = 0.8f; float c3 = 0.6f; + // added these to get biome color and save it before its overriden - shredder + float biomeR = r; + float biomeG = g; + float biomeB = b; + float r11 = c11 * r; float g11 = c11 * g; @@ -101,6 +108,10 @@ bool TileRenderer::tesselateBlockInWorld( Tile* tt, int x, int y, int z, float r if (tt->zz0 > 0) br = centerBrightness; t.color(r2 * br, g2 * br, b2 * br); renderNorth(tt, xf, yf, zf, tt->getTexture(level, x, y, z, 2)); + if ((tt->getTexture(level, x, y, z, 2) == 3) && sideTinting) { // checking if the texture from terrain.png is the normal grass side texture + t.color(c2 * br * biomeR, c2 * br * biomeG, c2 * br * biomeB); + renderNorth(tt, xf, yf, zf, 38); // rendering an extra face over the side of the cube that is a grayscale grass fringe tinted by t.color using biome colors, kinda inefficient + } changed = true; } @@ -109,6 +120,10 @@ bool TileRenderer::tesselateBlockInWorld( Tile* tt, int x, int y, int z, float r if (tt->zz1 < 1) br = centerBrightness; t.color(r2 * br, g2 * br, b2 * br); renderSouth(tt, xf, yf, zf, tt->getTexture(level, x, y, z, 3)); + if ((tt->getTexture(level, x, y, z, 3) == 3) && sideTinting){ // checking if the texture from terrain.png is the normal grass side texture + t.color(c2 * br * biomeR, c2 * br * biomeG, c2 * br * biomeB); + renderSouth(tt, xf, yf, zf, 38); // rendering an extra face over the side of the cube that is a grayscale grass fringe tinted by t.color using biome colors, kinda inefficient + } changed = true; } @@ -117,6 +132,10 @@ bool TileRenderer::tesselateBlockInWorld( Tile* tt, int x, int y, int z, float r if (tt->xx0 > 0) br = centerBrightness; t.color(r3 * br, g3 * br, b3 * br); renderWest(tt, xf, yf, zf, tt->getTexture(level, x, y, z, 4)); + if ((tt->getTexture(level, x, y, z, 4) == 3) && sideTinting) { // checking if the texture from terrain.png is the normal grass side texture + t.color(c2 * br * biomeR, c2 * br * biomeG, c2 * br * biomeB); + renderWest(tt, xf, yf, zf, 38); // rendering an extra face over the side of the cube that is a grayscale grass fringe tinted by t.color using biome colors, kinda inefficient + } changed = true; } @@ -125,6 +144,10 @@ bool TileRenderer::tesselateBlockInWorld( Tile* tt, int x, int y, int z, float r if (tt->xx1 < 1) br = centerBrightness; t.color(r3 * br, g3 * br, b3 * br); renderEast(tt, xf, yf, zf, tt->getTexture(level, x, y, z, 5)); + if ((tt->getTexture(level, x, y, z, 5) == 3) && sideTinting) { // checking if the texture from terrain.png is the normal grass side texture + t.color(c2 * br * biomeR, c2 * br * biomeG, c2 * br * biomeB); + renderEast(tt, xf, yf, zf, 38); // rendering an extra face over the side of the cube that is a grayscale grass fringe tinted by t.color using biome colors, kinda inefficient + } changed = true; } @@ -148,38 +171,38 @@ bool TileRenderer::tesselateInWorld( Tile* tt, int x, int y, int z ) return tesselateBlockInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_WATER) { return tesselateWaterInWorld(tt, x, y, z); - } else if (shape == Tile::SHAPE_CACTUS) { - return tesselateCactusInWorld(tt, x, y, z); + } else if (shape == Tile::SHAPE_CACTUS) { + return tesselateCactusInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_CROSS_TEXTURE) { return tesselateCrossInWorld(tt, x, y, z); } else if(shape == Tile::SHAPE_STEM) { return tesselateStemInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_ROWS) { - return tesselateRowInWorld(tt, x, y, z); + return tesselateRowInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_TORCH) { return tesselateTorchInWorld(tt, x, y, z); - } else if (shape == Tile::SHAPE_FIRE) { - return tesselateFireInWorld(tt, x, y, z); - //} else if (shape == Tile::SHAPE_RED_DUST) { - // return tesselateDustInWorld(tt, x, y, z); + } else if (shape == Tile::SHAPE_FIRE) { + return tesselateFireInWorld(tt, x, y, z); + //} else if (shape == Tile::SHAPE_RED_DUST) { + // return tesselateDustInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_LADDER) { return tesselateLadderInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_DOOR) { return tesselateDoorInWorld(tt, x, y, z); - //} else if (shape == Tile::SHAPE_RAIL) { - // return tesselateRailInWorld(tt, x, y, z); + //} else if (shape == Tile::SHAPE_RAIL) { + // return tesselateRailInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_STAIRS) { return tesselateStairsInWorld((StairTile*)tt, x, y, z); - } else if (shape == Tile::SHAPE_FENCE) { - return tesselateFenceInWorld((FenceTile*)tt, x, y, z); + } else if (shape == Tile::SHAPE_FENCE) { + return tesselateFenceInWorld((FenceTile*)tt, x, y, z); } else if (shape == Tile::SHAPE_FENCE_GATE) { return tesselateFenceGateInWorld((FenceGateTile*) tt, x, y, z); - //} else if (shape == Tile::SHAPE_LEVER) { - // return tesselateLeverInWorld(tt, x, y, z); - //} else if (shape == Tile::SHAPE_BED) { - // return tesselateBedInWorld(tt, x, y, z); - //} else if (shape == Tile::SHAPE_DIODE) { - // return tesselateDiodeInWorld(tt, x, y, z); + //} else if (shape == Tile::SHAPE_LEVER) { + // return tesselateLeverInWorld(tt, x, y, z); + //} else if (shape == Tile::SHAPE_BED) { + // return tesselateBedInWorld(tt, x, y, z); + //} else if (shape == Tile::SHAPE_DIODE) { + // return tesselateDiodeInWorld(tt, x, y, z); } else if (shape == Tile::SHAPE_IRON_FENCE) { return tesselateThinFenceInWorld((ThinFenceTile*) tt, x, y, z); } else if(shape == Tile::SHAPE_BED) { @@ -232,10 +255,10 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) int tex = tt->getTexture(0); if (fixedTexture >= 0) tex = fixedTexture; - + float br = tt->getBrightness( level, x, y, z ); t.color( br, br, br ); - + int xt = ((tex & 0xf) << 4); int yt = tex & 0xf0; @@ -340,82 +363,82 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) if ( Tile::fire->canBurn( level, x - 1, y, z ) ) { t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + r ), ( float )( y + h + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); } if ( Tile::fire->canBurn( level, x + 1, y, z ) ) { t.vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 1.0f - r ), ( float )( y + h + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 1.0f - 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f - 0 ), ( float )( y + 0.0f + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f - r ), ( float )( y + h + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v0 ) ); + 0.0f ), ( float )( u0 ), ( float )( v0 ) ); } if ( Tile::fire->canBurn( level, x, y, z - 1 ) ) { t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + - r ), ( float )( u1 ), ( float )( v0 ) ); + r ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + - r ), ( float )( u0 ), ( float )( v0 ) ); + r ), ( float )( u0 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + - r ), ( float )( u0 ), ( float )( v0 ) ); + r ), ( float )( u0 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + - 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + - r ), ( float )( u1 ), ( float )( v0 ) ); + r ), ( float )( u1 ), ( float )( v0 ) ); } if ( Tile::fire->canBurn( level, x, y, z + 1 ) ) { t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - - r ), ( float )( u0 ), ( float )( v0 ) ); + r ), ( float )( u0 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - - 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - - r ), ( float )( u1 ), ( float )( v0 ) ); + r ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - - r ), ( float )( u1 ), ( float )( v0 ) ); + r ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - - 0.0f ), ( float )( u1 ), ( float )( v1 ) ); + 0.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + 0.0f + yo ), ( float )( z + 1.0f - - 0.0f ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + h + yo ), ( float )( z + 1.0f - - r ), ( float )( u0 ), ( float )( v0 ) ); + r ), ( float )( u0 ), ( float )( v0 ) ); } if ( Tile::fire->canBurn( level, x, y + 1.0f, z ) ) { @@ -440,13 +463,13 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) if ( ( ( x + y + z ) & 1 ) == 0 ) { t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + - 0 ), ( float )( u1 ), ( float )( v0 ) ); + 0 ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + - 0 ), ( float )( u1 ), ( float )( v1 ) ); + 0 ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + - 1 ), ( float )( u0 ), ( float )( v1 ) ); + 1 ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + - 1 ), ( float )( u0 ), ( float )( v0 ) ); + 1 ), ( float )( u0 ), ( float )( v0 ) ); u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; @@ -454,24 +477,24 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) v1 = (yt + 15.99f) / 256.0f; t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v0 ) ); + 1.0f ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z + - 1.0f ), ( float )( u1 ), ( float )( v1 ) ); + 1.0f ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z + - 0 ), ( float )( u0 ), ( float )( v1 ) ); + 0 ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + - 0 ), ( float )( u0 ), ( float )( v0 ) ); + 0 ), ( float )( u0 ), ( float )( v0 ) ); } else { t.vertexUV( ( float )( x + 0.0f ), ( float )( y + - h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + - 0.0f ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); + 0.0f ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + - 0.0f ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + - h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) ); u0 = (xt) / 256.0f; u1 = (xt + 15.99f) / 256.0f; @@ -479,13 +502,13 @@ bool TileRenderer::tesselateFireInWorld( Tile* tt, int x, int y, int z ) v1 = (yt + 15.99f) / 256.0f; t.vertexUV( ( float )( x + 1.0f ), ( float )( y + - h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) ); t.vertexUV( ( float )( x + 1.0f ), ( float )( y + - 0.0f ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); + 0.0f ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + - 0.0f ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); + 0.0f ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) ); t.vertexUV( ( float )( x + 0.0f ), ( float )( y + - h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) ); } } } @@ -958,46 +981,46 @@ float TileRenderer::getWaterHeight( int x, int y, int z, const Material* m ) } void TileRenderer::renderBlock(Tile* tt, LevelSource* level, int x, int y, int z) { - float c10 = 0.5f; - float c11 = 1; - float c2 = 0.8f; - float c3 = 0.6f; + float c10 = 0.5f; + float c11 = 1; + float c2 = 0.8f; + float c3 = 0.6f; - Tesselator& t = Tesselator::instance; - t.begin(); + Tesselator& t = Tesselator::instance; + t.begin(); - float center = tt->getBrightness(level, x, y, z); - float br = tt->getBrightness(level, x, y - 1, z); - if (br < center) br = center; + float center = tt->getBrightness(level, x, y, z); + float br = tt->getBrightness(level, x, y - 1, z); + if (br < center) br = center; - t.color(c10 * br, c10 * br, c10 * br); - renderFaceDown(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(0)); + t.color(c10 * br, c10 * br, c10 * br); + renderFaceDown(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(0)); - br = tt->getBrightness(level, x, y + 1, z); - if (br < center) br = center; - t.color(c11 * br, c11 * br, c11 * br); - renderFaceUp(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(1)); + br = tt->getBrightness(level, x, y + 1, z); + if (br < center) br = center; + t.color(c11 * br, c11 * br, c11 * br); + renderFaceUp(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(1)); - br = tt->getBrightness(level, x, y, z - 1); - if (br < center) br = center; - t.color(c2 * br, c2 * br, c2 * br); - renderNorth(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(2)); + br = tt->getBrightness(level, x, y, z - 1); + if (br < center) br = center; + t.color(c2 * br, c2 * br, c2 * br); + renderNorth(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(2)); - br = tt->getBrightness(level, x, y, z + 1); - if (br < center) br = center; - t.color(c2 * br, c2 * br, c2 * br); - renderSouth(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(3)); + br = tt->getBrightness(level, x, y, z + 1); + if (br < center) br = center; + t.color(c2 * br, c2 * br, c2 * br); + renderSouth(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(3)); - br = tt->getBrightness(level, x - 1, y, z); - if (br < center) br = center; - t.color(c3 * br, c3 * br, c3 * br); - renderWest(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(4)); + br = tt->getBrightness(level, x - 1, y, z); + if (br < center) br = center; + t.color(c3 * br, c3 * br, c3 * br); + renderWest(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(4)); - br = tt->getBrightness(level, x + 1, y, z); - if (br < center) br = center; - t.color(c3 * br, c3 * br, c3 * br); - renderEast(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(5)); - t.draw(); + br = tt->getBrightness(level, x + 1, y, z); + if (br < center) br = center; + t.color(c3 * br, c3 * br, c3 * br); + renderEast(tt, -0.5f, -0.5f, -0.5f, tt->getTexture(5)); + t.draw(); } bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusion( Tile* tt, int pX, int pY, int pZ, float pBaseRed, float pBaseGreen, float pBaseBlue ) @@ -1197,6 +1220,15 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusion( Tile* tt, int pX, c4g *= ll4; c4b *= ll4; renderNorth(tt, (float) pX, (float) pY, (float) pZ, tt->getTexture(level, pX, pY, pZ, 2)); + if (tt->getTexture(level, pX, pY, pZ, 2) == 3 && sideTinting) + { + c1r *= pBaseRed; c1g *= pBaseGreen; c1b *= pBaseBlue; + c2r *= pBaseRed; c2g *= pBaseGreen; c2b *= pBaseBlue; + c3r *= pBaseRed; c3g *= pBaseGreen; c3b *= pBaseBlue; + c4r *= pBaseRed; c4g *= pBaseGreen; c4b *= pBaseBlue; + + renderNorth(tt, (float) pX, (float) pY, (float) pZ, 38); + } i = true; } if ((noCulling) || (tt->shouldRenderFace(level, pX, pY, pZ + 1, 3))) { @@ -1250,6 +1282,15 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusion( Tile* tt, int pX, c4g *= ll4; c4b *= ll4; renderSouth(tt, (float) pX, (float) pY, (float) pZ, tt->getTexture(level, pX, pY, pZ, 3)); + if (tt->getTexture(level, pX, pY, pZ, 3) == 3 && sideTinting) + { + c1r *= pBaseRed; c1g *= pBaseGreen; c1b *= pBaseBlue; + c2r *= pBaseRed; c2g *= pBaseGreen; c2b *= pBaseBlue; + c3r *= pBaseRed; c3g *= pBaseGreen; c3b *= pBaseBlue; + c4r *= pBaseRed; c4g *= pBaseGreen; c4b *= pBaseBlue; + + renderSouth(tt, (float) pX, (float) pY, (float) pZ, 38); + } i = true; } if ((noCulling) || (tt->shouldRenderFace(level, pX - 1, pY, pZ, 4))) { @@ -1302,6 +1343,15 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusion( Tile* tt, int pX, c4g *= ll4; c4b *= ll4; renderWest(tt, (float) pX, (float) pY, (float) pZ, tt->getTexture(level, pX, pY, pZ, 4)); + if (tt->getTexture(level, pX, pY, pZ, 4) == 3 && sideTinting) + { + c1r *= pBaseRed; c1g *= pBaseGreen; c1b *= pBaseBlue; + c2r *= pBaseRed; c2g *= pBaseGreen; c2b *= pBaseBlue; + c3r *= pBaseRed; c3g *= pBaseGreen; c3b *= pBaseBlue; + c4r *= pBaseRed; c4g *= pBaseGreen; c4b *= pBaseBlue; + + renderWest(tt, (float) pX, (float) pY, (float) pZ, 38); + } i = true; } if ((noCulling) || (tt->shouldRenderFace(level, pX + 1, pY, pZ, 5))) { @@ -1355,6 +1405,15 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusion( Tile* tt, int pX, c4b *= ll4; renderEast(tt, (float) pX, (float) pY, (float) pZ, tt->getTexture(level, pX, pY, pZ, 5)); + if (tt->getTexture(level, pX, pY, pZ, 5) == 3 && sideTinting) + { + c1r *= pBaseRed; c1g *= pBaseGreen; c1b *= pBaseBlue; + c2r *= pBaseRed; c2g *= pBaseGreen; c2b *= pBaseBlue; + c3r *= pBaseRed; c3g *= pBaseGreen; c3b *= pBaseBlue; + c4r *= pBaseRed; c4g *= pBaseGreen; c4b *= pBaseBlue; + + renderEast(tt, (float) pX, (float) pY, (float) pZ, 38); + } i = true; } applyAmbienceOcclusion = false; @@ -1362,124 +1421,124 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusion( Tile* tt, int pX, } bool TileRenderer::tesselateCactusInWorld(Tile* tt, int x, int y, int z) { - int col = tt->getColor(level, x, y, z); - float r = ((col >> 16) & 0xff) / 255.0f; - float g = ((col >> 8) & 0xff) / 255.0f; - float b = ((col) & 0xff) / 255.0f; - return tesselateCactusInWorld(tt, x, y, z, r, g, b); + int col = tt->getColor(level, x, y, z); + float r = ((col >> 16) & 0xff) / 255.0f; + float g = ((col >> 8) & 0xff) / 255.0f; + float b = ((col) & 0xff) / 255.0f; + return tesselateCactusInWorld(tt, x, y, z, r, g, b); } bool TileRenderer::tesselateCactusInWorld(Tile* tt, int x, int y, int z, float r, float g, float b) { - Tesselator& t = Tesselator::instance; + Tesselator& t = Tesselator::instance; - bool changed = false; - float c10 = 0.5f; - float c11 = 1; - float c2 = 0.8f; - float c3 = 0.6f; + bool changed = false; + float c10 = 0.5f; + float c11 = 1; + float c2 = 0.8f; + float c3 = 0.6f; - float r10 = c10 * r; - float r11 = c11 * r; - float r2 = c2 * r; - float r3 = c3 * r; + float r10 = c10 * r; + float r11 = c11 * r; + float r2 = c2 * r; + float r3 = c3 * r; - float g10 = c10 * g; - float g11 = c11 * g; - float g2 = c2 * g; - float g3 = c3 * g; + float g10 = c10 * g; + float g11 = c11 * g; + float g2 = c2 * g; + float g3 = c3 * g; - float b10 = c10 * b; - float b11 = c11 * b; - float b2 = c2 * b; - float b3 = c3 * b; + float b10 = c10 * b; + float b11 = c11 * b; + float b2 = c2 * b; + float b3 = c3 * b; - float s = 1 / 16.0f; + float s = 1 / 16.0f; const float X = (float)x; const float Y = (float)y; const float Z = (float)z; - float centerBrightness = tt->getBrightness(level, x, y, z); + float centerBrightness = tt->getBrightness(level, x, y, z); - if (noCulling || tt->shouldRenderFace(level, x, y - 1, z, 0)) { - float br = tt->getBrightness(level, x, y - 1, z); - // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = -// Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; - t.color(r10 * br, g10 * br, b10 * br); - renderFaceDown(tt, X, Y, Z, tt->getTexture(level, x, y, z, 0)); - changed = true; - } + if (noCulling || tt->shouldRenderFace(level, x, y - 1, z, 0)) { + float br = tt->getBrightness(level, x, y - 1, z); + // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = + // Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; + t.color(r10 * br, g10 * br, b10 * br); + renderFaceDown(tt, X, Y, Z, tt->getTexture(level, x, y, z, 0)); + changed = true; + } - if (noCulling || tt->shouldRenderFace(level, x, y + 1, z, 1)) { - float br = tt->getBrightness(level, x, y + 1, z); - if (tt->yy1 != 1 && !tt->material->isLiquid()) br = centerBrightness; - // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = -// Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; - t.color(r11 * br, g11 * br, b11 * br); - renderFaceUp(tt, X, Y, Z, tt->getTexture(level, x, y, z, 1)); - changed = true; - } + if (noCulling || tt->shouldRenderFace(level, x, y + 1, z, 1)) { + float br = tt->getBrightness(level, x, y + 1, z); + if (tt->yy1 != 1 && !tt->material->isLiquid()) br = centerBrightness; + // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = + // Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; + t.color(r11 * br, g11 * br, b11 * br); + renderFaceUp(tt, X, Y, Z, tt->getTexture(level, x, y, z, 1)); + changed = true; + } - if (noCulling || tt->shouldRenderFace(level, x, y, z - 1, 2)) { - float br = tt->getBrightness(level, x, y, z - 1); - if (tt->zz0 > 0) br = centerBrightness; - // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = -// Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; - t.color(r2 * br, g2 * br, b2 * br); - t.addOffset(0, 0, s); - renderNorth(tt, X, Y, Z, tt->getTexture(level, x, y, z, 2)); - t.addOffset(0, 0, -s); - changed = true; - } + if (noCulling || tt->shouldRenderFace(level, x, y, z - 1, 2)) { + float br = tt->getBrightness(level, x, y, z - 1); + if (tt->zz0 > 0) br = centerBrightness; + // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = + // Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; + t.color(r2 * br, g2 * br, b2 * br); + t.addOffset(0, 0, s); + renderNorth(tt, X, Y, Z, tt->getTexture(level, x, y, z, 2)); + t.addOffset(0, 0, -s); + changed = true; + } - if (noCulling || tt->shouldRenderFace(level, x, y, z + 1, 3)) { - float br = tt->getBrightness(level, x, y, z + 1); - if (tt->zz1 < 1) br = centerBrightness; - // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = -// Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; - t.color(r2 * br, g2 * br, b2 * br); - t.addOffset(0, 0, -s); - renderSouth(tt, X, Y, Z, tt->getTexture(level, x, y, z, 3)); - t.addOffset(0, 0, s); - changed = true; - } + if (noCulling || tt->shouldRenderFace(level, x, y, z + 1, 3)) { + float br = tt->getBrightness(level, x, y, z + 1); + if (tt->zz1 < 1) br = centerBrightness; + // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = + // Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; + t.color(r2 * br, g2 * br, b2 * br); + t.addOffset(0, 0, -s); + renderSouth(tt, X, Y, Z, tt->getTexture(level, x, y, z, 3)); + t.addOffset(0, 0, s); + changed = true; + } - if (noCulling || tt->shouldRenderFace(level, x - 1, y, z, 4)) { - float br = tt->getBrightness(level, x - 1, y, z); - if (tt->xx0 > 0) br = centerBrightness; - // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = -// Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; - t.color(r3 * br, g3 * br, b3 * br); - t.addOffset(s, 0, 0); - renderWest(tt, X, Y, Z, tt->getTexture(level, x, y, z, 4)); - t.addOffset(-s, 0, 0); - changed = true; - } + if (noCulling || tt->shouldRenderFace(level, x - 1, y, z, 4)) { + float br = tt->getBrightness(level, x - 1, y, z); + if (tt->xx0 > 0) br = centerBrightness; + // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = + // Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; + t.color(r3 * br, g3 * br, b3 * br); + t.addOffset(s, 0, 0); + renderWest(tt, X, Y, Z, tt->getTexture(level, x, y, z, 4)); + t.addOffset(-s, 0, 0); + changed = true; + } - if (noCulling || tt->shouldRenderFace(level, x + 1, y, z, 5)) { - float br = tt->getBrightness(level, x + 1, y, z); - if (tt->xx1 < 1) br = centerBrightness; - // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = -// Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; - t.color(r3 * br, g3 * br, b3 * br); - t.addOffset(-s, 0, 0); - renderEast(tt, X, Y, Z, tt->getTexture(level, x, y, z, 5)); - t.addOffset(s, 0, 0); - changed = true; - } + if (noCulling || tt->shouldRenderFace(level, x + 1, y, z, 5)) { + float br = tt->getBrightness(level, x + 1, y, z); + if (tt->xx1 < 1) br = centerBrightness; + // if (Tile::lightEmission[tt->id] > br*Level.MAX_BRIGHTNESS) br = + // Tile::lightEmission[tt->id]/Level.MAX_BRIGHTNESS; + t.color(r3 * br, g3 * br, b3 * br); + t.addOffset(-s, 0, 0); + renderEast(tt, X, Y, Z, tt->getTexture(level, x, y, z, 5)); + t.addOffset(s, 0, 0); + changed = true; + } - return changed; + return changed; } bool TileRenderer::tesselateFenceInWorld(FenceTile* tt, int x, int y, int z) { - bool changed = true; + bool changed = true; - float a = 6 / 16.0f; - float b = 10 / 16.0f; - tt->setShape(a, 0, a, b, 1, b); - tesselateBlockInWorld(tt, x, y, z); + float a = 6 / 16.0f; + float b = 10 / 16.0f; + tt->setShape(a, 0, a, b, 1, b); + tesselateBlockInWorld(tt, x, y, z); - bool vertical = false; - bool horizontal = false; + bool vertical = false; + bool horizontal = false; bool l = tt->connectsTo(level, x - 1, y, z); bool r = tt->connectsTo(level, x + 1, y, z); @@ -1487,42 +1546,42 @@ bool TileRenderer::tesselateFenceInWorld(FenceTile* tt, int x, int y, int z) { bool d = tt->connectsTo(level, x, y, z + 1); if (l || r) vertical = true; - if (u || d) horizontal = true; + if (u || d) horizontal = true; - if (!vertical && !horizontal) vertical = true; + if (!vertical && !horizontal) vertical = true; - a = 7 / 16.0f; - b = 9 / 16.0f; - float h0 = 12 / 16.0f; - float h1 = 15 / 16.0f; + a = 7 / 16.0f; + b = 9 / 16.0f; + float h0 = 12 / 16.0f; + float h1 = 15 / 16.0f; - float x0 = l ? 0 : a; - float x1 = r ? 1 : b; - float z0 = u ? 0 : a; - float z1 = d ? 1 : b; + float x0 = l ? 0 : a; + float x1 = r ? 1 : b; + float z0 = u ? 0 : a; + float z1 = d ? 1 : b; - if (vertical) { - tt->setShape(x0, h0, a, x1, h1, b); - tesselateBlockInWorld(tt, x, y, z); - } - if (horizontal) { - tt->setShape(a, h0, z0, b, h1, z1); - tesselateBlockInWorld(tt, x, y, z); - } + if (vertical) { + tt->setShape(x0, h0, a, x1, h1, b); + tesselateBlockInWorld(tt, x, y, z); + } + if (horizontal) { + tt->setShape(a, h0, z0, b, h1, z1); + tesselateBlockInWorld(tt, x, y, z); + } - h0 = 6 / 16.0f; - h1 = 9 / 16.0f; - if (vertical) { - tt->setShape(x0, h0, a, x1, h1, b); - tesselateBlockInWorld(tt, x, y, z); - } - if (horizontal) { - tt->setShape(a, h0, z0, b, h1, z1); - tesselateBlockInWorld(tt, x, y, z); - } + h0 = 6 / 16.0f; + h1 = 9 / 16.0f; + if (vertical) { + tt->setShape(x0, h0, a, x1, h1, b); + tesselateBlockInWorld(tt, x, y, z); + } + if (horizontal) { + tt->setShape(a, h0, z0, b, h1, z1); + tesselateBlockInWorld(tt, x, y, z); + } - tt->setShape(0, 0, 0, 1, 1, 1); - return changed; + tt->setShape(0, 0, 0, 1, 1, 1); + return changed; } bool TileRenderer::tesselateFenceGateInWorld(FenceGateTile* tt, int x, int y, int z) { @@ -2308,7 +2367,7 @@ void TileRenderer::renderEast( Tile* tt, float x, float y, float z, int tex ) void TileRenderer::renderTile( Tile* tile, int data ) { Tesselator& t = Tesselator::instance; - + t.color(0xff, 0xff, 0xff); // i disabled this, this is normally enabled in normal mcpe see if this fits OPTION_NORMAL_LIGHTING - shredder int shape = tile->getRenderShape(); @@ -2324,7 +2383,7 @@ void TileRenderer::renderTile( Tile* tile, int data ) t.normal(0.0f, 1.0f, 0.0f); renderFaceUp(tile, 0, 0, 0, tile->getTexture(1, data)); - + t.normal(0.0f, 0.0f, -1.0f); renderNorth(tile, 0, 0, 0, tile->getTexture(2, data)); @@ -2403,110 +2462,110 @@ void TileRenderer::renderTile( Tile* tile, int data ) t.addOffset(s, 0, 0); t.draw(); t.offset(0, 0, 0);//0.5f, 0.5f, 0.5f); - } else if (shape == Tile::SHAPE_ROWS) { - t.begin(); - t.normal(0, -1, 0); - tesselateRowTexture(tile, data, -0.5f, -0.5f, -0.5f); + } else if (shape == Tile::SHAPE_ROWS) { + t.begin(); + t.normal(0, -1, 0); + tesselateRowTexture(tile, data, -0.5f, -0.5f, -0.5f); //} else if (shape == Tile::SHAPE_TORCH) { //// t.begin(); //// t.normal(0, -1, 0); /// tesselateTorch(tile, -0.5f, -0.5f, -0.5f, 0, 0); //// t.end(); - } else if (shape == Tile::SHAPE_ENTITYTILE_ANIMATED) { - EntityTileRenderer::instance->render(tile, data, 1.0f); - //glEnable(GL_RESCALE_NORMAL); - } else if (shape == Tile::SHAPE_STAIRS) { - t.addOffset(-0.5f, -0.5f, -0.5f); - t.begin(); - for (int i = 0; i < 2; i++) { - if (i == 0) tile->setShape(0, 0, 0, 1, 1, 0.5f); - if (i == 1) tile->setShape(0, 0, 0.5f, 1, 0.5f, 1); + } else if (shape == Tile::SHAPE_ENTITYTILE_ANIMATED) { + EntityTileRenderer::instance->render(tile, data, 1.0f); + //glEnable(GL_RESCALE_NORMAL); + } else if (shape == Tile::SHAPE_STAIRS) { + t.addOffset(-0.5f, -0.5f, -0.5f); + t.begin(); + for (int i = 0; i < 2; i++) { + if (i == 0) tile->setShape(0, 0, 0, 1, 1, 0.5f); + if (i == 1) tile->setShape(0, 0, 0.5f, 1, 0.5f, 1); - t.normal(0.0f, -1.0f, 0.0f); - renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); + t.normal(0.0f, -1.0f, 0.0f); + renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); - t.normal(0.0f, 1.0f, 0.0f); - renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); + t.normal(0.0f, 1.0f, 0.0f); + renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); - t.normal(0.0f, 0.0f, -1.0f); - renderNorth(tile, 0, 0, 0, tile->getTexture(2)); + t.normal(0.0f, 0.0f, -1.0f); + renderNorth(tile, 0, 0, 0, tile->getTexture(2)); - t.normal(0.0f, 0.0f, 1.0f); - renderSouth(tile, 0, 0, 0, tile->getTexture(3)); + t.normal(0.0f, 0.0f, 1.0f); + renderSouth(tile, 0, 0, 0, tile->getTexture(3)); - t.normal(-1.0f, 0.0f, 0.0f); - renderWest(tile, 0, 0, 0, tile->getTexture(4)); + t.normal(-1.0f, 0.0f, 0.0f); + renderWest(tile, 0, 0, 0, tile->getTexture(4)); - t.normal(1.0f, 0.0f, 0.0f); - renderEast(tile, 0, 0, 0, tile->getTexture(5)); - } - t.draw(); - t.addOffset(0.5f, 0.5f, 0.5f); + t.normal(1.0f, 0.0f, 0.0f); + renderEast(tile, 0, 0, 0, tile->getTexture(5)); } - else if (shape == Tile::SHAPE_FENCE) { - t.addOffset(-0.5f, -0.5f, -0.5f); - t.begin(); - for (int i = 0; i < 4; i++) { - float w = 2 / 16.0f; - if (i == 0) tile->setShape(0.5f - w, 0, 0, 0.5f + w, 1, w * 2); - if (i == 1) tile->setShape(0.5f - w, 0, 1 - w * 2, 0.5f + w, 1, 1); - w = 1 / 16.0f; - if (i == 2) tile->setShape(0.5f - w, 1 - w * 3, -w * 2, 0.5f + w, 1 - w, 1 + w * 2); - if (i == 3) tile->setShape(0.5f - w, 0.5f - w * 3, -w * 2, 0.5f + w, 0.5f - w, 1 + w * 2); + t.draw(); + t.addOffset(0.5f, 0.5f, 0.5f); + } + else if (shape == Tile::SHAPE_FENCE) { + t.addOffset(-0.5f, -0.5f, -0.5f); + t.begin(); + for (int i = 0; i < 4; i++) { + float w = 2 / 16.0f; + if (i == 0) tile->setShape(0.5f - w, 0, 0, 0.5f + w, 1, w * 2); + if (i == 1) tile->setShape(0.5f - w, 0, 1 - w * 2, 0.5f + w, 1, 1); + w = 1 / 16.0f; + if (i == 2) tile->setShape(0.5f - w, 1 - w * 3, -w * 2, 0.5f + w, 1 - w, 1 + w * 2); + if (i == 3) tile->setShape(0.5f - w, 0.5f - w * 3, -w * 2, 0.5f + w, 0.5f - w, 1 + w * 2); - t.normal(0.0f, -1.0f, 0.0f); - renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); + t.normal(0.0f, -1.0f, 0.0f); + renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); - t.normal(0.0f, 1.0f, 0.0f); - renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); + t.normal(0.0f, 1.0f, 0.0f); + renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); - t.normal(0.0f, 0.0f, -1.0f); - renderNorth(tile, 0, 0, 0, tile->getTexture(2)); + t.normal(0.0f, 0.0f, -1.0f); + renderNorth(tile, 0, 0, 0, tile->getTexture(2)); - t.normal(0.0f, 0.0f, 1.0f); - renderSouth(tile, 0, 0, 0, tile->getTexture(3)); + t.normal(0.0f, 0.0f, 1.0f); + renderSouth(tile, 0, 0, 0, tile->getTexture(3)); - t.normal(-1.0f, 0.0f, 0.0f); - renderWest(tile, 0, 0, 0, tile->getTexture(4)); + t.normal(-1.0f, 0.0f, 0.0f); + renderWest(tile, 0, 0, 0, tile->getTexture(4)); - t.normal(1.0f, 0.0f, 0.0f); - renderEast(tile, 0, 0, 0, tile->getTexture(5)); - } - t.draw(); - t.addOffset(0.5f, 0.5f, 0.5f); - tile->setShape(0, 0, 0, 1, 1, 1); - } else if (shape == Tile::SHAPE_FENCE_GATE) { - t.addOffset(-0.5f, -0.5f, -0.5f); - t.begin(); - for (int i = 0; i < 3; i++) { - float w = 1 / 16.0f; - if (i == 0) tile->setShape(0.5f - w, .3f, 0, 0.5f + w, 1, w * 2); - if (i == 1) tile->setShape(0.5f - w, .3f, 1 - w * 2, 0.5f + w, 1, 1); - if (i == 2) tile->setShape(0.5f - w, .5f, w * 2, 0.5f + w, 1 - w, 1 - w * 2); - - t.normal(0.0f, -1.0f, 0.0f); - renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); - - t.normal(0.0f, 1.0f, 0.0f); - renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); - - t.normal(0.0f, 0.0f, -1.0f); - renderNorth(tile, 0, 0, 0, tile->getTexture(2)); - - t.normal(0.0f, 0.0f, 1.0f); - renderSouth(tile, 0, 0, 0, tile->getTexture(3)); - - t.normal(-1.0f, 0.0f, 0.0f); - renderWest(tile, 0, 0, 0, tile->getTexture(4)); - - t.normal(1.0f, 0.0f, 0.0f); - renderEast(tile, 0, 0, 0, tile->getTexture(5)); - } - t.draw(); - t.addOffset(0.5f, 0.5f, 0.5f); - tile->setShape(0, 0, 0, 1, 1, 1); + t.normal(1.0f, 0.0f, 0.0f); + renderEast(tile, 0, 0, 0, tile->getTexture(5)); } + t.draw(); + t.addOffset(0.5f, 0.5f, 0.5f); + tile->setShape(0, 0, 0, 1, 1, 1); + } else if (shape == Tile::SHAPE_FENCE_GATE) { + t.addOffset(-0.5f, -0.5f, -0.5f); + t.begin(); + for (int i = 0; i < 3; i++) { + float w = 1 / 16.0f; + if (i == 0) tile->setShape(0.5f - w, .3f, 0, 0.5f + w, 1, w * 2); + if (i == 1) tile->setShape(0.5f - w, .3f, 1 - w * 2, 0.5f + w, 1, 1); + if (i == 2) tile->setShape(0.5f - w, .5f, w * 2, 0.5f + w, 1 - w, 1 - w * 2); + + t.normal(0.0f, -1.0f, 0.0f); + renderFaceDown(tile, 0, 0, 0, tile->getTexture(0)); + + t.normal(0.0f, 1.0f, 0.0f); + renderFaceUp(tile, 0, 0, 0, tile->getTexture(1)); + + t.normal(0.0f, 0.0f, -1.0f); + renderNorth(tile, 0, 0, 0, tile->getTexture(2)); + + t.normal(0.0f, 0.0f, 1.0f); + renderSouth(tile, 0, 0, 0, tile->getTexture(3)); + + t.normal(-1.0f, 0.0f, 0.0f); + renderWest(tile, 0, 0, 0, tile->getTexture(4)); + + t.normal(1.0f, 0.0f, 0.0f); + renderEast(tile, 0, 0, 0, tile->getTexture(5)); + } + t.draw(); + t.addOffset(0.5f, 0.5f, 0.5f); + tile->setShape(0, 0, 0, 1, 1, 1); + } } diff --git a/src/client/renderer/TileRenderer.h b/src/client/renderer/TileRenderer.h index 83351bd..c463abf 100755 --- a/src/client/renderer/TileRenderer.h +++ b/src/client/renderer/TileRenderer.h @@ -10,6 +10,7 @@ class ThinFenceTile; class StairTile; class LevelSource; class Material; +class Minecraft; class TileRenderer { @@ -60,6 +61,10 @@ public: void renderTile(Tile* tile, int data); void renderGuiTile(Tile* tile, int data); + static void setUseTint(bool value) { + sideTinting = value; + } + static bool canRender(int renderShape); private: float getWaterHeight(int x, int y, int z, const Material* m); @@ -68,6 +73,7 @@ private: int fixedTexture; bool xFlipTexture; bool noCulling; + static bool sideTinting; bool applyAmbienceOcclusion; float ll000, llx00, ll0y0, ll00z, llX00, ll0Y0, ll00Z; diff --git a/src/world/entity/animal/Sheep.cpp b/src/world/entity/animal/Sheep.cpp index 9039fa1..5229434 100755 --- a/src/world/entity/animal/Sheep.cpp +++ b/src/world/entity/animal/Sheep.cpp @@ -1,5 +1,6 @@ #include "Sheep.h" #include "../../item/DyePowderItem.h" +#include "../../level/tile/TallGrass.h" #include "../../level/tile/LevelEvent.h" const float Sheep::COLOR[][3] = { @@ -198,7 +199,7 @@ void Sheep::updateAi() int yy = Mth::floor(y); int zz = Mth::floor(z); - if (/*(level->getTile(xx, yy, zz) == Tile::tallgrass->id && level->getData(xx, yy, zz) == TallGrass::TALL_GRASS) || */ level->getTile(xx, yy - 1, zz) == ((Tile*)Tile::grass)->id) { + if ((level->getTile(xx, yy, zz) == Tile::tallgrass->id && level->getData(xx, yy, zz) == TallGrass::TALL_GRASS) || level->getTile(xx, yy - 1, zz) == ((Tile*)Tile::grass)->id) { eatAnimationTick = EAT_ANIMATION_TICKS; level->broadcastEntityEvent(this, EntityEvent::EAT_GRASS); } @@ -208,11 +209,11 @@ void Sheep::updateAi() int zz = Mth::floor(z); bool ate = false; - /* if (level->getTile(xx, yy, zz) == Tile::tallgrass->id) { - level->levelEvent(LevelEvent::PARTICLES_DESTROY_BLOCK, xx, yy, zz, Tile::tallgrass->id + TallGrass::TALL_GRASS * 256); + if (level->getTile(xx, yy, zz) == Tile::tallgrass->id) { + level->levelEvent(NULL, LevelEvent::PARTICLES_DESTROY_BLOCK, xx, yy, zz, Tile::tallgrass->id + TallGrass::TALL_GRASS * 256); level->setTile(xx, yy, zz, 0); ate = true; - } else */if (level->getTile(xx, yy - 1, zz) == ((Tile*)Tile::grass)->id) { + } else if (level->getTile(xx, yy - 1, zz) == ((Tile*)Tile::grass)->id) { level->levelEvent(NULL, LevelEvent::PARTICLES_DESTROY_BLOCK, xx, yy - 1, zz, ((Tile*)Tile::grass)->id); level->setTile(xx, yy - 1, zz, Tile::dirt->id); ate = true; diff --git a/src/world/item/DyePowderItem.cpp b/src/world/item/DyePowderItem.cpp index 11c7964..2252c9d 100755 --- a/src/world/item/DyePowderItem.cpp +++ b/src/world/item/DyePowderItem.cpp @@ -10,6 +10,7 @@ #include "../level/tile/ClothTile.h" #include "../level/tile/CropTile.h" #include "../level/tile/StemTile.h" +#include "../level/tile/TallGrass.h" const std::string DyePowderItem::COLOR_DESCS[] = { "black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white" @@ -91,9 +92,9 @@ bool DyePowderItem::useOn( ItemInstance* itemInstance, Player* player, Level* le continue; if (level->getTile(xx, yy, zz) == 0) { - /*if (random.nextInt(10) != 0) { - level->setTileAndData(xx, yy, zz, Tile::tallgrass.id, TallGrass.TALL_GRASS); - } else*/ if (random.nextInt(3) != 0) { + if (random.nextInt(10) != 0) { + level->setTileAndData(xx, yy, zz, Tile::tallgrass->id, TallGrass::TALL_GRASS); + } else if (random.nextInt(3) != 0) { level->setTile(xx, yy, zz, Tile::flower->id); } else { level->setTile(xx, yy, zz, Tile::rose->id); diff --git a/src/world/item/ShearsItem.h b/src/world/item/ShearsItem.h index d73b2f5..30d4d57 100755 --- a/src/world/item/ShearsItem.h +++ b/src/world/item/ShearsItem.h @@ -22,7 +22,7 @@ public: /*@Override*/ bool mineBlock(ItemInstance* itemInstance, int tile, int x, int y, int z/*, Mob* owner*/) { - if (tile == ((Tile*)Tile::leaves)->id || tile == Tile::web->id /*|| tile == Tile::tallgrass->id || tile == Tile::vine->id*/) { + if (tile == ((Tile*)Tile::leaves)->id || tile == Tile::web->id || tile == Tile::tallgrass->id /*|| tile == Tile::vine->id*/) { itemInstance->hurt(1);//, owner); return true; } diff --git a/src/world/level/FoliageColor.h b/src/world/level/FoliageColor.h index 98d77b7..4d1a446 100755 --- a/src/world/level/FoliageColor.h +++ b/src/world/level/FoliageColor.h @@ -43,7 +43,7 @@ public: } static int getDefaultColor() { - return 0xFFFFFF; + return 0x48b518; } private: diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index bb5ac0e..14aa54e 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -1174,7 +1174,14 @@ Vec3 Level::getSkyColor(Entity* source, float a) { float br = Mth::cos(td * Mth::PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; - if (br > 0.75f) br = 0.75f; //@note; was 1.0f + if (dimension->FogType == 1) // @TODO - probably make this not dependent on dimension type honestly - shredder + { + if (br > 1.0f) br = 1.0f; //@ uses the normal javasky color ramp when java sky type is choosen, + } else + { + if (br > 0.8f) br = 0.8f; //@note; was 1.0f + } + int xx = Mth::floor(source->x); int zz = Mth::floor(source->z); diff --git a/src/world/level/biome/Biome.cpp b/src/world/level/biome/Biome.cpp index 2c8638f..4c09842 100755 --- a/src/world/level/biome/Biome.cpp +++ b/src/world/level/biome/Biome.cpp @@ -9,6 +9,7 @@ #include "../../level/tile/TallGrass.h" #include "../../../util/Color.h" +#include "../GrassColor.h" Biome* Biome::rainForest = NULL; Biome* Biome::swampland = NULL; @@ -217,6 +218,26 @@ int Biome::getSkyColor( float temp ) return Color::getHSBColor(224 / 360.0f - temp * 0.05f, 0.50f + temp * 0.1f, 1.0f).getRGB(); } +float Biome::getDownfall() +{ + return downfall; +} + + +float Biome::getTemperature() +{ + return temperature; +} + + +int Biome::getGrassColor() +{ + float temp = Mth::clamp(getTemperature(), 0.0f, 1.0f); + float rain = Mth::clamp(getDownfall(), 0.0f, 1.0f); + + return GrassColor::get(temp, rain); +} + Biome::MobList& Biome::getMobs(const MobCategory& category) { if (&category == &MobCategory::monster) diff --git a/src/world/level/biome/Biome.h b/src/world/level/biome/Biome.h index 48a49d5..af44be4 100755 --- a/src/world/level/biome/Biome.h +++ b/src/world/level/biome/Biome.h @@ -78,7 +78,13 @@ public: virtual float adjustScale(float scale); virtual float adjustDepth(float depth); + + virtual int getSkyColor(float temp); + virtual int getGrassColor(); + + virtual float getDownfall(); + virtual float getTemperature(); virtual MobList& getMobs(const MobCategory& category); virtual float getCreatureProbability(); @@ -88,6 +94,8 @@ public: char topMaterial; char material; int leafColor; + float temperature; + float downfall; private: static Biome* map[64*64]; }; diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 3868faa..4e3c4b2 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -419,7 +419,7 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { FlowerFeature feature(Tile::mushroom2->id); feature.place(level, &random, x, y, z); } - /*int grassCount = 1; + int grassCount = 1; for (int i = 0; i < grassCount; i++) { int x = xo + random.nextInt(16) + 8; int y = random.nextInt(Level::genDepth); @@ -429,7 +429,7 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { grassFeature->place(level, &random, x, y, z); delete grassFeature; } - }*/ + } for (int i = 0; i < 10; i++) { int x = xo + random.nextInt(16) + 8; int y = random.nextInt(128); diff --git a/src/world/level/tile/LeafTile.h b/src/world/level/tile/LeafTile.h index 53d9884..6095d12 100755 --- a/src/world/level/tile/LeafTile.h +++ b/src/world/level/tile/LeafTile.h @@ -60,6 +60,7 @@ public: return FoliageColor::getDefaultColor(); } + // return FoliageColor::getDefaultColor(); we need to hook this up with OPTION_FOLIAGE_TINT level->getBiomeSource()->getBiomeBlock(x, z, 1, 1); float temperature = level->getBiomeSource()->temperatures[0]; diff --git a/src/world/level/tile/TallGrass.cpp b/src/world/level/tile/TallGrass.cpp index 7a0350c..b3fc6e6 100755 --- a/src/world/level/tile/TallGrass.cpp +++ b/src/world/level/tile/TallGrass.cpp @@ -1,8 +1,12 @@ #include "TallGrass.h" #include "../FoliageColor.h" +#include "../GrassColor.h" #include "../../entity/player/Player.h" #include "../../item/Item.h" #include "../../item/ShearsItem.h" +#include "../Level.h" +#include "../LevelSource.h" +#include "../biome/BiomeSource.h" TallGrass::TallGrass( int id, int tex ) : super(id, tex, Material::replaceable_plant) { float ss = 0.4f; @@ -17,9 +21,14 @@ int TallGrass::getTexture( int face, int data ) { } int TallGrass::getColor() { - /*double temp = 0.5; - double rain = 1.0; - return GrassColor.get(temp, rain);*/ + //double temp = 0.5; + //double rain = 1.0; + // converted to float for consistency - shredder + float temp = 0.5; + float rain = 1.0; + if (GrassColor::useTint){ + return GrassColor::get(temp, rain); + } return 0x339933; } @@ -31,7 +40,15 @@ int TallGrass::getColor( int auxData ) { int TallGrass::getColor( LevelSource* level, int x, int y, int z ) { int d = level->getData(x, y, z); if (d == DEAD_SHRUB) return 0xffffff; - + float temp = level->getBiomeSource()->temperatures[0]; // shredder added + float rain = level->getBiomeSource()->downfalls[0]; // shredder added + if (GrassColor::useTint){ + return GrassColor::get(temp, rain); + } + // @TODO port this function from beta 1.6.6 probably, for now im using biomesource to tint it directly above - shredder + //if (GrassColor::useTint){ + //return level->getBiome(x, z)->getGrassColor(); + //} return 0x339933;//level->getBiome(x, z)->getGrassColor(); } From 4cfaa43d77f1708e35d15123dea286d40547047a Mon Sep 17 00:00:00 2001 From: Dram27 Date: Sun, 26 Apr 2026 15:47:52 +0200 Subject: [PATCH 103/189] Added scroll with wheel on PC and touch scroll on Android/IOS --- .../gui/components/GuiElementContainer.cpp | 11 + .../gui/components/GuiElementContainer.h | 21 +- src/client/gui/components/OptionsGroup.cpp | 330 ++++++++++++------ src/client/gui/components/OptionsGroup.h | 41 ++- src/client/gui/screens/OptionsScreen.cpp | 7 + src/client/gui/screens/OptionsScreen.h | 1 + 6 files changed, 275 insertions(+), 136 deletions(-) diff --git a/src/client/gui/components/GuiElementContainer.cpp b/src/client/gui/components/GuiElementContainer.cpp index 9cfbb09..4fdaf22 100755 --- a/src/client/gui/components/GuiElementContainer.cpp +++ b/src/client/gui/components/GuiElementContainer.cpp @@ -35,6 +35,17 @@ void GuiElementContainer::removeChild( GuiElement* element ) { children.erase(it); } +bool GuiElementContainer::containsPointInChildren(int x, int y) const { + for (std::vector::const_iterator it = children.begin(); it != children.end(); ++it) { + GuiElement* child = *it; + if (child == NULL || !child->visible) continue; + if (child->pointInside(x, y)) return true; + const GuiElementContainer* container = dynamic_cast(child); + if (container != NULL && container->containsPointInChildren(x, y)) return true; + } + return false; +} + void GuiElementContainer::tick( Minecraft* minecraft ) { for(std::vector::iterator it = children.begin(); it != children.end(); ++it) { (*it)->tick(minecraft); diff --git a/src/client/gui/components/GuiElementContainer.h b/src/client/gui/components/GuiElementContainer.h index d20f9d3..06df761 100755 --- a/src/client/gui/components/GuiElementContainer.h +++ b/src/client/gui/components/GuiElementContainer.h @@ -5,16 +5,17 @@ class Tesselator; class Minecraft; -class GuiElementContainer : public GuiElement { -public: - GuiElementContainer(bool active=false, bool visible=true, int x = 0, int y = 0, int width=24, int height=24); - virtual ~GuiElementContainer(); - virtual void render(Minecraft* minecraft, int xm, int ym); - virtual void setupPositions(); - virtual void addChild(GuiElement* element); - virtual void removeChild(GuiElement* element); - - virtual void tick( Minecraft* minecraft ); +class GuiElementContainer : public GuiElement { +public: + GuiElementContainer(bool active=false, bool visible=true, int x = 0, int y = 0, int width=24, int height=24); + virtual ~GuiElementContainer(); + virtual void render(Minecraft* minecraft, int xm, int ym); + virtual void setupPositions(); + virtual void addChild(GuiElement* element); + virtual void removeChild(GuiElement* element); + bool containsPointInChildren(int x, int y) const; + + virtual void tick( Minecraft* minecraft ); virtual void mouseClicked( Minecraft* minecraft, int x, int y, int buttonNum ); virtual void mouseReleased( Minecraft* minecraft, int x, int y, int buttonNum ); diff --git a/src/client/gui/components/OptionsGroup.cpp b/src/client/gui/components/OptionsGroup.cpp index 54212d5..3674a3f 100755 --- a/src/client/gui/components/OptionsGroup.cpp +++ b/src/client/gui/components/OptionsGroup.cpp @@ -1,115 +1,217 @@ -#include "OptionsGroup.h" -#include "../../Minecraft.h" -#include "ImageButton.h" -#include "OptionsItem.h" -#include "Slider.h" -#include "../../../locale/I18n.h" -#include "TextOption.h" -#include "KeyOption.h" - -OptionsGroup::OptionsGroup( std::string labelID ) { - label = I18n::get(labelID); -} - -void OptionsGroup::setupPositions() { - // First we write the header and then we add the items - int curY = y + 18; - for(std::vector::iterator it = children.begin(); it != children.end(); ++it) { - (*it)->width = width - 5; - - (*it)->y = curY; - (*it)->x = x + 10; - (*it)->setupPositions(); - curY += (*it)->height + 3; - } - height = curY; -} - -void OptionsGroup::render( Minecraft* minecraft, int xm, int ym ) { - float padX = 10.0f; - float padY = 5.0f; - - minecraft->font->draw(label, (float)x + padX, (float)y + padY, 0xffffffff, false); - - super::render(minecraft, xm, ym); -} - -OptionsGroup& OptionsGroup::addOptionItem(OptionId optId, Minecraft* minecraft ) { - auto option = minecraft->options.getOpt(optId); - - if (option == nullptr) return *this; - - // TODO: do a options key class to check it faster via dynamic_cast - if (option->getStringId().find("options.key") != std::string::npos) createKey(optId, minecraft); - else if (dynamic_cast(option)) createToggle(optId, minecraft); - else if (dynamic_cast(option)) createProgressSlider(optId, minecraft); - else if (dynamic_cast(option)) createStepSlider(optId, minecraft); - else if (dynamic_cast(option)) createTextbox(optId, minecraft); - - return *this; -} - -// TODO: wrap this copypaste shit into templates - -void OptionsGroup::createToggle(OptionId optId, Minecraft* minecraft ) { - ImageDef def; - - def.setSrc(IntRectangle(160, 206, 39, 20)); - def.name = "gui/touchgui.png"; - def.width = 39 * 0.7f; - def.height = 20 * 0.7f; - - OptionButton* element = new OptionButton(optId); - element->setImageDef(def, true); - element->updateImage(&minecraft->options); - - std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); - - OptionsItem* item = new OptionsItem(optId, itemLabel, element); - - addChild(item); - setupPositions(); -} - -void OptionsGroup::createProgressSlider(OptionId optId, Minecraft* minecraft ) { - Slider* element = new SliderFloat(minecraft, optId); - element->width = 100; - element->height = 20; - - std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); - OptionsItem* item = new OptionsItem(optId, itemLabel, element); - addChild(item); - setupPositions(); -} - -void OptionsGroup::createStepSlider(OptionId optId, Minecraft* minecraft ) { - Slider* element = new SliderInt(minecraft, optId); - element->width = 100; - element->height = 20; - std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); - OptionsItem* item = new OptionsItem(optId, itemLabel, element); - addChild(item); - setupPositions(); -} - -void OptionsGroup::createTextbox(OptionId optId, Minecraft* minecraft) { - TextBox* element = new TextOption(minecraft, optId); - element->width = 100; - element->height = 20; - - std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); - OptionsItem* item = new OptionsItem(optId, itemLabel, element); - addChild(item); - setupPositions(); -} - -void OptionsGroup::createKey(OptionId optId, Minecraft* minecraft) { - KeyOption* element = new KeyOption(minecraft, optId); - element->width = 50; - element->height = 20; - - std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); - OptionsItem* item = new OptionsItem(optId, itemLabel, element); - addChild(item); - setupPositions(); +#include "OptionsGroup.h" +#include "../../Minecraft.h" +#include "ImageButton.h" +#include "OptionsItem.h" +#include "Slider.h" +#include "../../../locale/I18n.h" +#include "TextOption.h" +#include "KeyOption.h" +#include +#include "../Screen.h" +#include "../../../platform/input/Mouse.h" +#include "../../../util/Mth.h" + +OptionsGroup::OptionsGroup( std::string labelID ) +: contentHeight(0), + scrollOffsetY(0.0f), + maxScrollOffsetY(0.0f), + trackingScrollGesture(false), + scrollingGesture(false), + touchDispatched(false), + dragStartX(0), + dragStartY(0), + lastDragY(0), + touchStartX(0), + touchStartY(0) { + label = I18n::get(labelID); +} + +void OptionsGroup::setupPositions() { + const int labelHeight = 18; + const float requestedScroll = scrollOffsetY; + const int scrollOffset = (int)requestedScroll; + int curY = y + labelHeight - scrollOffset; + const int contentStartY = y + labelHeight; + + // First we write the header and then we add the items + for(std::vector::iterator it = children.begin(); it != children.end(); ++it) { + (*it)->width = width - 5; + + (*it)->y = curY; + (*it)->x = x + 10; + (*it)->setupPositions(); + curY += (*it)->height + 3; + } + contentHeight = std::max(0, curY - contentStartY + scrollOffset); + maxScrollOffsetY = std::max(0, contentHeight - (height - labelHeight)); + const float clampedScroll = Mth::clamp(requestedScroll, 0.0f, maxScrollOffsetY); + if (clampedScroll != requestedScroll) { + scrollOffsetY = clampedScroll; + setupPositions(); + } +} + +void OptionsGroup::render( Minecraft* minecraft, int xm, int ym ) { + float padX = 10.0f; + float padY = 5.0f; + + minecraft->font->draw(label, (float)x + padX, (float)y + padY, 0xffffffff, false); + + super::render(minecraft, xm, ym); +} + +void OptionsGroup::tick(Minecraft* minecraft) { + int xm = Mouse::getX(); + int ym = Mouse::getY(); + if (minecraft->screen != NULL) { + minecraft->screen->toGUICoordinate(xm, ym); + } + + bool leftDown = Mouse::isButtonDown(MouseAction::ACTION_LEFT); + + if (trackingScrollGesture && leftDown) { + int dy = ym - lastDragY; + int dx = xm - dragStartX; + if (!scrollingGesture) { + int totalDx = xm - dragStartX; + int totalDy = ym - dragStartY; + if (std::abs(totalDx) >= ScrollStartThreshold || std::abs(totalDy) >= ScrollStartThreshold) { + if (std::abs(totalDy) >= std::abs(totalDx)) { + scrollingGesture = true; + } else if (!touchDispatched) { + super::mouseClicked(minecraft, touchStartX, touchStartY, MouseAction::ACTION_LEFT); + touchDispatched = true; + } + } + } + if (scrollingGesture && dy != 0) { + scrollByPixels((float)dy); + } + lastDragY = ym; + } + super::tick(minecraft); +} + +void OptionsGroup::mouseClicked(Minecraft* minecraft, int x, int y, int buttonNum) { + trackingScrollGesture = false; + scrollingGesture = false; + touchDispatched = false; + + if (buttonNum == MouseAction::ACTION_LEFT && pointInside(x, y)) { + trackingScrollGesture = true; + dragStartX = x; + dragStartY = y; + lastDragY = y; + touchStartX = x; + touchStartY = y; + return; + } + + super::mouseClicked(minecraft, x, y, buttonNum); +} + +void OptionsGroup::mouseReleased(Minecraft* minecraft, int x, int y, int buttonNum) { + bool wasScrolling = scrollingGesture; + bool wasTracking = trackingScrollGesture; + trackingScrollGesture = false; + scrollingGesture = false; + if (buttonNum == MouseAction::ACTION_LEFT && wasTracking && !touchDispatched && pointInside(touchStartX, touchStartY)) { + super::mouseClicked(minecraft, touchStartX, touchStartY, buttonNum); + touchDispatched = true; + } + + if (!wasScrolling) { + super::mouseReleased(minecraft, x, y, buttonNum); + } +} + +void OptionsGroup::scrollByPixels(float deltaY) { + if (deltaY == 0.0f || maxScrollOffsetY <= 0.0f) return; + + scrollOffsetY = Mth::clamp(scrollOffsetY - deltaY, 0.0f, maxScrollOffsetY); + setupPositions(); +} + +bool OptionsGroup::isScrollingGestureActive() const { + return trackingScrollGesture || scrollingGesture; +} + +OptionsGroup& OptionsGroup::addOptionItem(OptionId optId, Minecraft* minecraft ) { + auto option = minecraft->options.getOpt(optId); + + if (option == nullptr) return *this; + + // TODO: do a options key class to check it faster via dynamic_cast + if (option->getStringId().find("options.key") != std::string::npos) createKey(optId, minecraft); + else if (dynamic_cast(option)) createToggle(optId, minecraft); + else if (dynamic_cast(option)) createProgressSlider(optId, minecraft); + else if (dynamic_cast(option)) createStepSlider(optId, minecraft); + else if (dynamic_cast(option)) createTextbox(optId, minecraft); + + return *this; +} + +// TODO: wrap this copypaste shit into templates + +void OptionsGroup::createToggle(OptionId optId, Minecraft* minecraft ) { + ImageDef def; + + def.setSrc(IntRectangle(160, 206, 39, 20)); + def.name = "gui/touchgui.png"; + def.width = 39 * 0.7f; + def.height = 20 * 0.7f; + + OptionButton* element = new OptionButton(optId); + element->setImageDef(def, true); + element->updateImage(&minecraft->options); + + std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); + + OptionsItem* item = new OptionsItem(optId, itemLabel, element); + + addChild(item); + setupPositions(); +} + +void OptionsGroup::createProgressSlider(OptionId optId, Minecraft* minecraft ) { + Slider* element = new SliderFloat(minecraft, optId); + element->width = 100; + element->height = 20; + + std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); + OptionsItem* item = new OptionsItem(optId, itemLabel, element); + addChild(item); + setupPositions(); +} + +void OptionsGroup::createStepSlider(OptionId optId, Minecraft* minecraft ) { + Slider* element = new SliderInt(minecraft, optId); + element->width = 100; + element->height = 20; + std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); + OptionsItem* item = new OptionsItem(optId, itemLabel, element); + addChild(item); + setupPositions(); +} + +void OptionsGroup::createTextbox(OptionId optId, Minecraft* minecraft) { + TextBox* element = new TextOption(minecraft, optId); + element->width = 100; + element->height = 20; + + std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); + OptionsItem* item = new OptionsItem(optId, itemLabel, element); + addChild(item); + setupPositions(); +} + +void OptionsGroup::createKey(OptionId optId, Minecraft* minecraft) { + KeyOption* element = new KeyOption(minecraft, optId); + element->width = 50; + element->height = 20; + + std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId()); + OptionsItem* item = new OptionsItem(optId, itemLabel, element); + addChild(item); + setupPositions(); } \ No newline at end of file diff --git a/src/client/gui/components/OptionsGroup.h b/src/client/gui/components/OptionsGroup.h index 24d28bd..ac90e3d 100755 --- a/src/client/gui/components/OptionsGroup.h +++ b/src/client/gui/components/OptionsGroup.h @@ -11,22 +11,39 @@ class Font; class Minecraft; -class OptionsGroup: public GuiElementContainer { - typedef GuiElementContainer super; -public: - OptionsGroup(std::string labelID); - virtual void setupPositions(); - virtual void render(Minecraft* minecraft, int xm, int ym); - OptionsGroup& addOptionItem(OptionId optId, Minecraft* minecraft); -protected: +class OptionsGroup: public GuiElementContainer { + typedef GuiElementContainer super; +public: + OptionsGroup(std::string labelID); + virtual void setupPositions(); + virtual void render(Minecraft* minecraft, int xm, int ym); + virtual void tick(Minecraft* minecraft); + virtual void mouseClicked(Minecraft* minecraft, int x, int y, int buttonNum); + virtual void mouseReleased(Minecraft* minecraft, int x, int y, int buttonNum); + OptionsGroup& addOptionItem(OptionId optId, Minecraft* minecraft); + void scrollByPixels(float deltaY); + bool isScrollingGestureActive() const; +protected: void createToggle(OptionId optId, Minecraft* minecraft); void createProgressSlider(OptionId optId, Minecraft* minecraft); void createStepSlider(OptionId optId, Minecraft* minecraft); void createTextbox(OptionId optId, Minecraft* minecraft); - void createKey(OptionId optId, Minecraft* minecraft); - - std::string label; -}; + void createKey(OptionId optId, Minecraft* minecraft); + + std::string label; + int contentHeight; + float scrollOffsetY; + float maxScrollOffsetY; + bool trackingScrollGesture; + bool scrollingGesture; + bool touchDispatched; + int dragStartX; + int dragStartY; + int lastDragY; + int touchStartX; + int touchStartY; + static const int ScrollStartThreshold = 5; +}; #endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__*/ diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 88fbb63..b58f3fe 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -121,6 +121,7 @@ void OptionsScreen::setupPositions() { (*it)->x = categoryButtons[0]->width; (*it)->y = bHeader->height; (*it)->width = width - categoryButtons[0]->width; + (*it)->height = height - bHeader->height; (*it)->setupPositions(); } @@ -253,6 +254,12 @@ void OptionsScreen::mouseReleased(int x, int y, int buttonNum) { super::mouseReleased(x, y, buttonNum); } +void OptionsScreen::mouseWheel(int dx, int dy, int xm, int ym) { + if (currentOptionsGroup != NULL && currentOptionsGroup->pointInside(xm, ym) && dy != 0) { + currentOptionsGroup->scrollByPixels((float)dy * 18.0f); + } +} + void OptionsScreen::keyPressed(int eventKey) { if (currentOptionsGroup != NULL) currentOptionsGroup->keyPressed(minecraft, eventKey); diff --git a/src/client/gui/screens/OptionsScreen.h b/src/client/gui/screens/OptionsScreen.h index b02c7b8..dd1e73e 100755 --- a/src/client/gui/screens/OptionsScreen.h +++ b/src/client/gui/screens/OptionsScreen.h @@ -27,6 +27,7 @@ public: virtual void mouseClicked(int x, int y, int buttonNum); virtual void mouseReleased(int x, int y, int buttonNum); + virtual void mouseWheel(int dx, int dy, int xm, int ym); virtual void keyPressed(int eventKey); virtual void charPressed(char inputChar); From 162ec7adfaaea94cdabbfa5cd5eff0c4410f069d Mon Sep 17 00:00:00 2001 From: Dram27 Date: Sun, 26 Apr 2026 16:00:44 +0200 Subject: [PATCH 104/189] Fix bottom settings overlapping with Credits button --- src/client/gui/components/OptionsGroup.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/gui/components/OptionsGroup.cpp b/src/client/gui/components/OptionsGroup.cpp index 3674a3f..fa73815 100755 --- a/src/client/gui/components/OptionsGroup.cpp +++ b/src/client/gui/components/OptionsGroup.cpp @@ -28,6 +28,7 @@ OptionsGroup::OptionsGroup( std::string labelID ) void OptionsGroup::setupPositions() { const int labelHeight = 18; + const int bottomPadding = 36; const float requestedScroll = scrollOffsetY; const int scrollOffset = (int)requestedScroll; int curY = y + labelHeight - scrollOffset; @@ -42,6 +43,7 @@ void OptionsGroup::setupPositions() { (*it)->setupPositions(); curY += (*it)->height + 3; } + curY += bottomPadding; contentHeight = std::max(0, curY - contentStartY + scrollOffset); maxScrollOffsetY = std::max(0, contentHeight - (height - labelHeight)); const float clampedScroll = Mth::clamp(requestedScroll, 0.0f, maxScrollOffsetY); From b3561e773de1d8842eb7dbea6bd831d5273999a1 Mon Sep 17 00:00:00 2001 From: Dram27 Date: Sun, 26 Apr 2026 16:12:56 +0200 Subject: [PATCH 105/189] Fix to prevent text overlap in options list during scroll --- src/client/gui/components/OptionsGroup.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/client/gui/components/OptionsGroup.cpp b/src/client/gui/components/OptionsGroup.cpp index fa73815..61695bb 100755 --- a/src/client/gui/components/OptionsGroup.cpp +++ b/src/client/gui/components/OptionsGroup.cpp @@ -7,6 +7,7 @@ #include "TextOption.h" #include "KeyOption.h" #include +#include "../Gui.h" #include "../Screen.h" #include "../../../platform/input/Mouse.h" #include "../../../util/Mth.h" @@ -56,10 +57,20 @@ void OptionsGroup::setupPositions() { void OptionsGroup::render( Minecraft* minecraft, int xm, int ym ) { float padX = 10.0f; float padY = 5.0f; + const int labelHeight = 18; minecraft->font->draw(label, (float)x + padX, (float)y + padY, 0xffffffff, false); + glEnable2(GL_SCISSOR_TEST); + glScissor( + Gui::GuiScale * x, + minecraft->height - Gui::GuiScale * (y + height), + Gui::GuiScale * width, + Gui::GuiScale * (height - labelHeight) + ); + super::render(minecraft, xm, ym); + glDisable2(GL_SCISSOR_TEST); } void OptionsGroup::tick(Minecraft* minecraft) { @@ -216,4 +227,4 @@ void OptionsGroup::createKey(OptionId optId, Minecraft* minecraft) { OptionsItem* item = new OptionsItem(optId, itemLabel, element); addChild(item); setupPositions(); -} \ No newline at end of file +} From 0645905fc618075dc643f93b22df9790b73f9e99 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 27 Apr 2026 22:18:18 +0200 Subject: [PATCH 106/189] eeee it doesnt work :sob: --- src/network/ClientSideNetworkHandler.cpp | 20 +++++++++++++- src/network/ClientSideNetworkHandler.h | 6 ++--- src/network/ServerSideNetworkHandler.cpp | 13 ++++------ src/network/packet/StartGamePacket.h | 12 +++++++-- src/world/level/LevelConstants.h | 12 +++------ src/world/level/chunk/ChunkCache.h | 33 ++++++++++++------------ src/world/level/chunk/LevelChunk.h | 4 +-- 7 files changed, 60 insertions(+), 40 deletions(-) diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index ecfc12d..14e87cf 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -12,6 +12,7 @@ #include "../client/Minecraft.h" #include "../client/gamemode/GameMode.h" #include "world/item/ItemInstance.h" +#include "world/level/LevelConstants.h" #ifndef STANDALONE_SERVER #include "../client/gui/screens/DisconnectionScreen.h" #endif @@ -99,6 +100,10 @@ void ClientSideNetworkHandler::onUnableToConnect() void ClientSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid) { + CHUNK_CACHE_WIDTH = 16; + LEVEL_WIDTH = CHUNK_CACHE_WIDTH * CHUNK_WIDTH; + LEVEL_DEPTH = CHUNK_CACHE_WIDTH * CHUNK_DEPTH; + // TODO: Good disconnecting LOGI("onDisconnect\n"); if (level) @@ -155,6 +160,19 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, StartGam } #endif + // @todo @note i think its trash + // we can put it directly to selectLevel? + if (packet->chunkCacheWidth != 0) { + printf("lol \n"); + CHUNK_CACHE_WIDTH = packet->chunkCacheWidth; + LEVEL_WIDTH = CHUNK_CACHE_WIDTH * CHUNK_WIDTH; + LEVEL_DEPTH = CHUNK_CACHE_WIDTH * CHUNK_DEPTH; + + } + NumRequestChunks = CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; + requestNextChunkIndexList.resize(NumRequestChunks); + chunksLoaded.resize(NumRequestChunks); + const std::string& levelId = LevelStorageSource::TempLevelId; LevelStorageSource* storageSource = minecraft->getLevelSource(); storageSource->deleteLevel(levelId); @@ -696,7 +714,7 @@ void ClientSideNetworkHandler::arrangeRequestChunkOrder() { } _ChunkSorter sorter(cx, cz); - std::sort(requestNextChunkIndexList, requestNextChunkIndexList + NumRequestChunks, sorter); + std::sort(requestNextChunkIndexList.begin(), requestNextChunkIndexList.end(), sorter); } void ClientSideNetworkHandler::levelGenerated(Level* level) diff --git a/src/network/ClientSideNetworkHandler.h b/src/network/ClientSideNetworkHandler.h index 4847c74..57e0d81 100755 --- a/src/network/ClientSideNetworkHandler.h +++ b/src/network/ClientSideNetworkHandler.h @@ -102,11 +102,11 @@ private: BlockUpdateList bufferedBlockUpdates; int requestNextChunkPosition; - static const int NumRequestChunks = CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; + int NumRequestChunks; int requestNextChunkIndex; - IntPair requestNextChunkIndexList[NumRequestChunks]; - bool chunksLoaded[NumRequestChunks]; + std::vector requestNextChunkIndexList; + std::vector chunksLoaded; }; #endif diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 69793b4..0a70530 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -27,6 +27,7 @@ #include "util/Mth.h" #include "util/StringUtils.h" #include "world/item/ItemInstance.h" +#include "world/level/LevelConstants.h" #include "world/level/storage/LevelStorage.h" #include "world/phys/Vec3.h" #include "world/item/crafting/Recipe.h" @@ -219,8 +220,8 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac // bool oldClient = packet->clientNetworkVersion < SharedConstants::NetworkProtocolLowestSupportedVersion; bool oldServer = packet->clientNetworkLowestSupportedVersion > SharedConstants::NetworkProtocolVersion; - if (oldClient || oldServer) - loginStatus = oldClient? LoginStatus::Failed_ClientOld : LoginStatus::Failed_ServerOld; + if (oldClient || oldServer || !packet->newProto) + loginStatus = oldClient || !packet->newProto? LoginStatus::Failed_ClientOld : LoginStatus::Failed_ServerOld; for (int i = 0; i < level->players.size(); i++) { ServerPlayer* player = (ServerPlayer*) level->players.at(i); @@ -272,15 +273,11 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac level->getLevelData()->getGeneratorVersion(), gameType, newPlayer->entityId, - newPlayer->x, newPlayer->y - newPlayer->heightOffset, newPlayer->z + newPlayer->x, newPlayer->y - newPlayer->heightOffset, newPlayer->z, + CHUNK_CACHE_WIDTH ).write(&bitStream); rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); - - if (!packet->newProto) { - MessagePacket packet("You're using outdated client. Some features disabled."); - raknetInstance->send(packet); - } } } diff --git a/src/network/packet/StartGamePacket.h b/src/network/packet/StartGamePacket.h index 24adead..e1b037e 100755 --- a/src/network/packet/StartGamePacket.h +++ b/src/network/packet/StartGamePacket.h @@ -2,6 +2,7 @@ #define NET_MINECRAFT_NETWORK_PACKET__StartGamePacket_H__ #include "../Packet.h" +#include "world/level/LevelConstants.h" #include class StartGamePacket : public Packet @@ -14,18 +15,20 @@ public: int entityId; float x, y, z; + int chunkCacheWidth = 0; StartGamePacket() { } - StartGamePacket(long seed, int levelGeneratorVersion, int gameType, int entityId, float x, float y, float z) + StartGamePacket(long seed, int levelGeneratorVersion, int gameType, int entityId, float x, float y, float z, int chunkCacheWidth) : levelSeed((int32_t)seed), levelGeneratorVersion(levelGeneratorVersion), gameType(gameType), entityId(entityId), x(x), y(y), - z(z) + z(z), + chunkCacheWidth(chunkCacheWidth) { } @@ -40,6 +43,7 @@ public: bitStream->Write(x); bitStream->Write(y); bitStream->Write(z); + bitStream->Write(CHUNK_CACHE_WIDTH); } void read(RakNet::BitStream* bitStream) @@ -51,6 +55,10 @@ public: bitStream->Read(x); bitStream->Read(y); bitStream->Read(z); + + if (bitStream->GetNumberOfUnreadBits() > 0) { + bitStream->Read(chunkCacheWidth); + } } void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) diff --git a/src/world/level/LevelConstants.h b/src/world/level/LevelConstants.h index 4d6865b..18f3a0b 100755 --- a/src/world/level/LevelConstants.h +++ b/src/world/level/LevelConstants.h @@ -1,14 +1,10 @@ -#ifndef _MINECRAFT_WORLD_LEVELCONSTANTS_H_ -#define _MINECRAFT_WORLD_LEVELCONSTANTS_H_ - +#pragma once const int LEVEL_HEIGHT = 128; -const int CHUNK_CACHE_WIDTH = 16; // in chunks +int CHUNK_CACHE_WIDTH = 16; // in chunks const int CHUNK_WIDTH = 16; // in blocks const int CHUNK_DEPTH = 16; -const int LEVEL_WIDTH = CHUNK_CACHE_WIDTH * CHUNK_WIDTH; -const int LEVEL_DEPTH = CHUNK_CACHE_WIDTH * CHUNK_DEPTH; +int LEVEL_WIDTH = CHUNK_CACHE_WIDTH * CHUNK_WIDTH; +int LEVEL_DEPTH = CHUNK_CACHE_WIDTH * CHUNK_DEPTH; const int CHUNK_COLUMNS = CHUNK_WIDTH * CHUNK_DEPTH; const int CHUNK_BLOCK_COUNT = CHUNK_COLUMNS * LEVEL_HEIGHT; - -#endif diff --git a/src/world/level/chunk/ChunkCache.h b/src/world/level/chunk/ChunkCache.h index b1b16fe..1401905 100755 --- a/src/world/level/chunk/ChunkCache.h +++ b/src/world/level/chunk/ChunkCache.h @@ -24,7 +24,8 @@ public: isChunkCache = true; //emptyChunk = new EmptyLevelChunk(level_, emptyChunkBlocks, 0, 0); emptyChunk = new EmptyLevelChunk(level_, NULL, 0, 0); - memset(chunks, 0, sizeof(LevelChunk*) * CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH); + + chunks = (LevelChunk *)malloc(CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH); } ~ChunkCache() { @@ -33,10 +34,10 @@ public: for (int i = 0; i < CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; i++) { - if (chunks[i]) + if (&chunks[i]) { - chunks[i]->deleteBlockData(); - delete chunks[i]; + chunks[i].deleteBlockData(); + delete &chunks[i]; } } } @@ -55,7 +56,7 @@ public: int xs = x & (CHUNK_CACHE_WIDTH - 1); int zs = z & (CHUNK_CACHE_WIDTH - 1); int slot = xs + zs * CHUNK_CACHE_WIDTH; - return chunks[slot] != NULL && (chunks[slot] == emptyChunk || chunks[slot]->isAt(x, z)); + return &chunks[slot] != NULL && (&chunks[slot] == emptyChunk || chunks[slot].isAt(x, z)); } LevelChunk* create(int x, int z) { @@ -75,10 +76,10 @@ public: int zs = z & (CHUNK_CACHE_WIDTH - 1); int slot = xs + zs * CHUNK_CACHE_WIDTH; if (!hasChunk(x, z)) { - if (chunks[slot] != NULL) { - chunks[slot]->unload(); - save(chunks[slot]); - saveEntities(chunks[slot]); + if (&chunks[slot] != NULL) { + chunks[slot].unload(); + save(&chunks[slot]); + saveEntities(&chunks[slot]); } LevelChunk* newChunk = load(x, z); @@ -93,7 +94,7 @@ public: //return emptyChunk; updateLights = true; } - chunks[slot] = newChunk; + chunks[slot] = *newChunk; newChunk->lightLava(); if (updateLights) @@ -114,23 +115,23 @@ public: //level->updateLight(LightLayer::Block, x * 16, 0, z * 16, x * 16 + 15, 128, z * 16 + 15); } - if (chunks[slot] != NULL) { - chunks[slot]->load(); + if (&chunks[slot] != NULL) { + chunks[slot].load(); } - if (!chunks[slot]->terrainPopulated && hasChunk(x + 1, z + 1) && hasChunk(x, z + 1) && hasChunk(x + 1, z)) postProcess(this, x, z); + if (!chunks[slot].terrainPopulated && hasChunk(x + 1, z + 1) && hasChunk(x, z + 1) && hasChunk(x + 1, z)) postProcess(this, x, z); if (hasChunk(x - 1, z) && !getChunk(x - 1, z)->terrainPopulated && hasChunk(x - 1, z + 1) && hasChunk(x, z + 1) && hasChunk(x - 1, z)) postProcess(this, x - 1, z); if (hasChunk(x, z - 1) && !getChunk(x, z - 1)->terrainPopulated && hasChunk(x + 1, z - 1) && hasChunk(x, z - 1) && hasChunk(x + 1, z)) postProcess(this, x, z - 1); if (hasChunk(x - 1, z - 1) && !getChunk(x - 1, z - 1)->terrainPopulated && hasChunk(x - 1, z - 1) && hasChunk(x, z - 1) && hasChunk(x - 1, z)) postProcess(this, x - 1, z - 1); } xLast = x; zLast = z; - last = chunks[slot]; + last = &chunks[slot]; //sw.stop(); //sw.printEvery(500000, "ChunkCache::load: "); - return chunks[slot]; + return &chunks[slot]; } Biome::MobList getMobsAt(const MobCategory& mobCategory, int x, int y, int z) { @@ -254,7 +255,7 @@ private: LevelChunk* emptyChunk; ChunkSource* source; ChunkStorage* storage; - LevelChunk* chunks[CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH]; + LevelChunk* chunks; Level* level; LevelChunk* last; diff --git a/src/world/level/chunk/LevelChunk.h b/src/world/level/chunk/LevelChunk.h index 5735744..c06819e 100755 --- a/src/world/level/chunk/LevelChunk.h +++ b/src/world/level/chunk/LevelChunk.h @@ -122,8 +122,8 @@ public: unsigned char updateMap[CHUNK_COLUMNS]; // marks regions within block columns that have been modified int minHeight; - const int x, z; - const int xt, zt; + int x, z; + int xt, zt; bool terrainPopulated; bool unsaved; From de72a9a3b79cd907240d0ab41691e16e9558c03f Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 27 Apr 2026 23:43:36 +0200 Subject: [PATCH 107/189] all was broken :\ --- src/client/Minecraft.cpp | 10 +-- src/client/renderer/LevelRenderer.cpp | 2 +- src/network/ClientSideNetworkHandler.cpp | 68 +++++++++---------- src/network/ServerSideNetworkHandler.cpp | 2 +- src/network/command/CommandServer.cpp | 10 +-- src/network/packet/ChunkDataPacket.h | 8 +-- src/network/packet/StartGamePacket.h | 4 +- src/world/entity/Entity.cpp | 4 +- src/world/level/Level.cpp | 24 +++---- src/world/level/Level.h | 4 +- src/world/level/LevelConstants.cpp | 7 ++ src/world/level/LevelConstants.h | 20 +++--- src/world/level/chunk/ChunkCache.h | 26 +++---- src/world/level/chunk/LevelChunk.cpp | 11 +-- src/world/level/chunk/LevelChunk.h | 10 +-- .../level/levelgen/RandomLevelSource.cpp | 16 ++--- .../storage/ExternalFileLevelStorage.cpp | 34 +++++----- src/world/level/tile/Mushroom.cpp | 2 +- src/world/level/tile/NetherReactor.cpp | 2 +- .../tile/entity/NetherReactorTileEntity.cpp | 4 +- 20 files changed, 141 insertions(+), 127 deletions(-) create mode 100644 src/world/level/LevelConstants.cpp diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 05e397b..6698c3d 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -362,10 +362,10 @@ void Minecraft::prepareLevel(const std::string& title) { if (!level->isNew()) level->setUpdateLights(false); - int Max = CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; + int Max = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; int pp = 0; - for (int x = 8; x < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); x += CHUNK_WIDTH) { - for (int z = 8; z < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); z += CHUNK_WIDTH) { + for (int x = 8; x < (LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH); x += LevelConstants::CHUNK_WIDTH) { + for (int z = 8; z < (LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH); z += LevelConstants::CHUNK_WIDTH) { progressStagePercentage = 100 * pp++ / Max; //printf("level generation progress %d\n", progressStagePercentage); B.start(); @@ -382,9 +382,9 @@ void Minecraft::prepareLevel(const std::string& title) { level->setUpdateLights(true); C.start(); - for (int x = 0; x < CHUNK_CACHE_WIDTH; x++) + for (int x = 0; x < LevelConstants::CHUNK_CACHE_WIDTH; x++) { - for (int z = 0; z < CHUNK_CACHE_WIDTH; z++) + for (int z = 0; z < LevelConstants::CHUNK_CACHE_WIDTH; z++) { LevelChunk* chunk = level->getChunk(x, z); if (chunk && !chunk->createdFromSave) diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 3520732..c3f1161 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -65,7 +65,7 @@ LevelRenderer::LevelRenderer( Minecraft* mc) destroyProgress(0) { #ifdef OPENGL_ES - int maxChunksWidth = 2 * LEVEL_WIDTH / CHUNK_SIZE + 1; + int maxChunksWidth = 2 * LevelConstants::LEVEL_WIDTH / CHUNK_SIZE + 1; numListsOrBuffers = maxChunksWidth * maxChunksWidth * (128/CHUNK_SIZE) * 3; chunkBuffers = new GLuint[numListsOrBuffers]; glGenBuffers2(numListsOrBuffers, chunkBuffers); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 14e87cf..c1515f7 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -62,7 +62,7 @@ void ClientSideNetworkHandler::requestNextChunk() //LOGI("requesting chunks @ (%d, %d)\n", chunk.x, chunk.y); - //raknetInstance->send(new RequestChunkPacket(requestNextChunkPosition % CHUNK_CACHE_WIDTH, requestNextChunkPosition / CHUNK_CACHE_WIDTH)); + //raknetInstance->send(new RequestChunkPacket(requestNextChunkPosition % LevelConstants::CHUNK_CACHE_WIDTH, requestNextChunkPosition / LevelConstants::CHUNK_CACHE_WIDTH)); requestNextChunkIndex++; requestNextChunkPosition++; } @@ -70,16 +70,16 @@ void ClientSideNetworkHandler::requestNextChunk() bool ClientSideNetworkHandler::areAllChunksLoaded() { - return (requestNextChunkPosition >= (CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH)); + return (requestNextChunkPosition >= (LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH)); } bool ClientSideNetworkHandler::isChunkLoaded(int x, int z) { - if (x < 0 || x >= CHUNK_CACHE_WIDTH || z < 0 || z >= CHUNK_CACHE_WIDTH) { + if (x < 0 || x >= LevelConstants::CHUNK_CACHE_WIDTH || z < 0 || z >= LevelConstants::CHUNK_CACHE_WIDTH) { LOGE("Error: Tried to request chunk (%d, %d)\n", x, z); return true; } - return chunksLoaded[x * CHUNK_CACHE_WIDTH + z]; + return chunksLoaded[x * LevelConstants::CHUNK_CACHE_WIDTH + z]; //return areAllChunksLoaded(); } @@ -100,9 +100,9 @@ void ClientSideNetworkHandler::onUnableToConnect() void ClientSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid) { - CHUNK_CACHE_WIDTH = 16; - LEVEL_WIDTH = CHUNK_CACHE_WIDTH * CHUNK_WIDTH; - LEVEL_DEPTH = CHUNK_CACHE_WIDTH * CHUNK_DEPTH; + LevelConstants::CHUNK_CACHE_WIDTH = 16; + LevelConstants::LEVEL_WIDTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH; + LevelConstants::LEVEL_DEPTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_DEPTH; // TODO: Good disconnecting LOGI("onDisconnect\n"); @@ -164,12 +164,12 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, StartGam // we can put it directly to selectLevel? if (packet->chunkCacheWidth != 0) { printf("lol \n"); - CHUNK_CACHE_WIDTH = packet->chunkCacheWidth; - LEVEL_WIDTH = CHUNK_CACHE_WIDTH * CHUNK_WIDTH; - LEVEL_DEPTH = CHUNK_CACHE_WIDTH * CHUNK_DEPTH; + LevelConstants::CHUNK_CACHE_WIDTH = packet->chunkCacheWidth; + LevelConstants::LEVEL_WIDTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH; + LevelConstants::LEVEL_DEPTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_DEPTH; } - NumRequestChunks = CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; + NumRequestChunks = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; requestNextChunkIndexList.resize(NumRequestChunks); chunksLoaded.resize(NumRequestChunks); @@ -551,19 +551,19 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChunkDat //unsigned char* blockIds = chunk->getBlockData(); DataLayer& blockData = chunk->data; - const int setSize = LEVEL_HEIGHT / 8; - const int setShift = 4; // power of LEVEL_HEIGHT / 8 + const int setSize = LevelConstants::LEVEL_HEIGHT / 8; + const int setShift = 4; // power of LevelConstants::LEVEL_HEIGHT / 8 bool recalcHeight = false; - int x0 = 16, x1 = 0, z0 = 16, z1 = 0, y0 = LEVEL_HEIGHT, y1 = 0; + int x0 = 16, x1 = 0, z0 = 16, z1 = 0, y0 = LevelConstants::LEVEL_HEIGHT, y1 = 0; int rx = packet->x << 4; int rz = packet->z << 4; unsigned char readBlockBuffer[setSize]; unsigned char readDataBuffer[setSize / 2]; - for (int i = 0; i < CHUNK_COLUMNS; i++) + for (int i = 0; i < LevelConstants::CHUNK_COLUMNS; i++) { unsigned char updateBits = 0; packet->chunkData.Read(updateBits); @@ -572,8 +572,8 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChunkDat { recalcHeight = true; - int colX = (i % CHUNK_WIDTH); - int colZ = (i / CHUNK_WIDTH); + int colX = (i % LevelConstants::CHUNK_WIDTH); + int colZ = (i / LevelConstants::CHUNK_WIDTH); int colDataPosition = colX << 11 | colZ << 7; for (int set = 0; set < 8; set++) @@ -607,26 +607,26 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChunkDat { y0 = ((1 << set) << setShift); } - if (((1 << set) << setShift) + (LEVEL_HEIGHT / 8) - 1 > y1) + if (((1 << set) << setShift) + (LevelConstants::LEVEL_HEIGHT / 8) - 1 > y1) { - y1 = ((1 << set) << setShift) + (LEVEL_HEIGHT / 8) - 1; + y1 = ((1 << set) << setShift) + (LevelConstants::LEVEL_HEIGHT / 8) - 1; } } - if ((i % CHUNK_WIDTH) < x0) + if ((i % LevelConstants::CHUNK_WIDTH) < x0) { - x0 = (i % CHUNK_WIDTH); + x0 = (i % LevelConstants::CHUNK_WIDTH); } - if ((i % CHUNK_WIDTH) > x1) + if ((i % LevelConstants::CHUNK_WIDTH) > x1) { - x1 = (i % CHUNK_WIDTH); + x1 = (i % LevelConstants::CHUNK_WIDTH); } - if ((i / CHUNK_WIDTH) < z0) + if ((i / LevelConstants::CHUNK_WIDTH) < z0) { - z0 = (i / CHUNK_WIDTH); + z0 = (i / LevelConstants::CHUNK_WIDTH); } - if ((i / CHUNK_WIDTH) > z1) + if ((i / LevelConstants::CHUNK_WIDTH) > z1) { - z1 = (i / CHUNK_WIDTH); + z1 = (i / LevelConstants::CHUNK_WIDTH); } } } @@ -655,7 +655,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChunkDat //chunk->terrainPopulated = true; chunk->unsaved = false; - chunksLoaded[packet->x * CHUNK_CACHE_WIDTH + packet->z] = true; + chunksLoaded[packet->x * LevelConstants::CHUNK_CACHE_WIDTH + packet->z] = true; if (areAllChunksLoaded()) { @@ -703,14 +703,14 @@ void ClientSideNetworkHandler::arrangeRequestChunkOrder() { clearChunksLoaded(); // Default sort is around center of the world - int cx = CHUNK_CACHE_WIDTH / 2; - int cz = CHUNK_CACHE_WIDTH / 2; + int cx = LevelConstants::CHUNK_CACHE_WIDTH / 2; + int cz = LevelConstants::CHUNK_CACHE_WIDTH / 2; // If player exists, let's sort around him Player* p = minecraft? minecraft->player : NULL; if (p) { - cx = Mth::floor(p->x / (float)CHUNK_WIDTH); - cz = Mth::floor(p->z / (float)CHUNK_DEPTH); + cx = Mth::floor(p->x / (float)LevelConstants::CHUNK_WIDTH); + cz = Mth::floor(p->z / (float)LevelConstants::CHUNK_DEPTH); } _ChunkSorter sorter(cx, cz); @@ -1004,8 +1004,8 @@ void ClientSideNetworkHandler::clearChunksLoaded() { // Init the chunk positions for (int i = 0; i < NumRequestChunks; ++i) { - requestNextChunkIndexList[i].x = i/CHUNK_WIDTH; - requestNextChunkIndexList[i].y = i%CHUNK_WIDTH; + requestNextChunkIndexList[i].x = i / LevelConstants::CHUNK_WIDTH; + requestNextChunkIndexList[i].y = i % LevelConstants::CHUNK_WIDTH; chunksLoaded[i] = false; } } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 0a70530..e7e10fb 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -274,7 +274,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac gameType, newPlayer->entityId, newPlayer->x, newPlayer->y - newPlayer->heightOffset, newPlayer->z, - CHUNK_CACHE_WIDTH + LevelConstants::CHUNK_CACHE_WIDTH ).write(&bitStream); rakPeer->Send(&bitStream, HIGH_PRIORITY, RELIABLE_ORDERED, 0, source, false); diff --git a/src/network/command/CommandServer.cpp b/src/network/command/CommandServer.cpp index 14417c2..280b0a9 100755 --- a/src/network/command/CommandServer.cpp +++ b/src/network/command/CommandServer.cpp @@ -236,9 +236,9 @@ std::string CommandServer::parse(ConnectedClient& client, const std::string& s) if (x0 < 0) x0 = 0; if (y0 < 0) y0 = 0; if (z0 < 0) z0 = 0; - if (x1 >= LEVEL_WIDTH ) x1 = LEVEL_WIDTH - 1; - if (y1 >= LEVEL_HEIGHT) y1 = LEVEL_HEIGHT - 1; - if (z1 >= LEVEL_DEPTH ) z1 = LEVEL_DEPTH - 1; + if (x1 >= LevelConstants::LEVEL_WIDTH ) x1 = LevelConstants::LEVEL_WIDTH - 1; + if (y1 >= LevelConstants::LEVEL_HEIGHT) y1 = LevelConstants::LEVEL_HEIGHT - 1; + if (z1 >= LevelConstants::LEVEL_DEPTH ) z1 = LevelConstants::LEVEL_DEPTH - 1; for (int y = y0; y <= y1; ++y) for (int z = z0; z <= z1; ++z) @@ -456,7 +456,7 @@ std::string CommandServer::parse(ConnectedClient& client, const std::string& s) sw.start(); // Save a cuboid around the player - const int CSize = CHUNK_CACHE_WIDTH; + const int CSize = LevelConstants::CHUNK_CACHE_WIDTH; int cx = (int)e->x / CSize; int cz = (int)e->z / CSize; @@ -504,7 +504,7 @@ bool CommandServer::handleCheckpoint(bool doRestore ) { const int cz = restorePos.z; const int y0 = restorePos.y; const int y1 = y0 + RestoreHeight; - const int CSize = CHUNK_CACHE_WIDTH; + const int CSize = LevelConstants::CHUNK_CACHE_WIDTH; const int numChunkBytes = RestoreHeight * CSize * CSize * 20 / 8; if (!restoreBuffer) { diff --git a/src/network/packet/ChunkDataPacket.h b/src/network/packet/ChunkDataPacket.h index 51f1719..b272685 100755 --- a/src/network/packet/ChunkDataPacket.h +++ b/src/network/packet/ChunkDataPacket.h @@ -33,18 +33,18 @@ public: unsigned char* blockIds = chunk->getBlockData(); DataLayer& blockData = chunk->data; - const int setSize = LEVEL_HEIGHT / 8; - const int setShift = 4; // power of LEVEL_HEIGHT / 8 + const int setSize = LevelConstants::LEVEL_HEIGHT / 8; + const int setShift = 4; // power of LevelConstants::LEVEL_HEIGHT / 8 chunkData.Reset(); - for (int i = 0; i < CHUNK_COLUMNS; i++) + for (int i = 0; i < LevelConstants::CHUNK_COLUMNS; i++) { unsigned char updateBits = chunk->updateMap[i]; chunkData.Write(updateBits); if (updateBits > 0) { - int colDataPosition = (i % CHUNK_WIDTH) << 11 | (i / CHUNK_WIDTH) << 7; + int colDataPosition = (i % LevelConstants::CHUNK_WIDTH) << 11 | (i / LevelConstants::CHUNK_WIDTH) << 7; for (int set = 0; set < 8; set++) { diff --git a/src/network/packet/StartGamePacket.h b/src/network/packet/StartGamePacket.h index e1b037e..f2ce50f 100755 --- a/src/network/packet/StartGamePacket.h +++ b/src/network/packet/StartGamePacket.h @@ -43,7 +43,7 @@ public: bitStream->Write(x); bitStream->Write(y); bitStream->Write(z); - bitStream->Write(CHUNK_CACHE_WIDTH); + bitStream->Write(LevelConstants::CHUNK_CACHE_WIDTH); } void read(RakNet::BitStream* bitStream) @@ -55,7 +55,7 @@ public: bitStream->Read(x); bitStream->Read(y); bitStream->Read(z); - + if (bitStream->GetNumberOfUnreadBits() > 0) { bitStream->Read(chunkCacheWidth); } diff --git a/src/world/entity/Entity.cpp b/src/world/entity/Entity.cpp index bfccad7..a4e77e7 100755 --- a/src/world/entity/Entity.cpp +++ b/src/world/entity/Entity.cpp @@ -871,8 +871,8 @@ bool Entity::load( CompoundTag* tag ) // Add a small padding if standing next to the world edges const float padding = bbWidth * 0.5f + 0.001f; - xx = Mth::clamp(xx, padding, (float)LEVEL_WIDTH - padding); - zz = Mth::clamp(zz, padding, (float)LEVEL_DEPTH - padding); + xx = Mth::clamp(xx, padding, (float)LevelConstants::LEVEL_WIDTH - padding); + zz = Mth::clamp(zz, padding, (float)LevelConstants::LEVEL_DEPTH - padding); xo = xOld = x = xx; yo = yOld = y = yy; diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index 96255eb..35fbd7e 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -278,8 +278,8 @@ void Level::tickTiles() { for (int i = 0; i < pollChunkOffsetsSize; i += 2) { const int xp = xx + pollChunkOffsets[i]; const int zp = zz + pollChunkOffsets[i+1]; - if (xp >= 0 && xp < CHUNK_CACHE_WIDTH && - zp >= 0 && zp < CHUNK_CACHE_WIDTH) + if (xp >= 0 && xp < LevelConstants::CHUNK_CACHE_WIDTH && + zp >= 0 && zp < LevelConstants::CHUNK_CACHE_WIDTH) _chunksToPoll.insert(ChunkPos(xp, zp)); } } @@ -428,17 +428,17 @@ bool Level::findPath(Path* path, Entity* from, int xBest, int yBest, int zBest, /*protected*/ void Level::setInitialSpawn() { isFindingSpawn = true; - int xSpawn = CHUNK_CACHE_WIDTH * CHUNK_WIDTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; + int xSpawn = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; int ySpawn = 64; - int zSpawn = CHUNK_CACHE_WIDTH * CHUNK_DEPTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; + int zSpawn = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_DEPTH / 2; // (Level.MAX_LEVEL_SIZE - 100) * 0; while (!dimension->isValidSpawn(xSpawn, zSpawn)) { xSpawn += random.nextInt(32) - random.nextInt(32); zSpawn += random.nextInt(32) - random.nextInt(32); if (xSpawn < 4) xSpawn += 32; - if (xSpawn >= LEVEL_WIDTH-4) xSpawn -= 32; + if (xSpawn >= LevelConstants::LEVEL_WIDTH-4) xSpawn -= 32; if (zSpawn < 4) zSpawn += 32; - if (zSpawn >= LEVEL_DEPTH-4) zSpawn -= 32; + if (zSpawn >= LevelConstants::LEVEL_DEPTH-4) zSpawn -= 32; } levelData.setSpawn(xSpawn, ySpawn, zSpawn); isFindingSpawn = false; @@ -456,9 +456,9 @@ void Level::validateSpawn() { zSpawn += random.nextInt(8) - random.nextInt(8); if (xSpawn < 4) xSpawn += 8; - if (xSpawn >= LEVEL_WIDTH-4) xSpawn -= 8; + if (xSpawn >= LevelConstants::LEVEL_WIDTH-4) xSpawn -= 8; if (zSpawn < 4) zSpawn += 8; - if (zSpawn >= LEVEL_DEPTH-4) zSpawn -= 8; + if (zSpawn >= LevelConstants::LEVEL_DEPTH-4) zSpawn -= 8; } levelData.setXSpawn(xSpawn); levelData.setZSpawn(zSpawn); @@ -944,7 +944,7 @@ HitResult Level::clip(const Vec3& A, const Vec3& b, bool liquid /*= false*/, boo if (solidOnly && tile != NULL && tile->getAABB(this, xTile0, yTile0, zTile0) == NULL) { // No collision } else if (t > 0 && tile->mayPick(data, liquid)) { - if(xTile0 >= 0 && zTile0 >= 0 && xTile0 < LEVEL_WIDTH && zTile0 < LEVEL_WIDTH) { + if(xTile0 >= 0 && zTile0 >= 0 && xTile0 < LevelConstants::LEVEL_WIDTH && zTile0 < LevelConstants::LEVEL_WIDTH) { HitResult r = tile->clip(this, xTile0, yTile0, zTile0, a, b); if (r.isHit()) return r; } @@ -2222,9 +2222,9 @@ void Level::setNightMode( bool isNightMode ) { } bool Level::inRange( int x, int y, int z ) { - return x >= 0 && x < LEVEL_WIDTH - && y >= 0 && y < LEVEL_HEIGHT - && z >= 0 && z < LEVEL_DEPTH; + return x >= 0 && x < LevelConstants::LEVEL_WIDTH + && y >= 0 && y < LevelConstants::LEVEL_HEIGHT + && z >= 0 && z < LevelConstants::LEVEL_DEPTH; } // diff --git a/src/world/level/Level.h b/src/world/level/Level.h index e6ea67c..082cb07 100755 --- a/src/world/level/Level.h +++ b/src/world/level/Level.h @@ -67,8 +67,8 @@ class Level: public LevelSource public: static const int MAX_LEVEL_SIZE = 32000000; - static const short DEPTH = LEVEL_HEIGHT; - static const short SEA_LEVEL = DEPTH / 2 - 1; + const short DEPTH = LevelConstants::LEVEL_HEIGHT; + const short SEA_LEVEL = DEPTH / 2 - 1; static const int MAX_BRIGHTNESS = 15; static const int TICKS_PER_DAY = SharedConstants::TicksPerSecond * 60 * 16;// SharedConstants::TicksPerSecond * 60 * 12; // ORG:20*60*20 diff --git a/src/world/level/LevelConstants.cpp b/src/world/level/LevelConstants.cpp new file mode 100644 index 0000000..864ce32 --- /dev/null +++ b/src/world/level/LevelConstants.cpp @@ -0,0 +1,7 @@ +#include "LevelConstants.h" + +int LevelConstants::LEVEL_HEIGHT = 128; +int LevelConstants::CHUNK_WIDTH = 16; // in blocks +int LevelConstants::CHUNK_DEPTH = 16; +int LevelConstants::CHUNK_COLUMNS = LevelConstants::CHUNK_WIDTH * LevelConstants::CHUNK_DEPTH; +int LevelConstants::CHUNK_BLOCK_COUNT = LevelConstants::CHUNK_COLUMNS * LevelConstants::LEVEL_HEIGHT; \ No newline at end of file diff --git a/src/world/level/LevelConstants.h b/src/world/level/LevelConstants.h index 18f3a0b..0b00053 100755 --- a/src/world/level/LevelConstants.h +++ b/src/world/level/LevelConstants.h @@ -1,10 +1,14 @@ #pragma once -const int LEVEL_HEIGHT = 128; -int CHUNK_CACHE_WIDTH = 16; // in chunks -const int CHUNK_WIDTH = 16; // in blocks -const int CHUNK_DEPTH = 16; -int LEVEL_WIDTH = CHUNK_CACHE_WIDTH * CHUNK_WIDTH; -int LEVEL_DEPTH = CHUNK_CACHE_WIDTH * CHUNK_DEPTH; -const int CHUNK_COLUMNS = CHUNK_WIDTH * CHUNK_DEPTH; -const int CHUNK_BLOCK_COUNT = CHUNK_COLUMNS * LEVEL_HEIGHT; +class LevelConstants { +public: + static int CHUNK_CACHE_WIDTH; // in chunks + static int LEVEL_WIDTH; + static int LEVEL_DEPTH; + + static int LEVEL_HEIGHT; + static int CHUNK_WIDTH; // in blocks + static int CHUNK_DEPTH; + static int CHUNK_COLUMNS; + static int CHUNK_BLOCK_COUNT; +}; \ No newline at end of file diff --git a/src/world/level/chunk/ChunkCache.h b/src/world/level/chunk/ChunkCache.h index 1401905..13f81e9 100755 --- a/src/world/level/chunk/ChunkCache.h +++ b/src/world/level/chunk/ChunkCache.h @@ -10,7 +10,7 @@ #include "../LevelConstants.h" class ChunkCache: public ChunkSource { - //static const int CHUNK_CACHE_WIDTH = CHUNK_CACHE_WIDTH; // WAS 32; + //static const int LevelConstants::CHUNK_CACHE_WIDTH = LevelConstants::CHUNK_CACHE_WIDTH; // WAS 32; static const int MAX_SAVES = 2; public: ChunkCache(Level* level_, ChunkStorage* storage_, ChunkSource* source_) @@ -25,14 +25,14 @@ public: //emptyChunk = new EmptyLevelChunk(level_, emptyChunkBlocks, 0, 0); emptyChunk = new EmptyLevelChunk(level_, NULL, 0, 0); - chunks = (LevelChunk *)malloc(CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH); + chunks = (LevelChunk *)malloc(LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH); } ~ChunkCache() { delete source; delete emptyChunk; - for (int i = 0; i < CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; i++) + for (int i = 0; i < LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; i++) { if (&chunks[i]) { @@ -43,7 +43,7 @@ public: } bool fits(int x, int z) { - return (x >= 0 && z >= 0 && x < CHUNK_CACHE_WIDTH && z < CHUNK_CACHE_WIDTH); + return (x >= 0 && z >= 0 && x < LevelConstants::CHUNK_CACHE_WIDTH && z < LevelConstants::CHUNK_CACHE_WIDTH); } bool hasChunk(int x, int z) { @@ -53,9 +53,9 @@ public: if (x == xLast && z == zLast && last != NULL) { return true; } - int xs = x & (CHUNK_CACHE_WIDTH - 1); - int zs = z & (CHUNK_CACHE_WIDTH - 1); - int slot = xs + zs * CHUNK_CACHE_WIDTH; + int xs = x & (LevelConstants::CHUNK_CACHE_WIDTH - 1); + int zs = z & (LevelConstants::CHUNK_CACHE_WIDTH - 1); + int slot = xs + zs * LevelConstants::CHUNK_CACHE_WIDTH; return &chunks[slot] != NULL && (&chunks[slot] == emptyChunk || chunks[slot].isAt(x, z)); } @@ -72,9 +72,9 @@ public: } if (!fits(x, z)) return emptyChunk; //if (!level->isFindingSpawn && !fits(x, z)) return emptyChunk; - int xs = x & (CHUNK_CACHE_WIDTH - 1); - int zs = z & (CHUNK_CACHE_WIDTH - 1); - int slot = xs + zs * CHUNK_CACHE_WIDTH; + int xs = x & (LevelConstants::CHUNK_CACHE_WIDTH - 1); + int zs = z & (LevelConstants::CHUNK_CACHE_WIDTH - 1); + int slot = xs + zs * LevelConstants::CHUNK_CACHE_WIDTH; if (!hasChunk(x, z)) { if (&chunks[slot] != NULL) { chunks[slot].unload(); @@ -200,8 +200,8 @@ public: void saveAll(bool onlyUnsaved) { if (storage != NULL) { std::vector chunks; - for (int z = 0; z < CHUNK_CACHE_WIDTH; ++z) - for (int x = 0; x < CHUNK_CACHE_WIDTH; ++x) { + for (int z = 0; z < LevelConstants::CHUNK_CACHE_WIDTH; ++z) + for (int x = 0; x < LevelConstants::CHUNK_CACHE_WIDTH; ++x) { LevelChunk* chunk = level->getChunk(x, z); if (!onlyUnsaved || chunk->shouldSave(false)) chunks.push_back( chunk ); @@ -212,7 +212,7 @@ public: private: LevelChunk* load(int x, int z) { if (storage == NULL) return emptyChunk; - if (x < 0 || x >= CHUNK_CACHE_WIDTH || z < 0 || z >= CHUNK_CACHE_WIDTH) + if (x < 0 || x >= LevelConstants::CHUNK_CACHE_WIDTH || z < 0 || z >= LevelConstants::CHUNK_CACHE_WIDTH) { return emptyChunk; } diff --git a/src/world/level/chunk/LevelChunk.cpp b/src/world/level/chunk/LevelChunk.cpp index bb373fb..2710f21 100755 --- a/src/world/level/chunk/LevelChunk.cpp +++ b/src/world/level/chunk/LevelChunk.cpp @@ -17,8 +17,8 @@ LevelChunk::LevelChunk( Level* level, int x, int z ) : level(level), x(x), z(z), - xt(x * CHUNK_WIDTH), - zt(z * CHUNK_DEPTH) + xt(x * LevelConstants::CHUNK_WIDTH), + zt(z * LevelConstants::CHUNK_DEPTH) { init(); } @@ -27,8 +27,8 @@ LevelChunk::LevelChunk( Level* level, unsigned char* blocks, int x, int z ) : level(level), x(x), z(z), - xt(x * CHUNK_WIDTH), - zt(z * CHUNK_DEPTH), + xt(x * LevelConstants::CHUNK_WIDTH), + zt(z * LevelConstants::CHUNK_DEPTH), blocks(blocks), data(ChunkBlockCount), skyLight(ChunkBlockCount), @@ -45,6 +45,9 @@ LevelChunk::~LevelChunk() void LevelChunk::init() { + heightmap = (char*)malloc(LevelConstants::CHUNK_COLUMNS * sizeof(char)); + updateMap = (unsigned char*)malloc(LevelConstants::CHUNK_COLUMNS * sizeof(unsigned char)); + terrainPopulated = false; dontSave = false; unsaved = false; diff --git a/src/world/level/chunk/LevelChunk.h b/src/world/level/chunk/LevelChunk.h index c06819e..0ab8d68 100755 --- a/src/world/level/chunk/LevelChunk.h +++ b/src/world/level/chunk/LevelChunk.h @@ -106,9 +106,9 @@ private: void recalcHeight(int x, int yStart, int z); public: static bool touchedSky; - static const int ChunkBlockCount = CHUNK_BLOCK_COUNT; - static const int ChunkSize = ChunkBlockCount; - static const int UpdateMapBitShift = 4; // power of (LEVEL_HEIGHT / 8) == 16 + const int ChunkBlockCount = LevelConstants::CHUNK_BLOCK_COUNT; + const int ChunkSize = ChunkBlockCount; + static const int UpdateMapBitShift = 4; // power of (LevelConstants::LEVEL_HEIGHT / 8) == 16 int blocksLength; // ? needed or not? (i.e. are all chunks the same size?) @@ -118,8 +118,8 @@ public: DataLayer skyLight; DataLayer blockLight; - char heightmap[CHUNK_COLUMNS]; - unsigned char updateMap[CHUNK_COLUMNS]; // marks regions within block columns that have been modified + char* heightmap; // [LevelConstants::CHUNK_COLUMNS] + unsigned char* updateMap; // marks regions within block columns that have been modified [LevelConstants::CHUNK_COLUMNS] int minHeight; int x, z; diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 7ef40e3..da94dd3 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -64,7 +64,7 @@ RandomLevelSource::~RandomLevelSource() { /*public*/ void RandomLevelSource::prepareHeights(int xOffs, int zOffs, unsigned char* blocks, /*Biome*/void* biomes, float* temperatures) { - int xChunks = 16 / CHUNK_WIDTH; + int xChunks = 16 / LevelConstants::CHUNK_WIDTH; int waterHeight = Level::DEPTH - 64; int xSize = xChunks + 1; @@ -87,23 +87,23 @@ void RandomLevelSource::prepareHeights(int xOffs, int zOffs, unsigned char* bloc float s3a = (buffer[((xc + 1) * zSize + (zc + 1)) * ySize + (yc + 1)] - s3) * yStep; for (int y = 0; y < CHUNK_HEIGHT; y++) { - float xStep = 1 / (float) CHUNK_WIDTH; + float xStep = 1 / (float) LevelConstants::CHUNK_WIDTH; float _s0 = s0; float _s1 = s1; float _s0a = (s2 - s0) * xStep; float _s1a = (s3 - s1) * xStep; - for (int x = 0; x < CHUNK_WIDTH; x++) { - int offs = (x + xc * CHUNK_WIDTH) << 11 | (0 + zc * CHUNK_WIDTH) << 7 | (yc * CHUNK_HEIGHT + y); + for (int x = 0; x < LevelConstants::CHUNK_WIDTH; x++) { + int offs = (x + xc * LevelConstants::CHUNK_WIDTH) << 11 | (0 + zc * LevelConstants::CHUNK_WIDTH) << 7 | (yc * CHUNK_HEIGHT + y); int step = 1 << 7; - float zStep = 1 / (float) CHUNK_WIDTH; + float zStep = 1 / (float) LevelConstants::CHUNK_WIDTH; float val = _s0; float vala = (_s1 - _s0) * zStep; - for (int z = 0; z < CHUNK_WIDTH; z++) { -// + (zc * CHUNK_WIDTH + z)]; - float temp = temperatures[(xc * CHUNK_WIDTH + x) * 16 + (zc * CHUNK_WIDTH + z)]; + for (int z = 0; z < LevelConstants::CHUNK_WIDTH; z++) { +// + (zc * LevelConstants::CHUNK_WIDTH + z)]; + float temp = temperatures[(xc * LevelConstants::CHUNK_WIDTH + x) * 16 + (zc * LevelConstants::CHUNK_WIDTH + z)]; int tileId = 0; if (yc * CHUNK_HEIGHT + y < waterHeight) { if (temp < SNOW_CUTOFF && yc * CHUNK_HEIGHT + y >= waterHeight - 1) { diff --git a/src/world/level/storage/ExternalFileLevelStorage.cpp b/src/world/level/storage/ExternalFileLevelStorage.cpp index 03cca08..93ee9f1 100755 --- a/src/world/level/storage/ExternalFileLevelStorage.cpp +++ b/src/world/level/storage/ExternalFileLevelStorage.cpp @@ -343,8 +343,8 @@ bool ExternalFileLevelStorage::readPlayerData(const std::string& filename, Level Vec3& pos = dest.playerData.pos; if (pos.x < 0.5f) pos.x = 0.5f; if (pos.z < 0.5f) pos.z = 0.5f; - if (pos.x > (LEVEL_WIDTH - 0.5f)) pos.x = LEVEL_WIDTH - 0.5f; - if (pos.z > (LEVEL_DEPTH - 0.5f)) pos.z = LEVEL_DEPTH - 0.5f; + if (pos.x > (LevelConstants::LEVEL_WIDTH - 0.5f)) pos.x = LevelConstants::LEVEL_WIDTH - 0.5f; + if (pos.z > (LevelConstants::LEVEL_DEPTH - 0.5f)) pos.z = LevelConstants::LEVEL_DEPTH - 0.5f; if (pos.y < 0) pos.y = 64; dest.playerDataVersion = version; @@ -362,14 +362,14 @@ void ExternalFileLevelStorage::tick() LOGI("Saving level...\n"); // look for chunks that needs to be saved - for (int z = 0; z < CHUNK_CACHE_WIDTH; z++) + for (int z = 0; z < LevelConstants::CHUNK_CACHE_WIDTH; z++) { - for (int x = 0; x < CHUNK_CACHE_WIDTH; x++) + for (int x = 0; x < LevelConstants::CHUNK_CACHE_WIDTH; x++) { LevelChunk* chunk = level->getChunk(x, z); if (chunk && chunk->unsaved) { - int pos = x + z * CHUNK_CACHE_WIDTH; + int pos = x + z * LevelConstants::CHUNK_CACHE_WIDTH; UnsavedChunkList::iterator prev = unsavedChunkList.begin(); for ( ; prev != unsavedChunkList.end(); ++prev) { @@ -415,13 +415,13 @@ void ExternalFileLevelStorage::save(Level* level, LevelChunk* levelChunk) // Write chunk RakNet::BitStream chunkData; - chunkData.Write((const char*)levelChunk->getBlockData(), CHUNK_BLOCK_COUNT); - chunkData.Write((const char*)levelChunk->data.data, CHUNK_BLOCK_COUNT / 2); + chunkData.Write((const char*)levelChunk->getBlockData(), LevelConstants::CHUNK_BLOCK_COUNT); + chunkData.Write((const char*)levelChunk->data.data, LevelConstants::CHUNK_BLOCK_COUNT / 2); - chunkData.Write((const char*)levelChunk->skyLight.data, CHUNK_BLOCK_COUNT / 2); - chunkData.Write((const char*)levelChunk->blockLight.data, CHUNK_BLOCK_COUNT / 2); + chunkData.Write((const char*)levelChunk->skyLight.data, LevelConstants::CHUNK_BLOCK_COUNT / 2); + chunkData.Write((const char*)levelChunk->blockLight.data, LevelConstants::CHUNK_BLOCK_COUNT / 2); - chunkData.Write((const char*)levelChunk->updateMap, CHUNK_COLUMNS); + chunkData.Write((const char*)levelChunk->updateMap, LevelConstants::CHUNK_COLUMNS); regionFile->writeChunk(levelChunk->x, levelChunk->z, chunkData); @@ -453,16 +453,16 @@ LevelChunk* ExternalFileLevelStorage::load(Level* level, int x, int z) chunkData->ResetReadPointer(); - unsigned char* blockIds = new unsigned char[CHUNK_BLOCK_COUNT]; - chunkData->Read((char*)blockIds, CHUNK_BLOCK_COUNT); + unsigned char* blockIds = new unsigned char[LevelConstants::CHUNK_BLOCK_COUNT]; + chunkData->Read((char*)blockIds, LevelConstants::CHUNK_BLOCK_COUNT); LevelChunk* levelChunk = new LevelChunk(level, blockIds, x, z); - chunkData->Read((char*)levelChunk->data.data, CHUNK_BLOCK_COUNT / 2); + chunkData->Read((char*)levelChunk->data.data, LevelConstants::CHUNK_BLOCK_COUNT / 2); if (loadedStorageVersion >= ChunkVersion_Light) { - chunkData->Read((char*)levelChunk->skyLight.data, CHUNK_BLOCK_COUNT / 2); - chunkData->Read((char*)levelChunk->blockLight.data, CHUNK_BLOCK_COUNT / 2); + chunkData->Read((char*)levelChunk->skyLight.data, LevelConstants::CHUNK_BLOCK_COUNT / 2); + chunkData->Read((char*)levelChunk->blockLight.data, LevelConstants::CHUNK_BLOCK_COUNT / 2); } - chunkData->Read((char*)levelChunk->updateMap, CHUNK_COLUMNS); + chunkData->Read((char*)levelChunk->updateMap, LevelConstants::CHUNK_COLUMNS); // This will be difficult to maintain.. Storage version could be per chunk // too (but probably better to just read all -> write all, so that all // chunks got same version anyway) @@ -485,7 +485,7 @@ LevelChunk* ExternalFileLevelStorage::load(Level* level, int x, int z) //bool dbg = (x == 7 && z == 9); //int t = 0; - //for (int i = 0; i < CHUNK_COLUMNS; ++i) { + //for (int i = 0; i < LevelConstants::CHUNK_COLUMNS; ++i) { // char bits = levelChunk->updateMap[i]; // t += (bits != 0); // int xx = x * 16 + i%16; diff --git a/src/world/level/tile/Mushroom.cpp b/src/world/level/tile/Mushroom.cpp index 6de05ce..2992405 100755 --- a/src/world/level/tile/Mushroom.cpp +++ b/src/world/level/tile/Mushroom.cpp @@ -47,7 +47,7 @@ bool Mushroom::mayPlaceOn( int tile ) { } bool Mushroom::canSurvive( Level* level, int x, int y, int z ) { - if (y < 0 || y >= LEVEL_HEIGHT/*Level::maxBuildHeight*/) + if (y < 0 || y >= LevelConstants::LEVEL_HEIGHT/*Level::maxBuildHeight*/) return false; int below = level->getTile(x, y - 1, z); diff --git a/src/world/level/tile/NetherReactor.cpp b/src/world/level/tile/NetherReactor.cpp index 04404eb..00849b9 100755 --- a/src/world/level/tile/NetherReactor.cpp +++ b/src/world/level/tile/NetherReactor.cpp @@ -53,7 +53,7 @@ bool NetherReactor::canSpawnStartNetherReactor( Level* level, int x, int y, int if(!allPlayersCloseToReactor(level, x, y, z)) { player->displayClientMessage("All players need to be close to the reactor."); return false; - } else if(y > LEVEL_HEIGHT - 28) { + } else if(y > LevelConstants::LEVEL_HEIGHT - 28) { player->displayClientMessage("The nether reactor needs to be built lower down."); return false; } else if(y < 2) { diff --git a/src/world/level/tile/entity/NetherReactorTileEntity.cpp b/src/world/level/tile/entity/NetherReactorTileEntity.cpp index f55c12d..5b4728a 100755 --- a/src/world/level/tile/entity/NetherReactorTileEntity.cpp +++ b/src/world/level/tile/entity/NetherReactorTileEntity.cpp @@ -130,7 +130,7 @@ Vec3 NetherReactorTileEntity::getSpawnPosition( float minDistance, float varible void NetherReactorTileEntity::spawnEnemy() { Mob* mob = MobFactory::CreateMob(MobTypes::PigZombie, level); Vec3 enemyPosition = getSpawnPosition(3, 4, -1); - while(enemyPosition.x < 0 || enemyPosition.z < 0 || enemyPosition.x >= LEVEL_WIDTH || enemyPosition.z >= LEVEL_DEPTH) { + while(enemyPosition.x < 0 || enemyPosition.z < 0 || enemyPosition.x >= LevelConstants::LEVEL_WIDTH || enemyPosition.z >= LevelConstants::LEVEL_DEPTH) { enemyPosition = getSpawnPosition(3, 4, -1); } MobSpawner::addMob(level, mob, enemyPosition.x, enemyPosition.y, enemyPosition.z, 0, 0, true); @@ -140,7 +140,7 @@ void NetherReactorTileEntity::spawnEnemy() { void NetherReactorTileEntity::spawnItem() { Vec3 itemPosition= getSpawnPosition(3, 4, -1); - while(itemPosition.x < 0 || itemPosition.z < 0 || itemPosition.x >= LEVEL_WIDTH || itemPosition.z >= LEVEL_DEPTH) { + while(itemPosition.x < 0 || itemPosition.z < 0 || itemPosition.x >= LevelConstants::LEVEL_WIDTH || itemPosition.z >= LevelConstants::LEVEL_DEPTH) { itemPosition = getSpawnPosition(3, 4, -1); } ItemEntity* item = new ItemEntity(level, itemPosition.x, itemPosition.y, itemPosition.z, getSpawnItem()); From 3e48c7fabd69ddd098b719d4726678e7ad67fedf Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 2 May 2026 21:31:48 +0300 Subject: [PATCH 108/189] FIX: compilation --- src/network/ClientSideNetworkHandler.cpp | 7 ++++-- src/world/level/Level.cpp | 3 +++ src/world/level/Level.h | 4 ++-- src/world/level/LevelConstants.cpp | 3 +++ src/world/level/LevelConstants.h | 2 +- src/world/level/chunk/ChunkCache.h | 30 ++++++++++++------------ src/world/level/chunk/LevelChunk.cpp | 5 ++-- src/world/level/chunk/LevelChunk.h | 2 +- 8 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index c1515f7..f988fdd 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -560,8 +560,8 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChunkDat int rx = packet->x << 4; int rz = packet->z << 4; - unsigned char readBlockBuffer[setSize]; - unsigned char readDataBuffer[setSize / 2]; + unsigned char* readBlockBuffer = new unsigned char[setSize]; + unsigned char* readDataBuffer = new unsigned char[setSize / 2]; for (int i = 0; i < LevelConstants::CHUNK_COLUMNS; i++) { @@ -631,6 +631,9 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChunkDat } } + delete[] readBlockBuffer; + delete[] readDataBuffer; + if (recalcHeight) { // chunk->recalcHeightmap(); diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index 35fbd7e..cb6d688 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -29,6 +29,9 @@ #include "../Difficulty.h" #include "../../network/packet/ExplodePacket.h" +const int Level::DEPTH = LevelConstants::LEVEL_HEIGHT; +const int Level::SEA_LEVEL = Level::DEPTH / 2 - 1; + Level::Level(LevelStorage* levelStorage, const std::string& levelName, const LevelSettings& settings, int generatorVersion, Dimension* fixedDimension /* = NULL */) : levelStorage(levelStorage), isClientSide(false), diff --git a/src/world/level/Level.h b/src/world/level/Level.h index 082cb07..edf1747 100755 --- a/src/world/level/Level.h +++ b/src/world/level/Level.h @@ -67,8 +67,8 @@ class Level: public LevelSource public: static const int MAX_LEVEL_SIZE = 32000000; - const short DEPTH = LevelConstants::LEVEL_HEIGHT; - const short SEA_LEVEL = DEPTH / 2 - 1; + static const int DEPTH; + static const int SEA_LEVEL; static const int MAX_BRIGHTNESS = 15; static const int TICKS_PER_DAY = SharedConstants::TicksPerSecond * 60 * 16;// SharedConstants::TicksPerSecond * 60 * 12; // ORG:20*60*20 diff --git a/src/world/level/LevelConstants.cpp b/src/world/level/LevelConstants.cpp index 864ce32..6a36246 100644 --- a/src/world/level/LevelConstants.cpp +++ b/src/world/level/LevelConstants.cpp @@ -1,7 +1,10 @@ #include "LevelConstants.h" int LevelConstants::LEVEL_HEIGHT = 128; +int LevelConstants::CHUNK_CACHE_WIDTH = 16; // in chunks int LevelConstants::CHUNK_WIDTH = 16; // in blocks int LevelConstants::CHUNK_DEPTH = 16; +int LevelConstants::LEVEL_WIDTH = LevelConstants::CHUNK_CACHE_WIDTH * CHUNK_WIDTH; +int LevelConstants::LEVEL_DEPTH = LevelConstants::CHUNK_CACHE_WIDTH * CHUNK_DEPTH; int LevelConstants::CHUNK_COLUMNS = LevelConstants::CHUNK_WIDTH * LevelConstants::CHUNK_DEPTH; int LevelConstants::CHUNK_BLOCK_COUNT = LevelConstants::CHUNK_COLUMNS * LevelConstants::LEVEL_HEIGHT; \ No newline at end of file diff --git a/src/world/level/LevelConstants.h b/src/world/level/LevelConstants.h index 0b00053..ed77861 100755 --- a/src/world/level/LevelConstants.h +++ b/src/world/level/LevelConstants.h @@ -5,8 +5,8 @@ public: static int CHUNK_CACHE_WIDTH; // in chunks static int LEVEL_WIDTH; static int LEVEL_DEPTH; - static int LEVEL_HEIGHT; + static int CHUNK_WIDTH; // in blocks static int CHUNK_DEPTH; static int CHUNK_COLUMNS; diff --git a/src/world/level/chunk/ChunkCache.h b/src/world/level/chunk/ChunkCache.h index 13f81e9..ee5fc49 100755 --- a/src/world/level/chunk/ChunkCache.h +++ b/src/world/level/chunk/ChunkCache.h @@ -25,7 +25,7 @@ public: //emptyChunk = new EmptyLevelChunk(level_, emptyChunkBlocks, 0, 0); emptyChunk = new EmptyLevelChunk(level_, NULL, 0, 0); - chunks = (LevelChunk *)malloc(LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH); + chunks = new LevelChunk *[LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH]; } ~ChunkCache() { @@ -36,8 +36,8 @@ public: { if (&chunks[i]) { - chunks[i].deleteBlockData(); - delete &chunks[i]; + chunks[i]->deleteBlockData(); + delete chunks[i]; } } } @@ -56,7 +56,7 @@ public: int xs = x & (LevelConstants::CHUNK_CACHE_WIDTH - 1); int zs = z & (LevelConstants::CHUNK_CACHE_WIDTH - 1); int slot = xs + zs * LevelConstants::CHUNK_CACHE_WIDTH; - return &chunks[slot] != NULL && (&chunks[slot] == emptyChunk || chunks[slot].isAt(x, z)); + return chunks[slot] != NULL && (chunks[slot] == emptyChunk || chunks[slot]->isAt(x, z)); } LevelChunk* create(int x, int z) { @@ -76,10 +76,10 @@ public: int zs = z & (LevelConstants::CHUNK_CACHE_WIDTH - 1); int slot = xs + zs * LevelConstants::CHUNK_CACHE_WIDTH; if (!hasChunk(x, z)) { - if (&chunks[slot] != NULL) { - chunks[slot].unload(); - save(&chunks[slot]); - saveEntities(&chunks[slot]); + if (chunks[slot] != NULL) { + chunks[slot]->unload(); + save(chunks[slot]); + saveEntities(chunks[slot]); } LevelChunk* newChunk = load(x, z); @@ -94,7 +94,7 @@ public: //return emptyChunk; updateLights = true; } - chunks[slot] = *newChunk; + chunks[slot] = newChunk; newChunk->lightLava(); if (updateLights) @@ -115,23 +115,23 @@ public: //level->updateLight(LightLayer::Block, x * 16, 0, z * 16, x * 16 + 15, 128, z * 16 + 15); } - if (&chunks[slot] != NULL) { - chunks[slot].load(); + if (chunks[slot] != NULL) { + chunks[slot]->load(); } - if (!chunks[slot].terrainPopulated && hasChunk(x + 1, z + 1) && hasChunk(x, z + 1) && hasChunk(x + 1, z)) postProcess(this, x, z); + if (!chunks[slot]->terrainPopulated && hasChunk(x + 1, z + 1) && hasChunk(x, z + 1) && hasChunk(x + 1, z)) postProcess(this, x, z); if (hasChunk(x - 1, z) && !getChunk(x - 1, z)->terrainPopulated && hasChunk(x - 1, z + 1) && hasChunk(x, z + 1) && hasChunk(x - 1, z)) postProcess(this, x - 1, z); if (hasChunk(x, z - 1) && !getChunk(x, z - 1)->terrainPopulated && hasChunk(x + 1, z - 1) && hasChunk(x, z - 1) && hasChunk(x + 1, z)) postProcess(this, x, z - 1); if (hasChunk(x - 1, z - 1) && !getChunk(x - 1, z - 1)->terrainPopulated && hasChunk(x - 1, z - 1) && hasChunk(x, z - 1) && hasChunk(x - 1, z)) postProcess(this, x - 1, z - 1); } xLast = x; zLast = z; - last = &chunks[slot]; + last = chunks[slot]; //sw.stop(); //sw.printEvery(500000, "ChunkCache::load: "); - return &chunks[slot]; + return chunks[slot]; } Biome::MobList getMobsAt(const MobCategory& mobCategory, int x, int y, int z) { @@ -255,7 +255,7 @@ private: LevelChunk* emptyChunk; ChunkSource* source; ChunkStorage* storage; - LevelChunk* chunks; + LevelChunk** chunks; Level* level; LevelChunk* last; diff --git a/src/world/level/chunk/LevelChunk.cpp b/src/world/level/chunk/LevelChunk.cpp index 2710f21..5cf3ae6 100755 --- a/src/world/level/chunk/LevelChunk.cpp +++ b/src/world/level/chunk/LevelChunk.cpp @@ -12,6 +12,7 @@ /*static*/ bool LevelChunk::touchedSky = false; +const int LevelChunk::ChunkBlockCount = LevelConstants::CHUNK_BLOCK_COUNT; LevelChunk::LevelChunk( Level* level, int x, int z ) : level(level), @@ -45,8 +46,8 @@ LevelChunk::~LevelChunk() void LevelChunk::init() { - heightmap = (char*)malloc(LevelConstants::CHUNK_COLUMNS * sizeof(char)); - updateMap = (unsigned char*)malloc(LevelConstants::CHUNK_COLUMNS * sizeof(unsigned char)); + heightmap = new char[LevelConstants::CHUNK_COLUMNS]; + updateMap = new unsigned char[LevelConstants::CHUNK_COLUMNS]; terrainPopulated = false; dontSave = false; diff --git a/src/world/level/chunk/LevelChunk.h b/src/world/level/chunk/LevelChunk.h index 0ab8d68..b88cb7a 100755 --- a/src/world/level/chunk/LevelChunk.h +++ b/src/world/level/chunk/LevelChunk.h @@ -106,7 +106,7 @@ private: void recalcHeight(int x, int yStart, int z); public: static bool touchedSky; - const int ChunkBlockCount = LevelConstants::CHUNK_BLOCK_COUNT; + static const int ChunkBlockCount; const int ChunkSize = ChunkBlockCount; static const int UpdateMapBitShift = 4; // power of (LevelConstants::LEVEL_HEIGHT / 8) == 16 From e346df682c29996f216e4c5ea6dde2147706eb82 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 4 May 2026 01:28:27 +0500 Subject: [PATCH 109/189] Another Huge Commit my bad - shredder Restored Java's Debug Screen using partial unused code and ported code, avaliable in options menu as a style Slight Water texture is now overlayed when in water Vignette function has been fixed and can now be toggled in options World Generation now includes Tall Grass and Ferns both Broken Frame Chart Graph found in the source has now been fixed and enabled when debug screen is turned on Pie Chart works now and will appear when debug screen is opened Most changes have not been tested on anything besides windows, will test it --- data/lang/en_US.lang | 12 ++++ src/client/Minecraft.cpp | 47 +++++++++++++--- src/client/Minecraft.h | 8 +++ src/client/Options.cpp | 12 ++++ src/client/Options.h | 3 + src/client/gui/Gui.cpp | 56 +++++++++++++++---- src/client/gui/components/OptionsItem.cpp | 12 +++- src/client/gui/screens/OptionsScreen.cpp | 7 ++- src/client/renderer/GameRenderer.cpp | 4 +- src/client/renderer/ItemInHandRenderer.cpp | 8 +-- src/client/renderer/LevelRenderer.cpp | 14 +++-- src/client/renderer/LevelRenderer.h | 1 + src/util/PerfRenderer.cpp | 11 ++-- src/util/PerfTimer.h | 12 ++-- src/world/level/Level.cpp | 14 ++--- src/world/level/Level.h | 3 + src/world/level/chunk/ChunkCache.h | 3 +- src/world/level/dimension/Dimension.cpp | 29 ++++++---- src/world/level/dimension/Dimension.h | 2 +- .../level/levelgen/RandomLevelSource.cpp | 54 ++++++++++++++---- .../level/levelgen/feature/FeatureInclude.h | 1 + src/world/level/tile/TallGrass.cpp | 10 +++- 22 files changed, 247 insertions(+), 76 deletions(-) diff --git a/data/lang/en_US.lang b/data/lang/en_US.lang index 46866c8..b7c2ca9 100755 --- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -161,6 +161,18 @@ options.fogType.vanilla=Vanilla options.fogType.java=Beta Java options.fogType.unused=Unused +options.debugStyle=Debug Menu Style +options.debugStyle.javaBeta=Java Beta +options.debugStyle.custom=Custom + +options.beautifulSky=Beautiful Skies + +options.useVignette=Vignette Overlay + +options.tintedSide=Tint Grass Sides + +options.betaSky=Java Beta Sky + options.restoredAnims=Restored Animations options.normalLighting=Java Beta/Normals Shading diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 2a05eb2..c58b957 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -8,6 +8,7 @@ #include #include + #if defined(APPLE_DEMO_PROMOTION) #define NO_NETWORK #endif @@ -475,19 +476,20 @@ void Minecraft::update() { #ifndef STANDALONE_SERVER Multitouch::resetThisUpdate(); #endif - TIMER_POP(); + #ifndef STANDALONE_SERVER + TIMER_POP(); checkGlError("Update finished"); if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { -#ifndef PLATFORM_DESKTOP +//#ifndef PLATFORM_DESKTOP if (!PerfTimer::enabled) { PerfTimer::reset(); PerfTimer::enabled = true; } _perfRenderer->renderFpsMeter(1); checkGlError("render debug"); -#endif +//#endif } else { PerfTimer::enabled = false; } @@ -829,6 +831,12 @@ void Minecraft::tickInput() { } #endif + if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { + if (key >= '0' && key <= '9') { + _perfRenderer->debugFpsMeterKeyPress(key - '0'); + } + } + if (key == Keyboard::KEY_ESCAPE) pauseGame(false); @@ -840,6 +848,12 @@ void Minecraft::tickInput() { //glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL); } #endif + if (key == Keyboard::KEY_P) { + static bool isWireFrame = false; + isWireFrame = !isWireFrame; + glPolygonMode(GL_FRONT, isWireFrame? GL_LINE : GL_FILL); + //glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL); + } } #ifdef WIN32 if (key == Keyboard::KEY_M) { @@ -1410,10 +1424,10 @@ void Minecraft::_levelGenerated() player->resetPos(false); } - if (level && level->dimension) { - // For example, if you want FogType or any other option - level->dimension->FogType = options.getIntValue(OPTIONS_FOG_TYPE); - } + if (level && level->dimension) { + + level->dimension->FogType = options.getIntValue(OPTIONS_FOG_TYPE); + } this->cameraTargetPlayer = player; @@ -1441,6 +1455,25 @@ void Minecraft::_levelGenerated() _hasSignaledGeneratingLevelFinished = true; } +std::string Minecraft::gatherStats1() { + return levelRenderer->gatherStats1(); +} + +std::string Minecraft::gatherStats2() { + return levelRenderer->gatherStats2(); +} + +std::string Minecraft::gatherStats3() { + return ("P: " + particleEngine->countParticles() + ". T: " + (level->gatherStats())); +} + +std::string Minecraft::gatherStats4() { + return level->gatherChunkSourceStats(); +} + + + + Player* Minecraft::respawnPlayer(int playerId) { for (unsigned int i = 0; i < level->players.size(); ++i) { if (level->players[i]->entityId == playerId) { diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index 22b7ec7..72d3be7 100755 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -87,6 +87,14 @@ public: void update(); + std::string gatherStats1(); + + std::string gatherStats2(); + + std::string gatherStats4(); + + std::string gatherStats3(); + void tick(int nTick, int maxTick); void tickInput(); diff --git a/src/client/Options.cpp b/src/client/Options.cpp index ee9aced..5a438eb 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -58,6 +58,10 @@ OptionBool ambientOcclusion("ao", true); OptionBool useNormalLighting("normalLighting", true); +OptionBool beautifulSky("beautifulSky", true); + +OptionBool useVignette("useVignette", true); + OptionBool useTouchscreen("useTouchscreen", true); OptionBool serverVisible("servervisible", true); @@ -76,6 +80,8 @@ OptionBool blockOutline("blockOutline", false); OptionBool restoredAnims("restoredAnims", true); +OptionInt debugStyle("debugStyle", 0, 0, 1); + OptionInt keyForward("key.forward", Keyboard::KEY_W); OptionInt keyLeft("key.left", Keyboard::KEY_A); OptionInt keyBack("key.back", Keyboard::KEY_S); @@ -154,6 +160,10 @@ void Options::initTable() { m_options[OPTIONS_BLOCK_OUTLINE] = &blockOutline; + m_options[OPTIONS_VIGNETTE] = &useVignette; + + m_options[OPTIONS_BEAUTIFUL_SKY] = &beautifulSky; + m_options[OPTIONS_NORMAL_LIGHTING] = &useNormalLighting; m_options[OPTIONS_RESTORED_ANIMS] = &restoredAnims; @@ -187,6 +197,8 @@ void Options::initTable() { // more options yay m_options[OPTIONS_FOG_TYPE] = &fogType; + m_options[OPTIONS_DEBUG_STYLE] = &debugStyle; + m_options[OPTIONS_BETA_SKY] = &betaSky; m_options[OPTIONS_TINTED_SIDE] = &tintedSide; diff --git a/src/client/Options.h b/src/client/Options.h index 826bfb3..90aea6c 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -92,6 +92,9 @@ enum OptionId { OPTIONS_RESTORED_ANIMS, OPTIONS_TINTED_SIDE, OPTIONS_BETA_SKY, + OPTIONS_BEAUTIFUL_SKY, + OPTIONS_VIGNETTE, + OPTIONS_DEBUG_STYLE, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index c9f63ea..51058a7 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -7,6 +7,7 @@ #include "screens/ConsoleScreen.h" #include "../Minecraft.h" #include "../player/LocalPlayer.h" +#include "../renderer/Chunk.h" #include "../renderer/Tesselator.h" #include "../renderer/TileRenderer.h" #include "../renderer/LevelRenderer.h" @@ -103,10 +104,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { } } - // @todo - Shredder: I added this here but currently viginette is broken so i cant do much about it. - // if (minecraft->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)){ - // this->renderVignette(this->minecraft->player->getBrightness(a), screenWidth, screenHeight); - // } + // viginette has been fixed, was due to gl_blend not being enabled, my bad + if (minecraft->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS) && minecraft->options.getBooleanValue(OPTIONS_VIGNETTE)){ + renderVignette(this->minecraft->player->getBrightness(a), screenWidth, screenHeight); + } // shredder end if(minecraft->player->getSleepTimer() > 0) { @@ -121,7 +122,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { if (!minecraft->options.getBooleanValue(OPTIONS_HIDEGUI)) { renderToolBar(a, ySlot, screenWidth); - font->drawShadow("Minecraft - Pocket Edition ", 2, 2, 0xffffffff); + // font->drawShadow("Minecraft - Pocket Edition ", 2, 2, 0xffffffff); // font->drawShadow("This is a demo, not the finished product", 2, 10 + 2, 0xffffffff); glEnable(GL_BLEND); @@ -363,6 +364,7 @@ void Gui::renderVignette(float br, int w, int h) { glDisable(GL_DEPTH_TEST); glDepthMask(false); + glEnable(GL_BLEND); glBlendFunc2(GL_ZERO, GL_ONE_MINUS_SRC_COLOR); glColor4f2(tbr, tbr, tbr, 1); @@ -379,6 +381,7 @@ void Gui::renderVignette(float br, int w, int h) { t.draw(); glDepthMask(true); glEnable(GL_DEPTH_TEST); + glDisable(GL_BLEND); glColor4f2(1, 1, 1, 1); glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } @@ -729,13 +732,20 @@ void Gui::onLevelGenerated() { void Gui::renderDebugInfo() { // FPS counter (updates once per second) - static float fps = 0.0f; - static float fpsLastTime = 0.0f; + static int fps = 0; + static int fpsLastTime = 0; static int fpsFrames = 0; + static int displayChunkUpdates = 0; float now = getTimeS(); fpsFrames++; - if (now - fpsLastTime >= 1.0f) { + if (now - fpsLastTime >= 1) { fps = fpsFrames / (now - fpsLastTime); + + displayChunkUpdates = Chunk::updates; + + // 3. RESET the actual game counter to 0 for the next second + Chunk::updates = 0; + fpsFrames = 0; fpsLastTime = now; } @@ -773,6 +783,31 @@ void Gui::renderDebugInfo() { long seed = lvl ? lvl->getSeed() : 0; // Build lines (NULL entry = blank gap) + Font* font = minecraft->font; + + // @todo - add our own debug screen as an option alongside the restored java one, why does renderdebug have to be so jank - shredder + + // if java beta's restored debug menu is enabled + if (minecraft->options.getIntValue(OPTIONS_DEBUG_STYLE) == 0){ + font->drawShadow("Minecraft - Pocket Edition (" + + std::to_string((int)fps) + " fps, " + + std::to_string(displayChunkUpdates) + " chunk updates)", 2, 2, 0xffffff); + font->drawShadow(minecraft->gatherStats1(), 2, 12, 0xFFFFFF); + font->drawShadow(minecraft->gatherStats2(), 2, 22, 0xFFFFFF); + font->drawShadow(minecraft->gatherStats3(), 2, 32, 0xFFFFFF); + font->drawShadow(minecraft->gatherStats4(), 2, 42, 0xFFFFFF); + + drawString(font, "x: " + std::to_string(minecraft->player->x), 2, 64, 0xE0E0E0); + drawString(font, "y: " + std::to_string(minecraft->player->y), 2, 72, 0xE0E0E0); + drawString(font, "z: " + std::to_string(minecraft->player->z), 2, 80, 0xE0E0E0); + drawString(font, "f: " + std::to_string(Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3), 2, 88, 0xE0E0E0); + drawString(font, "Seed: " + std::to_string(lvl->getSeed()), 2, 104, 0xE0E0E0); + drawString(font, "Dimension: " + std::to_string(lvl->dimension->id) + " (" + lvl->dimension->getDimension() + ")", 2, 114, 0xE0E0E0); + drawString(font, "Biome: " + std::string(biomeName), 2, 124, 0xE0E0E0); + } + else if (minecraft->options.getIntValue(OPTIONS_DEBUG_STYLE) == 1){ + + static char ln[8][96]; sprintf(ln[0], "Minecraft PE 0.6.1 alpha (mcpe64)"); sprintf(ln[1], "%.1f fps", fps); @@ -787,8 +822,8 @@ void Gui::renderDebugInfo() { const float LH = (float)Font::DefaultLineHeight; // 10 font-pixels const float MGN = 2.0f; // left/top margin in font-pixels const float PAD = 2.0f; // horizontal padding for background - Font* font = minecraft->font; - +// Font* font = minecraft->font; + // 1) Draw semi-transparent background boxes behind each line for (int i = 0; i < N; i++) { if (ln[i][0] == '\0') continue; @@ -810,6 +845,7 @@ void Gui::renderDebugInfo() { font->draw(ln[i], MGN, y, col); } t.endOverrideAndDraw(); + } } void Gui::renderPlayerList(Font* font, int screenWidth, int screenHeight) { diff --git a/src/client/gui/components/OptionsItem.cpp b/src/client/gui/components/OptionsItem.cpp index b9d5bbb..d55b447 100755 --- a/src/client/gui/components/OptionsItem.cpp +++ b/src/client/gui/components/OptionsItem.cpp @@ -36,7 +36,7 @@ void OptionsItem::render( Minecraft* minecraft, int xm, int ym ) { } text += ": " + scaleText; } - if (m_optionId == OPTIONS_FOG_TYPE) { + if (m_optionId == OPTIONS_FOG_TYPE) { int value = minecraft->options.getIntValue(OPTIONS_FOG_TYPE); std::string scaleText; switch (value) { @@ -46,6 +46,16 @@ void OptionsItem::render( Minecraft* minecraft, int xm, int ym ) { } text += ": " + scaleText; } + if (m_optionId == OPTIONS_DEBUG_STYLE) { + int value = minecraft->options.getIntValue(OPTIONS_DEBUG_STYLE); + std::string scaleText; + switch (value) { + case 0: scaleText = I18n::get("options.debugStyle.javaBeta"); break; + case 1: scaleText = I18n::get("options.debugStyle.custom"); break; + case 2: scaleText = I18n::get("options.fogType.unused"); break; + } + text += ": " + scaleText; + } minecraft->font->draw(text, (float)x, (float)y + yOffset, 0x909090, false); super::render(minecraft, xm, ym); diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 9e53721..77d5a5f 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -227,7 +227,9 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_ANAGLYPH_3D, minecraft) .addOptionItem(OPTIONS_VIEW_BOBBING, minecraft) .addOptionItem(OPTIONS_AMBIENT_OCCLUSION, minecraft) - .addOptionItem(OPTIONS_NORMAL_LIGHTING, minecraft); + .addOptionItem(OPTIONS_NORMAL_LIGHTING, minecraft) + .addOptionItem(OPTIONS_BEAUTIFUL_SKY, minecraft) + .addOptionItem(OPTIONS_VIGNETTE, minecraft); optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft) .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) @@ -237,7 +239,8 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_JAVA_HUD, minecraft) .addOptionItem(OPTIONS_FOG_TYPE, minecraft) .addOptionItem(OPTIONS_BETA_SKY, minecraft) - .addOptionItem(OPTIONS_RESTORED_ANIMS, minecraft); + .addOptionItem(OPTIONS_RESTORED_ANIMS, minecraft) + .addOptionItem(OPTIONS_DEBUG_STYLE, minecraft); } diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index aab253a..7973b82 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -285,7 +285,7 @@ void GameRenderer::renderLevel(float a) { mc->levelRenderer->cull(&frustum, a); mc->levelRenderer->updateDirtyChunks(cameraEntity, false); // this sky rendering code below was originally before the frustrum and culling stuff but sunset color breaks for some reason in that place, so i moved i after those two - shredder - if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { +// if(mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)) { setupFog(-1); TIMER_POP_PUSH("sky"); // @TODO - EXTREME JANK BELOW, it works but i have to do heavy cleanup here, also to test if the glfogf commands even affect fog in anyway. @@ -298,7 +298,7 @@ void GameRenderer::renderLevel(float a) { glFogf(GL_FOG_START, renderDistance * 0.6f); glFogf(GL_FOG_END, renderDistance); } - } +// } glEnable2(GL_FOG); setupFog(1); // MCPE renders clouds using this, but this method breaks 3d clouds and also breaks 2d clouds transparency viewed from above, add as a Legacy Sky or Fast Sky option. - shredder diff --git a/src/client/renderer/ItemInHandRenderer.cpp b/src/client/renderer/ItemInHandRenderer.cpp index b45d837..088d93b 100755 --- a/src/client/renderer/ItemInHandRenderer.cpp +++ b/src/client/renderer/ItemInHandRenderer.cpp @@ -443,10 +443,10 @@ void ItemInHandRenderer::renderScreenEffect( float a ) } } - // if (mc->player->isUnderLiquid(Material::water)) { - //mc->textures->loadAndBindTexture("misc/water.png"); - // renderWater(a); - // } + if (mc->player->isUnderLiquid(Material::water)) { + mc->textures->loadAndBindTexture("misc/water.png"); + renderWater(a); + } glEnable2(GL_ALPHA_TEST); } diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 6ce0d9b..4f8c02a 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -1063,9 +1063,9 @@ std::string LevelRenderer::gatherStats1() { } // -// /*public*/ std::string gatherStats2() { -// return "E: " + renderedEntities + "/" + totalEntities + ". B: " + culledEntities + ", I: " + ((totalEntities - culledEntities) - renderedEntities); -// } + std::string LevelRenderer::gatherStats2() { + return "E: " + std::to_string(renderedEntities) + "/" + std::to_string(totalEntities) + ". B: " + std::to_string(culledEntities) + ", I: " + std::to_string(((totalEntities - culledEntities) - renderedEntities)); + } // // int[] toRender = new int[50000]; // IntBuffer resultBuffer = MemoryTracker.createIntBuffer(64); @@ -1158,6 +1158,7 @@ void LevelRenderer::renderSky(float alpha) { // thanks to the mcpe 0.1 decomp project a bit for this part, was not getting the gl states correctly, gles is painful - shredder // Sunrise + if (mc->options.getBooleanValue(OPTIONS_BEAUTIFUL_SKY)) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1228,6 +1229,7 @@ void LevelRenderer::renderSky(float alpha) { glColor4f(a, a, a, a); drawArrayVT(starBuffer, starVertexCount); } + } glColor4f(1.0f, 1.0f, 1.0f, 1.0f); @@ -1240,7 +1242,9 @@ void LevelRenderer::renderSky(float alpha) { glColor3f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f); glDisable(GL_TEXTURE_2D); - drawArrayVT(voidBuffer, voidVertexCount); + if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ + drawArrayVT(voidBuffer, voidVertexCount); + } glEnable(GL_TEXTURE_2D); // @TODO shredder - should not enable or disable depth mask if using legacy sky because mcpe sky rendering is awful and will render clouds above terrain @@ -1251,7 +1255,7 @@ void LevelRenderer::renderSky(float alpha) { void LevelRenderer::renderClouds( float alpha ) { //if (!mc->level->dimension->isNaturalDimension()) return; - if (mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS)){ + if (mc->options.getBooleanValue(OPTIONS_FANCY_GRAPHICS) && mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ renderAdvancedClouds(alpha); return; } diff --git a/src/client/renderer/LevelRenderer.h b/src/client/renderer/LevelRenderer.h index 2fa29c8..ba39bfe 100755 --- a/src/client/renderer/LevelRenderer.h +++ b/src/client/renderer/LevelRenderer.h @@ -69,6 +69,7 @@ public: void levelEvent(Player* source, int type, int x, int y, int z, int data); std::string gatherStats1(); + std::string gatherStats2(); void render(const AABB& b) const; void onGraphicsReset(); diff --git a/src/util/PerfRenderer.cpp b/src/util/PerfRenderer.cpp index 34f818a..0ae24d0 100755 --- a/src/util/PerfRenderer.cpp +++ b/src/util/PerfRenderer.cpp @@ -75,7 +75,7 @@ void PerfRenderer::renderFpsMeter( float tickTime ) glDisable2(GL_TEXTURE_2D); Tesselator& t = Tesselator::instance; - t.begin(GL_TRIANGLES); + t.begin(GL_QUADS); int hh1 = (int) (usPer60Fps / 200); float count = (float)frameTimes.size(); t.color(0x20000000); @@ -117,7 +117,8 @@ void PerfRenderer::renderFpsMeter( float tickTime ) t.color(0xff000000 + cc * 256); } - float time = 10 * 1000 * frameTimes[i] / 200; +// float time = 10 * 1000 * frameTimes[i] / 200; + float time = frameTimes[i] * 4000.0f; float time2 = 10 * 1000 * tickTimes[i] / 200; t.vertex(i + 0.5f, _mc->height - time + 0.5f, 0); @@ -210,12 +211,12 @@ void PerfRenderer::renderFpsMeter( float tickTime ) msg << result.name; float xx = (float)(x - r); float yy = (float)(y + r/2 + i * 8 + 20); - _font->drawShadow(msg.str(), xx, yy, result.getColor()); + _font->drawShadow(msg.str(), xx + 10 + 10, yy, result.getColor()); std::string msg2 = toPercentString(result.percentage); //LOGI("name: %s: perc: %f == %s @ %d, %d\n", msg.str().c_str(), result.percentage, msg2.c_str(), xx, yy); - _font->drawShadow(msg2, xx - 50 - _font->width(msg2), yy, result.getColor()); + _font->drawShadow(msg2, xx + 10 + 10 - _font->width(msg2), yy, result.getColor()); msg2 = toPercentString(result.globalPercentage); - _font->drawShadow(msg2, xx - _font->width(msg2), yy, result.getColor()); + _font->drawShadow(msg2, xx + 10 + 10 - _font->width(msg2), yy, result.getColor()); } } diff --git a/src/util/PerfTimer.h b/src/util/PerfTimer.h index 53cf3cd..f4ed974 100755 --- a/src/util/PerfTimer.h +++ b/src/util/PerfTimer.h @@ -6,7 +6,7 @@ #include "StringUtils.h" //package util; -#ifdef PROFILER +//#ifdef PROFILER #define TIMER_PUSH(x) PerfTimer::push(x) #define TIMER_POP() PerfTimer::pop() #define TIMER_POP_PUSH(x) PerfTimer::popPush(x) @@ -16,11 +16,11 @@ // #define TIMER_PUSH(x) ServerProfiler::push(x) // #define TIMER_POP() ServerProfiler::pop() // #define TIMER_POP_PUSH(x) ServerProfiler::popPush(x) -#else - #define TIMER_PUSH(x) ((void*)0) - #define TIMER_POP() ((void*)0) - #define TIMER_POP_PUSH(x) ((void*)0) -#endif +//#else +// #define TIMER_PUSH(x) ((void*)0) +// #define TIMER_POP() ((void*)0) +// #define TIMER_POP_PUSH(x) ((void*)0) +//#endif class PerfTimer { diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index 14aa54e..bdc6d27 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -1735,13 +1735,13 @@ void Level::extinguishFire(int x, int y, int z, int face) { setTile(x, y, z, 0); } } -// String gatherStats() { -// return "All: " + this.entities.size(); -// } -// -// String gatherChunkSourceStats() { -// return chunkSource.gatherStats(); -// } + std::string Level::gatherStats() { + return "All: " + std::to_string(entities.size()); + } + + std::string Level::gatherChunkSourceStats() { + return _chunkSource->gatherStats(); + } // TileEntity* Level::getTileEntity(int x, int y, int z) { LevelChunk* lc = getChunk(x >> 4, z >> 4); diff --git a/src/world/level/Level.h b/src/world/level/Level.h index fb76474..73a3296 100755 --- a/src/world/level/Level.h +++ b/src/world/level/Level.h @@ -202,6 +202,9 @@ public: bool checkAndHandleWater(const AABB& box, const Material* material, Entity* e); void extinguishFire(int x, int y, int z, int face); + std::string Level::gatherStats(); + std::string Level::gatherChunkSourceStats(); + //void addEntities(const EntityList& list); //void removeEntities(const EntityList& list); //void ensureAdded(Entity* entity); diff --git a/src/world/level/chunk/ChunkCache.h b/src/world/level/chunk/ChunkCache.h index b1b16fe..24d93f4 100755 --- a/src/world/level/chunk/ChunkCache.h +++ b/src/world/level/chunk/ChunkCache.h @@ -193,7 +193,8 @@ public: } std::string gatherStats() { - return "ChunkCache: 1024"; + // return "ChunkCache: 1024"; + return ("ChunkCache: " + std::to_string(CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH)); } void saveAll(bool onlyUnsaved) { diff --git a/src/world/level/dimension/Dimension.cpp b/src/world/level/dimension/Dimension.cpp index c565409..19a0eae 100755 --- a/src/world/level/dimension/Dimension.cpp +++ b/src/world/level/dimension/Dimension.cpp @@ -133,22 +133,29 @@ Dimension* Dimension::getNew( int id ) return NULL; } +std::string Dimension::getDimension(){ + int currentID = this->id; + if (currentID == Dimension::NORMAL) return "Overworld"; + if (currentID == Dimension::NORMAL_DAYCYCLE) return "Overworld"; + return "Unknown"; +} + // // DimensionFactory // #include "../storage/LevelData.h" -Dimension* DimensionFactory::createDefaultDimension(LevelData* data ) -{ - int dimensionId = Dimension::NORMAL; + Dimension* DimensionFactory::createDefaultDimension(LevelData* data ) + { + int dimensionId = Dimension::NORMAL; - switch(data->getGameType()) { - case GameType::Survival: dimensionId = Dimension::NORMAL_DAYCYCLE; - break; - case GameType::Creative: - default: - dimensionId = Dimension::NORMAL; - break; - } + switch(data->getGameType()) { + case GameType::Survival: dimensionId = Dimension::NORMAL_DAYCYCLE; + break; + case GameType::Creative: + default: + dimensionId = Dimension::NORMAL; + break; + } return Dimension::getNew(dimensionId); } diff --git a/src/world/level/dimension/Dimension.h b/src/world/level/dimension/Dimension.h index b33861c..5600426 100755 --- a/src/world/level/dimension/Dimension.h +++ b/src/world/level/dimension/Dimension.h @@ -49,7 +49,7 @@ public: bool hasCeiling; float brightnessRamp[16];//Level::MAX_BRIGHTNESS + 1]; int id; - + std::string getDimension(); // shredder added int FogType; // lets us choose between what fog we want ig protected: diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 4e3c4b2..5d84f35 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -11,6 +11,7 @@ #include "../tile/Tile.h" #include "../tile/HeavyTile.h" #include "../../../util/Random.h" +#include "../../level/tile/TallGrass.h" const float RandomLevelSource::SNOW_CUTOFF = 0.5f; const float RandomLevelSource::SNOW_SCALE = 0.3f; @@ -225,7 +226,7 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { int zo = zt * 16; Biome* biome = level->getBiomeSource()->getBiome(xo + 16, zo + 16); - // Biome* biome = Biome::forest; +// Biome* biome = Biome::forest; random.setSeed(level->getSeed()); int xScale = random.nextInt() / 2 * 2 + 1; @@ -419,17 +420,46 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { FlowerFeature feature(Tile::mushroom2->id); feature.place(level, &random, x, y, z); } - int grassCount = 1; - for (int i = 0; i < grassCount; i++) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(Level::genDepth); - int z = zo + random.nextInt(16) + 8; - Feature* grassFeature = biome->getGrassFeature(&random); - if (grassFeature) { - grassFeature->place(level, &random, x, y, z); - delete grassFeature; - } - } + // normally unused in mcpe but how its supposed to do it + //int grassCount = 1; + //for (int i = 0; i < grassCount; i++) { + //int x = xo + random.nextInt(16) + 8; + //int y = random.nextInt(Level::genDepth); + //int z = zo + random.nextInt(16) + 8; + //Feature* grassFeature = biome->getGrassFeature(&random); + //if (grassFeature) { + //grassFeature->place(level, &random, x, y, z); + //delete grassFeature; + //} + //} + + // reworked code from above to generate ferns and shrubs to just like in beta java +int grassCount = 0; + +if (biome == Biome::forest) { grassCount = 2; } +else if (biome == Biome::rainForest) { grassCount = 10; } +else if (biome == Biome::seasonalForest) { grassCount = 2; } +else if (biome == Biome::taiga) { grassCount = 1; } +else if (biome == Biome::plains) { grassCount = 10; } + +for (int i = 0; i < grassCount; i++) { + int grassMetadata = TallGrass::TALL_GRASS; + + + if (biome == Biome::rainForest && random.nextInt(3) != 0) { + grassMetadata = TallGrass::FERN; + } + + int x = xo + random.nextInt(16) + 8; + + int z = zo + random.nextInt(16) + 8; + int y = level->getHeightmap(x, z); + + TallgrassFeature grassFeature(Tile::tallgrass->id, grassMetadata); + grassFeature.place(level, &random, x, y, z); +} + + for (int i = 0; i < 10; i++) { int x = xo + random.nextInt(16) + 8; int y = random.nextInt(128); diff --git a/src/world/level/levelgen/feature/FeatureInclude.h b/src/world/level/levelgen/feature/FeatureInclude.h index 940db75..81aa39a 100755 --- a/src/world/level/levelgen/feature/FeatureInclude.h +++ b/src/world/level/levelgen/feature/FeatureInclude.h @@ -10,5 +10,6 @@ #include "OreFeature.h" #include "ReedsFeature.h" #include "SpringFeature.h" +#include "TallgrassFeature.h" #endif /*FEATURE_INCLUDE__H__*/ diff --git a/src/world/level/tile/TallGrass.cpp b/src/world/level/tile/TallGrass.cpp index b3fc6e6..dbd3738 100755 --- a/src/world/level/tile/TallGrass.cpp +++ b/src/world/level/tile/TallGrass.cpp @@ -33,15 +33,21 @@ int TallGrass::getColor() { } int TallGrass::getColor( int auxData ) { - if(auxData == DEAD_SHRUB) return 0xffffffff; + if(auxData == DEAD_SHRUB); + if (!FoliageColor::useTint && auxData == DEAD_SHRUB){ + return 0xffffff; + } return FoliageColor::getDefaultColor(); } int TallGrass::getColor( LevelSource* level, int x, int y, int z ) { int d = level->getData(x, y, z); - if (d == DEAD_SHRUB) return 0xffffff; + if (d == DEAD_SHRUB); //return 0xffffff; // i removed this to make it accurate to beta 1.6.6 instead of early java release versions float temp = level->getBiomeSource()->temperatures[0]; // shredder added float rain = level->getBiomeSource()->downfalls[0]; // shredder added + if (!GrassColor::useTint && d == DEAD_SHRUB){ + return 0xffffff; + } if (GrassColor::useTint){ return GrassColor::get(temp, rain); } From 0d23fadc3e889ecf14f19afba2cc154387ee2863 Mon Sep 17 00:00:00 2001 From: Shredder Date: Tue, 5 May 2026 00:13:05 +0500 Subject: [PATCH 110/189] how did this even slip past me --- src/world/level/Level.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/world/level/Level.h b/src/world/level/Level.h index 73a3296..17d9942 100755 --- a/src/world/level/Level.h +++ b/src/world/level/Level.h @@ -202,8 +202,8 @@ public: bool checkAndHandleWater(const AABB& box, const Material* material, Entity* e); void extinguishFire(int x, int y, int z, int face); - std::string Level::gatherStats(); - std::string Level::gatherChunkSourceStats(); + std::string gatherStats(); + std::string gatherChunkSourceStats(); //void addEntities(const EntityList& list); //void removeEntities(const EntityList& list); From 52afff463b98559f39395e331b6bcc6a16599e79 Mon Sep 17 00:00:00 2001 From: Shredder Date: Tue, 5 May 2026 00:21:37 +0500 Subject: [PATCH 111/189] left a debug opengl only feature accidentally in, and also hopefully fixed include mess --- src/client/Minecraft.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index c58b957..c0c6f70 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -92,6 +92,9 @@ #include "gamemode/CreatorMode.h" #include "../world/level/GrassColor.h" +#include "renderer/LevelRenderer.h" +#include "particle/ParticleEngine.h" +#include "../world/level/Level.h" static void checkGlError(const char* tag) { #ifdef GLDEBUG while (1) { @@ -848,12 +851,6 @@ void Minecraft::tickInput() { //glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL); } #endif - if (key == Keyboard::KEY_P) { - static bool isWireFrame = false; - isWireFrame = !isWireFrame; - glPolygonMode(GL_FRONT, isWireFrame? GL_LINE : GL_FILL); - //glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL); - } } #ifdef WIN32 if (key == Keyboard::KEY_M) { From 9c46d7094cfc7bc06b60d23943987bc90c823276 Mon Sep 17 00:00:00 2001 From: Shredder Date: Tue, 5 May 2026 00:51:03 +0500 Subject: [PATCH 112/189] sigh converted to_string calls to sprintf --- src/client/gui/Gui.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index 51058a7..bde57ef 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -789,21 +789,37 @@ void Gui::renderDebugInfo() { // if java beta's restored debug menu is enabled if (minecraft->options.getIntValue(OPTIONS_DEBUG_STYLE) == 0){ - font->drawShadow("Minecraft - Pocket Edition (" - + std::to_string((int)fps) + " fps, " - + std::to_string(displayChunkUpdates) + " chunk updates)", 2, 2, 0xffffff); + + char buf[128]; + + sprintf(buf, "Minecraft - Pocket Edition (%d fps, %d chunk updates)", (int)fps, displayChunkUpdates); + font->drawShadow(buf, 2, 2, 0xffffff); + font->drawShadow(minecraft->gatherStats1(), 2, 12, 0xFFFFFF); font->drawShadow(minecraft->gatherStats2(), 2, 22, 0xFFFFFF); font->drawShadow(minecraft->gatherStats3(), 2, 32, 0xFFFFFF); font->drawShadow(minecraft->gatherStats4(), 2, 42, 0xFFFFFF); - drawString(font, "x: " + std::to_string(minecraft->player->x), 2, 64, 0xE0E0E0); - drawString(font, "y: " + std::to_string(minecraft->player->y), 2, 72, 0xE0E0E0); - drawString(font, "z: " + std::to_string(minecraft->player->z), 2, 80, 0xE0E0E0); - drawString(font, "f: " + std::to_string(Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3), 2, 88, 0xE0E0E0); - drawString(font, "Seed: " + std::to_string(lvl->getSeed()), 2, 104, 0xE0E0E0); - drawString(font, "Dimension: " + std::to_string(lvl->dimension->id) + " (" + lvl->dimension->getDimension() + ")", 2, 114, 0xE0E0E0); - drawString(font, "Biome: " + std::string(biomeName), 2, 124, 0xE0E0E0); + sprintf(buf, "x: %.8f", minecraft->player->x); + drawString(font, buf, 2, 64, 0xE0E0E0); + + sprintf(buf, "y: %.8f", minecraft->player->y); + drawString(font, buf, 2, 72, 0xE0E0E0); + + sprintf(buf, "z: %.8f", minecraft->player->z); + drawString(font, buf, 2, 80, 0xE0E0E0); + + sprintf(buf, "f: %d",Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3); + drawString(font, buf, 2, 88, 0xE0E0E0); + + sprintf(buf, "Seed: %.ld", lvl->getSeed()); + drawString(font, buf, 2, 104, 0xE0E0E0); + + sprintf(buf, "Dimension: %d (%s)", lvl->dimension->id, lvl->dimension->getDimension().c_str()); + drawString(font, buf, 2, 114, 0xE0E0E0); + + sprintf(buf, "Biome: %s", biomeName); + drawString(font, buf, 2, 124, 0xE0E0E0); } else if (minecraft->options.getIntValue(OPTIONS_DEBUG_STYLE) == 1){ From 9cd91b150876806ec9807de08fe0a12247aaa08b Mon Sep 17 00:00:00 2001 From: Shredder Date: Tue, 5 May 2026 01:05:57 +0500 Subject: [PATCH 113/189] should finally work hopefully... --- src/client/renderer/LevelRenderer.cpp | 4 +++- src/world/level/Level.cpp | 4 +++- src/world/level/chunk/ChunkCache.h | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 4f8c02a..7ec623b 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -1064,7 +1064,9 @@ std::string LevelRenderer::gatherStats1() { // std::string LevelRenderer::gatherStats2() { - return "E: " + std::to_string(renderedEntities) + "/" + std::to_string(totalEntities) + ". B: " + std::to_string(culledEntities) + ", I: " + std::to_string(((totalEntities - culledEntities) - renderedEntities)); + std::stringstream ss; + ss << "E: "<< renderedEntities << "/" << totalEntities << ". B: " << culledEntities << ", I: " << (totalEntities - culledEntities) - renderedEntities <<"\n"; + return ss.str(); } // // int[] toRender = new int[50000]; diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index bdc6d27..b22a692 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -1736,7 +1736,9 @@ void Level::extinguishFire(int x, int y, int z, int face) { } } std::string Level::gatherStats() { - return "All: " + std::to_string(entities.size()); + std::stringstream ss; + ss << "All: " << entities.size(); + return ss.str(); } std::string Level::gatherChunkSourceStats() { diff --git a/src/world/level/chunk/ChunkCache.h b/src/world/level/chunk/ChunkCache.h index 24d93f4..f6e5376 100755 --- a/src/world/level/chunk/ChunkCache.h +++ b/src/world/level/chunk/ChunkCache.h @@ -194,7 +194,9 @@ public: std::string gatherStats() { // return "ChunkCache: 1024"; - return ("ChunkCache: " + std::to_string(CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH)); + std::stringstream ss; + ss << "ChunkCache: " << CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; + return ss.str(); } void saveAll(bool onlyUnsaved) { From edc6985a6b806f1bb18b2dd4af406bbd27ca6945 Mon Sep 17 00:00:00 2001 From: Shredder Date: Tue, 5 May 2026 01:18:57 +0500 Subject: [PATCH 114/189] opengl and gles and their damn deprecated functions --- src/client/renderer/LevelRenderer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index 7ec623b..ea5120a 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -1242,7 +1242,8 @@ void LevelRenderer::renderSky(float alpha) { // ported over void plane (the blue bottom plane seen in java) because pocket edition lacks it @TODO test if it's buggy - shredder - glColor3f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f); +// glColor3f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f); + glColor4f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f, 1.0f); glDisable(GL_TEXTURE_2D); if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ drawArrayVT(voidBuffer, voidVertexCount); From 18793a6e052214c1bd1b480a19841ad53ffed9de Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 20:40:41 +0200 Subject: [PATCH 115/189] idk? --- src/main_dedicated.cpp | 1 + src/network/ClientSideNetworkHandler.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index 9c0e812..37ce2d0 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -76,6 +76,7 @@ int main(int numArguments, char* pszArgs[]) { //pthread_yield(); sleepMs(20); } + ((MAIN_CLASS*)g_app)->level->saveLevelData(); delete app; appContext.platform->finish(); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index f988fdd..9c3a6b5 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -163,7 +163,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, StartGam // @todo @note i think its trash // we can put it directly to selectLevel? if (packet->chunkCacheWidth != 0) { - printf("lol \n"); + printf("lol \n"); LevelConstants::CHUNK_CACHE_WIDTH = packet->chunkCacheWidth; LevelConstants::LEVEL_WIDTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH; LevelConstants::LEVEL_DEPTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_DEPTH; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index e7e10fb..b184d8b 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -74,11 +74,11 @@ void ServerSideNetworkHandler::tileChanged(int x, int y, int z) Packet* ServerSideNetworkHandler::getAddPacketFromEntity( Entity* entity ) { if (entity->isMob() && !entity->isPlayer()) { //@fix: This code is duplicated. See if it can be unified. - if (minecraft->player) { + // if (minecraft->player) { // I guess this should always be true, but it crashed somewhere in this // function once and I only see this one as a potential problem return new AddMobPacket((Mob*)entity); - } + // } } else if (entity->isPlayer()) { From 26b2c196fa8dd40eb0f664f58760934717f7856b Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:09:42 +0200 Subject: [PATCH 116/189] :\ --- project/android_java/jni/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/project/android_java/jni/Android.mk b/project/android_java/jni/Android.mk index 04720a6..db61279 100755 --- a/project/android_java/jni/Android.mk +++ b/project/android_java/jni/Android.mk @@ -228,6 +228,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/world/level/tile/entity/TileEntity.cpp \ ../../../src/world/level/tile/entity/FurnaceTileEntity.cpp \ ../../../src/world/phys/HitResult.cpp +../../../src/world/level/LevelConstants.cpp LOCAL_CFLAGS := -Wno-psabi $(LOCAL_CFLAGS) From 2465292473878f344e829531a314a85d42610de3 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:14:17 +0200 Subject: [PATCH 117/189] jopa --- project/android/jni/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 9bff609..60db5e8 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -109,6 +109,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/client/renderer/Textures.cpp \ ../../../src/client/renderer/TileRenderer.cpp \ ../../../src/client/renderer/gles.cpp \ +../../../src/world/level/LevelConstants.cpp \ ../../../src/client/renderer/culling/Frustum.cpp \ ../../../src/client/renderer/entity/ArrowRenderer.cpp \ ../../../src/client/renderer/entity/ChickenRenderer.cpp \ From 7e9de7a461f073131b5add7787c9225cc9836e30 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:19:08 +0200 Subject: [PATCH 118/189] fck android build!!! --- project/android/jni/Android.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 60db5e8..24d0dfb 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -135,6 +135,13 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/locale/I18n.cpp \ ../../../src/nbt/Tag.cpp \ ../../../src/network/command/CommandServer.cpp \ +../../../src/network/command/CommandServer.cpp \ +../../../src/commands/Command.cpp \ +../../../src/commands/CommandHelp.cpp \ +../../../src/commands/CommandKick.cpp \ +../../../src/commands/CommandManager.cpp \ +../../../src/commands/CommandOp.cpp \ +../../../src/network/command/CommandServer.cpp \ ../../../src/network/ClientSideNetworkHandler.cpp \ ../../../src/network/NetEventCallback.cpp \ ../../../src/network/Packet.cpp \ From 30dd3442081091aa88fe38f9298d4d9508133ec5 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:33:28 +0200 Subject: [PATCH 119/189] 123 --- project/android/jni/Android.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 24d0dfb..4093feb 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -134,14 +134,14 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/client/sound/SoundEngine.cpp \ ../../../src/locale/I18n.cpp \ ../../../src/nbt/Tag.cpp \ -../../../src/network/command/CommandServer.cpp \ -../../../src/network/command/CommandServer.cpp \ ../../../src/commands/Command.cpp \ ../../../src/commands/CommandHelp.cpp \ ../../../src/commands/CommandKick.cpp \ ../../../src/commands/CommandManager.cpp \ ../../../src/commands/CommandOp.cpp \ ../../../src/network/command/CommandServer.cpp \ +../../../src/network/command/CommandServer.cpp \ +../../../src/network/command/CommandServer.cpp \ ../../../src/network/ClientSideNetworkHandler.cpp \ ../../../src/network/NetEventCallback.cpp \ ../../../src/network/Packet.cpp \ From 4047fd71e1cc7cae37b8c9fe5e7bf8e2fecab0b7 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:36:35 +0200 Subject: [PATCH 120/189] oi --- project/android/jni/Android.mk | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 4093feb..632c137 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -134,19 +134,17 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/client/sound/SoundEngine.cpp \ ../../../src/locale/I18n.cpp \ ../../../src/nbt/Tag.cpp \ -../../../src/commands/Command.cpp \ -../../../src/commands/CommandHelp.cpp \ -../../../src/commands/CommandKick.cpp \ -../../../src/commands/CommandManager.cpp \ -../../../src/commands/CommandOp.cpp \ -../../../src/network/command/CommandServer.cpp \ -../../../src/network/command/CommandServer.cpp \ ../../../src/network/command/CommandServer.cpp \ ../../../src/network/ClientSideNetworkHandler.cpp \ ../../../src/network/NetEventCallback.cpp \ ../../../src/network/Packet.cpp \ ../../../src/network/RakNetInstance.cpp \ ../../../src/network/ServerSideNetworkHandler.cpp \ +../../../src/commands/Command.cpp \ +../../../src/commands/CommandHelp.cpp \ +../../../src/commands/CommandKick.cpp \ +../../../src/commands/CommandManager.cpp \ +../../../src/commands/CommandOp.cpp \ ../../../src/server/ServerLevel.cpp \ ../../../src/server/ServerPlayer.cpp \ ../../../src/util/DataIO.cpp \ From 27b22d81081b87f179cd1af0ba3630e858373767 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:41:26 +0200 Subject: [PATCH 121/189] vegetables --- src/commands/CommandKick.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/CommandKick.cpp b/src/commands/CommandKick.cpp index 2dad690..c05a1f9 100644 --- a/src/commands/CommandKick.cpp +++ b/src/commands/CommandKick.cpp @@ -1,11 +1,11 @@ #include "CommandKick.hpp" +#include "RakPeerInterface.h" #include "commands/Command.hpp" #include "network/RakNetInstance.h" -#include "raknet/RakPeer.h" #include "world/level/Level.h" #include #include - +// RakNet::RakPeerInterface CommandKick::CommandKick() : Command("kick") {} From 830549791a4c0b1970e36ec7dcdcd9e1f19f52c9 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:51:35 +0200 Subject: [PATCH 122/189] 121 --- src/commands/CommandKick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/CommandKick.cpp b/src/commands/CommandKick.cpp index c05a1f9..df8c113 100644 --- a/src/commands/CommandKick.cpp +++ b/src/commands/CommandKick.cpp @@ -1,7 +1,7 @@ #include "CommandKick.hpp" -#include "RakPeerInterface.h" #include "commands/Command.hpp" #include "network/RakNetInstance.h" +#include "raknet/RakPeerInterface.h" #include "world/level/Level.h" #include #include From 70308d415157947ed00e5260e285748047856d99 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 5 May 2026 21:55:03 +0200 Subject: [PATCH 123/189] qqqqqq --- src/commands/CommandManager.cpp | 2 -- src/commands/CommandOp.cpp | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index f92f380..9087c42 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -11,8 +11,6 @@ #include "network/RakNetInstance.h" #include "world/level/Level.h" - - CommandManager::CommandManager() { registerAllCommands(); } diff --git a/src/commands/CommandOp.cpp b/src/commands/CommandOp.cpp index df28db5..e50e130 100644 --- a/src/commands/CommandOp.cpp +++ b/src/commands/CommandOp.cpp @@ -1,12 +1,9 @@ #include "CommandOp.hpp" #include "commands/Command.hpp" -#include "network/RakNetInstance.h" -#include "raknet/RakPeer.h" #include "world/level/Level.h" #include #include - CommandOp::CommandOp() : Command("op") {} std::string CommandOp::execute(Minecraft& mc, Player& player, const std::vector& args) { From 620b358ba75ababe465b17c49cb3145d5c9a5750 Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 7 May 2026 13:33:57 +0500 Subject: [PATCH 124/189] i love when my errors are cryptic --- src/client/renderer/LevelRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index ea5120a..a452d2e 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -1243,7 +1243,7 @@ void LevelRenderer::renderSky(float alpha) { // ported over void plane (the blue bottom plane seen in java) because pocket edition lacks it @TODO test if it's buggy - shredder // glColor3f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f); - glColor4f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f, 1.0f); +// glColor4f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f, 1.0f); glDisable(GL_TEXTURE_2D); if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ drawArrayVT(voidBuffer, voidVertexCount); From b6ea0c7dc3054dbd32d65837e2ca47f5605ba39d Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 7 May 2026 13:50:08 +0500 Subject: [PATCH 125/189] this has to be an insanely hacky solution to get it working on linux again --- CMakeLists.txt | 1 + src/client/renderer/LevelRenderer.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdd27f0..fbb244c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,6 +312,7 @@ if(UNIX) target_compile_definitions("${PROJECT_NAME}-server" PUBLIC "STANDALONE_SERVER" "SERVER_PROFILER") target_include_directories("${PROJECT_NAME}-server" PUBLIC + "${CMAKE_SOURCE_DIR}/glad/include/" "${CMAKE_SOURCE_DIR}/src/" "project/lib_projects/raknet/jni/RaknetSources" ) diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index a452d2e..ea5120a 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -1243,7 +1243,7 @@ void LevelRenderer::renderSky(float alpha) { // ported over void plane (the blue bottom plane seen in java) because pocket edition lacks it @TODO test if it's buggy - shredder // glColor3f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f); -// glColor4f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f, 1.0f); + glColor4f(sc.x * 0.2f + 0.04f, sc.y * 0.2f + 0.04f, sc.z * 0.6f + 0.1f, 1.0f); glDisable(GL_TEXTURE_2D); if(mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ drawArrayVT(voidBuffer, voidVertexCount); From a0e99e2f035db4c03a0a8da3ba38da20d191c152 Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 7 May 2026 13:59:13 +0500 Subject: [PATCH 126/189] debug screen ifdef case because linux compilation is hell --- src/client/Minecraft.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index c0c6f70..33834e9 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1453,15 +1453,21 @@ void Minecraft::_levelGenerated() } std::string Minecraft::gatherStats1() { +#ifndef STANDALONE_SERVER return levelRenderer->gatherStats1(); +#endif } std::string Minecraft::gatherStats2() { +#ifndef STANDALONE_SERVER return levelRenderer->gatherStats2(); +#endif } std::string Minecraft::gatherStats3() { +#ifndef STANDALONE_SERVER return ("P: " + particleEngine->countParticles() + ". T: " + (level->gatherStats())); +#endif } std::string Minecraft::gatherStats4() { From 2da05d94c86af647e67f5b0aa7512e2f9d99cfab Mon Sep 17 00:00:00 2001 From: Shredder Date: Thu, 7 May 2026 14:06:01 +0500 Subject: [PATCH 127/189] should return some value in the debug stuff so nothing breaks --- src/client/Minecraft.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 33834e9..64fb14e 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1456,18 +1456,21 @@ std::string Minecraft::gatherStats1() { #ifndef STANDALONE_SERVER return levelRenderer->gatherStats1(); #endif + return "Blank"; } std::string Minecraft::gatherStats2() { #ifndef STANDALONE_SERVER return levelRenderer->gatherStats2(); #endif + return "Blank"; } std::string Minecraft::gatherStats3() { #ifndef STANDALONE_SERVER return ("P: " + particleEngine->countParticles() + ". T: " + (level->gatherStats())); #endif + return "Blank"; } std::string Minecraft::gatherStats4() { From 43f0d1f75ff5e82fa11457234248374dffce36c6 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 8 May 2026 23:42:41 +0200 Subject: [PATCH 128/189] server config --- src/main_dedicated.cpp | 151 +++++++++++++++++++++++++++++++++++------ 1 file changed, 129 insertions(+), 22 deletions(-) diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index 37ce2d0..05cab6a 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -1,3 +1,4 @@ +#include #include #include "NinecraftApp.h" #include "AppPlatform.h" @@ -27,45 +28,151 @@ void signal_callback_handler(int signum) { } } +std::string findStringInConfig(std::string line, std::string config) { + auto valuePos = config.find(line); + + if (line.empty()) { + throw std::runtime_error("Key cannot be empty"); + } + + if (valuePos == std::string::npos) { + throw std::runtime_error("Cannot find value"); + } + + std::string valueStr = ""; + + valuePos += 1 + line.size(); + + + while (true) { + auto sym = config.at(valuePos); + + if (sym == '\n') { + break; + } + + if (valuePos == config.size()) { + throw std::runtime_error("Cannot end line"); + } + + valueStr += sym; + valuePos++; + } + + return valueStr; +} + + int main(int numArguments, char* pszArgs[]) { ArgumentsSettings aSettings(numArguments, pszArgs); - if(aSettings.getShowHelp()) { - // TODO: Map with args and print it with std::cout and for loop - // TODO: World size setting + // if(aSettings.getShowHelp()) { + // // TODO: Map with args and print it with std::cout and for loop + // // TODO: World size setting - ArgumentsSettings defaultSettings(0, NULL); + // ArgumentsSettings defaultSettings(0, NULL); - printf("Minecraft Pockect Edition Server %s\n", Common::getGameVersionString("").c_str()); - printf("-------------------------------------------------------\n"); + // printf("Minecraft Pockect Edition Server %s\n", Common::getGameVersionString("").c_str()); + // printf("-------------------------------------------------------\n"); - printf("--cachepath - Path to where the server can store temp stuff (not sure if this is used) [default: \"%s\"]\n", defaultSettings.getCachePath().c_str()); - printf("--externalpath - The path to the place where the server should store the levels. [default: \"%s\"]\n", defaultSettings.getExternalPath().c_str()); - printf("--levelname - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelName().c_str()); - printf("--gamemode - The name of the gamemode [default: \"%s\"]\n", defaultSettings.getGamemode().c_str()); - printf("--leveldir - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelDir().c_str()); - printf("--help - Shows this message.\n"); - printf("--port - The port to run the server on. [default: %d]\n", defaultSettings.getPort()); - printf("--serverkey - The key that the server should use for API calls. [default: \"%s\"]\n", defaultSettings.getServerKey().c_str()); + // printf("--cachepath - Path to where the server can store temp stuff (not sure if this is used) [default: \"%s\"]\n", defaultSettings.getCachePath().c_str()); + // printf("--externalpath - The path to the place where the server should store the levels. [default: \"%s\"]\n", defaultSettings.getExternalPath().c_str()); + // printf("--levelname - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelName().c_str()); + // printf("--gamemode - The name of the gamemode [default: \"%s\"]\n", defaultSettings.getGamemode().c_str()); + // printf("--leveldir - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelDir().c_str()); + // printf("--help - Shows this message.\n"); + // printf("--port - The port to run the server on. [default: %d]\n", defaultSettings.getPort()); + // printf("--serverkey - The key that the server should use for API calls. [default: \"%s\"]\n", defaultSettings.getServerKey().c_str()); - printf("-------------------------------------------------------\n"); + // printf("-------------------------------------------------------\n"); - return 0; + // return 0; + // } + + std::ifstream serverProperties("server.properties"); + + int port = 0; + int gamemode = 0; + + std::string levelDir = ""; + std::string cachePath = ""; + std::string externalPath = ""; + std::string levelName = ""; + + if (serverProperties.is_open()) { + std::string propString; + std::string line; + + while (std::getline(serverProperties, line)) { + propString += line; + propString += "\n"; + } + + if (propString.empty()) { + throw std::runtime_error("Config cannot be empty"); + } + + port = std::stoi(findStringInConfig("port", propString)); + cachePath = findStringInConfig("level-cachepath", propString); + externalPath = findStringInConfig("level-externalpath", propString); + levelName = findStringInConfig("level-name", propString); + levelDir = findStringInConfig("level-dir", propString); + + std::string gamemodeStr = findStringInConfig("gamemode", propString); + + if (gamemodeStr == "survival") { + gamemode = GameType::Survival; + } else if (gamemodeStr == "creative") { + gamemode = GameType::Creative; + } else { + gamemode = GameType::Survival; + } + + printf("%d %s %s %d \n", port, cachePath.c_str(), externalPath.c_str(), gamemode); + } else { + std::ofstream defaultProperties("server.properties"); + + if (defaultProperties.is_open()) { + ArgumentsSettings defaultSettings(0, NULL); + + std::stringstream buffer; + + buffer << "// MCPE Server properties" << std::endl; + buffer << "port=" << defaultSettings.getPort() << std::endl; + buffer << "level-dir=" << defaultSettings.getLevelDir() << std::endl; + buffer << "level-cachepath=" << defaultSettings.getCachePath() << std::endl; + buffer << "level-externalpath=" << defaultSettings.getExternalPath() << std::endl; + buffer << "gamemode=survival" << std::endl; + buffer << "level-name=" << defaultSettings.getLevelName() << std::endl; + buffer << "world-size=16" << std::endl; + + defaultProperties << buffer.str(); + + printf("%s \n", buffer.str().c_str()); + + printf("Edit a config file first!"); + + defaultProperties.close(); + exit(0); + } else { + throw std::runtime_error("Cannot create default config."); + } } - printf("Level Name: %s\n", aSettings.getLevelName().c_str()); + + printf("Level Name: %s\n", levelName.c_str()); AppContext appContext; appContext.platform = new AppPlatform(); App* app = new MAIN_CLASS(); signal(SIGINT, signal_callback_handler); g_app = app; - ((MAIN_CLASS*)g_app)->externalStoragePath = aSettings.getExternalPath(); - ((MAIN_CLASS*)g_app)->externalCacheStoragePath = aSettings.getCachePath(); + ((MAIN_CLASS*)g_app)->externalStoragePath = externalPath; + ((MAIN_CLASS*)g_app)->externalCacheStoragePath = cachePath; g_app->init(appContext); - LevelSettings settings(getEpochTimeS(), GameType::Creative); + LevelSettings settings(getEpochTimeS(), gamemode); float startTime = getTimeS(); - ((MAIN_CLASS*)g_app)->selectLevel(aSettings.getLevelDir(), aSettings.getLevelName(), settings); - ((MAIN_CLASS*)g_app)->hostMultiplayer(aSettings.getPort()); + ((MAIN_CLASS*)g_app)->selectLevel(levelDir, levelName, settings); + ((MAIN_CLASS*)g_app)->hostMultiplayer(port); std::cout << "Level has been generated in " << getTimeS() - startTime << std::endl; ((MAIN_CLASS*)g_app)->level->saveLevelData(); From 1d0264a9c507c0ea14a5cad991f2defad63f714e Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 9 May 2026 01:45:19 +0200 Subject: [PATCH 129/189] FEAT: World size --- src/main_dedicated.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index 05cab6a..f1a0921 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -12,6 +12,7 @@ #include "server/ArgumentsSettings.h" #include "platform/time.h" #include "SharedConstants.h" +#include "world/level/LevelConstants.h" #define MAIN_CLASS NinecraftApp static App* g_app = 0; @@ -40,9 +41,8 @@ std::string findStringInConfig(std::string line, std::string config) { } std::string valueStr = ""; - - valuePos += 1 + line.size(); + valuePos += 1 + line.size(); while (true) { auto sym = config.at(valuePos); @@ -92,6 +92,7 @@ int main(int numArguments, char* pszArgs[]) { int port = 0; int gamemode = 0; + int worldSize = 0; std::string levelDir = ""; std::string cachePath = ""; @@ -112,6 +113,16 @@ int main(int numArguments, char* pszArgs[]) { } port = std::stoi(findStringInConfig("port", propString)); + worldSize = std::stoi(findStringInConfig("world-size", propString)); + + if (worldSize < 16 || worldSize > 32) { + throw std::runtime_error("Incorrect world size."); + } + + LevelConstants::CHUNK_CACHE_WIDTH = worldSize; + LevelConstants::LEVEL_WIDTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH; + LevelConstants::LEVEL_DEPTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_DEPTH; + cachePath = findStringInConfig("level-cachepath", propString); externalPath = findStringInConfig("level-externalpath", propString); levelName = findStringInConfig("level-name", propString); @@ -144,7 +155,7 @@ int main(int numArguments, char* pszArgs[]) { buffer << "gamemode=survival" << std::endl; buffer << "level-name=" << defaultSettings.getLevelName() << std::endl; buffer << "world-size=16" << std::endl; - + defaultProperties << buffer.str(); printf("%s \n", buffer.str().c_str()); From 792d4b32e7fade96df54ae369c4a0390b6b62056 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 9 May 2026 06:27:30 +0500 Subject: [PATCH 130/189] Fixed Grass Foliage color using foliagecolor.png instead of grasscolor.png Debug Screen now also renders mob id nametags like in beta java SkyDarken is now also no longer clamped in Java Fog Style --- src/client/Minecraft.cpp | 4 ++-- src/client/renderer/entity/MobRenderer.cpp | 12 +++++++++--- src/world/level/Level.cpp | 8 +++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 64fb14e..db32ae2 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1159,8 +1159,8 @@ void Minecraft::init() // now i can finally initialize foliage color, probably not the best way to handle this but i cant be arsed rn FoliageColor::init(foliagePixels); - TextureId grassId = (textures->loadTexture("misc/foliagecolor.png")); // loading the uh png for foliage color - int* grassPixels = textures->loadTexturePixels(grassId, "misc/foliagecolor.png"); + TextureId grassId = (textures->loadTexture("misc/grasscolor.png")); // loading the uh png for foliage color + int* grassPixels = textures->loadTexturePixels(grassId, "misc/grasscolor.png"); GrassColor::init(grassPixels); bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color diff --git a/src/client/renderer/entity/MobRenderer.cpp b/src/client/renderer/entity/MobRenderer.cpp index 3d6b3d9..137a38b 100755 --- a/src/client/renderer/entity/MobRenderer.cpp +++ b/src/client/renderer/entity/MobRenderer.cpp @@ -187,10 +187,12 @@ void MobRenderer::scale(Mob* mob, float a) { } void MobRenderer::renderName(Mob* mob, float x, float y, float z) { - /* + std::stringstream ss; ss << mob->entityId; + if (entityRenderDispatcher->minecraft->options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { renderNameTag(mob, ss.str(), x, y, z, 64); - */ + } + } void MobRenderer::renderNameTag(Mob* mob, const std::string& name, float x, float y, float z, int maxDist) { @@ -205,7 +207,11 @@ void MobRenderer::renderNameTag(Mob* mob, const std::string& name, float x, floa float s = 1 / 60.0f * size; glPushMatrix2(); - glTranslatef2((float) x + 0, (float) y + 1.0f /*2.3f*/, (float) z); + if (mob->isPlayer()){ + glTranslatef2((float) x + 0, (float) y + 1.0f, (float) z); + } else { + glTranslatef2((float) x + 0, (float) y + 2.3f, (float) z); + } glRotatef2(-entityRenderDispatcher->playerRotY, 0, 1, 0); glRotatef2(entityRenderDispatcher->playerRotX, 1, 0, 0); diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index b22a692..21e1a2f 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -1165,7 +1165,13 @@ int Level::getSkyDarken(float a) { float br = 1 - (Mth::cos(td * Mth::PI * 2) * 2 + 0.5f); if (br < 0.0f) br = 0.0f; - if (br > 0.80f) br = 0.80f; //@note; was 1.0f + if (dimension->FogType == 1) // @TODO - probably make this not dependent on dimension type honestly - shredder + { + if (br > 1.0f) br = 1.0f; //@ uses the normal javasky color ramp when java sky type is choosen, + } else + { + if (br > 0.8f) br = 0.8f; //@note; was 1.0f + } return ((int) (br * 11)); } From 263118f2e058a87186fba3e992fbb995115aa8b6 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 9 May 2026 13:09:45 +0200 Subject: [PATCH 131/189] Fix --- src/client/Minecraft.cpp | 3 --- src/main_dedicated.cpp | 32 +++--------------------- src/network/ClientSideNetworkHandler.cpp | 3 +++ 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 6698c3d..d428879 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1322,12 +1322,9 @@ bool Minecraft::joinMultiplayerFromString( const std::string& server ) } else { ip = server; } - - printf("%s \n", port.c_str()); if (isLookingForMultiplayer && netCallback) { isLookingForMultiplayer = false; - printf("test"); int portNum = atoi(port.c_str()); return raknetInstance->connect(ip.c_str(), portNum); } diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index f1a0921..2c429ed 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -52,7 +52,7 @@ std::string findStringInConfig(std::string line, std::string config) { } if (valuePos == config.size()) { - throw std::runtime_error("Cannot end line"); + throw std::runtime_error("Cannot find end of the line"); } valueStr += sym; @@ -63,31 +63,7 @@ std::string findStringInConfig(std::string line, std::string config) { } -int main(int numArguments, char* pszArgs[]) { - ArgumentsSettings aSettings(numArguments, pszArgs); - // if(aSettings.getShowHelp()) { - // // TODO: Map with args and print it with std::cout and for loop - // // TODO: World size setting - - // ArgumentsSettings defaultSettings(0, NULL); - - // printf("Minecraft Pockect Edition Server %s\n", Common::getGameVersionString("").c_str()); - // printf("-------------------------------------------------------\n"); - - // printf("--cachepath - Path to where the server can store temp stuff (not sure if this is used) [default: \"%s\"]\n", defaultSettings.getCachePath().c_str()); - // printf("--externalpath - The path to the place where the server should store the levels. [default: \"%s\"]\n", defaultSettings.getExternalPath().c_str()); - // printf("--levelname - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelName().c_str()); - // printf("--gamemode - The name of the gamemode [default: \"%s\"]\n", defaultSettings.getGamemode().c_str()); - // printf("--leveldir - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelDir().c_str()); - // printf("--help - Shows this message.\n"); - // printf("--port - The port to run the server on. [default: %d]\n", defaultSettings.getPort()); - // printf("--serverkey - The key that the server should use for API calls. [default: \"%s\"]\n", defaultSettings.getServerKey().c_str()); - - // printf("-------------------------------------------------------\n"); - - // return 0; - // } - +int main(int numArguments, char* pszArgs[]) { std::ifstream serverProperties("server.properties"); int port = 0; @@ -138,7 +114,7 @@ int main(int numArguments, char* pszArgs[]) { gamemode = GameType::Survival; } - printf("%d %s %s %d \n", port, cachePath.c_str(), externalPath.c_str(), gamemode); + printf("%d %s %s %d %d\n", port, cachePath.c_str(), externalPath.c_str(), gamemode, LevelConstants::CHUNK_CACHE_WIDTH); } else { std::ofstream defaultProperties("server.properties"); @@ -160,7 +136,7 @@ int main(int numArguments, char* pszArgs[]) { printf("%s \n", buffer.str().c_str()); - printf("Edit a config file first!"); + printf("Edit a config file first!\n"); defaultProperties.close(); exit(0); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 9c3a6b5..e5db2b7 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -45,6 +45,9 @@ ClientSideNetworkHandler::ClientSideNetworkHandler(Minecraft* minecraft, IRakNet requestNextChunkPosition(0), requestNextChunkIndex(0) { + NumRequestChunks = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; + requestNextChunkIndexList.resize(NumRequestChunks); + chunksLoaded.resize(NumRequestChunks); rakPeer = raknetInstance->getPeer(); } From dfb3bf1da7992326bb5773c2c2f6d2ec49aba3a0 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 9 May 2026 14:41:31 +0200 Subject: [PATCH 132/189] FIX: render ty shredder --- src/network/ClientSideNetworkHandler.cpp | 4 +++- src/world/level/tile/Tile.cpp | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index e5db2b7..fd0b5f3 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -13,6 +13,7 @@ #include "../client/gamemode/GameMode.h" #include "world/item/ItemInstance.h" #include "world/level/LevelConstants.h" +#include #ifndef STANDALONE_SERVER #include "../client/gui/screens/DisconnectionScreen.h" #endif @@ -120,6 +121,7 @@ void ClientSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid) } } } + minecraft->setLevel(NULL); #ifndef STANDALONE_SERVER minecraft->gui.addMessage("Disconnected from server"); #endif @@ -354,7 +356,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RemoveEn if (!level) return; Entity* entity = level->getEntity(packet->entityId); - LOGI("RemoveEntityPacket %p %p, %d\n", entity, minecraft->player, entity?(int)(entity->isPlayer()): -1); + // LOGI("RemoveEntityPacket %p %p, %d\n", entity, minecraft->player, entity?(int)(entity->isPlayer()): -1); if (!entity) return; level->removeEntity(entity); diff --git a/src/world/level/tile/Tile.cpp b/src/world/level/tile/Tile.cpp index a5acf7a..6736bc7 100755 --- a/src/world/level/tile/Tile.cpp +++ b/src/world/level/tile/Tile.cpp @@ -22,6 +22,7 @@ #include "../../item/StoneSlabTileItem.h" #include "../../item/SaplingTileItem.h" #include "../../item/ItemCategory.h" +#include "world/level/LevelConstants.h" const int Tile::RENDERLAYER_OPAQUE = 0; const int Tile::RENDERLAYER_ALPHATEST = 1; @@ -512,10 +513,15 @@ bool Tile::shouldRenderFace( LevelSource* level, int x, int y, int z, int face ) { if (face == 0 && y == -1) return false; // For fixed size worlds //@todo: external constants rather than magic numbers + // @fixme @ahtung temp fix + + auto xz = LevelConstants::CHUNK_CACHE_WIDTH == 16 ? 256 : + LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH / (LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH / 256 / 2); + if (face == 2 && z == -1) return false; - if (face == 3 && z == 256) return false; + if (face == 3 && z == xz) return false; if (face == 4 && x == -1) return false; - if (face == 5 && x == 256) return false; + if (face == 5 && x == xz) return false; // Common if (face == 0 && yy0 > 0) return true; if (face == 1 && yy1 < 1) return true; From 5bc19c4ab26066271e59965aae21e7454c0605a5 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 9 May 2026 16:37:11 +0200 Subject: [PATCH 133/189] FEAT: Ban command, save ops and banned ppl in files TODO: fix many crashes... --- project/android/jni/Android.mk | 1 + src/client/Minecraft.cpp | 31 ++++++------ src/commands/Command.cpp | 5 +- src/commands/CommandBan.cpp | 52 ++++++++++++++++++++ src/commands/CommandBan.hpp | 9 ++++ src/commands/CommandKick.cpp | 13 +++-- src/commands/CommandManager.cpp | 2 + src/commands/CommandOp.cpp | 11 ++--- src/main_dedicated.cpp | 61 ++++++++++++++++++++++++ src/network/ClientSideNetworkHandler.cpp | 6 +++ src/network/ServerSideNetworkHandler.cpp | 22 +++++++-- src/network/packet/LoginStatusPacket.h | 1 + src/world/level/Level.h | 2 +- 13 files changed, 187 insertions(+), 29 deletions(-) create mode 100644 src/commands/CommandBan.cpp create mode 100644 src/commands/CommandBan.hpp diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 632c137..ec493d0 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -143,6 +143,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/commands/Command.cpp \ ../../../src/commands/CommandHelp.cpp \ ../../../src/commands/CommandKick.cpp \ +../../../src/commands/CommandBan.cpp \ ../../../src/commands/CommandManager.cpp \ ../../../src/commands/CommandOp.cpp \ ../../../src/server/ServerLevel.cpp \ diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index d428879..bb2f579 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -278,7 +278,10 @@ void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, Loc } this->level = level; // So uhhh - level->ops.emplace(options.getStringValue(OPTIONS_USERNAME)); + std::string op = options.getStringValue(OPTIONS_USERNAME); + std::transform(op.begin(), op.end(), op.begin(), ::tolower); + + level->ops.emplace(op); _hasSignaledGeneratingLevelFinished = false; #ifdef STANDALONE_SERVER const bool threadedLevelCreation = false; @@ -732,19 +735,19 @@ void Minecraft::tickInput() { } // TODO: replace it with client /give command :face_vomiting: - if (key == Keyboard::KEY_F4) { - player->inventory->add(new ItemInstance(Tile::redBrick)); - player->inventory->add(new ItemInstance(Item::ironIngot, 64)); - player->inventory->add(new ItemInstance(Item::ironIngot, 34)); - player->inventory->add(new ItemInstance(Tile::stonecutterBench)); - player->inventory->add(new ItemInstance(Tile::workBench)); - player->inventory->add(new ItemInstance(Tile::furnace)); - player->inventory->add(new ItemInstance(Tile::wood, 54)); - player->inventory->add(new ItemInstance(Item::stick, 14)); - player->inventory->add(new ItemInstance(Item::coal, 31)); - player->inventory->add(new ItemInstance(Tile::sand, 6)); + // if (key == Keyboard::KEY_F4) { + // player->inventory->add(new ItemInstance(Tile::redBrick)); + // player->inventory->add(new ItemInstance(Item::ironIngot, 64)); + // player->inventory->add(new ItemInstance(Item::ironIngot, 34)); + // player->inventory->add(new ItemInstance(Tile::stonecutterBench)); + // player->inventory->add(new ItemInstance(Tile::workBench)); + // player->inventory->add(new ItemInstance(Tile::furnace)); + // player->inventory->add(new ItemInstance(Tile::wood, 54)); + // player->inventory->add(new ItemInstance(Item::stick, 14)); + // player->inventory->add(new ItemInstance(Item::coal, 31)); + // player->inventory->add(new ItemInstance(Tile::sand, 6)); - } + // } if (key == Keyboard::KEY_F5) { options.toggle(OPTIONS_THIRD_PERSON_VIEW); @@ -1603,6 +1606,6 @@ void Minecraft::addMessage(const std::string& msg) { #ifndef STANDALONE_SERVER gui.addMessage(msg); #else - LOGI("%s", msg.c_str()); + LOGI("%s \n", msg.c_str()); #endif } \ No newline at end of file diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index ebcbf3d..187267c 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -3,5 +3,8 @@ #include bool Command::isPlayerOp(Minecraft& mc, Player& player) { - return mc.level->ops.find(player.name) != mc.level->ops.end(); + std::string nicknameLower = player.name; + std::transform(nicknameLower.begin(), nicknameLower.end(), nicknameLower.begin(), ::tolower); + + return mc.level->ops.find(nicknameLower) != mc.level->ops.end(); } \ No newline at end of file diff --git a/src/commands/CommandBan.cpp b/src/commands/CommandBan.cpp new file mode 100644 index 0000000..0373d5b --- /dev/null +++ b/src/commands/CommandBan.cpp @@ -0,0 +1,52 @@ +#include "CommandBan.hpp" +#include "commands/Command.hpp" +#include "network/RakNetInstance.h" +#include "raknet/RakPeerInterface.h" +#include "world/level/Level.h" +#include +#include + +CommandBan::CommandBan() : Command("ban") {} + +std::string CommandBan::execute(Minecraft& mc, Player& player, const std::vector& args) { + if (!isPlayerOp(mc, player)) { + return "You aren't enough priveleged to run this command"; + } + + if (args.empty()) { + return help(mc); + } + + std::string nicknameLower = args[0]; + std::transform(nicknameLower.begin(), nicknameLower.end(), nicknameLower.begin(), ::tolower); + + auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args, nicknameLower] (auto& it) -> bool { + std::string lower = it->name; + std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); + + return lower == nicknameLower; + }); + + if (*it == (Player*)mc.player) { + return "ban: you can't ban urself lol"; + } + + if (it != mc.level->players.end()) { + mc.level->removePlayer(*it); + (*it)->remove(); + mc.raknetInstance->getPeer()->CloseConnection((*it)->owner, true); + } else { + for (auto& banned : mc.level->bannedPpl) { + if (nicknameLower == banned) { + return args[0] + "already banned!"; + } + } + } + + mc.level->bannedPpl.insert(nicknameLower); + return "ban: successfully banned player " + args[0]; +} + +std::string CommandBan::help(Minecraft& mc) { + return "Usage: /ban "; +} \ No newline at end of file diff --git a/src/commands/CommandBan.hpp b/src/commands/CommandBan.hpp new file mode 100644 index 0000000..b688800 --- /dev/null +++ b/src/commands/CommandBan.hpp @@ -0,0 +1,9 @@ +#include "Command.hpp" + +class CommandBan : public Command { +public: + CommandBan(); + + std::string execute(Minecraft& mc, Player& player, const std::vector& args); + std::string help(Minecraft& mc); +}; \ No newline at end of file diff --git a/src/commands/CommandKick.cpp b/src/commands/CommandKick.cpp index df8c113..b876d9a 100644 --- a/src/commands/CommandKick.cpp +++ b/src/commands/CommandKick.cpp @@ -5,7 +5,6 @@ #include "world/level/Level.h" #include #include -// RakNet::RakPeerInterface CommandKick::CommandKick() : Command("kick") {} @@ -18,8 +17,14 @@ std::string CommandKick::execute(Minecraft& mc, Player& player, const std::vecto return help(mc); } - auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args] (auto& it) -> bool { - return it->name == args[0]; + std::string nicknameLower = args[0]; + std::transform(nicknameLower.begin(), nicknameLower.end(), nicknameLower.begin(), ::tolower); + + auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args, nicknameLower] (auto& it) -> bool { + std::string lower = it->name; + std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); + + return lower == nicknameLower; }); if (it == mc.level->players.end()) { @@ -33,7 +38,7 @@ std::string CommandKick::execute(Minecraft& mc, Player& player, const std::vecto mc.level->removePlayer(*it); (*it)->remove(); mc.raknetInstance->getPeer()->CloseConnection((*it)->owner, true); - mc.addMessage("kick: successfully kicked player " + args[0]); + return "kick: successfully kicked player " + args[0]; } std::string CommandKick::help(Minecraft& mc) { diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index 9087c42..fbb9324 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -7,6 +7,7 @@ #include "commands/CommandHelp.hpp" #include "commands/CommandKick.hpp" #include "commands/CommandOp.hpp" +#include "commands/CommandBan.hpp" #include "network/packet/ChatPacket.h" #include "network/RakNetInstance.h" #include "world/level/Level.h" @@ -19,6 +20,7 @@ void CommandManager::registerAllCommands() { m_commands.push_back(new CommandHelp()); m_commands.push_back(new CommandKick()); m_commands.push_back(new CommandOp()); + m_commands.push_back(new CommandBan()); } std::vector CommandManager::getListAllCommands() { diff --git a/src/commands/CommandOp.cpp b/src/commands/CommandOp.cpp index e50e130..7fc2c30 100644 --- a/src/commands/CommandOp.cpp +++ b/src/commands/CommandOp.cpp @@ -15,15 +15,14 @@ std::string CommandOp::execute(Minecraft& mc, Player& player, const std::vector< return help(mc); } - auto it = std::find_if(mc.level->players.begin(), mc.level->players.end(), [args] (auto& it) -> bool { - return it->name == args[0]; - }); - - if (mc.level->ops.find(args[0]) != mc.level->ops.end()) { + std::string nicknameLower = args[0]; + std::transform(nicknameLower.begin(), nicknameLower.end(), nicknameLower.begin(), ::tolower); + + if (mc.level->ops.find(nicknameLower) != mc.level->ops.end()) { return "op: player " + args[0] + " already opped"; } - mc.level->ops.emplace((*it)->name); + mc.level->ops.emplace(nicknameLower); return "op: successfully opped player " + args[0]; } diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index 2c429ed..4c667b5 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -161,6 +161,44 @@ int main(int numArguments, char* pszArgs[]) { ((MAIN_CLASS*)g_app)->selectLevel(levelDir, levelName, settings); ((MAIN_CLASS*)g_app)->hostMultiplayer(port); + // Reading ops + std::ifstream ops("ops.txt"); + + if (ops.is_open()) { + std::string line; + + while (std::getline(ops, line)) { + if (!line.empty()) { + ((MAIN_CLASS*)g_app)->level->ops.insert(line); + } + } + } else { + std::ofstream opsDefault("ops.txt"); + + if (!opsDefault.is_open()) { + throw std::runtime_error("Cannot create ops list."); + } + } + + // Reading banned ppl + std::ifstream banned("banned-players.txt"); + + if (banned.is_open()) { + std::string line; + + while (std::getline(banned, line)) { + if (!line.empty()) { + ((MAIN_CLASS*)g_app)->level->bannedPpl.insert(line); + } + } + } else { + std::ofstream bannedPpl("banned-players.txt"); + + if (!bannedPpl.is_open()) { + throw std::runtime_error("Cannot create banned players list."); + } + } + std::cout << "Level has been generated in " << getTimeS() - startTime << std::endl; ((MAIN_CLASS*)g_app)->level->saveLevelData(); std::cout << "Level has been saved!" << std::endl; @@ -171,7 +209,30 @@ int main(int numArguments, char* pszArgs[]) { sleepMs(20); } + std::ofstream opsWrite("ops.txt"); + + if (opsWrite.is_open()) { + for (auto& op : ((MAIN_CLASS*)g_app)->level->ops) { + opsWrite << op << std::endl; + } + opsWrite.close(); + } else { + throw std::runtime_error("Cannot open ops list."); + } + + std::ofstream bannedWrite("banned-players.txt"); + + if (bannedWrite.is_open()) { + for (auto& banned : ((MAIN_CLASS*)g_app)->level->bannedPpl) { + bannedWrite << banned << std::endl; + } + bannedWrite.close(); + } else { + throw std::runtime_error("Cannot open banned players list."); + } + ((MAIN_CLASS*)g_app)->level->saveLevelData(); + delete app; appContext.platform->finish(); delete appContext.platform; diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index fd0b5f3..493ddfe 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -149,6 +149,12 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginSta LOGI("Disconnect! Nickname is taken!\n"); #ifndef STANDALONE_SERVER minecraft->setScreen(new DisconnectionScreen("Could not connect: Nickname is taken!")); +#endif + } + if (packet->status == LoginStatus::Failed_Banned) { + LOGI("Disconnect! You're banned from this server!\n"); +#ifndef STANDALONE_SERVER + minecraft->setScreen(new DisconnectionScreen("Could not connect: You're banned from this server!")); #endif } } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index b184d8b..20d375b 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -159,7 +159,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChatPack { auto player = getPlayer(source); - if (player == nullptr) return; // TODO maybe kick? + if (player == nullptr) return; // @todo maybe kick? if (packet->message[0] == '/') { // This is a command @@ -223,11 +223,27 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac if (oldClient || oldServer || !packet->newProto) loginStatus = oldClient || !packet->newProto? LoginStatus::Failed_ClientOld : LoginStatus::Failed_ServerOld; + std::string nicknameLower = packet->clientName.C_String(); + std::transform(nicknameLower.begin(), nicknameLower.end(), nicknameLower.begin(), ::tolower); + + printf("%s lower \n", nicknameLower.c_str()); for (int i = 0; i < level->players.size(); i++) { ServerPlayer* player = (ServerPlayer*) level->players.at(i); - - if (player->name == packet->clientName.C_String()) { + + std::string clientLower = player->name; + std::transform(clientLower.begin(), clientLower.end(), clientLower.begin(), ::tolower); + + // @todo to lower case + if (nicknameLower == clientLower) { loginStatus = packet->newProto ? LoginStatus::Failed_TakenNickname : LoginStatus::Failed_ClientOld; + break; + } + } + + for (auto& banned : level->bannedPpl) { + if (nicknameLower == banned) { + loginStatus = packet->newProto ? LoginStatus::Failed_Banned : LoginStatus::Failed_ClientOld; + break; } } diff --git a/src/network/packet/LoginStatusPacket.h b/src/network/packet/LoginStatusPacket.h index efa10f5..e2e0957 100755 --- a/src/network/packet/LoginStatusPacket.h +++ b/src/network/packet/LoginStatusPacket.h @@ -9,6 +9,7 @@ namespace LoginStatus { const int Failed_ClientOld = 1; const int Failed_ServerOld = 2; const int Failed_TakenNickname = 3; + const int Failed_Banned = 4; } class LoginStatusPacket : public Packet { diff --git a/src/world/level/Level.h b/src/world/level/Level.h index edf1747..a7196ed 100755 --- a/src/world/level/Level.h +++ b/src/world/level/Level.h @@ -309,7 +309,7 @@ public: Random random; std::set ops; - + std::set bannedPpl; protected: bool isFindingSpawn; From 890604256b5028f119128f79f5e669643926c6eb Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 11 May 2026 04:51:03 +0500 Subject: [PATCH 134/189] Fixes and New Additions Added GUI Styles with 3 options: Java, Pi/Xperia and Pocket Hopefully fixed touch input eating and breaking blocks bug Fire should render on all mobs now Fixed only one side of the first person burning animation being animated Added Window Scaling Option for PC Users (Hasn't been tested on other platforms Render Distance is now configurable from the settings menu Tried to fix shadows again on IOS and Android, hopefully works? Block Outline Selection now has a thicker outline for better visibility --- data/lang/en_US.lang | 6 ++ src/client/Minecraft.cpp | 46 +++++++-- src/client/Options.cpp | 7 ++ src/client/Options.h | 4 + src/client/gui/components/OptionsItem.cpp | 22 +++++ src/client/gui/screens/DeathScreen.cpp | 33 ++++++- .../screens/IngameBlockSelectionScreen.cpp | 31 ++++-- .../gui/screens/IngameBlockSelectionScreen.h | 1 + src/client/gui/screens/OptionsScreen.cpp | 3 + src/client/gui/screens/PauseScreen.cpp | 94 +++++++++++------- src/client/gui/screens/ScreenChooser.cpp | 2 +- src/client/gui/screens/StartMenuScreen.cpp | 97 ++++++++++++------- src/client/gui/screens/StartMenuScreen.h | 8 +- src/client/renderer/LevelRenderer.cpp | 2 +- src/client/renderer/entity/EntityRenderer.cpp | 12 +-- .../renderer/ptexture/DynamicTexture.cpp | 4 +- src/client/renderer/ptexture/DynamicTexture.h | 2 +- 17 files changed, 264 insertions(+), 110 deletions(-) diff --git a/data/lang/en_US.lang b/data/lang/en_US.lang index b7c2ca9..c90c4be 100755 --- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -229,6 +229,12 @@ options.fancyGraphics=Fancy graphics options.renderDebug=Debug render options.anaglyph3d=3D anaglyph +options.windowScale =Window Scaling + +options.menuStyle =Menu Style +options.menuStyle.pocket =Pocket Edition +options.menuStyle.xperia =Xperia/Pi +options.menuStyle.java =Java Beta performance.max=Max FPS performance.balanced=Balanced diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index db32ae2..eadb978 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -843,7 +843,7 @@ void Minecraft::tickInput() { if (key == Keyboard::KEY_ESCAPE) pauseGame(false); - #ifndef OPENGL_ES + #ifdef PLATFORM_DESKTOP if (key == Keyboard::KEY_P) { static bool isWireFrame = false; isWireFrame = !isWireFrame; @@ -864,12 +864,14 @@ void Minecraft::tickInput() { static bool prevMouseDownLeft = false; - if (Mouse::getButtonState(MouseAction::ACTION_LEFT) == 0) { - gameMode->stopDestroyBlock(); - } + if (!useTouchscreen()) { + if (Mouse::getButtonState(MouseAction::ACTION_LEFT) == 0) { + gameMode->stopDestroyBlock(); + } - if (!Mouse::isButtonDown(MouseAction::ACTION_RIGHT)) { - gameMode->releaseUsingItem(player); + if (!Mouse::isButtonDown(MouseAction::ACTION_RIGHT)) { + gameMode->releaseUsingItem(player); + } } if (useTouchscreen()) { @@ -1142,7 +1144,8 @@ void Minecraft::init() textures->addDynamicTexture(new WaterSideTexture()); textures->addDynamicTexture(new LavaTexture()); textures->addDynamicTexture(new LavaSideTexture()); - textures->addDynamicTexture(new FireTexture()); + textures->addDynamicTexture(new FireTexture(0)); + textures->addDynamicTexture(new FireTexture(1)); gui.texturesLoaded(textures); levelRenderer = new LevelRenderer(this); @@ -1191,6 +1194,27 @@ void Minecraft::setSize(int w, int h) { width = w; height = h; + int screenWidth; + int screenHeight; +//#ifdef PLATFORM_DESKTOP +if (options.getBooleanValue(OPTIONS_WINDOW_SCALE)){ // scales with resolution using a formula instead of having hardcoded if checks + int guiScale = options.getIntValue(OPTIONS_GUI_SCALE); + if (guiScale == 0) { + guiScale = 1000; + } + + // determine gui scale, optionally overriding auto + + + Gui::GuiScale = (float)Mth::Min(guiScale, Mth::Max(1, Mth::Min(width / 320, height / 240))); + + // 2. Calculate the Inverse based on the NEW scale + Gui::InvGuiScale = 1.0f / Gui::GuiScale; + screenWidth = (int)(width * Gui::InvGuiScale); + screenHeight = (int)(height * Gui::InvGuiScale); + +} else { + int guiScale = options.getIntValue(OPTIONS_GUI_SCALE); @@ -1228,8 +1252,8 @@ void Minecraft::setSize(int w, int h) { } Gui::InvGuiScale = 1.0f / Gui::GuiScale; - int screenWidth = (int)(width * Gui::InvGuiScale); - int screenHeight = (int)(height * Gui::InvGuiScale); + screenWidth = (int)(width * Gui::InvGuiScale); + screenHeight = (int)(height * Gui::InvGuiScale); // if (platform()) { // float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER); @@ -1237,6 +1261,8 @@ void Minecraft::setSize(int w, int h) { // pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale); // } +#endif +} Config config = createConfig(this); gui.onConfigChanged(config); @@ -1251,7 +1277,7 @@ void Minecraft::setSize(int w, int h) { char resbuf[128]; sprintf(resbuf, " %d x %d @ scale %.2f", width, height, Gui::GuiScale); //gui.addMessage(resbuf); -#endif + #endif /* STANDALONE_SERVER */ } diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 5a438eb..0785d4d 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -82,6 +82,10 @@ OptionBool restoredAnims("restoredAnims", true); OptionInt debugStyle("debugStyle", 0, 0, 1); +OptionInt menuStyle("menuStyle",0, 0, 2); + +OptionBool windowScale("windowScale", false); + OptionInt keyForward("key.forward", Keyboard::KEY_W); OptionInt keyLeft("key.left", Keyboard::KEY_A); OptionInt keyBack("key.back", Keyboard::KEY_S); @@ -134,6 +138,7 @@ void Options::initTable() { m_options[OPTIONS_GUI_SCALE] = &guiScale; + m_options[OPTIONS_WINDOW_SCALE] = &windowScale; m_options[OPTIONS_SKIN] = &skin; m_options[OPTIONS_USERNAME] = &username; @@ -170,6 +175,8 @@ void Options::initTable() { m_options[OPTIONS_SERVER_VISIBLE] = &serverVisible; + m_options[OPTIONS_MENU_STYLE] = &menuStyle; + m_options[OPTIONS_KEY_FORWARD] = &keyForward; m_options[OPTIONS_KEY_LEFT] = &keyLeft; m_options[OPTIONS_KEY_BACK] = &keyBack; diff --git a/src/client/Options.h b/src/client/Options.h index 90aea6c..001a555 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -37,6 +37,7 @@ enum OptionId { OPTIONS_BAR_ON_TOP, OPTIONS_ALLOW_SPRINT, OPTIONS_AUTOJUMP, + OPTIONS_WINDOW_SCALE, // Graphics OPTIONS_RENDER_DEBUG, @@ -51,6 +52,7 @@ enum OptionId { OPTIONS_FANCY_GRAPHICS, OPTIONS_NORMAL_LIGHTING, + // Cheats / debug OPTIONS_FLY_SPEED, OPTIONS_CAMERA_SPEED, @@ -95,6 +97,8 @@ enum OptionId { OPTIONS_BEAUTIFUL_SKY, OPTIONS_VIGNETTE, OPTIONS_DEBUG_STYLE, + OPTIONS_COMPLETE_LIGHTING, + OPTIONS_MENU_STYLE, // Should be last! OPTIONS_COUNT }; diff --git a/src/client/gui/components/OptionsItem.cpp b/src/client/gui/components/OptionsItem.cpp index d55b447..93eccb8 100755 --- a/src/client/gui/components/OptionsItem.cpp +++ b/src/client/gui/components/OptionsItem.cpp @@ -56,6 +56,28 @@ void OptionsItem::render( Minecraft* minecraft, int xm, int ym ) { } text += ": " + scaleText; } + if (m_optionId == OPTIONS_MENU_STYLE) { + int value = minecraft->options.getIntValue(OPTIONS_MENU_STYLE); + std::string scaleText; + switch (value) { + case 0: scaleText = I18n::get("options.menuStyle.pocket"); break; + case 1: scaleText = I18n::get("options.menuStyle.xperia"); break; + case 2: scaleText = I18n::get("options.menuStyle.java"); break; + } + text += ": " + scaleText; + } + if (m_optionId == OPTIONS_VIEW_DISTANCE) { + int value = minecraft->options.getIntValue(OPTIONS_VIEW_DISTANCE); + std::string scaleText; + switch (value) { + case 0: scaleText = I18n::get("options.renderDistance.far"); break; + case 1: scaleText = I18n::get("options.renderDistance.normal"); break; + case 2: scaleText = I18n::get("options.renderDistance.short"); break; + case 3: scaleText = I18n::get("options.renderDistance.tiny"); break; + default: scaleText = "Debug"; break; + } + text += ": " + scaleText; + } minecraft->font->draw(text, (float)x, (float)y + yOffset, 0x909090, false); super::render(minecraft, xm, ym); diff --git a/src/client/gui/screens/DeathScreen.cpp b/src/client/gui/screens/DeathScreen.cpp index 411b148..e97b103 100755 --- a/src/client/gui/screens/DeathScreen.cpp +++ b/src/client/gui/screens/DeathScreen.cpp @@ -23,12 +23,15 @@ DeathScreen::~DeathScreen() void DeathScreen::init() { - if (/* minecraft->useTouchscreen() */ true) { + if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 0) { bRespawn = new Touch::TButton(1, "Respawn!"); bTitle = new Touch::TButton(2, "Main menu"); - } else { + } else if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 1) { bRespawn = new Button(1, "Respawn!"); bTitle = new Button(2, "Main menu"); + } else { + bRespawn = new Button(1, 0, 0, 200, 20, "Respawn"); + bTitle = new Button(2, 0, 0, 200, 20, "Title menu"); } buttons.push_back(bRespawn); buttons.push_back(bTitle); @@ -39,13 +42,23 @@ void DeathScreen::init() void DeathScreen::setupPositions() { - bRespawn->width = bTitle->width = width / 4; +if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){ + bRespawn->width = 200; + bTitle->width = 200; + int centerX = (width / 2) - (bRespawn->width / 2); + bRespawn->x = centerX; + bTitle->x = centerX; + + bRespawn->y = (height / 2); + bTitle->y = bRespawn->y + 24; +} else { + bRespawn->width = bTitle->width = width / 4; bRespawn->y = bTitle->y = height / 2; bRespawn->x = width/2 - bRespawn->width - 10; bTitle->x = width/2 + 10; - - LOGI("xyz: %d, %d (%d, %d)\n", bTitle->x, bTitle->y, width, height); +} +// LOGI("xyz: %d, %d (%d, %d)\n", bTitle->x, bTitle->y, width, height); } void DeathScreen::tick() { @@ -56,10 +69,20 @@ void DeathScreen::render( int xm, int ym, float a ) { fillGradient(0, 0, width, height, 0x60500000, 0xa0803030); +if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){ + glPushMatrix2(); + glScalef2(2, 2, 2); + drawCenteredString(font, "Game over!", width / 2 / 2, height / 8, 0xffffff); + glPopMatrix2(); + std::stringstream ss; + ss << "Score: &e" << minecraft->player->getScore(); + drawCenteredString(font, ss.str(), width / 2, (height / 4) + 32, 0xffffff); +} else { glPushMatrix2(); glScalef2(2, 2, 2); drawCenteredString(font, "You died!", width / 2 / 2, height / 8, 0xffffff); glPopMatrix2(); +} if (_tick >= WAIT_TICKS) Screen::render(xm, ym, a); diff --git a/src/client/gui/screens/IngameBlockSelectionScreen.cpp b/src/client/gui/screens/IngameBlockSelectionScreen.cpp index c1b72c7..1eab145 100755 --- a/src/client/gui/screens/IngameBlockSelectionScreen.cpp +++ b/src/client/gui/screens/IngameBlockSelectionScreen.cpp @@ -12,6 +12,7 @@ #include "../../renderer/Textures.h" #include "../../gamemode/GameMode.h" #include "ArmorScreen.h" +#include "crafting/WorkbenchScreen.h" #include "../components/Button.h" #if defined(__APPLE__) @@ -27,7 +28,8 @@ IngameBlockSelectionScreen::IngameBlockSelectionScreen() InventoryRows(1), InventoryCols(1), InventorySize(1), - bArmor(1, "Armor") + bArmor(1, "Armor"), + bCrafting(1, "Crafting") { } @@ -42,6 +44,19 @@ void IngameBlockSelectionScreen::init() (float)getSlotPosY(0) - 4, (float)getSlotPosX(InventoryCols) + 4, (float)getSlotPosY(InventoryRows) + 4); + + if (!minecraft->isCreativeMode()) { + bArmor.width = 42; + bCrafting.width = 42; + + bArmor.x = 0; + bArmor.y = height - bArmor.height; + + bCrafting.x = 0; + bCrafting.y = height - bCrafting.height - 30; + buttons.push_back(&bArmor); + buttons.push_back(&bCrafting); + } ItemInstance* selected = inventory->getSelected(); if (!selected || selected->isNull()) { @@ -58,13 +73,6 @@ void IngameBlockSelectionScreen::init() } if (!isAllowed(selectedItem)) selectedItem = 0; - - if (!minecraft->isCreativeMode()) { - bArmor.width = 42; - bArmor.x = 0; - bArmor.y = height - bArmor.height; - buttons.push_back(&bArmor); - } } void IngameBlockSelectionScreen::removed() @@ -124,7 +132,7 @@ void IngameBlockSelectionScreen::renderSlots() //w.printEvery(1000, "render-blocksel"); glDisable2(GL_RESCALE_NORMAL); - Lighting::turnOn(minecraft); + Lighting::turnOff(); } int IngameBlockSelectionScreen::getSlotPosX(int slotX) { @@ -249,7 +257,7 @@ void IngameBlockSelectionScreen::mouseClicked(int x, int y, int buttonNum) //minecraft->soundEngine->playUI("random.click", 1, 1); } else { _pendingQuit = !_area.isInside((float)x, (float)y) - && !bArmor.isInside(x, y); + && !bArmor.isInside(x, y) && !bCrafting.isInside(x, y); } } if (!_pendingQuit) @@ -338,5 +346,8 @@ void IngameBlockSelectionScreen::buttonClicked( Button* button ) if (button == &bArmor) { minecraft->setScreen(new ArmorScreen()); } + if (button == &bCrafting) { + minecraft->setScreen(new WorkbenchScreen(Recipe::SIZE_2X2)); + } super::buttonClicked(button); } diff --git a/src/client/gui/screens/IngameBlockSelectionScreen.h b/src/client/gui/screens/IngameBlockSelectionScreen.h index affd6af..6a0c4b9 100755 --- a/src/client/gui/screens/IngameBlockSelectionScreen.h +++ b/src/client/gui/screens/IngameBlockSelectionScreen.h @@ -52,6 +52,7 @@ private: bool _pendingQuit; Button bArmor; + Button bCrafting; RectangleArea _area; }; diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 77d5a5f..d4eced8 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -197,6 +197,7 @@ void OptionsScreen::generateOptionScreens() { optionPanes[1]->addOptionItem(OPTIONS_DIFFICULTY, minecraft) .addOptionItem(OPTIONS_SERVER_VISIBLE, minecraft) .addOptionItem(OPTIONS_THIRD_PERSON_VIEW, minecraft) + .addOptionItem(OPTIONS_WINDOW_SCALE, minecraft) .addOptionItem(OPTIONS_GUI_SCALE, minecraft) .addOptionItem(OPTIONS_SENSITIVITY, minecraft) .addOptionItem(OPTIONS_MUSIC_VOLUME, minecraft) @@ -223,6 +224,7 @@ void OptionsScreen::generateOptionScreens() { // .addOptionItem(&Option::ANAGLYPH, minecraft) .addOptionItem(OPTIONS_LIMIT_FRAMERATE, minecraft) .addOptionItem(OPTIONS_VSYNC, minecraft) + .addOptionItem(OPTIONS_VIEW_DISTANCE, minecraft) .addOptionItem(OPTIONS_RENDER_DEBUG, minecraft) .addOptionItem(OPTIONS_ANAGLYPH_3D, minecraft) .addOptionItem(OPTIONS_VIEW_BOBBING, minecraft) @@ -233,6 +235,7 @@ void OptionsScreen::generateOptionScreens() { optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft) .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) + .addOptionItem(OPTIONS_MENU_STYLE, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) diff --git a/src/client/gui/screens/PauseScreen.cpp b/src/client/gui/screens/PauseScreen.cpp index ab30ecb..64b611e 100755 --- a/src/client/gui/screens/PauseScreen.cpp +++ b/src/client/gui/screens/PauseScreen.cpp @@ -10,18 +10,18 @@ #include "client/gui/screens/OptionsScreen.h" PauseScreen::PauseScreen(bool wasBackPaused) -: saveStep(0), + : saveStep(0), visibleTime(0), bContinue(0), bQuit(0), bOptions(0), bQuitAndSaveLocally(0), bServerVisibility(0), -// bThirdPerson(0), + // bThirdPerson(0), wasBackPaused(wasBackPaused), // bSound(OPTIONS_SOUND_VOLUME, 1, 0), bThirdPerson(OPTIONS_THIRD_PERSON_VIEW), - bHideGui(OPTIONS_HIDEGUI) + bHideGui(OPTIONS_HIDEGUI) { ImageDef def; def.setSrc(IntRectangle(160, 144, 39, 31)); @@ -34,7 +34,7 @@ PauseScreen::PauseScreen(bool wasBackPaused) // bSound.setImageDef(def, true); defSrc.y += defSrc.h; bThirdPerson.setImageDef(def, true); - bHideGui.setImageDef(def, true); + bHideGui.setImageDef(def, true); //void setImageDef(ImageDef& imageDef, bool setButtonSize); } @@ -44,24 +44,31 @@ PauseScreen::~PauseScreen() { delete bQuitAndSaveLocally; delete bServerVisibility; delete bOptions; -// delete bThirdPerson; + // delete bThirdPerson; } void PauseScreen::init() { - if (/* minecraft->useTouchscreen() */ true) { + if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 0) { bContinue = new Touch::TButton(1, "Back to game"); bOptions = new Touch::TButton(5, "Options"); bQuit = new Touch::TButton(2, "Quit to title"); bQuitAndSaveLocally = new Touch::TButton(3, "Quit and copy map"); bServerVisibility = new Touch::TButton(4, ""); -// bThirdPerson = new Touch::TButton(5, "Toggle 3:rd person view"); - } else { + // bThirdPerson = new Touch::TButton(5, "Toggle 3:rd person view"); + } else if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 1) { bContinue = new Button(1, "Back to game"); bOptions = new Button(5, "Options"); bQuit = new Button(2, "Quit to title"); bQuitAndSaveLocally = new Button(3, "Quit and copy map"); bServerVisibility = new Button(4, ""); -// bThirdPerson = new Button(5, "Toggle 3:rd person view"); + // bThirdPerson = new Button(5, "Toggle 3:rd person view"); + } else { + bContinue = new Button(1, 0, 0, 200, 20, "Back to game"); + bServerVisibility = new Button(4, 0, 0, 200, 20, ""); + bOptions = new Button(5, 0, 0, 200, 20, "Options..."); + bQuit = new Button(2, 0, 0, 200, 20, "Save and quit to title"); + bQuitAndSaveLocally = new Button(3, 0, 0, 200, 20, "Copy and quit map"); + // bThirdPerson = new Button(5, "Toggle 3:rd person view"); } buttons.push_back(bContinue); @@ -72,12 +79,12 @@ void PauseScreen::init() { bHideGui.updateImage(&minecraft->options); // buttons.push_back(&bSound); buttons.push_back(&bThirdPerson); - //buttons.push_back(&bHideGui); + //buttons.push_back(&bHideGui); // If Back wasn't pressed, set up additional items (more than Quit to menu // and Back to game) here - - #if !defined(APPLE_DEMO_PROMOTION) && !defined(RPI) + +#if !defined(APPLE_DEMO_PROMOTION) && !defined(RPI) if (true || !wasBackPaused) { if (minecraft->raknetInstance) { if (minecraft->raknetInstance->isServer()) { @@ -85,14 +92,14 @@ void PauseScreen::init() { buttons.push_back(bServerVisibility); } else { - #if !defined(DEMO_MODE) - buttons.push_back(bQuitAndSaveLocally); - #endif +#if !defined(DEMO_MODE) + buttons.push_back(bQuitAndSaveLocally); +#endif } } } - #endif -// buttons.push_back(bThirdPerson); +#endif + // buttons.push_back(bThirdPerson); for (unsigned int i = 0; i < buttons.size(); ++i) { // if (buttons[i] == &bSound) continue; @@ -103,27 +110,48 @@ void PauseScreen::init() { } void PauseScreen::setupPositions() { - saveStep = 0; + saveStep = 0; int yBase = 16; + if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){ + yBase = 50; - bContinue->width = bOptions->width = bQuit->width = /*bThirdPerson->w =*/ 160; - bQuitAndSaveLocally->width = bServerVisibility->width = 160; + bContinue->width = bOptions->width = bQuit->width = /*bThirdPerson->w =*/ 200; + bQuitAndSaveLocally->width = bServerVisibility->width = 200; - bContinue->x = (width - bContinue->width) / 2; - bContinue->y = yBase + 32 * 1; + bContinue->x = (width - bContinue->width) / 2; + bContinue->y = yBase + 24 * 1; - bOptions->x = (width - bOptions->width) / 2; - bOptions->y = yBase + 32 * 2; + bQuitAndSaveLocally->x = bServerVisibility->x = (width - bQuitAndSaveLocally->width) / 2; + bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 24 * 2; - bQuit->x = (width - bQuit->width) / 2; - bQuit->y = yBase + 32 * 3; + bOptions->x = (width - bOptions->width) / 2; + bOptions->y = yBase + 24 * 3 + 24; + + bQuit->x = (width - bQuit->width) / 2; + bQuit->y = yBase + 24 * 4 + 24; + + } else { + bContinue->width = bOptions->width = bQuit->width = /*bThirdPerson->w =*/ 160; + bQuitAndSaveLocally->width = bServerVisibility->width = 160; + + bContinue->x = (width - bContinue->width) / 2; + bContinue->y = yBase + 32 * 1; + + bOptions->x = (width - bOptions->width) / 2; + bOptions->y = yBase + 32 * 2; + + bQuit->x = (width - bQuit->width) / 2; + bQuit->y = yBase + 32 * 3; #if APPLE_DEMO_PROMOTION - bQuit->y += 16; + bQuit->y += 16; #endif - - bQuitAndSaveLocally->x = bServerVisibility->x = (width - bQuitAndSaveLocally->width) / 2; - bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 4; + + bQuitAndSaveLocally->x = bServerVisibility->x = (width - bQuitAndSaveLocally->width) / 2; + bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 4; + } + + // bSound.y = bThirdPerson.y = 8; // bSound.x = 4; @@ -161,9 +189,9 @@ void PauseScreen::buttonClicked(Button* button) { minecraft->setScreen(NULL); //minecraft->grabMouse(); } - if (button->id == bQuit->id) { + if (button->id == bQuit->id) { minecraft->leaveGame(); - } + } if (button->id == bQuitAndSaveLocally->id) { minecraft->leaveGame(true); } @@ -197,5 +225,5 @@ void PauseScreen::updateServerVisibilityText() ServerSideNetworkHandler* ss = (ServerSideNetworkHandler*) minecraft->netCallback; bServerVisibility->msg = ss->allowsIncomingConnections()? "Server is visible" - : "Server is invisible"; + : "Server is invisible"; } diff --git a/src/client/gui/screens/ScreenChooser.cpp b/src/client/gui/screens/ScreenChooser.cpp index 610a209..86dbdf5 100755 --- a/src/client/gui/screens/ScreenChooser.cpp +++ b/src/client/gui/screens/ScreenChooser.cpp @@ -21,7 +21,7 @@ Screen* ScreenChooser::createScreen( ScreenId id ) Screen* screen = NULL; // :sob: - if (/* _mc->useTouchscreen() */ true) { + if (_mc->options.getIntValue(OPTIONS_MENU_STYLE) == 0) { switch (id) { case SCREEN_STARTMENU: screen = new Touch::StartMenuScreen(); break; case SCREEN_SELECTWORLD: screen = new Touch::SelectWorldScreen();break; diff --git a/src/client/gui/screens/StartMenuScreen.cpp b/src/client/gui/screens/StartMenuScreen.cpp index 3fede7e..27f25ec 100755 --- a/src/client/gui/screens/StartMenuScreen.cpp +++ b/src/client/gui/screens/StartMenuScreen.cpp @@ -23,49 +23,62 @@ // Some kind of default settings, might be overridden in ::init StartMenuScreen::StartMenuScreen() -: bHost( 2, 0, 0, 160, 24, "Start Game"), - bJoin( 3, 0, 0, 160, 24, "Join Game"), - bOptions( 4, 0, 0, 160, 24, "Options"), - bQuit( 5, "") { } StartMenuScreen::~StartMenuScreen() { + delete bHost; + delete bJoin; + delete bOptions; + delete bQuit; } void StartMenuScreen::init() { - bJoin.active = bHost.active = bOptions.active = true; + if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){ + bHost = new Button( 2, 0, 0, 200, 20, "Singleplayer"); + bJoin = new Button( 3, 0, 0, 200, 20, "Multiplayer"); + bOptions = new Button( 4, 0, 0, 200, 20, "Options..."); + bQuit = new Button( 5, 0, 0, 200, 20, "Ouit Game"); + } else { + bHost = new Button( 2, 0, 0, 160, 24, "Start Game"); + bJoin = new Button( 3, 0, 0, 160, 24, "Join Game"); + bOptions = new Button( 4, 0, 0, 160, 24, "Options"); + bQuit = new Button( 5, 0, 0, 160, 24, "Ouit Game"); + } + bJoin->active = bHost->active = bOptions->active = true; if (minecraft->options.getStringValue(OPTIONS_USERNAME).empty()) { return; // tick() will redirect to UsernameScreen } - buttons.push_back(&bHost); - buttons.push_back(&bJoin); + buttons.push_back(bHost); + buttons.push_back(bJoin); //buttons.push_back(&bTest); + buttons.push_back(bQuit); - tabButtons.push_back(&bHost); - tabButtons.push_back(&bJoin); + tabButtons.push_back(bHost); + tabButtons.push_back(bJoin); + tabButtons.push_back(bQuit); #ifndef RPI - buttons.push_back(&bOptions); - tabButtons.push_back(&bOptions); + buttons.push_back(bOptions); + tabButtons.push_back(bOptions); #endif - // add quit button (top right X icon) – match OptionsScreen style - { - ImageDef def; - def.name = "gui/touchgui.png"; - def.width = 34; - def.height = 26; - def.setSrc(IntRectangle(150, 0, (int)def.width, (int)def.height)); - bQuit.setImageDef(def, true); - bQuit.scaleWhenPressed = false; - buttons.push_back(&bQuit); - // don't include in tab navigation - } + //// add quit button (top right X icon) – match OptionsScreen style + //{ + // ImageDef def; + // def.name = "gui/touchgui.png"; + // def.width = 34; + // def.height = 26; + // def.setSrc(IntRectangle(150, 0, (int)def.width, (int)def.height)); + // bQuit.setImageDef(def, true); + // bQuit.scaleWhenPressed = false; + // buttons.push_back(&bQuit); + // // don't include in tab navigation + //} copyright = "\xffMojang AB";//. Do not distribute!"; @@ -93,20 +106,30 @@ void StartMenuScreen::init() } void StartMenuScreen::setupPositions() { - int yBase = height / 2; + if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){ + int yBase = (height / 2) - 20; - bHost.y = yBase; - bJoin.y = bHost.y + 24 + 4; - bOptions.y = bJoin.y + 24 + 4; + bHost->y = yBase; + bJoin->y = bHost->y + 24; + bOptions->y = bJoin->y + 24; + bQuit->y = bOptions->y + 24; + } else { + int yBase = height / 2; + bHost->y = yBase; + bJoin->y = bHost->y + 24 + 4; + bOptions->y = bJoin->y + 24 + 4; + bQuit->y = bOptions->y + 24 + 4; + } // Center buttons - bHost.x = (width - bHost.width) / 2; - bJoin.x = (width - bJoin.width) / 2; - bOptions.x = (width - bOptions.width) / 2; + bHost->x = (width - bHost->width) / 2; + bJoin->x = (width - bJoin->width) / 2; + bOptions->x = (width - bOptions->width) / 2; + bQuit->x = (width - bQuit->width) / 2; - // position quit icon at top-right (use image-defined size) - bQuit.x = width - bQuit.width; - bQuit.y = 0; + //// position quit icon at top-right (use image-defined size) + //bQuit.x = width - bQuit.width; + //bQuit.y = 0; } void StartMenuScreen::tick() { @@ -114,7 +137,7 @@ void StartMenuScreen::tick() { void StartMenuScreen::buttonClicked(Button* button) { - if (button->id == bHost.id) + if (button->id == bHost->id) { #if defined(DEMO_MODE) || defined(APPLE_DEMO_PROMOTION) minecraft->setScreen( new SimpleChooseLevelScreen("_DemoLevel") ); @@ -122,16 +145,16 @@ void StartMenuScreen::buttonClicked(Button* button) { minecraft->screenChooser.setScreen(SCREEN_SELECTWORLD); #endif } - if (button->id == bJoin.id) + if (button->id == bJoin->id) { minecraft->locateMultiplayer(); minecraft->screenChooser.setScreen(SCREEN_JOINGAME); } - if (button->id == bOptions.id) + if (button->id == bOptions->id) { minecraft->setScreen(new OptionsScreen()); } - if (button == &bQuit) + if (button->id == bQuit->id) { minecraft->quit(); } diff --git a/src/client/gui/screens/StartMenuScreen.h b/src/client/gui/screens/StartMenuScreen.h index e2801fe..9ff3c8b 100755 --- a/src/client/gui/screens/StartMenuScreen.h +++ b/src/client/gui/screens/StartMenuScreen.h @@ -23,10 +23,10 @@ public: bool isInGameScreen(); private: - Button bHost; - Button bJoin; - Button bOptions; - ImageButton bQuit; // X button in top-right corner + Button* bHost; + Button* bJoin; + Button* bOptions; + Button* bQuit; std::string copyright; int copyrightPosX; diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index ea5120a..efccf21 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -575,7 +575,7 @@ void LevelRenderer::render(const AABB& b) const // t.color(255, 255, 255, 255); // again not needed, for some reason the vanilla source code tints it... white? maybe this was used for something else in MCPE's dev at one point? - shredder // t.offset(((Mob*)mc->player)->getPos(0).negated()); // why does this even exist normally, it just makes the thing... not render - + glLineWidth(2.0f); // make it more thick - shredder t.begin(GL_LINE_STRIP); t.vertex(b.x0, b.y0, b.z0); t.vertex(b.x1, b.y0, b.z0); diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index 692a967..335384f 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -130,9 +130,8 @@ void EntityRenderer::postRender(Entity* entity, float x, float y, float z, float if (pow > 0) { renderShadow(entity, x, y, z, pow, a); } - //} - if (entity->isOnFire()) renderFlame(entity, x, y, z, a); } + if (entity->isOnFire()) renderFlame(entity, x, y, z, a); } void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) { glDisable(GL_LIGHTING); @@ -187,7 +186,11 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po //Textures* textures = entityRenderDispatcher->textures; //textures->bind(textures->loadTexture("%clamp%/environment/shadow.png")); Textures* textures = entityRenderDispatcher->textures; - + textures->loadAndBindTexture("/misc/shadow.png"); + + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); @@ -221,9 +224,6 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po renderTileShadow(Tile::tiles[t], x, y + e->getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e->getShadowHeightOffs(), zo); } } - textures->loadAndBindTexture(("/misc/shadow.png")); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); tt.draw(); glColor4f2(1, 1, 1, 1); diff --git a/src/client/renderer/ptexture/DynamicTexture.cpp b/src/client/renderer/ptexture/DynamicTexture.cpp index 23a6464..0af8757 100755 --- a/src/client/renderer/ptexture/DynamicTexture.cpp +++ b/src/client/renderer/ptexture/DynamicTexture.cpp @@ -393,8 +393,8 @@ void LavaSideTexture::tick() { } } -FireTexture::FireTexture() - : super(((Tile*)Tile::fire)->tex), +FireTexture::FireTexture(int id) + : super(((Tile*)Tile::fire)->tex + id * 16), _tick(0), _frame(0) { diff --git a/src/client/renderer/ptexture/DynamicTexture.h b/src/client/renderer/ptexture/DynamicTexture.h index 84b902e..a38f086 100755 --- a/src/client/renderer/ptexture/DynamicTexture.h +++ b/src/client/renderer/ptexture/DynamicTexture.h @@ -106,7 +106,7 @@ class FireTexture: public DynamicTexture float* heata; public: - FireTexture(); + FireTexture(int id); ~FireTexture(); void tick(); From 8f34fbc1ecbdd2447bd812e38028f715dfecbdb5 Mon Sep 17 00:00:00 2001 From: Shredder Date: Mon, 11 May 2026 05:07:07 +0500 Subject: [PATCH 135/189] It isn't a commit without a linux compilation fail --- src/client/Minecraft.cpp | 572 +++++++++++++++++++-------------------- 1 file changed, 286 insertions(+), 286 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index eadb978..35e15e5 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -10,11 +10,11 @@ #if defined(APPLE_DEMO_PROMOTION) - #define NO_NETWORK +#define NO_NETWORK #endif #if defined(RPI) - #define CREATORMODE +#define CREATORMODE #endif #include "../network/RakNetInstance.h" #include "../network/ClientSideNetworkHandler.h" @@ -98,8 +98,8 @@ static void checkGlError(const char* tag) { #ifdef GLDEBUG while (1) { - const int errCode = glGetError(); - if (errCode == GL_NO_ERROR) break; + const int errCode = glGetError(); + if (errCode == GL_NO_ERROR) break; LOGE("################\nOpenGL-error @ %s : #%d\n", tag, errCode); } @@ -117,7 +117,7 @@ const char* Minecraft::progressMessages[] = { int Minecraft::customDebugId = Minecraft::CDI_NONE; #if defined(_MSC_VER) - #pragma warning( disable : 4355 ) // 'this' pointer in initialization list which is perfectly legal +#pragma warning( disable : 4355 ) // 'this' pointer in initialization list which is perfectly legal #endif bool Minecraft::useAmbientOcclusion = false; @@ -175,17 +175,17 @@ Minecraft::Minecraft() : width(1), height(1), //_respawnPlayerTicks(-1), #ifdef __APPLE__ - _isSuperFast(false), + _isSuperFast(false), #endif _powerVr(false), commandPort(4711), reserved_d1(0),reserved_d2(0), reserved_f1(0),reserved_f2(0), options(this) { -//#ifdef ANDROID + //#ifdef ANDROID #if defined(NO_NETWORK) - raknetInstance = new IRakNetInstance(); + raknetInstance = new IRakNetInstance(); #else raknetInstance = new RakNetInstance(); #endif @@ -265,7 +265,7 @@ void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, Loc if (level != NULL) { level->raknetInstance = raknetInstance; - gameMode->initLevel(level); + gameMode->initLevel(level); if (!player && forceInsertPlayer) { @@ -296,19 +296,19 @@ void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, Loc // Non-threaded generateLevel("Currently not used", level); } - } else { - player = NULL; - } + } else { + player = NULL; + } - this->lastTickTime = 0; + this->lastTickTime = 0; this->_running = true; } void Minecraft::leaveGame(bool renameLevel /*=false*/) { - if (isGeneratingLevel || !_hasSignaledGeneratingLevelFinished) - return; - + if (isGeneratingLevel || !_hasSignaledGeneratingLevelFinished) + return; + isGeneratingLevel = false; bool saveLevel = level && (!level->isClientSide || renameLevel); @@ -366,19 +366,19 @@ void Minecraft::prepareLevel(const std::string& title) { int Max = CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; int pp = 0; for (int x = 8; x < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); x += CHUNK_WIDTH) { - for (int z = 8; z < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); z += CHUNK_WIDTH) { - progressStagePercentage = 100 * pp++ / Max; - //printf("level generation progress %d\n", progressStagePercentage); + for (int z = 8; z < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); z += CHUNK_WIDTH) { + progressStagePercentage = 100 * pp++ / Max; + //printf("level generation progress %d\n", progressStagePercentage); B.start(); - level->getTile(x, 64, z); + level->getTile(x, 64, z); B.stop(); L.start(); if (level->isNew()) while (level->updateLights()) ; L.stop(); - } - } + } + } A.stop(); level->setUpdateLights(true); @@ -466,33 +466,33 @@ void Minecraft::update() { } TIMER_POP(); - #ifndef STANDALONE_SERVER - if (gameMode != NULL) gameMode->render(timer.a); - TIMER_PUSH("sound"); - soundEngine->update(player, timer.a); - TIMER_POP_PUSH("render"); - gameRenderer->render(timer.a); - TIMER_POP(); - #else +#ifndef STANDALONE_SERVER + if (gameMode != NULL) gameMode->render(timer.a); + TIMER_PUSH("sound"); + soundEngine->update(player, timer.a); + TIMER_POP_PUSH("render"); + gameRenderer->render(timer.a); + TIMER_POP(); +#else CThread::sleep(1); - #endif +#endif #ifndef STANDALONE_SERVER Multitouch::resetThisUpdate(); #endif - + #ifndef STANDALONE_SERVER TIMER_POP(); checkGlError("Update finished"); if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { -//#ifndef PLATFORM_DESKTOP + //#ifndef PLATFORM_DESKTOP if (!PerfTimer::enabled) { PerfTimer::reset(); PerfTimer::enabled = true; } _perfRenderer->renderFpsMeter(1); checkGlError("render debug"); -//#endif + //#endif } else { PerfTimer::enabled = false; } @@ -569,17 +569,17 @@ void Minecraft::tick(int nTick, int maxTick) { #ifndef STANDALONE_SERVER textures->loadAndBindTexture("terrain.png"); if (!pause && !(screen && !screen->renderGameBehind())) { - #if !defined(RPI) - #ifdef __APPLE__ - if (isSuperFast()) - #endif - { +#if !defined(RPI) +#ifdef __APPLE__ + if (isSuperFast()) +#endif + { if (nTick == maxTick) { TIMER_POP_PUSH("textures"); textures->tick(true); } - } - #endif + } +#endif } TIMER_POP_PUSH("particles"); if (!pause) { @@ -641,8 +641,8 @@ void Minecraft::tickInput() { while (Mouse::next()) { //if (Mouse::getButtonState(MouseAction::ACTION_LEFT)) // LOGI("mouse-down-at: %d, %d\n", Mouse::getX(), Mouse::getY()); - int passedTime = getTimeMs() - lastTickTime; - if (passedTime > 200) continue; // @note: As long Mouse::clear CLEARS the whole buffer, it's safe to break here + int passedTime = getTimeMs() - lastTickTime; + if (passedTime > 200) continue; // @note: As long Mouse::clear CLEARS the whole buffer, it's safe to break here // But since it might be rewritten anyway (and hopefully there aren't a lot of messages, we just continue. const MouseAction& e = Mouse::getEvent(); @@ -673,14 +673,14 @@ void Minecraft::tickInput() { } /* if (mouseDiggable && options.useMouseForDigging) { - if (Mouse::getEventButton() == MouseAction::ACTION_LEFT && Mouse::getEventButtonState()) { - handleMouseClick(MouseAction::ACTION_LEFT); - lastClickTick = ticks; - } - if (Mouse::getEventButton() == MouseAction::ACTION_RIGHT && Mouse::getEventButtonState()) { - handleMouseClick(MouseAction::ACTION_RIGHT); - lastClickTick = ticks; - } + if (Mouse::getEventButton() == MouseAction::ACTION_LEFT && Mouse::getEventButtonState()) { + handleMouseClick(MouseAction::ACTION_LEFT); + lastClickTick = ticks; + } + if (Mouse::getEventButton() == MouseAction::ACTION_RIGHT && Mouse::getEventButtonState()) { + handleMouseClick(MouseAction::ACTION_RIGHT); + lastClickTick = ticks; + } } */ } @@ -701,20 +701,20 @@ void Minecraft::tickInput() { if (slot >= 0 && slot < gui.getNumSlots()) player->inventory->selectSlot(slot); - #if defined(WIN32) - if (digit >= 1 && GetAsyncKeyState(VK_CONTROL) < 0) { - // Set adventure settings here! - AdventureSettingsPacket p(level->adventureSettings); - p.toggle((AdventureSettingsPacket::Flags)(1 << slot)); - p.fillIn(level->adventureSettings); - raknetInstance->send(p); - } - if (digit == 0) { - Pos pos((int)player->x, (int)player->y-1, (int)player->z); - SetSpawnPositionPacket p(pos); - raknetInstance->send(p); - } - #endif +#if defined(WIN32) + if (digit >= 1 && GetAsyncKeyState(VK_CONTROL) < 0) { + // Set adventure settings here! + AdventureSettingsPacket p(level->adventureSettings); + p.toggle((AdventureSettingsPacket::Flags)(1 << slot)); + p.fillIn(level->adventureSettings); + raknetInstance->send(p); + } + if (digit == 0) { + Pos pos((int)player->x, (int)player->y-1, (int)player->z); + SetSpawnPositionPacket p(pos); + raknetInstance->send(p); + } +#endif } if (key == Keyboard::KEY_LEFT_CTRL) { @@ -738,7 +738,7 @@ void Minecraft::tickInput() { /* ImprovedNoise noise; for (int i = 0; i < 16; ++i) - printf("%d\t%f\n", i, noise.grad2(i, 3, 8)); + printf("%d\t%f\n", i, noise.grad2(i, 3, 8)); */ } @@ -751,88 +751,88 @@ void Minecraft::tickInput() { options.set(OPTIONS_VIEW_DISTANCE, (dst + 1) % 4); } - #ifdef CHEATS - if (key == Keyboard::KEY_U) { - onGraphicsReset(); - player->heal(100); +#ifdef CHEATS + if (key == Keyboard::KEY_U) { + onGraphicsReset(); + player->heal(100); + } + + if (key == Keyboard::KEY_B || key == 108) // Toggle the game mode + setIsCreativeMode(!isCreativeMode()); + + if (key == Keyboard::KEY_P) // Step forward in time + level->setTime( level->getTime() + 1000); + + if (key == Keyboard::KEY_G) { + setScreen(new ArmorScreen()); + /* + std::vector& boxs = level->getCubes(NULL, AABB(128.1f, 73, 128.1f, 128.9f, 74.9f, 128.9f)); + LOGI("boxes: %d\n", (int)boxs.size()); + */ + } + + if (key == Keyboard::KEY_Y) { + textures->reloadAll(); + player->hurtTo(2); + } + if (key == Keyboard::KEY_Z || key == 108) { + for (int i = 0; i < 1; ++i) { + Mob* mob = NULL; + int forceId = 0;//MobTypes::Sheep; + + int types[] = { + MobTypes::Sheep, + MobTypes::Pig, + MobTypes::Chicken, + MobTypes::Cow, + }; + + int mobType = (forceId > 0)? forceId : types[Mth::random(sizeof(types) / sizeof(int))]; + mob = MobFactory::CreateMob(mobType, level); + + //((Animal*)mob)->setAge(-1000); + float dx = 4 - 8 * Mth::random() + 4 * Mth::sin(Mth::DEGRAD * player->yRot); + float dz = 4 - 8 * Mth::random() + 4 * Mth::cos(Mth::DEGRAD * player->yRot); + if (mob && !MobSpawner::addMob(level, mob, player->x + dx, player->y, player->z + dz, Mth::random()*360, 0, true)) + delete mob; } + } - if (key == Keyboard::KEY_B || key == 108) // Toggle the game mode - setIsCreativeMode(!isCreativeMode()); - - if (key == Keyboard::KEY_P) // Step forward in time - level->setTime( level->getTime() + 1000); - - if (key == Keyboard::KEY_G) { - setScreen(new ArmorScreen()); - /* - std::vector& boxs = level->getCubes(NULL, AABB(128.1f, 73, 128.1f, 128.9f, 74.9f, 128.9f)); - LOGI("boxes: %d\n", (int)boxs.size()); - */ + if (key == Keyboard::KEY_X) { + const EntityList& entities = level->getAllEntities(); + for (int i = entities.size()-1; i >= 0; --i) { + Entity* e = entities[i]; + if (!e->isPlayer()) + level->removeEntity(e); } + } - if (key == Keyboard::KEY_Y) { - textures->reloadAll(); - player->hurtTo(2); - } - if (key == Keyboard::KEY_Z || key == 108) { - for (int i = 0; i < 1; ++i) { - Mob* mob = NULL; - int forceId = 0;//MobTypes::Sheep; + if (key == Keyboard::KEY_C /*|| key == 4*/) { + player->inventory->clearInventoryWithDefault(); + // @todo: Add saving here for benchmarking + } + if (key == Keyboard::KEY_H) { + setScreen( new PrerenderTilesScreen() ); + } - int types[] = { - MobTypes::Sheep, - MobTypes::Pig, - MobTypes::Chicken, - MobTypes::Cow, - }; + if (key == Keyboard::KEY_O) { + for (int i = Inventory::MAX_SELECTION_SIZE; i < player->inventory->getContainerSize(); ++i) + if (player->inventory->getItem(i)) + player->inventory->dropSlot(i, false); + } + if (key == Keyboard::KEY_M) { + Difficulty difficulty = (Difficulty)options.getIntValue(OPTIONS_DIFFICULTY); + options.set(OPTIONS_DIFFICULTY, (difficulty == Difficulty::PEACEFUL)? + Difficulty::NORMAL : Difficulty::PEACEFUL); + //setIsCreativeMode( !isCreativeMode() ); + } - int mobType = (forceId > 0)? forceId : types[Mth::random(sizeof(types) / sizeof(int))]; - mob = MobFactory::CreateMob(mobType, level); - - //((Animal*)mob)->setAge(-1000); - float dx = 4 - 8 * Mth::random() + 4 * Mth::sin(Mth::DEGRAD * player->yRot); - float dz = 4 - 8 * Mth::random() + 4 * Mth::cos(Mth::DEGRAD * player->yRot); - if (mob && !MobSpawner::addMob(level, mob, player->x + dx, player->y, player->z + dz, Mth::random()*360, 0, true)) - delete mob; - } + if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { + if (key >= '0' && key <= '9') { + _perfRenderer->debugFpsMeterKeyPress(key - '0'); } - - if (key == Keyboard::KEY_X) { - const EntityList& entities = level->getAllEntities(); - for (int i = entities.size()-1; i >= 0; --i) { - Entity* e = entities[i]; - if (!e->isPlayer()) - level->removeEntity(e); - } - } - - if (key == Keyboard::KEY_C /*|| key == 4*/) { - player->inventory->clearInventoryWithDefault(); - // @todo: Add saving here for benchmarking - } - if (key == Keyboard::KEY_H) { - setScreen( new PrerenderTilesScreen() ); - } - - if (key == Keyboard::KEY_O) { - for (int i = Inventory::MAX_SELECTION_SIZE; i < player->inventory->getContainerSize(); ++i) - if (player->inventory->getItem(i)) - player->inventory->dropSlot(i, false); - } - if (key == Keyboard::KEY_M) { - Difficulty difficulty = (Difficulty)options.getIntValue(OPTIONS_DIFFICULTY); - options.set(OPTIONS_DIFFICULTY, (difficulty == Difficulty::PEACEFUL)? - Difficulty::NORMAL : Difficulty::PEACEFUL); - //setIsCreativeMode( !isCreativeMode() ); - } - - if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { - if (key >= '0' && key <= '9') { - _perfRenderer->debugFpsMeterKeyPress(key - '0'); - } - } - #endif + } +#endif if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) { if (key >= '0' && key <= '9') { @@ -843,25 +843,25 @@ void Minecraft::tickInput() { if (key == Keyboard::KEY_ESCAPE) pauseGame(false); - #ifdef PLATFORM_DESKTOP - if (key == Keyboard::KEY_P) { - static bool isWireFrame = false; - isWireFrame = !isWireFrame; - glPolygonMode(GL_FRONT, isWireFrame? GL_LINE : GL_FILL); - //glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL); - } - #endif - } - #ifdef WIN32 - if (key == Keyboard::KEY_M) { - for (int i = 0; i < 5 * SharedConstants::TicksPerSecond; ++i) - level->tick(); +#ifdef PLATFORM_DESKTOP + if (key == Keyboard::KEY_P) { + static bool isWireFrame = false; + isWireFrame = !isWireFrame; + glPolygonMode(GL_FRONT, isWireFrame? GL_LINE : GL_FILL); + //glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL); } - #endif +#endif + } +#ifdef WIN32 + if (key == Keyboard::KEY_M) { + for (int i = 0; i < 5 * SharedConstants::TicksPerSecond; ++i) + level->tick(); + } +#endif } TIMER_POP_PUSH("handlemouse"); - + static bool prevMouseDownLeft = false; if (!useTouchscreen()) { @@ -934,35 +934,35 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) { } if(player->isUsingItem()) return; - bool mayUse = true; + bool mayUse = true; if (!hitResult.isHit()) { if (action->isRemove() && !gameMode->isCreativeType()) { missTime = 10; } - } else if (hitResult.type == ENTITY) { - if (action->isAttack()) { + } else if (hitResult.type == ENTITY) { + if (action->isAttack()) { player->swing(); //LOGI("attacking!\n"); InteractPacket packet(InteractPacket::Attack, player->entityId, hitResult.entity->entityId); raknetInstance->send(packet); - gameMode->attack(player, hitResult.entity); + gameMode->attack(player, hitResult.entity); } else if (action->isInteract()) { if (hitResult.entity->interactPreventDefault()) mayUse = false; //LOGI("interacting!\n"); InteractPacket packet(InteractPacket::Interact, player->entityId, hitResult.entity->entityId); raknetInstance->send(packet); - gameMode->interact(player, hitResult.entity); - } - } else if (hitResult.type == TILE) { + gameMode->interact(player, hitResult.entity); + } + } else if (hitResult.type == TILE) { int x = hitResult.x; - int y = hitResult.y; - int z = hitResult.z; - int face = hitResult.f; + int y = hitResult.y; + int z = hitResult.z; + int face = hitResult.f; int oldTileId = level->getTile(x, y, z); - Tile* oldTile = Tile::tiles[oldTileId]; + Tile* oldTile = Tile::tiles[oldTileId]; //bool tryDestroyBlock = false; @@ -971,8 +971,8 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) { return; //LOGI("tile: %s - %d, %d, %d. b: %f - %f\n", oldTile->getDescriptionId().c_str(), x, y, z, oldTile->getBrightness(level, x, y, z), oldTile->getBrightness(level, x, y+1, z)); - level->extinguishFire(x, y, z, hitResult.f); - + level->extinguishFire(x, y, z, hitResult.f); + if (action->isFirstRemove()) { gameMode->startDestroyBlock(x, y, z, hitResult.f); } else { @@ -981,16 +981,16 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) { particleEngine->crack(x, y, z, hitResult.f); player->swing(); - } + } else { ItemInstance* item = player->inventory->getSelected(); - if (gameMode->useItemOn(player, level, item, x, y, z, face, hitResult.pos)) { - mayUse = false; - player->swing(); - #ifdef RPI - } else if (item && item->id == ((Item*)Item::sword_iron)->id) { - player->swing(); - #endif + if (gameMode->useItemOn(player, level, item, x, y, z, face, hitResult.pos)) { + mayUse = false; + player->swing(); +#ifdef RPI + } else if (item && item->id == ((Item*)Item::sword_iron)->id) { + player->swing(); +#endif } if (item && item->count <= 0) { player->inventory->clearSlot(player->inventory->selected); @@ -1016,7 +1016,7 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) { bool Minecraft::isOnlineClient() { - return (level != NULL && level->isClientSide); + return (level != NULL && level->isClientSide); } bool Minecraft::isOnline() @@ -1083,8 +1083,8 @@ void Minecraft::setScreen( Screen* screen ) if (screen->isInGameScreen() && level) { level->saveLevelData(); - level->saveGame(); - } + level->saveGame(); + } //noRender = false; } else { @@ -1121,7 +1121,7 @@ void Minecraft::releaseMouse() bool Minecraft::useTouchscreen() { #if defined(TARGET_OS_IPHONE) - return true; + return true; #elif defined(RPI) return false; #endif @@ -1153,7 +1153,7 @@ void Minecraft::init() particleEngine = new ParticleEngine(level, textures); // 4j's code for reference -// FoliageColor::init(textures->loadTexturePixels(L"misc/foliagecolor.png")); + // FoliageColor::init(textures->loadTexturePixels(L"misc/foliagecolor.png")); // my code @@ -1165,7 +1165,7 @@ void Minecraft::init() TextureId grassId = (textures->loadTexture("misc/grasscolor.png")); // loading the uh png for foliage color int* grassPixels = textures->loadTexturePixels(grassId, "misc/grasscolor.png"); GrassColor::init(grassPixels); - + bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); @@ -1190,82 +1190,82 @@ void Minecraft::init() void Minecraft::setSize(int w, int h) { #ifndef STANDALONE_SERVER - transformResolution(&w, &h); + transformResolution(&w, &h); width = w; height = h; int screenWidth; int screenHeight; -//#ifdef PLATFORM_DESKTOP -if (options.getBooleanValue(OPTIONS_WINDOW_SCALE)){ // scales with resolution using a formula instead of having hardcoded if checks - int guiScale = options.getIntValue(OPTIONS_GUI_SCALE); - if (guiScale == 0) { - guiScale = 1000; - } - - // determine gui scale, optionally overriding auto - - - Gui::GuiScale = (float)Mth::Min(guiScale, Mth::Max(1, Mth::Min(width / 320, height / 240))); - - // 2. Calculate the Inverse based on the NEW scale - Gui::InvGuiScale = 1.0f / Gui::GuiScale; - screenWidth = (int)(width * Gui::InvGuiScale); - screenHeight = (int)(height * Gui::InvGuiScale); - -} else { - - - int guiScale = options.getIntValue(OPTIONS_GUI_SCALE); - - // determine gui scale, optionally overriding auto - if (guiScale != 0) { - // manual selection: 1->small, 2->medium, 3->large, 4->larger, 5->largest - switch (guiScale) { - case 1: Gui::GuiScale = 2.0f; break; - case 2: Gui::GuiScale = 3.0f; break; - case 3: Gui::GuiScale = 4.0f; break; - case 4: Gui::GuiScale = 5.0f; break; - case 5: Gui::GuiScale = 6.0f; break; - default: Gui::GuiScale = 1.0f; break; // auto + //#ifdef PLATFORM_DESKTOP + if (options.getBooleanValue(OPTIONS_WINDOW_SCALE)){ // scales with resolution using a formula instead of having hardcoded if checks + int guiScale = options.getIntValue(OPTIONS_GUI_SCALE); + if (guiScale == 0) { + guiScale = 1000; } + + // determine gui scale, optionally overriding auto + + + Gui::GuiScale = (float)Mth::Min(guiScale, Mth::Max(1, Mth::Min(width / 320, height / 240))); + + + } else { - // auto compute from resolution - if (width >= 1000) { - #ifdef __APPLE__ - Gui::GuiScale = (width > 2000)? 8.0f : 4.0f; - #else - Gui::GuiScale = 4.0f; - #endif - } - else if (width >= 800) { + + + int guiScale = options.getIntValue(OPTIONS_GUI_SCALE); + + // determine gui scale, optionally overriding auto + if (guiScale != 0) { + // manual selection: 1->small, 2->medium, 3->large, 4->larger, 5->largest + switch (guiScale) { + case 1: Gui::GuiScale = 2.0f; break; + case 2: Gui::GuiScale = 3.0f; break; + case 3: Gui::GuiScale = 4.0f; break; + case 4: Gui::GuiScale = 5.0f; break; + case 5: Gui::GuiScale = 6.0f; break; + default: Gui::GuiScale = 1.0f; break; // auto + } + } else { + // auto compute from resolution + if (width >= 1000) { #ifdef __APPLE__ - Gui::GuiScale = 4.0f; + Gui::GuiScale = (width > 2000)? 8.0f : 4.0f; #else - Gui::GuiScale = 3.0f; + Gui::GuiScale = 4.0f; #endif - } - else if (width >= 400) - Gui::GuiScale = 2.0f; - else - Gui::GuiScale = 1.0f; + } + else if (width >= 800) { +#ifdef __APPLE__ + Gui::GuiScale = 4.0f; +#else + Gui::GuiScale = 3.0f; +#endif + } + else if (width >= 400) + Gui::GuiScale = 2.0f; + else + Gui::GuiScale = 1.0f; + } + + + + // if (platform()) { + // float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER); + // pixelCalc.setPixelsPerMillimeter(pixelsPerMillimeter); + // pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale); + // } + } + Gui::InvGuiScale = 1.0f / Gui::GuiScale; screenWidth = (int)(width * Gui::InvGuiScale); screenHeight = (int)(height * Gui::InvGuiScale); - // if (platform()) { - // float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER); - // pixelCalc.setPixelsPerMillimeter(pixelsPerMillimeter); - // pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale); - // } - -#endif -} Config config = createConfig(this); gui.onConfigChanged(config); - + if (screen) screen->setSize(screenWidth, screenHeight); @@ -1277,7 +1277,7 @@ if (options.getBooleanValue(OPTIONS_WINDOW_SCALE)){ // scales with resolution us char resbuf[128]; sprintf(resbuf, " %d x %d @ scale %.2f", width, height, Gui::GuiScale); //gui.addMessage(resbuf); - +#endif #endif /* STANDALONE_SERVER */ } @@ -1294,9 +1294,9 @@ void Minecraft::reloadOptions() { LOGI("Reloading-options\n"); - // @todo @fix Android and iOS behaves a bit differently when leaving - // an options screen (Android recreates OpenGL surface) - setSize(width, height); + // @todo @fix Android and iOS behaves a bit differently when leaving + // an options screen (Android recreates OpenGL surface) + setSize(width, height); } void Minecraft::_reloadInput() { @@ -1307,17 +1307,17 @@ void Minecraft::_reloadInput() { if (useTouchHolder) { inputHolder = new TouchInputHolder(this, &options); } else { - #if defined(ANDROID) || defined(__APPLE__) - inputHolder = new CustomInputHolder( - new XperiaPlayInput(&options), - new ControllerTurnInput(2, ControllerTurnInput::MODE_DELTA), - new IBuildInput()); - #else - inputHolder = new CustomInputHolder( - new KeyboardInput(&options), - new MouseTurnInput(MouseTurnInput::MODE_DELTA, width/2, height/2), - new MouseBuildInput()); - #endif +#if defined(ANDROID) || defined(__APPLE__) + inputHolder = new CustomInputHolder( + new XperiaPlayInput(&options), + new ControllerTurnInput(2, ControllerTurnInput::MODE_DELTA), + new IBuildInput()); +#else + inputHolder = new CustomInputHolder( + new KeyboardInput(&options), + new MouseTurnInput(MouseTurnInput::MODE_DELTA, width/2, height/2), + new MouseBuildInput()); +#endif } mouseHandler.setTurnInput(inputHolder->getTurnInput()); @@ -1360,7 +1360,7 @@ bool Minecraft::joinMultiplayerFromString( const std::string& server ) { std::string ip = ""; std::string port = "19132"; - + size_t pos = server.find(":"); if (pos != std::string::npos) { @@ -1371,7 +1371,7 @@ bool Minecraft::joinMultiplayerFromString( const std::string& server ) } printf("%s \n", port.c_str()); - + if (isLookingForMultiplayer && netCallback) { isLookingForMultiplayer = false; printf("test"); @@ -1382,18 +1382,18 @@ bool Minecraft::joinMultiplayerFromString( const std::string& server ) } void Minecraft::hostMultiplayer(int port) { - // Tear down last instance - raknetInstance->disconnect(); - delete netCallback; - netCallback = NULL; + // Tear down last instance + raknetInstance->disconnect(); + delete netCallback; + netCallback = NULL; #if !defined(NO_NETWORK) netCallback = new ServerSideNetworkHandler(this, raknetInstance); - #ifdef STANDALONE_SERVER - raknetInstance->host("Server", port, 16); - #else - raknetInstance->host(options.getStringValue(OPTIONS_USERNAME), port); - #endif +#ifdef STANDALONE_SERVER + raknetInstance->host("Server", port, 16); +#else + raknetInstance->host(options.getStringValue(OPTIONS_USERNAME), port); +#endif #endif } @@ -1447,9 +1447,9 @@ void Minecraft::_levelGenerated() player->resetPos(false); } - if (level && level->dimension) { - - level->dimension->FogType = options.getIntValue(OPTIONS_FOG_TYPE); + if (level && level->dimension) { + + level->dimension->FogType = options.getIntValue(OPTIONS_FOG_TYPE); } @@ -1480,14 +1480,14 @@ void Minecraft::_levelGenerated() std::string Minecraft::gatherStats1() { #ifndef STANDALONE_SERVER - return levelRenderer->gatherStats1(); + return levelRenderer->gatherStats1(); #endif return "Blank"; } std::string Minecraft::gatherStats2() { #ifndef STANDALONE_SERVER - return levelRenderer->gatherStats2(); + return levelRenderer->gatherStats2(); #endif return "Blank"; } @@ -1500,7 +1500,7 @@ std::string Minecraft::gatherStats3() { } std::string Minecraft::gatherStats4() { - return level->gatherChunkSourceStats(); + return level->gatherChunkSourceStats(); } @@ -1553,7 +1553,7 @@ void Minecraft::onGraphicsReset() { #ifndef STANDALONE_SERVER textures->clear(); - + font->onGraphicsReset(); gui.onGraphicsReset(); @@ -1592,12 +1592,12 @@ LevelStorageSource* Minecraft::getLevelSource() void Minecraft::audioEngineOn() { #ifndef STANDALONE_SERVER - soundEngine->enable(true); + soundEngine->enable(true); #endif } void Minecraft::audioEngineOff() { #ifndef STANDALONE_SERVER - soundEngine->enable(false); + soundEngine->enable(false); #endif } @@ -1668,17 +1668,17 @@ void Minecraft::optionUpdated(OptionId option, bool value ) { } void Minecraft::optionUpdated(OptionId option, float value ) { -// #ifndef STANDALONE_SERVER -// if(option == OPTIONS_PIXELS_PER_MILLIMETER) { -// pixelCalcUi.setPixelsPerMillimeter(value * Gui::InvGuiScale); -// pixelCalc.setPixelsPerMillimeter(value); -// } -// #endif + // #ifndef STANDALONE_SERVER + // if(option == OPTIONS_PIXELS_PER_MILLIMETER) { + // pixelCalcUi.setPixelsPerMillimeter(value * Gui::InvGuiScale); + // pixelCalc.setPixelsPerMillimeter(value); + // } + // #endif } void Minecraft::optionUpdated(OptionId option, int value ) { - if(option == OPTIONS_GUI_SCALE) { - // reapply screen scaling using current window size - setSize(width, height); - } + if(option == OPTIONS_GUI_SCALE) { + // reapply screen scaling using current window size + setSize(width, height); + } } From 4b69a1240a90a5282f545271866818d6cc3357c3 Mon Sep 17 00:00:00 2001 From: Shredder Date: Tue, 12 May 2026 02:25:04 +0500 Subject: [PATCH 136/189] Some fixes Fixed Missing Lighting calls and GL states which was causing stars to render too early Split Controls should hopefully work on phones now Chickens should hopefully lay eggs now --- src/client/renderer/GameRenderer.cpp | 28 +++++++++++++++++++-------- src/client/renderer/LevelRenderer.cpp | 15 +++++++------- src/world/entity/animal/Chicken.cpp | 14 +++++++------- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index 7acd4d4..e104e26 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -101,12 +101,22 @@ void GameRenderer::setupCamera(float a, int eye) { float stereoScale = 0.07f; if (mc->options.getBooleanValue(OPTIONS_ANAGLYPH_3D)) glTranslatef2(-(eye * 2 - 1) * stereoScale, 0, 0); - if (zoom != 1) { - glTranslatef2((float) zoom_x, (float) -zoom_y, 0); - glScalef2(zoom, zoom, 1); - gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); + if (mc->options.getBooleanValue(OPTIONS_BETA_SKY)){ + if (zoom != 1) { + glTranslatef2((float) zoom_x, (float) -zoom_y, 0); + glScalef2(zoom, zoom, 1); + gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance * 2.0f); + } else { + gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance * 2.0f); + } } else { - gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); + if (zoom != 1) { + glTranslatef2((float) zoom_x, (float) -zoom_y, 0); + glScalef2(zoom, zoom, 1); + gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); + } else { + gluPerspective(_setupCameraFov = getFov(a, true), mc->width / (float) mc->height, 0.05f, renderDistance); + } } glMatrixMode(GL_MODELVIEW); @@ -340,10 +350,12 @@ void GameRenderer::renderLevel(float a) { setupFog(0); glEnable2(GL_BLEND); glDisable2(GL_CULL_FACE); - glDepthMask(GL_FALSE); + glDepthMask(GL_FALSE); // @TODO commenting this out fixes Ice transparency and clouds are no longer visilbe underwater like normal beta - shredder glDisable2(GL_ALPHA_TEST); mc->textures->loadAndBindTexture("terrain.png"); - //if (mc->options.fancyGraphics) { + // @TODO - below is a commented out double render system that fixes ice transparency, but probs harm performance, add it as an option - shredder + + //if (mc->options.fancyGraphics) { // glColorMask(false, false, false, false); // int visibleWaterChunks = levelRenderer->render(cameraEntity, 1, a); // glColorMask(true, true, true, true); @@ -677,7 +689,7 @@ void GameRenderer::pick(float a) { float range = mc->gameMode->getPickRange(); bool isPicking = true; - bool freeform = mc->useTouchscreen(); //&& !mc->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA); + bool freeform = mc->useTouchscreen() && !mc->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA); if (freeform) { isPicking = updateFreeformPickDirection(a, pickDirection); diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index efccf21..2630d63 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -26,6 +26,7 @@ #include "../../client/player/LocalPlayer.h" #include "../../world/level/GrassColor.h" +#include "Lighting.h" #ifdef GFX_SMALLER_CHUNKS /* static */ const int LevelRenderer::CHUNK_SIZE = 8; @@ -1157,23 +1158,22 @@ void LevelRenderer::renderSky(float alpha) { glDisable(GL_FOG); glDisable(GL_ALPHA_TEST); - // thanks to the mcpe 0.1 decomp project a bit for this part, was not getting the gl states correctly, gles is painful - shredder + // re ported this again from beta 1.6.6, thanks to the mcpe 0.1 decomp team's code for some bit of help about the void layer - shredder // Sunrise if (mc->options.getBooleanValue(OPTIONS_BEAUTIFUL_SKY)) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + Lighting::turnOff(); float* c = level->dimension->getSunriseColor(level->getTimeOfDay(alpha), alpha); if (c != nullptr) { glDisable(GL_TEXTURE_2D); - +// glShadeModel(GL_SMOOTH); // glPushMatrix(); glRotatef(90.0f, 1.0f, 0.0f, 0.0f); glRotatef(level->getTimeOfDay(alpha) > 0.5f ? 180 : 0, 0.0f, 0.0f, 1.0f); - t.begin(GL_TRIANGLE_FAN); t.color(c[0], c[1], c[2], c[3]); t.vertex(0.0f, 100.0f, 0.0f); @@ -1190,11 +1190,12 @@ void LevelRenderer::renderSky(float alpha) { t.draw(); glPopMatrix(); +// glShadeModel(GL_FLAT); // } // gets the time of day and rotates the sun and moon png based on the time glEnable(GL_TEXTURE_2D); - glBlendFunc(GL_ONE, GL_ONE); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); glPushMatrix(); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); @@ -1326,8 +1327,8 @@ void LevelRenderer::renderAdvancedClouds(float alpha) { float cloudTime = (float)ticks + alpha; - double xo = (px + cloudTime * 0.03f) / ss; - double zo = pz / ss + 0.33f; + float xo = (px + cloudTime * 0.03f) / ss; + float zo = pz / ss + 0.33f; float yy = 108.0f - py + 0.33f; diff --git a/src/world/entity/animal/Chicken.cpp b/src/world/entity/animal/Chicken.cpp index ca08fa1..cc25555 100755 --- a/src/world/entity/animal/Chicken.cpp +++ b/src/world/entity/animal/Chicken.cpp @@ -51,13 +51,13 @@ void Chicken::aiStep() flap += flapping * 2; //@todo - //if (!isBaby()) { - // if (!level->isClientSide && --eggTime <= 0) { - // level->playSound(this, "mob.chickenplop", 1.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f); - // spawnAtLocation(Item::egg->id, 1); - // eggTime = random.nextInt(SharedConstants::TicksPerSecond * 60 * 5) + SharedConstants::TicksPerSecond * 60 * 5; - // } - //} + if (!isBaby()) { + if (!level->isClientSide && --eggTime <= 0) { + level->playSound(this, "mob.chickenplop", 1.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f); + spawnAtLocation(Item::egg->id, 1); + eggTime = random.nextInt(SharedConstants::TicksPerSecond * 60 * 5) + SharedConstants::TicksPerSecond * 60 * 5; + } + } } void Chicken::addAdditonalSaveData( CompoundTag* tag ) From 5e19ef778eb01262944f6d2f1410f387d97761d2 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Tue, 12 May 2026 22:12:52 +0300 Subject: [PATCH 137/189] FIX: memset ._. --- src/world/level/chunk/ChunkCache.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/world/level/chunk/ChunkCache.h b/src/world/level/chunk/ChunkCache.h index ee5fc49..ea4933e 100755 --- a/src/world/level/chunk/ChunkCache.h +++ b/src/world/level/chunk/ChunkCache.h @@ -26,6 +26,8 @@ public: emptyChunk = new EmptyLevelChunk(level_, NULL, 0, 0); chunks = new LevelChunk *[LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH]; + memset(chunks, 0, sizeof(LevelChunk*) * LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH); + LOGI("Chunks allocated."); } ~ChunkCache() { @@ -34,7 +36,7 @@ public: for (int i = 0; i < LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; i++) { - if (&chunks[i]) + if (chunks[i]) { chunks[i]->deleteBlockData(); delete chunks[i]; From b73f7f121d1507e251a2d88d4d8f9898665568e2 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 12 May 2026 21:29:17 +0200 Subject: [PATCH 138/189] ee --- src/network/ServerSideNetworkHandler.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 20d375b..71c4902 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -968,19 +968,17 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, Containe void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SetHealthPacket* packet ) { - LOGI("net idi nahui\n"); - - // for (unsigned int i = 0; i < level->players.size(); ++i) { - // Player* p = level->players[i]; - // if (p->owner == source) { - // if (packet->health <= -32) { - // int diff = packet->health - SetHealthPacket::HEALTH_MODIFY_OFFSET; - // if (diff > 0) p->hurt(NULL, diff); - // else if (diff < 0) p->heal(-diff); - // } - // break; - // } - // } + for (unsigned int i = 0; i < level->players.size(); ++i) { + Player* p = level->players[i]; + if (p->owner == source) { + if (packet->health <= -32) { + int diff = packet->health - SetHealthPacket::HEALTH_MODIFY_OFFSET; + if (diff > 0) p->hurt(NULL, diff); + else if (diff < 0) p->heal(-diff); + } + break; + } + } } void ServerSideNetworkHandler::handle( const RakNet::RakNetGUID& source, SignUpdatePacket* packet ) { From d7d887f882a648f1024c0a5b665f99c05dff2349 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 23 May 2026 05:29:47 +0500 Subject: [PATCH 139/189] few additions and bug fixes Added Hand Sway (not an option yet) from b1,8 Fire works properly in multiplayer now and also renders on undead mobs in sunlight now hopefully fixed bow stuck bug on touchscreen devices Fire on entites uses updated rendering from b1.6.6 Shadow bug fix attempt the 15th Added looking at block in debug screen Zombie Pigman now renders his hat layer Temporarily disabled most randomlevelsource cave, canyon and tall grass code just for this commit to test performance --- src/client/Minecraft.cpp | 4 + src/client/gui/Gui.cpp | 114 +++++++++++------- src/client/model/HumanoidModel.cpp | 39 +++--- src/client/player/LocalPlayer.cpp | 10 +- src/client/player/LocalPlayer.h | 4 + src/client/renderer/GameRenderer.cpp | 1 + src/client/renderer/ItemInHandRenderer.cpp | 13 ++ src/client/renderer/entity/EntityRenderer.cpp | 73 +++++++++++ src/client/renderer/entity/MobRenderer.cpp | 3 + src/world/entity/Entity.cpp | 9 ++ src/world/entity/Entity.h | 2 + src/world/entity/Mob.cpp | 16 ++- src/world/entity/Mob.h | 1 + src/world/entity/monster/Skeleton.cpp | 4 +- src/world/entity/monster/Zombie.cpp | 4 +- src/world/entity/player/Player.cpp | 20 ++- .../level/levelgen/RandomLevelSource.cpp | 90 +++++++------- 17 files changed, 287 insertions(+), 120 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 35e15e5..4992be4 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -857,6 +857,7 @@ void Minecraft::tickInput() { for (int i = 0; i < 5 * SharedConstants::TicksPerSecond; ++i) level->tick(); } + #endif } @@ -882,6 +883,9 @@ void Minecraft::tickInput() { handleBuildAction(&bai); } else { gameMode->stopDestroyBlock(); + if (player && player->isUsingItem()) { + gameMode->releaseUsingItem(player); + } } } else { // Desktop: left mouse = destroy/attack diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index bde57ef..324ba15 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -224,58 +224,58 @@ void Gui::handleClick(int button, int x, int y) { } } -void Gui::handleKeyPressed(int key) -{ - bool isChatting = (minecraft->screen && (dynamic_cast(minecraft->screen) || dynamic_cast(minecraft->screen))); - if (isChatting) { - // Allow scrolling the chat history with the mouse/keyboard when chat is open - if (key == 38) { // VK_UP - scrollChat(1); - return; - } else if (key == 40) { // VK_DOWN - scrollChat(-1); - return; - } else if (key == 33) { // VK_PRIOR (Page Up) - // Scroll by a page - int screenHeight = (int)(minecraft->height * InvGuiScale); - int maxVisible = (screenHeight - 48) / 9; - scrollChat(maxVisible); - return; - } else if (key == 34) { // VK_NEXT (Page Down) - int screenHeight = (int)(minecraft->height * InvGuiScale); - int maxVisible = (screenHeight - 48) / 9; - scrollChat(-maxVisible); - return; + void Gui::handleKeyPressed(int key) + { + bool isChatting = (minecraft->screen && (dynamic_cast(minecraft->screen) || dynamic_cast(minecraft->screen))); + if (isChatting) { + // Allow scrolling the chat history with the mouse/keyboard when chat is open + if (key == 38) { // VK_UP + scrollChat(1); + return; + } else if (key == 40) { // VK_DOWN + scrollChat(-1); + return; + } else if (key == 33) { // VK_PRIOR (Page Up) + // Scroll by a page + int screenHeight = (int)(minecraft->height * InvGuiScale); + int maxVisible = (screenHeight - 48) / 9; + scrollChat(maxVisible); + return; + } else if (key == 34) { // VK_NEXT (Page Down) + int screenHeight = (int)(minecraft->height * InvGuiScale); + int maxVisible = (screenHeight - 48) / 9; + scrollChat(-maxVisible); + return; + } } - } - if (key == Keyboard::KEY_F1) { - minecraft->options.toggle(OPTIONS_HIDEGUI); - } + if (key == Keyboard::KEY_F1) { + minecraft->options.toggle(OPTIONS_HIDEGUI); + } - if (key == 99) - { - if (minecraft->player->inventory->selected > 0) + if (key == 99) { - minecraft->player->inventory->selected--; + if (minecraft->player->inventory->selected > 0) + { + minecraft->player->inventory->selected--; + } + } + else if (key == 4) + { + if (minecraft->player->inventory->selected < (getNumSlots() - 2)) + { + minecraft->player->inventory->selected++; + } + } + else if (key == 100) + { + minecraft->screenChooser.setScreen(SCREEN_BLOCKSELECTION); + } + else if (key == minecraft->options.getIntValue(OPTIONS_KEY_DROP)) + { + minecraft->player->inventory->dropSlot(minecraft->player->inventory->selected, false); } } - else if (key == 4) - { - if (minecraft->player->inventory->selected < (getNumSlots() - 2)) - { - minecraft->player->inventory->selected++; - } - } - else if (key == 100) - { - minecraft->screenChooser.setScreen(SCREEN_BLOCKSELECTION); - } - else if (key == minecraft->options.getIntValue(OPTIONS_KEY_DROP)) - { - minecraft->player->inventory->dropSlot(minecraft->player->inventory->selected, false); - } -} void Gui::scrollChat(int delta) { if (delta == 0) @@ -782,6 +782,25 @@ void Gui::renderDebugInfo() { long day = worldTime / Level::TICKS_PER_DAY; long seed = lvl ? lvl->getSeed() : 0; + // Block looking at + std::string CurrentTile = "Air"; + if (minecraft->hitResult.type == TILE) { + int LookingX = minecraft->hitResult.x; + int LookingY = minecraft->hitResult.y; + int LookingZ = minecraft->hitResult.z; + + int tileID = minecraft->level->getTile(LookingX, LookingY, LookingZ); + if (tileID > 0 && tileID < 256){ + Tile* LookingTile = Tile::tiles[tileID]; + if (LookingTile != NULL) { + CurrentTile = LookingTile->getDescriptionId(); + } else { + CurrentTile = "Unknown Tile"; + } + } else { + CurrentTile = "Air"; + } + } // Build lines (NULL entry = blank gap) Font* font = minecraft->font; @@ -820,6 +839,9 @@ void Gui::renderDebugInfo() { sprintf(buf, "Biome: %s", biomeName); drawString(font, buf, 2, 124, 0xE0E0E0); + + sprintf(buf, "Looking at: %s", CurrentTile.c_str()); + drawString(font, buf, 2, 134, 0xE0E0E0); } else if (minecraft->options.getIntValue(OPTIONS_DEBUG_STYLE) == 1){ diff --git a/src/client/model/HumanoidModel.cpp b/src/client/model/HumanoidModel.cpp index 5a64657..bf004ec 100755 --- a/src/client/model/HumanoidModel.cpp +++ b/src/client/model/HumanoidModel.cpp @@ -40,10 +40,9 @@ HumanoidModel::HumanoidModel( float g /*= 0*/, float yOffset /*= 0*/, int texW / head.addBox(-4, -8, -4, 8, 8, 8, g); // Head head.setPos(0, 0 + yOffset, 0); - if (modernSkin) { - hair.addBox(-4, -8, -4, 8, 8, 8, g + 0.5f); // Outer head layer (hat) - hair.setPos(0, 0 + yOffset, 0); - } + hair.addBox(-4, -8, -4, 8, 8, 8, g + 0.5f); // Outer head layer (hat) + hair.setPos(0, 0 + yOffset, 0); + body.addBox(-4, 0, -2, 8, 12, 4, g); // Body body.setPos(0, 0 + yOffset, 0); @@ -99,17 +98,17 @@ void HumanoidModel::render(Entity* e, float time, float r, float bob, float yRot setupAnim(time, r, bob, yRot, xRot, scale); // Sync overlay with head rotation/position - if (texWidth == 64 && texHeight == 64) { - hair.xRot = head.xRot; - hair.yRot = head.yRot; - hair.zRot = head.zRot; - hair.y = head.y; - } + + hair.xRot = head.xRot; + hair.yRot = head.yRot; + hair.zRot = head.zRot; + hair.y = head.y; + head.render(scale); - if (texWidth == 64 && texHeight == 64) { - hair.render(scale); - } + + hair.render(scale); + body.render(scale); arm0.render(scale); arm1.render(scale); @@ -123,12 +122,12 @@ void HumanoidModel::render( HumanoidModel* model, float scale ) head.yRot = model->head.yRot; head.y = model->head.y; head.xRot = model->head.xRot; - if (texWidth == 64 && texHeight == 64) { - hair.yRot = head.yRot; - hair.xRot = head.xRot; - hair.zRot = head.zRot; - hair.y = head.y; - } + + hair.yRot = head.yRot; + hair.xRot = head.xRot; + hair.zRot = head.zRot; + hair.y = head.y; + arm0.xRot = model->arm0.xRot; arm0.zRot = model->arm0.zRot; @@ -273,7 +272,7 @@ void HumanoidModel::onGraphicsReset() arm1.onGraphicsReset(); leg0.onGraphicsReset(); leg1.onGraphicsReset(); - //hair.onGraphicsReset(); + hair.onGraphicsReset(); } //void renderHair(float scale) { diff --git a/src/client/player/LocalPlayer.cpp b/src/client/player/LocalPlayer.cpp index 398edcd..bc612c9 100755 --- a/src/client/player/LocalPlayer.cpp +++ b/src/client/player/LocalPlayer.cpp @@ -355,7 +355,11 @@ LocalPlayer::LocalPlayer(Minecraft* minecraft, Level* level, const std::string& armorTypeHash(0), sprinting(false), sprintDoubleTapTimer(0), - prevForwardHeld(false) + prevForwardHeld(false), + xBob(0.0f), + yBob(0.0f), + xBobO(0.0f), + yBobO(0.0f) { this->dimension = dimension; _init(); @@ -550,6 +554,10 @@ void LocalPlayer::aiStep() { //if (onGround && abilities.flying) // abilities.flying = false; + yBobO = yBob; + xBobO = xBob; + xBob += (xRot - xBob) * 0.5; + yBob += (yRot - yBob) * 0.5; if (interpolateOnly()) updateAi(); diff --git a/src/client/player/LocalPlayer.h b/src/client/player/LocalPlayer.h index e027624..d1fef05 100755 --- a/src/client/player/LocalPlayer.h +++ b/src/client/player/LocalPlayer.h @@ -22,6 +22,10 @@ public: virtual void reset(); void tick(); + + float yBob, xBob; // shredder added from b1.8/4j for the hand swaying animation + float yBobO, xBobO; // shredder added from b1.8/4j for the hand swaying animation + void move(float xa, float ya, float za); void aiStep(); diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index e104e26..c4bc08c 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -347,6 +347,7 @@ void GameRenderer::renderLevel(float a) { Lighting::turnOff(); glDisable2(GL_BLEND); glBlendFunc2(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + Lighting::turnOff(); setupFog(0); glEnable2(GL_BLEND); glDisable2(GL_CULL_FACE); diff --git a/src/client/renderer/ItemInHandRenderer.cpp b/src/client/renderer/ItemInHandRenderer.cpp index 088d93b..fb83bdd 100755 --- a/src/client/renderer/ItemInHandRenderer.cpp +++ b/src/client/renderer/ItemInHandRenderer.cpp @@ -280,6 +280,9 @@ void ItemInHandRenderer::render( float a ) float h = oHeight + (height - oHeight) * a; Player* player = mc->player; // if (selectedTile==NULL) return; + LocalPlayer* localPlayer = (LocalPlayer*)(player); + + float xr = player->xRotO + (player->xRot - player->xRotO) * a; // shredder added for hand swaying glPushMatrix2(); glRotatef2(player->xRotO + (player->xRot - player->xRotO) * a, 1, 0, 0); @@ -288,6 +291,16 @@ void ItemInHandRenderer::render( float a ) Lighting::turnOn(mc); glPopMatrix2(); + if (localPlayer) // shredder added, basically does the hand swaying animation from b1.8 + { + float xrr = localPlayer->xBobO + (localPlayer->xBob - localPlayer->xBobO) * a; + float yrr = localPlayer->yBobO + (localPlayer->yBob - localPlayer->yBobO) * a; + // 4J - was using player->xRot and yRot directly here rather than interpolating between old & current with a + float yr = player->yRotO + (player->yRot - player->yRotO) * a; + glRotatef((xr - xrr) * 0.1f, 1, 0, 0); + glRotatef((yr - yrr) * 0.1f, 0, 1, 0); + } + float br = mc->level->getBrightness(Mth::floor(player->x), Mth::floor(player->y), Mth::floor(player->z)); ItemInstance* item;// = selectedItem; diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index 335384f..a1b18c0 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -133,6 +133,8 @@ void EntityRenderer::postRender(Entity* entity, float x, float y, float z, float } if (entity->isOnFire()) renderFlame(entity, x, y, z, a); } +// duplicate renderflame below is the pre b1.6.6 way flame rendered on player and mobs, probs gonna make it an option. - shredder +/* void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) { glDisable(GL_LIGHTING); int tex = ((Tile*)Tile::fire)->tex; @@ -178,6 +180,75 @@ void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) glPopMatrix2(); glEnable2(GL_LIGHTING); } +*/ +// new renderflame ported from b1.6.6, fixes player height offset and also uses the newer style - shredder +void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) { + glDisable(GL_LIGHTING); + int tex = ((Tile*)Tile::fire)->tex; + + int xt = (tex & 0xf) << 4; + int yt = tex & 0xf0; + + float u0 = (xt) / 256.0f; + float u1 = (xt + 15.99f) / 256.0f; + float v0 = (yt) / 256.0f; + float v1 = (yt + 15.99f) / 256.0f; + + glPushMatrix2(); + glTranslatef2((float) x, (float) y, (float) z); + + float s = e->bbWidth * 1.4f; + glScalef2(s, s, s); + bindTexture("terrain.png"); + Tesselator& t = Tesselator::instance; + + float r = 0.5f; + float xo = 0.0f; + + float h = e->bbHeight / s; + float yo = (float)(e->y - e->bb.y0) / s; + + glRotatef2(-entityRenderDispatcher->playerRotY, 0, 1, 0); + glTranslatef2(0, 0, -0.3f + ((int) h) * 0.02f); + glColor4f2(1, 1, 1, 1); + + float zo = 0.0f; + int cycle_counter = 0; + + t.begin(); + while (h > 0.0f) { + float current_u0 = u0; + float current_u1 = u1; + float current_v0 = v0; + float current_v1 = v1; + + if (cycle_counter % 2 != 0) { + current_v0 = (yt + 16) / 256.0f; + current_v1 = (yt + 16 + 15.99f) / 256.0f; + } + + if ((cycle_counter / 2) % 2 == 0) { + float tmp = current_u1; + current_u1 = current_u0; + current_u0 = tmp; + } + + t.vertexUV(r - xo, 0.0f - yo, zo, current_u1, current_v1); + t.vertexUV(-r - xo, 0.0f - yo, zo, current_u0, current_v1); + t.vertexUV(-r - xo, 1.4f - yo, zo, current_u0, current_v0); + t.vertexUV(r - xo, 1.4f - yo, zo, current_u1, current_v0); + + h -= 0.45f; + yo -= 0.45f; + r *= 0.9f; + zo += 0.03f; + cycle_counter++; + } + t.draw(); + + glPopMatrix2(); + glEnable2(GL_LIGHTING); +} void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float pow, float a) { // glEnable2(GL_BLEND); @@ -229,6 +300,8 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po glColor4f2(1, 1, 1, 1); glDisable2(GL_BLEND); glDepthMask(true); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } Level* EntityRenderer::getLevel() { diff --git a/src/client/renderer/entity/MobRenderer.cpp b/src/client/renderer/entity/MobRenderer.cpp index 137a38b..f3a9661 100755 --- a/src/client/renderer/entity/MobRenderer.cpp +++ b/src/client/renderer/entity/MobRenderer.cpp @@ -218,6 +218,8 @@ void MobRenderer::renderNameTag(Mob* mob, const std::string& name, float x, floa glScalef2(-s, -s, s); + glDisable(GL_LIGHTING); + glDepthMask(false); glDisable2(GL_DEPTH_TEST); glEnable2(GL_BLEND); @@ -241,6 +243,7 @@ void MobRenderer::renderNameTag(Mob* mob, const std::string& name, float x, floa glDepthMask(true); font->draw(name, (float) fnameWidth, 0, 0xffffffff); + glEnable(GL_LIGHTING); glDisable2(GL_BLEND); glColor4f2(1, 1, 1, 1); glPopMatrix2(); diff --git a/src/world/entity/Entity.cpp b/src/world/entity/Entity.cpp index bfccad7..7be3325 100755 --- a/src/world/entity/Entity.cpp +++ b/src/world/entity/Entity.cpp @@ -465,6 +465,15 @@ void Entity::tick() baseTick(); } +void Entity::setOnFire(int numberOfSeconds) +{ + int newValue = numberOfSeconds * 20; + if (onFire < newValue) + { + onFire = newValue; + } +} + void Entity::baseTick() { TIMER_PUSH("entityBaseTick"); diff --git a/src/world/entity/Entity.h b/src/world/entity/Entity.h index 23c229f..02436a0 100755 --- a/src/world/entity/Entity.h +++ b/src/world/entity/Entity.h @@ -89,6 +89,8 @@ public: virtual bool isAlive(); virtual bool isOnFire(); + virtual void setOnFire(int numberOfSeconds); + virtual bool isPlayer(); virtual bool isCreativeModeAllowed(); diff --git a/src/world/entity/Mob.cpp b/src/world/entity/Mob.cpp index cc784f0..be601c8 100755 --- a/src/world/entity/Mob.cpp +++ b/src/world/entity/Mob.cpp @@ -169,7 +169,9 @@ void Mob::playAmbientSound() level->playSound(this, ambient, getSoundVolume(), getVoicePitch()); } } - +bool Mob::isOnFire() { + return onFire > 0 || getSharedFlag(SharedFlagsInformation::FLAG_ONFIRE); +} void Mob::baseTick() { oAttackAnim = attackAnim; @@ -177,6 +179,18 @@ void Mob::baseTick() TIMER_PUSH("mobBaseTick"); +// @TODO - check if this section i added to make fire render in mp doesnt break crap - shredder + if (!level->isClientSide) { + // Server side: Tell the client if this mob/player is still burning + setSharedFlag(SharedFlagsInformation::FLAG_ONFIRE, onFire > 0); + } else { + // Client side: If the server flag says we aren't on fire, extinguish local visual timer + if (!getSharedFlag(SharedFlagsInformation::FLAG_ONFIRE)) { + onFire = 0; + } + } +// todo ends here + if (((ambientSoundTime++ & 15) == 0) && random.nextInt(2000) < ambientSoundTime) { ambientSoundTime = -getAmbientSoundInterval(); playAmbientSound(); diff --git a/src/world/entity/Mob.h b/src/world/entity/Mob.h index 7e90196..89f0347 100755 --- a/src/world/entity/Mob.h +++ b/src/world/entity/Mob.h @@ -52,6 +52,7 @@ public: virtual bool isPickable(); virtual bool isPushable(); + virtual bool isOnFire(); virtual bool isShootable(); MoveControl* getMoveControl(); diff --git a/src/world/entity/monster/Skeleton.cpp b/src/world/entity/monster/Skeleton.cpp index 497944c..e8a8709 100755 --- a/src/world/entity/monster/Skeleton.cpp +++ b/src/world/entity/monster/Skeleton.cpp @@ -19,7 +19,7 @@ void Skeleton::aiStep() { float br = getBrightness(1); if (br > 0.5f) { if (level->canSeeSky(Mth::floor(x), Mth::floor(y), Mth::floor(z)) && random.nextFloat() * 3.5f < (br - 0.4f)) { - hurt(NULL, 1); + // hurt(NULL, 1); // no use anymore since i restored setOnFire - shredder for (int i = 0; i < 5; ++i) { float xa = (2.0f * random.nextFloat() - 1.0f) * (2.0f * random.nextFloat() - 1.0f) * 0.02f; @@ -27,7 +27,7 @@ void Skeleton::aiStep() { float za = (2.0f * random.nextFloat() - 1.0f) * (2.0f * random.nextFloat() - 1.0f) * 0.02f; level->addParticle(PARTICLETYPE(explode), x + random.nextFloat() * bbWidth * 2 - bbWidth, y + random.nextFloat() * bbHeight, z + random.nextFloat() * bbWidth * 2 - bbWidth, xa, ya, za); } - //setOnFire(8); //@todo + setOnFire(8); //@todo } } } diff --git a/src/world/entity/monster/Zombie.cpp b/src/world/entity/monster/Zombie.cpp index 5846375..3654382 100755 --- a/src/world/entity/monster/Zombie.cpp +++ b/src/world/entity/monster/Zombie.cpp @@ -55,7 +55,7 @@ void Zombie::aiStep() { float br = getBrightness(1); if (br > 0.5f) { if (level->canSeeSky(Mth::floor(x), Mth::floor(y), Mth::floor(z)) && random.nextFloat() * 3.5f < (br - 0.4f)) { - hurt(NULL, 1); + // hurt(NULL, 1); // no use anymore since i restored setOnFire - shredder for (int i = 0; i < 5; ++i) { float xa = (2.0f * random.nextFloat() - 1.0f) * (2.0f * random.nextFloat() - 1.0f) * 0.02f; @@ -63,7 +63,7 @@ void Zombie::aiStep() { float za = (2.0f * random.nextFloat() - 1.0f) * (2.0f * random.nextFloat() - 1.0f) * 0.02f; level->addParticle(PARTICLETYPE(explode), x + random.nextFloat() * bbWidth * 2 - bbWidth, y + random.nextFloat() * bbHeight, z + random.nextFloat() * bbWidth * 2 - bbWidth, xa, ya, za); } - //setOnFire(8); //@todo + setOnFire(8); //@todo } } } diff --git a/src/world/entity/player/Player.cpp b/src/world/entity/player/Player.cpp index e287acf..487b361 100755 --- a/src/world/entity/player/Player.cpp +++ b/src/world/entity/player/Player.cpp @@ -216,6 +216,7 @@ bool Player::checkBed() { return (level->getTile(bedPosition.x, bedPosition.y, bedPosition.z) == Tile::bed->id); } + void Player::tick() { bool shouldSleep = entityData.getFlag(DATA_PLAYER_FLAGS_ID, PLAYER_SLEEP_FLAG); if(shouldSleep != isSleeping()) { @@ -246,11 +247,24 @@ void Player::tick() { } super::tick(); + if (!level->isClientSide) { + // @TODO - Awful Hack Start, MCPE 0.6 doesn't deal damage with fire to players for some reason on mp, so we force it here to do it, need a better way honestly - shredder + if (level->containsFireTile(this->bb)) { + hurt(NULL, 1); + + if (!isInWater()) { + if (onFire <= 0) { + onFire = 20 * 15; + } + } + } + // Awful hack ends here + foodData.tick(this); - // if (containerMenu != NULL && !containerMenu->stillValid(this)) { - // closeContainer(); - // } + // if (containerMenu != NULL && !containerMenu->stillValid(this)) { + // closeContainer(); + // } } } diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index 5d84f35..c1b4368 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -236,26 +236,26 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { // @todo - add generation options to enable or disable extra features like lava lakes or water lakes as they affect seed parity with the original vanilla game - shredder - // //@todo: hide those chunks if they are aren't visible - if (random.nextInt(4) == 0) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = zo + random.nextInt(16) + 8; - LakeFeature feature(Tile::calmWater->id); - feature.place(level, &random, x, y, z); - // LOGI("Adding underground lake @ (%d,%d,%d)\n", x, y, z); - } + //// //@todo: hide those chunks if they are aren't visible + //if (random.nextInt(4) == 0) { + // int x = xo + random.nextInt(16) + 8; + // int y = random.nextInt(128); + // int z = zo + random.nextInt(16) + 8; + // LakeFeature feature(Tile::calmWater->id); + // feature.place(level, &random, x, y, z); + // // LOGI("Adding underground lake @ (%d,%d,%d)\n", x, y, z); + //} - ////@todo: hide those chunks if they are aren't visible - if (random.nextInt(8) == 0) { - int x = xo + random.nextInt(16) + 8; - int y = random.nextInt(random.nextInt(120) + 8); - int z = zo + random.nextInt(16) + 8; - if (y < 64 || random.nextInt(10) == 0) { - LakeFeature feature(Tile::calmLava->id); - feature.place(level, &random, x, y, z); - } - } + //////@todo: hide those chunks if they are aren't visible + //if (random.nextInt(8) == 0) { + // int x = xo + random.nextInt(16) + 8; + // int y = random.nextInt(random.nextInt(120) + 8); + // int z = zo + random.nextInt(16) + 8; + // if (y < 64 || random.nextInt(10) == 0) { + // LakeFeature feature(Tile::calmLava->id); + // feature.place(level, &random, x, y, z); + // } + //} static float totalTime = 0; const float st = getTimeS(); @@ -434,30 +434,30 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { //} // reworked code from above to generate ferns and shrubs to just like in beta java -int grassCount = 0; - -if (biome == Biome::forest) { grassCount = 2; } -else if (biome == Biome::rainForest) { grassCount = 10; } -else if (biome == Biome::seasonalForest) { grassCount = 2; } -else if (biome == Biome::taiga) { grassCount = 1; } -else if (biome == Biome::plains) { grassCount = 10; } - -for (int i = 0; i < grassCount; i++) { - int grassMetadata = TallGrass::TALL_GRASS; - - - if (biome == Biome::rainForest && random.nextInt(3) != 0) { - grassMetadata = TallGrass::FERN; - } - - int x = xo + random.nextInt(16) + 8; - - int z = zo + random.nextInt(16) + 8; - int y = level->getHeightmap(x, z); - - TallgrassFeature grassFeature(Tile::tallgrass->id, grassMetadata); - grassFeature.place(level, &random, x, y, z); -} +//int grassCount = 0; +// +//if (biome == Biome::forest) { grassCount = 2; } +//else if (biome == Biome::rainForest) { grassCount = 10; } +//else if (biome == Biome::seasonalForest) { grassCount = 2; } +//else if (biome == Biome::taiga) { grassCount = 1; } +//else if (biome == Biome::plains) { grassCount = 10; } +// +//for (int i = 0; i < grassCount; i++) { +// int grassMetadata = TallGrass::TALL_GRASS; +// +// +// if (biome == Biome::rainForest && random.nextInt(3) != 0) { +// grassMetadata = TallGrass::FERN; +// } +// +// int x = xo + random.nextInt(16) + 8; +// +// int z = zo + random.nextInt(16) + 8; +// int y = level->getHeightmap(x, z); +// +// TallgrassFeature grassFeature(Tile::tallgrass->id, grassMetadata); +// grassFeature.place(level, &random, x, y, z); +//} for (int i = 0; i < 10; i++) { @@ -557,8 +557,8 @@ LevelChunk* RandomLevelSource::getChunk(int xOffs, int zOffs) { buildSurfaces(xOffs, zOffs, blocks, biomes); // Carve caves into the chunk - caveFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); - canyonFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); +// caveFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); +// canyonFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); levelChunk->recalcHeightmap(); return levelChunk; From 061d6db3a937fd4b86c90ac999b5fa3f30824afc Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 23 May 2026 05:46:11 +0500 Subject: [PATCH 140/189] add burp1.ogg to fix android compilation --- project/android_java/res/raw/burp1.ogg | Bin 0 -> 6337 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 project/android_java/res/raw/burp1.ogg diff --git a/project/android_java/res/raw/burp1.ogg b/project/android_java/res/raw/burp1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..5ad3f57dfad010393dcf5bf13ff4dafdd601beed GIT binary patch literal 6337 zcmai1c|6qJ_y3G7Te9V`3=NqWQHBv?DQk?Z!(eEVeVHi6C`l%UED^FLJhrh@_N8b; z$SzwFPqI^%63OHDnd$p{f8XC9zt{J^?%X-|oO|B)+;h*p=YGsRJgfjF;9q6l`cW;N zEZQ5ffk;3CulhTCk?0JFemVUQ0Iu;t82^nBbGqig3tf{g;jX&U$fI@eABB(kH;e)( zwez~>dCJ`119rvB*@giQ!@!gjk%~yL!ep&nJe|nyZoXs>54QjW9UH>>TUkn1&jtc$ z1AsJ1SnfQHBt+#E)wK|rh3fVZS4DJ9_`;w{CJt}mqy))=9Nj1f**gOXIDoEjSLcQx zHAaVBk_y+dOA43K0;wo8$n&D}cy<424A7pSREJ%hI;*J09X_YF1Em_E?RY`nB8+-O zw=pBU91RYZRxz>&XG1SSsjuW^W5U`L8-=JWDzf*&J}Y*<3+K{}$_U4(?1)l5bZ!X! zor!!}B@H`pDRcP@{qq?A^ zM=?$4g-lXk*L)_j52W%k@!T2UxP{EN96aZ5N~S7kAVZGM^Xpr>oXOV#QYR{c5;EfI zK#H}(D?Z~w6-XI11z{gupz}y{C`Pl~z68w_pm&Q~no=JPw1bp+$I{14-hU5ajAJ+% zT(357WSr9n1pCl}C+s|*v#8RN&W}Y!4$<&T-Q~eW&w^xic6f>()>!7Z!bChJHuzxqAC@0KVuB15cp3+80dRlHWAkZOFFW16rw28pHr^*w>x3`2W@o zXg?p^k{_%J!%8Z{Rt7k-+gK_Y-w@(39zpmKG6mKhvX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=tBK5@1 zP+e*Z?x4Mm`K6M#veu%!x14(s+iCmwM>l@0#f!{$(N6vRIp3LuJR@{Gj2}7@R%!Yr z6dhd^eEt1WdfyG@*LcPFZ#Y3k{yK?hd(>IMsXu$rz4*(PvAU<*^Hate8YYb1F5i+p zN6gwf?P_cuk-1!`#Jzchi;T$gcS(t6Ul+}_h=>~8)misU7FtlQ*=lCZVHO7@WcEq5 z8m17jC^HSKs3<_Q75nYsVQJ%4AJ@?0y$wxI Date: Sat, 23 May 2026 06:03:34 +0500 Subject: [PATCH 141/189] renable generation features --- .../level/levelgen/RandomLevelSource.cpp | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/world/level/levelgen/RandomLevelSource.cpp b/src/world/level/levelgen/RandomLevelSource.cpp index c1b4368..5d84f35 100755 --- a/src/world/level/levelgen/RandomLevelSource.cpp +++ b/src/world/level/levelgen/RandomLevelSource.cpp @@ -236,26 +236,26 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { // @todo - add generation options to enable or disable extra features like lava lakes or water lakes as they affect seed parity with the original vanilla game - shredder - //// //@todo: hide those chunks if they are aren't visible - //if (random.nextInt(4) == 0) { - // int x = xo + random.nextInt(16) + 8; - // int y = random.nextInt(128); - // int z = zo + random.nextInt(16) + 8; - // LakeFeature feature(Tile::calmWater->id); - // feature.place(level, &random, x, y, z); - // // LOGI("Adding underground lake @ (%d,%d,%d)\n", x, y, z); - //} + // //@todo: hide those chunks if they are aren't visible + if (random.nextInt(4) == 0) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = zo + random.nextInt(16) + 8; + LakeFeature feature(Tile::calmWater->id); + feature.place(level, &random, x, y, z); + // LOGI("Adding underground lake @ (%d,%d,%d)\n", x, y, z); + } - //////@todo: hide those chunks if they are aren't visible - //if (random.nextInt(8) == 0) { - // int x = xo + random.nextInt(16) + 8; - // int y = random.nextInt(random.nextInt(120) + 8); - // int z = zo + random.nextInt(16) + 8; - // if (y < 64 || random.nextInt(10) == 0) { - // LakeFeature feature(Tile::calmLava->id); - // feature.place(level, &random, x, y, z); - // } - //} + ////@todo: hide those chunks if they are aren't visible + if (random.nextInt(8) == 0) { + int x = xo + random.nextInt(16) + 8; + int y = random.nextInt(random.nextInt(120) + 8); + int z = zo + random.nextInt(16) + 8; + if (y < 64 || random.nextInt(10) == 0) { + LakeFeature feature(Tile::calmLava->id); + feature.place(level, &random, x, y, z); + } + } static float totalTime = 0; const float st = getTimeS(); @@ -434,30 +434,30 @@ void RandomLevelSource::postProcess(ChunkSource* parent, int xt, int zt) { //} // reworked code from above to generate ferns and shrubs to just like in beta java -//int grassCount = 0; -// -//if (biome == Biome::forest) { grassCount = 2; } -//else if (biome == Biome::rainForest) { grassCount = 10; } -//else if (biome == Biome::seasonalForest) { grassCount = 2; } -//else if (biome == Biome::taiga) { grassCount = 1; } -//else if (biome == Biome::plains) { grassCount = 10; } -// -//for (int i = 0; i < grassCount; i++) { -// int grassMetadata = TallGrass::TALL_GRASS; -// -// -// if (biome == Biome::rainForest && random.nextInt(3) != 0) { -// grassMetadata = TallGrass::FERN; -// } -// -// int x = xo + random.nextInt(16) + 8; -// -// int z = zo + random.nextInt(16) + 8; -// int y = level->getHeightmap(x, z); -// -// TallgrassFeature grassFeature(Tile::tallgrass->id, grassMetadata); -// grassFeature.place(level, &random, x, y, z); -//} +int grassCount = 0; + +if (biome == Biome::forest) { grassCount = 2; } +else if (biome == Biome::rainForest) { grassCount = 10; } +else if (biome == Biome::seasonalForest) { grassCount = 2; } +else if (biome == Biome::taiga) { grassCount = 1; } +else if (biome == Biome::plains) { grassCount = 10; } + +for (int i = 0; i < grassCount; i++) { + int grassMetadata = TallGrass::TALL_GRASS; + + + if (biome == Biome::rainForest && random.nextInt(3) != 0) { + grassMetadata = TallGrass::FERN; + } + + int x = xo + random.nextInt(16) + 8; + + int z = zo + random.nextInt(16) + 8; + int y = level->getHeightmap(x, z); + + TallgrassFeature grassFeature(Tile::tallgrass->id, grassMetadata); + grassFeature.place(level, &random, x, y, z); +} for (int i = 0; i < 10; i++) { @@ -557,8 +557,8 @@ LevelChunk* RandomLevelSource::getChunk(int xOffs, int zOffs) { buildSurfaces(xOffs, zOffs, blocks, biomes); // Carve caves into the chunk -// caveFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); -// canyonFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); + caveFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); + canyonFeature.apply(this, level, xOffs, zOffs, blocks, LevelChunk::ChunkBlockCount); levelChunk->recalcHeightmap(); return levelChunk; From 3ebed84cdbe619817580dc433176d07431867a70 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Thu, 2 Jul 2026 16:32:17 +0300 Subject: [PATCH 142/189] FIX: crash while joining to large world server --- src/client/Minecraft.cpp | 1 + src/network/ClientSideNetworkHandler.cpp | 2 +- src/world/level/chunk/LevelChunk.cpp | 2 +- src/world/level/chunk/LevelChunk.h | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index bb2f579..4e1a1ad 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1137,6 +1137,7 @@ bool Minecraft::supportNonTouchScreen() { } void Minecraft::init() { + LevelChunk::ChunkBlockCount = LevelConstants::CHUNK_BLOCK_COUNT; #ifndef STANDALONE_SERVER checkGlError("Init enter"); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 493ddfe..4b384de 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -178,7 +178,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, StartGam LevelConstants::CHUNK_CACHE_WIDTH = packet->chunkCacheWidth; LevelConstants::LEVEL_WIDTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_WIDTH; LevelConstants::LEVEL_DEPTH = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_DEPTH; - + LevelChunk::ChunkBlockCount = LevelConstants::CHUNK_BLOCK_COUNT; } NumRequestChunks = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; requestNextChunkIndexList.resize(NumRequestChunks); diff --git a/src/world/level/chunk/LevelChunk.cpp b/src/world/level/chunk/LevelChunk.cpp index 5cf3ae6..499a7ae 100755 --- a/src/world/level/chunk/LevelChunk.cpp +++ b/src/world/level/chunk/LevelChunk.cpp @@ -12,7 +12,7 @@ /*static*/ bool LevelChunk::touchedSky = false; -const int LevelChunk::ChunkBlockCount = LevelConstants::CHUNK_BLOCK_COUNT; +int LevelChunk::ChunkBlockCount; LevelChunk::LevelChunk( Level* level, int x, int z ) : level(level), diff --git a/src/world/level/chunk/LevelChunk.h b/src/world/level/chunk/LevelChunk.h index b88cb7a..8fe7281 100755 --- a/src/world/level/chunk/LevelChunk.h +++ b/src/world/level/chunk/LevelChunk.h @@ -106,7 +106,7 @@ private: void recalcHeight(int x, int yStart, int z); public: static bool touchedSky; - static const int ChunkBlockCount; + static int ChunkBlockCount; const int ChunkSize = ChunkBlockCount; static const int UpdateMapBitShift = 4; // power of (LevelConstants::LEVEL_HEIGHT / 8) == 16 From f0df3fe2570d20bc31b8ee279665b97ac89a71e2 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 10 Jul 2026 00:46:36 +0200 Subject: [PATCH 143/189] Server for windows wow --- CMakeLists.txt | 17 +++++++---------- src/NinecraftApp.cpp | 2 +- src/main_dedicated.cpp | 2 ++ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7650b9a..eab2ada 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,7 +149,6 @@ file(GLOB SERVER_SOURCES "src/platform/CThread.cpp" "src/platform/HttpClient.cpp" - "src/platform/PngLoader.cpp" "src/platform/time.cpp" "src/platform/input/Controller.cpp" @@ -302,18 +301,16 @@ if (${PLATFORM} STREQUAL "Desktop") endif() # Server -if(UNIX) - add_executable("${PROJECT_NAME}-server" ${SERVER_SOURCES}) +add_executable("${PROJECT_NAME}-server" ${SERVER_SOURCES}) - target_compile_definitions("${PROJECT_NAME}-server" PUBLIC "STANDALONE_SERVER" "SERVER_PROFILER") +target_compile_definitions("${PROJECT_NAME}-server" PUBLIC "STANDALONE_SERVER" "SERVER_PROFILER") - target_include_directories("${PROJECT_NAME}-server" PUBLIC - "${CMAKE_SOURCE_DIR}/src/" - "project/lib_projects/raknet/jni/RaknetSources" - ) +target_include_directories("${PROJECT_NAME}-server" PUBLIC + "${CMAKE_SOURCE_DIR}/src/" + "project/lib_projects/raknet/jni/RaknetSources" +) - target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT}) -endif() +target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT}) add_executable(${PROJECT_NAME} ${CLIENT_SOURCES}) diff --git a/src/NinecraftApp.cpp b/src/NinecraftApp.cpp index d2feea6..60e9fee 100755 --- a/src/NinecraftApp.cpp +++ b/src/NinecraftApp.cpp @@ -136,7 +136,7 @@ void NinecraftApp::teardown() Recipes ::teardownRecipes(); TileEntity::teardownTileEntities(); #endif -#ifdef WIN32 +#if defined(WIN32) && !defined(STANDALONE_SERVER) ItemRenderer::teardown_static(); if (EntityTileRenderer::instance != NULL) { delete EntityTileRenderer::instance; diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index 4c667b5..fcf14ce 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -5,7 +5,9 @@ #include #include #include +#ifdef __linux__ #include +#endif #include "world/level/LevelSettings.h" #include "world/level/Level.h" From d3d9b1a23845c83eb9d74cecb6ddd8e31c2e7491 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 10 Jul 2026 00:59:26 +0200 Subject: [PATCH 144/189] anticheat sucks xdxd --- src/network/ServerSideNetworkHandler.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 71c4902..9892131 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -433,24 +433,24 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay { if (!level) return; - //LOGI("MovePlayerPacket\n"); + LOGI("MovePlayerPacket\n"); if (Entity* entity = level->getEntity(packet->entityId)) { ServerPlayer* player = (ServerPlayer*) getPlayer(source); - int timeElapsed = minecraft->getTicks() - player->getLastMoveTicks(); + // int timeElapsed = minecraft->getTicks() - player->getLastMoveTicks(); - if (timeElapsed > 0) { - float dist = player->distanceTo(packet->x, player->y, packet->z); - float speed = dist / (minecraft->getTicks() - player->getLastMoveTicks()); - player->setLastMoveTicks(minecraft->getTicks()); + // if (timeElapsed > 0) { + // float dist = player->distanceTo(packet->x, player->y, packet->z); + // float speed = dist / (minecraft->getTicks() - player->getLastMoveTicks()); + // player->setLastMoveTicks(minecraft->getTicks()); - float maxSpeed = (minecraft->isCreativeMode()) ? 1.65f : 1.f; + // float maxSpeed = (minecraft->isCreativeMode()) ? 1.65f : 1.f; - if (speed > maxSpeed) { - MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); - return raknetInstance->send(refuse); - } - } + // if (speed > maxSpeed) { + // MovePlayerPacket refuse(player->entityId, player->x, player->y, player->z, player->xRot, player->yRot); + // return raknetInstance->send(refuse); + // } + // } entity->xd = entity->yd = entity->zd = 0; entity->lerpTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot, 3); From 26e53760309e8c61ee15698544e01980f134749e Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Fri, 10 Jul 2026 21:45:52 +0200 Subject: [PATCH 145/189] FIX: Crash when server is disaibling --- src/client/Minecraft.cpp | 3 +- src/client/renderer/LevelRenderer.cpp | 73 ++++++++++++------------ src/network/ClientSideNetworkHandler.cpp | 4 +- src/network/ServerSideNetworkHandler.cpp | 9 +-- 4 files changed, 45 insertions(+), 44 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 4e1a1ad..26a8bb9 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -258,9 +258,10 @@ void Minecraft::selectLevel( const std::string& levelId, const std::string& leve void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, LocalPlayer* forceInsertPlayer /* = NULL */) { cameraTargetPlayer = NULL; - LOGI("Seed is %ld\n", level->getSeed()); if (level != NULL) { + LOGI("Seed is %ld\n", level->getSeed()); + level->raknetInstance = raknetInstance; gameMode->initLevel(level); diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index c3f1161..240ab9b 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -1077,53 +1077,54 @@ void LevelRenderer::playSound(const std::string& name, float x, float y, float z float dd = 16; if (volume > 1) dd *= volume; - if (mc->cameraTargetPlayer->distanceToSqr(x, y, z) < dd * dd) { + if (mc->cameraTargetPlayer != NULL && mc->cameraTargetPlayer->distanceToSqr(x, y, z) < dd * dd) { mc->soundEngine->play(name, x, y, z, volume, pitch); } } void LevelRenderer::addParticle(const std::string& name, float x, float y, float z, float xa, float ya, float za, int data) { + if (mc->cameraTargetPlayer != NULL) { + float xd = mc->cameraTargetPlayer->x - x; + float yd = mc->cameraTargetPlayer->y - y; + float zd = mc->cameraTargetPlayer->z - z; + float distanceSquared = xd * xd + yd * yd + zd * zd; - float xd = mc->cameraTargetPlayer->x - x; - float yd = mc->cameraTargetPlayer->y - y; - float zd = mc->cameraTargetPlayer->z - z; - float distanceSquared = xd * xd + yd * yd + zd * zd; + //Particle* p = NULL; + //if (name == "hugeexplosion") p = new HugeExplosionSeedParticle(level, x, y, z, xa, ya, za); + //else if (name == "largeexplode") p = new HugeExplosionParticle(textures, level, x, y, z, xa, ya, za); - //Particle* p = NULL; - //if (name == "hugeexplosion") p = new HugeExplosionSeedParticle(level, x, y, z, xa, ya, za); - //else if (name == "largeexplode") p = new HugeExplosionParticle(textures, level, x, y, z, xa, ya, za); + //if (p) { + // if (distanceSquared < 32 * 32) { + // mc->particleEngine->add(p); + // } else { delete p; } + // return; + //} - //if (p) { - // if (distanceSquared < 32 * 32) { - // mc->particleEngine->add(p); - // } else { delete p; } - // return; - //} + const float particleDistance = 16; + if (distanceSquared > particleDistance * particleDistance) return; - const float particleDistance = 16; - if (distanceSquared > particleDistance * particleDistance) return; + //static Stopwatch sw; + //sw.start(); - //static Stopwatch sw; - //sw.start(); + if (name == "bubble") mc->particleEngine->add(new BubbleParticle(level, x, y, z, xa, ya, za)); + else if (name == "crit") mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za)); + else if (name == "smoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za)); + //else if (name == "note") mc->particleEngine->add(new NoteParticle(level, x, y, z, xa, ya, za)); + else if (name == "explode") mc->particleEngine->add(new ExplodeParticle(level, x, y, z, xa, ya, za)); + else if (name == "flame") mc->particleEngine->add(new FlameParticle(level, x, y, z, xa, ya, za)); + else if (name == "lava") mc->particleEngine->add(new LavaParticle(level, x, y, z)); + //else if (name == "splash") mc->particleEngine->add(new SplashParticle(level, x, y, z, xa, ya, za)); + else if (name == "largesmoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f)); + else if (name == "reddust") mc->particleEngine->add(new RedDustParticle(level, x, y, z, xa, ya, za)); + else if (name == "iconcrack") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data])); + else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); + //else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); + //else if (name == "slime") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::slimeBall)); + //else if (name == "heart") mc->particleEngine->add(new HeartParticle(level, x, y, z, xa, ya, za)); - if (name == "bubble") mc->particleEngine->add(new BubbleParticle(level, x, y, z, xa, ya, za)); - else if (name == "crit") mc->particleEngine->add(new CritParticle2(level, x, y, z, xa, ya, za)); - else if (name == "smoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za)); - //else if (name == "note") mc->particleEngine->add(new NoteParticle(level, x, y, z, xa, ya, za)); - else if (name == "explode") mc->particleEngine->add(new ExplodeParticle(level, x, y, z, xa, ya, za)); - else if (name == "flame") mc->particleEngine->add(new FlameParticle(level, x, y, z, xa, ya, za)); - else if (name == "lava") mc->particleEngine->add(new LavaParticle(level, x, y, z)); - //else if (name == "splash") mc->particleEngine->add(new SplashParticle(level, x, y, z, xa, ya, za)); - else if (name == "largesmoke") mc->particleEngine->add(new SmokeParticle(level, x, y, z, xa, ya, za, 2.5f)); - else if (name == "reddust") mc->particleEngine->add(new RedDustParticle(level, x, y, z, xa, ya, za)); - else if (name == "iconcrack") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, xa, ya, za, Item::items[data])); - else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); - //else if (name == "snowballpoof") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::snowBall)); - //else if (name == "slime") mc->particleEngine->add(new BreakingItemParticle(level, x, y, z, Item::slimeBall)); - //else if (name == "heart") mc->particleEngine->add(new HeartParticle(level, x, y, z, xa, ya, za)); - - //sw.stop(); - //sw.printEvery(50, "add-particle-string"); + //sw.stop(); + //sw.printEvery(50, "add-particle-string"); + } } /* diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 4b384de..807dd1a 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -120,10 +120,12 @@ void ClientSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid) level->removeEntity(p); } } - } + } minecraft->setLevel(NULL); #ifndef STANDALONE_SERVER minecraft->gui.addMessage("Disconnected from server"); + // TODO: screen with error + minecraft->screenChooser.setScreen(SCREEN_STARTMENU); #endif } diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 9892131..cc49754 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -697,12 +697,9 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, WantCrea } } - // for (int i = 0; i < items.size(); i++) { - // RemoveItemPacket removePacket(packet->playerId, items.at(i).count, items.at(i).getAuxValue(), items.at(i).id); - // raknetInstance->send(source, removePacket); - - // p->inventory->removeResource(ItemInstance(items.at(i).id, items.at(i).count, items.at(i).getAuxValue())); - // } + for (int i = 0; i < items.size(); i++) { + p->inventory->removeResource(ItemInstance(items.at(i).id, items.at(i).count, items.at(i).getAuxValue())); + } // TakeItemPacket itemAdd(p->entityId, wantCreate.count, wantCreate.getAuxValue(), wantCreate.id); // raknetInstance->send(source, itemAdd); From 381196468951975d3e4dd4dd424cd8355325ee35 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 18 Jul 2026 14:02:45 +0200 Subject: [PATCH 146/189] ffqwfqwfw --- src/client/gamemode/GameMode.cpp | 8 +++++--- src/network/ClientSideNetworkHandler.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 11 ++++++++++- src/network/packet/UseItemPacket.h | 23 ++++++++++++++++++----- src/world/item/TileItem.h | 2 +- src/world/level/Level.cpp | 2 +- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/client/gamemode/GameMode.cpp b/src/client/gamemode/GameMode.cpp index de6df50..6877d7c 100755 --- a/src/client/gamemode/GameMode.cpp +++ b/src/client/gamemode/GameMode.cpp @@ -90,8 +90,10 @@ bool GameMode::useItemOn(Player* player, Level* level, ItemInstance* item, int x float clickY = hit.y - y; float clickZ = hit.z - z; if (level->isClientSide) { + LOGI("%f %f %f \n", player->x, player->y, player->z); + item = player->inventory->getSelected(); - UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ); + UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ, player->x, player->y, player->z); minecraft->raknetInstance->send(packet); } int t = level->getTile(x, y, z); @@ -100,7 +102,7 @@ bool GameMode::useItemOn(Player* player, Level* level, ItemInstance* item, int x return true; if (item == NULL) return false; - if(isCreativeType()) { + if (isCreativeType()) { int aux = item->getAuxValue(); int count = item->count; bool success = item->useOn(player, level, x, y, z, face, clickX, clickY, clickZ); @@ -117,7 +119,7 @@ bool GameMode::useItem( Player* player, Level* level, ItemInstance* item ) { ItemInstance* itemInstance = item->use(level, player); if(level->isClientSide) { - UseItemPacket packet(item, player->entityId, player->aimDirection); + UseItemPacket packet(item, player->entityId, player->aimDirection, player->x, player->y, player->z); minecraft->raknetInstance->send(packet); } if (itemInstance != item || (itemInstance != NULL && itemInstance->count != oldCount)) { diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 807dd1a..ee61184 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -820,7 +820,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, SetEntit if (!level) return; - LOGI("SetEntityDataPacket\n"); + // LOGI("SetEntityDataPacket\n"); Entity* e = level->getEntity(packet->id); if (e) { diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index cc49754..1c4a1ac 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -433,7 +433,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MovePlay { if (!level) return; - LOGI("MovePlayerPacket\n"); + // LOGI("MovePlayerPacket\n"); if (Entity* entity = level->getEntity(packet->entityId)) { ServerPlayer* player = (ServerPlayer*) getPlayer(source); @@ -713,7 +713,10 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemP LOGI("UseItemPacket: id %i data %i\n", packet->itemId, packet->itemData); Entity* entity = level->getEntity(packet->entityId); + if (entity && entity->isPlayer()) { + LOGI("%f %f %f \n", entity->x, entity->y, entity->z); + Player* player = (Player*) entity; int x = packet->x, y = packet->y, z = packet->z; Tile* t = Tile::tiles[level->getTile(x, y, z)]; @@ -747,6 +750,12 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemP ItemInstance* item = player->inventory->getItem(slot); + player->x = packet->playerX; + player->y = packet->playerY; + player->z = packet->playerZ; + LOGI("upd: %f %f %f \n", packet->playerX, packet->playerY, packet->playerZ); + LOGI("plr new: %f %f %f \n", player->x, player->y, player->z); + if(packet->face == 255) { // Special case: x,y,z means direction-of-action player->aimDirection.set(packet->x / 32768.0f, packet->y / 32768.0f, packet->z / 32768.0f); diff --git a/src/network/packet/UseItemPacket.h b/src/network/packet/UseItemPacket.h index e1583de..bfef1f2 100755 --- a/src/network/packet/UseItemPacket.h +++ b/src/network/packet/UseItemPacket.h @@ -16,10 +16,12 @@ public: short itemId; unsigned char itemData; ItemInstance item; + float playerX, playerY, playerZ; UseItemPacket() {} - UseItemPacket(int x, int y, int z, int face, const ItemInstance* item, int entityId, float clickX, float clickY, float clickZ) + UseItemPacket(int x, int y, int z, int face, const ItemInstance* item, int entityId, float clickX, float clickY, float clickZ, + float plrX, float plrY, float plrZ) : x(x), y(y), z(z), @@ -29,17 +31,23 @@ public: entityId(entityId), clickX(clickX), clickY(clickY), - clickZ(clickZ) + clickZ(clickZ), + playerX(plrX), + playerY(plrY), + playerZ(plrZ) {} - UseItemPacket(const ItemInstance* item, int entityId, const Vec3& aim) + UseItemPacket(const ItemInstance* item, int entityId, const Vec3& aim, float plrX, float plrY, float plrZ) : face(255), itemId(item? item->id : 0), itemData(item? item->getAuxValue() : 0), entityId(entityId), x((int)(aim.x * 32768.0f)), y((int)(aim.y * 32768.0f)), - z((int)(aim.z * 32768.0f)) + z((int)(aim.z * 32768.0f)), + playerX(plrX), + playerY(plrY), + playerZ(plrZ) { } @@ -57,6 +65,9 @@ public: bitStream->Write(clickX); bitStream->Write(clickY); bitStream->Write(clickZ); + bitStream->Write(playerX); + bitStream->Write(playerY); + bitStream->Write(playerZ); } void read(RakNet::BitStream* bitStream) @@ -74,7 +85,9 @@ public: item.id = itemId; item.setAuxValue(itemData); item.count = (itemId == 0 && itemData == 0)? 0 : 1; - + bitStream->Read(playerX); + bitStream->Read(playerY); + bitStream->Read(playerZ); } void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) diff --git a/src/world/item/TileItem.h b/src/world/item/TileItem.h index c75084e..08bd1d0 100755 --- a/src/world/item/TileItem.h +++ b/src/world/item/TileItem.h @@ -61,7 +61,7 @@ public: if (level->setTileAndData(x, y, z, tileId, data)) { Tile::tiles[tileId]->setPlacedBy(level, x, y, z, player); level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, tile->soundType->getStepSound(), (tile->soundType->getVolume() + 1) / 2, tile->soundType->getPitch() * 0.8f); - + printf("%f %f %f \n", player->x, player->y, player->z); /* PlaceBlockPacket packet(player->entityId, x, y, z, face, tileId, instance->getAuxValue()); //LOGI("Place block at @ %d, %d, %d\n", x, y, z); diff --git a/src/world/level/Level.cpp b/src/world/level/Level.cpp index cb6d688..2c7fffd 100755 --- a/src/world/level/Level.cpp +++ b/src/world/level/Level.cpp @@ -1962,7 +1962,7 @@ void Level::prepare() { ; } -bool Level::mayPlace(int tileId, int x, int y, int z, bool ignoreEntities,unsigned char face) { +bool Level::mayPlace(int tileId, int x, int y, int z, bool ignoreEntities,unsigned char face) { int targetType = getTile(x, y, z); const Tile* targetTile = Tile::tiles[targetType]; Tile* tile = Tile::tiles[tileId]; From 50d1de49e012531e0d8d9e640c53d3c42ed7d955 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 18 Jul 2026 15:24:58 +0300 Subject: [PATCH 147/189] FIX: multiplayer leave crash and compilation --- .../raknet/jni/RaknetSources/GetTime.cpp | 2 +- src/network/ClientSideNetworkHandler.cpp | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/project/lib_projects/raknet/jni/RaknetSources/GetTime.cpp b/project/lib_projects/raknet/jni/RaknetSources/GetTime.cpp index 4f868f8..effd244 100755 --- a/project/lib_projects/raknet/jni/RaknetSources/GetTime.cpp +++ b/project/lib_projects/raknet/jni/RaknetSources/GetTime.cpp @@ -140,7 +140,7 @@ RakNet::TimeUS GetTimeUS_Windows( void ) #if _MSC_VER >= 1400 && defined (_M_X64) GetProcessAffinityMask(mProc, (PDWORD_PTR)&mProcMask, (PDWORD_PTR)&mSysMask); #else - GetProcessAffinityMask(mProc, &mProcMask, &mSysMask); + GetProcessAffinityMask(mProc, (PDWORD_PTR)&mProcMask, (PDWORD_PTR)&mSysMask); #endif mThread = GetCurrentThread(); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index ee61184..a5bb960 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -120,13 +120,14 @@ void ClientSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid) level->removeEntity(p); } } - } - minecraft->setLevel(NULL); -#ifndef STANDALONE_SERVER - minecraft->gui.addMessage("Disconnected from server"); - // TODO: screen with error - minecraft->screenChooser.setScreen(SCREEN_STARTMENU); -#endif + } + minecraft->leaveGame(); +// minecraft->setLevel(NULL); +// #ifndef STANDALONE_SERVER +// minecraft->gui.addMessage("Disconnected from server"); +// // TODO: screen with error +// minecraft->screenChooser.setScreen(SCREEN_STARTMENU); +// #endif } void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginStatusPacket* packet) { From fcf7427fb259c8737634f9fb4ba44f5c0f0fa40b Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 18 Jul 2026 19:14:16 +0200 Subject: [PATCH 148/189] gg fixed --- src/client/gamemode/GameMode.cpp | 7 +++-- src/network/ServerSideNetworkHandler.cpp | 11 ++++++-- src/network/packet/UseItemPacket.h | 35 +++++++++++++++++++++--- 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/client/gamemode/GameMode.cpp b/src/client/gamemode/GameMode.cpp index 6877d7c..8009d64 100755 --- a/src/client/gamemode/GameMode.cpp +++ b/src/client/gamemode/GameMode.cpp @@ -93,7 +93,9 @@ bool GameMode::useItemOn(Player* player, Level* level, ItemInstance* item, int x LOGI("%f %f %f \n", player->x, player->y, player->z); item = player->inventory->getSelected(); - UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ, player->x, player->y, player->z); + UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ, player->x, player->y, player->z, + player->bb.x0, player->bb.y0, player->bb.z0, player->bb.x1, player->bb.y1, player->bb.z1); + minecraft->raknetInstance->send(packet); } int t = level->getTile(x, y, z); @@ -119,7 +121,8 @@ bool GameMode::useItem( Player* player, Level* level, ItemInstance* item ) { ItemInstance* itemInstance = item->use(level, player); if(level->isClientSide) { - UseItemPacket packet(item, player->entityId, player->aimDirection, player->x, player->y, player->z); + UseItemPacket packet(item, player->entityId, player->aimDirection, player->x, player->y, player->z, + player->bb.x0, player->bb.y0, player->bb.z0, player->bb.x1, player->bb.y1, player->bb.z1); minecraft->raknetInstance->send(packet); } if (itemInstance != item || (itemInstance != NULL && itemInstance->count != oldCount)) { diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 1c4a1ac..2f3f237 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -749,12 +749,17 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, UseItemP } ItemInstance* item = player->inventory->getItem(slot); - player->x = packet->playerX; player->y = packet->playerY; player->z = packet->playerZ; - LOGI("upd: %f %f %f \n", packet->playerX, packet->playerY, packet->playerZ); - LOGI("plr new: %f %f %f \n", player->x, player->y, player->z); + + player->bb.x0 = packet->playerX0; + player->bb.y0 = packet->playerY0; + player->bb.z0 = packet->playerZ0; + + player->bb.x1 = packet->playerX1; + player->bb.y1 = packet->playerY1; + player->bb.z1 = packet->playerZ1; if(packet->face == 255) { // Special case: x,y,z means direction-of-action diff --git a/src/network/packet/UseItemPacket.h b/src/network/packet/UseItemPacket.h index bfef1f2..3f67c41 100755 --- a/src/network/packet/UseItemPacket.h +++ b/src/network/packet/UseItemPacket.h @@ -17,11 +17,13 @@ public: unsigned char itemData; ItemInstance item; float playerX, playerY, playerZ; + float playerX0, playerY0, playerZ0; + float playerX1, playerY1, playerZ1; UseItemPacket() {} UseItemPacket(int x, int y, int z, int face, const ItemInstance* item, int entityId, float clickX, float clickY, float clickZ, - float plrX, float plrY, float plrZ) + float plrX, float plrY, float plrZ, float plrX0, float plrY0, float plrZ0, float plrX1, float plrY1, float plrZ1) : x(x), y(y), z(z), @@ -34,10 +36,17 @@ public: clickZ(clickZ), playerX(plrX), playerY(plrY), - playerZ(plrZ) + playerZ(plrZ), + playerX0(plrX0), + playerY0(plrY0), + playerZ0(plrZ0), + playerX1(plrX1), + playerY1(plrY1), + playerZ1(plrZ1) {} - UseItemPacket(const ItemInstance* item, int entityId, const Vec3& aim, float plrX, float plrY, float plrZ) + UseItemPacket(const ItemInstance* item, int entityId, const Vec3& aim, float plrX, float plrY, float plrZ, + float plrX0, float plrY0, float plrZ0, float plrX1, float plrY1, float plrZ1) : face(255), itemId(item? item->id : 0), itemData(item? item->getAuxValue() : 0), @@ -47,7 +56,13 @@ public: z((int)(aim.z * 32768.0f)), playerX(plrX), playerY(plrY), - playerZ(plrZ) + playerZ(plrZ), + playerX0(plrX0), + playerY0(plrY0), + playerZ0(plrZ0), + playerX1(plrX1), + playerY1(plrY1), + playerZ1(plrZ1) { } @@ -68,6 +83,12 @@ public: bitStream->Write(playerX); bitStream->Write(playerY); bitStream->Write(playerZ); + bitStream->Write(playerX0); + bitStream->Write(playerY0); + bitStream->Write(playerZ0); + bitStream->Write(playerX1); + bitStream->Write(playerY1); + bitStream->Write(playerZ1); } void read(RakNet::BitStream* bitStream) @@ -88,6 +109,12 @@ public: bitStream->Read(playerX); bitStream->Read(playerY); bitStream->Read(playerZ); + bitStream->Read(playerX0); + bitStream->Read(playerY0); + bitStream->Read(playerZ0); + bitStream->Read(playerX1); + bitStream->Read(playerY1); + bitStream->Read(playerZ1); } void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback) From 4f21343e3bd34d4fbc01251af70607bf53b011b5 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 18 Jul 2026 21:01:13 +0200 Subject: [PATCH 149/189] release soon but we need to fix large world in mp --- .github/workflows/build.yml | 9 ++++++++- src/network/ClientSideNetworkHandler.cpp | 6 +++--- src/network/ServerSideNetworkHandler.cpp | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eba5db7..c7593cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,13 +60,14 @@ jobs: - name: Build working-directory: ${{github.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target MinecraftPE --parallel + run: cmake --build . --config $BUILD_TYPE --parallel - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: mcpe-windows path: | + ${{github.workspace}}/build/MinecraftPE-server.exe ${{github.workspace}}/build/MinecraftPE.exe ${{github.workspace}}/build/libpng16.dll ${{github.workspace}}/build/OpenAL32.dll @@ -298,6 +299,12 @@ jobs: with: files: mcpe-linux/MinecraftPE-server dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.zip + + - name: Zip Windows Server Artifacts + uses: vimtor/action-zip@v1.2 + with: + files: mcpe-windows/MinecraftPE-server.exe + dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.zip - name: Zip Android arm64-v8a Artifact uses: vimtor/action-zip@v1.2 diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index a5bb960..022b35f 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -223,7 +223,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, SetTimeP if (!level) return; - LOGI("SetTimePacket\n"); + // LOGI("SetTimePacket\n"); level->setTime(packet->time); } @@ -279,7 +279,7 @@ void ClientSideNetworkHandler::handle( const RakNet::RakNetGUID& source, AddPain } void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, AddMobPacket* packet) { - LOGI("AddMobPacket (%p)\n", level); + // LOGI("AddMobPacket (%p)\n", level); if (!level) { LOGW("Trying to add a mob with no level!\n"); @@ -385,7 +385,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, AddItemE } void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, TakeItemEntityPacket* packet) { - printf("TakeItemEntityPacket \n"); + // printf("TakeItemEntityPacket \n"); if (!level) return; Entity* e = level->getEntity(packet->itemId); diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 2f3f237..474d9ad 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -368,7 +368,7 @@ void ServerSideNetworkHandler::onReady_ClientGeneration(const RakNet::RakNetGUID if (!minecraft->level->getLevelStorage()->loadPlayer(*newPlayer)) { LOGW("Failed to load %s data\n", newPlayer->name.c_str()); } - + // Credits to EpikIzCool bitStream.Reset(); MovePlayerPacket mv(newPlayer->entityId, newPlayer->x, newPlayer->y - newPlayer->heightOffset, From 8955b6ea47431c6222b044a834a28fa6ca85df8d Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 18 Jul 2026 22:31:15 +0300 Subject: [PATCH 150/189] ADD: server build for windows --- .github/workflows/build.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7593cd..ce3a9f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,9 @@ jobs: - name: Build working-directory: ${{github.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --parallel + run: | + cmake --build . --config $BUILD_TYPE --target MinecraftPE --parallel + cmake --build . --config $BUILD_TYPE --target MinecraftPE-server --parallel - name: Upload Artifact uses: actions/upload-artifact@v4 @@ -287,6 +289,12 @@ jobs: with: files: mcpe-windows/MinecraftPE.exe mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/libz.dll dest: minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip + + - name: Zip Windows Server Artifacts + uses: vimtor/action-zip@v1.2 + with: + files: mcpe-windows/MinecraftPE-server.exe + dest: minecraftpe-server-${{ steps.ref.outputs.hash }}-windows.zip - name: Zip Linux Artifacts uses: vimtor/action-zip@v1.2 @@ -298,13 +306,7 @@ jobs: uses: vimtor/action-zip@v1.2 with: files: mcpe-linux/MinecraftPE-server - dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.zip - - - name: Zip Windows Server Artifacts - uses: vimtor/action-zip@v1.2 - with: - files: mcpe-windows/MinecraftPE-server.exe - dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.zip + dest: minecraftpe-server-${{ steps.ref.outputs.hash }}-linux.zip - name: Zip Android arm64-v8a Artifact uses: vimtor/action-zip@v1.2 @@ -343,8 +345,9 @@ jobs: files: | ./data.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip + ./minecraftpe-server-${{ steps.ref.outputs.hash }}-windows.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip - ./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip + ./minecraftpe-server-${{ steps.ref.outputs.hash }}-linux.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip \ No newline at end of file From 3fcf3e34181601d57ea7b40bf19faf3656fe5e1b Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 18 Jul 2026 22:47:41 +0300 Subject: [PATCH 151/189] link WSA with server --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eab2ada..0d367ed 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ if (${PLATFORM} STREQUAL "Desktop") add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(misc/windows) set(EXTRA_LIBS ws2_32 winhttp) + set(SERVER_EXTRA_LIBS ws2_32) elseif(UNIX) find_library(pthread NAMES pthread) set(EXTRA_LIBS pthread m) @@ -310,7 +311,7 @@ target_include_directories("${PROJECT_NAME}-server" PUBLIC "project/lib_projects/raknet/jni/RaknetSources" ) -target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT} ${SERVER_EXTRA_LIBS}) add_executable(${PROJECT_NAME} ${CLIENT_SOURCES}) From e43da17d66e9140275487fa16b6e8d717646ba29 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 18 Jul 2026 23:02:25 +0300 Subject: [PATCH 152/189] oh i didnt know --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d367ed..b60e6b5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,6 @@ if (${PLATFORM} STREQUAL "Desktop") add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(misc/windows) set(EXTRA_LIBS ws2_32 winhttp) - set(SERVER_EXTRA_LIBS ws2_32) elseif(UNIX) find_library(pthread NAMES pthread) set(EXTRA_LIBS pthread m) @@ -311,7 +310,7 @@ target_include_directories("${PROJECT_NAME}-server" PUBLIC "project/lib_projects/raknet/jni/RaknetSources" ) -target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT} ${SERVER_EXTRA_LIBS}) +target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBS}) add_executable(${PROJECT_NAME} ${CLIENT_SOURCES}) From 444e826d1b9e610e3c5efc647ecc6858f6245ad9 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 18 Jul 2026 23:41:05 +0200 Subject: [PATCH 153/189] aa --- src/world/level/chunk/ChunkCache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/level/chunk/ChunkCache.h b/src/world/level/chunk/ChunkCache.h index a770686..fbb2d77 100755 --- a/src/world/level/chunk/ChunkCache.h +++ b/src/world/level/chunk/ChunkCache.h @@ -198,7 +198,7 @@ public: std::string gatherStats() { // return "ChunkCache: 1024"; std::stringstream ss; - ss << "ChunkCache: " << CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH; + ss << "ChunkCache: " << LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; return ss.str(); } From f7ad5acd339d520d69f771c651080d3167c58374 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sun, 19 Jul 2026 01:04:34 +0300 Subject: [PATCH 154/189] remove includes for server --- src/client/Minecraft.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 2db00dc..8c90b6f 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -92,10 +92,14 @@ #include "../network/command/CommandServer.h" #include "gamemode/CreatorMode.h" + +#ifndef STANDALONE_SERVER #include "../world/level/GrassColor.h" #include "renderer/LevelRenderer.h" #include "particle/ParticleEngine.h" +#endif #include "../world/level/Level.h" + static void checkGlError(const char* tag) { #ifdef GLDEBUG while (1) { From ce8ca15c561fededfda262b5e56e3f300075dd90 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 15:37:19 +0300 Subject: [PATCH 155/189] FIX: android entity shadows --- src/client/renderer/entity/EntityRenderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/renderer/entity/EntityRenderer.cpp b/src/client/renderer/entity/EntityRenderer.cpp index a1b18c0..691ddfb 100755 --- a/src/client/renderer/entity/EntityRenderer.cpp +++ b/src/client/renderer/entity/EntityRenderer.cpp @@ -257,7 +257,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po //Textures* textures = entityRenderDispatcher->textures; //textures->bind(textures->loadTexture("%clamp%/environment/shadow.png")); Textures* textures = entityRenderDispatcher->textures; - textures->loadAndBindTexture("/misc/shadow.png"); + textures->loadAndBindTexture("misc/shadow.png"); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -298,6 +298,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po tt.draw(); glColor4f2(1, 1, 1, 1); + // tt.color(1.f, 1.f, 1.f, 1.f); glDisable2(GL_BLEND); glDepthMask(true); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); @@ -315,7 +316,7 @@ void EntityRenderer::renderTileShadow(Tile* tt, float x, float y, float z, int x float a = ((pow - (y - (yt + yo)) / 2) * 0.5f) * getLevel()->getBrightness(xt, yt, zt); if (a < 0) return; if (a > 1) a = 1; - // t.color(1, 1, 1, (float) a); + // t.color(1.f, 1.f, 1.f, (float) a); glColor4f2(1, 1, 1, (float) a); float x0 = xt + tt->xx0 + xo; From 6a8b19202477dce3420735fda2843d77afa79fa6 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 20 Jul 2026 15:45:27 +0200 Subject: [PATCH 156/189] Update README.md --- README.md | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ebdc8cb..1814aa1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MinecraftPE > [!Warning] -> Github repository **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1). +> [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1). > [!Important] > We have a discord server, where you can report bugs or send feedback https://discord.gg/c58YesBxve @@ -9,23 +9,15 @@ Source code for **Minecraft Pocket Edition 0.6.1 alpha** with various fixes and This project aims to preserve and improve this early version of Minecraft PE. -# TODO / Roadmap -- [x] Add platform GLFW -- [x] Compile for Linux -- [x] Compile for android aarch64 - - [x] Touch control improvements - - [ ] Screen fixes -- [ ] Rewrite platform logic -- [x] Fix sound -- [x] Do a server connection GUI -- [ ] Controller support -- [x] Minecraft server hosting -- [x] Screen fixess -- [x] Fix fog -- [x] Add sprinting -- [x] Chat (semi working) and commands -- [x] Implementing options -- [x] Better F3 +# Features +- Support for modern IOS and Android, Linux, Web +- Improved Dedicated Server (Windows build, anticheat, commands, etc) +- Features from Beta version of Minecraft (Grass tint, Beta sky, Smooth lighting, etc) and other tweaks + +# Screenshots +

+ +

# Build @@ -79,8 +71,14 @@ cmake --build . ``` C:\android-ndk-r14b ``` +3. Install **Build tools 35** with [SDKManager](https://dl.google.com/android/repository/commandlinetools-win-15859902_latest.zip) (BuildTools should be in AppData): -3. Run the build script: +```powershell +sdkmanager "build-tools;35.0.0" --sdk_root="%LocalAppData%\Android\Sdk" +sdkmanager "build-tools;android-36" --sdk_root="%LocalAppData%\Android\Sdk" +``` + +4. Run the build script: ```powershell # Full build (NDK + Java + APK + install) From 156849eeb633fc7ba131d13623177407f9d2457b Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 20 Jul 2026 15:56:21 +0200 Subject: [PATCH 157/189] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 1814aa1..cd06e22 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ This project aims to preserve and improve this early version of Minecraft PE. # Screenshots

+menu +settings +worlds +gameplay +

# Build From 3940c9ce1b337c07fc30948d0f35c7216cb97938 Mon Sep 17 00:00:00 2001 From: Nikolai Nevzorov Date: Mon, 20 Jul 2026 16:22:56 +0200 Subject: [PATCH 158/189] Update README.MD --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index cd06e22..49e1b44 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ cmake --build . ``` C:\android-ndk-r14b ``` -3. Install **Build tools 35** with [SDKManager](https://dl.google.com/android/repository/commandlinetools-win-15859902_latest.zip) (BuildTools should be in AppData): +3. Install **Build tools 35** with [SDKManager](https://dl.google.com/android/repository/commandlinetools-win-15859902_latest.zip) (build-tools should be in AppData): ```powershell sdkmanager "build-tools;35.0.0" --sdk_root="%LocalAppData%\Android\Sdk" @@ -157,7 +157,6 @@ sdkmanager "build-tools;android-36" --sdk_root="%LocalAppData%\Android\Sdk" ```bash 35.0.0 - 33.0.2 ``` 6. Download **Android NDK r14b**: From 365d8a10dac3ff2000d43b83ddb32805c59f5360 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 20 Jul 2026 17:25:02 +0200 Subject: [PATCH 159/189] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49e1b44..1d4caa8 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ sdkmanager "build-tools;android-36" --sdk_root="%LocalAppData%\Android\Sdk" ``` ## iOS ### Xcode -> [Note!] +> [!Note] > There's a precompiled IPA artifact in the GitHub mirror under Actions for those who either don't have Macs or don't want to build themself. But if you want to build youself, you'll need a Mac with Xcode. Download Xcode from the Mac App Store. ### 1. Clone From a048a5130022be4266c2c4d40ce980926bb3e19b Mon Sep 17 00:00:00 2001 From: deepfriedwaffles Date: Mon, 20 Jul 2026 11:53:20 -0400 Subject: [PATCH 160/189] Added new sources to xcodeproj so it can compile again --- .../minecraftpe.xcodeproj/project.pbxproj | 58 ++++++++++++++++++- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj index 9e371ea..57b12b7 100755 --- a/project/iosproj/minecraftpe.xcodeproj/project.pbxproj +++ b/project/iosproj/minecraftpe.xcodeproj/project.pbxproj @@ -47,6 +47,8 @@ 9D293CE816071C08000305C8 /* CreateNewWorld_iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */; }; 9D293CEB160720D6000305C8 /* worldname_iphone5_3.png in Resources */ = {isa = PBXBuildFile; fileRef = 9D293CEA160720D6000305C8 /* worldname_iphone5_3.png */; }; 9D293CEC160720D6000305C8 /* worldname_iphone5_3.png in Resources */ = {isa = PBXBuildFile; fileRef = 9D293CEA160720D6000305C8 /* worldname_iphone5_3.png */; }; + BEEF202614CFF670005F0002 /* Lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEEF202614CFF670005F0001 /* Lighting.cpp */; }; + BEEF202614CFF670005F0003 /* Lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEEF202614CFF670005F0001 /* Lighting.cpp */; }; D506D3E2161288BD0099FA65 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9D959AFF16036BEE00E23A6F /* Default-568h@2x.png */; }; D51DC73614581D4E00E3D761 /* itemframe.png in Resources */ = {isa = PBXBuildFile; fileRef = D51DC73514581D4E00E3D761 /* itemframe.png */; }; D51DC74314592B8B00E3D761 /* PVRTexture.m in Sources */ = {isa = PBXBuildFile; fileRef = D51DC74214592B8A00E3D761 /* PVRTexture.m */; }; @@ -1179,8 +1181,19 @@ F99F0FAD2F8436CE00F2B29A /* FoliageColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */; }; F99F0FAF2F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; F99F0FB02F8436EB00F2B29A /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99F0FAE2F8436EB00F2B29A /* Color.cpp */; }; - BEEF202614CFF670005F0002 /* Lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEEF202614CFF670005F0001 /* Lighting.cpp */; }; - BEEF202614CFF670005F0003 /* Lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEEF202614CFF670005F0001 /* Lighting.cpp */; }; + F9E5A772300E7A8700164066 /* LevelConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A771300E7A8700164066 /* LevelConstants.cpp */; }; + F9E5A775300E7AB700164066 /* CommandManager.hpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A773300E7AB700164066 /* CommandManager.hpp */; }; + F9E5A776300E7AB700164066 /* CommandManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A774300E7AB700164066 /* CommandManager.cpp */; }; + F9E5A779300E7AD500164066 /* CommandBan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A777300E7AD500164066 /* CommandBan.cpp */; }; + F9E5A77A300E7AD500164066 /* CommandBan.hpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A778300E7AD500164066 /* CommandBan.hpp */; }; + F9E5A77D300E7AF400164066 /* CommandHelp.hpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A77B300E7AF400164066 /* CommandHelp.hpp */; }; + F9E5A77E300E7AF400164066 /* CommandHelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A77C300E7AF400164066 /* CommandHelp.cpp */; }; + F9E5A783300E7B0B00164066 /* CommandKick.hpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A77F300E7B0A00164066 /* CommandKick.hpp */; }; + F9E5A784300E7B0B00164066 /* CommandOp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A780300E7B0A00164066 /* CommandOp.cpp */; }; + F9E5A785300E7B0B00164066 /* CommandKick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A781300E7B0B00164066 /* CommandKick.cpp */; }; + F9E5A786300E7B0B00164066 /* CommandOp.hpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A782300E7B0B00164066 /* CommandOp.hpp */; }; + F9E5A789300E7B3400164066 /* Command.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A787300E7B3400164066 /* Command.cpp */; }; + F9E5A78A300E7B3400164066 /* Command.hpp in Sources */ = {isa = PBXBuildFile; fileRef = F9E5A788300E7B3400164066 /* Command.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -1248,6 +1261,7 @@ 9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CreateNewWorld_iphone.xib; path = minecraftpe/dialogs/CreateNewWorld_iphone.xib; sourceTree = ""; }; 9D293CEA160720D6000305C8 /* worldname_iphone5_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = worldname_iphone5_3.png; sourceTree = ""; }; 9D959AFF16036BEE00E23A6F /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + BEEF202614CFF670005F0001 /* Lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lighting.cpp; sourceTree = ""; }; D51A8B01146A200000E5D720 /* minecraftpedemo-info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "minecraftpedemo-info.plist"; sourceTree = ""; }; D51DC73514581D4E00E3D761 /* itemframe.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = itemframe.png; sourceTree = ""; }; D51DC74114592B8A00E3D761 /* PVRTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PVRTexture.h; sourceTree = ""; }; @@ -2468,7 +2482,19 @@ F99F0FA82F84369F00F2B29A /* GrassColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GrassColor.cpp; sourceTree = ""; }; F99F0FAB2F8436CE00F2B29A /* FoliageColor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FoliageColor.cpp; sourceTree = ""; }; F99F0FAE2F8436EB00F2B29A /* Color.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Color.cpp; sourceTree = ""; }; - BEEF202614CFF670005F0001 /* Lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Lighting.cpp; path = Lighting.cpp; sourceTree = ""; }; + F9E5A771300E7A8700164066 /* LevelConstants.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LevelConstants.cpp; path = ../../src/world/level/LevelConstants.cpp; sourceTree = ""; }; + F9E5A773300E7AB700164066 /* CommandManager.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = CommandManager.hpp; path = ../../src/commands/CommandManager.hpp; sourceTree = ""; }; + F9E5A774300E7AB700164066 /* CommandManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CommandManager.cpp; path = ../../src/commands/CommandManager.cpp; sourceTree = ""; }; + F9E5A777300E7AD500164066 /* CommandBan.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CommandBan.cpp; path = ../../src/commands/CommandBan.cpp; sourceTree = ""; }; + F9E5A778300E7AD500164066 /* CommandBan.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = CommandBan.hpp; path = ../../src/commands/CommandBan.hpp; sourceTree = ""; }; + F9E5A77B300E7AF400164066 /* CommandHelp.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = CommandHelp.hpp; path = ../../src/commands/CommandHelp.hpp; sourceTree = ""; }; + F9E5A77C300E7AF400164066 /* CommandHelp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CommandHelp.cpp; path = ../../src/commands/CommandHelp.cpp; sourceTree = ""; }; + F9E5A77F300E7B0A00164066 /* CommandKick.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = CommandKick.hpp; path = ../../src/commands/CommandKick.hpp; sourceTree = ""; }; + F9E5A780300E7B0A00164066 /* CommandOp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CommandOp.cpp; path = ../../src/commands/CommandOp.cpp; sourceTree = ""; }; + F9E5A781300E7B0B00164066 /* CommandKick.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CommandKick.cpp; path = ../../src/commands/CommandKick.cpp; sourceTree = ""; }; + F9E5A782300E7B0B00164066 /* CommandOp.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = CommandOp.hpp; path = ../../src/commands/CommandOp.hpp; sourceTree = ""; }; + F9E5A787300E7B3400164066 /* Command.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Command.cpp; path = ../../src/commands/Command.cpp; sourceTree = ""; }; + F9E5A788300E7B3400164066 /* Command.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = Command.hpp; path = ../../src/commands/Command.hpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -4319,6 +4345,19 @@ D5CF9C37144C225000E4244F = { isa = PBXGroup; children = ( + F9E5A788300E7B3400164066 /* Command.hpp */, + F9E5A787300E7B3400164066 /* Command.cpp */, + F9E5A77F300E7B0A00164066 /* CommandKick.hpp */, + F9E5A781300E7B0B00164066 /* CommandKick.cpp */, + F9E5A782300E7B0B00164066 /* CommandOp.hpp */, + F9E5A780300E7B0A00164066 /* CommandOp.cpp */, + F9E5A77B300E7AF400164066 /* CommandHelp.hpp */, + F9E5A77C300E7AF400164066 /* CommandHelp.cpp */, + F9E5A778300E7AD500164066 /* CommandBan.hpp */, + F9E5A777300E7AD500164066 /* CommandBan.cpp */, + F9E5A773300E7AB700164066 /* CommandManager.hpp */, + F9E5A774300E7AB700164066 /* CommandManager.cpp */, + F9E5A771300E7A8700164066 /* LevelConstants.cpp */, F99D344D2F7372A100DC153E /* Launch Screen.storyboard */, D5E1BA9A1451C8A0007DCC4F /* Default@2x.png */, 9D959AFF16036BEE00E23A6F /* Default-568h@2x.png */, @@ -5451,6 +5490,19 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F9E5A789300E7B3400164066 /* Command.cpp in Sources */, + F9E5A78A300E7B3400164066 /* Command.hpp in Sources */, + F9E5A783300E7B0B00164066 /* CommandKick.hpp in Sources */, + F9E5A784300E7B0B00164066 /* CommandOp.cpp in Sources */, + F9E5A785300E7B0B00164066 /* CommandKick.cpp in Sources */, + F9E5A786300E7B0B00164066 /* CommandOp.hpp in Sources */, + F9E5A77D300E7AF400164066 /* CommandHelp.hpp in Sources */, + F9E5A77E300E7AF400164066 /* CommandHelp.cpp in Sources */, + F9E5A779300E7AD500164066 /* CommandBan.cpp in Sources */, + F9E5A77A300E7AD500164066 /* CommandBan.hpp in Sources */, + F9E5A775300E7AB700164066 /* CommandManager.hpp in Sources */, + F9E5A776300E7AB700164066 /* CommandManager.cpp in Sources */, + F9E5A772300E7A8700164066 /* LevelConstants.cpp in Sources */, F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */, D5CF9C57144C225000E4244F /* main.mm in Sources */, D5CF9C5B144C225000E4244F /* minecraftpeAppDelegate.mm in Sources */, From 93bf97a15ec1a5808193d066b1e14332fe5de281 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 20:05:29 +0300 Subject: [PATCH 161/189] Style changes --- .../gui/components/GuiElementContainer.cpp | 2 +- src/client/gui/components/OptionsGroup.cpp | 15 +---- src/client/gui/components/OptionsGroup.h | 62 +++++++++---------- 3 files changed, 34 insertions(+), 45 deletions(-) diff --git a/src/client/gui/components/GuiElementContainer.cpp b/src/client/gui/components/GuiElementContainer.cpp index 4fdaf22..377538a 100755 --- a/src/client/gui/components/GuiElementContainer.cpp +++ b/src/client/gui/components/GuiElementContainer.cpp @@ -36,7 +36,7 @@ void GuiElementContainer::removeChild( GuiElement* element ) { } bool GuiElementContainer::containsPointInChildren(int x, int y) const { - for (std::vector::const_iterator it = children.begin(); it != children.end(); ++it) { + for (auto it = children.begin(); it != children.end(); ++it) { GuiElement* child = *it; if (child == NULL || !child->visible) continue; if (child->pointInside(x, y)) return true; diff --git a/src/client/gui/components/OptionsGroup.cpp b/src/client/gui/components/OptionsGroup.cpp index 61695bb..d4dd161 100755 --- a/src/client/gui/components/OptionsGroup.cpp +++ b/src/client/gui/components/OptionsGroup.cpp @@ -12,18 +12,7 @@ #include "../../../platform/input/Mouse.h" #include "../../../util/Mth.h" -OptionsGroup::OptionsGroup( std::string labelID ) -: contentHeight(0), - scrollOffsetY(0.0f), - maxScrollOffsetY(0.0f), - trackingScrollGesture(false), - scrollingGesture(false), - touchDispatched(false), - dragStartX(0), - dragStartY(0), - lastDragY(0), - touchStartX(0), - touchStartY(0) { +OptionsGroup::OptionsGroup( std::string labelID ) { label = I18n::get(labelID); } @@ -36,7 +25,7 @@ void OptionsGroup::setupPositions() { const int contentStartY = y + labelHeight; // First we write the header and then we add the items - for(std::vector::iterator it = children.begin(); it != children.end(); ++it) { + for(auto it = children.begin(); it != children.end(); ++it) { (*it)->width = width - 5; (*it)->y = curY; diff --git a/src/client/gui/components/OptionsGroup.h b/src/client/gui/components/OptionsGroup.h index ac90e3d..bb284fa 100755 --- a/src/client/gui/components/OptionsGroup.h +++ b/src/client/gui/components/OptionsGroup.h @@ -1,16 +1,16 @@ -#ifndef NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__ -#define NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__ - -//package net.minecraft.client.gui; - -#include -#include "GuiElementContainer.h" -#include "ScrollingPane.h" -#include "../../Options.h" - -class Font; -class Minecraft; - +#ifndef NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__ +#define NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__ + +//package net.minecraft.client.gui; + +#include +#include "GuiElementContainer.h" +#include "ScrollingPane.h" +#include "../../Options.h" + +class Font; +class Minecraft; + class OptionsGroup: public GuiElementContainer { typedef GuiElementContainer super; public: @@ -24,26 +24,26 @@ public: void scrollByPixels(float deltaY); bool isScrollingGestureActive() const; protected: - - void createToggle(OptionId optId, Minecraft* minecraft); - void createProgressSlider(OptionId optId, Minecraft* minecraft); - void createStepSlider(OptionId optId, Minecraft* minecraft); - void createTextbox(OptionId optId, Minecraft* minecraft); + + void createToggle(OptionId optId, Minecraft* minecraft); + void createProgressSlider(OptionId optId, Minecraft* minecraft); + void createStepSlider(OptionId optId, Minecraft* minecraft); + void createTextbox(OptionId optId, Minecraft* minecraft); void createKey(OptionId optId, Minecraft* minecraft); std::string label; - int contentHeight; - float scrollOffsetY; - float maxScrollOffsetY; - bool trackingScrollGesture; - bool scrollingGesture; - bool touchDispatched; - int dragStartX; - int dragStartY; - int lastDragY; - int touchStartX; - int touchStartY; + int contentHeight = 0; + float scrollOffsetY = 0.f; + float maxScrollOffsetY = 0.f; + bool trackingScrollGesture = false; + bool scrollingGesture = false; + bool touchDispatched = false; + int dragStartX = 0; + int dragStartY = 0; + int lastDragY = 0; + int touchStartX = 0; + int touchStartY = 0; static const int ScrollStartThreshold = 5; }; - -#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__*/ + +#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__*/ From 0c32f620af1088023647bf094d3e33d52bbf564f Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 22:11:41 +0300 Subject: [PATCH 162/189] Sorry, apple users, I'm temporary removing foliage tinting --- src/client/Options.cpp | 15 ++++++++------- src/client/Options.h | 6 +++++- src/client/renderer/LevelRenderer.cpp | 7 +++++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 0785d4d..04479c5 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -65,17 +65,17 @@ OptionBool useVignette("useVignette", true); OptionBool useTouchscreen("useTouchscreen", true); OptionBool serverVisible("servervisible", true); - +#ifndef __APPLE__ OptionBool foliageTint("foliagetint", true); - +#endif OptionInt fogType("fogType", 0, 0, 2); OptionBool javaHud("javaHud", false); OptionBool betaSky("betaSky", false); - +#ifndef __APPLE__ OptionBool tintedSide("tintedSide", false); - +#endif OptionBool blockOutline("blockOutline", false); OptionBool restoredAnims("restoredAnims", true); @@ -199,17 +199,18 @@ void Options::initTable() { m_options[OPTIONS_BAR_ON_TOP] = &barOnTop; m_options[OPTIONS_ALLOW_SPRINT] = &allowSprint; m_options[OPTIONS_RPI_CURSOR] = &rpiCursor; +#ifndef __APPLE__ m_options[OPTIONS_FOLIAGE_TINT] = &foliageTint; - +#endif // more options yay m_options[OPTIONS_FOG_TYPE] = &fogType; m_options[OPTIONS_DEBUG_STYLE] = &debugStyle; m_options[OPTIONS_BETA_SKY] = &betaSky; - +#ifndef __APPLE__ m_options[OPTIONS_TINTED_SIDE] = &tintedSide; - +#endif m_options[OPTIONS_JAVA_HUD] = &javaHud; m_options[OPTIONS_AUTOJUMP] = &autoJump; diff --git a/src/client/Options.h b/src/client/Options.h index 001a555..2faddfa 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -88,11 +88,15 @@ enum OptionId { OPTIONS_LAST_IP, OPTIONS_RPI_CURSOR, +#ifndef __APPLE__ OPTIONS_FOLIAGE_TINT, - OPTIONS_FOG_TYPE, +#endif + OPTIONS_FOG_TYPE, OPTIONS_JAVA_HUD, OPTIONS_RESTORED_ANIMS, +#ifndef __APPLE__ OPTIONS_TINTED_SIDE, +#endif OPTIONS_BETA_SKY, OPTIONS_BEAUTIFUL_SKY, OPTIONS_VIGNETTE, diff --git a/src/client/renderer/LevelRenderer.cpp b/src/client/renderer/LevelRenderer.cpp index ba57fb6..1ce3ffd 100755 --- a/src/client/renderer/LevelRenderer.cpp +++ b/src/client/renderer/LevelRenderer.cpp @@ -185,11 +185,14 @@ void LevelRenderer::allChanged() lastFogType = mc->options.getIntValue(OPTIONS_FOG_TYPE); +#ifndef __APPLE__ bool tint = mc->options.getBooleanValue(OPTIONS_FOLIAGE_TINT); + bool sideTint = mc->options.getBooleanValue(OPTIONS_TINTED_SIDE); +#else + bool tint = false, sideTint = false; +#endif FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); - - bool sideTint = mc->options.getBooleanValue(OPTIONS_TINTED_SIDE); TileRenderer::setUseTint(sideTint); From 002bb40aae8e1123e506239ad8aaaa8bd38b5526 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 22:25:18 +0300 Subject: [PATCH 163/189] FIX: OpenAL error loop --- src/platform/audio/SoundSystemAL.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/platform/audio/SoundSystemAL.cpp b/src/platform/audio/SoundSystemAL.cpp index 7ea7289..3000608 100755 --- a/src/platform/audio/SoundSystemAL.cpp +++ b/src/platform/audio/SoundSystemAL.cpp @@ -10,13 +10,10 @@ static const char* errIdString = 0; void checkError() { + ALenum err = alGetError(); + if(err == AL_NO_ERROR) return; - while (1) { - ALenum err = alGetError(); - if(err == AL_NO_ERROR) return; - - LOGI("### SoundSystemAL error: %d ####: %s\n", err, errIdString==0?"(none)":errIdString); - } + LOGI("### SoundSystemAL error: %d ####: %s\n", err, errIdString==0?"(none)":errIdString); } //typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid *data, ALsizei size, ALsizei freq); From 980fc2ccfb17a70ce9031f214b2ae429b3eb04a4 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 22:48:38 +0300 Subject: [PATCH 164/189] fix build!! --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e51fd93..51bf53f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,6 @@ if (${PLATFORM} STREQUAL "Desktop") endif() if (WIN32) - target_sources(MinecraftPE PRIVATE data/images/pe.rc) add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(misc/windows) set(EXTRA_LIBS ws2_32 winhttp) @@ -321,6 +320,10 @@ target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT} ${EXTRA add_executable(${PROJECT_NAME} ${CLIENT_SOURCES}) +if(WIN32) + target_sources(${PROJECT_NAME} PRIVATE data/images/pe.rc) +endif() + target_compile_definitions(${PROJECT_NAME} PUBLIC ${PLATFORM_CPP}) target_include_directories(${PROJECT_NAME} PUBLIC From 92f972d32041eb1a8d2ac5c79ccbe85b7f50ca99 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 22:53:31 +0300 Subject: [PATCH 165/189] hopefully fixed ios build --- src/client/gui/screens/OptionsScreen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 5bed753..899750c 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -238,7 +238,9 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_MENU_STYLE, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) +#ifndef __APPLE__ .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) +#endif .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) .addOptionItem(OPTIONS_JAVA_HUD, minecraft) .addOptionItem(OPTIONS_FOG_TYPE, minecraft) From c616546e1ee2ee1e2f6a919eed133cfbd6a55200 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 22:56:20 +0300 Subject: [PATCH 166/189] fuck i forgot ro remove tinted side option too --- src/client/gui/screens/OptionsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 899750c..bdccde0 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -240,8 +240,8 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) #ifndef __APPLE__ .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) -#endif .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) +#endif .addOptionItem(OPTIONS_JAVA_HUD, minecraft) .addOptionItem(OPTIONS_FOG_TYPE, minecraft) .addOptionItem(OPTIONS_BETA_SKY, minecraft) From 79be815827f1b0ae31e0961e5f74d677fcb80e97 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:01:12 +0300 Subject: [PATCH 167/189] help me --- src/client/Minecraft.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 8c90b6f..009c4cf 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1197,12 +1197,15 @@ void Minecraft::init() TextureId grassId = (textures->loadTexture("misc/grasscolor.png")); // loading the uh png for foliage color int* grassPixels = textures->loadTexturePixels(grassId, "misc/grasscolor.png"); GrassColor::init(grassPixels); - +#ifndef __APPLE__ bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color + bool sideTint = options.getBooleanValue(OPTIONS_TINTED_SIDE); +#else + bool tint = false, sideTint = false; +#endif FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); - bool sideTint = options.getBooleanValue(OPTIONS_TINTED_SIDE); TileRenderer::setUseTint(sideTint); From 9434a48ae75a71804a6a8a52ff202c2af1b572d1 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:10:21 +0300 Subject: [PATCH 168/189] Revert "help me" This reverts commit 79be815827f1b0ae31e0961e5f74d677fcb80e97. --- src/client/Minecraft.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 009c4cf..8c90b6f 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1197,15 +1197,12 @@ void Minecraft::init() TextureId grassId = (textures->loadTexture("misc/grasscolor.png")); // loading the uh png for foliage color int* grassPixels = textures->loadTexturePixels(grassId, "misc/grasscolor.png"); GrassColor::init(grassPixels); -#ifndef __APPLE__ + bool tint = options.getBooleanValue(OPTIONS_FOLIAGE_TINT); // finally, toggleable foliage color - bool sideTint = options.getBooleanValue(OPTIONS_TINTED_SIDE); -#else - bool tint = false, sideTint = false; -#endif FoliageColor::setUseTint(tint); GrassColor::setUseTint(tint); + bool sideTint = options.getBooleanValue(OPTIONS_TINTED_SIDE); TileRenderer::setUseTint(sideTint); From 325ab94a6412396971aefa943cc998a0f17efdba Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:10:25 +0300 Subject: [PATCH 169/189] Revert "fuck i forgot ro remove tinted side option too" This reverts commit c616546e1ee2ee1e2f6a919eed133cfbd6a55200. --- src/client/gui/screens/OptionsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index bdccde0..899750c 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -240,8 +240,8 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) #ifndef __APPLE__ .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) - .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) #endif + .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) .addOptionItem(OPTIONS_JAVA_HUD, minecraft) .addOptionItem(OPTIONS_FOG_TYPE, minecraft) .addOptionItem(OPTIONS_BETA_SKY, minecraft) From 3ab30eefa41331ab4231a699cf444895d1113044 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:10:28 +0300 Subject: [PATCH 170/189] Revert "hopefully fixed ios build" This reverts commit 92f972d32041eb1a8d2ac5c79ccbe85b7f50ca99. --- src/client/gui/screens/OptionsScreen.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 899750c..5bed753 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -238,9 +238,7 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_MENU_STYLE, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) -#ifndef __APPLE__ .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) -#endif .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) .addOptionItem(OPTIONS_JAVA_HUD, minecraft) .addOptionItem(OPTIONS_FOG_TYPE, minecraft) From 8be6e381d8ca69cf96a954afbaf2e44fc073726e Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:12:34 +0300 Subject: [PATCH 171/189] ok i was wrong --- src/client/Options.cpp | 2 +- src/client/gui/screens/OptionsScreen.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 04479c5..deda2a8 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -66,7 +66,7 @@ OptionBool useTouchscreen("useTouchscreen", true); OptionBool serverVisible("servervisible", true); #ifndef __APPLE__ -OptionBool foliageTint("foliagetint", true); +OptionBool foliageTint("foliagetint", false); #endif OptionInt fogType("fogType", 0, 0, 2); diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 5bed753..9515e9a 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -238,8 +238,10 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_MENU_STYLE, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) +#ifdef __APPLE__ .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) +#endif .addOptionItem(OPTIONS_JAVA_HUD, minecraft) .addOptionItem(OPTIONS_FOG_TYPE, minecraft) .addOptionItem(OPTIONS_BETA_SKY, minecraft) From 381ef354c64ccac538665ee0403538839b1c4265 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:14:21 +0300 Subject: [PATCH 172/189] wtfffffff with git --- src/client/Options.cpp | 4 ---- src/client/Options.h | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/client/Options.cpp b/src/client/Options.cpp index deda2a8..2a84253 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -65,17 +65,13 @@ OptionBool useVignette("useVignette", true); OptionBool useTouchscreen("useTouchscreen", true); OptionBool serverVisible("servervisible", true); -#ifndef __APPLE__ OptionBool foliageTint("foliagetint", false); -#endif OptionInt fogType("fogType", 0, 0, 2); OptionBool javaHud("javaHud", false); OptionBool betaSky("betaSky", false); -#ifndef __APPLE__ OptionBool tintedSide("tintedSide", false); -#endif OptionBool blockOutline("blockOutline", false); OptionBool restoredAnims("restoredAnims", true); diff --git a/src/client/Options.h b/src/client/Options.h index 2faddfa..c33c93b 100755 --- a/src/client/Options.h +++ b/src/client/Options.h @@ -88,15 +88,11 @@ enum OptionId { OPTIONS_LAST_IP, OPTIONS_RPI_CURSOR, -#ifndef __APPLE__ OPTIONS_FOLIAGE_TINT, -#endif OPTIONS_FOG_TYPE, OPTIONS_JAVA_HUD, OPTIONS_RESTORED_ANIMS, -#ifndef __APPLE__ OPTIONS_TINTED_SIDE, -#endif OPTIONS_BETA_SKY, OPTIONS_BEAUTIFUL_SKY, OPTIONS_VIGNETTE, From 7620d49489b8a375dcb1a860609a9ef4dedf6d45 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:14:59 +0300 Subject: [PATCH 173/189] I should go sleep ig --- src/client/Options.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/client/Options.cpp b/src/client/Options.cpp index 2a84253..c67f68d 100755 --- a/src/client/Options.cpp +++ b/src/client/Options.cpp @@ -195,18 +195,14 @@ void Options::initTable() { m_options[OPTIONS_BAR_ON_TOP] = &barOnTop; m_options[OPTIONS_ALLOW_SPRINT] = &allowSprint; m_options[OPTIONS_RPI_CURSOR] = &rpiCursor; -#ifndef __APPLE__ m_options[OPTIONS_FOLIAGE_TINT] = &foliageTint; -#endif // more options yay m_options[OPTIONS_FOG_TYPE] = &fogType; m_options[OPTIONS_DEBUG_STYLE] = &debugStyle; m_options[OPTIONS_BETA_SKY] = &betaSky; -#ifndef __APPLE__ m_options[OPTIONS_TINTED_SIDE] = &tintedSide; -#endif m_options[OPTIONS_JAVA_HUD] = &javaHud; m_options[OPTIONS_AUTOJUMP] = &autoJump; From 09cc2ceee4576fa639e18f074ed27a3551e2d0e1 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 20 Jul 2026 23:35:32 +0300 Subject: [PATCH 174/189] hopefully fixed web world creation --- src/SharedConstants.cpp | 5 ++--- src/client/Minecraft.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/SharedConstants.cpp b/src/SharedConstants.cpp index 4a31175..ee64aa9 100755 --- a/src/SharedConstants.cpp +++ b/src/SharedConstants.cpp @@ -4,12 +4,11 @@ namespace Common { std::string getGameVersionString(const std::string& versionSuffix /* = "" */) { - std::string result = std::string("v0.6.1") + versionSuffix; + std::string result = std::string("v0.1.0 (forked from v0.6.1 alpha)") + versionSuffix; // append 64-bit port marker only on Android 64‑bit targets #if defined(ANDROID) && (defined(__aarch64__) || defined(__x86_64__)) - result += " (64-bit port)"; + result += " (64-bit)"; #endif - result += " alpha"; return result; } diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 8c90b6f..be01595 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -293,7 +293,7 @@ void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, Loc level->ops.emplace(op); _hasSignaledGeneratingLevelFinished = false; -#ifdef STANDALONE_SERVER +#if defined(STANDALONE_SERVER) || defined(PLATFORM_WEB) const bool threadedLevelCreation = false; #else const bool threadedLevelCreation = true; From 47cab7d66bf107a80ca948506955c03d91d9ebab Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 21 Jul 2026 12:35:34 +0200 Subject: [PATCH 175/189] FIX: Melon seeds name --- data/lang/en_US.lang | 2 +- project/android/assets/lang/en_US.lang | 2 +- src/world/item/Item.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/lang/en_US.lang b/data/lang/en_US.lang index c90c4be..567a52b 100755 --- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -1020,5 +1020,5 @@ desc.netherbrickitem=Used to form blocks of Nether bricks. desc.netherquartz=Quartz from the Nether, used to create Blocks of Quartz. desc.quartzblock=Decorative block, used to create other kinds of Quartz blocks. desc.stonecutter=For crafting stoneblocks. -desc.seedsmelon=Allows for more melons. +desc.seeds_melon=Allows for more melons. desc.tile.melon=Can be cut up and eaten. diff --git a/project/android/assets/lang/en_US.lang b/project/android/assets/lang/en_US.lang index fedae1c..83c1066 100755 --- a/project/android/assets/lang/en_US.lang +++ b/project/android/assets/lang/en_US.lang @@ -965,5 +965,5 @@ desc.netherbrickitem=Used to form blocks of Nether bricks. desc.netherquartz=Quartz from the Nether, used to create Blocks of Quartz. desc.quartzblock=Decorative block, used to create other kinds of Quartz blocks. desc.stonecutter=For crafting stoneblocks. -desc.seedsmelon=Allows for more melons. +desc.seeds_melon=Allows for more melons. desc.tile.melon=Can be cut up and eaten. diff --git a/src/world/item/Item.cpp b/src/world/item/Item.cpp index 1430743..9f27efa 100755 --- a/src/world/item/Item.cpp +++ b/src/world/item/Item.cpp @@ -274,7 +274,7 @@ void Item::initItems() { //Item::diode = (new TilePlanterItem(100, Tile::diode_off))->setIcon(6, 5)->setCategory(ItemCategory::Mechanisms)->setDescriptionId("diode"); Item::shears = (ShearsItem*)(new ShearsItem(103))->setIcon(13, 5)->setCategory(ItemCategory::Tools)->setDescriptionId("shears"); Item::melon = (new FoodItem(104, 2, false))->setIcon(13, 6)->setCategory(ItemCategory::FoodArmor)->setDescriptionId("melon"); - Item::seeds_melon = (new SeedItem(106, Tile::melonStem->id, Tile::farmland->id))->setIcon(14, 3)->setCategory(ItemCategory::FoodArmor)->setDescriptionId("seedsMelon"); + Item::seeds_melon = (new SeedItem(106, Tile::melonStem->id, Tile::farmland->id))->setIcon(14, 3)->setCategory(ItemCategory::FoodArmor)->setDescriptionId("seeds_melon"); Item::beef_raw = (new FoodItem(107, 3, /*FoodConstants.FOOD_SATURATION_LOW,*/ true))->setIcon(9, 6)->setCategory(ItemCategory::FoodArmor)->setDescriptionId("beefRaw"); Item::beef_cooked = (new FoodItem(108, 8, /*FoodConstants.FOOD_SATURATION_GOOD,*/ true))->setIcon(10, 6)->setCategory(ItemCategory::FoodArmor)->setDescriptionId("beefCooked"); Item::chicken_raw = (new FoodItem(109, 2, /*FoodConstants.FOOD_SATURATION_LOW,*/ true))->setIcon(9, 7)->setCategory(ItemCategory::FoodArmor)->setDescriptionId("chickenRaw"); From d7a51b09f17d87c0f6e4b457763f61cda2fabb29 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 21 Jul 2026 13:03:22 +0200 Subject: [PATCH 176/189] FIX: MessagePacket instead of ChatPacket --- src/client/gui/screens/ConsoleScreen.cpp | 4 ++-- src/network/ServerSideNetworkHandler.cpp | 17 +++++++++++++++++ src/network/ServerSideNetworkHandler.h | 2 ++ src/network/command/CommandServer.cpp | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index 42f47ee..5a9e4a6 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -6,7 +6,7 @@ #include "../../../world/level/Level.h" #include "../../../network/RakNetInstance.h" #include "../../../network/ServerSideNetworkHandler.h" -#include "../../../network/packet/ChatPacket.h" +#include "../../../network/packet/MessagePacket.h" #include "../../../platform/log.h" #include "util/StringUtils.h" @@ -76,7 +76,7 @@ void ConsoleScreen::execute() if (minecraft->netCallback && minecraft->raknetInstance->isServer()) { static_cast(minecraft->netCallback)->displayGameMessage(_input); } else if (minecraft->netCallback) { - ChatPacket chatPkt(_input); + MessagePacket chatPkt(_input.c_str()); minecraft->raknetInstance->send(chatPkt); } else { minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 474d9ad..2f4abc5 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -155,6 +155,23 @@ void ServerSideNetworkHandler::displayGameMessage(const std::string& message) raknetInstance->send(packet); } +void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MessagePacket* packet) +{ + auto player = getPlayer(source); + + if (player == nullptr) return; // @todo maybe kick? + std::string msg = packet->message.C_String(); + + if (packet->message[0] == '/') { + // This is a command + + ChatPacket resp(minecraft->commandManager().execute(*minecraft, *player, Util::stringTrim(msg.substr(1)))); + return sendPrivate(resp, source); + } + + displayGameMessage("<" + player->name + "> " + msg); +} + void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, ChatPacket* packet) { auto player = getPlayer(source); diff --git a/src/network/ServerSideNetworkHandler.h b/src/network/ServerSideNetworkHandler.h index 1e9585d..c1cb632 100755 --- a/src/network/ServerSideNetworkHandler.h +++ b/src/network/ServerSideNetworkHandler.h @@ -58,6 +58,8 @@ public: virtual void handle(const RakNet::RakNetGUID& source, ContainerClosePacket* packet); virtual void handle(const RakNet::RakNetGUID& source, SignUpdatePacket* packet); virtual void handle(const RakNet::RakNetGUID& source, ChatPacket* packet); + virtual void handle(const RakNet::RakNetGUID& source, MessagePacket* packet); + virtual void handle(const RakNet::RakNetGUID& source, WantCreatePacket* packet); bool allowsIncomingConnections() { return _allowIncoming; } diff --git a/src/network/command/CommandServer.cpp b/src/network/command/CommandServer.cpp index 280b0a9..3bcbbc1 100755 --- a/src/network/command/CommandServer.cpp +++ b/src/network/command/CommandServer.cpp @@ -92,7 +92,7 @@ static std::string ToStringOk(const T& a, const T& b, const T& c) { std::stringstream ss; ss << a << "," << b << "," << c << "\n"; return ss.str(); -} +} static bool inRange(int c, int lowInclusive, int highInclusive) { return c >= lowInclusive && c <= highInclusive; From 9a743b9aeacd5c09e81ff2a5f6c6da9057cfd889 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 21 Jul 2026 14:43:37 +0200 Subject: [PATCH 177/189] FIX: Steve skin hand, containers open in creative, crash when downfalls is nullptr, build on android (hope) --- src/client/gui/screens/ChestScreen.cpp | 5 ++++- src/client/gui/screens/FurnaceScreen.cpp | 2 ++ src/client/model/HumanoidModel.cpp | 3 +++ src/client/player/LocalPlayer.cpp | 15 ++++++--------- src/client/renderer/ItemInHandRenderer.cpp | 17 +++++++++-------- .../renderer/entity/EntityRenderDispatcher.cpp | 5 +++++ .../renderer/entity/EntityRenderDispatcher.h | 2 ++ src/client/renderer/entity/PlayerRenderer.cpp | 9 +++++++-- src/client/renderer/entity/PlayerRenderer.h | 2 ++ src/network/ServerSideNetworkHandler.cpp | 2 +- src/world/level/tile/TallGrass.cpp | 2 +- 11 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/client/gui/screens/ChestScreen.cpp b/src/client/gui/screens/ChestScreen.cpp index c9383c9..8a7b81e 100755 --- a/src/client/gui/screens/ChestScreen.cpp +++ b/src/client/gui/screens/ChestScreen.cpp @@ -329,7 +329,10 @@ bool ChestScreen::handleAddItem(FillingContainer* from, FillingContainer* to, in added = (takenItem.count != wantedCount); if (added) { - item->count -= (wantedCount - takenItem.count); + if (!minecraft->isCreativeMode()) { + item->count -= (wantedCount - takenItem.count); + } + std::vector changed; std::vector items = getItems(toPane); differ.getDiff(items, changed); diff --git a/src/client/gui/screens/FurnaceScreen.cpp b/src/client/gui/screens/FurnaceScreen.cpp index 58d6df2..eb9861f 100755 --- a/src/client/gui/screens/FurnaceScreen.cpp +++ b/src/client/gui/screens/FurnaceScreen.cpp @@ -500,6 +500,8 @@ ItemInstance FurnaceScreen::moveOver(const ItemInstance* item, int maxCount) { setIfNotSet(doRecreatePane, newSize != oldSize); return removed; } + + return ItemInstance(); } diff --git a/src/client/model/HumanoidModel.cpp b/src/client/model/HumanoidModel.cpp index bf004ec..e6515ea 100755 --- a/src/client/model/HumanoidModel.cpp +++ b/src/client/model/HumanoidModel.cpp @@ -21,6 +21,9 @@ HumanoidModel::HumanoidModel( float g /*= 0*/, float yOffset /*= 0*/, int texW / texWidth = texW; texHeight = texH; + // texWidth = 64; + // texHeight = 32; + head.setModel(this); hair.setModel(this); body.setModel(this); diff --git a/src/client/player/LocalPlayer.cpp b/src/client/player/LocalPlayer.cpp index 86a345f..29ccf44 100755 --- a/src/client/player/LocalPlayer.cpp +++ b/src/client/player/LocalPlayer.cpp @@ -554,9 +554,9 @@ void LocalPlayer::aiStep() { //if (onGround && abilities.flying) // abilities.flying = false; - yBobO = yBob; - xBobO = xBob; - xBob += (xRot - xBob) * 0.5; + yBobO = yBob; + xBobO = xBob; + xBob += (xRot - xBob) * 0.5; yBob += (yRot - yBob) * 0.5; if (interpolateOnly()) @@ -774,22 +774,19 @@ void LocalPlayer::startCrafting(int x, int y, int z, int tableSize) { void LocalPlayer::startStonecutting(int x, int y, int z) { #ifndef STANDALONE_SERVER - if (!minecraft->isCreativeMode()) - minecraft->setScreen( new StonecutterScreen() ); + minecraft->setScreen( new StonecutterScreen() ); #endif } void LocalPlayer::openFurnace( FurnaceTileEntity* e ) { #ifndef STANDALONE_SERVER - if (!minecraft->isCreativeMode()) - minecraft->setScreen( new FurnaceScreen(this, e) ); + minecraft->setScreen( new FurnaceScreen(this, e) ); #endif } void LocalPlayer::openContainer( ChestTileEntity* container ) { #ifndef STANDALONE_SERVER - if (!minecraft->isCreativeMode()) - minecraft->setScreen( new ChestScreen(this, container) ); + minecraft->setScreen( new ChestScreen(this, container) ); #endif } diff --git a/src/client/renderer/ItemInHandRenderer.cpp b/src/client/renderer/ItemInHandRenderer.cpp index fb83bdd..eb2be2b 100755 --- a/src/client/renderer/ItemInHandRenderer.cpp +++ b/src/client/renderer/ItemInHandRenderer.cpp @@ -291,14 +291,13 @@ void ItemInHandRenderer::render( float a ) Lighting::turnOn(mc); glPopMatrix2(); - if (localPlayer) // shredder added, basically does the hand swaying animation from b1.8 - { - float xrr = localPlayer->xBobO + (localPlayer->xBob - localPlayer->xBobO) * a; - float yrr = localPlayer->yBobO + (localPlayer->yBob - localPlayer->yBobO) * a; - // 4J - was using player->xRot and yRot directly here rather than interpolating between old & current with a - float yr = player->yRotO + (player->yRot - player->yRotO) * a; - glRotatef((xr - xrr) * 0.1f, 1, 0, 0); - glRotatef((yr - yrr) * 0.1f, 0, 1, 0); + if (localPlayer) { // shredder added, basically does the hand swaying animation from b1.8 + float xrr = localPlayer->xBobO + (localPlayer->xBob - localPlayer->xBobO) * a; + float yrr = localPlayer->yBobO + (localPlayer->yBob - localPlayer->yBobO) * a; + // 4J - was using player->xRot and yRot directly here rather than interpolating between old & current with a + float yr = player->yRotO + (player->yRot - player->yRotO) * a; + glRotatef((xr - xrr) * 0.1f, 1, 0, 0); + glRotatef((yr - yrr) * 0.1f, 0, 1, 0); } float br = mc->level->getBrightness(Mth::floor(player->x), Mth::floor(player->y), Mth::floor(player->z)); @@ -425,6 +424,8 @@ void ItemInHandRenderer::render( float a ) EntityRenderer* er = EntityRenderDispatcher::getInstance()->getRenderer(mc->player); HumanoidMobRenderer* playerRenderer = (HumanoidMobRenderer*) er; + EntityRenderDispatcher::getInstance()->setModernSkin((Entity*)(player)); + float ss = 1; glScalef2(ss, ss, ss); playerRenderer->renderHand(); diff --git a/src/client/renderer/entity/EntityRenderDispatcher.cpp b/src/client/renderer/entity/EntityRenderDispatcher.cpp index b0edea7..9381b89 100755 --- a/src/client/renderer/entity/EntityRenderDispatcher.cpp +++ b/src/client/renderer/entity/EntityRenderDispatcher.cpp @@ -137,6 +137,11 @@ void EntityRenderDispatcher::render( Entity* entity, float x, float y, float z, } } +void EntityRenderDispatcher::setModernSkin(Entity* player) { + PlayerRenderer* rend = (PlayerRenderer*)(getRenderer(player)); + rend->setModernSkin((Mob*)player); +} + EntityRenderer* EntityRenderDispatcher::getRenderer( Entity* entity ) { EntityRendererId rendererId = entity->entityRendererId; diff --git a/src/client/renderer/entity/EntityRenderDispatcher.h b/src/client/renderer/entity/EntityRenderDispatcher.h index 06c4eac..180b4ef 100755 --- a/src/client/renderer/entity/EntityRenderDispatcher.h +++ b/src/client/renderer/entity/EntityRenderDispatcher.h @@ -45,6 +45,8 @@ public: Font* getFont(); void onGraphicsReset(); + + void setModernSkin(Entity* player); private: void assign(EntityRendererId id, EntityRenderer* renderer); public: diff --git a/src/client/renderer/entity/PlayerRenderer.cpp b/src/client/renderer/entity/PlayerRenderer.cpp index 092b9dc..93685fd 100755 --- a/src/client/renderer/entity/PlayerRenderer.cpp +++ b/src/client/renderer/entity/PlayerRenderer.cpp @@ -70,13 +70,18 @@ void PlayerRenderer::renderName( Mob* mob, float x, float y, float z ){ } } -void PlayerRenderer::render(Entity* mob_, float x, float y, float z, float rot, float a) { - Mob* mob = (Mob*) mob_; +// @note fix player skin system +void PlayerRenderer::setModernSkin(Mob* mob) { HumanoidModel* desired = isModernPlayerSkin(mob) ? playerModel64 : playerModel32; if (model != desired || humanoidModel != desired) { model = desired; humanoidModel = desired; } +} + +void PlayerRenderer::render(Entity* mob_, float x, float y, float z, float rot, float a) { + Mob* mob = (Mob*) mob_; + setModernSkin(mob); /* LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), humanoidModel->texWidth, humanoidModel->texHeight, diff --git a/src/client/renderer/entity/PlayerRenderer.h b/src/client/renderer/entity/PlayerRenderer.h index d4b25e2..1105c4b 100755 --- a/src/client/renderer/entity/PlayerRenderer.h +++ b/src/client/renderer/entity/PlayerRenderer.h @@ -19,6 +19,8 @@ public: virtual void renderName(Mob* mob, float x, float y, float z); virtual void onGraphicsReset(); + + void setModernSkin(Mob* mob); private: HumanoidModel* playerModel32; HumanoidModel* playerModel64; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index 2f4abc5..dd9f08f 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -162,7 +162,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, MessageP if (player == nullptr) return; // @todo maybe kick? std::string msg = packet->message.C_String(); - if (packet->message[0] == '/') { + if (msg[0] == '/') { // This is a command ChatPacket resp(minecraft->commandManager().execute(*minecraft, *player, Util::stringTrim(msg.substr(1)))); diff --git a/src/world/level/tile/TallGrass.cpp b/src/world/level/tile/TallGrass.cpp index dbd3738..5f9743b 100755 --- a/src/world/level/tile/TallGrass.cpp +++ b/src/world/level/tile/TallGrass.cpp @@ -44,7 +44,7 @@ int TallGrass::getColor( LevelSource* level, int x, int y, int z ) { int d = level->getData(x, y, z); if (d == DEAD_SHRUB); //return 0xffffff; // i removed this to make it accurate to beta 1.6.6 instead of early java release versions float temp = level->getBiomeSource()->temperatures[0]; // shredder added - float rain = level->getBiomeSource()->downfalls[0]; // shredder added + float rain = level->getBiomeSource()->downfalls != nullptr ? level->getBiomeSource()->downfalls[0] : 0; // shredder added if (!GrassColor::useTint && d == DEAD_SHRUB){ return 0xffffff; } From 5ef00eee9f1a30c274bc203a32a7efd304084e0d Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 21 Jul 2026 15:28:17 +0200 Subject: [PATCH 178/189] FIX: Grass tint only on IOS --- src/client/gui/screens/OptionsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index 9515e9a..bdccde0 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -238,7 +238,7 @@ void OptionsScreen::generateOptionScreens() { .addOptionItem(OPTIONS_BAR_ON_TOP, minecraft) .addOptionItem(OPTIONS_MENU_STYLE, minecraft) .addOptionItem(OPTIONS_RPI_CURSOR, minecraft) -#ifdef __APPLE__ +#ifndef __APPLE__ .addOptionItem(OPTIONS_FOLIAGE_TINT, minecraft) .addOptionItem(OPTIONS_TINTED_SIDE, minecraft) #endif From 7104ba93ae8406cbb030b52ac5d53c968236d33b Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 21 Jul 2026 17:28:42 +0200 Subject: [PATCH 179/189] FIX: Grass color and egg red rectangle --- src/client/renderer/entity/ItemRenderer.cpp | 6 +++--- src/world/level/tile/TallGrass.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/renderer/entity/ItemRenderer.cpp b/src/client/renderer/entity/ItemRenderer.cpp index d103fcc..4c48a3b 100755 --- a/src/client/renderer/entity/ItemRenderer.cpp +++ b/src/client/renderer/entity/ItemRenderer.cpp @@ -189,9 +189,9 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, const ItemInsta // it we're batching for saving the // buffer, this will fail miserably t.endOverrideAndDraw(); - glDisable2(GL_TEXTURE_2D); - fillRect(t, x, y, w, h, 0xff0000); - glEnable2(GL_TEXTURE_2D); + // glDisable2(GL_TEXTURE_2D); + // fillRect(t, x, y, w, h, 0xff0000); + // glEnable2(GL_TEXTURE_2D); renderGuiItemCorrect(font, textures, item, int(x), int(y)); t.beginOverride(); } diff --git a/src/world/level/tile/TallGrass.cpp b/src/world/level/tile/TallGrass.cpp index 5f9743b..2c52bf6 100755 --- a/src/world/level/tile/TallGrass.cpp +++ b/src/world/level/tile/TallGrass.cpp @@ -48,9 +48,9 @@ int TallGrass::getColor( LevelSource* level, int x, int y, int z ) { if (!GrassColor::useTint && d == DEAD_SHRUB){ return 0xffffff; } - if (GrassColor::useTint){ - return GrassColor::get(temp, rain); - } + // if (GrassColor::useTint){ + // return GrassColor::get(temp, rain); @fixme @todo doesnt work properly + // } // @TODO port this function from beta 1.6.6 probably, for now im using biomesource to tint it directly above - shredder //if (GrassColor::useTint){ //return level->getBiome(x, z)->getGrassColor(); From 1f252ac4b30892aeceed3096b26d115f32198f9f Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sun, 26 Jul 2026 20:43:02 +0300 Subject: [PATCH 180/189] FIX: grass color | small improvements --- CMakeLists.txt | 4 ++- src/client/Minecraft.cpp | 2 +- src/client/gui/components/ScrollingPane.cpp | 31 ++++++++--------- src/client/gui/screens/DeathScreen.cpp | 4 +-- .../gui/screens/SimpleChooseLevelScreen.cpp | 25 +++++++------- src/client/player/LocalPlayer.h | 2 +- src/client/renderer/GameRenderer.cpp | 4 +-- src/commands/Command.hpp | 9 +---- src/commands/CommandGimmieItems.cpp | 33 +++++++++++++++++++ src/commands/CommandGimmieItems.hpp | 9 +++++ src/commands/CommandManager.cpp | 32 +++++++++--------- src/world/entity/Mob.cpp | 12 ++++--- src/world/entity/Mob.h | 2 ++ src/world/entity/player/Player.cpp | 21 +++--------- src/world/entity/player/Player.h | 5 +-- src/world/level/tile/TallGrass.cpp | 8 +++-- 16 files changed, 117 insertions(+), 86 deletions(-) create mode 100644 src/commands/CommandGimmieItems.cpp create mode 100644 src/commands/CommandGimmieItems.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 51bf53f..b978db0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,9 @@ endif() enum_option(PLATFORM "Desktop;Web" "Platform to build for.") -find_package(Threads REQUIRED) +if(NOT EMSCRIPTEN) + find_package(Threads REQUIRED) +endif() find_package(OpenSSL) if (${PLATFORM} STREQUAL "Desktop") diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index be01595..ded2191 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -516,7 +516,7 @@ void Minecraft::tick(int nTick, int maxTick) { if (missTime > 0) missTime--; #ifndef STANDALONE_SERVER if (!screen && player) { - if (player->health <= 0) { + if (player->hasDied()) { setScreen(new DeathScreen()); } } diff --git a/src/client/gui/components/ScrollingPane.cpp b/src/client/gui/components/ScrollingPane.cpp index 090bc3a..79dd11c 100755 --- a/src/client/gui/components/ScrollingPane.cpp +++ b/src/client/gui/components/ScrollingPane.cpp @@ -204,22 +204,23 @@ void ScrollingPane::render( int xm, int ym, float alpha ) { const float bxx = bbox.x - (fpx /*+ dx*alpha*/) + (nw.xf - nw.x); const float byy = bbox.y - (fpy /*+ dy*alpha*/) + (nw.yf - nw.y); - for (int y = nw.y; y <= se.y; ++y) - for (int x = nw.x; x <= se.x; ++x) { - int id = y * columns + x; - if (y <0 || id < 0 || id >= numItems) continue; // @todo: break rather - if (isNotSet(SF_WrapX) && (x < 0 || x >= columns)) continue; // @todo: break rather - GridItem item; //@todo: v- Does not support SF_Wrapping - item.id = id; - item.xf = bxx + x * itemBbox.w; - item.yf = byy + y * itemBbox.h; - item.x = (int)item.xf; - item.y = (int)item.yf; - //LOGI("i: %d (%.1f, %.1f)\t", id, item.xf, item.yf); - if (isSet(SF_MultiSelect)) item.selected = selected[id]; - else item.selected = (id == selectedId); + for (int y = nw.y; y <= se.y; ++y) { + for (int x = nw.x; x <= se.x; ++x) { + int id = y * columns + x; + if (y <0 || id < 0 || id >= numItems) continue; // @todo: break rather + if (isNotSet(SF_WrapX) && (x < 0 || x >= columns)) continue; // @todo: break rather + GridItem item; //@todo: v- Does not support SF_Wrapping + item.id = id; + item.xf = bxx + x * itemBbox.w; + item.yf = byy + y * itemBbox.h; + item.x = (int)item.xf; + item.y = (int)item.yf; + //LOGI("i: %d (%.1f, %.1f)\t", id, item.xf, item.yf); + if (isSet(SF_MultiSelect)) item.selected = selected[id]; + else item.selected = (id == selectedId); - itemsToRender.push_back(item); + itemsToRender.push_back(item); + } } renderBatch(itemsToRender, alpha); diff --git a/src/client/gui/screens/DeathScreen.cpp b/src/client/gui/screens/DeathScreen.cpp index e97b103..0d881a1 100755 --- a/src/client/gui/screens/DeathScreen.cpp +++ b/src/client/gui/screens/DeathScreen.cpp @@ -72,7 +72,7 @@ void DeathScreen::render( int xm, int ym, float a ) if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){ glPushMatrix2(); glScalef2(2, 2, 2); - drawCenteredString(font, "Game over!", width / 2 / 2, height / 8, 0xffffff); + drawCenteredString(font, I18n::get("deathScreen.title.hardcore"), width / 4, height / 8, 0xffffff); glPopMatrix2(); std::stringstream ss; ss << "Score: &e" << minecraft->player->getScore(); @@ -80,7 +80,7 @@ if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){ } else { glPushMatrix2(); glScalef2(2, 2, 2); - drawCenteredString(font, "You died!", width / 2 / 2, height / 8, 0xffffff); + drawCenteredString(font, I18n::get("deathScreen.title"), width / 4, height / 8, 0xffffff); glPopMatrix2(); } diff --git a/src/client/gui/screens/SimpleChooseLevelScreen.cpp b/src/client/gui/screens/SimpleChooseLevelScreen.cpp index c5a1278..37f5c72 100755 --- a/src/client/gui/screens/SimpleChooseLevelScreen.cpp +++ b/src/client/gui/screens/SimpleChooseLevelScreen.cpp @@ -8,13 +8,14 @@ #include "../../../platform/time.h" #include "../../../platform/input/Keyboard.h" #include "../../../platform/log.h" +#include SimpleChooseLevelScreen::SimpleChooseLevelScreen(const std::string& levelName) -: bHeader(0), - bGamemode(0), - bCheats(0), - bBack(0), - bCreate(0), +: bHeader(nullptr), + bGamemode(nullptr), + bCheats(nullptr), + bBack(nullptr), + bCreate(nullptr), levelName(levelName), hasChosen(false), gamemode(GameType::Survival), @@ -42,10 +43,10 @@ void SimpleChooseLevelScreen::init() // first") when the name already existed. ChooseLevelScreen::init(); - tLevelName.text = "New world"; + tLevelName.text = I18n::get("selectWorld.newWorld"); // header + close button - bHeader = new Touch::THeader(0, "Create World"); + bHeader = new Touch::THeader(0, I18n::get("selectWorld.create")); // create the back/X button as ImageButton like CreditsScreen bBack = new ImageButton(2, ""); { @@ -56,14 +57,14 @@ void SimpleChooseLevelScreen::init() def.setSrc(IntRectangle(150, 0, (int)def.width, (int)def.height)); bBack->setImageDef(def, true); } - if (/* minecraft->useTouchscreen() */ true) { - bGamemode = new Touch::TButton(1, "Survival mode"); + if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) != 2) { + bGamemode = new Touch::TButton(1, I18n::get("selectWorld.gameMode.survival")); bCheats = new Touch::TButton(4, "Cheats: Off"); - bCreate = new Touch::TButton(3, "Create"); + bCreate = new Touch::TButton(3, I18n::get("selectWorld.create")); } else { - bGamemode = new Button(1, "Survival mode"); + bGamemode = new Button(1, I18n::get("selectWorld.gameMode.survival")); bCheats = new Button(4, "Cheats: Off"); - bCreate = new Button(3, "Create"); + bCreate = new Button(3, I18n::get("Create")); } buttons.push_back(bHeader); diff --git a/src/client/player/LocalPlayer.h b/src/client/player/LocalPlayer.h index d1fef05..aa0b956 100755 --- a/src/client/player/LocalPlayer.h +++ b/src/client/player/LocalPlayer.h @@ -23,7 +23,7 @@ public: void tick(); - float yBob, xBob; // shredder added from b1.8/4j for the hand swaying animation + float yBob, xBob; // shredder added from b1.8/4j for the hand swaying animation float yBobO, xBobO; // shredder added from b1.8/4j for the hand swaying animation void move(float xa, float ya, float za); diff --git a/src/client/renderer/GameRenderer.cpp b/src/client/renderer/GameRenderer.cpp index c4bc08c..3ea22a0 100755 --- a/src/client/renderer/GameRenderer.cpp +++ b/src/client/renderer/GameRenderer.cpp @@ -440,7 +440,7 @@ float GameRenderer::getFov(float a, bool applyEffects) { fov *= this->oFov + (this->fov - this->oFov) * a; if (player->isUnderLiquid(Material::water)) fov = 60; - if (player->health <= 0) { + if (player->hasDied()) { float duration = player->deathTime + a; fov /= ((1 - 500 / (duration + 500)) * 2.0f + 1); @@ -537,7 +537,7 @@ void GameRenderer::bobHurt(float a) { float hurt = player->hurtTime - a; - if (player->health <= 0) { + if (player->hasDied()) { float duration = player->deathTime + a; glRotatef2(40 - (40 * 200) / (duration + 200), 0, 0, 1); } diff --git a/src/commands/Command.hpp b/src/commands/Command.hpp index fb3fdd0..e19ad45 100644 --- a/src/commands/Command.hpp +++ b/src/commands/Command.hpp @@ -2,18 +2,12 @@ #include #include -enum CommandFlags { - COMMAND_FLAG_SINGLEPLAYER_ONLY = (1 << 1), - COMMAND_FLAG_NO_ARGS = (1 << 2), -}; - class Minecraft; class Player; class Command { public: const std::string& getName() { return m_name; } - const CommandFlags getFlags() { return m_flags; } bool isPlayerOp(Minecraft& mc, Player& player); @@ -21,8 +15,7 @@ public: virtual std::string help(Minecraft& mc) = 0; protected: - Command(const std::string& name, CommandFlags flags = (CommandFlags)0) : m_name(name), m_flags(flags) {} + Command(const std::string& name) : m_name(name) {} const std::string m_name; - const CommandFlags m_flags; }; \ No newline at end of file diff --git a/src/commands/CommandGimmieItems.cpp b/src/commands/CommandGimmieItems.cpp new file mode 100644 index 0000000..9a7f542 --- /dev/null +++ b/src/commands/CommandGimmieItems.cpp @@ -0,0 +1,33 @@ +#include "CommandGimmieItems.hpp" +#include +#include +#include + +CommandGimmieItems::CommandGimmieItems() : Command("gimmieitems") {} + +std::string CommandGimmieItems::execute(Minecraft& mc, Player& player, const std::vector& args) { + if (mc.level != nullptr) { + if (mc.level->getLevelData()->getAllowCheats()) { + player.inventory->add(new ItemInstance(Item::ironIngot, 64)); + player.inventory->add(new ItemInstance(Item::ironIngot, 34)); + player.inventory->add(new ItemInstance(Tile::stonecutterBench)); + player.inventory->add(new ItemInstance(Tile::workBench)); + player.inventory->add(new ItemInstance(Tile::furnace)); + player.inventory->add(new ItemInstance(Tile::wood, 54)); + player.inventory->add(new ItemInstance(Item::stick, 14)); + player.inventory->add(new ItemInstance(Item::coal, 31)); + player.inventory->add(new ItemInstance(Tile::sand, 6)); + player.inventory->add(new ItemInstance(Item::dye_powder, 23, DyePowderItem::PURPLE)); + + return "Grant debug items. Have fun!"; + } else { + return "Cheats are not allowed!"; + } + } + + return "World not loaded"; +} + +std::string CommandGimmieItems::help(Minecraft& mc) { + return "Usage: /gimmieitems"; +} \ No newline at end of file diff --git a/src/commands/CommandGimmieItems.hpp b/src/commands/CommandGimmieItems.hpp new file mode 100644 index 0000000..d3fa66e --- /dev/null +++ b/src/commands/CommandGimmieItems.hpp @@ -0,0 +1,9 @@ +#include "Command.hpp" + +class CommandGimmieItems : public Command { +public: + CommandGimmieItems(); + + std::string execute(Minecraft& mc, Player& player, const std::vector& args); + std::string help(Minecraft& mc); +}; \ No newline at end of file diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index fbb9324..4c49eaf 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -8,6 +8,7 @@ #include "commands/CommandKick.hpp" #include "commands/CommandOp.hpp" #include "commands/CommandBan.hpp" +#include "commands/CommandGimmieItems.hpp" #include "network/packet/ChatPacket.h" #include "network/RakNetInstance.h" #include "world/level/Level.h" @@ -21,6 +22,7 @@ void CommandManager::registerAllCommands() { m_commands.push_back(new CommandKick()); m_commands.push_back(new CommandOp()); m_commands.push_back(new CommandBan()); + m_commands.push_back(new CommandGimmieItems()); } std::vector CommandManager::getListAllCommands() { @@ -34,32 +36,32 @@ std::vector CommandManager::getListAllCommands() { } std::string CommandManager::execute(Minecraft& mc, Player& player, const std::string& input) { - std::istringstream ss(input); - std::string cmd; + if (!mc.level->isClientSide) { + std::istringstream ss(input); + std::string cmd; - ss >> cmd; + ss >> cmd; - auto it = std::find_if(m_commands.begin(), m_commands.end(), [cmd](auto& it) -> bool { - return it->getName() == cmd; - }); + auto it = std::find_if(m_commands.begin(), m_commands.end(), [cmd](auto& it) -> bool { + return it->getName() == cmd; + }); - if (it == m_commands.end()) { - return "Command /" + cmd + " not found"; - } + if (it == m_commands.end()) { + return "Command /" + cmd + " not found"; + } - std::vector args; + std::vector args; + + std::string tok; + while (ss >> tok) args.push_back(tok); - std::string tok; - while (ss >> tok) args.push_back(tok); - - if (!mc.level->isClientSide || (*it)->getFlags() & CommandFlags::COMMAND_FLAG_SINGLEPLAYER_ONLY) { return (*it)->execute(mc, player, args); } else { ChatPacket packet("/" + input); mc.raknetInstance->send(packet); } - return ""; + return std::string(); } Command* CommandManager::getCommand(const std::string& name) { diff --git a/src/world/entity/Mob.cpp b/src/world/entity/Mob.cpp index e275ea8..726f444 100755 --- a/src/world/entity/Mob.cpp +++ b/src/world/entity/Mob.cpp @@ -224,7 +224,7 @@ void Mob::baseTick() if (hurtTime > 0) hurtTime--; if (invulnerableTime > 0) invulnerableTime--; - if (health <= 0) { + if (this->hasDied()) { deathTime++; if (deathTime > SharedConstants::TicksPerSecond) { beforeRemove(); @@ -437,7 +437,8 @@ void Mob::setSize( float w, float h ) void Mob::heal( int heal ) { - if (health <= 0) return; + if (this->hasDied()) return; + health += heal; if (health > 20) health = 20; invulnerableTime = invulnerableDuration / 2; @@ -447,7 +448,8 @@ bool Mob::hurt( Entity* source, int dmg ) { if (level->isClientSide) return false; noActionTime = 0; - if (health <= 0) return false; + + if (this->hasDied()) return false; this->walkAnimSpeed = 1.5f; @@ -485,7 +487,7 @@ bool Mob::hurt( Entity* source, int dmg ) } } - if (health <= 0) { + if (this->hasDied()) { if (sound) level->playSound(this, getDeathSound(), getSoundVolume(), getVoicePitch()); die(source); } else { @@ -892,7 +894,7 @@ void Mob::newServerAiStep() { bool Mob::isImmobile() { - return health <= 0; + return this->hasDied(); } void Mob::jumpFromGround() diff --git a/src/world/entity/Mob.h b/src/world/entity/Mob.h index f9a0fa0..40ee980 100755 --- a/src/world/entity/Mob.h +++ b/src/world/entity/Mob.h @@ -127,6 +127,8 @@ public: virtual ItemInstance* getCarriedItem() {return NULL;} virtual int getUseItemDuration() {return 0;} virtual void swing(); + + inline bool hasDied() { return health <= 0; } protected: virtual void causeFallDamage(float distance); diff --git a/src/world/entity/player/Player.cpp b/src/world/entity/player/Player.cpp index 487b361..a5fcb26 100755 --- a/src/world/entity/player/Player.cpp +++ b/src/world/entity/player/Player.cpp @@ -390,7 +390,7 @@ void Player::travel(float xa, float ya) { /*protected*/ bool Player::isImmobile() { - return health <= 0 || isSleeping(); + return hasDied() || isSleeping(); } /*protected*/ @@ -447,8 +447,8 @@ void Player::aiStep() { float tBob = (float) Mth::sqrt(xd * xd + zd * zd); float tTilt = (float) Mth::atan(-yd * 0.2f) * 15.f; if (tBob > 0.1f) tBob = 0.1f; - if (!onGround || health <= 0) tBob = 0; - if (onGround || health <= 0) tTilt = 0; + if (!onGround || hasDied()) tBob = 0; + if (onGround || hasDied()) tTilt = 0; bob += (tBob - bob) * 0.4f; tilt += (tTilt - tilt) * 0.8f; @@ -518,14 +518,6 @@ bool Player::isCreativeModeAllowed() { return true; } -//void Player::drop() { -// //drop(inventory.removeItem(inventory.selected, 1), false); -//} - -void Player::drop(ItemInstance* item) { - drop(item, false); -} - void Player::drop(ItemInstance* item, bool randomly) { if (item == NULL || item->isNull()) return; @@ -559,11 +551,6 @@ void Player::drop(ItemInstance* item, bool randomly) { thrownItem->zd += Mth::sin(dir) * pow; } - reallyDrop(thrownItem); -} - -/*protected*/ -void Player::reallyDrop(ItemEntity* thrownItem) { level->addEntity(thrownItem); } @@ -680,7 +667,7 @@ bool Player::hurt(Entity* source, int dmg) { if (abilities.invulnerable) return false; noActionTime = 0; - if (health <= 0) return false; + if (hasDied()) return false; if(isSleeping() && !level->isClientSide) { stopSleepInBed(true, true, false); } diff --git a/src/world/entity/player/Player.h b/src/world/entity/player/Player.h index 0fb7dae..6f69b01 100755 --- a/src/world/entity/player/Player.h +++ b/src/world/entity/player/Player.h @@ -91,10 +91,7 @@ public: void handleEntityEvent(char id); virtual void take(Entity* e, int orgCount); - //void drop(); - virtual void drop(ItemInstance* item); - virtual void drop(ItemInstance* item, bool randomly); - void reallyDrop(ItemEntity* thrownItem); + virtual void drop(ItemInstance* item, bool randomly = false); bool canDestroy(Tile* tile); float getDestroySpeed(Tile* tile); diff --git a/src/world/level/tile/TallGrass.cpp b/src/world/level/tile/TallGrass.cpp index 2c52bf6..497279e 100755 --- a/src/world/level/tile/TallGrass.cpp +++ b/src/world/level/tile/TallGrass.cpp @@ -43,14 +43,16 @@ int TallGrass::getColor( int auxData ) { int TallGrass::getColor( LevelSource* level, int x, int y, int z ) { int d = level->getData(x, y, z); if (d == DEAD_SHRUB); //return 0xffffff; // i removed this to make it accurate to beta 1.6.6 instead of early java release versions + + level->getBiomeSource()->getBiomeBlock(x, z, 1, 1); float temp = level->getBiomeSource()->temperatures[0]; // shredder added float rain = level->getBiomeSource()->downfalls != nullptr ? level->getBiomeSource()->downfalls[0] : 0; // shredder added if (!GrassColor::useTint && d == DEAD_SHRUB){ return 0xffffff; } - // if (GrassColor::useTint){ - // return GrassColor::get(temp, rain); @fixme @todo doesnt work properly - // } + if (GrassColor::useTint){ + return GrassColor::get(temp, rain); + } // @TODO port this function from beta 1.6.6 probably, for now im using biomesource to tint it directly above - shredder //if (GrassColor::useTint){ //return level->getBiome(x, z)->getGrassColor(); From 61ff4835ea497ff10622de87887b1851bc959609 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Mon, 27 Jul 2026 17:55:40 +0300 Subject: [PATCH 181/189] FIX: commands and multiplayer crashes --- src/client/gui/screens/ConsoleScreen.cpp | 29 ++++++++++---------- src/commands/CommandBan.cpp | 4 +-- src/commands/CommandManager.cpp | 35 ++++++++++-------------- src/main_dedicated.cpp | 8 +++--- src/network/RakNetInstance.cpp | 2 +- src/network/ServerSideNetworkHandler.cpp | 2 +- src/world/level/Level.h | 2 +- 7 files changed, 38 insertions(+), 44 deletions(-) diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index 5a9e4a6..2bdec3c 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -63,24 +63,25 @@ void ConsoleScreen::execute() return minecraft->setScreen(NULL); } - if (_input[0] == '/') { - // Command + if (minecraft->netCallback && !minecraft->raknetInstance->isServer()) { + minecraft->raknetInstance->send(MessagePacket(_input.c_str())); + } else if (_input[0] == '/') { _input = Util::stringTrim(_input.substr(1)); - - std::istringstream iss(minecraft->commandManager().execute(*minecraft, *minecraft->player, _input)); - for (std::string line; std::getline(iss, line); ) { + + std::istringstream iss( + minecraft->commandManager().execute(*minecraft, *minecraft->player, _input) + ); + + for (std::string line; std::getline(iss, line);) { minecraft->gui.addMessage(line); } - } else { - // @ai @rewrite - if (minecraft->netCallback && minecraft->raknetInstance->isServer()) { - static_cast(minecraft->netCallback)->displayGameMessage(_input); - } else if (minecraft->netCallback) { - MessagePacket chatPkt(_input.c_str()); - minecraft->raknetInstance->send(chatPkt); - } else { - minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); + } + else { + if (minecraft->raknetInstance->isServer()) { + minecraft->raknetInstance->send(MessagePacket(_input.c_str())); } + + minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); } minecraft->setScreen(NULL); diff --git a/src/commands/CommandBan.cpp b/src/commands/CommandBan.cpp index 0373d5b..3877d95 100644 --- a/src/commands/CommandBan.cpp +++ b/src/commands/CommandBan.cpp @@ -36,14 +36,14 @@ std::string CommandBan::execute(Minecraft& mc, Player& player, const std::vector (*it)->remove(); mc.raknetInstance->getPeer()->CloseConnection((*it)->owner, true); } else { - for (auto& banned : mc.level->bannedPpl) { + for (auto& banned : mc.level->bannedPlayers) { if (nicknameLower == banned) { return args[0] + "already banned!"; } } } - mc.level->bannedPpl.insert(nicknameLower); + mc.level->bannedPlayers.insert(nicknameLower); return "ban: successfully banned player " + args[0]; } diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index 4c49eaf..ae25b9a 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -36,32 +36,25 @@ std::vector CommandManager::getListAllCommands() { } std::string CommandManager::execute(Minecraft& mc, Player& player, const std::string& input) { - if (!mc.level->isClientSide) { - std::istringstream ss(input); - std::string cmd; + std::istringstream ss(input); + std::string cmd; - ss >> cmd; + ss >> cmd; - auto it = std::find_if(m_commands.begin(), m_commands.end(), [cmd](auto& it) -> bool { - return it->getName() == cmd; - }); + auto it = std::find_if(m_commands.begin(), m_commands.end(), [cmd](auto& it) -> bool { + return it->getName() == cmd; + }); - if (it == m_commands.end()) { - return "Command /" + cmd + " not found"; - } - - std::vector args; - - std::string tok; - while (ss >> tok) args.push_back(tok); - - return (*it)->execute(mc, player, args); - } else { - ChatPacket packet("/" + input); - mc.raknetInstance->send(packet); + if (it == m_commands.end()) { + return "Command /" + cmd + " not found"; } - return std::string(); + std::vector args; + + std::string tok; + while (ss >> tok) args.push_back(tok); + + return (*it)->execute(mc, player, args); } Command* CommandManager::getCommand(const std::string& name) { diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index fcf14ce..5e27cd3 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -190,13 +190,13 @@ int main(int numArguments, char* pszArgs[]) { while (std::getline(banned, line)) { if (!line.empty()) { - ((MAIN_CLASS*)g_app)->level->bannedPpl.insert(line); + ((MAIN_CLASS*)g_app)->level->bannedPlayers.insert(line); } } } else { - std::ofstream bannedPpl("banned-players.txt"); + std::ofstream bannedPlayers("banned-players.txt"); - if (!bannedPpl.is_open()) { + if (!bannedPlayers.is_open()) { throw std::runtime_error("Cannot create banned players list."); } } @@ -225,7 +225,7 @@ int main(int numArguments, char* pszArgs[]) { std::ofstream bannedWrite("banned-players.txt"); if (bannedWrite.is_open()) { - for (auto& banned : ((MAIN_CLASS*)g_app)->level->bannedPpl) { + for (auto& banned : ((MAIN_CLASS*)g_app)->level->bannedPlayers) { bannedWrite << banned << std::endl; } bannedWrite.close(); diff --git a/src/network/RakNetInstance.cpp b/src/network/RakNetInstance.cpp index 75a2814..d5e3ad0 100755 --- a/src/network/RakNetInstance.cpp +++ b/src/network/RakNetInstance.cpp @@ -200,7 +200,7 @@ void RakNetInstance::runEvents(NetEventCallback* callback) case ID_DISCONNECTION_NOTIFICATION: case ID_CONNECTION_LOST: callback->onDisconnect(currentEvent->guid); - break; + return; case ID_UNCONNECTED_PONG: { RakNet::TimeMS time; diff --git a/src/network/ServerSideNetworkHandler.cpp b/src/network/ServerSideNetworkHandler.cpp index dd9f08f..7863e37 100755 --- a/src/network/ServerSideNetworkHandler.cpp +++ b/src/network/ServerSideNetworkHandler.cpp @@ -257,7 +257,7 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& source, LoginPac } } - for (auto& banned : level->bannedPpl) { + for (auto& banned : level->bannedPlayers) { if (nicknameLower == banned) { loginStatus = packet->newProto ? LoginStatus::Failed_Banned : LoginStatus::Failed_ClientOld; break; diff --git a/src/world/level/Level.h b/src/world/level/Level.h index 17c1d48..e9b9294 100755 --- a/src/world/level/Level.h +++ b/src/world/level/Level.h @@ -312,7 +312,7 @@ public: Random random; std::set ops; - std::set bannedPpl; + std::set bannedPlayers; protected: bool isFindingSpawn; From db4683f62a17625ab4c485d8e4f7c96370e52360 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 27 Jul 2026 22:07:44 +0200 Subject: [PATCH 182/189] 1 --- src/client/gui/screens/ConsoleScreen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index 2bdec3c..ccb6039 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -64,7 +64,8 @@ void ConsoleScreen::execute() } if (minecraft->netCallback && !minecraft->raknetInstance->isServer()) { - minecraft->raknetInstance->send(MessagePacket(_input.c_str())); + MessagePacket packet(_input.c_str()); + minecraft->raknetInstance->send(&packet); } else if (_input[0] == '/') { _input = Util::stringTrim(_input.substr(1)); @@ -78,7 +79,8 @@ void ConsoleScreen::execute() } else { if (minecraft->raknetInstance->isServer()) { - minecraft->raknetInstance->send(MessagePacket(_input.c_str())); + MessagePacket packet(_input.c_str()); + minecraft->raknetInstance->send(&packet); } minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); From 6767011d5004f2e53330ce9b00fe32f9e5613ddf Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 27 Jul 2026 22:12:21 +0200 Subject: [PATCH 183/189] 123123 --- src/commands/CommandManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index ae25b9a..16b331c 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -22,7 +22,7 @@ void CommandManager::registerAllCommands() { m_commands.push_back(new CommandKick()); m_commands.push_back(new CommandOp()); m_commands.push_back(new CommandBan()); - m_commands.push_back(new CommandGimmieItems()); + // m_commands.push_back(new CommandGimmieItems()); } std::vector CommandManager::getListAllCommands() { From a489435cc510ddb1a1785c41afa58692948289f9 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 27 Jul 2026 22:41:21 +0200 Subject: [PATCH 184/189] AAAAAAAAAAAAAAA --- src/client/gui/screens/ConsoleScreen.cpp | 4 ++-- src/network/ClientSideNetworkHandler.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index ccb6039..9d3e874 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -65,7 +65,7 @@ void ConsoleScreen::execute() if (minecraft->netCallback && !minecraft->raknetInstance->isServer()) { MessagePacket packet(_input.c_str()); - minecraft->raknetInstance->send(&packet); + minecraft->raknetInstance->send(packet); } else if (_input[0] == '/') { _input = Util::stringTrim(_input.substr(1)); @@ -80,7 +80,7 @@ void ConsoleScreen::execute() else { if (minecraft->raknetInstance->isServer()) { MessagePacket packet(_input.c_str()); - minecraft->raknetInstance->send(&packet); + minecraft->raknetInstance->send(packet); } minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 022b35f..e2b8150 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -448,7 +448,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, TakeItem LOGI("TakeItemPacket\n"); - ItemInstance* item; + ItemInstance* item = new ItemInstance(); item->count = packet->count; item->id = packet->itemId; From 9987ab63b49d03020fe22b4ef56955078acdcf91 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Wed, 29 Jul 2026 20:24:11 +0300 Subject: [PATCH 185/189] FIX: door item spawn in creative mode --- src/world/level/tile/DoorTile.cpp | 11 ++++++----- src/world/level/tile/DoorTile.h | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/world/level/tile/DoorTile.cpp b/src/world/level/tile/DoorTile.cpp index 7aea82f..203e424 100755 --- a/src/world/level/tile/DoorTile.cpp +++ b/src/world/level/tile/DoorTile.cpp @@ -3,6 +3,7 @@ #include "../Level.h" #include "../../item/Item.h" #include "../../entity/player/Player.h" +#include "world/level/LevelSettings.h" DoorTile::DoorTile(int id, const Material* material) : super(id, material) @@ -150,7 +151,7 @@ void DoorTile::setOpen(Level* level, int x, int y, int z, bool shouldOpen) { void DoorTile::neighborChanged(Level* level, int x, int y, int z, int type) { int data = level->getData(x, y, z); - if ((data & UPPER_BIT) == 0) { + if ((data & C_IS_UPPER_MASK) == 0) { bool spawn = false; if (level->getTile(x, y + 1, z) != id) { level->setTile(x, y, z, 0); @@ -164,7 +165,7 @@ void DoorTile::neighborChanged(Level* level, int x, int y, int z, int type) { } } if (spawn) { - if (!level->isClientSide) { + if (!level->isClientSide && level->getLevelData()->getGameType() != GameType::Creative) { // use default chance (1.0) so the drop always occurs spawnResources(level, x, y, z, data); } @@ -193,7 +194,7 @@ int DoorTile::getResource(int data, Random* random) { // itself never drops anything and playerDestroy suppresses spawning // from the top. This prevents duplicate drops if the bottom half is // mined. - if ((data & UPPER_BIT) != 0) return 0; + if ((data & C_IS_UPPER_MASK) != 0) return 0; if (material == Material::metal) return Item::door_iron->id; return Item::door_wood->id; } @@ -205,7 +206,7 @@ HitResult DoorTile::clip(Level* level, int xt, int yt, int zt, const Vec3& a, co // override to prevent double-dropping when top half is directly mined void DoorTile::playerDestroy(Level* level, Player* player, int x, int y, int z, int data) { - if ((data & UPPER_BIT) == 0) { + if ((data & C_IS_UPPER_MASK) == 0) { // only let the lower half handle the actual spawning super::playerDestroy(level, player, x, y, z, data); } @@ -225,7 +226,7 @@ bool DoorTile::mayPlace(Level* level, int x, int y, int z, unsigned char face) { int DoorTile::getCompositeData( LevelSource* level, int x, int y, int z ) { int data = level->getData(x, y, z); - bool isUpper = (data & UPPER_BIT) != 0; + bool isUpper = (data & C_IS_UPPER_MASK) != 0; int lowerData; int upperData; if (isUpper) { diff --git a/src/world/level/tile/DoorTile.h b/src/world/level/tile/DoorTile.h index 250d274..bd585e5 100755 --- a/src/world/level/tile/DoorTile.h +++ b/src/world/level/tile/DoorTile.h @@ -17,7 +17,6 @@ class DoorTile: public Tile { typedef Tile super; public: - static const int UPPER_BIT = 8; static const int C_DIR_MASK = 3; static const int C_OPEN_MASK = 4; static const int C_LOWER_DATA_MASK = 7; From b032a8df7ce93678dadad483aa3e46ee6dfc579c Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Wed, 29 Jul 2026 22:22:35 +0300 Subject: [PATCH 186/189] FIX: char '1' work like backspace on android --- src/client/gui/Screen.cpp | 8 ++++++++ src/client/gui/Screen.h | 2 +- src/main_android_java.cpp | 15 +++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/client/gui/Screen.cpp b/src/client/gui/Screen.cpp index a6bcc6f..1a19efb 100755 --- a/src/client/gui/Screen.cpp +++ b/src/client/gui/Screen.cpp @@ -61,6 +61,12 @@ bool Screen::handleBackEvent( bool isDown ) return false; } +void Screen::tick() { + for (auto& textbox : textBoxes) { + textbox->tick(minecraft); + } +} + void Screen::updateEvents() { if (passEvents) @@ -110,10 +116,12 @@ void Screen::keyboardEvent() keyPressed(Keyboard::getEventKey()); } } + void Screen::keyboardTextEvent() { charPressed(Keyboard::getChar()); } + void Screen::renderBackground() { renderBackground(0); diff --git a/src/client/gui/Screen.h b/src/client/gui/Screen.h index be44d5c..16b551a 100755 --- a/src/client/gui/Screen.h +++ b/src/client/gui/Screen.h @@ -31,7 +31,7 @@ public: virtual void keyboardTextEvent(); virtual bool handleBackEvent(bool isDown); - virtual void tick() {} + virtual void tick(); virtual void removed() {} diff --git a/src/main_android_java.cpp b/src/main_android_java.cpp index c89ae03..d407ba7 100755 --- a/src/main_android_java.cpp +++ b/src/main_android_java.cpp @@ -220,16 +220,23 @@ static int androidKeyToInternal(int androidKey) { JNIEXPORT void JNICALL Java_com_mojang_minecraftpe_MainActivity_nativeOnKeyDown(JNIEnv* env, jclass cls, jint keyCode) { LOGI("@nativeOnKeyDown: %d\n", keyCode); - int mapped = androidKeyToInternal(keyCode); - Keyboard::feed(mapped, true); + + // @rewrite + + if (keyCode != AKEYCODE_1) { + int mapped = androidKeyToInternal(keyCode); + Keyboard::feed(mapped, true); + } } JNIEXPORT void JNICALL Java_com_mojang_minecraftpe_MainActivity_nativeTextChar(JNIEnv* env, jclass cls, jint unicodeChar) { + LOGI("@nativeTextChar: %d '%c'", unicodeChar, (char)unicodeChar); // soft-keyboards may send a backspace as a character code - if (unicodeChar == 8) { + // Kolyah35: i dont believe :v + /*if (unicodeChar == 8) { Keyboard::feed(Keyboard::KEY_BACKSPACE, true); Keyboard::feed(Keyboard::KEY_BACKSPACE, false); - } else if (unicodeChar > 0 && unicodeChar < 128) { + } else*/ if (unicodeChar > 0 && unicodeChar < 128) { Keyboard::feedText((char)unicodeChar); } } From a16863041c992e1cfae0ad95c7bdef47865cde6e Mon Sep 17 00:00:00 2001 From: Nikolai Nevzorov Date: Wed, 26 Aug 2026 13:12:32 +0200 Subject: [PATCH 187/189] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1d4caa8..ae6897e 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ > [!Warning] > [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1). -> [!Important] -> We have a discord server, where you can report bugs or send feedback https://discord.gg/c58YesBxve +> [!Note] +> There is unofficial (not related to Kolyah35 and InviseDivine) discord server, where you can report bugs or send feedback https://discord.gg/udYrbNDfDH Source code for **Minecraft Pocket Edition 0.6.1 alpha** with various fixes and improvements. @@ -17,10 +17,10 @@ This project aims to preserve and improve this early version of Minecraft PE. # Screenshots

-menu -settings -worlds -gameplay +menu +settings +worlds +gameplay

From 567769a74f7f487cfd9d4ee32422962757054b4d Mon Sep 17 00:00:00 2001 From: Nikolai Nevzorov Date: Tue, 22 Sep 2026 20:52:17 +0200 Subject: [PATCH 188/189] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae6897e..c7db0f7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MinecraftPE > [!Warning] -> [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1). +> [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffetwork.ru/Kolyah35/minecraft-pe-0.6.1). > [!Note] > There is unofficial (not related to Kolyah35 and InviseDivine) discord server, where you can report bugs or send feedback https://discord.gg/udYrbNDfDH From db9f6c9f3236557af7e14cb81f8772d713fb9bdf Mon Sep 17 00:00:00 2001 From: Nikolai Nevzorov Date: Tue, 22 Sep 2026 20:52:44 +0200 Subject: [PATCH 189/189] :facepalm: --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7db0f7..094ec25 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MinecraftPE > [!Warning] -> [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffetwork.ru/Kolyah35/minecraft-pe-0.6.1). +> [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1). > [!Note] > There is unofficial (not related to Kolyah35 and InviseDivine) discord server, where you can report bugs or send feedback https://discord.gg/udYrbNDfDH