Skip to content

Integrate MCPE 1.0 features into MC 0.6.2 engine + Linux build support - #1

Draft
sriail with Copilot wants to merge 5 commits into
mainfrom
copilot/copy-mcpe-assets-to-web-build
Draft

Integrate MCPE 1.0 features into MC 0.6.2 engine + Linux build support#1
sriail with Copilot wants to merge 5 commits into
mainfrom
copilot/copy-mcpe-assets-to-web-build

Conversation

Copilot AI commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

Modernizes the Minecraft Pocket Edition WASM project by integrating MCPE 1.0 features into the MC 0.6.2 engine and adding cross-platform build support.

Task 1: Copy MCPE 1.0 Assets

  • Copied textures, sounds, and lang files from resources/assets/resource_packs/vanilla/ and resources/assets/sounds/ into web-build/data/textures/, web-build/data/sounds/, and web-build/data/lang/

Task 2: UI Modernization

  • StartMenuScreen: version text changed to "MCPE-WASM v1.0", buttons resized to 200×20px with 24px spacing
  • PauseScreen: button labels updated to "Resume" / "Save and Quit", title changed to "Game Menu"
  • Gui: added renderHungerBar() — renders 10 drumstick icons on the right side of the HUD using gui/icons.png texture coordinates
  • Button: updated texture path to textures/gui/gui.png (MCPE 1.0 asset location)

Task 3: Hunger System

  • SimpleFoodData: full MCPE 1.0 hunger mechanics — saturation (starts at 5.0), exhaustion (drains saturation/food every 4 points), natural healing at food ≥ 18 HP every 4 seconds, starvation damage at food ≤ 0
  • Player: exhaustion added on walking (0.01/block), sprinting (0.1/block), jumping (0.2/jump), attacking (0.3), and taking damage (0.3)
  • FoodItem / Item: MCPE 1.0 saturation modifiers applied (apple 1.2, bread 1.2, raw pork 0.3, cooked pork 0.8, raw/cooked beef/chicken); eating now allowed whenever food bar is not full
  • Gui: renderHungerBar() wired into Gui::render() alongside hearts and bubbles

Task 4: Infinite World Generation

  • ChunkCache: replaced fixed LevelChunk*[CHUNK_CACHE_WIDTH²] array with std::unordered_map<long long, LevelChunk*> keyed by packed (x,z) coordinates, removing the 16×16 chunk hard limit
  • Level: removed fixed-world coordinate bounds checks from chunk polling, ray-casting, and inRange(); initial spawn now starts at (0,0) instead of the old fixed-grid center
  • ExternalFileLevelStorage: updated tick() to iterate the ChunkCache map directly; changed pos key type to long long to match the new map key

Build System

  • Added Linux/macOS build scripts: build.sh, install_deps.sh, and project/emscripten/build_web.sh
    • Uses source emsdk_env.sh, find-based source discovery with case filtering, and direct emcc invocations — no cmd.exe or PowerShell required
    • Supports incremental compilation (skips objects newer than source)
  • Fixed build_web.ps1: removed cmd /c wrappers; now calls emcc directly via PowerShell's & operator with array splatting (works on PowerShell 7+ / cross-platform pwsh)
  • README.md: updated with separate Linux/macOS and Windows setup and build instructions

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 8, 2026 22:59
Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
…ect damage

Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
@sriail

sriail commented Mar 9, 2026

Copy link
Copy Markdown
Owner

@copilot fix the build system so it can be built on linux without cmd dependency and other build factors

…build

Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>

Copilot AI commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the build system so it can be built on linux without cmd dependency and other build factors

Done in commit 10524d7. Three new scripts were added and the PowerShell script was fixed:

New Linux/macOS scripts:

  • web-build/install_deps.sh — clones emsdk and runs ./emsdk install latest && ./emsdk activate latest
  • web-build/build.sh — top-level entry point (mirrors build.ps1)
  • web-build/project/emscripten/build_web.sh — full build script using bash/find/emcc directly, no cmd or PowerShell required

Fixed PowerShell script (build_web.ps1):

  • Removed both cmd /c calls (one wrapping the per-file compiler invocation, one wrapping the linker)
  • Now calls emcc directly via PowerShell's & operator — works on PowerShell 7+ / cross-platform pwsh
  • Removed the intermediate .rsp file per source; uses @allLinkArgs array splatting for the link step

README.md updated with separate Linux and Windows instructions.

Copilot AI changed the title [WIP] Copy MCPE 1.0 assets to 0.6.2 source Integrate MCPE 1.0 features into MC 0.6.2 engine + Linux build support Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants