diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5e081e..da5b4c2 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: @@ -60,21 +60,47 @@ jobs: - name: Build working-directory: ${{github.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target MinecraftPE --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 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/z.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: Linux Build + name: Build Linux runs-on: ubuntu-latest steps: @@ -120,7 +146,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: @@ -193,16 +219,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 @@ -215,11 +231,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 ] - if: github.ref == 'refs/heads/main' + needs: [ build-windows, build-ios, build-linux, build-android, build-web ] steps: - name: Checkout uses: actions/checkout@v4 @@ -236,32 +300,44 @@ 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: 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 with: - files: data mcpe-linux/MinecraftPE + files: 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 }}.zip + dest: minecraftpe-server-${{ steps.ref.outputs.hash }}-linux.zip - - name: Zip Android arm64-v8a Artifact + - 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 with: - files: minecraftpe-apk-arm64-v8a/minecraftpe-v8a-debug.apk - dest: minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip + 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 Android armeabi-v7a Artifact + - name: Zip Data 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 + files: data + recursive: false + dest: data.zip - name: Update Development Release uses: andelf/nightly-release@main @@ -273,8 +349,14 @@ jobs: body: | MinecraftPE development release for commit ${{ github.sha }}. files: | - ./minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip - ./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip + ./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-${{ 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 diff --git a/CMakeLists.txt b/CMakeLists.txt index cdf558a..b978db0 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) @@ -20,12 +16,22 @@ 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") 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) @@ -52,6 +58,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" ) @@ -102,9 +109,10 @@ 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" @@ -143,7 +151,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" @@ -159,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" @@ -192,6 +200,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" @@ -205,6 +216,7 @@ file(GLOB SERVER_SOURCES "src/world/level/tile/entity/*.cpp" "src/world/phys/HitResult.cpp" + "src/commands/*.cpp" ) file(GLOB CLIENT_SOURCES @@ -251,6 +263,8 @@ file(GLOB CLIENT_SOURCES "src/util/**.cpp" + "src/util/Color.cpp" + "src/world/*.cpp" "src/world/phys/*.cpp" "src/world/entity/*.cpp" @@ -286,6 +300,8 @@ file(GLOB CLIENT_SOURCES "src/AppPlatform_glfw.cpp" "src/main.cpp" + + "src/commands/*.cpp" ) if (${PLATFORM} STREQUAL "Desktop") @@ -293,21 +309,23 @@ 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} ${EXTRA_LIBS}) 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 @@ -321,11 +339,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 -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}") - 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/README.md b/README.md index ec0b870..094ec25 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,28 @@ # 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.sffnetwork.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. 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 +
+
+
+
+
+
+
+