43 Commits

Author SHA1 Message Date
Revela e773e64840 Restore Visual Studio project files and build scripts
Preserve vcxproj, sln, and PowerShell build scripts that were
removed during the upstream CMake migration merge, so this branch
retains a working Visual Studio build configuration.
2026-03-17 17:52:56 -05:00
Revela bf2b488f2d Add x64_* build output directories to .gitignore 2026-03-17 17:29:02 -05:00
Revela 7c88569e8b Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp
#	Minecraft.Client/Minecraft.Client.vcxproj
#	Minecraft.Client/Minecraft.Client.vcxproj.filters
#	Minecraft.Server/Minecraft.Server.vcxproj
#	Minecraft.World/Minecraft.World.vcxproj
#	Minecraft.World/Minecraft.World.vcxproj.filters
#	README.md
2026-03-17 17:26:40 -05:00
Revela a02538daa0 Add Arabic text shaping support for chat functionality
This commit introduces Arabic text shaping in the chat application by adding `ArabicShaping.cpp` and `ArabicShaping.h` for handling contextual forms and visual reordering.

The rendering logic in `ChatScreen.cpp` is updated to utilize this new functionality, adjusting cursor positions accordingly. Other UI components, including `UIControl_Base.cpp`, `UIControl_Label.cpp`, and `UIControl_SaveList.cpp`, are modified to ensure proper display of Arabic text.

Additionally, `Font.cpp` is enhanced with methods for efficient rendering of pre-shaped text.
2026-03-17 17:08:58 -05:00
Revela e4335cfc09 Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-17 00:32:54 -05:00
Revela 863998e19a Improve Nightly release management process
Enhanced the script to delete and recreate the Nightly-Dedicated-Server release, ensuring the client is always up-to-date. The process now fetches release information, deletes the old release, updates the tag to the latest commit, and creates a new release with an updated title and body. Streamlined asset uploads and clarified title update logic for better reliability and clarity.
2026-03-17 00:32:25 -05:00
Revela 9c6186f06e Added to README with multi-language support details
Added support for multi-language font rendering and Unicode text input, along with copy-paste functionality for various fields. Also included security enhancements and fixed a memory leak.
2026-03-16 23:16:46 -05:00
Revela d56a4bbe2a Merge branch 'smartcmd:main' into main 2026-03-16 23:12:41 -05:00
Revela 24f27462a6 Enable multi-language font rendering and Unicode text input
Goal:
Allow players to type and display text in any language supported by
Unicode, including Chinese, Japanese, Korean, Thai, Arabic, Korean, Hindi, and more. This
covers all text surfaces: chat editor, chat messages, signs (in-world
and editor), world name/seed, server address/port fields, and all
Iggy Flash UI text fields.

Multi-language support:
Two complementary rendering systems were added to handle Unicode text
across the entire client:

1. Iggy UI (Flash-based text fields): A new UIUnicodeBitmapFont class
   serves Java Minecraft's glyph page PNGs (glyph_00.png-glyph_FF.png)
   through Iggy's bitmap font provider API. Registered as the global
   fallback font with metrics matching the Mojangles bitmap font for
   correct baseline alignment. When the primary bitmap font lacks a
   glyph, it returns IGGY_GLYPH_INVALID and Iggy seamlessly falls back
   to the unicode bitmap font.

2. Legacy C++ Font renderer (chat editor, in-world signs): Revived the
   commented-out unicode glyph page system in Font.cpp. Characters not
   in the bitmap font texture are rendered from glyph page PNGs loaded
   on demand, with proper texture switching mid-string.

3. ChatScreen input: Removed the restrictive acceptableLetters filter
   so all printable Unicode characters are accepted in chat.

Languages now supported for text input and rendering:
- Japanese (Hiragana, Katakana, Kanji)
- Chinese (Simplified and Traditional)
- Korean (Hangul)
- Thai
- Arabic
- Hindi (Devanagari)
- Russian (Cyrillic) - already worked via bitmap font
- Greek - already worked via bitmap font
- Polish, Czech, Turkish (Extended Latin) - already worked via bitmap font
- Armenian, Georgian, and other scripts covered by glyph pages

Security fixes:
- Fixed memset under-initialization of Font::charWidths (zeroed 460
  bytes instead of 460*sizeof(int)=1840 bytes, leaving entries 115+
  uninitialized) - pre-existing bug
- Added bounds checks to all UIUnicodeBitmapFont callbacks to reject
  glyph IDs outside [0, 65535], preventing OOB array access
- Added bounds check in Font::width() section-sign fallback path to
  prevent OOB read on charWidths[] with high codepoints
- Blocked Unicode bidirectional override characters (U+202A-202E,
  U+2066-2069) in chat input to prevent message spoofing

Memory leak fix:
- Fixed SignTileEntity::load allocating wchar_t[256] with new[] on
  every sign load without freeing. Replaced with stack allocation.

Debug logging:
- Added [SIGN] prefixed logging for sign save/update operations
- Added [CHAT] prefixed logging for chat send/receive operations

Files changed:
- UIUnicodeBitmapFont.h/.cpp (new) - Iggy bitmap font for glyph pages
- UIBitmapFont.cpp - Return IGGY_GLYPH_INVALID for unknown chars
- UIFontData.h/.cpp - Added hasGlyph() method
- UIController.h/.cpp - Load and register unicode bitmap fallback font
- UITTFFont.h/.cpp - Added registerAsDefaultFonts parameter
- Font.h/.cpp - Revived unicode glyph page rendering system
- ChatScreen.cpp - Accept all Unicode input, block bidi overrides
- Gui.cpp - Chat display debug logging
- ClientConnection.cpp - Sign update debug logging
- SignTileEntity.cpp - Sign save logging, memory leak fix
2026-03-16 23:08:05 -05:00
Revela 68537572e5 Update README with copy-paste support details
Added copy-paste support for various elements including IP/Port and world names.
2026-03-16 11:05:42 -05:00
Revela 43145a9366 Add Ctrl+V clipboard paste to UIControl_TextInput and UIScene_Keyboard
Previously paste only worked in the chat screen. Wire Screen::getClipboard() into the two remaining text input paths so Ctrl+V works for sign editing, seed entry, server IP/port, and world name fields.
2026-03-16 10:36:46 -05:00
Revela 72012da42f Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-16 08:10:47 -05:00
Revela e5a035795b Change default for hardcore-ban-ip to false
Updated the default value of the "hardcore-ban-ip" server property from "true" to "false" in the `kServerPropertyDefaults` array. Adjusted the `LoadServerPropertiesConfig` function to read the "hardcore-ban-ip" property as "false" to ensure consistency with the new default.
2026-03-16 08:10:40 -05:00
Revela 1a95b757ea Add hardcore-ban-ip property for IP banning on hardcore death
This commit introduces a new server property `hardcore-ban-ip` that controls whether players who die in hardcore mode are banned by their IP address. This setting should be set to `false` for playit.gg users!

Key changes include:
- Updated `banPlayerForHardcoreDeath` in `PlayerList.cpp` to check the `hardcoreBanIp` setting and handle IP bans accordingly.
- Added `hardcore-ban-ip` to the default server properties in `ServerProperties.cpp`.
- Declared the `hardcoreBanIp` boolean variable in `ServerProperties.h` to store the property value.

These changes enhance the server's ability to enforce IP bans based on configuration settings.
2026-03-16 08:00:48 -05:00
Revela faf32515f5 Update README with Hardcore Mode and server info
Added details about Hardcore Mode support and server downloads.
2026-03-16 04:11:04 -05:00
Revela 97bb759ecc Update workflows and Docker image references
- Modify `.gitattributes` to use "ours" merge strategy for specific workflow and Docker Compose files.
- Update `nightly.yml` to allow manual triggering and set permissions for content writing.
- Change Docker image reference for `minecraft-lce-dedicated-server` service to a new source.
2026-03-16 03:52:25 -05:00
Revela 1c4e5d5f95 Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-16 03:25:10 -05:00
Revela 635ffc6c54 Enhance nightly release script for client and server
Updated the script to build zips for both client and server, including new variables for server release management. Added functionality to create a server zip, fetch server release info, delete old assets, and upload the new server zip to GitHub. The script now updates the server release title with the latest commit hash and provides clearer output messages for both client and server releases.
2026-03-16 03:25:00 -05:00
Revela ba6a6393e8 Update Dedicated Server download link in README
Updated the link for Dedicated Server software to fork's build
2026-03-16 03:12:44 -05:00
Revela d2e9808a26 Implement persistent hardcore death bans (XUID + IP) for dedicated server
On the dedicated server, hardcore death now persists XUID and IP bans to
banned-players.json and banned-ips.json via the Access system, and
disconnects the player. Bans survive server restarts. Client-hosted games
retain the existing in-memory XUID ban with force-save behavior.

- Add hardcore property to server.properties (forces Hard difficulty)
- Add LevelData::setHardcore() so loaded worlds respect the server config
- Add PlayerList::banPlayerForHardcoreDeath() with persistent XUID + IP bans
- Reject respawn requests server-side in hardcore mode
- Ensure server-side player ticks run without move packets (fixes
  environmental damage not applying for some clients)
- Restore 0x8 hardcore bit on LoginPacket/RespawnPacket wire format so
  the client-side death screen detects hardcore mode correctly
2026-03-16 02:52:16 -05:00
Revela 110cec3dab Merge upstream/main into main 2026-03-15 23:38:41 -05:00
Revela 700fdf0c41 Add support for empty directory entries in ZIP archive
This commit introduces a new block in the `Update-NightlyRelease.ps1` script that creates empty directory entries in the ZIP archive. A `try` block is added to manage the `ZipArchive` object, and a loop iterates through all directories in the specified `$ReleaseDir`, ensuring that empty directories are included in the final archive.
2026-03-15 10:25:53 -05:00
Revela d7efcad139 Remove NDEBUG from preprocessor definitions
Incorrectly assumed that this was causing crashing on Steam deck. Reverting with this commit
2026-03-15 10:07:18 -05:00
Revela c60eabe32d Refactor ZIP creation using System.IO.Compression
Updated the ZIP file creation process to utilize the .NET `System.IO.Compression` library. This change eliminates the need for a temporary ZIP file and directly excludes `.pch` and `.zip` files from the archive. A top-level folder named "LCEWindows64" has been added to the ZIP structure, and resource management has been improved with proper disposal of file streams and ZIP archives.
2026-03-15 10:05:37 -05:00
Revela 7cb91529fb Include base directory in release script
Modified the CreateFromDirectory method to include the base directory in the zip file by changing the parameter from `$false` to `$true`.
2026-03-15 09:03:54 -05:00
Revela a4b0572362 Refactor zip creation using .NET Compression library
Updated the zipping process to utilize .NET's `System.IO.Compression` library for improved cross-platform compatibility. The new implementation creates a temporary zip file, removes unwanted entries (e.g., `.pch` and `.zip` files), and then finalizes the zip file, ensuring it only contains the desired files.
2026-03-15 08:50:39 -05:00
Revela c59010cb81 Prepare project for release build
Updated `<PreprocessorDefinitions>` to include `NDEBUG`,
indicating that debugging code will be excluded from the
build. This change is part of the preparation for a
release version of the project.
2026-03-15 07:37:07 -05:00
Revela a41c82539a Add F2 screenshot functionality and image writing support
- Updated `EControllerActions` to include `MINECRAFT_ACTION_SCREENSHOT`.
- Added conditional compilation for `stb_image_write.h` in `Minecraft.cpp`.
- Modified `run_middle()` to handle screenshot key press.
- Updated `tick()` to capture and save screenshots as PNG files.
- Introduced `KEY_SCREENSHOT` in `KeyboardMouseInput.h` mapped to F2.
- Added `stb_image_write.h` for image writing capabilities.
2026-03-15 07:36:49 -05:00
Revela 1e8c7a08b6 Update README with new features and functionality
Added details about in-game screenshot functionality
2026-03-15 05:46:51 -05:00
Revela f0c554a893 Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-15 04:00:31 -05:00
Revela e10ddcacd0 Merge upstream/main into main
Brings in dedicated server software, README updates, and .vscode cleanup
while preserving hardcore mode, screenshot, and watermark toggle features.
2026-03-15 03:54:37 -05:00
Revela 8a20e34b31 Add F2 screenshot functionality and image writing support
- Updated `EControllerActions` to include `MINECRAFT_ACTION_SCREENSHOT`.
- Added conditional compilation for `stb_image_write.h` in `Minecraft.cpp`.
- Modified `run_middle()` to handle screenshot key press.
- Updated `tick()` to capture and save screenshots as PNG files.
- Introduced `KEY_SCREENSHOT` in `KeyboardMouseInput.h` mapped to F2.
- Added `stb_image_write.h` for image writing capabilities.
2026-03-15 03:47:31 -05:00
Revela eaffb40316 Readme: Fix multiplayer exit loophole for non-host players
Added multiplayer fix to prevent host exit loophole.
2026-03-15 01:07:54 -05:00
Revela 50c4c42660 Prevent exit-without-saving loophole for hardcore players
Switch player to Adventure mode on death in hardcore mode, ban their XUID, and trigger a save action to prevent quitting without saving.
2026-03-15 00:37:14 -05:00
Revela 31a6facf02 Powershell script that updates Nightly release & archives previous versions 2026-03-13 22:46:05 -05:00
Revela 022427cb93 Merge branch 'smartcmd:main' into main 2026-03-13 21:48:39 -05:00
Revela 8bd66905aa Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-13 11:11:43 -05:00
Revela 9397d404a6 Fix Gui.cpp merge and enhance hardcore mode visuals
This commit adds new `NamedFrame` entries and `KeyFrame` animations in `skin_Minecraft.xui` for various hardcore game modes, improving the UI representation (likely will get rid of this since it's dead code). A new `isHardcore` variable in `XUI_HUD.cpp` allows for conditional health icon animations based on the game mode. Additionally, commented-out code in `Gui.cpp` has been removed to streamline rendering logic. Several new PNG images for health states in hardcore mode have also been added to enhance the user experience.

TL;DR: This commit is basically just prep for adding hardcore heathbar hearts while also fixing some breaking that occurred in Gui.cpp after a merge.
2026-03-13 11:11:21 -05:00
Revela 54f70cd904 Update image in README for Hardcore Mode 2026-03-13 08:51:32 -05:00
Revela e2644b2c35 Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-13 08:50:14 -05:00
Revela 85c589f453 added hardcore preview image 2026-03-13 08:50:05 -05:00
Revela 4a284a289b Update README with Hardcore Mode features
Added details about the latest Hardcore Mode implementation including features for singleplayer and multiplayer.
2026-03-13 08:46:17 -05:00
Revela 18081f8fb9 Merge branch 'smartcmd:main' into main
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 07:17:11 -05:00
1316 changed files with 77744 additions and 45717 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ❗NEW❗ MinecraftConsoles Community Discord
url: https://discord.gg/dH8AZWGcau
- name: MinecraftConsoles Community Discord
url: https://discord.gg/jrum7HhegA
about: If you need help, please ask for it in our Discord! You will get assistance much faster there, including help getting the project to compile.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

+167
View File
@@ -0,0 +1,167 @@
name: Nightly Server Release
on:
workflow_dispatch:
push:
branches:
- 'main'
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/**'
- '!.github/workflows/nightly-server.yml'
permissions:
contents: write
packages: write
concurrency:
group: nightly-server
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
platform: [Windows64]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set platform lowercase
run: echo "MATRIX_PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Setup CMake
uses: lukka/get-cmake@latest
- name: Run CMake
uses: lukka/run-cmake@v10
env:
VCPKG_ROOT: "" # Disable vcpkg for CI builds
with:
configurePreset: ${{ env.MATRIX_PLATFORM }}
buildPreset: ${{ env.MATRIX_PLATFORM }}-release
buildPresetAdditionalArgs: "['--target', 'Minecraft.Server']"
- name: Zip Build
run: 7z a -r LCEServer${{ matrix.platform }}.zip ./build/${{ env.MATRIX_PLATFORM }}/Minecraft.Server/Release/* -x!*.ipdb -x!*.iobj
- name: Stage artifacts
run: |
New-Item -ItemType Directory -Force -Path staging
Copy-Item LCEServer${{ matrix.platform }}.zip staging/
- name: Stage exe and pdb
if: matrix.platform == 'Windows64'
run: |
Copy-Item ./build/${{ env.MATRIX_PLATFORM }}/Minecraft.Server/Release/Minecraft.Server.exe staging/
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: build-${{ matrix.platform }}
path: staging/*
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
merge-multiple: true
- name: Update release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly-dedicated-server
name: Nightly Dedicated Server Release
body: |
Dedicated Server runtime for Windows64.
Download `LCEServerWindows64.zip` and extract it to a folder where you'd like to keep the server runtime.
files: |
artifacts/*
docker-publish:
name: Build and Push Docker Image
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download dedicated server runtime from artifacts
uses: actions/download-artifact@v4
with:
name: build-Windows64
path: .artifacts/
- name: Prepare Docker runtime directory
shell: bash
run: |
set -euo pipefail
rm -rf runtime
mkdir -p runtime
unzip .artifacts/LCEServerWindows64.zip -d runtime
- name: Compute image name
id: image
shell: bash
run: |
owner="$(echo "${{ vars.CONTAINER_REGISTRY_OWNER || github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
image_tag="nightly"
# if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then
# image_tag="nightly-test"
# fi
echo "owner=$owner" >> "$GITHUB_OUTPUT"
echo "image=ghcr.io/$owner/minecraft-lce-dedicated-server" >> "$GITHUB_OUTPUT"
echo "image_tag=$image_tag" >> "$GITHUB_OUTPUT"
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.image.outputs.image }}
tags: |
type=raw,value=${{ steps.image.outputs.image_tag }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME || github.actor }}
password: ${{ secrets.GHCR_TOKEN || secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: docker/dedicated-server/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
MC_RUNTIME_DIR=runtime
cleanup:
needs: [build, release]
if: always()
runs-on: ubuntu-latest
steps:
- name: Cleanup artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: build-*
+38 -475
View File
@@ -1,498 +1,61 @@
name: Nightly Release
name: Nightly Releases
on:
workflow_dispatch:
permissions:
contents: write
id-token: write
attestations: write
packages: write
concurrency:
group: nightly
cancel-in-progress: true
jobs:
build-client:
name: Build Client
runs-on: [self-hosted, windows]
build:
name: Build Windows64
runs-on: windows-latest
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v6
with:
submodules: recursive
uses: actions/checkout@v6
- name: Setup MSVC
uses: https://github.com/ilammy/msvc-dev-cmd@v1
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Setup CMake
uses: https://github.com/lukka/get-cmake@latest
- name: Run CMake
uses: https://github.com/lukka/run-cmake@v10
env:
VCPKG_ROOT: ""
with:
configurePreset: windows64
buildPreset: windows64-release
buildPresetAdditionalArgs: "['--target', 'Minecraft.Client']"
- name: Build
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Release /p:Platform="Windows64"
- name: Zip Build
shell: pwsh
run: |
$source = "./build/windows64/Minecraft.Client/Release"
$zip = "LCE-Revelations-Client-Win64.zip"
$topLevel = "LCE-Revelations-Client-Win64"
run: 7z a -r LCEWindows64.zip ./x64/Release/*
# Collect files, excluding unwanted extensions
$files = Get-ChildItem -Path $source -Recurse -File |
Where-Object { $_.Extension -notin '.pch', '.pdb', '.zip', '.ipdb', '.iobj', '.exp', '.lib' }
- name: Zip Dedicated Server Build
run: 7z a -r LCEServerWindows64.zip ./x64/Minecraft.Server/Release/*
Add-Type -AssemblyName System.IO.Compression
Add-Type -AssemblyName System.IO.Compression.FileSystem
$basePath = (Resolve-Path $source).Path
$fs = [System.IO.File]::Open($zip, [System.IO.FileMode]::Create)
try {
$archive = New-Object System.IO.Compression.ZipArchive($fs, [System.IO.Compression.ZipArchiveMode]::Create)
try {
# Add directories
Get-ChildItem -Path $basePath -Recurse -Directory | ForEach-Object {
$rel = $_.FullName.Substring($basePath.Length).TrimStart('\', '/')
$archive.CreateEntry("$topLevel/$($rel -replace '\\','/')/") | Out-Null
}
# Add files
foreach ($file in $files) {
$rel = $file.FullName.Substring($basePath.Length).TrimStart('\', '/')
$entryName = "$topLevel/$($rel -replace '\\','/')"
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile(
$archive, $file.FullName, $entryName,
[System.IO.Compression.CompressionLevel]::Optimal
) | Out-Null
}
} finally { $archive.Dispose() }
} finally { $fs.Dispose() }
Write-Host "Created $zip"
- name: Stage artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path staging
Copy-Item LCE-Revelations-Client-Win64.zip staging/
Copy-Item ./build/windows64/Minecraft.Client/Release/Minecraft.Client.exe staging/
Copy-Item ./build/windows64/Minecraft.Client/Release/Minecraft.Client.pdb staging/
- name: Upload artifacts
uses: https://github.com/actions/upload-artifact@v3
with:
name: client-build
path: staging/*
build-server:
name: Build Server
runs-on: [self-hosted, windows]
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v6
with:
submodules: recursive
- name: Setup MSVC
uses: https://github.com/ilammy/msvc-dev-cmd@v1
- name: Setup CMake
uses: https://github.com/lukka/get-cmake@latest
- name: Setup .NET
uses: https://github.com/actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Run CMake
uses: https://github.com/lukka/run-cmake@v10
- name: Update Client release
uses: andelf/nightly-release@main
env:
VCPKG_ROOT: ""
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configurePreset: windows64
buildPreset: windows64-release
buildPresetAdditionalArgs: "['--target', 'Minecraft.Server', '--target', 'Minecraft.Server.FourKit']"
tag_name: nightly
name: Nightly Client Release
body: |
Requires at least Windows 7 and DirectX 11 compatible GPU to run. Compiled with MSVC v14.44.35207 in Release mode with Whole Program Optimization, as well as `/O2 /Ot /Oi /Ob3 /GF /fp:precise`.
# 🚨 First time here? 🚨
If you've never downloaded the game before, you need to download `LCEWindows64.zip` and extract it to the folder where you'd like to keep the game. The other files are included in this `.zip` file!
files: |
LCEWindows64.zip
./x64/Release/Minecraft.Client.exe
./x64/Release/Minecraft.Client.pdb
- name: Zip Build (vanilla)
shell: pwsh
run: |
$source = "./build/windows64/Minecraft.Server/Release"
$zip = "LCE-Revelations-Server-Win64.zip"
$topLevel = "LCE-Revelations-Server-Win64"
$files = Get-ChildItem -Path $source -Recurse -File |
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj', '.exp', '.lib' }
Add-Type -AssemblyName System.IO.Compression
Add-Type -AssemblyName System.IO.Compression.FileSystem
$basePath = (Resolve-Path $source).Path
$fs = [System.IO.File]::Open($zip, [System.IO.FileMode]::Create)
try {
$archive = New-Object System.IO.Compression.ZipArchive($fs, [System.IO.Compression.ZipArchiveMode]::Create)
try {
Get-ChildItem -Path $basePath -Recurse -Directory | ForEach-Object {
$rel = $_.FullName.Substring($basePath.Length).TrimStart('\', '/')
$archive.CreateEntry("$topLevel/$($rel -replace '\\','/')/") | Out-Null
}
foreach ($file in $files) {
$rel = $file.FullName.Substring($basePath.Length).TrimStart('\', '/')
$entryName = "$topLevel/$($rel -replace '\\','/')"
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile(
$archive, $file.FullName, $entryName,
[System.IO.Compression.CompressionLevel]::Optimal
) | Out-Null
}
} finally { $archive.Dispose() }
} finally { $fs.Dispose() }
Write-Host "Created $zip"
- name: Zip Build (FourKit)
shell: pwsh
run: |
$source = "./build/windows64/Minecraft.Server.FourKit/Release"
$zip = "LCE-Revelations-Server-Win64-FourKit.zip"
$topLevel = "LCE-Revelations-Server-Win64-FourKit"
$files = Get-ChildItem -Path $source -Recurse -File |
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj', '.exp', '.lib' }
Add-Type -AssemblyName System.IO.Compression
Add-Type -AssemblyName System.IO.Compression.FileSystem
$basePath = (Resolve-Path $source).Path
$fs = [System.IO.File]::Open($zip, [System.IO.FileMode]::Create)
try {
$archive = New-Object System.IO.Compression.ZipArchive($fs, [System.IO.Compression.ZipArchiveMode]::Create)
try {
Get-ChildItem -Path $basePath -Recurse -Directory | ForEach-Object {
$rel = $_.FullName.Substring($basePath.Length).TrimStart('\', '/')
$archive.CreateEntry("$topLevel/$($rel -replace '\\','/')/") | Out-Null
}
foreach ($file in $files) {
$rel = $file.FullName.Substring($basePath.Length).TrimStart('\', '/')
$entryName = "$topLevel/$($rel -replace '\\','/')"
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile(
$archive, $file.FullName, $entryName,
[System.IO.Compression.CompressionLevel]::Optimal
) | Out-Null
}
} finally { $archive.Dispose() }
} finally { $fs.Dispose() }
Write-Host "Created $zip"
- name: Stage artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path staging
Copy-Item LCE-Revelations-Server-Win64.zip staging/
Copy-Item LCE-Revelations-Server-Win64-FourKit.zip staging/
- name: Upload artifacts
uses: https://github.com/actions/upload-artifact@v3
with:
name: server-build
path: staging/*
docker:
name: Build Docker (${{ matrix.variant }})
needs: build-server
runs-on: [self-hosted, linux]
strategy:
fail-fast: false
matrix:
include:
- variant: vanilla
zip: LCE-Revelations-Server-Win64.zip
subdir: LCE-Revelations-Server-Win64
image: lce-revelations-dedicated-server
- variant: fourkit
zip: LCE-Revelations-Server-Win64-FourKit.zip
subdir: LCE-Revelations-Server-Win64-FourKit
image: lce-revelations-dedicated-server-fourkit
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v6
- name: Download server artifacts
uses: https://github.com/actions/download-artifact@v3
with:
name: server-build
path: .artifacts/
- name: Prepare runtime directory
shell: bash
run: |
set -euo pipefail
rm -rf runtime .extracted
unzip -q ".artifacts/${{ matrix.zip }}" -d .extracted
mv ".extracted/${{ matrix.subdir }}" runtime
# Strip debug symbols to keep image small (zip includes .pdb).
find runtime -name '*.pdb' -delete
- name: Compute image name
id: image
shell: bash
run: |
owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
echo "image=git.revela.dev/$owner/${{ matrix.image }}" >> "$GITHUB_OUTPUT"
- name: Extract Docker metadata
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: ${{ steps.image.outputs.image }}
tags: |
type=raw,value=nightly
- name: Login to Forgejo registry
uses: https://github.com/docker/login-action@v3
with:
registry: git.revela.dev
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push image
uses: https://github.com/docker/build-push-action@v6
with:
context: .
file: docker/dedicated-server/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
MC_RUNTIME_DIR=runtime
release-server:
name: Release Server
needs: build-server
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v6
- name: Download server artifacts
uses: https://github.com/actions/download-artifact@v3
with:
name: server-build
path: artifacts
- name: Install jq
run: apt-get update && apt-get install -y --no-install-recommends jq
- name: Get short SHA
id: sha
run: echo "short=$(echo '${{ github.sha }}' | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Delete old release and tag
- name: Update Dedicated Server release
uses: andelf/nightly-release@main
env:
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG="Nightly-Dedicated-Server"
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
AUTH="Authorization: token $FORGEJO_TOKEN"
EXISTING_ID=$(curl -sf -H "$AUTH" "$API/releases/tags/$TAG" 2>/dev/null | jq -r '.id // empty' || true)
if [ -n "$EXISTING_ID" ]; then
curl -sf -X DELETE -H "$AUTH" "$API/releases/$EXISTING_ID"
fi
curl -s -X DELETE -H "$AUTH" "$API/tags/$TAG" > /dev/null || true
- name: Import GPG key
uses: https://github.com/crazy-max/ghaction-import-gpg@v6
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_tag_gpgsign: true
tag_name: nightly-dedicated-server
name: Nightly Dedicated Server Release
body: |
Dedicated Server runtime for Windows64.
- name: Create signed tag
run: |
git tag -s -f Nightly-Dedicated-Server -m "Nightly server release ${{ steps.sha.outputs.short }}"
git push origin Nightly-Dedicated-Server --force
- name: Create release on Forgejo
env:
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG="Nightly-Dedicated-Server"
TITLE="Server: ${{ steps.sha.outputs.short }}"
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
AUTH="Authorization: token $FORGEJO_TOKEN"
NOTES=$(cat <<'EOF'
Dedicated Server runtime for Windows64.
Two flavours are attached:
- `LCE-Revelations-Server-Win64.zip`: vanilla server, no plugin support, smallest download.
- `LCE-Revelations-Server-Win64-FourKit.zip`: server with the FourKit plugin host, bundled .NET 10 runtime, and an empty `plugins/` folder ready for plugin authors to drop DLLs into.
Pick the flavour you want and extract it to a folder where you'd like to keep the server runtime.
EOF
)
PAYLOAD=$(jq -nc --arg tag "$TAG" --arg name "$TITLE" --arg body "$NOTES" \
'{tag_name:$tag, name:$name, body:$body, draft:false, prerelease:false}')
RID=$(curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d "$PAYLOAD" "$API/releases" | jq -r '.id')
if [ -z "$RID" ] || [ "$RID" = "null" ]; then
echo "Failed to create release" >&2
exit 1
fi
echo "Created release id=$RID"
for asset in artifacts/*; do
name=$(basename "$asset")
size=$(stat -c%s "$asset")
echo "Uploading $name ($size bytes)"
HTTP=$(curl -sS -w '%{http_code}' -o /tmp/upload-resp -X POST -H "$AUTH" \
-F "attachment=@$asset" \
"$API/releases/$RID/assets?name=$name")
if [ "$HTTP" -lt 200 ] || [ "$HTTP" -ge 300 ]; then
echo "Upload failed: HTTP $HTTP" >&2
echo "--- response body ---" >&2
cat /tmp/upload-resp >&2 || true
echo "" >&2
exit 1
fi
echo "Uploaded $name OK (HTTP $HTTP)"
done
release-client:
name: Release Client
needs: [build-client, release-server]
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v6
- name: Download client artifacts
uses: https://github.com/actions/download-artifact@v3
with:
name: client-build
path: artifacts
- name: Install jq
run: apt-get update && apt-get install -y --no-install-recommends jq
- name: Get short SHA
id: sha
run: echo "short=$(echo '${{ github.sha }}' | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Delete old release and tag
env:
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG="Nightly"
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
AUTH="Authorization: token $FORGEJO_TOKEN"
EXISTING_ID=$(curl -sf -H "$AUTH" "$API/releases/tags/$TAG" 2>/dev/null | jq -r '.id // empty' || true)
if [ -n "$EXISTING_ID" ]; then
curl -sf -X DELETE -H "$AUTH" "$API/releases/$EXISTING_ID"
fi
curl -s -X DELETE -H "$AUTH" "$API/tags/$TAG" > /dev/null || true
- name: Import GPG key
uses: https://github.com/crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_tag_gpgsign: true
- name: Create signed tag
run: |
git tag -s -f Nightly -m "Nightly release ${{ steps.sha.outputs.short }}"
git push origin Nightly --force
- name: Write release notes
run: |
cat > notes.md <<'NOTES'
# Instructions:
**Newcomers:**
- If this is your first time, download `LCE-Revelations-Client-Win64.zip` and extract it wherever you would like to keep it.
- I would recommend to set your username prior to launch (create a file called `username.txt`, put your desired username into the file, and save).
- To play, simply run `Minecraft.Client.exe`.
**For those that wish to update their existing installation with the latest build:**
- Download `Minecraft.Client.exe` and copy it over to your existing LCE-Revelations-Client-Win64 build (overwrite your old version of Minecraft.Client.exe).
**For developers:**
- `Minecraft.Client.pdb` contains debug symbols for crash analysis and development. Place it next to `Minecraft.Client.exe` for stack traces to show function names and line numbers.
**Steam Deck & Linux:**
- Y'all know the drill. Download the `LCE-Revelations-Client-Win64.zip`, extract it, add the `Minecraft.Client.exe` as a "Non-Steam Game" within the Steam library, turn on compatibility mode with Proton Experimental, and then run it!
# Multiplayer instructions:
LAN games are natively supported, and any LAN games will appear automatically on the right. However, if you'd like to play with your friends online (and if you don't want to require them to setup a vpn, and/or if you don't want to port forward), I would recommend the following setup. Please keep in mind, you do NOT need to do this to enjoy the game. This is just how I have it setup for me so my friends can join without any hassle:
Prerequisites:
- Premium playit.gg account, costs about $3 USD per month. This is for setting up the tunnel.
- playit.gg agent installed on host PC.
How-to:
- Ensure your playit.gg agent is connected to your playit.gg account
- On the playit.gg website, setup a new tunnel (choose TCP). Ensure the configurable settings are set to the below values, assuming your agent is installed on the same computer as your online LCE Revelations game is hosted from.
- Configurable settings:
- Local IP: `127.0.0.1`
- Local Port: `25565`
- Proxy Protocol: `None`
- After creating your tunnel, navigate to the "Tunnels" main page. You'll see the IP address and port for your tunnel. This is what your friends will input when adding your server in order to join your online game!
NOTES
- name: Create release on Forgejo
env:
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG="Nightly"
TITLE="Client: ${{ steps.sha.outputs.short }}"
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
AUTH="Authorization: token $FORGEJO_TOKEN"
BODY=$(cat notes.md)
PAYLOAD=$(jq -nc --arg tag "$TAG" --arg name "$TITLE" --arg body "$BODY" \
'{tag_name:$tag, name:$name, body:$body, draft:false, prerelease:false}')
RID=$(curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d "$PAYLOAD" "$API/releases" | jq -r '.id')
if [ -z "$RID" ] || [ "$RID" = "null" ]; then
echo "Failed to create release" >&2
exit 1
fi
echo "Created release id=$RID"
for asset in artifacts/*; do
name=$(basename "$asset")
size=$(stat -c%s "$asset")
echo "Uploading $name ($size bytes)"
HTTP=$(curl -sS -w '%{http_code}' -o /tmp/upload-resp -X POST -H "$AUTH" \
-F "attachment=@$asset" \
"$API/releases/$RID/assets?name=$name")
if [ "$HTTP" -lt 200 ] || [ "$HTTP" -ge 300 ]; then
echo "Upload failed: HTTP $HTTP" >&2
echo "--- response body ---" >&2
cat /tmp/upload-resp >&2 || true
echo "" >&2
exit 1
fi
echo "Uploaded $name OK (HTTP $HTTP)"
done
Download `LCEServerWindows64.zip` and extract it to a folder where you'd like to keep the server runtime.
files: |
LCEServerWindows64.zip
./x64/Minecraft.Server/Release/Minecraft.Server.exe
./x64/Minecraft.Server/Release/Minecraft.Server.pdb
+6 -13
View File
@@ -11,27 +11,20 @@ on:
jobs:
build:
runs-on: [self-hosted, windows]
runs-on: windows-latest
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v6
with:
submodules: recursive
uses: actions/checkout@v6
- name: Setup MSVC
uses: https://github.com/ilammy/msvc-dev-cmd@v1
uses: ilammy/msvc-dev-cmd@v1
- name: Setup CMake
uses: https://github.com/lukka/get-cmake@latest
- name: Setup .NET
uses: https://github.com/actions/setup-dotnet@v4
with:
global-json-file: global.json
uses: lukka/get-cmake@latest
- name: Run CMake
uses: https://github.com/lukka/run-cmake@v10
uses: lukka/run-cmake@v10
env:
VCPKG_ROOT: "" # Disable vcpkg for CI builds
with:
-17
View File
@@ -415,20 +415,3 @@ build/
tmp*/
_server_asset_probe/
server-data/
# Tools build artifacts and intermediates
tools/*.class
tools/*.swf
tools/staging/
tools/server-monitor/
# Nix
result
result-*
.direnv/
.xwin-cache/
.xwin/
# macOS
.DS_Store
-3
View File
@@ -1,3 +0,0 @@
[submodule "Minecraft.Client/Windows64/4JLibs"]
path = Minecraft.Client/Windows64/4JLibs
url = https://github.com/itsRevela/4JLibs.git
+5 -13
View File
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.24)
project(LCE-Revelations LANGUAGES C CXX RC ASM_MASM)
project(MinecraftConsoles LANGUAGES C CXX RC ASM_MASM)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "This CMake build currently supports Windows only. For cross-compilation from Linux, use the clang-cl toolchain.")
if(NOT WIN32)
message(FATAL_ERROR "This CMake build currently supports Windows only.")
endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -39,10 +39,10 @@ function(configure_compiler_target target)
# MSVC
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(${target} PRIVATE
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL /Zi>
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL>
)
target_link_options(${target} PRIVATE
$<$<CONFIG:Release>:/LTCG:incremental /DEBUG /OPT:REF /OPT:ICF>
$<$<CONFIG:Release>:/LTCG:incremental>
)
endif()
@@ -68,25 +68,17 @@ set(MINECRAFT_SHARED_DEFINES
$<$<CONFIG:Debug>:_DEBUG>
_CRT_NON_CONFORMING_SWPRINTFS
_CRT_SECURE_NO_WARNINGS
_HAS_STD_BYTE=0
)
# Add platform-specific defines
if(PLATFORM_NAME STREQUAL "Windows64")
list(APPEND MINECRAFT_SHARED_DEFINES _WINDOWS64)
set(IGGY_LIBS iggy_w64.lib)
endif()
list(APPEND MINECRAFT_SHARED_DEFINES ${PLATFORM_DEFINES})
# ---
# Sources
# ---
add_subdirectory("Minecraft.Client/${PLATFORM_NAME}/4JLibs")
add_subdirectory(Minecraft.World)
add_subdirectory(Minecraft.Client)
if(PLATFORM_NAME STREQUAL "Windows64") # Server is only supported on Windows for now
add_subdirectory(Minecraft.Server.FourKit)
add_subdirectory(Minecraft.Server)
endif()
+17 -128
View File
@@ -1,56 +1,24 @@
# Compile Instructions
## Prerequisites
## Visual Studio
- **Visual Studio 2022** with the **Desktop development with C++** workload (this includes the CMake tools, MSVC toolchain, and Windows 10 SDK).
- **.NET 10 SDK**, required to build the FourKit plugin host (`Minecraft.Server.FourKit`).
- Download: https://dotnet.microsoft.com/download/dotnet/10.0 (pick the **x64 SDK** installer)
- The exact SDK version is pinned in `global.json` at the repo root.
- CMake will fail configure with a clear error message if .NET 10 is not installed, so you find out immediately rather than partway through a build.
- The build invokes `dotnet publish ... --runtime win-x64 --self-contained true`, so the published output bundles a complete .NET 10 runtime alongside the FourKit assembly. End users running the produced server do **not** need to install .NET themselves.
- All FourKit runtime files (DLL + .NET runtime + `hostfxr.dll`) land in a `runtime/` subfolder next to `Minecraft.Server.exe`. An empty `plugins/` folder is also created. Both are produced automatically by the build.
## Visual Studio 2022 quick start (recommended)
VS 2022 has built-in CMake support, so there is no need to generate a `.sln` file by hand.
1. Install the prerequisites above.
2. Clone the repo with submodules. If you don't, you will get a build error!
- `git clone --recurse-submodules https://github.com/itsRevela/LCE-Revelations.git`
3. In Visual Studio: `File > Open > Folder...` and select the **repo root** (the folder that contains `CMakeLists.txt`).
4. Wait for CMake to configure (~5 seconds on a warm cache, a few minutes on the first run while assets copy).
5. Pick a build configuration in the dropdown, for example `windows64-release`.
6. `Build > Build All` (or `F7`). Targets of interest:
- `Minecraft.Client`: the game client.
- `Minecraft.Server`: the **vanilla** dedicated server. Standalone C++ binary, no plugin host, no .NET dependency at runtime, smallest distribution.
- `Minecraft.Server.FourKit`: the **FourKit-enabled** dedicated server. Bundles the .NET 10 plugin host alongside the exe (in `runtime/`) and creates an empty `plugins/` folder for end users to drop plugin DLLs into. Building this target also triggers the `Minecraft.Server.FourKit.Managed` target which publishes the C# project.
7. Use the debug target dropdown to pick `Minecraft.Client.exe` or whichever server flavour you want, then `F5` to launch.
### Server flavours
Both server targets compile from the same source tree and produce a binary literally named `Minecraft.Server.exe`. The variant identity lives in the build directory:
```
build/<preset>/Minecraft.Server/Release/
Minecraft.Server.exe (vanilla, no plugin support)
Common/, Windows64/, ...
build/<preset>/Minecraft.Server.FourKit/Release/
Minecraft.Server.exe (FourKit-enabled, same exe name on purpose)
runtime/ (self-contained .NET 10 + Minecraft.Server.FourKit.dll)
plugins/ (empty drop point)
Common/, Windows64/, ...
```
The FourKit target gets the `MINECRAFT_SERVER_FOURKIT_BUILD` preprocessor define. Inside `FourKitBridge.h`, the real plugin entry points are conditional on that define; the vanilla target sees inline no-op stubs instead, so gameplay code can call `FourKitBridge::Fire*` unconditionally and produce the right behaviour for each flavour without per-call-site `#ifdef`s.
1. Clone or download the repository
1. Open the repo folder in Visual Studio 2022+.
2. Wait for cmake to configure the project and load all assets (this may take a few minutes on the first run).
3. Right click a folder in the solution explorer and switch to the 'CMake Targets View'
4. Select platform and configuration from the dropdown. EG: `Windows64 - Debug` or `Windows64 - Release`
5. Pick the startup project `Minecraft.Client.exe` or `Minecraft.Server.exe` using the debug targets dropdown
6. Build and run the project:
- `Build > Build Solution` (or `Ctrl+Shift+B`)
- Start debugging with `F5`.
### Dedicated server debug arguments
- Default debugger arguments for both `Minecraft.Server` and `Minecraft.Server.FourKit`:
- Default debugger arguments for `Minecraft.Server`:
- `-port 25565 -bind 0.0.0.0 -name DedicatedServer`
- You can override arguments in:
- `Project Properties > Debugging > Command Arguments`
- Both server targets post-build copy the dedicated-server asset set:
- `Minecraft.Server` post-build copies only the dedicated-server asset set:
- `Common/Media/MediaWindows64.arc`
- `Common/res`
- `Windows64/GameHDD`
@@ -77,36 +45,18 @@ Build Release:
cmake --build --preset windows64-release --target Minecraft.Client
```
Build vanilla Dedicated Server (Debug):
Build Dedicated Server (Debug):
```powershell
cmake --build --preset windows64-debug --target Minecraft.Server
```
Build vanilla Dedicated Server (Release):
Build Dedicated Server (Release):
```powershell
cmake --build --preset windows64-release --target Minecraft.Server
```
Build FourKit Dedicated Server (Debug):
```powershell
cmake --build --preset windows64-debug --target Minecraft.Server.FourKit
```
Build FourKit Dedicated Server (Release):
```powershell
cmake --build --preset windows64-release --target Minecraft.Server.FourKit
```
Build everything (client + both server flavours):
```powershell
cmake --build --preset windows64-release
```
Run executable:
```powershell
@@ -114,76 +64,15 @@ cd .\build\windows64\Minecraft.Client\Debug
.\Minecraft.Client.exe
```
Run vanilla dedicated server:
Run dedicated server:
```powershell
cd .\build\windows64\Minecraft.Server\Debug
.\Minecraft.Server.exe -port 25565 -bind 0.0.0.0 -name DedicatedServer
```
Run FourKit dedicated server:
```powershell
cd .\build\windows64\Minecraft.Server.FourKit\Debug
.\Minecraft.Server.exe -port 25565 -bind 0.0.0.0 -name DedicatedServer
```
Notes:
- The CMake build is Windows-only and x64-only.
- Contributors on macOS or Linux need a Windows machine or VM to build the project. Running the game via Wine is separate from having a supported build environment.
- Post-build asset copy is automatic for `Minecraft.Client` in CMake (Debug and Release variants).
- The game relies on relative paths (for example `Common\Media\...`), so launching from the output directory is required.
## CMake (Linux x64 Cross-Compile with Clang)
Cross-compile Windows x64 binaries on Linux using LLVM/Clang and the Windows SDK obtained via xwin.
### Prerequisites
Install the following packages (example for Ubuntu):
```bash
sudo apt install clang lld llvm cmake ninja-build rsync cargo
```
Install xwin for downloading the Windows SDK:
```bash
cargo install xwin
```
### Compile
Run this (Release):
```bash
./build-linux.sh
```
Or, for debug:
```bash
./build-linux.sh . Debug
```
### NixOS / Nix
For NixOS or systems with Nix installed, use the provided flake:
```bash
nix build .#client
nix build .#server
```
Or enter the development shell with all dependencies:
```bash
nix develop
```
Notes:
- Requires LLVM 15+ with clang-cl, lld-link, llvm-rc, and llvm-mt.
- Wine is required to run the compiled Windows executables on Linux.
### Troubleshooting
- **`'vswhere.exe' is not recognized`**: harmless warning. This appears if you ran `vcvars64.bat` from a plain command prompt instead of `Developer PowerShell for VS`. The Visual Studio Installer's `vswhere.exe` lives at `C:\Program Files (x86)\Microsoft Visual Studio\Installer\` and is not on the default `PATH`. Use the Developer PowerShell shortcut, or open the repo folder directly in VS (which handles the dev env for you).
- **`.NET 10 SDK not found` at configure time**: install the x64 SDK from https://dotnet.microsoft.com/download/dotnet/10.0 and re-run CMake configure (`Project > Configure Cache` in VS, or `cmake --preset windows64` from a shell).
- **Server starts but logs `hostfxr_initialize_for_dotnet_command_line failed`**: the `runtime/` folder next to `Minecraft.Server.exe` is missing or stale. Rebuild the `Minecraft.Server.FourKit` target (which re-stages `runtime/`), or do a clean rebuild of `Minecraft.Server`.
+4 -4
View File
@@ -1,14 +1,14 @@
#include "stdafx.h"
#include "AbstractContainerScreen.h"
#include "ItemRenderer.h"
#include "MultiPlayerLocalPlayer.h"
#include "MultiplayerLocalPlayer.h"
#include "Lighting.h"
#include "GameMode.h"
#include "KeyMapping.h"
#include "Options.h"
#include "../Minecraft.World/net.minecraft.world.inventory.h"
#include "../Minecraft.World/net.minecraft.locale.h"
#include "../Minecraft.World/net.minecraft.world.item.h"
#include "..\Minecraft.World\net.minecraft.world.inventory.h"
#include "..\Minecraft.World\net.minecraft.locale.h"
#include "..\Minecraft.World\net.minecraft.world.item.h"
ItemRenderer *AbstractContainerScreen::itemRenderer = new ItemRenderer();
@@ -1,8 +1,8 @@
#include "stdafx.h"
#include "../Minecraft.World/net.minecraft.core.h"
#include "../Minecraft.World/net.minecraft.world.entity.projectile.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/net.minecraft.world.level.h"
#include "..\Minecraft.World\net.minecraft.core.h"
#include "..\Minecraft.World\net.minecraft.world.entity.projectile.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\Minecraft.World\net.minecraft.world.level.h"
#include "AbstractProjectileDispenseBehavior.h"
shared_ptr<ItemInstance> AbstractProjectileDispenseBehavior::execute(BlockSource *source, shared_ptr<ItemInstance> dispensed)
@@ -1,6 +1,6 @@
#pragma once
#include "../Minecraft.World/DefaultDispenseItemBehavior.h"
#include "..\Minecraft.World\DefaultDispenseItemBehavior.h"
class Projectile;
+2 -2
View File
@@ -1,8 +1,8 @@
#include "stdafx.h"
#include "Textures.h"
#include "AbstractTexturePack.h"
#include "../Minecraft.World/InputOutputStream.h"
#include "../Minecraft.World/StringHelpers.h"
#include "..\Minecraft.World\InputOutputStream.h"
#include "..\Minecraft.World\StringHelpers.h"
#include "Common/UI/UI.h"
AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback) : id(id), name(name)
+4 -4
View File
@@ -4,10 +4,10 @@
#include "Font.h"
#include "Textures.h"
#include "Lighting.h"
#include "../Minecraft.World/System.h"
#include "../Minecraft.World/net.minecraft.locale.h"
#include "../Minecraft.World/net.minecraft.stats.h"
#include "../Minecraft.World/SharedConstants.h"
#include "..\Minecraft.World\System.h"
#include "..\Minecraft.World\net.minecraft.locale.h"
#include "..\Minecraft.World\net.minecraft.stats.h"
#include "..\Minecraft.World\SharedConstants.h"
AchievementPopup::AchievementPopup(Minecraft *mc)
{
+4 -4
View File
@@ -8,10 +8,10 @@
#include "Textures.h"
#include "StatsCounter.h"
#include "ItemRenderer.h"
#include "../Minecraft.World/System.h"
#include "../Minecraft.World/net.minecraft.locale.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/JavaMath.h"
#include "..\Minecraft.World\System.h"
#include "..\Minecraft.World\net.minecraft.locale.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\Minecraft.World\JavaMath.h"
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "Screen.h"
#include "../Minecraft.World/net.minecraft.stats.h"
#include "..\Minecraft.World\net.minecraft.stats.h"
class StatsCounter;
class AchievementScreen : public Screen
+3 -3
View File
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "../Minecraft.World/StringHelpers.h"
#include "../Minecraft.World/compression.h"
#include "..\Minecraft.World\StringHelpers.h"
#include "..\Minecraft.World\compression.h"
#include "ArchiveFile.h"
@@ -104,7 +104,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
app.DebugPrintf("Couldn't find file in archive\n");
app.DebugPrintf("Failed to find file '%ls' in archive\n", filename.c_str());
#ifndef _CONTENT_PACKAGE
DEBUG_BREAK();
__debugbreak();
#endif
app.FatalLoadError();
}
+2 -2
View File
@@ -3,8 +3,8 @@
#include <vector>
#include <unordered_map>
#include "../Minecraft.World/File.h"
#include "../Minecraft.World/ArrayWithLength.h"
#include "..\Minecraft.World\File.h"
#include "..\Minecraft.World\ArrayWithLength.h"
using namespace std;
+2 -2
View File
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "ArrowRenderer.h"
#include "../Minecraft.World/net.minecraft.world.entity.projectile.h"
#include "../Minecraft.World/Mth.h"
#include "..\Minecraft.World\net.minecraft.world.entity.projectile.h"
#include "..\Minecraft.World\Mth.h"
ResourceLocation ArrowRenderer::ARROW_LOCATION = ResourceLocation(TN_ITEM_ARROWS);
+1 -1
View File
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../Minecraft.World/net.minecraft.world.entity.ambient.h"
#include "..\Minecraft.World\net.minecraft.world.entity.ambient.h"
#include "BatModel.h"
#include "ModelPart.h"
+1 -1
View File
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../Minecraft.World/net.minecraft.world.entity.ambient.h"
#include "..\Minecraft.World\net.minecraft.world.entity.ambient.h"
#include "BatRenderer.h"
#include "BatModel.h"
+21 -20
View File
@@ -1,13 +1,11 @@
#include "stdafx.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.entity.h"
#include "../Minecraft.World/net.minecraft.world.level.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
#include "..\Minecraft.World\net.minecraft.world.level.h"
#include "BeaconRenderer.h"
#include "Tesselator.h"
ResourceLocation BeaconRenderer::BEAM_LOCATION = ResourceLocation(TN_MISC_BEACON_BEAM);
bool BeaconRenderer::s_renderOuterHalo = false;
void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
{
shared_ptr<BeaconTileEntity> beacon = dynamic_pointer_cast<BeaconTileEntity>(_beacon);
@@ -20,18 +18,21 @@ void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y,
bindTexture(&BEAM_LOCATION);
// TODO: 4J: Put this back in
//assert(0);
//glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
//glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glDisable(GL_LIGHTING);
glDisable(GL_CULL_FACE);
glDisable(GL_BLEND);
glDepthMask(true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
float tt = beacon->getLevel()->getGameTime() + a;
float texVOff = -tt * .20f - floor(-tt * .10f);
if (!s_renderOuterHalo)
{
glDisable(GL_BLEND);
glDepthMask(true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
int r = 1;
double rot = tt * .025 * (1 - (r & 1) * 2.5);
@@ -72,20 +73,20 @@ void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y,
t->vertexUV(x + enx, y, z + enz, uu2, vv2);
t->vertexUV(x + esx, y, z + esz, uu1, vv2);
t->vertexUV(x + esx, y + top, z + esz, uu1, vv1);
t->vertexUV(x + wsx, y + top, z + wsz, uu2, vv1);
t->vertexUV(x + wsx, y, z + wsz, uu2, vv2);
t->vertexUV(x + wnx, y, z + wnz, uu1, vv2);
t->vertexUV(x + wnx, y + top, z + wnz, uu1, vv1);
t->end();
}
else
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(false);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(false);
{
t->begin();
t->color(255, 255, 255, 32);
@@ -110,22 +111,22 @@ void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y,
t->vertexUV(x + wnx, y, z + wnz, uu2, vv2);
t->vertexUV(x + enx, y, z + enz, uu1, vv2);
t->vertexUV(x + enx, y + top, z + enz, uu1, vv1);
t->vertexUV(x + esx, y + top, z + esz, uu2, vv1);
t->vertexUV(x + esx, y, z + esz, uu2, vv2);
t->vertexUV(x + wsx, y, z + wsz, uu1, vv2);
t->vertexUV(x + wsx, y + top, z + wsz, uu1, vv1);
t->vertexUV(x + enx, y + top, z + enz, uu2, vv1);
t->vertexUV(x + enx, y, z + enz, uu2, vv2);
t->vertexUV(x + esx, y, z + esz, uu1, vv2);
t->vertexUV(x + esx, y + top, z + esz, uu1, vv1);
t->vertexUV(x + wsx, y + top, z + wsz, uu2, vv1);
t->vertexUV(x + wsx, y, z + wsz, uu2, vv2);
t->vertexUV(x + wnx, y, z + wnz, uu1, vv2);
t->vertexUV(x + wnx, y + top, z + wnz, uu1, vv1);
t->end();
}
-2
View File
@@ -9,7 +9,5 @@ private:
static ResourceLocation BEAM_LOCATION;
public:
static bool s_renderOuterHalo;
virtual void render(shared_ptr<TileEntity> _beacon, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled);
};
+1 -1
View File
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../Minecraft.World/Mth.h"
#include "..\Minecraft.World\Mth.h"
#include "BlazeModel.h"
#include "ModelPart.h"
+1 -1
View File
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "BlazeModel.h"
#include "../Minecraft.World/net.minecraft.world.entity.monster.h"
#include "..\Minecraft.World\net.minecraft.world.entity.monster.h"
#include "BlazeRenderer.h"
ResourceLocation BlazeRenderer::BLAZE_LOCATION = ResourceLocation(TN_MOB_BLAZE);
+2 -2
View File
@@ -1,8 +1,8 @@
#include "stdafx.h"
#include "BoatRenderer.h"
#include "BoatModel.h"
#include "../Minecraft.World/net.minecraft.world.entity.item.h"
#include "../Minecraft.World/Mth.h"
#include "..\Minecraft.World\net.minecraft.world.entity.item.h"
#include "..\Minecraft.World\Mth.h"
ResourceLocation BoatRenderer::BOAT_LOCATION = ResourceLocation(TN_ITEM_BOAT);
+1 -1
View File
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../Minecraft.World/Mth.h"
#include "..\Minecraft.World\Mth.h"
#include "BookModel.h"
#include "ModelPart.h"
+3 -3
View File
@@ -1,9 +1,9 @@
#include "stdafx.h"
#include "BreakingItemParticle.h"
#include "Tesselator.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/net.minecraft.world.item.h"
#include "../Minecraft.World/net.minecraft.world.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\Minecraft.World\net.minecraft.world.item.h"
#include "..\Minecraft.World\net.minecraft.world.h"
void BreakingItemParticle::_init(Item *item, Textures *textures, int data)
{
+5 -5
View File
@@ -1,10 +1,10 @@
#include "stdafx.h"
#include "BubbleParticle.h"
#include "../Minecraft.World/Random.h"
#include "../Minecraft.World/Mth.h"
#include "../Minecraft.World/JavaMath.h"
#include "../Minecraft.World/net.minecraft.world.level.h"
#include "../Minecraft.World/net.minecraft.world.level.material.h"
#include "..\Minecraft.World\Random.h"
#include "..\Minecraft.World\Mth.h"
#include "..\Minecraft.World\JavaMath.h"
#include "..\Minecraft.World\net.minecraft.world.level.h"
#include "..\Minecraft.World\net.minecraft.world.level.material.h"
BubbleParticle::BubbleParticle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z, xa, ya, za)
{
+2 -2
View File
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "../Minecraft.World/StringHelpers.h"
#include "..\Minecraft.World\StringHelpers.h"
#include "Textures.h"
#include "../Minecraft.World/ArrayWithLength.h"
#include "..\Minecraft.World\ArrayWithLength.h"
#include "BufferedImage.h"
#ifdef _XBOX
+12 -5
View File
@@ -52,15 +52,20 @@ set_target_properties(Minecraft.Client PROPERTIES
target_link_libraries(Minecraft.Client PRIVATE
Minecraft.World
d3d11
dxgi
d3dcompiler
XInput9_1_0
wsock32
legacy_stdio_definitions
4JLibs.${PLATFORM_NAME}.Input
4JLibs.${PLATFORM_NAME}.Profile
4JLibs.${PLATFORM_NAME}.Storage
4JLibs.${PLATFORM_NAME}.Render
$<$<CONFIG:Debug>: # Debug 4J libraries
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
>
$<$<NOT:$<CONFIG:Debug>>: # Release 4J libraries
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
>
)
# Iggy libs
@@ -76,6 +81,8 @@ set(ASSET_FOLDER_PAIRS
"${CMAKE_CURRENT_SOURCE_DIR}/music" "music"
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Media" "Common/Media"
"${CMAKE_CURRENT_SOURCE_DIR}/Common/res" "Common/res"
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Trial" "Common/Trial"
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Tutorial" "Common/Tutorial"
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}Media" "${PLATFORM_NAME}Media"
)
setup_asset_folder_copy(Minecraft.Client "${ASSET_FOLDER_PAIRS}")
+4 -4
View File
@@ -1,10 +1,10 @@
#include "stdafx.h"
#include "Camera.h"
#include "MemoryTracker.h"
#include "../Minecraft.World/net.minecraft.world.entity.player.h"
#include "../Minecraft.World/net.minecraft.world.level.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/TilePos.h"
#include "..\Minecraft.World\net.minecraft.world.entity.player.h"
#include "..\Minecraft.World\net.minecraft.world.level.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\Minecraft.World\TilePos.h"
float Camera::xPlayerOffs = 0.0f;
float Camera::yPlayerOffs = 0.0f;
+2 -2
View File
@@ -1,6 +1,6 @@
#pragma once
#include "../Minecraft.World/FloatBuffer.h"
#include "../Minecraft.World/IntBuffer.h"
#include "..\Minecraft.World\FloatBuffer.h"
#include "..\Minecraft.World\IntBuffer.h"
class TilePos;
+6 -23
View File
@@ -2,17 +2,16 @@
#include "ChatScreen.h"
#include "ClientConnection.h"
#include "Font.h"
#include "MultiPlayerLocalPlayer.h"
#include "../Minecraft.World/SharedConstants.h"
#include "../Minecraft.World/StringHelpers.h"
#include "../Minecraft.World/ChatPacket.h"
#include "../Minecraft.World/ArabicShaping.h"
#include "MultiplayerLocalPlayer.h"
#include "..\Minecraft.World\SharedConstants.h"
#include "..\Minecraft.World\StringHelpers.h"
#include "..\Minecraft.World\ChatPacket.h"
#include "..\Minecraft.World\ArabicShaping.h"
const wstring ChatScreen::allowedChars = SharedConstants::acceptableLetters;
vector<wstring> ChatScreen::s_chatHistory;
int ChatScreen::s_historyIndex = -1;
wstring ChatScreen::s_historyDraft;
int ChatScreen::s_chatIndex = 0;
bool ChatScreen::isAllowedChatChar(wchar_t c)
{
@@ -29,8 +28,6 @@ ChatScreen::ChatScreen()
frame = 0;
cursorIndex = 0;
s_historyIndex = -1;
ChatScreen::s_chatIndex = 0;
}
void ChatScreen::init()
@@ -92,20 +89,6 @@ void ChatScreen::handleHistoryDown()
applyHistoryMessage();
}
int ChatScreen::getChatIndex()
{
return ChatScreen::s_chatIndex;
}
void ChatScreen::correctChatIndex(int newChatIndex) {
ChatScreen::s_chatIndex = newChatIndex;
}
void ChatScreen::setWheelValue(int wheel) {
ChatScreen::s_chatIndex += wheel;
if (ChatScreen::s_chatIndex < 0) ChatScreen::s_chatIndex = 0;
}
void ChatScreen::keyPressed(wchar_t ch, int eventKey)
{
if (eventKey == Keyboard::KEY_ESCAPE)
@@ -157,7 +140,7 @@ void ChatScreen::keyPressed(wchar_t ch, int eventKey)
cursorIndex--;
return;
}
if (isAllowedChatChar(ch) && static_cast<int>(message.length()) < SharedConstants::maxVisibleLength)
if (isAllowedChatChar(ch) && static_cast<int>(message.length()) < SharedConstants::maxChatLength)
{
message.insert(cursorIndex, 1, ch);
cursorIndex++;
-4
View File
@@ -16,7 +16,6 @@ private:
static std::vector<wstring> s_chatHistory;
static int s_historyIndex;
static wstring s_historyDraft;
static int s_chatIndex;
static const wstring allowedChars;
static bool isAllowedChatChar(wchar_t c);
@@ -29,9 +28,6 @@ public:
virtual void handleHistoryUp();
virtual void handleHistoryDown();
static int getChatIndex();
static void correctChatIndex(int newChatIndex);
static void setWheelValue(int wheel);
protected:
void keyPressed(wchar_t ch, int eventKey);
public:
+3 -3
View File
@@ -3,9 +3,9 @@
#include "ChestModel.h"
#include "LargeChestModel.h"
#include "ModelPart.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.entity.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/Calendar.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\Minecraft.World\Calendar.h"
ResourceLocation ChestRenderer::CHEST_LARGE_TRAP_LOCATION = ResourceLocation(TN_TILE_LARGE_TRAP_CHEST);
//ResourceLocation ChestRenderer::CHEST_LARGE_XMAS_LOCATION = ResourceLocation(TN_TILE_LARGE_XMAS_CHEST);
+1 -1
View File
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../Minecraft.World/Mth.h"
#include "..\Minecraft.World\Mth.h"
#include "ChickenModel.h"
#include "ModelPart.h"
+2 -2
View File
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "../Minecraft.World/Mth.h"
#include "..\Minecraft.World\Mth.h"
#include "ChickenRenderer.h"
#include "../Minecraft.World/net.minecraft.world.entity.animal.h"
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
ResourceLocation ChickenRenderer::CHICKEN_LOCATION = ResourceLocation(TN_MOB_CHICKEN);
+8 -8
View File
@@ -2,16 +2,16 @@
#include "Chunk.h"
#include "TileRenderer.h"
#include "TileEntityRenderDispatcher.h"
#include "../Minecraft.World/net.minecraft.world.level.h"
#include "../Minecraft.World/net.minecraft.world.level.chunk.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.entity.h"
#include "..\Minecraft.World\net.minecraft.world.level.h"
#include "..\Minecraft.World\net.minecraft.world.level.chunk.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
#include "LevelRenderer.h"
#ifdef __PS3__
#include "PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h"
#include "PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h"
#include "PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h"
#include "PS3\SPU_Tasks\ChunkUpdate\ChunkRebuildData.h"
#include "PS3\SPU_Tasks\ChunkUpdate\TileRenderer_SPU.h"
#include "PS3\SPU_Tasks\CompressedTile\CompressedTileStorage_SPU.h"
#include "C4JThread_SPU.h"
#include "C4JSpursJob.h"
@@ -1016,7 +1016,7 @@ bool Chunk::isEmpty()
void Chunk::setDirty()
{
// 4J - not used, but if this starts being used again then we'll need to investigate how best to handle it.
DEBUG_BREAK();
__debugbreak();
levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_DIRTY);
}
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "AllowAllCuller.h"
#include "Tesselator.h"
#include "../Minecraft.World/ArrayWithLength.h"
#include "..\Minecraft.World\ArrayWithLength.h"
#include "LevelRenderer.h"
class Level;
+53 -278
View File
@@ -9,46 +9,46 @@
#include "TakeAnimationParticle.h"
#include "CritParticle.h"
#include "User.h"
#include "../Minecraft.World/net.minecraft.world.level.storage.h"
#include "../Minecraft.World/net.minecraft.world.level.chunk.h"
#include "../Minecraft.World/net.minecraft.stats.h"
#include "../Minecraft.World/net.minecraft.world.entity.h"
#include "../Minecraft.World/net.minecraft.world.entity.ai.attributes.h"
#include "../Minecraft.World/net.minecraft.world.entity.player.h"
#include "../Minecraft.World/net.minecraft.world.entity.animal.h"
#include "../Minecraft.World/net.minecraft.world.entity.npc.h"
#include "../Minecraft.World/net.minecraft.world.entity.item.h"
#include "../Minecraft.World/net.minecraft.world.entity.projectile.h"
#include "../Minecraft.World/net.minecraft.world.entity.global.h"
#include "../Minecraft.World/net.minecraft.world.entity.boss.enderdragon.h"
#include "../Minecraft.World/net.minecraft.world.entity.monster.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.entity.h"
#include "../Minecraft.World/net.minecraft.world.item.h"
#include "../Minecraft.World/net.minecraft.world.item.trading.h"
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/net.minecraft.world.inventory.h"
#include "../Minecraft.World/net.minecraft.world.h"
#include "../Minecraft.World/net.minecraft.world.level.saveddata.h"
#include "../Minecraft.World/net.minecraft.world.level.dimension.h"
#include "../Minecraft.World/net.minecraft.world.effect.h"
#include "../Minecraft.World/net.minecraft.world.food.h"
#include "../Minecraft.World/SharedConstants.h"
#include "../Minecraft.World/AABB.h"
#include "../Minecraft.World/Pos.h"
#include "../Minecraft.World/Socket.h"
#include "..\Minecraft.World\net.minecraft.world.level.storage.h"
#include "..\Minecraft.World\net.minecraft.world.level.chunk.h"
#include "..\Minecraft.World\net.minecraft.stats.h"
#include "..\Minecraft.World\net.minecraft.world.entity.h"
#include "..\Minecraft.World\net.minecraft.world.entity.ai.attributes.h"
#include "..\Minecraft.World\net.minecraft.world.entity.player.h"
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
#include "..\Minecraft.World\net.minecraft.world.entity.npc.h"
#include "..\Minecraft.World\net.minecraft.world.entity.item.h"
#include "..\Minecraft.World\net.minecraft.world.entity.projectile.h"
#include "..\Minecraft.World\net.minecraft.world.entity.global.h"
#include "..\Minecraft.World\net.minecraft.world.entity.boss.enderdragon.h"
#include "..\Minecraft.World\net.minecraft.world.entity.monster.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
#include "..\Minecraft.World\net.minecraft.world.item.h"
#include "..\Minecraft.World\net.minecraft.world.item.trading.h"
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\Minecraft.World\net.minecraft.world.inventory.h"
#include "..\Minecraft.World\net.minecraft.world.h"
#include "..\Minecraft.World\net.minecraft.world.level.saveddata.h"
#include "..\Minecraft.World\net.minecraft.world.level.dimension.h"
#include "..\Minecraft.World\net.minecraft.world.effect.h"
#include "..\Minecraft.World\net.minecraft.world.food.h"
#include "..\Minecraft.World\SharedConstants.h"
#include "..\Minecraft.World\AABB.h"
#include "..\Minecraft.World\Pos.h"
#include "..\Minecraft.World\Socket.h"
#include "Minecraft.h"
#include "ProgressRenderer.h"
#include "LevelRenderer.h"
#include "Options.h"
#include "MinecraftServer.h"
#include "ClientConstants.h"
#include "../Minecraft.World/SoundTypes.h"
#include "../Minecraft.World/BasicTypeContainers.h"
#include "..\Minecraft.World\SoundTypes.h"
#include "..\Minecraft.World\BasicTypeContainers.h"
#include "TexturePackRepository.h"
#ifdef _XBOX
#include "Common/XUI/XUI_Scene_Trading.h"
#include "Common\XUI\XUI_Scene_Trading.h"
#else
#include "Common/UI/UI.h"
#include "Common\UI\UI.h"
#endif
#ifdef __PS3__
#include "PS3/Network/SonyVoiceChat.h"
@@ -56,41 +56,16 @@
#include "DLCTexturePack.h"
#ifdef _WINDOWS64
#include "Xbox/Network/NetworkPlayerXbox.h"
#include "Common/Network/PlatformNetworkManagerStub.h"
#include "Windows64/Network/WinsockNetLayer.h"
#include "Xbox\Network\NetworkPlayerXbox.h"
#include "Common\Network\PlatformNetworkManagerStub.h"
#endif
#ifdef _DURANGO
#include "../Minecraft.World/DurangoStats.h"
#include "../Minecraft.World/GenericStats.h"
#include "..\Minecraft.World\DurangoStats.h"
#include "..\Minecraft.World\GenericStats.h"
#endif
namespace
{
char mapIconToFrame(char iconSlot)
{
if (iconSlot >= 8) return iconSlot - 4;
return iconSlot;
}
// Same hash as getRandomPlayerMapIcon in MapItemSavedData.cpp, returning
// the Iggy/SWF frame index (0-7) instead of the raw icon slot.
char computePlayerMapFrame(int entityId, int playerIndex)
{
static const char PLAYER_MAP_ICON_SLOTS[] = { 0, 1, 2, 3, 8, 9, 10, 11 };
unsigned int seed = static_cast<unsigned int>(entityId);
seed ^= static_cast<unsigned int>(playerIndex * 0x9E3779B9u);
seed ^= (seed >> 16);
seed *= 0x7FEB352Du;
seed ^= (seed >> 15);
seed *= 0x846CA68Bu;
seed ^= (seed >> 16);
return mapIconToFrame(PLAYER_MAP_ICON_SLOTS[seed % 8]);
}
}
ClientConnection::ClientConnection(Minecraft *minecraft, const wstring& ip, int port)
{
// 4J Stu - No longer used as we use the socket version below.
@@ -135,7 +110,6 @@ ClientConnection::ClientConnection(Minecraft *minecraft, Socket *socket, int iUs
started = false;
savedDataStorage = new SavedDataStorage(nullptr);
maxPlayers = 20;
m_isForkServer = false;
this->minecraft = minecraft;
@@ -403,7 +377,6 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
BYTE networkSmallId = getSocket()->getSmallId();
app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges);
app.SetPlayerMapIcon(minecraft->player->getName().c_str(), computePlayerMapFrame(packet->clientVersion, packet->m_playerIndex));
minecraft->player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges);
// Assume all privileges are on, so that the first message we see only indicates things that have been turned off
@@ -474,7 +447,6 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
BYTE networkSmallId = getSocket()->getSmallId();
app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges);
app.SetPlayerMapIcon(player->getName().c_str(), computePlayerMapFrame(packet->clientVersion, packet->m_playerIndex));
player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges);
// Assume all privileges are on, so that the first message we see only indicates things that have been turned off
@@ -945,36 +917,6 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
}
}
// Client-side registration: if we still have no IQNet entry for this remote
// player, create one so they appear in the Tab player list.
// Find the first available IQNet slot (customData == 0, skip slot 0 which
// is the host). We can't use packet->m_playerIndex directly because on
// dedicated servers the game-level player index starts at 0 for real
// players, conflicting with the IQNet host slot.
if (matchedQNetPlayer == nullptr)
{
for (int s = 1; s < MINECRAFT_NET_MAX_PLAYERS; ++s)
{
IQNetPlayer* qp = &IQNet::m_player[s];
if (qp->GetCustomDataValue() == 0 && qp->m_gamertag[0] == 0)
{
BYTE smallId = static_cast<BYTE>(s);
qp->m_smallId = smallId;
qp->m_isRemote = true;
qp->m_isHostPlayer = false;
qp->m_resolvedXuid = pktXuid;
wcsncpy_s(qp->m_gamertag, 32, packet->name.c_str(), _TRUNCATE);
if (smallId >= IQNet::s_playerCount)
IQNet::s_playerCount = smallId + 1;
extern CPlatformNetworkManagerStub* g_pPlatformNetworkManager;
g_pPlatformNetworkManager->NotifyPlayerJoined(qp);
matchedQNetPlayer = qp;
break;
}
}
}
if (matchedQNetPlayer != nullptr)
{
// Store packet-authoritative XUID on this network slot so later lookups by XUID
@@ -1004,7 +946,6 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
player->setPlayerIndex( packet->m_playerIndex );
player->setCustomSkin( packet->m_skinId );
player->setCustomCape( packet->m_capeId );
app.SetPlayerMapIcon(packet->name.c_str(), computePlayerMapFrame(packet->id, packet->m_playerIndex));
player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges);
if (!player->customTextureUrl.empty() && player->customTextureUrl.substr(0, 3).compare(L"def") != 0 && !app.IsFileInMemoryTextures(player->customTextureUrl))
@@ -1142,35 +1083,33 @@ void ClientConnection::handleMoveEntitySmall(shared_ptr<MoveEntityPacketSmall> p
void ClientConnection::handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packet)
{
#ifdef _WINDOWS64
// On fork servers, IQNet cleanup is handled by the MC|ForkPLeave custom
// payload so players stay in Tab regardless of render distance. On
// upstream servers (no MC|ForkHello received), fall back to the old
// behaviour of cleaning up IQNet here.
if (!m_isForkServer && !g_NetworkManager.IsHost())
if (!g_NetworkManager.IsHost())
{
for (int i = 0; i < packet->ids.length; i++)
{
shared_ptr<Entity> entity = getEntity(packet->ids[i]);
if (entity != nullptr)
if (entity != nullptr && entity->GetType() == eTYPE_PLAYER)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(entity);
if (player != nullptr)
{
for (int s = 1; s < MINECRAFT_NET_MAX_PLAYERS; ++s)
PlayerUID xuid = player->getXuid();
INetworkPlayer* np = g_NetworkManager.GetPlayerByXuid(xuid);
if (np != nullptr)
{
IQNetPlayer* qp = &IQNet::m_player[s];
if (qp->GetCustomDataValue() != 0 &&
_wcsicmp(qp->m_gamertag, player->getName().c_str()) == 0)
NetworkPlayerXbox* npx = (NetworkPlayerXbox*)np;
IQNetPlayer* qp = npx->GetQNetPlayer();
if (qp != nullptr)
{
extern CPlatformNetworkManagerStub* g_pPlatformNetworkManager;
g_pPlatformNetworkManager->NotifyPlayerLeaving(qp);
qp->m_smallId = 0;
qp->m_isRemote = false;
qp->m_isHostPlayer = false;
// Clear resolved id to avoid stale XUID -> player matches after disconnect.
qp->m_resolvedXuid = INVALID_XUID;
qp->m_gamertag[0] = 0;
qp->SetCustomDataValue(0);
break;
}
}
}
@@ -1607,28 +1546,17 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
bool replaceEntitySource = false;
bool replaceItem = false;
int stringArgsSize = packet->m_stringArgs.size();
wstring playerDisplayName = L"";
wstring sourceDisplayName = L"";
// On platforms other than Xbox One this just sets display name to gamertag
if (stringArgsSize >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]);
if (stringArgsSize >= 2) sourceDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[1]);
if (packet->m_stringArgs.size() >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]);
if (packet->m_stringArgs.size() >= 2) sourceDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[1]);
switch(packet->m_messageType)
{
case ChatPacket::e_ChatCustom:
case ChatPacket::e_ChatActionBar:
if (stringArgsSize >= 1) {
message = packet->m_stringArgs[0];
message = app.EscapeHTMLString(message); //do this to enforce escaped string
message = app.FormatChatMessage(message); //this needs to be last cause it converts colors to html colors that would have been escaped
} else {
message = L"";
}
displayOnGui = (packet->m_messageType == ChatPacket::e_ChatCustom);
message = (packet->m_stringArgs.size() >= 1) ? packet->m_stringArgs[0] : L"";
break;
case ChatPacket::e_ChatBedOccupied:
message = app.GetString(IDS_TILE_BED_OCCUPIED);
@@ -1978,7 +1906,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
if(replacePlayer)
{
message = replaceAll(message,L"{*PLAYER*}", playerDisplayName);
message = replaceAll(message,L"{*PLAYER*}",playerDisplayName);
}
if(replaceEntitySource)
@@ -2013,9 +1941,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
// flag that a message is a death message
bool bIsDeathMessage = (packet->m_messageType>=ChatPacket::e_ChatDeathInFire) && (packet->m_messageType<=ChatPacket::e_ChatDeathIndirectMagicItem);
if( displayOnGui ) minecraft->gui->addMessage(message, m_userIndex, bIsDeathMessage);
if (!displayOnGui && !message.empty()) minecraft->gui->setActionBarMessage(message);
if( displayOnGui ) minecraft->gui->addMessage(message,m_userIndex, bIsDeathMessage);
}
void ClientConnection::handleAnimate(shared_ptr<AnimatePacket> packet)
@@ -3805,158 +3731,6 @@ void ClientConnection::handleSoundEvent(shared_ptr<LevelSoundPacket> packet)
void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> customPayloadPacket)
{
#ifdef _WINDOWS64
// Build a server-specific identity token file path next to the executable.
// Each server gets its own token file based on a hash of the server address,
// so connecting to multiple secured servers doesn't overwrite tokens.
auto buildIdentityTokenPath = []() -> std::string {
char exePath[MAX_PATH] = {};
DWORD len = GetModuleFileNameA(NULL, exePath, MAX_PATH);
if (len == 0 || len >= MAX_PATH) return std::string();
char *lastSlash = strrchr(exePath, '\\');
if (lastSlash != NULL) *(lastSlash + 1) = 0;
// Hash the server IP:port to create a unique filename per server
char serverAddr[300] = {};
sprintf_s(serverAddr, sizeof(serverAddr), "%s:%d", g_Win64MultiplayerIP, g_Win64MultiplayerPort);
unsigned int hash = 5381;
for (const char *p = serverAddr; *p; ++p)
hash = ((hash << 5) + hash) + static_cast<unsigned char>(*p);
char filename[64] = {};
sprintf_s(filename, sizeof(filename), "identity-token-%08x.dat", hash);
return std::string(exePath) + filename;
};
// Identity token: server issued us a new token - store it locally
if (CustomPayloadPacket::IDENTITY_TOKEN_ISSUE.compare(customPayloadPacket->identifier) == 0)
{
if (customPayloadPacket->data.data != nullptr && customPayloadPacket->length == 32)
{
std::string tokenPath = buildIdentityTokenPath();
if (!tokenPath.empty())
{
FILE *f = nullptr;
fopen_s(&f, tokenPath.c_str(), "wb");
if (f != nullptr)
{
size_t written = fwrite(customPayloadPacket->data.data, 1, 32, f);
fclose(f);
if (written == 32)
{
app.DebugPrintf("Client: Stored identity token to %s\n", tokenPath.c_str());
}
else
{
app.DebugPrintf("Client: Failed to write full identity token (wrote %zu/32)\n", written);
}
}
else
{
app.DebugPrintf("Client: Failed to open %s for writing\n", tokenPath.c_str());
}
}
}
return;
}
// Identity token: server is challenging us to present our stored token
if (CustomPayloadPacket::IDENTITY_TOKEN_CHALLENGE.compare(customPayloadPacket->identifier) == 0)
{
std::string tokenPath = buildIdentityTokenPath();
FILE *f = nullptr;
if (!tokenPath.empty())
fopen_s(&f, tokenPath.c_str(), "rb");
if (f != nullptr)
{
uint8_t token[32] = {};
size_t bytesRead = fread(token, 1, 32, f);
fclose(f);
if (bytesRead == 32)
{
byteArray tokenData(32);
memcpy(tokenData.data, token, 32);
connection->send(std::make_shared<CustomPayloadPacket>(
CustomPayloadPacket::IDENTITY_TOKEN_RESPONSE, tokenData));
app.DebugPrintf("Client: Sent identity token response\n");
}
else
{
app.DebugPrintf("Client: identity-token.dat is invalid (%zu bytes)\n", bytesRead);
connection->send(std::make_shared<CustomPayloadPacket>(
CustomPayloadPacket::IDENTITY_TOKEN_RESPONSE, byteArray()));
}
SecureZeroMemory(token, sizeof(token));
}
else
{
app.DebugPrintf("Client: No identity-token.dat found, sending empty response\n");
connection->send(std::make_shared<CustomPayloadPacket>(
CustomPayloadPacket::IDENTITY_TOKEN_RESPONSE, byteArray()));
}
return;
}
// Stream cipher handshake: server sent us a key
if (CustomPayloadPacket::CIPHER_KEY_CHANNEL.compare(customPayloadPacket->identifier) == 0)
{
if (customPayloadPacket->length == ServerRuntime::Security::StreamCipher::KEY_SIZE &&
customPayloadPacket->data.data != nullptr)
{
app.DebugPrintf("Client: Received MC|CKey from server (%d bytes)\n", customPayloadPacket->length);
// Store key and send ack+activate atomically to prevent ResetClientCipher race
WinsockNetLayer::StoreClientCipherKey(customPayloadPacket->data.data);
if (!WinsockNetLayer::SendAckAndActivateClientSendCipher())
{
app.DebugPrintf("Client: Failed to send cipher ack, connection will be closed\n");
}
}
else
{
app.DebugPrintf("Client: Received malformed MC|CKey (length=%d)\n", customPayloadPacket->length);
}
return;
}
// Fork server identification: enables render-distance-independent player list
if (CustomPayloadPacket::FORK_HELLO_CHANNEL.compare(customPayloadPacket->identifier) == 0)
{
m_isForkServer = true;
app.DebugPrintf("Client: Connected to fork server\n");
return;
}
// Fork server player leave: clean up IQNet slot so player leaves Tab list
if (CustomPayloadPacket::FORK_PLAYER_LEAVE_CHANNEL.compare(customPayloadPacket->identifier) == 0)
{
if (customPayloadPacket->data.data != nullptr && customPayloadPacket->length > 0)
{
int nameLen = customPayloadPacket->length / static_cast<int>(sizeof(wchar_t));
wstring leavingName(reinterpret_cast<const wchar_t*>(customPayloadPacket->data.data), nameLen);
for (int s = 1; s < MINECRAFT_NET_MAX_PLAYERS; ++s)
{
IQNetPlayer* qp = &IQNet::m_player[s];
if (qp->GetCustomDataValue() != 0 &&
_wcsicmp(qp->m_gamertag, leavingName.c_str()) == 0)
{
extern CPlatformNetworkManagerStub* g_pPlatformNetworkManager;
g_pPlatformNetworkManager->NotifyPlayerLeaving(qp);
qp->m_smallId = 0;
qp->m_isRemote = false;
qp->m_isHostPlayer = false;
qp->m_resolvedXuid = INVALID_XUID;
qp->m_gamertag[0] = 0;
qp->SetCustomDataValue(0);
app.DebugPrintf("Client: Player \"%ls\" left fork server, cleared IQNet slot %d\n", leavingName.c_str(), s);
break;
}
}
}
return;
}
#endif
if (CustomPayloadPacket::TRADER_LIST_PACKET.compare(customPayloadPacket->identifier) == 0)
{
ByteArrayInputStream bais(customPayloadPacket->data);
@@ -4264,9 +4038,6 @@ void ClientConnection::handleSetPlayerTeamPacket(shared_ptr<SetPlayerTeamPacket>
void ClientConnection::handleParticleEvent(shared_ptr<LevelParticlesPacket> packet)
{
wstring particleName = packet->getName();
ePARTICLE_TYPE particleId = (ePARTICLE_TYPE)Integer::parseInt(particleName);
for (int i = 0; i < packet->getCount(); i++)
{
double xVarience = random->nextGaussian() * packet->getXDist();
@@ -4276,6 +4047,10 @@ void ClientConnection::handleParticleEvent(shared_ptr<LevelParticlesPacket> pack
double ya = random->nextGaussian() * packet->getMaxSpeed();
double za = random->nextGaussian() * packet->getMaxSpeed();
// TODO: determine particle ID from name
assert(0);
ePARTICLE_TYPE particleId = eParticleType_heart;
level->addParticle(particleId, packet->getX() + xVarience, packet->getY() + yVarience, packet->getZ() + zVarience, xa, ya, za);
}
}
+1 -2
View File
@@ -1,6 +1,6 @@
#pragma once
#include <unordered_set>
#include "../Minecraft.World/net.minecraft.network.h"
#include "..\Minecraft.World\net.minecraft.network.h"
class Minecraft;
class MultiPlayerLevel;
class SavedDataStorage;
@@ -48,7 +48,6 @@ private:
std::unordered_set<int> m_trackedEntityIds;
std::unordered_set<int64_t> m_visibleChunks;
bool m_isForkServer; // true when connected to a fork server (received MC|ForkHello)
static int64_t chunkKey(int x, int z) { return ((int64_t)x << 32) | ((int64_t)z & 0xFFFFFFFF); }
+4 -4
View File
@@ -1,9 +1,9 @@
#include "stdafx.h"
#include "Minecraft.h"
#include "../Minecraft.World/net.minecraft.world.level.h"
#include "../Minecraft.World/net.minecraft.world.level.dimension.h"
#include "MultiPlayerLocalPlayer.h"
#include "../Minecraft.World/JavaMath.h"
#include "..\Minecraft.World\net.minecraft.world.level.h"
#include "..\Minecraft.World\net.minecraft.world.level.dimension.h"
#include "MultiplayerLocalPlayer.h"
#include "..\Minecraft.World\JavaMath.h"
#include "Texture.h"
#include "ClockTexture.h"
-2
View File
@@ -105,8 +105,6 @@ enum EGameHostOptionWorldSize
#define GAMESETTING_ANIMATEDCHARACTER 0x00008000
#define GAMESETTING_PS3EULAREAD 0x00010000
#define GAMESETTING_PSVITANETWORKMODEADHOC 0x00020000
#define GAMESETTING_VSYNC 0x01000000
#define GAMESETTING_EXCLUSIVEFULLSCREEN 0x02000000
// defines for languages
-3
View File
@@ -178,9 +178,6 @@ enum eGameSetting
// PSVita
eGameSetting_PSVita_NetworkModeAdhoc,
// PC
eGameSetting_VSync,
eGameSetting_ExclusiveFullscreen,
};
@@ -1,24 +1,24 @@
#pragma once
#include "../../../Minecraft.World/SoundTypes.h"
#include "..\..\..\Minecraft.World\SoundTypes.h"
#ifdef _XBOX
#elif defined (__PS3__)
#undef __in
#undef __out
#include "../../PS3/Miles/include/mss.h"
#include "..\..\PS3\Miles\include\mss.h"
#elif defined (__PSVITA__)
#include "../../PSVITA/Miles/include/mss.h"
#include "..\..\PSVITA\Miles\include\mss.h"
#elif defined _DURANGO
// 4J Stu - Temp define to get Miles to link, can likely be removed when we get a new version of Miles
#define _SEKRIT
#include "../../Durango/Miles/include/mss.h"
#include "..\..\Durango\Miles\include\mss.h"
#elif defined _WINDOWS64
#else // PS4
// 4J Stu - Temp define to get Miles to link, can likely be removed when we get a new version of Miles
#define _SEKRIT2
#include "../../Orbis/Miles/include/mss.h"
#include "..\..\Orbis\Miles\include\mss.h"
#endif
typedef struct
+91 -173
View File
@@ -1,22 +1,20 @@
#include "stdafx.h"
#include "SoundEngine.h"
#include "../Consoles_App.h"
#include "../../MultiPlayerLocalPlayer.h"
#include "../../../Minecraft.World/net.minecraft.world.level.h"
#include "../../Minecraft.World/LevelData.h"
#include "../../Minecraft.World/Mth.h"
#include "../../TexturePackRepository.h"
#include "../../DLCTexturePack.h"
#include "../../MultiPlayerGameMode.h"
#include "../../Minecraft.World/LevelSettings.h"
#include "Common/DLC/DLCAudioFile.h"
#include "..\Consoles_App.h"
#include "..\..\MultiplayerLocalPlayer.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
#include "..\..\Minecraft.World\leveldata.h"
#include "..\..\Minecraft.World\mth.h"
#include "..\..\TexturePackRepository.h"
#include "..\..\DLCTexturePack.h"
#include "Common\DLC\DLCAudioFile.h"
#ifdef __PSVITA__
#include <audioout.h>
#endif
#include "../../Minecraft.Client/Windows64/Windows64_App.h"
#include "..\..\Minecraft.Client\Windows64\Windows64_App.h"
#include "stb_vorbis.h"
@@ -27,7 +25,7 @@
#include <vector>
#include <memory>
#include <mutex>
#include <lce_filesystem/lce_filesystem.h>
#include <lce_filesystem\lce_filesystem.h>
#ifdef __ORBIS__
#include <audioout.h>
@@ -116,9 +114,6 @@ const char *SoundEngine::m_szStreamFileA[eStream_Max]=
"hal4",
"nuance1",
"nuance2",
"piano1",
"piano2",
"piano3",
#ifndef _XBOX
"creative1",
@@ -133,6 +128,10 @@ const char *SoundEngine::m_szStreamFileA[eStream_Max]=
"menu4",
#endif
"piano1",
"piano2",
"piano3",
// Nether
"nether1",
"nether2",
@@ -410,13 +409,6 @@ SoundEngine::SoundEngine()
eStream_end_dragon,eStream_end_end,
eStream_CD_1);
#ifndef _XBOX
m_iStream_Creative_Min = eStream_Overworld_Creative1;
m_iStream_Creative_Max = eStream_Overworld_Creative6;
m_iStream_Menu_Min = eStream_Overworld_Menu1;
m_iStream_Menu_Max = eStream_Overworld_Menu4;
#endif
m_musicID=getMusicID(LevelData::DIMENSION_OVERWORLD);
m_StreamingAudioInfo.bIs3D=false;
@@ -476,69 +468,65 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
sprintf_s(basePath, "Windows64Media/Sound/%s", (char*)szSoundName);
char finalPath[256];
sprintf_s(finalPath, "%s.wav", basePath);
// Check path cache first to avoid expensive filesystem probing
auto cacheIt = m_soundPathCache.find(iSound);
if (cacheIt != m_soundPathCache.end())
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
size_t extCount = sizeof(extensions) / sizeof(extensions[0]);
bool found = false;
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
{
const auto& paths = cacheIt->second;
if (paths.empty())
return; // previously probed, no files found
const std::string& chosen = paths[rand() % paths.size()];
sprintf_s(finalPath, "%s", chosen.c_str());
char basePlusExt[256];
sprintf_s(basePlusExt, "%s%s", basePath, extensions[extIdx]);
DWORD attr = GetFileAttributesA(basePlusExt);
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
{
sprintf_s(finalPath, "%s", basePlusExt);
found = true;
break;
}
}
else
{
// Cache miss — probe filesystem and store results
std::vector<std::string> validPaths;
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
size_t extCount = sizeof(extensions) / sizeof(extensions[0]);
bool found = false;
// Check base name with each extension (non-numbered)
if (!found)
{
int count = 0;
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
{
char basePlusExt[256];
sprintf_s(basePlusExt, "%s%s", basePath, extensions[extIdx]);
DWORD attr = GetFileAttributesA(basePlusExt);
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
for (size_t i = 1; i < 32; i++)
{
validPaths.push_back(basePlusExt);
found = true;
break; // non-numbered: only one base file needed
}
}
if (!found)
{
// Check numbered variants (e.g. sound1.ogg, sound2.ogg, ...)
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
{
for (int i = 1; i < 32; i++)
char numberedPath[256];
sprintf_s(numberedPath, "%s%d%s", basePath, i, extensions[extIdx]);
DWORD attr = GetFileAttributesA(numberedPath);
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
{
char numberedPath[256];
sprintf_s(numberedPath, "%s%d%s", basePath, i, extensions[extIdx]);
DWORD attr = GetFileAttributesA(numberedPath);
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
{
validPaths.push_back(numberedPath);
}
count = i;
}
}
}
m_soundPathCache[iSound] = validPaths;
if (validPaths.empty())
if (count > 0)
{
sprintf_s(finalPath, "%s.wav", basePath); // fallback for debug print
}
else
{
const std::string& chosen = validPaths[rand() % validPaths.size()];
sprintf_s(finalPath, "%s", chosen.c_str());
int chosen = (rand() % count) + 1;
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
{
char numberedPath[256];
sprintf_s(numberedPath, "%s%d%s", basePath, chosen, extensions[extIdx]);
DWORD attr = GetFileAttributesA(numberedPath);
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
{
sprintf_s(finalPath, "%s", numberedPath);
found = true;
break;
}
}
if (!found)
{
sprintf_s(finalPath, "%s%d.wav", basePath, chosen);
}
}
}
@@ -558,7 +546,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
if (ma_sound_init_from_file(
&m_engine,
finalPath,
MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC,
MA_SOUND_FLAG_ASYNC,
nullptr,
nullptr,
&s->sound) != MA_SUCCESS)
@@ -595,62 +583,43 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
{
U8 szSoundName[256];
wstring name;
const char* soundDir;
if (iSound >= eSFX_MAX)
{
strcpy((char*)szSoundName, "Minecraft/");
name = wchSoundNames[iSound];
soundDir = "Minecraft";
}
else
{
strcpy((char*)szSoundName, "Minecraft/UI/");
name = wchUISoundNames[iSound];
soundDir = "Minecraft/UI";
}
char* SoundName = (char*)ConvertSoundPathToName(name);
strcat((char*)szSoundName, SoundName);
char basePath[256];
sprintf_s(basePath, "Windows64Media/Sound/%s/%s", soundDir, ConvertSoundPathToName(name));
sprintf_s(basePath, "Windows64Media/Sound/Minecraft/UI/%s", ConvertSoundPathToName(name));
char finalPath[256];
sprintf_s(finalPath, "%s.wav", basePath);
// Check UI sound path cache first
auto cacheIt = m_uiSoundPathCache.find(iSound);
if (cacheIt != m_uiSoundPathCache.end())
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
size_t count = sizeof(extensions) / sizeof(extensions[0]);
bool found = false;
for (size_t i = 0; i < count; i++)
{
if (cacheIt->second.empty())
sprintf_s(finalPath, "%s%s", basePath, extensions[i]);
if (FileExists(finalPath))
{
app.DebugPrintf("No sound file found for UI sound (cached): %s\n", basePath);
return;
found = true;
break;
}
sprintf_s(finalPath, "%s", cacheIt->second.c_str());
}
else
if (!found)
{
// Cache miss — probe filesystem and store result
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
size_t count = sizeof(extensions) / sizeof(extensions[0]);
bool found = false;
for (size_t i = 0; i < count; i++)
{
sprintf_s(finalPath, "%s%s", basePath, extensions[i]);
if (FileExists(finalPath))
{
found = true;
break;
}
}
if (!found)
{
m_uiSoundPathCache[iSound] = ""; // cache negative result
app.DebugPrintf("No sound file found for UI sound: %s\n", basePath);
return;
}
m_uiSoundPathCache[iSound] = finalPath;
app.DebugPrintf("No sound file found for UI sound: %s\n", basePath);
return;
}
MiniAudioSound* s = new MiniAudioSound();
@@ -664,7 +633,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
if (ma_sound_init_from_file(
&m_engine,
finalPath,
MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC,
MA_SOUND_FLAG_ASYNC,
nullptr,
nullptr,
&s->sound) != MA_SUCCESS)
@@ -817,46 +786,6 @@ int SoundEngine::GetRandomishTrack(int iStart,int iEnd)
app.DebugPrintf("Select track %d\n",iVal);
return iVal;
}
/////////////////////////////////////////////
//
// getOverworldMusicID - selects overworld music based on game mode
//
/////////////////////////////////////////////
int SoundEngine::getOverworldMusicID(Minecraft *pMinecraft)
{
#ifndef _XBOX
// Check if any local player is in creative mode
bool isCreative = false;
for(unsigned int i = 0; i < MAX_LOCAL_PLAYERS; i++)
{
if(pMinecraft->localplayers[i] != nullptr && pMinecraft->localgameModes[i] != nullptr)
{
GameType *mode = pMinecraft->localgameModes[i]->getLocalPlayerMode();
if(mode != nullptr && mode->isCreative())
{
isCreative = true;
break;
}
}
}
if(isCreative)
{
// Creative: survival tracks + creative tracks
int survivalCount = m_iStream_Overworld_Max - m_iStream_Overworld_Min + 1;
int creativeCount = m_iStream_Creative_Max - m_iStream_Creative_Min + 1;
int pick = random->nextInt(survivalCount + creativeCount);
if(pick < survivalCount)
return GetRandomishTrack(m_iStream_Overworld_Min, m_iStream_Overworld_Max);
else
return GetRandomishTrack(m_iStream_Creative_Min, m_iStream_Creative_Max);
}
#endif
// Survival/Adventure: survival tracks only
return GetRandomishTrack(m_iStream_Overworld_Min, m_iStream_Overworld_Max);
}
/////////////////////////////////////////////
//
// getMusicID
@@ -864,33 +793,29 @@ int SoundEngine::getOverworldMusicID(Minecraft *pMinecraft)
/////////////////////////////////////////////
int SoundEngine::getMusicID(int iDomain)
{
int result=-1;
int iRandomVal=0;
Minecraft *pMinecraft=Minecraft::GetInstance();
// Before the game has started?
if(pMinecraft==nullptr)
{
#ifndef _XBOX
// Title screen: play menu music
result = GetRandomishTrack(m_iStream_Menu_Min,m_iStream_Menu_Max);
#else
result = GetRandomishTrack(m_iStream_Overworld_Min,m_iStream_Overworld_Max);
#endif
// any track from the overworld
return GetRandomishTrack(m_iStream_Overworld_Min,m_iStream_Overworld_Max);
}
else if(pMinecraft->skins->isUsingDefaultSkin())
if(pMinecraft->skins->isUsingDefaultSkin())
{
switch(iDomain)
{
case LevelData::DIMENSION_END:
// the end isn't random - it has different music depending on whether the dragon is alive or not, but we've not added the dead dragon music yet
result = m_iStream_End_Min;
break;
return m_iStream_End_Min;
case LevelData::DIMENSION_NETHER:
result = GetRandomishTrack(m_iStream_Nether_Min,m_iStream_Nether_Max);
break;
return GetRandomishTrack(m_iStream_Nether_Min,m_iStream_Nether_Max);
//return m_iStream_Nether_Min + random->nextInt(m_iStream_Nether_Max-m_iStream_Nether_Min);
default: //overworld
result = getOverworldMusicID(pMinecraft);
break;
//return m_iStream_Overworld_Min + random->nextInt(m_iStream_Overworld_Max-m_iStream_Overworld_Min);
return GetRandomishTrack(m_iStream_Overworld_Min,m_iStream_Overworld_Max);
}
}
else
@@ -899,22 +824,15 @@ int SoundEngine::getMusicID(int iDomain)
switch(iDomain)
{
case LevelData::DIMENSION_END:
result = GetRandomishTrack(m_iStream_End_Min,m_iStream_End_Max);
break;
return GetRandomishTrack(m_iStream_End_Min,m_iStream_End_Max);
case LevelData::DIMENSION_NETHER:
result = GetRandomishTrack(m_iStream_Nether_Min,m_iStream_Nether_Max);
break;
//return m_iStream_Nether_Min + random->nextInt(m_iStream_Nether_Max-m_iStream_Nether_Min);
return GetRandomishTrack(m_iStream_Nether_Min,m_iStream_Nether_Max);
default: //overworld
result = getOverworldMusicID(pMinecraft);
break;
//return m_iStream_Overworld_Min + random->nextInt(m_iStream_Overworld_Max-m_iStream_Overworld_Min);
return GetRandomishTrack(m_iStream_Overworld_Min,m_iStream_Overworld_Max);
}
}
#ifdef _DEBUG
if(result >= 0 && result < eStream_Max)
app.DebugPrintf("getMusicID: selected track '%s' (id=%d, domain=%d)\n", m_szStreamFileA[result], result, iDomain);
#endif
return result;
}
/////////////////////////////////////////////
@@ -1579,4 +1497,4 @@ char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpac
return buf;
}
#endif
#endif
+4 -14
View File
@@ -1,13 +1,10 @@
#pragma once
class Minecraft;
class Mob;
class Options;
using namespace std;
#include "..\..\Minecraft.World\SoundTypes.h"
#include "miniaudio.h"
#include <unordered_map>
#include <string>
constexpr float SFX_3D_MIN_DISTANCE = 1.0f;
constexpr float SFX_3D_MAX_DISTANCE = 16.0f;
@@ -26,10 +23,8 @@ enum eMUSICFILES
eStream_Overworld_hal4,
eStream_Overworld_nuance1,
eStream_Overworld_nuance2,
eStream_Overworld_piano1,
eStream_Overworld_piano2,
eStream_Overworld_piano3, // <-- make piano3 the last survival overworld one
#ifndef _XBOX
// Add the new music tracks
eStream_Overworld_Creative1,
eStream_Overworld_Creative2,
eStream_Overworld_Creative3,
@@ -41,6 +36,9 @@ enum eMUSICFILES
eStream_Overworld_Menu3,
eStream_Overworld_Menu4,
#endif
eStream_Overworld_piano1,
eStream_Overworld_piano2,
eStream_Overworld_piano3, // <-- make piano3 the last overworld one
// Nether
eStream_Nether1,
eStream_Nether2,
@@ -136,7 +134,6 @@ public:
bool isStreamingWavebankReady(); // 4J Added
int getMusicID(int iDomain);
int getMusicID(const wstring& name);
int getOverworldMusicID(Minecraft *pMinecraft);
void SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int iNetherMin, int iNetherMax, int iEndMin, int iEndMax, int iCD1);
void updateMiniAudio();
void playMusicUpdate();
@@ -188,15 +185,8 @@ private:
int m_iStream_Nether_Min,m_iStream_Nether_Max;
int m_iStream_End_Min,m_iStream_End_Max;
int m_iStream_CD_1;
#ifndef _XBOX
int m_iStream_Creative_Min, m_iStream_Creative_Max;
int m_iStream_Menu_Min, m_iStream_Menu_Max;
#endif
bool *m_bHeardTrackA;
std::unordered_map<int, std::vector<std::string>> m_soundPathCache; // play(): sound ID → all valid variant paths
std::unordered_map<int, std::string> m_uiSoundPathCache; // playUI(): sound ID → resolved path
#ifdef __ORBIS__
int32_t m_hBGMAudio;
#endif
+22 -24
View File
@@ -187,28 +187,28 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
L"liquid.swim", //eSoundType_LIQUID_SWIM,
L"Mob.horse.land", //eSoundType_MOB_HORSE_LAND,
L"Mob.horse.armor", //eSoundType_MOB_HORSE_ARMOR,
L"Mob.horse.leather", //eSoundType_MOB_HORSE_LEATHER,
L"Mob.horse.zombie.death", //eSoundType_MOB_HORSE_ZOMBIE_DEATH,
L"Mob.horse.skeleton.death", //eSoundType_MOB_HORSE_SKELETON_DEATH,
L"Mob.horse.donkey.death", //eSoundType_MOB_HORSE_DONKEY_DEATH,
L"Mob.horse.death", //eSoundType_MOB_HORSE_DEATH,
L"Mob.horse.zombie.hit", //eSoundType_MOB_HORSE_ZOMBIE_HIT,
L"Mob.horse.skeleton.hit", //eSoundType_MOB_HORSE_SKELETON_HIT,
L"Mob.horse.donkey.hit", //eSoundType_MOB_HORSE_DONKEY_HIT,
L"Mob.horse.hit", //eSoundType_MOB_HORSE_HIT,
L"Mob.horse.zombie.idle", //eSoundType_MOB_HORSE_ZOMBIE_IDLE,
L"Mob.horse.skeleton.idle", //eSoundType_MOB_HORSE_SKELETON_IDLE,
L"Mob.horse.donkey.idle", //eSoundType_MOB_HORSE_DONKEY_IDLE,
L"Mob.horse.idle", //eSoundType_MOB_HORSE_IDLE,
L"Mob.horse.donkey.angry", //eSoundType_MOB_HORSE_DONKEY_ANGRY,
L"Mob.horse.angry", //eSoundType_MOB_HORSE_ANGRY,
L"Mob.horse.gallop", //eSoundType_MOB_HORSE_GALLOP,
L"Mob.horse.breathe", //eSoundType_MOB_HORSE_BREATHE,
L"Mob.horse.wood", //eSoundType_MOB_HORSE_WOOD,
L"Mob.horse.soft", //eSoundType_MOB_HORSE_SOFT,
L"Mob.horse.jump", //eSoundType_MOB_HORSE_JUMP,
L"mob.horse.land", //eSoundType_MOB_HORSE_LAND,
L"mob.horse.armor", //eSoundType_MOB_HORSE_ARMOR,
L"mob.horse.leather", //eSoundType_MOB_HORSE_LEATHER,
L"mob.horse.zombie.death", //eSoundType_MOB_HORSE_ZOMBIE_DEATH,
L"mob.horse.skeleton.death", //eSoundType_MOB_HORSE_SKELETON_DEATH,
L"mob.horse.donkey.death", //eSoundType_MOB_HORSE_DONKEY_DEATH,
L"mob.horse.death", //eSoundType_MOB_HORSE_DEATH,
L"mob.horse.zombie.hit", //eSoundType_MOB_HORSE_ZOMBIE_HIT,
L"mob.horse.skeleton.hit", //eSoundType_MOB_HORSE_SKELETON_HIT,
L"mob.horse.donkey.hit", //eSoundType_MOB_HORSE_DONKEY_HIT,
L"mob.horse.hit", //eSoundType_MOB_HORSE_HIT,
L"mob.horse.zombie.idle", //eSoundType_MOB_HORSE_ZOMBIE_IDLE,
L"mob.horse.skeleton.idle", //eSoundType_MOB_HORSE_SKELETON_IDLE,
L"mob.horse.donkey.idle", //eSoundType_MOB_HORSE_DONKEY_IDLE,
L"mob.horse.idle", //eSoundType_MOB_HORSE_IDLE,
L"mob.horse.donkey.angry", //eSoundType_MOB_HORSE_DONKEY_ANGRY,
L"mob.horse.angry", //eSoundType_MOB_HORSE_ANGRY,
L"mob.horse.gallop", //eSoundType_MOB_HORSE_GALLOP,
L"mob.horse.breathe", //eSoundType_MOB_HORSE_BREATHE,
L"mob.horse.wood", //eSoundType_MOB_HORSE_WOOD,
L"mob.horse.soft", //eSoundType_MOB_HORSE_SOFT,
L"mob.horse.jump", //eSoundType_MOB_HORSE_JUMP,
L"mob.witch.ambient", //eSoundType_MOB_WITCH_IDLE,
L"mob.witch.hurt", //eSoundType_MOB_WITCH_HURT,
@@ -223,8 +223,6 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
// 4J-PB - Some sounds were updated, but we can't do that for the 360 or we have to do a new sound bank
// instead, we'll add the sounds as new ones and change the code to reference them
L"fire.new_ignite",
L"damage.critical", //eSoundType_DAMAGE_CRITICAL,
};
@@ -1,7 +1,7 @@
#pragma once
#include "../Minecraft.Client/Common/C4JMemoryPool.h"
#include "..\Minecraft.Client\Common\C4JMemoryPool.h"
// Custom allocator, takes a C4JMemoryPool class, which can be one of a number of pool implementations.
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "ColourTable.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
unordered_map<wstring,eMinecraftColour> ColourTable::s_colourNamesMap;
+28
View File
@@ -0,0 +1,28 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommonMedia", "CommonMedia.vcxproj", "{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}"
EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = http://tfs_server:8080/tfs/storiespark
SccProjectUniqueName0 = CommonMedia.vcxproj
SccLocalPath0 = .
SccLocalPath1 = .
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Debug|Win32.ActiveCfg = Debug|Win32
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Debug|Win32.Build.0 = Debug|Win32
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Release|Win32.ActiveCfg = Release|Win32
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+115
View File
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<None Include="Media\ChestMenu720.swf" />
<None Include="Media\CreateWorldMenu720.swf" />
<None Include="Media\CreativeMenu720.swf" />
<None Include="Media\DebugMenu720.swf" />
<None Include="Media\FullscreenProgress720.swf" />
<None Include="Media\HUD720.swf" />
<None Include="Media\InventoryMenu720.swf" />
<None Include="Media\languages.loc" />
<None Include="Media\LaunchMoreOptionsMenu720.swf" />
<None Include="Media\LoadMenu720.swf" />
<None Include="Media\LoadOrJoinMenu720.swf" />
<None Include="Media\MainMenu720.swf" />
<None Include="Media\media.arc" />
<None Include="Media\Panorama720.swf" />
<None Include="Media\PauseMenu720.swf" />
<None Include="Media\skin.swf" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Media\strings.resx" />
</ItemGroup>
<ItemGroup>
<Text Include="Media\media.txt" />
<Text Include="Media\strings_begin.txt" />
<Text Include="Media\strings_Controls.txt" />
<Text Include="Media\strings_Credits.txt" />
<Text Include="Media\strings_Descriptions.txt" />
<Text Include="Media\strings_end.txt" />
<Text Include="Media\strings_HowToPlay.txt" />
<Text Include="Media\strings_ItemsAndTiles.txt" />
<Text Include="Media\strings_Misc.txt" />
<Text Include="Media\strings_PotionsAndEnchantments.txt" />
<Text Include="Media\strings_Tips.txt" />
<Text Include="Media\strings_Tooltips.txt" />
<Text Include="Media\strings_Tutorial.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Durango\strings.h" />
<ClInclude Include="..\Orbis\strings.h" />
<ClInclude Include="..\PS3\strings.h" />
<ClInclude Include="..\Windows64\strings.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
<SccProjectName>SAK</SccProjectName>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeBuildCommandLine>echo Creating languages.loc
copy .\Media\strings.resx .\Media\en-EN.lang
copy .\Media\fr-FR\strings.resx .\Media\fr-FR\fr-FR.lang
copy .\Media\ja-JP\strings.resx .\Media\ja-JP\ja-JP.lang
..\..\..\Tools\NewLocalisationPacker.exe --static .\Media .\Media\languages.loc
echo Making archive
..\..\..\Tools\ArchiveFilePacker.exe -cd $(ProjectDir)\Media media.arc media.txt
echo Copying Durango strings.h
copy .\Media\strings.h ..\Durango\strings.h
echo Copying PS3 strings.h
copy .\Media\strings.h ..\PS3\strings.h
echo Copying PS4 strings.h
copy .\Media\strings.h ..\Orbis\strings.h
echo Copying Win strings.h
copy .\Media\strings.h ..\Windows64\strings.h</NMakeBuildCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="IggyMedia">
<UniqueIdentifier>{55c7ab2e-b3e5-4aed-9ffe-3308591d9c34}</UniqueIdentifier>
</Filter>
<Filter Include="Strings">
<UniqueIdentifier>{eaa0eb72-0b27-4080-ad53-f68e42f37ba8}</UniqueIdentifier>
</Filter>
<Filter Include="Archive">
<UniqueIdentifier>{711ad95b-eb56-4e18-b001-34ad7b8075a3}</UniqueIdentifier>
</Filter>
<Filter Include="Archive\Win64">
<UniqueIdentifier>{1432ec3d-c5d0-46da-91b6-e7737095a97e}</UniqueIdentifier>
</Filter>
<Filter Include="Archive\PS4">
<UniqueIdentifier>{4b2aeaf1-04d7-454d-b2d9-08364799831c}</UniqueIdentifier>
</Filter>
<Filter Include="Archive\PS3">
<UniqueIdentifier>{4b0eaef6-fa2f-4605-b0da-a81ffb5659bc}</UniqueIdentifier>
</Filter>
<Filter Include="Archive\Durango">
<UniqueIdentifier>{bf1c74da-21f1-4bdd-98ed-83457946e4cc}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="Media\ChestMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\CreateWorldMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\CreativeMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\DebugMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\FullscreenProgress720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\HUD720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\InventoryMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\media.arc">
<Filter>Archive</Filter>
</None>
<None Include="Media\languages.loc">
<Filter>Archive</Filter>
</None>
<None Include="Media\skin.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\MainMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\Panorama720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\LoadOrJoinMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\LaunchMoreOptionsMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\LoadMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
<None Include="Media\PauseMenu720.swf">
<Filter>IggyMedia</Filter>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Media\strings.resx">
<Filter>Strings</Filter>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Text Include="Media\strings_begin.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_Controls.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_Credits.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_Descriptions.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_end.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_HowToPlay.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_ItemsAndTiles.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_Misc.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_PotionsAndEnchantments.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_Tips.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_Tooltips.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\strings_Tutorial.txt">
<Filter>Strings</Filter>
</Text>
<Text Include="Media\media.txt">
<Filter>Archive</Filter>
</Text>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Durango\strings.h">
<Filter>Archive\Durango</Filter>
</ClInclude>
<ClInclude Include="..\PS3\strings.h">
<Filter>Archive\PS3</Filter>
</ClInclude>
<ClInclude Include="..\Orbis\strings.h">
<Filter>Archive\PS4</Filter>
</ClInclude>
<ClInclude Include="..\Windows64\strings.h">
<Filter>Archive\Win64</Filter>
</ClInclude>
</ItemGroup>
</Project>
+1 -1
View File
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "ConsoleGameMode.h"
#include "./Tutorial/Tutorial.h"
#include ".\Tutorial\Tutorial.h"
ConsoleGameMode::ConsoleGameMode(int iPad, Minecraft *minecraft, ClientConnection *connection)
: TutorialMode(iPad, minecraft, connection)
+1 -1
View File
@@ -1,5 +1,5 @@
#pragma once
#include "./Tutorial/TutorialMode.h"
#include ".\Tutorial\TutorialMode.h"
class ConsoleGameMode : public TutorialMode
{
+1 -1
View File
@@ -1,6 +1,6 @@
#include "stdafx.h"
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#include "../../Minecraft.Server/ServerLogManager.h"
#include "..\..\Minecraft.Server\ServerLogManager.h"
#endif
//--------------------------------------------------------------------------------------
+59 -239
View File
@@ -1,66 +1,66 @@
#include "stdafx.h"
#include "../../Minecraft.World/net.minecraft.world.entity.item.h"
#include "../../Minecraft.World/net.minecraft.world.entity.player.h"
#include "../../Minecraft.World/net.minecraft.world.level.tile.entity.h"
#include "../../Minecraft.World/net.minecraft.world.phys.h"
#include "../../Minecraft.World/InputOutputStream.h"
#include "../../Minecraft.World/compression.h"
#include "../Options.h"
#include "../MinecraftServer.h"
#include "../MultiPlayerLevel.h"
#include "../GameRenderer.h"
#include "../ProgressRenderer.h"
#include "../LevelRenderer.h"
#include "../MobSkinMemTextureProcessor.h"
#include "../Minecraft.h"
#include "../ClientConnection.h"
#include "../MultiPlayerLocalPlayer.h"
#include "../LocalPlayer.h"
#include "../../Minecraft.World/Player.h"
#include "../../Minecraft.World/Inventory.h"
#include "../../Minecraft.World/Level.h"
#include "../../Minecraft.World/FurnaceTileEntity.h"
#include "../../Minecraft.World/Container.h"
#include "../../Minecraft.World/DispenserTileEntity.h"
#include "../../Minecraft.World/SignTileEntity.h"
#include "../StatsCounter.h"
#include "../GameMode.h"
#include "../Xbox/Social/SocialManager.h"
#include "Tutorial/TutorialMode.h"
#include "..\..\Minecraft.World\net.minecraft.world.entity.item.h"
#include "..\..\Minecraft.World\net.minecraft.world.entity.player.h"
#include "..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
#include "..\..\Minecraft.World\net.minecraft.world.phys.h"
#include "..\..\Minecraft.World\InputOutputStream.h"
#include "..\..\Minecraft.World\compression.h"
#include "..\Options.h"
#include "..\MinecraftServer.h"
#include "..\MultiPlayerLevel.h"
#include "..\GameRenderer.h"
#include "..\ProgressRenderer.h"
#include "..\LevelRenderer.h"
#include "..\MobSkinMemTextureProcessor.h"
#include "..\Minecraft.h"
#include "..\ClientConnection.h"
#include "..\MultiPlayerLocalPlayer.h"
#include "..\LocalPlayer.h"
#include "..\..\Minecraft.World\Player.h"
#include "..\..\Minecraft.World\Inventory.h"
#include "..\..\Minecraft.World\Level.h"
#include "..\..\Minecraft.World\FurnaceTileEntity.h"
#include "..\..\Minecraft.World\Container.h"
#include "..\..\Minecraft.World\DispenserTileEntity.h"
#include "..\..\Minecraft.World\SignTileEntity.h"
#include "..\StatsCounter.h"
#include "..\GameMode.h"
#include "..\Xbox\Social\SocialManager.h"
#include "Tutorial\TutorialMode.h"
#if defined _XBOX || defined _WINDOWS64
#include "../Xbox/XML/ATGXmlParser.h"
#include "../Xbox/XML/xmlFilesCallback.h"
#include "..\Xbox\XML\ATGXmlParser.h"
#include "..\Xbox\XML\xmlFilesCallback.h"
#endif
#include "Minecraft_Macros.h"
#include "../PlayerList.h"
#include "../ServerPlayer.h"
#include "GameRules/ConsoleGameRules.h"
#include "GameRules/ConsoleSchematicFile.h"
#include "../User.h"
#include "../../Minecraft.World/LevelData.h"
#include "..\PlayerList.h"
#include "..\ServerPlayer.h"
#include "GameRules\ConsoleGameRules.h"
#include "GameRules\ConsoleSchematicFile.h"
#include "..\User.h"
#include "..\..\Minecraft.World\LevelData.h"
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#include "../../Minecraft.Server/ServerLogManager.h"
#include "..\..\Minecraft.Server\ServerLogManager.h"
#endif
#include "../../Minecraft.World/net.minecraft.world.entity.player.h"
#include "../EntityRenderDispatcher.h"
#include "../../Minecraft.World/compression.h"
#include "../TexturePackRepository.h"
#include "../DLCTexturePack.h"
#include "DLC/DLCPack.h"
#include "../StringTable.h"
#include "..\..\Minecraft.World\net.minecraft.world.entity.player.h"
#include "..\EntityRenderDispatcher.h"
#include "..\..\Minecraft.World\compression.h"
#include "..\TexturePackRepository.h"
#include "..\DLCTexturePack.h"
#include "DLC\DLCPack.h"
#include "..\StringTable.h"
#ifndef _XBOX
#include "../ArchiveFile.h"
#include "..\ArchiveFile.h"
#endif
#include "../Minecraft.h"
#include "..\Minecraft.h"
#ifdef _XBOX
#include "../Xbox/GameConfig/Minecraft.spa.h"
#include "../Xbox/Network/NetworkPlayerXbox.h"
#include "XUI/XUI_TextEntry.h"
#include "XUI/XUI_XZP_Icons.h"
#include "XUI/XUI_PauseMenu.h"
#include "..\Xbox\GameConfig\Minecraft.spa.h"
#include "..\Xbox\Network\NetworkPlayerXbox.h"
#include "XUI\XUI_TextEntry.h"
#include "XUI\XUI_XZP_Icons.h"
#include "XUI\XUI_PauseMenu.h"
#else
#include "UI/UI.h"
#include "UI/UIScene_PauseMenu.h"
#include "UI\UI.h"
#include "UI\UIScene_PauseMenu.h"
#endif
#ifdef __PS3__
#include <sys/tty.h>
@@ -69,8 +69,7 @@
#include <save_data_dialog.h>
#endif
#include "../Common/Leaderboards/LeaderboardManager.h"
#include <regex>
#include "..\Common\Leaderboards\LeaderboardManager.h"
//CMinecraftApp app;
unsigned int CMinecraftApp::m_uiLastSignInData = 0;
@@ -96,7 +95,7 @@ CMinecraftApp::CMinecraftApp()
// 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES in Xbox_App.h
DebugPrintf("WARNING: The size of the profile GAME_SETTINGS struct has changed, so all stat data is likely incorrect. Is: %d, Should be: %d\n",sizeof(GAME_SETTINGS),GAME_SETTINGS_PROFILE_DATA_BYTES);
#ifndef _CONTENT_PACKAGE
DEBUG_BREAK();
__debugbreak();
#endif
}
@@ -188,7 +187,6 @@ CMinecraftApp::CMinecraftApp()
#endif
ZeroMemory(m_playerColours,MINECRAFT_NET_MAX_PLAYERS);
ZeroMemory(m_playerMapIcons,MINECRAFT_NET_MAX_PLAYERS);
m_iDLCOfferC=0;
m_bAllDLCContentRetrieved=true;
@@ -208,8 +206,6 @@ CMinecraftApp::CMinecraftApp()
m_dwRequiredTexturePackID=0;
m_bResetNether=false;
m_seedOverride = 0;
m_hasSeedOverride = false;
#ifdef _XBOX
// m_bTransferSavesToXboxOne=false;
@@ -1303,6 +1299,9 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat
{
// This might be from a version during testing of new profile updates
app.DebugPrintf("Don't know what to do with this profile version!\n");
#ifndef _CONTENT_PACKAGE
// __debugbreak();
#endif
GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData;
pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu
@@ -1383,7 +1382,6 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad)
ActionGameSettings(iPad,eGameSetting_AnimatedCharacter);
ActionGameSettings(iPad,eGameSetting_PS3_EULA_Read);
ActionGameSettings(iPad,eGameSetting_VSync);
}
@@ -1619,22 +1617,6 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
case eGameSetting_PSVita_NetworkModeAdhoc:
//nothing to do here
break;
case eGameSetting_VSync:
#ifdef _WINDOWS64
{
extern bool g_bVSync;
g_bVSync = (GetGameSettings(iPad, eGameSetting_VSync) != 0);
}
#endif
break;
case eGameSetting_ExclusiveFullscreen:
#ifdef _WINDOWS64
{
extern void SetExclusiveFullscreen(bool enabled);
SetExclusiveFullscreen(GetGameSettings(iPad, eGameSetting_ExclusiveFullscreen) != 0);
}
#endif
break;
}
}
@@ -2346,38 +2328,6 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV
}
break;
case eGameSetting_VSync:
if(((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_VSYNC)>>24)!=(ucVal&0x01))
{
if(ucVal==1)
{
GameSettingsA[iPad]->uiBitmaskValues|=GAMESETTING_VSYNC;
}
else
{
GameSettingsA[iPad]->uiBitmaskValues&=~GAMESETTING_VSYNC;
}
ActionGameSettings(iPad,eVal);
GameSettingsA[iPad]->bSettingsChanged=true;
}
break;
case eGameSetting_ExclusiveFullscreen:
if(((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_EXCLUSIVEFULLSCREEN)>>25)!=(ucVal&0x01))
{
if(ucVal==1)
{
GameSettingsA[iPad]->uiBitmaskValues|=GAMESETTING_EXCLUSIVEFULLSCREEN;
}
else
{
GameSettingsA[iPad]->uiBitmaskValues&=~GAMESETTING_EXCLUSIVEFULLSCREEN;
}
ActionGameSettings(iPad,eVal);
GameSettingsA[iPad]->bSettingsChanged=true;
}
break;
}
}
@@ -2513,12 +2463,6 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal)
case eGameSetting_PSVita_NetworkModeAdhoc:
return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_PSVITANETWORKMODEADHOC)>>17;
case eGameSetting_VSync:
return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_VSYNC)>>24;
case eGameSetting_ExclusiveFullscreen:
return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_EXCLUSIVEFULLSCREEN)>>25;
}
return 0;
}
@@ -6476,7 +6420,7 @@ void CMinecraftApp::InitialiseTips()
{
// the m_TriviaTipA or the m_GameTipA are out of sync
#ifndef _CONTENT_PACKAGE
DEBUG_BREAK();
__debugbreak();
#endif
}
}
@@ -6651,97 +6595,6 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
return text;
}
//found list of html escapes at https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html
wstring CMinecraftApp::EscapeHTMLString(const wstring& desc)
{
static std::unordered_map<wchar_t, wchar_t*> replacementMap = {
{L'&', L"&amp;"},
{L'<', L"&lt;"},
{L'>', L"&gt;"},
};
wstring finalString = L"";
for (int i = 0; i < desc.size(); i++) {
wchar_t _char = desc[i];
auto it = replacementMap.find(_char);
if (it != replacementMap.end()) finalString += it->second;
else finalString += _char;
}
return finalString;
}
wstring CMinecraftApp::FormatChatMessage(const wstring& desc, bool applyStyling)
{
static std::wregex IDS_Pattern(LR"(\{\*IDS_(\d+)\*\})"); //maybe theres a better way to do translateable IDS
static std::wstring_view colorFormatString = L"<font color=\"#%08x\">";
wstring results = desc;
wchar_t replacements[64];
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_0), 0xFFFFFFFF);
results = replaceAll(results, L"§0", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_1), 0xFFFFFFFF);
results = replaceAll(results, L"§1", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_2), 0xFFFFFFFF);
results = replaceAll(results, L"§2", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_3), 0xFFFFFFFF);
results = replaceAll(results, L"§3", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_4), 0xFFFFFFFF);
results = replaceAll(results, L"§4", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_5), 0xFFFFFFFF);
results = replaceAll(results, L"§5", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_6), 0xFFFFFFFF);
results = replaceAll(results, L"§6", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_7), 0xFFFFFFFF);
results = replaceAll(results, L"§7", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_8), 0xFFFFFFFF);
results = replaceAll(results, L"§8", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_9), 0xFFFFFFFF);
results = replaceAll(results, L"§9", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_a), 0xFFFFFFFF);
results = replaceAll(results, L"§a", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_b), 0xFFFFFFFF);
results = replaceAll(results, L"§b", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_c), 0xFFFFFFFF);
results = replaceAll(results, L"§c", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_d), 0xFFFFFFFF);
results = replaceAll(results, L"§d", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_e), 0xFFFFFFFF);
results = replaceAll(results, L"§e", replacements);
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_f), 0xFFFFFFFF);
results = replaceAll(results, L"§f", replacements);
results = replaceAll(results, L"§r", replacements); //we only support color so reset is the same as white color
results = replaceAll(results, L"'", L"\u2019");
if (applyStyling) {
std::wsmatch match;
while (std::regex_search(results, match, IDS_Pattern)) {
results = replaceAll(results, match[0], app.GetString(std::stoi(match[1].str())));
}
}
return results;
}
wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction)
{
unsigned int input = InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad) ,ucAction);
@@ -8623,39 +8476,6 @@ short CMinecraftApp::GetPlayerColour(BYTE networkSmallId)
return index;
}
void CMinecraftApp::SetPlayerMapIcon(const wchar_t* name, char icon)
{
if (name == nullptr) return;
// Update existing entry or use first empty slot
int emptySlot = -1;
for (int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
{
if (m_playerMapIcons[i].name[0] != 0 && _wcsicmp(m_playerMapIcons[i].name, name) == 0)
{
m_playerMapIcons[i].icon = icon;
return;
}
if (emptySlot < 0 && m_playerMapIcons[i].name[0] == 0)
emptySlot = i;
}
if (emptySlot >= 0)
{
wcsncpy_s(m_playerMapIcons[emptySlot].name, 32, name, _TRUNCATE);
m_playerMapIcons[emptySlot].icon = icon;
}
}
char CMinecraftApp::GetPlayerMapIconByName(const wchar_t* name)
{
if (name == nullptr) return 0;
for (int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
{
if (m_playerMapIcons[i].name[0] != 0 && _wcsicmp(m_playerMapIcons[i].name, name) == 0)
return m_playerMapIcons[i].icon;
}
return 0;
}
unsigned int CMinecraftApp::GetPlayerPrivileges(BYTE networkSmallId)
{
+12 -24
View File
@@ -5,23 +5,23 @@ using namespace std;
#include "Audio/Consoles_SoundEngine.h"
#include <xuiapp.h>
#include "./Tutorial/TutorialEnum.h"
#include ".\Tutorial\TutorialEnum.h"
#ifdef _XBOX
#include "./XUI/XUI_Helper.h"
#include "./XUI/XUI_HelpCredits.h"
#include ".\XUI\XUI_Helper.h"
#include ".\XUI\XUI_HelpCredits.h"
#endif
#include "UI/UIStructs.h"
#include "UI\UIStructs.h"
#include "../../Minecraft.World/DisconnectPacket.h"
#include "..\..\Minecraft.World\DisconnectPacket.h"
#include <xsocialpost.h>
#include "../StringTable.h"
#include "./DLC/DLCManager.h"
#include "./GameRules/ConsoleGameRulesConstants.h"
#include "./GameRules/GameRuleManager.h"
#include "../SkinBox.h"
#include "../ArchiveFile.h"
#include "..\StringTable.h"
#include ".\DLC\DLCManager.h"
#include ".\GameRules\ConsoleGameRulesConstants.h"
#include ".\GameRules\GameRuleManager.h"
#include "..\SkinBox.h"
#include "..\ArchiveFile.h"
typedef struct _JoinFromInviteData
{
@@ -564,9 +564,7 @@ public:
int GetHTMLColour(eMinecraftColour colour);
int GetHTMLColor(eMinecraftColour colour) { return GetHTMLColour(colour); }
int GetHTMLFontSize(EHTMLFontSize size);
wstring FormatHTMLString(int iPad, const wstring& desc, int shadowColour = 0xFFFFFFFF);
wstring EscapeHTMLString(const wstring &desc);
wstring FormatChatMessage(const wstring& desc, bool applyStyling = true);
wstring FormatHTMLString(int iPad, const wstring &desc, int shadowColour = 0xFFFFFFFF);
wstring GetActionReplacement(int iPad, unsigned char ucAction);
wstring GetVKReplacement(unsigned int uiVKey);
wstring GetIconReplacement(unsigned int uiIcon);
@@ -708,8 +706,6 @@ private:
bool m_bGameNewWorldSizeUseMoat;
unsigned int m_GameNewHellScale;
#endif
int64_t m_seedOverride;
bool m_hasSeedOverride;
unsigned int FromBigEndian(unsigned int uiValue);
public:
@@ -727,10 +723,6 @@ public:
void SetGameNewHellScale(unsigned int newScale) { m_GameNewHellScale = newScale; }
unsigned int GetGameNewHellScale() { return m_GameNewHellScale; }
#endif
void SetSeedOverride(int64_t seed) { m_seedOverride = seed; m_hasSeedOverride = true; }
bool HasSeedOverride() { return m_hasSeedOverride; }
int64_t GetSeedOverride() { return m_seedOverride; }
void SetResetNether(bool bResetNether) {m_bResetNether=bResetNether;}
bool GetResetNether() {return m_bResetNether;}
bool CanRecordStatsAndAchievements();
@@ -755,14 +747,10 @@ public:
private:
BYTE m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's
unsigned int m_playerGamePrivileges[MINECRAFT_NET_MAX_PLAYERS];
struct PlayerMapIconEntry { wchar_t name[32]; char icon; };
PlayerMapIconEntry m_playerMapIcons[MINECRAFT_NET_MAX_PLAYERS];
public:
void UpdatePlayerInfo(BYTE networkSmallId, SHORT playerColourIndex, unsigned int playerGamePrivileges);
short GetPlayerColour(BYTE networkSmallId);
void SetPlayerMapIcon(const wchar_t* name, char icon);
char GetPlayerMapIconByName(const wchar_t* name);
unsigned int GetPlayerPrivileges(BYTE networkSmallId);
wstring getEntityName(eINSTANCEOF type);
+2 -2
View File
@@ -2,8 +2,8 @@
#include "DLCManager.h"
#include "DLCAudioFile.h"
#if defined _XBOX || defined _WINDOWS64
#include "../../Xbox/XML/ATGXmlParser.h"
#include "../../Xbox/XML/xmlFilesCallback.h"
#include "..\..\Xbox\XML\ATGXmlParser.h"
#include "..\..\Xbox\XML\xmlFilesCallback.h"
#endif
DLCAudioFile::DLCAudioFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Audio,path)
@@ -1,9 +1,9 @@
#include "stdafx.h"
#include "DLCManager.h"
#include "DLCColourTableFile.h"
#include "../../Minecraft.h"
#include "../../TexturePackRepository.h"
#include "../../TexturePack.h"
#include "..\..\Minecraft.h"
#include "..\..\TexturePackRepository.h"
#include "..\..\TexturePack.h"
DLCColourTableFile::DLCColourTableFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_ColourTable,path)
{
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "DLCFile.h"
#include "../GameRules/LevelGenerationOptions.h"
#include "..\GameRules\LevelGenerationOptions.h"
class DLCGameRules : public DLCFile
{
@@ -2,9 +2,9 @@
#include <string>
#include "../../../Minecraft.World/File.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/InputOutputStream.h"
#include "..\..\..\Minecraft.World\File.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\InputOutputStream.h"
#include "DLCManager.h"
#include "DLCGameRulesHeader.h"
@@ -1,7 +1,7 @@
#pragma once
#include "DLCGameRules.h"
#include "../GameRules/LevelGenerationOptions.h"
#include "..\GameRules\LevelGenerationOptions.h"
class DLCGameRulesHeader : public DLCGameRules, public JustGrSource
{
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "DLCManager.h"
#include "DLCLocalisationFile.h"
#include "../../StringTable.h"
#include "..\..\StringTable.h"
DLCLocalisationFile::DLCLocalisationFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_LocalisationData,path)
{
+13 -50
View File
@@ -3,14 +3,13 @@
#include "DLCManager.h"
#include "DLCPack.h"
#include "DLCFile.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../Minecraft.h"
#include "../../TexturePackRepository.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\Minecraft.h"
#include "..\..\TexturePackRepository.h"
#include "Common/UI/UI.h"
const WCHAR *DLCManager::wchTypeNamesA[]=
{
L"XMLVERSION",
L"DISPLAYNAME",
L"THEMENAME",
L"FREE",
@@ -171,7 +170,7 @@ DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/)
if(index >= m_packs.size())
{
app.DebugPrintf("DLCManager: Trying to access a DLC pack beyond the range of valid packs\n");
DEBUG_BREAK();
__debugbreak();
}
pack = m_packs[index];
}
@@ -186,6 +185,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
if(pack == nullptr)
{
app.DebugPrintf("DLCManager: Attempting to find the index for a nullptr pack\n");
//__debugbreak();
return foundIndex;
}
if( type != e_DLCType_All )
@@ -387,65 +387,41 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
// // unsigned long, p = number of parameters
// // p * DLC_FILE_PARAM describing each parameter for this file
// // ulFileSize bytes of data blob of the file added
unsigned int uiVersion=readUInt32(pbData, false);
unsigned int uiVersion=*(unsigned int *)pbData;
uiCurrentByte+=sizeof(int);
bool bSwapEndian = false;
unsigned int uiVersionSwapped = SwapInt32(uiVersion);
if (uiVersion >= 0 && uiVersion <= CURRENT_DLC_VERSION_NUM) {
bSwapEndian = false;
} else if (uiVersionSwapped >= 0 && uiVersionSwapped <= CURRENT_DLC_VERSION_NUM) {
bSwapEndian = true;
} else {
if(pbData!=nullptr) delete [] pbData;
app.DebugPrintf("Unknown DLC version of %d\n", uiVersion);
if(uiVersion < CURRENT_DLC_VERSION_NUM)
{
if(pbData!=nullptr) delete [] pbData;
app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion);
return false;
}
pack->SetDataPointer(pbData);
unsigned int uiParameterCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte];
uiCurrentByte+=sizeof(int);
C4JStorage::DLC_FILE_PARAM *pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
bool bXMLVersion = false;
//DWORD dwwchCount=0;
for(unsigned int i=0;i<uiParameterCount;i++)
{
pParams->dwType = bSwapEndian ? SwapInt32(pParams->dwType) : pParams->dwType;
pParams->dwWchCount = bSwapEndian ? SwapInt32(pParams->dwWchCount) : pParams->dwWchCount;
char16_t* wchData = reinterpret_cast<char16_t*>(pParams->wchData);
if (bSwapEndian) {
SwapUTF16Bytes(wchData, pParams->dwWchCount);
}
// Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName(static_cast<WCHAR *>(pParams->wchData));
EDLCParameterType type = getParameterType(parameterName);
if( type != e_DLCParamType_Invalid )
{
parameterMapping[pParams->dwType] = type;
if (type == e_DLCParamType_XMLVersion)
{
bXMLVersion = true;
}
}
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR));
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
}
//ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
if (bXMLVersion)
{
uiCurrentByte += sizeof(int);
}
unsigned int uiFileCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
unsigned int uiFileCount=*(unsigned int *)&pbData[uiCurrentByte];
uiCurrentByte+=sizeof(int);
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
DWORD dwTemp=uiCurrentByte;
for(unsigned int i=0;i<uiFileCount;i++)
{
pFile->dwWchCount = bSwapEndian ? SwapInt32(pFile->dwWchCount) : pFile->dwWchCount;
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
}
@@ -454,13 +430,6 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
for(unsigned int i=0;i<uiFileCount;i++)
{
pFile->dwType = bSwapEndian ? SwapInt32(pFile->dwType) : pFile->dwType;
pFile->uiFileSize = bSwapEndian ? SwapInt32(pFile->uiFileSize) : pFile->uiFileSize;
char16_t* wchFile = reinterpret_cast<char16_t*>(pFile->wchFile);
if (bSwapEndian) {
SwapUTF16Bytes(wchFile, pFile->dwWchCount);
}
EDLCType type = static_cast<EDLCType>(pFile->dwType);
DLCFile *dlcFile = nullptr;
@@ -476,18 +445,12 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
}
// Params
uiParameterCount=readUInt32(pbTemp, bSwapEndian);
uiParameterCount=*(unsigned int *)pbTemp;
pbTemp+=sizeof(int);
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
for(unsigned int j=0;j<uiParameterCount;j++)
{
//DLCManager::EDLCParameterType paramType = DLCManager::e_DLCParamType_Invalid;
pParams->dwType = bSwapEndian ? SwapInt32(pParams->dwType) : pParams->dwType;
pParams->dwWchCount = bSwapEndian ? SwapInt32(pParams->dwWchCount) : pParams->dwWchCount;
char16_t* wchData = reinterpret_cast<char16_t*>(pParams->wchData);
if (bSwapEndian) {
SwapUTF16Bytes(wchData, pParams->dwWchCount);
}
auto it = parameterMapping.find(pParams->dwType);
+1 -26
View File
@@ -31,8 +31,7 @@ public:
{
e_DLCParamType_Invalid = -1,
e_DLCParamType_XMLVersion = 0,
e_DLCParamType_DisplayName,
e_DLCParamType_DisplayName = 0,
e_DLCParamType_ThemeName,
e_DLCParamType_Free, // identify free skins
e_DLCParamType_Credit, // legal credits for DLC
@@ -95,30 +94,6 @@ public:
bool readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false);
DWORD retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack);
static unsigned short SwapInt16(unsigned short value) {
return (value >> 8) | (value << 8);
}
static unsigned int SwapInt32(unsigned int value) {
return ((value & 0xFF) << 24) |
((value & 0xFF00) << 8) |
((value & 0xFF0000) >> 8) |
((value & 0xFF000000) >> 24);
}
static void SwapUTF16Bytes(char16_t* buffer, size_t count) {
for (size_t i = 0; i < count; ++i) {
char16_t& c = buffer[i];
c = (c >> 8) | (c << 8);
}
}
static unsigned int readUInt32(unsigned char* ptr, bool endian) {
unsigned int val = *(unsigned int*)ptr;
if (endian) val = SwapInt32(val);
return val;
}
private:
bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack);
+6 -3
View File
@@ -9,7 +9,7 @@
#include "DLCGameRulesHeader.h"
#include "DLCAudioFile.h"
#include "DLCColourTableFile.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
DLCPack::DLCPack(const wstring &name,DWORD dwLicenseMask)
{
@@ -107,7 +107,7 @@ void DLCPack::addChildPack(DLCPack *childPack)
#ifndef _CONTENT_PACKAGE
if(packId < 0 || packId > 15)
{
DEBUG_BREAK();
__debugbreak();
}
#endif
childPack->SetPackId( (packId<<24) | m_packId );
@@ -362,7 +362,7 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo
{
app.DebugPrintf("Unimplemented\n");
#ifndef __CONTENT_PACKAGE
DEBUG_BREAK();
__debugbreak();
#endif
return 0;
}
@@ -392,6 +392,9 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path)
/*if(type == DLCManager::e_DLCType_All)
{
app.DebugPrintf("Unimplemented\n");
#ifndef _CONTENT_PACKAGE
__debugbreak();
#endif
return false;
}
#ifndef _CONTENT_PACKAGE
+5 -5
View File
@@ -1,11 +1,11 @@
#include "stdafx.h"
#include "DLCManager.h"
#include "DLCSkinFile.h"
#include "../../ModelPart.h"
#include "../../EntityRenderer.h"
#include "../../EntityRenderDispatcher.h"
#include "../../../Minecraft.World/Player.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\ModelPart.h"
#include "..\..\EntityRenderer.h"
#include "..\..\EntityRenderDispatcher.h"
#include "..\..\..\Minecraft.World\Player.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
DLCSkinFile::DLCSkinFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Skin,path)
{
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "DLCFile.h"
#include "../../../Minecraft.Client/HumanoidModel.h"
#include "..\..\..\Minecraft.Client\HumanoidModel.h"
class DLCSkinFile : public DLCFile
{
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.item.h"
#include "../../../Minecraft.World/net.minecraft.world.item.enchantment.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.enchantment.h"
#include "AddEnchantmentRuleDefinition.h"
AddEnchantmentRuleDefinition::AddEnchantmentRuleDefinition()
@@ -1,8 +1,8 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.item.h"
#include "../../../Minecraft.World/net.minecraft.world.inventory.h"
#include "../../../Minecraft.World/net.minecraft.world.entity.player.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.entity.player.h"
#include "AddItemRuleDefinition.h"
#include "AddEnchantmentRuleDefinition.h"
@@ -1,10 +1,10 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.phys.h"
#include "../../../Minecraft.World/net.minecraft.world.level.h"
#include "../../../Minecraft.World/net.minecraft.world.level.dimension.h"
#include "../../../Minecraft.World/net.minecraft.world.level.chunk.h"
#include "../../../Minecraft.World/net.minecraft.world.level.tile.entity.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.phys.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.dimension.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.chunk.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
#include "ApplySchematicRuleDefinition.h"
#include "LevelGenerationOptions.h"
#include "ConsoleSchematicFile.h"
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "BiomeOverride.h"
BiomeOverride::BiomeOverride()
@@ -1,10 +1,10 @@
#include "stdafx.h"
#include "../../WstringLookup.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\WstringLookup.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "CollectItemRuleDefinition.h"
#include "../../../Minecraft.World/net.minecraft.world.item.h"
#include "../../../Minecraft.World/Connection.h"
#include "../../../Minecraft.World/net.minecraft.network.packet.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
#include "..\..\..\Minecraft.World\Connection.h"
#include "..\..\..\Minecraft.World\net.minecraft.network.packet.h"
CollectItemRuleDefinition::CollectItemRuleDefinition()
{
@@ -1,9 +1,9 @@
#include "stdafx.h"
#include "CompleteAllRuleDefinition.h"
#include "ConsoleGameRules.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/Connection.h"
#include "../../../Minecraft.World/net.minecraft.network.packet.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\Connection.h"
#include "..\..\..\Minecraft.World\net.minecraft.network.packet.h"
void CompleteAllRuleDefinition::getChildren(vector<GameRuleDefinition *> *children)
{
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.item.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
#include "CompoundGameRuleDefinition.h"
#include "ConsoleGameRules.h"
@@ -1,11 +1,11 @@
#include "stdafx.h"
#include "ConsoleGenerateStructure.h"
#include "ConsoleGameRules.h"
#include "../../../Minecraft.World/net.minecraft.world.level.h"
#include "../../../Minecraft.World/net.minecraft.world.level.dimension.h"
#include "../../../Minecraft.World/net.minecraft.world.level.levelgen.structure.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.dimension.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.levelgen.structure.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.h"
ConsoleGenerateStructure::ConsoleGenerateStructure() : StructurePiece(0)
{
@@ -1,6 +1,6 @@
#pragma once
#include "GameRuleDefinition.h"
#include "../../../Minecraft.World/StructurePiece.h"
#include "..\..\..\Minecraft.World\StructurePiece.h"
class Level;
class Random;
@@ -1,16 +1,16 @@
#include "stdafx.h"
#include <vector>
#include "../../../Minecraft.World/com.mojang.nbt.h"
#include "../../../Minecraft.World/System.h"
#include "..\..\..\Minecraft.World\com.mojang.nbt.h"
#include "..\..\..\Minecraft.World\System.h"
#include "ConsoleSchematicFile.h"
#include "../../../Minecraft.World/InputOutputStream.h"
#include "../../../Minecraft.World/net.minecraft.world.level.h"
#include "../../../Minecraft.World/net.minecraft.world.level.chunk.h"
#include "../../../Minecraft.World/net.minecraft.world.level.tile.entity.h"
#include "../../../Minecraft.World/net.minecraft.world.entity.h"
#include "../../../Minecraft.World/net.minecraft.world.entity.item.h"
#include "../../../Minecraft.World/net.minecraft.world.phys.h"
#include "../../../Minecraft.World/compression.h"
#include "..\..\..\Minecraft.World\InputOutputStream.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.chunk.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.entity.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.entity.item.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.phys.h"
#include "..\..\..\Minecraft.World\compression.h"
ConsoleSchematicFile::ConsoleSchematicFile()
{
@@ -122,7 +122,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
{
#ifndef _CONTENT_PACKAGE
app.DebugPrintf("ConsoleSchematicFile has read a nullptr tile entity\n");
DEBUG_BREAK();
__debugbreak();
#endif
}
else
@@ -635,7 +635,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
}
#ifndef _CONTENT_PACKAGE
if(p!=blockCount) DEBUG_BREAK();
if(p!=blockCount) __debugbreak();
#endif
// We don't know how this will compress - just make a fixed length buffer to initially decompress into
@@ -4,7 +4,7 @@ using namespace std;
#define XBOX_SCHEMATIC_ORIGINAL_VERSION 1
#define XBOX_SCHEMATIC_CURRENT_VERSION 2
#include "../../../Minecraft.World/ArrayWithLength.h"
#include "..\..\..\Minecraft.World\ArrayWithLength.h"
class Level;
class DataOutputStream;
@@ -24,7 +24,7 @@ GameRule::ValueType GameRule::getParameter(const wstring &parameterName)
{
#ifndef _CONTENT_PACKAGE
wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", parameterName.c_str());
DEBUG_BREAK();
__debugbreak();
#endif
}
return m_parameters[parameterName];
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "../../WstringLookup.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\WstringLookup.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "ConsoleGameRules.h"
GameRuleDefinition::GameRuleDefinition()
@@ -3,7 +3,7 @@ using namespace std;
#include <unordered_map>
#include <string>
#include "../../../Minecraft.World/ItemInstance.h"
#include "..\..\..\Minecraft.World\ItemInstance.h"
#include "ConsoleGameRulesConstants.h"
#include "GameRulesInstance.h"
@@ -1,14 +1,14 @@
#include "stdafx.h"
#include "../../../Minecraft.World/compression.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/File.h"
#include "../../../Minecraft.World/compression.h"
#include "../DLC/DLCPack.h"
#include "../DLC/DLCLocalisationFile.h"
#include "../DLC/DLCGameRulesFile.h"
#include "../DLC/DLCGameRules.h"
#include "../DLC/DLCGameRulesHeader.h"
#include "../../StringTable.h"
#include "..\..\..\Minecraft.World\compression.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\File.h"
#include "..\..\..\Minecraft.World\compression.h"
#include "..\DLC\DLCPack.h"
#include "..\DLC\DLCLocalisationFile.h"
#include "..\DLC\DLCGameRulesFile.h"
#include "..\DLC\DLCGameRules.h"
#include "..\DLC\DLCGameRulesHeader.h"
#include "..\..\StringTable.h"
#include "ConsoleGameRules.h"
#include "GameRuleManager.h"
@@ -2,13 +2,13 @@
#include <unordered_set>
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/Pos.h"
#include "../../../Minecraft.World/net.minecraft.world.phys.h"
#include "../../../Minecraft.World/net.minecraft.world.level.h"
#include "../../../Minecraft.World/net.minecraft.world.level.chunk.h"
#include "Common/DLC/DLCGameRulesHeader.h"
#include "../../StringTable.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\Pos.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.phys.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.chunk.h"
#include "Common\DLC\DLCGameRulesHeader.h"
#include "..\..\StringTable.h"
#include "LevelGenerationOptions.h"
#include "ConsoleGameRules.h"
@@ -4,7 +4,7 @@ using namespace std;
#pragma message("LevelGenerationOptions.h ")
#include "GameRuleDefinition.h"
#include "../../../Minecraft.World/StructureFeature.h"
#include "..\..\..\Minecraft.World\StructureFeature.h"
class ApplySchematicRuleDefinition;
class LevelChunk;
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../StringTable.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\StringTable.h"
#include "ConsoleGameRules.h"
#include "LevelRuleset.h"
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "NamedAreaRuleDefinition.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.phys.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.phys.h"
NamedAreaRuleDefinition::NamedAreaRuleDefinition()
{
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "StartFeature.h"
StartFeature::StartFeature()
@@ -2,7 +2,7 @@
using namespace std;
#include "GameRuleDefinition.h"
#include "../../../Minecraft.World/StructureFeature.h"
#include "..\..\..\Minecraft.World\StructureFeature.h"
class StartFeature : public GameRuleDefinition
{
@@ -1,11 +1,11 @@
#include "stdafx.h"
#include "UpdatePlayerRuleDefinition.h"
#include "ConsoleGameRules.h"
#include "../../../Minecraft.World/Pos.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.entity.player.h"
#include "../../../Minecraft.World/net.minecraft.world.food.h"
#include "../../../Minecraft.World/net.minecraft.world.item.h"
#include "..\..\..\Minecraft.World\Pos.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.entity.player.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.food.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition()
{
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "UseTileRuleDefinition.h"
UseTileRuleDefinition::UseTileRuleDefinition()
@@ -2,7 +2,7 @@
using namespace std;
#include "GameRuleDefinition.h"
#include "../../../Minecraft.World/Pos.h"
#include "..\..\..\Minecraft.World\Pos.h"
class UseTileRuleDefinition : public GameRuleDefinition
{
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "XboxStructureActionGenerateBox.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.level.levelgen.structure.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.levelgen.structure.h"
XboxStructureActionGenerateBox::XboxStructureActionGenerateBox()
{
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "XboxStructureActionPlaceBlock.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "../../../Minecraft.World/net.minecraft.world.level.levelgen.structure.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.levelgen.structure.h"
XboxStructureActionPlaceBlock::XboxStructureActionPlaceBlock()
{
@@ -1,11 +1,11 @@
#include "stdafx.h"
#include "../../../Minecraft.World/StringHelpers.h"
#include "..\..\..\Minecraft.World\StringHelpers.h"
#include "XboxStructureActionPlaceContainer.h"
#include "AddItemRuleDefinition.h"
#include "../../../Minecraft.World/net.minecraft.world.level.levelgen.structure.h"
#include "../../../Minecraft.World/net.minecraft.world.level.h"
#include "../../../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../../../Minecraft.World/net.minecraft.world.inventory.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.levelgen.structure.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
XboxStructureActionPlaceContainer::XboxStructureActionPlaceContainer()
{

Some files were not shown because too many files have changed in this diff Show More