diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da5b4c2..c5e081e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ permissions: jobs: build-windows: - name: Build Windows + name: Windows Build runs-on: ubuntu-22.04 steps: @@ -60,47 +60,21 @@ jobs: - name: Build working-directory: ${{github.workspace}}/build - run: | - cmake --build . --config $BUILD_TYPE --target MinecraftPE --parallel - cmake --build . --config $BUILD_TYPE --target MinecraftPE-server --parallel + run: cmake --build . --config $BUILD_TYPE --target MinecraftPE --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/glfw3.dll ${{github.workspace}}/build/libpng16.dll ${{github.workspace}}/build/OpenAL32.dll - ${{github.workspace}}/build/libz.dll + ${{github.workspace}}/build/z.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 + name: Linux Build runs-on: ubuntu-latest steps: @@ -146,7 +120,7 @@ jobs: ${{github.workspace}}/build/MinecraftPE-server build-android: # pray to god - name: Build Android (${{ matrix.abi }}) + name: Build Android APK (${{ matrix.abi }}) runs-on: ubuntu-latest strategy: @@ -219,6 +193,16 @@ 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 @@ -231,59 +215,11 @@ 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-ios, build-linux, build-android, build-web ] + needs: [ build-windows, build-linux, build-android ] + if: github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4 @@ -300,44 +236,32 @@ jobs: - name: Zip Windows Artifacts uses: vimtor/action-zip@v1.2 with: - files: mcpe-windows/MinecraftPE.exe mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/libz.dll + files: data mcpe-windows/MinecraftPE.exe mcpe-windows/glfw3.dll mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/z.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 with: - files: mcpe-linux/MinecraftPE + files: data mcpe-linux/MinecraftPE dest: minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip - name: Zip Linux Server Artifacts uses: vimtor/action-zip@v1.2 with: files: mcpe-linux/MinecraftPE-server - dest: minecraftpe-server-${{ steps.ref.outputs.hash }}-linux.zip + dest: minecraftpe-server-${{ steps.ref.outputs.hash }}.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 + - name: Zip Android arm64-v8a 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 + files: minecraftpe-apk-arm64-v8a/minecraftpe-v8a-debug.apk + dest: minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip - - name: Zip Data + - name: Zip Android armeabi-v7a Artifact uses: vimtor/action-zip@v1.2 with: - files: data - recursive: false - dest: data.zip + files: minecraftpe-apk-armeabi-v7a/minecraftpe-v7a-debug.apk + dest: minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip - name: Update Development Release uses: andelf/nightly-release@main @@ -349,14 +273,8 @@ jobs: body: | 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-server-${{ steps.ref.outputs.hash }}-windows.zip ./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip - ./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.apk - ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.apk - ./minecraftpe-server-${{ 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 }}-web.zip + ./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index b978db0..cdf558a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,10 @@ 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) @@ -16,22 +20,12 @@ endif() enum_option(PLATFORM "Desktop;Web" "Platform to build for.") -if(NOT EMSCRIPTEN) - find_package(Threads REQUIRED) -endif() +find_package(Threads REQUIRED) 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) @@ -58,7 +52,6 @@ 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" ) @@ -109,10 +102,9 @@ CPMAddPackage( "ALSOFT_UTILS OFF" "LIBTYPE ${AL_LIBTYPE}" "ALSOFT_ENABLE_MODULES OFF" - "ALSOFT_STATIC_STDCXX ON" - "ALSOFT_STATIC_LIBGCC ON" ) +# TODO: Clear this paths with * file(GLOB SERVER_SOURCES "project/lib_projects/raknet/jni/RaknetSources/*.cpp" "src/NinecraftApp.cpp" @@ -151,6 +143,7 @@ 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" @@ -166,7 +159,6 @@ file(GLOB SERVER_SOURCES "src/util/Mth.cpp" "src/util/PerfTimer.cpp" "src/util/StringUtils.cpp" - "src/util/Color.cpp" "src/world/Direction.cpp" @@ -200,9 +192,6 @@ 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" @@ -216,7 +205,6 @@ file(GLOB SERVER_SOURCES "src/world/level/tile/entity/*.cpp" "src/world/phys/HitResult.cpp" - "src/commands/*.cpp" ) file(GLOB CLIENT_SOURCES @@ -263,8 +251,6 @@ file(GLOB CLIENT_SOURCES "src/util/**.cpp" - "src/util/Color.cpp" - "src/world/*.cpp" "src/world/phys/*.cpp" "src/world/entity/*.cpp" @@ -300,8 +286,6 @@ file(GLOB CLIENT_SOURCES "src/AppPlatform_glfw.cpp" "src/main.cpp" - - "src/commands/*.cpp" ) if (${PLATFORM} STREQUAL "Desktop") @@ -309,23 +293,21 @@ if (${PLATFORM} STREQUAL "Desktop") endif() # Server -add_executable("${PROJECT_NAME}-server" ${SERVER_SOURCES}) +if(UNIX) + 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} ${EXTRA_LIBS}) + target_link_libraries("${PROJECT_NAME}-server" ${CMAKE_THREAD_LIBS_INIT}) +endif() 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 @@ -339,11 +321,11 @@ 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 -sUSE_LIBPNG=1 -sSHARED_MEMORY=1") + set(EM_FLAGS "-pthread -sUSE_PTHREADS=1 -sSHARED_MEMORY=1") 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") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EM_FLAGS} --preload-file ${CMAKE_SOURCE_DIR}/data@/data -sPROXY_TO_PTHREAD") target_compile_options(${PROJECT_NAME} PUBLIC "-Os" diff --git a/README.md b/README.md index 094ec25..ec0b870 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,31 @@ # 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.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1). +> 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). -> [!Note] -> There is unofficial (not related to Kolyah35 and InviseDivine) discord server, where you can report bugs or send feedback https://discord.gg/udYrbNDfDH +> [!Important] +> We have a discord server, where you can report bugs or send feedback https://discord.gg/c58YesBxve Source code for **Minecraft Pocket Edition 0.6.1 alpha** with various fixes and improvements. This project aims to preserve and improve this early version of Minecraft PE. -# 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 -
-
-
-
-
-
-
-