315 Commits

Author SHA1 Message Date
itsRevela 2c23e3e54c wip: flip mode resize buffers experiment (blocked by deferred context IntRefs)
Experimental branch that tried to enable screen tearing by switching the swap chain from DXGI_SWAP_EFFECT_DISCARD (bitblt) to DXGI_SWAP_EFFECT_FLIP_DISCARD with the ALLOW_TEARING flag. Tearing in flip mode requires ResizeBuffers on window resize because flip swap chains take exclusive ownership of the HWND and cannot be destroyed-and-recreated like bitblt ones.

ResizeBuffers fails with DXGI_ERROR_INVALID_CALL (0x887A0001) every time. Diagnosis path got us to the authoritative cause via the DXGI debug layer's info queue and ID3D11Debug::ReportLiveDeviceObjects: both physical backbuffers of the flip chain have an internal reference count of 5 (D3D11 IntRef, not public COM refcount). DXGI's outstanding-references check looks at IntRef, which is why probing public refcount always showed 2 and nothing we released dropped it.

The internal refs come from the 4J Renderer library's use of a deferred context. Renderer::InitialiseContext calls ID3D11Device::CreateDeferredContext and records commands into it via Renderer::Context (stored in thread-local storage). Commands that reference the backbuffer or an RTV wrapping it pin IntRefs on the backbuffer texture until the command list is Finished and then Released. The Renderer library owns that command list and we have no handle to it, so we cannot drop those refs from the outside without reverse engineering significantly more of the 4J library.

This commit preserves the instrumentation and the failed flip mode experiment so we can return to it later if a cleaner approach becomes available. Retained in this file:
- DXGI_FEATURE_PRESENT_ALLOW_TEARING probe and g_bTearingSupported global
- FLIP_DISCARD swap chain config with ALLOW_TEARING flag
- ResizeBuffers call path in ResizeD3D with fallback recovery for when it fails
- Dedicated file logger (FlipTestLog) writing to flip_test.log
- D3D11 and DXGI info queue capture helpers
- ID3D11Debug / IDXGIDebug ReportLiveObjects wiring
- Granular refcount probes throughout the resize cleanup chain
- GPU idle wait via ID3D11Query fence

Not a fix. The next iteration goes back to bitblt and tries exclusive fullscreen for tearing instead.
2026-04-11 05:00:04 -05:00
itsRevela 6c8f463707 fix: restore in-world rendering and aspect ratio via bitblt swap chain
The previous FLIP_DISCARD swap chain configuration was producing broken rendering and a stretched aspect ratio on startup and after window resize, because the closed-source 4J Renderer library holds hidden backbuffer references that prevent ResizeBuffers from succeeding in flip mode. Switches the swap chain to the legacy bitblt DISCARD model with BufferCount=1, which lets the "destroy old, create new" resize path in ResizeD3D work cleanly. In-world rendering and aspect ratio are now correct at launch and across window resizes.

Known regression from this change: screen tearing no longer works when VSync is off. On Windows 10 and 11, bitblt swap chains always go through the DWM compositor, which locks presentation to the monitor refresh rate regardless of the SyncInterval parameter we pass to Present. Every frame the renderer produces above the refresh rate is silently dropped by DWM, which hurts input latency compared to a true uncapped-fps presentation path. The next iteration will reverse-engineer the 4J Renderer struct layout to find where those hidden backbuffer references are stored, release them before ResizeBuffers, and switch back to FLIP_DISCARD with ALLOW_TEARING so real tearing is possible again.

Also removes the dead SwapChainVSyncProxy COM wrapper. The proxy was originally intended to intercept Present calls from the Renderer library for VSync control, but the library hardcodes SyncInterval=1 and does not dispatch Present through the proxy vtable, so it was never actually doing anything useful.
2026-04-11 02:49:53 -05:00
Revela b67889485f Remove Discord link from README
Removed Discord badge from README.
2026-04-11 02:09:48 -05:00
itsRevela 17eae2b41e chore: sync upstream MinecraftConsoles through d25b762c
Reviewed 8 upstream commits from smartcmd/MCLCE/MinecraftConsoles and recorded the result as a merge so GitHub stops reporting "behind upstream". All accepted changes were cherry-picked earlier in this branch, and this commit only absorbs the upstream commit SHAs as reachable ancestors using the "ours" merge strategy, so no tree changes come in from this commit itself.

Applied:
- 98a86fc6 feat: set intro scene background to white (#1474)
- 413baace fix: reorder autosave tick to account for weak hardware (#1482)
- d25b762c Fix _jeb easter egg on sheep (#1488)

Partially applied:
- d0786f95 Update more references to old smartcmd repo (credits reorganization and Star History URL applied, Nightly download URLs dropped since our fork has its own release pipeline, itsRevela added to Project Maintainers on top of upstream's restructure)

Already present:
- b928351e Update Windows64_Minecraft.cpp (#1468). Unicode WinAPI conversion was already applied during our Linux cross-compile work, so this was a no-op cherry-pick.
2026-04-11 02:06:01 -05:00
Tyler Reese 7ea30d026c Fix _jeb easter egg on sheep (#1488)
Fixed the original jeb sheep behavior.

For some reason the later code (now commented out) just completely overrid it
2026-04-11 02:02:23 -05:00
itsRevela a07bc651b3 chore: sync credits screen and Star History with upstream org rename
The upstream project (formerly smartcmd/MinecraftConsoles, now MCLCE/MinecraftConsoles) reorganized their in-game credits screen. This pulls in that restructure so our credits accurately reflect who the current and former upstream maintainers are, and points the attribution URL at the right place. codeHusky and mattsumi stay as Project Maintainers, and itsRevela is added alongside them. smartcmd, Patoke, and rtm516 move to a new Former Maintainers section. The contributor count ticks up from 100+ to 120+, and the credit URL at the bottom now reads github.com/MCLCE/MinecraftConsoles with a "(formerly smartcmd/MinecraftConsoles)" line underneath it.

On the README side, only the Star History chart URL was updated from smartcmd to MCLCE. The Nightly client and dedicated server download links stay pointed at itsRevela/LCE-Revelations since our fork has its own release pipeline.

Upstream attribution: d0786f95 by Loki Rautio. Applied as a partial cherry-pick with the two Nightly download URL hunks dropped and itsRevela added to the maintainer list.
2026-04-11 02:01:26 -05:00
Sylvessa aedb6125b6 fix: reorder autosave tick to account for weak hardware (#1482) 2026-04-11 01:52:58 -05:00
Fireblade 37ee04356b feat. set intro scene background to white (#1474) 2026-04-11 01:52:01 -05:00
itsRevela 28d997a8d0 chore: rename project from MinecraftConsoles to LCE-Revelations
The personal repo was renamed from itsRevela/MinecraftConsoles to itsRevela/LCE-Revelations, so this sweeps the rest of the codebase to match. In-game, the credits screen now shows "LCE-Revelations" instead of "MinecraftConsoles" as the project heading. In the README, the Nightly client and dedicated server download links point at the new repo URL, and the Docker image reference is now ghcr.io/itsrevela/lce-revelations-dedicated-server. The dedicated server's generated server.properties file also picks up a new header comment reflecting the rename.

For folks building from source: the CMake project name was renamed, so when you configure the build the generated solution file is now LCE-Revelations.sln instead of MinecraftConsoles.sln. The Nix flake description and the Nightly release uploader script were updated to match, and a historical FourKit port reconnaissance document was removed since that port is already complete.

Also restored the Fluxer server link at the top of the README, which was lost when the repo was fast-forwarded from the upstream that got griefed.
2026-04-11 01:38:35 -05:00
itsRevela a191df1f2e fix: controller cursor speed no longer scales with framerate
When framerate was uncapped (vsync off, high-end hardware), the controller cursor in the inventory and creative menus moved way too fast. Basically unusable unless you switched to the dpad. The cursor update was tied to how often the screen redraws, so the faster the game ran, the faster the cursor flew.

Now the cursor moves a smaller distance per frame at higher framerates, so the actual on-screen speed stays the same whether you're at 60 FPS or 600 FPS.

While fixing this I also found an old workaround that was rounding the cursor position to whole pixels every frame and nudging it by 1 pixel to keep it from getting stuck. That nudge was pointing the wrong way on the vertical axis, which made up/down movement feel broken once the per-frame distance got small. Removed the rounding and the nudge. The cursor can now hold a fractional position between frames, and the part of the code that actually draws the cursor still snaps it to whole pixels on screen.

Fixes #3
2026-04-10 21:38:43 -05:00
itsRevela 8f41d34325 fix: redirect AppContext.BaseDirectory to server root for FourKit plugins
AppContext.BaseDirectory pointed to the runtime/ subfolder where the
self-contained .NET payload lives, causing plugins that use it for file
paths to write to the wrong directory. Now set to the server exe
directory at startup via AppContext.SetData.

Also adds serverDirectory and dataDirectory properties to ServerPlugin
so plugin authors have convenient access to the server root and a
per-plugin data folder (plugins/<PluginName>/) without needing to
resolve paths manually.
2026-04-10 02:03:44 -05:00
itsRevela d14e46701c feat: add stress testing tool for dedicated server stability validation
Python-based bot tool that rapidly connects/disconnects to the server
using the full LCE protocol (PreLogin, Login, cipher handshake, identity
tokens, keepalive). Configurable concurrent bots, hold times, burst
joins, movement packets, and duration. Includes batch files for common
test scenarios (basic, aggressive, movement, burst, endurance).
2026-04-10 02:03:20 -05:00
itsRevela 20229fc07b fix: dedicated server thread safety, disconnect deadlock, and console freeze
- Protect PlayerList and ServerConnection players vectors with critical
  sections; all iterations use copy-on-read snapshots to prevent iterator
  invalidation during concurrent join/leave
- Add null check on player bounding box in movement validation to prevent
  crash when player is removed mid-tick
- Re-validate socket player pointer immediately before SendData to narrow
  the TOCTOU race window on disconnect
- Replace inline disconnect cleanup with a queued system drained on the
  main tick thread, eliminating the done_cs -> m_playersCS lock inversion
  that caused deadlocks under load
- Disable Windows QuickEdit mode at server startup to prevent console
  input selection from freezing the process
- Move chunk priority sort behind ServerConnection::sortPlayersByChunkPriority()
  to keep the players vector lock-protected
2026-04-10 01:12:59 -05:00
itsRevela 055bce517d docs: add Beacon Menu Fixes to Latest section in README 2026-04-09 21:58:29 -05:00
itsRevela 9c9df615a1 fix: beacon menu item consumption, data sync, and button state issues
- Prevent payment item from being consumed when submitting unchanged powers
- Reorder ServerPlayer::openBeacon to send ContainerOpenPacket before
  addSlotListener so beacon data packets arrive after the client menu is ready
- Add BeaconMenu::broadcastChanges() to continuously sync levels and powers
  to clients, matching the pattern FurnaceMenu already uses
- Initialize UIControl_BeaconEffectButton::m_lastState to prevent stale
  heap memory from suppressing Iggy ChangeState calls on menu re-entry
2026-04-09 21:34:48 -05:00
Tyler Reese d25b762ca5 Fix _jeb easter egg on sheep (#1488)
Fixed the original jeb sheep behavior.

For some reason the later code (now commented out) just completely overrid it
2026-04-08 22:34:48 -05:00
Revela 657fdd7108 Update Discord invite link in README 2026-04-08 14:00:53 -05:00
itsRevela d3b4713f00 docs: add feature summary blurb and Latest entries for Linux cross-compile and FourKit plugin support 2026-04-08 13:54:38 -05:00
Revela 1e1550a1b8 Update project description in README.md 2026-04-08 13:13:55 -05:00
Revela 1a98bc6a19 Update project title in README.md 2026-04-08 13:12:40 -05:00
itsRevela 71b1bf92b8 Revert "fix: tutorial world"
This reverts commit 222852c11b.
2026-04-08 13:00:44 -05:00
neoapps-dev 6fb106984a fix(build-linux): fourkit installation 2026-04-08 13:36:01 +03:00
neoapps-dev 6b63a808bb fix(build-linux): fourkit installation 2026-04-08 13:32:02 +03:00
neoapps-dev 25595fba71 fix(build-linux): silly me 2026-04-08 13:21:06 +03:00
neoapps-dev 0ddac15fad fix: linux cross-compiling 2026-04-08 13:07:04 +03:00
neoapps-dev 9babdac928 fix: linux cross-compiling 2026-04-08 12:44:56 +03:00
neoapps-dev 222852c11b fix: tutorial world 2026-04-08 12:21:09 +03:00
neoapps-dev de0ea474b1 chore: ignore .xwin 2026-04-08 12:19:12 +03:00
neoapps-dev ed18e26e85 feat: script for building 2026-04-08 12:09:32 +03:00
ryleu d449a582e4 add linux clang instructions 2026-04-08 12:05:43 +03:00
ryleu 5eab358dde add support for linux clang cross compiles 2026-04-08 12:03:15 +03:00
neoapps-dev b2f00d16e6 feat: cancel join 2026-04-08 11:47:25 +03:00
irice7 d191bee468 Add cancel join
Adds the Cancel Join tooltip to the "Connecting to host"
progress bar
2026-04-08 11:47:01 +03:00
itsRevela 42a582fb9f feat: add FourKit plugin host with dual server build
Adds the FourKit .NET 10 plugin host as a second dedicated server
build flavour alongside the existing vanilla server. Both flavours
build from the same source tree, with FourKit gated by the
MINECRAFT_SERVER_FOURKIT_BUILD preprocessor define.

Build layout:

  Minecraft.Server         vanilla, no plugin support, no .NET dep
  Minecraft.Server.FourKit FourKit-enabled, ships with bundled
                           .NET 10 self-contained runtime in runtime/
                           and an empty plugins/ folder

Both produce a Minecraft.Server.exe in their own per-target output
dir. The variant identity lives in the directory name, not the
binary name, so either flavour can be shipped as a drop-in.

Native bridge (Minecraft.Server/FourKit*.{cpp,h}):

* FourKitRuntime: hosts CoreCLR via hostfxr's command-line init API
  (the runtime-config API does not support self-contained components)
* FourKitBridge: ~50 Fire* event entry points, with inline no-op
  stubs for the standalone build so gameplay code can call them
  unconditionally
* FourKitNatives: ~80 native callbacks the managed side invokes
  for player/world/inventory mutations
* FourKitMappers: type and enum mapping helpers

Managed plugin host (Minecraft.Server.FourKit/):

* Bukkit-style API: Player, World, Block, Inventory, Command,
  Listener, EventHandler attribute, ~54 event classes
* PluginLoader with per-plugin AssemblyLoadContext
* FourKitHost as the [UnmanagedCallersOnly] entry point table
* Runtime resolves plugins relative to the host process so they
  always live next to Minecraft.Server.exe regardless of where the
  managed assembly itself is loaded from

Engine hooks (Minecraft.Client/, Minecraft.World/):

* Player lifecycle (PreLogin, Login, Join, Quit, Kick, Move,
  Teleport, Portal, Death) wired into PendingConnection and
  PlayerConnection without disturbing the cipher handshake or
  identity-token security flow
* Inventory open/click/drop hooks across every container menu type
* Block place/break/grow/burn/spread/from-to hooks across the
  full tile family
* Bed enter/leave, sign change, entity damage/death, ender pearl
  teleport hooks

Regression fixes preserved while applying donor diffs:

* ServerPlayer::die() retains the LCE-Revelations hardcore branch
  (setGameMode(ADVENTURE) + banPlayerForHardcoreDeath) in both the
  FourKit and non-FourKit code paths
* ServerLevel::entityAdded() retains the sub-entity ID reassignment
  loop required by the client's handleAddMob offset, fixing Ender
  Dragon and Wither boss multi-part hit detection
* LivingEntity::travel() retains the raw Player* cast and the
  cached frictionTile, both Revelations perf wins that the donor
  silently reverted
* ServerLogger.cpp keeps the file-logging code donor stripped
* PlayerList.cpp end portal transition fix and UIScene_EndPoem
  bounds-check are intact

Build system:

* Top-level CMakeLists.txt adds the Minecraft.Server.FourKit
  subdirectory and pulls in the new shared cmake/ServerTarget.cmake
  helper
* Minecraft.Server/cmake/sources/Common.cmake is now location
  independent (uses CMAKE_CURRENT_LIST_DIR) so the source list
  can be consumed from either server target's CMakeLists.txt
* The seven FourKit*.cpp/h files live in their own
  _MINECRAFT_SERVER_COMMON_SERVER_FOURKIT variable so the
  standalone target omits them
* configure-time .NET 10 SDK check fails fast with a clear
  download link if the SDK is missing
* global.json pins the SDK to 10.0.100 with latestFeature
  rollforward

Sample plugin (samples/HelloPlugin/) demonstrates the loader and
the PlayerJoinEvent listener pattern.

CI:

* nightly.yml builds both server flavours, ships
  LCE-Revelations-Server-Win64.zip and
  LCE-Revelations-Server-Win64-FourKit.zip, attests both, and
  updates release notes for the dual-flavour layout
* pull-request.yml pulls in actions/setup-dotnet so the FourKit
  publish step works in PR validation
* All zip artifacts and the client zip are renamed from
  LCREWindows64 to LCE-Revelations-{Client,Server}-Win64

Documentation:

* COMPILE.md gets a VS 2022 quick start, .NET 10 prereq section,
  server flavours explanation, and a troubleshooting section
* docs/FOURKIT_PORT_RECON.md captures the file-by-file recon that
  drove the port
* docs/FOURKIT_PARITY.md is the canonical reference for which
  events FourKit fires

Docker:

* docker-compose.dedicated-server.yml MC_RUNTIME_DIR default points
  at the vanilla CMake output. The FourKit Docker image is
  intentionally NOT shipped yet because hosting .NET 10 self
  contained inside Wine has not been smoke-tested
2026-04-08 03:02:48 -05:00
itsRevela 5d56f5080f chore: rename LCRE branding to LCE-Revelations
Renames release artifacts, Docker image, container/service names,
and shell wrappers from the legacy LCRE prefix to LCE-Revelations.

* Banner asset: LCRE-banner.png to LCE-Revelations-banner.png
* Docker compose service and container: minecraft-lce-dedicated-server
  to lce-revelations-dedicated-server
* ghcr image: ghcr.io/itsrevela/minecraft-lce-dedicated-server to
  ghcr.io/lce-hub/lce-revelations-dedicated-server
* Dockerfile MC_RUNTIME_DIR default points at the CMake build output
  path now that the legacy x64/ MSBuild path is no longer produced
* README and helper shell scripts updated to match

Workflow rename for nightly.yml release notes is folded into the
FourKit commit because the FourKit CI changes overwhelm the diff.
2026-04-08 02:30:58 -05:00
Loki Rautio d0786f956d Update more references to old smartcmd repo 2026-04-07 20:29:32 -05:00
Loki 126943e06e Add details about org change to README 2026-04-07 17:44:00 -05:00
Loki 108e3dc233 Whitespace adjustment to test GitHub webhook 2026-04-07 15:52:48 -05:00
/home/neo 29ebc01ea9 feat: TU19 tutorial world (#1) 2026-04-07 22:42:22 +03:00
Loki 29edc4aff0 Link to new Discord 2026-04-07 14:31:30 -05:00
/home/neo 7149e696f2 docs: discord server link 2026-04-07 22:04:22 +03:00
Revela 078e661b91 Update README to include Unity-LCE Discord server link
Removed Fluxer server link and added Discord badge.
2026-04-07 13:43:05 -05:00
Revela a07d791683 Update project name in README.md
temporary
2026-04-07 13:37:38 -05:00
itsRevela 77fbf36f54 chore: remove 'why this fork exists' section from release notes 2026-04-07 13:35:32 -05:00
rucheykov b928351e0b Update Windows64_Minecraft.cpp (#1468) 2026-04-06 12:34:25 -05:00
Sylvessa 413baaceed fix: reorder autosave tick to account for weak hardware (#1482) 2026-04-06 12:34:02 -05:00
Fireblade 98a86fc69b feat. set intro scene background to white (#1474) 2026-04-06 12:33:45 -05:00
itsRevela 37d1942033 chore: remove nightly server release workflow 2026-04-05 18:37:50 -05:00
itsRevela 6728ecb141 fix: increase max packet size to 4MB for cross-fork compatibility
Matches the packet size limit used by the plugin-api fork. Our 512KB
limit caused "Connection lost" when their server sent large packets
(e.g. chunk data) that exceeded our cap.
2026-04-05 18:35:28 -05:00
itsRevela ca5dbe1c9c revert: remove skipped upstream changes brought in by merge
Reverts workflow revert (#c4c4c08b), BACKPORTING.md (#5e584910),
and CONTRIBUTING.md backporting link (#7dfe46aa) that were
unintentionally included via the upstream merge commit.
2026-04-05 16:25:49 -05:00
itsRevela e52565f9a3 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	.github/workflows/nightly-server.yml
#	Minecraft.Server/Windows64/ServerMain.cpp
#	Minecraft.World/ConsoleSaveFileOriginal.cpp
2026-04-05 16:23:28 -05:00
itsRevela 38250cc51b docs: update README for upstream merges and chunk loading optimization 2026-04-05 16:20:30 -05:00
Sylvessa 207a1b309f optimization: async dedicated server autosaving (#1473) 2026-04-05 16:17:01 -05:00
Sylvessa 2f3cf58c3c optimization: remove redundant lastTime setter (#1479) 2026-04-05 16:14:13 -05:00
Sylvessa d758eb887f fix: wither and ender dragon custom names (#1472) 2026-04-05 16:11:56 -05:00
Us3ful"-Dev 931b5e9dcb Quality of life netherportal fix (#1337)
* Working New portal checks

fixed x axis portal with obsidian on z axis

* Removed Debug code

* Remove unnecessary code

removed PortalTile:: from PortalTile::validPortalFrame

* Remove more debug code
2026-04-05 16:08:57 -05:00
Sylvessa 4e6c695899 fix: boat plr height & sneak height (#1459) 2026-04-05 16:08:17 -05:00
Logan Gibson c0a2e82223 Replace instances of hard-coded port in ports variable with SERVER_PORT variable in yml files (#1457) 2026-04-05 16:07:06 -05:00
Sneexy 446df4a6dc Minor docker/container fixes and edits (#1454) 2026-04-05 16:05:40 -05:00
itsRevela 207d90de28 perf: process 16 chunks/player/tick on dedicated server, revert async save
Chunk loading now batches up to 16 nearest-first requests per player per
tick on dedicated server (client stays at 1), improving tick recovery
time after player join.

Reverts the async save system -- the background thread snapshot/compress
path added complexity without measurable benefit. Autosave on Windows64
server now uses the standard synchronous flush like client, in
preparation for a proper async implementation from upstream.
2026-04-05 15:56:39 -05:00
itsRevela be17d4028f feat: add performance monitor tool
DLL injector + Python GUI for real-time server metrics.
Hooks into tick loop, chunk generation, and player chunk map
to collect timing data over TCP, displayed in a tkinter dashboard.
Includes bot spawner for load testing.
2026-04-05 15:49:52 -05:00
Sylvessa 034c313ddf optimization: async dedicated server autosaving (#1473) 2026-04-05 12:57:43 -05:00
Sylvessa c2ea1fa62b optimization: remove redundant lastTime setter (#1479) 2026-04-05 12:51:37 -05:00
Sylvessa a4e689095c fix: wither and ender dragon custom names (#1472) 2026-04-04 22:04:02 -05:00
Loki 7dfe46aa5d Add backporting link to Contributor's Guide 2026-04-03 16:56:05 -05:00
Loki 5e5849102f Add info about backports we will accept. 2026-04-03 16:55:20 -05:00
Us3ful"-Dev 103f38859a Quality of life netherportal fix (#1337)
* Working New portal checks

fixed x axis portal with obsidian on z axis

* Removed Debug code

* Remove unnecessary code

removed PortalTile:: from PortalTile::validPortalFrame

* Remove more debug code
2026-04-03 15:01:48 -05:00
Sylvessa 8bf0343544 fix: boat plr height & sneak height (#1459) 2026-04-02 17:16:31 -05:00
Logan Gibson e4c08b8414 Replace instances of hard-coded port in ports variable with SERVER_PORT variable in yml files (#1457) 2026-04-02 02:43:33 -05:00
Sylvessa c4c4c08b96 Revert "Update actions workflows and add clang format check for PRs (#1418)"
This reverts commit 38d58f2d8b due to it causing spam and other problems with pull requests.
2026-04-02 00:01:27 -05:00
Sneexy c2356bf29e Minor docker/container fixes and edits (#1454) 2026-04-01 19:10:47 -05:00
itsRevela 463bf2b93f fix: player list no longer limited by render distance
The previous IQNet cleanup in handleRemoveEntity fired on every entity
despawn, which happens both when a player goes out of tracking range
and when they disconnect.  This caused players to vanish from the Tab
list whenever they moved beyond render distance.

Introduce two custom payload channels (MC|ForkHello, MC|ForkPLeave) so
the client can distinguish "out of range" from "actually left":

- Server sends MC|ForkHello during login to identify itself as a fork
- Server sends MC|ForkPLeave with the player's gamertag on disconnect
- Client skips IQNet cleanup in handleRemoveEntity on fork servers
- Client cleans up IQNet only when MC|ForkPLeave arrives

Fully backwards-compatible: no existing packet wire formats changed.
Upstream clients ignore the unknown channels, fork clients on upstream
servers fall back to the old entity-tracking-based cleanup.
2026-04-01 16:01:56 -05:00
itsRevela 8e2b475317 removed backup arc file 2026-04-01 03:50:21 -05:00
itsRevela a017579bc3 fix: graphics menu navigation, layout, render distance cap, skin anim speed
Rewire the SWF focus chain via Iggy so VSync, Fullscreen, and Render
Distance are reachable with keyboard/gamepad navigation.

Cap render distance slider at 16 chunks. Shift graphics menu layout
up 60px for better centering.

Fix skin preview walk/attack animations running too fast with VSync
off by scaling per-frame increments by delta time relative to 60fps.
2026-04-01 03:43:28 -05:00
itsRevela 2cc03476b3 fix: skin preview animations too fast with VSync off
The walking and attack animations in the Change Skin menu were
frame-rate-dependent, advancing per render call with no delta time
scaling. With uncapped FPS they ran proportionally too fast.

Add time-based scaling relative to a 60fps baseline. The scale is
computed once per frame (cached for 0.5ms) so multiple skin previews
rendered in the same frame all animate at the correct speed.
2026-04-01 02:24:45 -05:00
itsRevela 9372b2d2ea fix: move async save commit off game thread to prevent disk I/O stall
StorageManager.SaveSaveData() blocks until the disk write completes.
Calling it from the game thread caused 2.5s freezes. Now it only runs
from TickCoreSystems() on the ServerMain thread, which operates
independently of the game tick loop.
2026-04-01 01:49:58 -05:00
itsRevela 68521f8c92 fix: async autosave thread safety and commit path
Move StorageManager.AllocateSaveData() back under the save lock (called
on the game thread before releasing). Background thread now only does
pure zlib compression with no StorageManager calls.

Add CommitPendingAsyncSave() to both the game thread tick and
TickCoreSystems() to ensure saves commit during bootstrap, normal
gameplay, and shutdown.
2026-04-01 01:23:50 -05:00
itsRevela 073a511217 perf: async autosave for dedicated server
Autosave previously froze the main thread for 2-6 seconds while
compressing the entire save file with zlib. Now the save buffer is
snapshotted under the lock (~18ms), then compression runs on a
background thread. The compressed data is committed to StorageManager
on the next main-thread tick via CommitPendingAsyncSave().

Also skip redundant full chunk saves during autosave on the dedicated
server -- chunks are already persisted by the per-tick trickle save.
Only entity data is flushed, matching Xbox/Orbis behavior.

Added per-step timing to the autosave handler for diagnostics.
2026-03-31 23:33:21 -05:00
itsRevela 450891d8c4 docs: add entity tracker optimization to README 2026-03-31 22:12:18 -05:00
itsRevela ea15409bb9 perf: skip split-screen system-mate checks on dedicated server
The EntityTracker and TrackedEntity classes have O(players^2 * entities)
loops that check IsSameSystem() for split-screen couch co-op visibility
expansion. On the dedicated server, all players are remote so
IsSameSystem() always returns false, making these loops pure overhead.

Skip them entirely when g_Win64DedicatedServer is true. The original
split-screen logic is preserved for game client LAN hosting.
2026-03-31 22:07:41 -05:00
itsRevela aecef7f10d fix: move security gate close after login sequence to prevent high-latency crashes
The security gate was closed before LoginPacket was sent in placeNewPlayer,
causing all login setup packets to be buffered behind the cipher handshake.
Under high-latency connections, the flushed data arrived before the player
object was initialized, causing a null pointer crash. The gate now closes
after the login sequence and MC|CKey are sent.
2026-03-31 17:28:03 -05:00
Revela d5fafb74e8 Fix typo in graphics settings section of README
Corrected a typo in the README regarding spacing error.
2026-03-30 17:01:30 -05:00
itsRevela 383c710833 feat: uncapped FPS when VSync off, fix graphics settings bitmask collision
Bypass the 4J RenderManager's hardcoded SyncInterval=1 by calling
the DXGI swap chain directly with Present(0, ALLOW_TEARING) when
VSync is disabled. Falls back to the library's Present on failure.

Relocate VSync/Fullscreen setting flags from bits 18-19 to bits 24-25
to eliminate overlap with the render distance byte (bits 16-23).

Sync the Fullscreen game setting when F11 is pressed so the graphics
menu checkbox stays accurate.

Remove tracked DumpSwf.class (already covered by tools/*.class gitignore).
2026-03-30 15:36:08 -05:00
itsRevela 9f08612f25 fix: graphics settings layout broken by removeControl on Windows64
BedrockFog removal via removeControl with centreScene=true triggered
Flash-side repositioning that didn't account for the tool-added VSync
and Fullscreen checkboxes, creating a gap after CustomSkinAnim and
causing RenderDistance to render behind Gamma.

On Windows64 (single player per client), the console splitscreen
host-check that removed BedrockFog/CustomSkinAnim is unnecessary.
Gate it behind #ifndef _WINDOWS64 so all controls stay visible.
2026-03-30 14:10:50 -05:00
itsRevela 4e323c8365 merge: upstream fix for world seeds not saving correctly (#1119) 2026-03-30 13:53:17 -05:00
itsRevela 3aa2d23fa9 feat: implement hardcore hearts with game mode lock
Display hardcore heart textures when a world is in hardcore mode,
matching Java Edition behavior. Hearts switch between normal/hardcore
across all states (poison, wither, flash) and all HUD resolutions.

C++ changes:
- IUIScene_HUD: check isHardcore() and call SetHardcoreMode() each tick
- UIScene_HUD: send hardcore boolean to Flash via Iggy, invalidate
  SetHealth dirty check on state change to force heart redraw
- CreateWorldMenu/LoadMenu: lock game mode to Survival when hardcore
- MinecraftServer: gate server.properties hardcore override behind
  MINECRAFT_SERVER_BUILD so offline worlds preserve their saved flag

SWF changes (via new Java tools):
- AddHardcoreBitmaps: adds 10 hardcore heart bitmaps to graphics SWFs
- AddHardcoreHearts: adds 10 new frames (15-24) to health sprite
- PatchHudABC: patches HUD ActionScript bytecode with SetHardcore
  method and frame offset logic (+14 normal/poison, +6 wither)

Also updates README changelog styling with consistent ### headings.
2026-03-30 13:50:29 -05:00
blongm d3412aaae7 Fixed issue with world seeds not saving correctly (#1119)
## Description
Fix issue where typing in a short seed on world creation doesn't save the seed correctly

## Changes

### Previous Behavior
Typing in a seed on the world creation menu that's less than 8 characters long will result in garbage data being saved as the seed. Happens with controller and KBM.
You can see this in-game - if you exit the world options menu and go back in, the seed will show up as boxes □□□.
Weirdly, if you type a seed again, it behaves as expected.

### Root Cause
For some reason, assigning `m_params->seed` to the seed text points it to garbage data, when it's 7 characters or less.

### New Behavior
Seed entry behaves as expected.

### Fix Implementation
- Added `static_cast<wstring>` before assignment to `m_params->seed`.
- Also replaced `(wchar_t *)` with `reinterpret_cast<wchar_t*>` in the functions.

### AI Use Disclosure
No AI was used
2026-03-30 06:05:32 -05:00
itsRevela a4f55dde16 chore: add LCRE banner, SWF/ARC tools, ignore build artifacts
Replace README banner with LCRE-banner.png. Add SWF inspection
and ARC archive tools. Ignore compiled .class, .swf intermediates,
and staging directory in tools/.
2026-03-29 21:14:34 -05:00
itsRevela 967adf1e54 feat: make F2 screenshot work in any context
Move screenshot capture from Minecraft::tick() (which requires an
active player) to the Windows64 main loop alongside other global
key handlers (F1/F3/F11). F2 now works from the main menu, pause
menu, settings, inventory, crafting, and all other screens. Chat
message still shown when in-game.
2026-03-29 19:30:00 -05:00
itsRevela f2434a8ea8 feat: use full-size LCRE logo shifted up 10px
Replace the 80% scaled approach with full-size logo bitmaps and
shift the ComponentLogo SWF placements up by 10px (proportionally
scaled for lower resolutions) to avoid occlusion by the load/join
menu. Add ShiftLogo.java tool for adjusting SWF placement offsets.
2026-03-29 19:10:14 -05:00
itsRevela 4a8291f6cc feat: replace Minecraft logo with LCRE logo at 80% scale
Replace MenuTitle and MenuTitleSmall bitmaps in skinHDWin.swf and
skinWin.swf with the custom LCRE (Legacy Console Edition Revelations)
logo, scaled to 80% within the original bitmap canvas to avoid
occlusion by the load/join menu.

Add ReplaceLogo.java and ExtractFromArc.java tools for SWF bitmap
replacement and arc file extraction. Keep original arc as .bak.
2026-03-29 19:00:50 -05:00
itsRevela b8cfd62cdf fix: sign correct tag for dedicated server release 2026-03-29 17:14:43 -05:00
itsRevela 97a1459929 feat: GPG-sign release tags for verified badge
Use crazy-max/ghaction-import-gpg to sign Nightly and
Nightly-Dedicated-Server tags with a GPG key so releases
show the green Verified badge on GitHub.
2026-03-29 14:47:53 -05:00
itsRevela 45987849b8 fix: add checkout to release jobs for gh cli 2026-03-29 14:29:06 -05:00
itsRevela 91e8b9cef4 fix: heredoc indentation and cleanup-tag without checkout
Remove --cleanup-tag (requires local git repo). Delete tags via API
instead. Fix heredoc terminators for release notes.
2026-03-29 14:21:05 -05:00
itsRevela cf7cd32116 feat: use GitHub API for signed release tags
Replace andelf/nightly-release with gh CLI commands that create tags
via the GitHub API, which auto-signs them with the github-actions bot
key for the green Verified badge.
2026-03-29 14:13:19 -05:00
itsRevela b3db1da8cb fix: set prerelease to false for nightly releases 2026-03-29 13:57:36 -05:00
itsRevela c405ee9036 fix: use correct release tags and client description
Use capitalized tags (Nightly, Nightly-Dedicated-Server) to match
existing releases. Restore full client release body with instructions,
multiplayer setup, and fork explanation.
2026-03-29 13:56:29 -05:00
itsRevela 0fd15d360f feat: consolidate nightly workflows with signed builds
Merge client and server nightly releases into a single workflow.
Add artifact attestation for signed builds. Use CMake instead of
MSBuild. Preserve LCRE naming, top-level zip folders, and commit
hash release titles.
2026-03-29 13:46:18 -05:00
itsRevela 59fd7266b6 Merge upstream/main (skip CI workflow changes) 2026-03-29 01:03:35 -05:00
rtm516 38d58f2d8b Update actions workflows and add clang format check for PRs (#1418)
* Add clang-format workflow for pull request checks

* Modify push paths in nightly workflow

Updated paths for push event to include all files except specified ones.

* Update paths for nightly-server workflow triggers

* Modify paths for pull request triggers

Update pull request workflow to include specific paths.

* Tidy up clang-format installation in workflow
2026-03-28 23:35:25 -05:00
itsRevela 245da783b3 feat: upgrade stream cipher from XOR to AES-128-CTR
Replace the XOR obfuscation cipher with AES-128-CTR using the Windows
BCrypt API. Key material grows from 16 to 32 bytes (16 AES key + 16 IV).
All callers auto-adjust via StreamCipher::KEY_SIZE. No handshake or
protocol changes needed beyond the larger MC|CKey payload.
2026-03-28 21:03:45 -05:00
Revela 1036c360dc Merge branch 'smartcmd:main' into main 2026-03-28 19:19:42 -05:00
itsRevela ba3ebe666c feat: dedicated server security hardening
Comprehensive security system to protect against packet-sniffing attacks,
XUID harvesting, privilege escalation, bot flooding, and XUID impersonation.

- Stream cipher: per-session XOR cipher with 4-message handshake via
  CustomPayloadPacket (MC|CKey, MC|CAck, MC|COn). Negotiated per-connection,
  backwards compatible (old clients/servers fall back to plaintext).
- Security gate: buffers all game data until cipher handshake completes,
  preventing unsecured clients from receiving any XUIDs or game state.
- Cipher handshake enforcer: kicks clients that don't complete the handshake
  within 5 seconds (configurable via require-secure-client).
- Identity tokens: persistent per-XUID tokens in identity-tokens.json,
  issued over the encrypted channel, verified on reconnect. Prevents XUID
  replay attacks. Client stores server-specific tokens.
- PROXY protocol v1: parses real client IPs from playit.gg tunnel headers
  so rate limiting, IP bans, and XUID spoof detection work per-player.
- Rate limiting: per-IP sliding window (default 5 connections/30s) with
  pending connection cap (default 10).
- Privilege hardening: OP requires ops.json, live checks on every command
  and privilege packet. Host-only server settings changes.
- XUID stripping: PreLoginPacket response sends INVALID_XUID placeholders.
- Packet validation: readUtf global string cap, reduced max packet size,
  stream desync protection on oversized strings.
- OpManager: persistent ops.json with XUID-based OP list.
- Whitelist improvements: whitelist add accepts player names with ambiguity
  detection, XUID cache from login attempts.
- revoketoken command: revoke identity tokens for players who lost theirs.
- server.log: persistent log file written alongside console output with
  flush-per-write to survive crashes.
- CLI security logging: consolidated per-join security summary with cipher
  status, token status, XUID, and real IP. Security warnings for kicks,
  spoofing, and unauthorized commands.
2026-03-28 19:18:06 -05:00
Botch 277d74716e Render custom skin boxes on viewmodel (#1415)
* Update PlayerRenderer.cpp

* Fix fatal bug where skins with no additional boxes would crash the game
2026-03-28 14:44:27 -05:00
Revela ed3fffcc6a Merge branch 'smartcmd:main' into main 2026-03-27 16:42:40 -05:00
Sestain 7447fabe0d Fix game crashing if DLC has XMLVERSION paramater (#1285)
* Fix game crashing if DLC has XMLVERSION paramater

* Better implementation of XMLVersion check

* Forgot to add type name to the list

* Removed extra newline
2026-03-27 15:11:27 -05:00
Sestain 3c1166c45e Added support for Big-Endian DLCs (#1291)
* Added support for Big-Endian DLCs

* Remove unused variable

* Remove the things made for other PR
2026-03-27 15:59:35 -04:00
Revela 4e678fbf6b Merge branch 'smartcmd:main' into main 2026-03-27 00:55:24 -05:00
Loki 0d4874dea5 Clarify Android support in README 2026-03-27 00:29:08 -05:00
itsRevela f1ec7a0d20 Send AddPlayerPacket for all players on join and RemoveEntitiesPacket on disconnect
Players now appear in each other's Tab list immediately on join,
regardless of render distance. Previously, players only appeared when
they entered entity tracking range because AddPlayerPacket was only
sent through the TrackedEntity system.

On disconnect, a RemoveEntitiesPacket is broadcast to all clients so
players added via the join broadcast are properly cleaned up, not just
those within tracking range.
2026-03-26 23:55:02 -05:00
itsRevela 1b423e48d3 Fix player list map icon colors to match map markers
The tab player list and teleport menu now show the correct map marker
color for each player. The icon is computed using the same hash as the
map renderer (getRandomPlayerMapIcon) and stored by player name,
bypassing the unreliable small-ID lookup that produced wrong colors
on dedicated servers.
2026-03-26 22:22:13 -05:00
itsRevela 35fbc7af17 Fix Ender Dragon damage, End portal transition, and End Poem crash
Dragon melee damage: reassign sub-entity IDs to be sequential from
the parent entity ID in ServerLevel::entityAdded(), so the client's
offset-based ID calculation matches the server. Previously the server's
smallId pool allocated non-sequential IDs, causing melee attacks to
target entity IDs the server didn't recognize.

End portal transition: ensure the player entity is always added to the
new level when transitioning from The End, not just for non-End
dimensions. The addEntity call was previously gated behind a
lastDimension != 1 check that also excluded it from End exits.

End Poem crash: bounds-check the WIN_GAME event's player index before
accessing localplayers[], with a fallback to prevent null dereference
when the server sends an out-of-range index.
2026-03-26 19:46:58 -05:00
itsRevela 2e75441355 Merge upstream: fix redstone tick persistence on chunk unload 2026-03-26 18:22:04 -05:00
itsRevela 6a21637e75 Fix player list not showing all players on dedicated servers
Register remote players in the client's IQNet array when their
AddPlayerPacket arrives, so they appear in the Tab player list.
Previously only the host and local player were registered.

Also filter the dedicated server's phantom host entry (slot 0, empty
gamertag) from the UI, fix tick() to update entries by smallId instead
of sequential index, and fix player removal to use gamertag matching
since XUIDs are 0 on dedicated servers.
2026-03-26 18:20:01 -05:00
666uvu 73d713878c fix redstone tick persistence on chunk unload (#1423) 2026-03-26 16:55:56 -05:00
itsRevela d292190aae Skip upstream piston fix #1420 (already applied in this fork) 2026-03-26 15:49:50 -05:00
itsRevela fbe14e7755 Add SRV record support for server connections
Resolve _minecraft._tcp.<hostname> SRV records before connecting,
matching Java Edition behavior. Players can connect using just a domain
name and the client will look up the actual server address and port
from DNS. Falls back to the original hostname/port if no SRV record
exists or the address is a numeric IP.
2026-03-26 15:45:24 -05:00
Revela 4f370c45e3 Fix pistons permanently breaking server-wide on dedicated servers (#1420)
triggerEvent() set ignoreUpdate to true at the start but three early
return paths skipped the reset at the end. Once any of these paths was
hit, the TLS flag stayed true permanently, blocking all piston neighbor
updates for the rest of the server session.
2026-03-26 15:16:15 -05:00
itsRevela f1310abe08 Refactor async server joining with eJoinState enum and dedicated progress UI
Replace the boolean-flag-based async join system with a clean state machine
(eJoinState enum) and move connection progress handling from UIScene_JoinMenu
into UIScene_ConnectingProgress as a dedicated UI class.

Combines the best of two approaches: non-blocking sockets with select()
timeout and SO_RCVTIMEO clearing (prevents random disconnects) with the
upstream's state enum, FinalizeJoin separation, and ConnectingProgress UI.

JoinGame() now returns JOINGAME_PENDING on Win64, and
PlatformNetworkManagerStub::DoWork() polls the join state to finalize
the connection when the background thread succeeds.
2026-03-26 11:51:17 -05:00
itsRevela 39b0ad1cb4 Merge upstream: skip async joining #1408 (already implemented), splitscreen XUID fix cherry-picked 2026-03-26 11:07:35 -05:00
Sylvessa 1ae70176d4 fix splitscreen xuids (#1413) 2026-03-26 11:07:30 -05:00
itsRevela f2fb995c84 Fix pistons permanently breaking server-wide on dedicated servers
triggerEvent() set ignoreUpdate to true at the start but three early
return paths (lines 221, 225, 250) skipped the reset at the end. Once
any of these paths was hit (common with fast redstone clocks where the
signal state changes between event queuing and processing), the TLS
flag stayed true permanently, blocking all piston neighbor updates for
the rest of the server session.
2026-03-26 10:40:43 -05:00
Sylvessa c96a8ee524 fix splitscreen xuids (#1413) 2026-03-26 10:19:20 -04:00
Sylvessa 1a50770647 Add asynchronous server joining (#1408) 2026-03-26 10:15:11 -04:00
Revela deb10de463 Update README for fork title change
MinecraftConsoles (Legacy Console Revelations Edition)
LCRE
2026-03-26 02:46:08 -05:00
itsRevela c0085a8336 Skip upstream revert of chunk unload commit (already fixed properly in this fork) 2026-03-26 02:33:32 -05:00
Loki Rautio dee559bd16 Revert "Memory leak fix: Make chunks unload properly (#1406)"
This reverts commit a24318eedc.
This fix introduces broken behavior for dedicated servers. It will be
merged back in once the related issue is fixed
2026-03-26 01:37:23 -05:00
itsRevela 13372692d5 change foldernames & filenames (LCRE) in release update script 2026-03-25 23:56:48 -05:00
itsRevela 6d28177e4c Fix client disconnect from leftover socket recv timeout
Clear the 5-second SO_RCVTIMEO that was set during the connection
handshake but never removed. The timeout persisted into the game
session, causing the client to disconnect whenever the server paused
for longer than 5 seconds (e.g. autosave, chunk I/O).

Also update README with chunk unloading and connection stability fixes.
2026-03-25 23:54:52 -05:00
itsRevela c264262b66 Fix chunk unloading regression from upstream merge
Commit a24318ee changed drop() to immediately remove chunks from cache,
bypassing the deferred m_toDrop save/unload pipeline. This caused missing
chunks on dedicated servers, iterator invalidation in dropAll() and
ServerLevel::save(), and entity duplication (item frames) from chunks
being reloaded without their entities first being removed from the level.

- ServerChunkCache::drop(): restore m_toDrop queue instead of immediate
  cache removal, so tick() can save/unload/move to unloadedCache safely
- MultiPlayerChunkCache::drop(): restore soft-unload (keep chunk in cache
  with loaded=true) instead of nulling cache and hasData
- PlayerChunkMap::setRadius(): remove dropAll() call when reducing radius,
  the per-chunk removal loop already handles out-of-range chunks
2026-03-25 19:57:35 -05:00
Revela 3a8106593f Merge branch 'smartcmd:main' into main 2026-03-25 10:58:16 -05:00
ModMaker101 a24318eedc Memory leak fix: Make chunks unload properly (#1406)
* Fix chunk unload and cleanup logic, fixes #1347

* Applying formatting to code I edited 😝
2026-03-24 23:25:18 -05:00
Revela 4c7f1a6385 Merge branch 'smartcmd:main' into main 2026-03-24 13:59:56 -05:00
itsRevela 2637577a62 Remove emdashes from README 2026-03-24 13:08:11 -05:00
itsRevela 08f14e32ae Add seed validation for server world creation and override-seed property
The dedicated server previously picked a completely random seed with no
biome diversity checks (the client validates but the server skipped it).
On top of that, the client's findSeed() was hardcoded to only check a
54-chunk (Classic) area, so Large worlds had no diversity guarantee
beyond the center.

New server worlds now use findSeed() scaled to the full target world
size. Added override-seed in server.properties to fix existing worlds
without deleting them.
2026-03-24 13:07:04 -05:00
itsRevela 5dad6c24f7 Fix server list refresh and add cancellable non-blocking connection
Server list: edits and deletions now update the UI immediately by
calling SearchForGames() in ForceFriendsSessionRefresh() and
UpdateGamesList() on nav-back to LoadOrJoinMenu.

Connection: moved WinsockNetLayer::JoinGame() to a background thread
with non-blocking sockets (5s timeout, 3 retries). Users can cancel
with B/Escape during the attempt. Failed connections always show an
error dialog.
2026-03-24 11:30:14 -05:00
Sylvessa 993052409a Fix XUID logging (#1395)
* pass invalid_xuid to other players

* actually more simple fix
2026-03-24 05:04:07 -04:00
Ayush Thoren ed9cbae3f7 Fix initial cursor position for in-game UI elements (#1120)
Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
2026-03-23 21:06:20 -05:00
Sylvessa daed75b8a1 make handleParticleEvent actually parse the particle type instead of hardcoding hearts (#1399) 2026-03-23 20:11:37 -05:00
rtm516 9e715cb3bc Fix render order of F3 debug screen (#1239) 2026-03-23 18:01:40 -05:00
Sylvessa 127465b0eb add advanced tooltips, F3+H combo, and handle settings (#1389) 2026-03-23 17:54:46 -05:00
itsRevela d4d5ffe403 Fix archive path for new Windows username 2026-03-23 12:34:32 -05:00
itsRevela dd4b76d02a Disable automatic release on push for nightly-server workflow 2026-03-23 12:33:48 -05:00
itsRevela e1446953c4 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	CMakeLists.txt
#	Minecraft.Client/CMakeLists.txt
#	Minecraft.Client/ClientConnection.cpp
#	Minecraft.Client/Common/Media/MediaWindows64.arc
#	Minecraft.Client/Common/UI/UIControl_TextInput.cpp
#	Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp
#	Minecraft.Client/Gui.cpp
#	Minecraft.Client/PlayerList.cpp
#	Minecraft.Client/ServerPlayerGameMode.cpp
#	Minecraft.Client/Windows64/KeyboardMouseInput.h
#	Minecraft.Client/Windows64Media/strings.h
#	Minecraft.Client/cmake/sources/Windows.cmake
#	Minecraft.Server/CMakeLists.txt
#	Minecraft.Server/ServerProperties.cpp
#	Minecraft.Server/ServerProperties.h
#	Minecraft.Server/Windows64/ServerMain.cpp
#	Minecraft.Server/cmake/sources/Common.cmake
#	Minecraft.World/cmake/sources/Common.cmake
#	README.md
2026-03-23 12:29:00 -05:00
itsRevela cbc0617dcd Update README with upstream merge features 2026-03-23 12:22:03 -05:00
itsRevela 58c73d1052 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	Minecraft.Client/Common/Media/MediaWindows64.arc
#	Minecraft.Client/Common/UI/UIControl_TextInput.cpp
2026-03-23 12:12:37 -05:00
itsRevela 712ae60a6f Fix unicode glyph color in per-vertex font rendering path
The upstream font color fix (commit be7e2ca9) switched from glColor4f to
per-vertex t->color() but renderUnicodeCharacter() still relied on glColor4f.
Set glColor4f to currentColor before rendering unicode glyphs and restore
white after, and re-apply t->color() when resuming the batched draw.
2026-03-23 12:09:57 -05:00
itsRevela 3ea2eda597 Fix: CMP0057 policy was not set (#1367) 2026-03-23 11:58:13 -05:00
itsRevela 93532ef533 Stained Glass Survival Integration & Crafting UI Fix (#1195) 2026-03-23 11:58:13 -05:00
itsRevela d446985f12 Add clipboard paste support to UIControl_TextInput and UIScene_Keyboard (#1298)
Resolved conflicts with existing fork paste implementation - adopted upstream's
batch sanitize-then-insert approach over char-by-char insertion.
2026-03-23 11:57:59 -05:00
itsRevela 33a3d69fc8 Clicking outside container now drops items (#1306) 2026-03-23 11:57:16 -05:00
itsRevela 8e820975b1 Allow displaying item lore (#1384) 2026-03-23 11:57:16 -05:00
itsRevela dde608b1e9 Fix missing trapped chest textures in Natural Texture Pack (#1381) 2026-03-23 11:57:16 -05:00
itsRevela 1dda62a924 Remove redundant buffer in UIScene_SettingsGraphicsMenu.cpp (#1348) (#1380) 2026-03-23 11:57:16 -05:00
itsRevela a4ca19ff17 Add ifdef debug around handle debug options (#1382) 2026-03-23 11:57:15 -05:00
itsRevela d7c0830eb4 Fix font rendering for color and formatting codes (#1017) 2026-03-23 11:56:36 -05:00
itsRevela 3fa959ab07 Fix Sign (#1369) + re-add VSync/ExclusiveFullscreen checkboxes
Cherry-picked upstream sign fix (SignEntryMenu720 restored) and re-applied
VSync and ExclusiveFullscreen checkbox patches to all SettingsGraphicsMenu SWFs
using the ffdec_lib Java tools.
2026-03-23 11:49:12 -05:00
itsRevela 4adce63f3d Update maximum limits for game entities (#1355) 2026-03-23 11:35:48 -05:00
itsRevela bb16e953a7 Fix CMake build configuration for Windows64 platform
- Add #include <windows.h> to extraX64.h for Windows type definitions
- Remove duplicate byte typedef and suppress std::byte via _HAS_STD_BYTE=0
- Define _WINDOWS64 for correct platform header selection
- Set IGGY_LIBS to iggy_w64.lib for proper Iggy UI library linking
2026-03-23 11:31:51 -05:00
Connor Beard 77433dbd86 Fix: CMP0057 policy was not set (#1367) 2026-03-22 23:27:42 -05:00
Connor Beard 57f031a7c8 Fix: CMP0057 policy was not set (#1367) 2026-03-22 23:27:42 -05:00
Lord Cambion 9a6d126ae1 Stained Glass Survival Integration & Crafting UI Fix (#1195)
* Added Stained Glass

i found out that stained glass  was not accessible in survival, then i  saw they disabled it in the code

* Grouping glass correctly in crafting table

I removed the #if/endif from the ClothDyeRecipes.cpp and added a different one in StructureRecipies.cpp
also changed the Tile definition giving it the same
setBaseItemTypeAndMaterial of stained glass to group it correctly inside the crafting table UI.
also aincremented the Vertical Slot for crafting table to include many more craftings in the same group
2026-03-22 21:15:02 -05:00
Lord Cambion 174eba45c7 Stained Glass Survival Integration & Crafting UI Fix (#1195)
* Added Stained Glass

i found out that stained glass  was not accessible in survival, then i  saw they disabled it in the code

* Grouping glass correctly in crafting table

I removed the #if/endif from the ClothDyeRecipes.cpp and added a different one in StructureRecipies.cpp
also changed the Tile definition giving it the same
setBaseItemTypeAndMaterial of stained glass to group it correctly inside the crafting table UI.
also aincremented the Vertical Slot for crafting table to include many more craftings in the same group
2026-03-22 21:15:02 -05:00
Revela 39e46751bf Add clipboard paste support to UIControl_TextInput and UIScene_Keyboard (#1298)
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-22 21:09:10 -05:00
Revela dec26b43d5 Add clipboard paste support to UIControl_TextInput and UIScene_Keyboard (#1298)
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-22 21:09:10 -05:00
Alezito2008 ebab3ec40f Clicking outside container now drops items (#1306)
Java Edition KBM input parity
2026-03-22 21:05:04 -05:00
Alezito2008 dbee7d398e Clicking outside container now drops items (#1306)
Java Edition KBM input parity
2026-03-22 21:05:04 -05:00
Sylvessa c1ce97f7be allow displaying item lore (#1384) 2026-03-22 20:50:06 -05:00
Sylvessa 16d7ecd283 allow displaying item lore (#1384) 2026-03-22 20:50:06 -05:00
Iruka Wolf 603c6ba7cb Fix missing trapped chest textures in Natural Texture Pack (#1381)
Co-authored-by: Iruka-Wolf <17684713+Iruka-Wolf@users.noreply.github.com>
2026-03-22 20:49:14 -05:00
Iruka Wolf 9f19b25a16 Fix missing trapped chest textures in Natural Texture Pack (#1381)
Co-authored-by: Iruka-Wolf <17684713+Iruka-Wolf@users.noreply.github.com>
2026-03-22 20:49:14 -05:00
Sylvessa b6e25415ca Remove redundant buffer in UIScene_SettingsGraphicsMenu.cpp (#1348) (#1380) 2026-03-22 18:37:59 -04:00
Sylvessa 1c24421358 Remove redundant buffer in UIScene_SettingsGraphicsMenu.cpp (#1348) (#1380) 2026-03-22 18:37:59 -04:00
Sylvessa dac073605f add ifdef debug around handle debug options (#1382) 2026-03-22 13:38:35 -04:00
Sylvessa 9c15309018 add ifdef debug around handle debug options (#1382) 2026-03-22 13:38:35 -04:00
Ayush Thoren be7e2ca91d Fix font rendering for color and formatting codes (#1017)
* Fix "Colormatic" splash text rendering as single color

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>

* Use per-vertex coloring in a single batch

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>

* Fix font rendering for color and formatting codes

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>

---------

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
2026-03-22 00:33:35 -04:00
Ayush Thoren f39b44e75e Fix font rendering for color and formatting codes (#1017)
* Fix "Colormatic" splash text rendering as single color

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>

* Use per-vertex coloring in a single batch

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>

* Fix font rendering for color and formatting codes

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>

---------

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
2026-03-22 00:33:35 -04:00
GabsPuNs 250accd40b Fix Sign (#1369)
fix for the sign's interface.

SignEntryMenu720 was being replaced by an older version of SkinWinHD.

SignEntryMenu720 was is now replaced with it's original version.
2026-03-21 17:49:21 -04:00
GabsPuNs 4a0f799b02 Fix Sign (#1369)
fix for the sign's interface.

SignEntryMenu720 was being replaced by an older version of SkinWinHD.

SignEntryMenu720 was is now replaced with it's original version.
2026-03-21 17:49:21 -04:00
Jazzitch 33b008c96a Update maximum limits for game entities (#1355)
* Update maximum limits for game entities

Increased the maximum limits for Xbox boats, console minecarts, dispensable fireballs, and projectiles.

* Update maximum limits for game entities

Increased maximum limits for Xbox boats, console minecarts, dispensable fireballs, and projectiles.
2026-03-21 16:15:47 -04:00
Jazzitch 1f4dceb89b Update maximum limits for game entities (#1355)
* Update maximum limits for game entities

Increased the maximum limits for Xbox boats, console minecarts, dispensable fireballs, and projectiles.

* Update maximum limits for game entities

Increased maximum limits for Xbox boats, console minecarts, dispensable fireballs, and projectiles.
2026-03-21 16:15:47 -04:00
Revela b406456d13 Update README with music fix info
Added music context fixes
2026-03-21 12:41:20 -05:00
Revela c62d5e6ff4 Fix music selection to match TU19 behavior
Menu music (menu1-4) now plays only on the title screen, creative
music (creative1-6) only plays in creative mode, and survival mode
correctly plays only calm/hal/nuance/piano tracks. Reordered the
eMUSICFILES enum so piano tracks are contiguous with the survival
range, added game-mode-aware track selection via getOverworldMusicID,
and re-enabled the playStreaming call in setLevel to stop menu music
when entering gameplay. Added debug logging for track selection.
2026-03-21 12:33:04 -05:00
Revela cbbac3936c update readme with removing performance optimization detail
Removed lighting optimization details as this change caused issues
2026-03-19 17:06:02 -05:00
Revela 34cb0b10e4 Update swap chain validation in ResizeD3D function
Modified the conditional check in `ResizeD3D` to use
`(IDXGISwapChain*)&g_swapChainProxy` instead of `g_pSwapChain`.
This change ensures the correct proxy is validated. Updated
the debug print statement for clearer output regarding
the render manager's device and swap chain pointers.
2026-03-19 12:07:43 -05:00
Revela 4fffcac6e7 Add VSync and fullscreen settings, fix swap chain resize and revert lighting changes
- Add VSync and Exclusive Fullscreen toggles to the graphics settings menu
- Rewrite D3D11 swap chain to use DXGI flip model with tearing support
- Fix black screen on resize by creating new swap chain instead of ResizeBuffers
- Revert conditional lighting optimization in Level::setTileAndData back to unconditional checkLight
- Revert deferred lightGaps flagging in LevelChunk::recalcHeight back to immediate lightGap calls
- Add SWF/ARC editing tools used to add new UI checkboxes
2026-03-19 11:04:49 -05:00
Revela 0a343d2c8d Merge branch 'smartcmd:main' into main 2026-03-19 03:15:11 -05:00
Matthew Toro ecb3f00bd6 Revert "Increase limits for boats, minecarts, fireballs, and height (#1325)" (#1341)
This reverts commit baa9fc058d.
2026-03-18 20:52:48 -04:00
Matthew Toro b336e52f91 Revert "Increase limits for boats, minecarts, fireballs, and height (#1325)" (#1341)
This reverts commit baa9fc058d.
2026-03-18 20:52:48 -04:00
Adem Kurt 71d6fba4b9 Fix: opening the horse's inventory plays sound effects twice (#1336) 2026-03-18 20:11:07 -04:00
Adem Kurt f537096a21 Fix: opening the horse's inventory plays sound effects twice (#1336) 2026-03-18 20:11:07 -04:00
ButterSword baa9fc058d Increase limits for boats, minecarts, fireballs, and height (#1325) 2026-03-18 20:10:24 -04:00
ButterSword 679d7cf67f Increase limits for boats, minecarts, fireballs, and height (#1325) 2026-03-18 20:10:24 -04:00
Xenovyy ab80b34c45 Update banner.png to new logo (#1323)
Update banner.png to new logo
2026-03-18 20:08:40 -04:00
Xenovyy 0b12046f61 Update banner.png to new logo (#1323)
Update banner.png to new logo
2026-03-18 20:08:40 -04:00
Revela e3649573d3 Update Latest section with performance optimization summary 2026-03-18 17:26:02 -05:00
Revela 0ba923f085 Performance optimizations: sound caching, renderer culling, entity and lighting improvements
- Sound engine: cache filesystem probe results to avoid repeated file existence checks; add MA_SOUND_FLAG_DECODE for pre-decoded playback
- Level renderer: column-level frustum culling, compact visible chunk lists to skip empty iteration, lightweight second-pass render path, early-out for non-dirty chunks, scaled recheck period at high render distances
- Entity: cache shared_from_this() to reduce reference counting overhead in move() and checkInsideTiles()
- Level: skip checkLight() when tile light properties unchanged; enable entity locking on all platforms (not just Vita)
- LevelChunk: only rescan min height when the minimum column changes; defer lightGap processing
- LivingEntity: use raw pointer cast instead of dynamic_pointer_cast; cache friction tile lookup
- ServerPlayerGameMode: return whether block was destroyed to avoid redundant tile update packets
2026-03-18 17:22:04 -05:00
Revela 80ba2e0762 Remove Minecraft.Client.pdb from nightly release upload
Updated `Update-NightlyRelease.ps1` to exclude the upload of the `Minecraft.Client.pdb` file. The asset list in the log output has also been adjusted to reflect this change.
2026-03-17 18:47:30 -05:00
Revela b0b358c44e Update Latest section with CMake migration and Arabic text shaping 2026-03-17 18:44:02 -05:00
Revela 00401a5b3a Merge remote-tracking branch 'upstream/main' 2026-03-17 18:35:24 -05:00
Revela b7a33dc82b Add UIUnicodeBitmapFont to CMake source lists and update nightly release paths
The upstream CMake migration missed UIUnicodeBitmapFont in the Windows
client and server source lists, causing linker errors. Also update
nightly release script paths from x64/ to build/ for CMake output.
2026-03-17 18:32:15 -05:00
Xenovyy a94ee1ca22 Fixed the ear bleeding sound when using a slider with mouse controls (#1296)
* Fixed the ear bleeding sound when using a slider with mouse controls

Now only ticks every 9 "ticks" unless the slider has less than 18 possible values..

* cured rtm516's ocd

title

* rtm516 reaches enlightenment

* rtm516 reaches total enlightenment
2026-03-17 22:44:12 +00:00
Xenovyy 6dd9eb4890 Fixed the ear bleeding sound when using a slider with mouse controls (#1296)
* Fixed the ear bleeding sound when using a slider with mouse controls

Now only ticks every 9 "ticks" unless the slider has less than 18 possible values..

* cured rtm516's ocd

title

* rtm516 reaches enlightenment

* rtm516 reaches total enlightenment
2026-03-17 22:44:12 +00:00
rtm516 b774d13806 Fix zip command when packaging release 2026-03-17 22:36:52 +00:00
rtm516 2d4c725934 Fix zip command when packaging release 2026-03-17 22:36:52 +00:00
Revela c3ca509b44 Add x64_* build output directories to .gitignore 2026-03-17 17:29:02 -05:00
Revela b58f7c8fdd 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 e786604228 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
Matthew Toro 6df8089003 Merge pull request #669 from qwasdrizzel/main
Fix crash when FOV is equal to zero
2026-03-17 18:03:57 -04:00
Matthew Toro b1eb9a34a4 Merge pull request #669 from qwasdrizzel/main
Fix crash when FOV is equal to zero
2026-03-17 18:03:57 -04:00
rtm516 76f4832a6b Fix actions and sort docker nightly 2026-03-17 22:02:24 +00:00
rtm516 89d364ec50 Fix actions and sort docker nightly 2026-03-17 22:02:24 +00:00
rtm516 02a5961f39 Move project to CMake (#781)
* Move to cmake

* Move sources to source_groups and ditch more old VS files

* Add BuildVer.h generation

* Break out cmake source lists to platforms

* Don't copy swf files

* Revert audio changes from merge

* Add platform defines

* Match MSBuild flags

* Move BuildVer.h to common include and fix rebuild issue

* Seperate projects properly

* Exclude more files and make sure GameHDD exists

* Missing line

* Remove remaining VS project files

* Update readme and actions

* Use incremental LTCG

* Update workflows

* Update build workflows and output folder

* Disable vcpkg checks

* Force MSVC

* Use precompiled headers

* Only use PCH for cpp

* Exclude compat_shims from PCH

* Handle per-platform source includes

* Copy only current platform media

* Define Iggy libs per platform

* Fix EnsureGameHDD check

* Only set WIN32_EXECUTABLE on Windows

* Correct Iggy libs path

* Remove include of terrain_MipmapLevel

* Correct path to xsb/xwb

* Implement copilot suggestions

* Add clang flags (untested)

* Fix robocopy error checking

* Update documentation

* Drop CMakePresets.json version as we dont use v6 features

* Always cleanup artifacts in nightly even if some builds fail

* Re-work compiler target options

* Move newer iggy dll into redist and cleanup

* Fix typos

* Remove 'Source Files' from all source groups

* Remove old ps1 build scripts
2026-03-17 16:39:22 -05:00
rtm516 df4c9831c4 Move project to CMake (#781)
* Move to cmake

* Move sources to source_groups and ditch more old VS files

* Add BuildVer.h generation

* Break out cmake source lists to platforms

* Don't copy swf files

* Revert audio changes from merge

* Add platform defines

* Match MSBuild flags

* Move BuildVer.h to common include and fix rebuild issue

* Seperate projects properly

* Exclude more files and make sure GameHDD exists

* Missing line

* Remove remaining VS project files

* Update readme and actions

* Use incremental LTCG

* Update workflows

* Update build workflows and output folder

* Disable vcpkg checks

* Force MSVC

* Use precompiled headers

* Only use PCH for cpp

* Exclude compat_shims from PCH

* Handle per-platform source includes

* Copy only current platform media

* Define Iggy libs per platform

* Fix EnsureGameHDD check

* Only set WIN32_EXECUTABLE on Windows

* Correct Iggy libs path

* Remove include of terrain_MipmapLevel

* Correct path to xsb/xwb

* Implement copilot suggestions

* Add clang flags (untested)

* Fix robocopy error checking

* Update documentation

* Drop CMakePresets.json version as we dont use v6 features

* Always cleanup artifacts in nightly even if some builds fail

* Re-work compiler target options

* Move newer iggy dll into redist and cleanup

* Fix typos

* Remove 'Source Files' from all source groups

* Remove old ps1 build scripts
2026-03-17 16:39:22 -05:00
Loki Rautio 1a3fcb5b20 Remove Miles Sound System from credits
we don't use it anymore!
2026-03-17 16:22:49 -05:00
Loki Rautio feb4b3ac8b Remove Miles Sound System from credits
we don't use it anymore!
2026-03-17 16:22:49 -05:00
Loki Rautio a3ca23fdf6 Cleanup project credits and README 2026-03-17 16:15:26 -05:00
Loki Rautio f4626606e4 Cleanup project credits and README 2026-03-17 16:15:26 -05:00
Toru the Red Fox c98153bf07 Fix FOV modification so it respects applyEffects (#1297) 2026-03-17 19:47:34 +00:00
Toru the Red Fox ab4de7c87e Fix FOV modification so it respects applyEffects (#1297) 2026-03-17 19:47:34 +00:00
Matthew Toro a5f5595c63 Merge pull request #1315 from dognews/main
LoadJoinMenu UI Bug Fix: Properly display space indicator, remove label placeholder [BUG: #1004]
2026-03-17 15:45:22 -04:00
Matthew Toro d1673536c3 Merge pull request #1315 from dognews/main
LoadJoinMenu UI Bug Fix: Properly display space indicator, remove label placeholder [BUG: #1004]
2026-03-17 15:45:22 -04:00
Matthew Toro dc8af13b45 Merge pull request #1321 from rtm516/fix/host-settings
Change KEY_HOST_SETTINGS back to to VK_TAB
2026-03-17 15:41:26 -04:00
Matthew Toro 4e408a5b4a Merge pull request #1321 from rtm516/fix/host-settings
Change KEY_HOST_SETTINGS back to to VK_TAB
2026-03-17 15:41:26 -04:00
rtm516 ab16f3bf45 Change KEY_HOST_SETTINGS back to to VK_TAB 2026-03-17 19:22:24 +00:00
rtm516 681dc7cefe Change KEY_HOST_SETTINGS back to to VK_TAB 2026-03-17 19:22:24 +00:00
Alex 994a23f96b Fix save space indicator display
Include space indicator UI element in windows build, logic to handle getting save file sizes on windows
2026-03-17 07:44:52 -07:00
Alex 1c3aeb9f02 Fix save space indicator display
Include space indicator UI element in windows build, logic to handle getting save file sizes on windows
2026-03-17 07:44:52 -07:00
Revela d473ef0dc5 Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-17 00:32:54 -05:00
Revela 0d269f0c83 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 f20b0d252c 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 0644d7da5c Merge branch 'smartcmd:main' into main 2026-03-16 23:12:41 -05:00
Revela d7822ac81e 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
qwasdrizzel d359957727 fix 2026-03-16 21:54:29 -05:00
qwasdrizzel a101555fde fix 2026-03-16 21:54:29 -05:00
qwasdrizzel ce739f6045 Merge branch 'smartcmd:main' into main 2026-03-16 21:44:26 -05:00
qwasdrizzel 9910a1adf4 Merge branch 'smartcmd:main' into main 2026-03-16 21:44:26 -05:00
GabsPuNs 5a59f5d146 Update to more accurate logo (#1305)
* Updated Logo

* Updated two old files.
2026-03-16 19:00:51 -05:00
GabsPuNs 4d9067dbfb Update to more accurate logo (#1305)
* Updated Logo

* Updated two old files.
2026-03-16 19:00:51 -05:00
Revela a3395329e5 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 3980cd813a 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 289f1ccd6a Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-16 08:10:47 -05:00
Revela 9af36133cc 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 4a3128d32b 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 9a13ce9856 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 090dd49ccd 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 88274ebad1 Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-16 03:25:10 -05:00
Revela 091564cdce 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 30fd14096e 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 8a6934c83c 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 c92a5ab31a Merge upstream/main into main 2026-03-15 23:38:41 -05:00
ZorpLemon 5d19215e60 Comment out FOV modification line, since the FOV is stored and doesn't need to be adjusted. (#1248)
I guess this line was just the games way of applying modifications the player made to the FOV. But since whenever ago someone changed the way the FOV stuff is saved, so this line just adds the difference *again* causing issues when the FOV is set above 70. Setting your FOV to 80 actually sets it to 90, and setting it to 110 actually sets it to 150.
2026-03-15 18:14:15 -05:00
Ananasloll3 1fe25a9398 Fix audio volume levels for cows and bats (#1225)
Cow volume 0.4f to 1.f
Bat volume 0.1f to 0.8f
2026-03-15 18:13:11 -05:00
iris 3810c96d14 Fix game crashing when crafting fireworks (#1230) (#1240) 2026-03-15 18:13:03 -05:00
Xenovyy 5f76a7cc49 Adjusted Exit Game title (#1277)
* Adjusted Exit Game title

Replaced "Return to Xbox Dashboard" with "Exit Minecraft" on the exit game screen.

* Fixed Blending on Intro Sequence

Fixed Blocky, Crappy blending on the ESRB and Mojang Logos in the Intro Sequence.
2026-03-15 18:12:53 -05:00
retucio ecfdeeb1b5 organized keybinds a lil bit (#1279) 2026-03-15 18:11:55 -05:00
kuwa c05b104223 Fix server DedicatedServer issues (#1266)
* add: Dedicated Server implementation

- Introduced `ServerMain.cpp` for the dedicated server logic, handling command-line arguments, server initialization, and network management.
- Created `postbuild_server.ps1` script for post-build tasks, including copying necessary resources and DLLs for the dedicated server.
- Added `CopyServerAssets.cmake` to manage the copying of server assets during the build process, ensuring required files are available for the dedicated server.
- Defined project filters in `Minecraft.Server.vcxproj.filters` for better organization of server-related files.

* add: refactor world loader & add server properties

- Introduced ServerLogger for logging startup steps and world I/O operations.
- Implemented ServerProperties for loading and saving server configuration from `server.properties`.
- Added WorldManager to handle world loading and creation based on server properties.
- Updated ServerMain to integrate server properties loading and world management.
- Enhanced project files to include new source and header files for the server components.

* update: implement enhanced logging functionality with configurable log levels

* update: update keyboard and mouse input initialization 1dc8a005ed

* fix: change virtual screen resolution to 1920x1080(HD)

Since 31881af56936aeef38ff322b975fd0 , `skinHud.swf` for 720 is not included in `MediaWindows64.arc`,
the app crashes unless the virtual screen is set to HD.

* fix: dedicated server build settings for miniaudio migration and missing sources

- remove stale Windows64 Miles (mss64) link/copy references from server build
- add Common/Filesystem/Filesystem.cpp to Minecraft.Server.vcxproj
- add Windows64/PostProcesser.cpp to Minecraft.Server.vcxproj
- fix unresolved externals (PostProcesser::*, FileExists) in dedicated server build

* update: changed the virtual screen to 720p

Since the crash caused by the 720p `skinHud.swf` not being included in `MediaWindows64.arc` has been resolved, switching back to 720p to reduce resource usage.

* add: add Docker support for Dedicated Server

add with entrypoint and build scripts

* fix: add initial save for newly created worlds in dedicated server

on the server side, I fixed the behavior introduced after commit aadb511, where newly created worlds are intentionally not saved to disk immediately.

* update: add basically all configuration options that are implemented in the classes to `server.properties`

* update: add LAN advertising configuration for server.properties

LAN-Discovery, which isn’t needed in server mode and could potentially be a security risk, has also been disabled(only server mode).

* add: add implementing interactive command line using linenoise

- Integrated linenoise library for line editing and completion in the server console.
- Updated ServerLogger to handle external writes safely during logging.
- Modified ServerMain to initialize and manage the ServerCli for command input.
- The implementation is separate from everything else, so it doesn't affect anything else.
- The command input section and execution section are separated into threads.

* update: enhance command line completion with predictive hints

Like most command line tools, it highlights predictions in gray.

* add: implement `StringUtils` for string manipulation and refactor usages

Unified the scattered utility functions.

* fix: send DisconnectPacket on shutdown and fix Win64 recv-thread teardown race

Before this change, server/host shutdown closed sockets directly in
ServerConnection::stop(), which bypassed the normal disconnect flow.
As a result, clients could be dropped without receiving a proper
DisconnectPacket during stop/kill/world-close paths.

Also, WinsockNetLayer::Shutdown() could destroy synchronization objects
while host-side recv threads were still exiting, causing a crash in
RecvThreadProc (access violation on world close in host mode).

* fix: return client to menus when Win64 host connection drops

- Add client-side host disconnect handling in CPlatformNetworkManagerStub::DoWork() for _WINDOWS64.
- When in QNET_STATE_GAME_PLAY as a non-host and WinsockNetLayer::IsConnected() becomes false, trigger g_NetworkManager.HandleDisconnect(false) to enter the normal disconnect/UI flow.
- Use m_bLeaveGameOnTick as a one-shot guard to prevent repeated disconnect handling while the link remains down.
- Reset m_bLeaveGameOnTick on LeaveGame(), HostGame(), and JoinGame() to avoid stale state across sessions.

* update: converted Japanese comments to English

* add: create `Minecraft.Server` developer guide in English and Japanese

* update: add note about issue

* add: add `nlohmann/json` json lib

* add: add FileUtils

Moved file operations to `utils`.

* add: Dedicated Server BAN access manager with persistent player and IP bans

- add Access frontend that publishes thread-safe ban manager snapshots for dedicated server use
- add BanManager storage for banned-players.json and banned-ips.json with load/save/update flows
- add persistent player and IP ban checks during dedicated server connection handling
- add UTF-8 BOM-safe JSON parsing and shared file helpers backed by nlohmann/json
- add Unicode-safe ban file read/write and safer atomic replacement behavior on Windows
- add active-ban snapshot APIs and expiry-aware filtering for expires metadata
- add RAII-based dedicated access shutdown handling during server startup and teardown

* update: changed file read/write operations to use `FileUtils`.

- As a side effect, saving has become faster!

* fix: Re-added the source that had somehow disappeared.

* add: significantly improved the dedicated server logging system

- add ServerLogManager to Minecraft.Server as the single entry point for dedicated-server log output
- forward CMinecraftApp logger output to the server logger when running with g_Win64DedicatedServer
- add named network logs for incoming, accepted, rejected, and disconnected connections
- cache connection metadata by smallId so player name and remote IP remain available for disconnect logs
- keep Minecraft.Client changes minimal by using lightweight hook points and handling log orchestration on the server side

* fix: added the updated library source

* add: add `ban` and `pardon` commands for Player and IP

* fix: fix stop command shutdown process

add dedicated server shutdown request handling

* fix: fixed the save logic during server shutdown

Removed redundant repeated saves and eliminated the risks of async writes.

* update: added new sever files to Docker entrypoint

* fix: replace shutdown flag with atomic variable for thread safety

* update: update Dedicated Server developer guide

English is machine translated.
Please forgive me.

* update: check for the existence of `GameHDD` and create

* add: add Whitelist to Dedicated Server

* refactor: clean up and refactor the code

- unify duplicated implementations that were copied repeatedly
- update outdated patterns to more modern ones

* fix: include UI header (new update fix)

* fix: fix the detection range for excessive logging

`getHighestNonEmptyY()` returning `-1` occurs normally when the chunk is entirely air.
The caller (`Minecraft.World/LevelChunk.cpp:2400`) normalizes `-1` to `0`.

* update: add world size config to dedicated server properties

* update: update README add explanation of  `server.properties` & launch arguments

* update: add nightly release workflow for dedicated server and client builds to Actions

* fix: update name for workflow

* add random seed generation

* add: add Docker nightly workflow for Dedicated Server publish to GitHub Container Registry

* fix: ghost player when clients disconnect out of order

#4

* fix: fix 7zip option

* fix: fix Docker workflow for Dedicated Server artifact handling

* add: add no build Dedicated Server startup scripts and Docker Compose

* update: add README for Docker Dedicated Server setup with no local build

* refactor: refactor command path structure

As the number of commands has increased and become harder to navigate, each command has been organized into separate folders.

* update: support stream(file stdin) input mode for server CLI

Support for the stream (file stdin) required when attaching a tty to a Docker container on Linux.

* add: add new CLI Console Commands for Dedicated Server

Most of these commands are executed using the command dispatcher implemented on the `Minecraft.World` side. When registering them with the dispatcher, the sender uses a permission-enabled configuration that treats the CLI as a player.

- default game.
- enchant
- experience.
- give
- kill(currently, getting a permission error for some reason)
- time
- weather.
- update tp & gamemode command

* fix: change player map icon to random select

* update: increase the player limit

* add: restore the basic anti-cheat implementation and add spawn protection

Added the following anti-cheat measures and add spawn protection to `server.properties`.
- instant break
- speed
- reach

* fix: fix Docker image tag

* make chunks delay less for dedi

* fix: prevent overwriting allow-flight value on server startup

* fix: mitigate entity id overflow and crash for max chunk updates

* remove autosave prompt for dedicated server

* fix: fix `Failed to create window instance.`

Wait for Xvfb to be fully ready before starting.

* Revert wrong readme order

---------

Co-authored-by: sylvessa <225480449+sylvessa@users.noreply.github.com>
Co-authored-by: Loki Rautio <lokirautio@gmail.com>
2026-03-15 15:50:12 -05:00
Matthew Toro 22bce8e1ee fix: removed headlesss server logic in favor of the new server exe. (#1265) 2026-03-15 15:43:27 -05:00
Revela 04329d840a 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 77ea49440c 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 610a1c7aa7 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 20e237dfaf 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 9c01398cd4 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 3f24d52ee3 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 f66f5f9cd3 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 f612574c67 Update README with new features and functionality
Added details about in-game screenshot functionality
2026-03-15 05:46:51 -05:00
Revela 0f89dea817 Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-15 04:00:31 -05:00
Revela f0495c546c 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 6aea7c4bb7 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
Loki Rautio b415a6bf6b Update README.md 2026-03-15 03:10:20 -05:00
Loki Rautio d5320de154 Update README.md
fixed up some ordering and made it a little more organized, added new
banner image
2026-03-15 03:09:41 -05:00
Loki Rautio b739987996 Remove .vscode settings by default
this makes it impossible to search for stuff in the assets with VS Code
which sucks. if you need this you can just copy the file locally
2026-03-15 02:44:59 -05:00
kuwa 9079db0315 Dedicated Server Software - Minecraft.Server.exe (#498)
* add: Dedicated Server implementation

- Introduced `ServerMain.cpp` for the dedicated server logic, handling command-line arguments, server initialization, and network management.
- Created `postbuild_server.ps1` script for post-build tasks, including copying necessary resources and DLLs for the dedicated server.
- Added `CopyServerAssets.cmake` to manage the copying of server assets during the build process, ensuring required files are available for the dedicated server.
- Defined project filters in `Minecraft.Server.vcxproj.filters` for better organization of server-related files.

* add: refactor world loader & add server properties

- Introduced ServerLogger for logging startup steps and world I/O operations.
- Implemented ServerProperties for loading and saving server configuration from `server.properties`.
- Added WorldManager to handle world loading and creation based on server properties.
- Updated ServerMain to integrate server properties loading and world management.
- Enhanced project files to include new source and header files for the server components.

* update: implement enhanced logging functionality with configurable log levels

* update: update keyboard and mouse input initialization 1dc8a005ed

* fix: change virtual screen resolution to 1920x1080(HD)

Since 31881af56936aeef38ff322b975fd0 , `skinHud.swf` for 720 is not included in `MediaWindows64.arc`,
the app crashes unless the virtual screen is set to HD.

* fix: dedicated server build settings for miniaudio migration and missing sources

- remove stale Windows64 Miles (mss64) link/copy references from server build
- add Common/Filesystem/Filesystem.cpp to Minecraft.Server.vcxproj
- add Windows64/PostProcesser.cpp to Minecraft.Server.vcxproj
- fix unresolved externals (PostProcesser::*, FileExists) in dedicated server build

* update: changed the virtual screen to 720p

Since the crash caused by the 720p `skinHud.swf` not being included in `MediaWindows64.arc` has been resolved, switching back to 720p to reduce resource usage.

* add: add Docker support for Dedicated Server

add with entrypoint and build scripts

* fix: add initial save for newly created worlds in dedicated server

on the server side, I fixed the behavior introduced after commit aadb511, where newly created worlds are intentionally not saved to disk immediately.

* update: add basically all configuration options that are implemented in the classes to `server.properties`

* update: add LAN advertising configuration for server.properties

LAN-Discovery, which isn’t needed in server mode and could potentially be a security risk, has also been disabled(only server mode).

* add: add implementing interactive command line using linenoise

- Integrated linenoise library for line editing and completion in the server console.
- Updated ServerLogger to handle external writes safely during logging.
- Modified ServerMain to initialize and manage the ServerCli for command input.
- The implementation is separate from everything else, so it doesn't affect anything else.
- The command input section and execution section are separated into threads.

* update: enhance command line completion with predictive hints

Like most command line tools, it highlights predictions in gray.

* add: implement `StringUtils` for string manipulation and refactor usages

Unified the scattered utility functions.

* fix: send DisconnectPacket on shutdown and fix Win64 recv-thread teardown race

Before this change, server/host shutdown closed sockets directly in
ServerConnection::stop(), which bypassed the normal disconnect flow.
As a result, clients could be dropped without receiving a proper
DisconnectPacket during stop/kill/world-close paths.

Also, WinsockNetLayer::Shutdown() could destroy synchronization objects
while host-side recv threads were still exiting, causing a crash in
RecvThreadProc (access violation on world close in host mode).

* fix: return client to menus when Win64 host connection drops

- Add client-side host disconnect handling in CPlatformNetworkManagerStub::DoWork() for _WINDOWS64.
- When in QNET_STATE_GAME_PLAY as a non-host and WinsockNetLayer::IsConnected() becomes false, trigger g_NetworkManager.HandleDisconnect(false) to enter the normal disconnect/UI flow.
- Use m_bLeaveGameOnTick as a one-shot guard to prevent repeated disconnect handling while the link remains down.
- Reset m_bLeaveGameOnTick on LeaveGame(), HostGame(), and JoinGame() to avoid stale state across sessions.

* update: converted Japanese comments to English

* add: create `Minecraft.Server` developer guide in English and Japanese

* update: add note about issue

* add: add `nlohmann/json` json lib

* add: add FileUtils

Moved file operations to `utils`.

* add: Dedicated Server BAN access manager with persistent player and IP bans

- add Access frontend that publishes thread-safe ban manager snapshots for dedicated server use
- add BanManager storage for banned-players.json and banned-ips.json with load/save/update flows
- add persistent player and IP ban checks during dedicated server connection handling
- add UTF-8 BOM-safe JSON parsing and shared file helpers backed by nlohmann/json
- add Unicode-safe ban file read/write and safer atomic replacement behavior on Windows
- add active-ban snapshot APIs and expiry-aware filtering for expires metadata
- add RAII-based dedicated access shutdown handling during server startup and teardown

* update: changed file read/write operations to use `FileUtils`.

- As a side effect, saving has become faster!

* fix: Re-added the source that had somehow disappeared.

* add: significantly improved the dedicated server logging system

- add ServerLogManager to Minecraft.Server as the single entry point for dedicated-server log output
- forward CMinecraftApp logger output to the server logger when running with g_Win64DedicatedServer
- add named network logs for incoming, accepted, rejected, and disconnected connections
- cache connection metadata by smallId so player name and remote IP remain available for disconnect logs
- keep Minecraft.Client changes minimal by using lightweight hook points and handling log orchestration on the server side

* fix: added the updated library source

* add: add `ban` and `pardon` commands for Player and IP

* fix: fix stop command shutdown process

add dedicated server shutdown request handling

* fix: fixed the save logic during server shutdown

Removed redundant repeated saves and eliminated the risks of async writes.

* update: added new sever files to Docker entrypoint

* fix: replace shutdown flag with atomic variable for thread safety

* update: update Dedicated Server developer guide

English is machine translated.
Please forgive me.

* update: check for the existence of `GameHDD` and create

* add: add Whitelist to Dedicated Server

* refactor: clean up and refactor the code

- unify duplicated implementations that were copied repeatedly
- update outdated patterns to more modern ones

* fix: include UI header (new update fix)

* fix: fix the detection range for excessive logging

`getHighestNonEmptyY()` returning `-1` occurs normally when the chunk is entirely air.
The caller (`Minecraft.World/LevelChunk.cpp:2400`) normalizes `-1` to `0`.

* update: add world size config to dedicated server properties

* update: update README add explanation of  `server.properties` & launch arguments

* update: add nightly release workflow for dedicated server and client builds to Actions

* fix: update name for workflow

* add random seed generation

* add: add Docker nightly workflow for Dedicated Server publish to GitHub Container Registry

* fix: ghost player when clients disconnect out of order

#4

* fix: fix 7zip option

* fix: fix Docker workflow for Dedicated Server artifact handling

* add: add no build Dedicated Server startup scripts and Docker Compose

* update: add README for Docker Dedicated Server setup with no local build

* refactor: refactor command path structure

As the number of commands has increased and become harder to navigate, each command has been organized into separate folders.

* update: support stream(file stdin) input mode for server CLI

Support for the stream (file stdin) required when attaching a tty to a Docker container on Linux.

* add: add new CLI Console Commands for Dedicated Server

Most of these commands are executed using the command dispatcher implemented on the `Minecraft.World` side. When registering them with the dispatcher, the sender uses a permission-enabled configuration that treats the CLI as a player.

- default game.
- enchant
- experience.
- give
- kill(currently, getting a permission error for some reason)
- time
- weather.
- update tp & gamemode command

* fix: change player map icon to random select

* update: increase the player limit

* add: restore the basic anti-cheat implementation and add spawn protection

Added the following anti-cheat measures and add spawn protection to `server.properties`.
- instant break
- speed
- reach

* fix: fix Docker image tag

---------

Co-authored-by: sylvessa <225480449+sylvessa@users.noreply.github.com>
2026-03-15 02:32:50 -05:00
Revela ddf60a573e 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 ae006e03f4 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 52271f05fe Powershell script that updates Nightly release & archives previous versions 2026-03-13 22:46:05 -05:00
Revela 4256a8b43a Merge branch 'smartcmd:main' into main 2026-03-13 21:48:39 -05:00
troglodyte9 7e0faa7a66 Fixed dangling pointer issue (#1209) 2026-03-13 20:32:02 +00:00
rtm516 c269fa31f1 Remove all old binka redist files (#1116)
* Remove all old binka redist files

* Delete x64/Debug/Effects.msscmp

* Delete x64/Release/Effects.msscmp
2026-03-13 19:43:37 +00:00
Revela fc544e612e Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-13 11:11:43 -05:00
Revela c3b204f77b 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 0bc1f2fc1a Update image in README for Hardcore Mode 2026-03-13 08:51:32 -05:00
Revela 324b116b7d Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-13 08:50:14 -05:00
Revela 07700eb0b0 added hardcore preview image 2026-03-13 08:50:05 -05:00
Revela 3cc8d7d9f1 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 b6d19582b6 Merge branch 'smartcmd:main' into main 2026-03-13 07:17:11 -05:00
Revela 514c4cf102 smartcmd/MinecraftConsoles and itsRevela/MinecraftConsoles network packet compatibility fix:
LoginPacket.cpp:
  - read(): Extracts hardcore from bit 3 of gameType (gameType & 0x8), then masks it off (gameType &
  ~0x8)
  - write(): Encodes hardcore into gameType via gameType | (m_isHardcore ? 0x8 : 0)
  - Removed the separate readBoolean()/writeBoolean() for m_isHardcore
  - Removed trailing + sizeof(bool) from getEstimatedSize()

  RespawnPacket.cpp:
  - read(): Extracts hardcore from bit 3 of the playerGameType byte, then masks it off before passing
  to GameType::byId()
  - write(): Encodes hardcore into the playerGameType byte via getId() | (m_isHardcore ? 0x8 : 0)
  - Removed the separate readBoolean()/writeBoolean() for m_isHardcore
  - Reverted getEstimatedSize() from 14+length to 13+length
2026-03-13 07:12:26 -05:00
Revela b28c0026af detailed summary of every changed file:
---
  Minecraft.Client/ClientConnection.cpp

  Purpose: Propagate hardcore flag through network level creation

  - handleLogin() (2 sites): Changed MultiPlayerLevel constructor calls from hardcoded false for the
  hardcore parameter to packet->m_isHardcore, so the client-side level correctly knows it's hardcore
  when joining a server.
  - handleRespawn(): Same change - when creating a new dimension level on respawn, uses
  packet->m_isHardcore instead of querying minecraft->level->getLevelData()->isHardcore() (which could
   be stale/wrong).

  ---
  Minecraft.Client/Common/App_Defines.h

  Purpose: Define bitmask for hardcore host option

  - Added GAME_HOST_OPTION_BITMASK_HARDCORE (0x40000000) - a new bit in the host options bitfield to
  store whether the game is hardcore.

  ---
  Minecraft.Client/Common/App_enums.h

  Purpose: Add hardcore enum value

  - Added eGameHostOption_Hardcore to the eGameHostOption enum so code can get/set the hardcore flag
  via SetGameHostOption/GetGameHostOption.

  ---
  Minecraft.Client/Common/Consoles_App.cpp

  Purpose: Implement hardcore get/set in host options bitfield

  - SetGameHostOption(): Added case eGameHostOption_Hardcore - sets or clears the
  GAME_HOST_OPTION_BITMASK_HARDCORE bit.
  - GetGameHostOption(): Added case eGameHostOption_Hardcore - returns 1 if the hardcore bit is set, 0
   otherwise.

  ---
  Minecraft.Client/Common/Consoles_App.h

  Purpose: Store save folder name for hardcore world deletion

  - Added SetCurrentSaveFolderName() and GetCurrentSaveFolderName() public methods.
  - Added wstring m_currentSaveFolderName private member - stores the save folder name so the hardcore
   death handler can find and delete the world.

  ---
  Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp

  Purpose: Delete hardcore world's save data on exit

  - Added Win64_DeleteSaveDirectory() - a recursive directory deletion helper (Windows64 only).
  - In _ExitWorld(): Before the server is torn down, captures whether this is a hardcore death exit
  (getDeleteWorldOnExit()). Tries 3 sources for the save folder name: app storage, StorageManager, and
   MinecraftServer.
  - After the server fully stops, if shouldDeleteHardcoreWorld is true, deletes the entire
  Windows64\GameHDD\<savefolder> directory.

  ---
  Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp

  Purpose: Hardcore difficulty slider in Create World menu

  - Added file-scope s_bHardcore flag to track when the slider is at position 4 (Hardcore).
  - Constructor: Extended difficulty slider range from 0-3 to 0-4, resets s_bHardcore to false.
  - handleSliderMove(): When slider value >= 4, sets s_bHardcore = true, stores actual difficulty as 3
   (Hard), and displays "Hardcore" label. Otherwise behaves normally.
  - CreateGame(): Clears the save folder name (new world), and sets eGameHostOption_Hardcore based on
  s_bHardcore.
  - Minor: Changed RequestErrorMessage to RequestAlertMessage for a content restriction dialog.

  ---
  Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp

  Purpose: Hardcore death screen behavior (Iggy UI)

  - Constructor: Checks if current level is hardcore. If so, shows IDS_HARDCORE_DEATH_MESSAGE on the
  respawn button and hides it. Otherwise shows normal "Respawn" button.
  - handlePress() - Respawn: Added safeguard - if hardcore, blocks respawn entirely.
  - handlePress() - Exit Game: If hardcore and host, skips save dialog, disables save-on-exit, enables
   delete-world-on-exit, and triggers immediate world exit.

  ---
  Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp

  Purpose: Show "Difficulty: Hardcore" in Load World menu + persist hardcore through game launch

  - Static array: Expanded m_iDifficultyTitleSettingA from 4 to 5 entries, added IDS_GAMEMODE_HARDCORE
   at index 4.
  - Constructor: Initializes m_bHardcore = false. In Windows64 block: sets up thumbnail name from save
   details, and reads isHardcore from params->saveDetails. If hardcore, immediately initializes the
  difficulty slider to show "Hardcore" locked at position 4.
  - tick(): When host options are read (bHostOptionsRead block), also reads the hardcore flag and
  re-initializes the slider if needed (for console path).
  - handleSliderMove(): If m_bHardcore, locks the slider at position 4 (prevents changing difficulty).
  - StartGameFromSave(): Stores the save folder name in app for later hardcore deletion. Sets
  eGameHostOption_Hardcore from m_bHardcore.

  ---
  Minecraft.Client/Common/UI/UIScene_LoadMenu.h

  Purpose: Declare hardcore member

  - Expanded m_iDifficultyTitleSettingA from [4] to [5].
  - Added bool m_bHardcore private member.

  ---
  Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp

  Purpose: Read hardcore flag from level.dat when building the save list

  - ReadLevelNameFromSaveFile(): Added optional bool *outHardcore parameter. Inside the NBT Data
  compound tag parsing, if outHardcore is non-null, reads dataTag->getBoolean(L"hardcore").
  - Save enumeration block (Windows64): Passes &saveHardcore to ReadLevelNameFromSaveFile and stores
  the result in m_saveDetails[i].isHardcore.

  ---
  Minecraft.Client/Common/UI/UIStructs.h

  Purpose: Add isHardcore to save list details struct

  - Added bool isHardcore field to _SaveListDetails struct.
  - Initialized to false in the constructor.

  ---
  Minecraft.Client/Common/XUI/XUI_Death.cpp

  Purpose: Hardcore death screen behavior (XUI/Xbox UI)

  - Mirror of the Iggy UIScene_DeathMenu.cpp changes but for the XUI rendering path.
  - OnInit(): Checks isHardcore(), hides respawn button and shows death message if true.
  - OnNotifyPressEx() - Exit Game: If hardcore and host, skips save, flags world for deletion, exits
  immediately.
  - OnNotifyPressEx() - Respawn: Safeguard to block respawn in hardcore.

  ---
  Minecraft.Client/Gui.cpp

  Purpose: Syntax fix

  - Fixed lines.push_back(L"" → lines.push_back(L"") - missing closing quote/paren in debug terrain
  feature display.

  ---
  Minecraft.Client/MinecraftServer.cpp

  Purpose: Server-side hardcore support

  - Constructor: Initializes m_deleteWorldOnExit = false.
  - loadLevel(): Captures the save folder name from StorageManager into m_saveFolderName for later use
   in hardcore world deletion.
  - isHardcore(): Changed from always returning false to returning
  app.GetGameHostOption(eGameHostOption_Hardcore) > 0 - this is the key change that makes the server
  actually report hardcore mode.

  ---
  Minecraft.Client/MinecraftServer.h

  Purpose: Declare hardcore-related members

  - Added bool m_deleteWorldOnExit and wstring m_saveFolderName private members.
  - Added setDeleteWorldOnExit(), getDeleteWorldOnExit(), and getSaveFolderName() public methods.

  ---
  Minecraft.Client/PlayerConnection.h

  Purpose: Thread-safety fix for kicked flag

  - Changed m_bWasKicked from bool to std::atomic<bool> (initialized with {false}).
  - Changed setWasKicked()/getWasKicked() to use .store()/.load() - fixes a race condition where the
  kicked flag is set on one thread and read on another.

  ---
  Minecraft.Client/PlayerList.cpp

  Purpose: Hardcore multiplayer - ban, respawn as Adventure, thread-safe bans

  - Constructor/Destructor: Added InitializeCriticalSection/DeleteCriticalSection for m_banCS.
  - placeNewPlayer(): Passes isHardcore() flag to the LoginPacket constructor so clients joining know
  it's hardcore.
  - respawn(): After respawn in hardcore, forces the player into Adventure mode (spectate-like: can
  look around but not interact). Sends GameEventPacket to sync client.
  - respawn() and toggleDimension() (2 sites): Pass isHardcore() to RespawnPacket constructor.
  - isXuidBanned(): Wrapped m_bannedXuids iteration with EnterCriticalSection/LeaveCriticalSection for
   thread safety.
  - banXuid() (new): Thread-safe method to add a player's XUID to the ban list - used when a player
  dies in hardcore multiplayer.

  ---
  Minecraft.Client/PlayerList.h

  Purpose: Declare ban-related additions

  - Added CRITICAL_SECTION m_banCS to protect m_bannedXuids.
  - Added void banXuid(PlayerUID xuid) public method.

  ---
  Minecraft.Client/SelectWorldScreen.cpp

  Purpose: Show [Hardcore] badge in Java-style world list

  - In renderItem(): If levelSummary->isHardcore(), appends  [Hardcore] to the world name display.

  ---
  Minecraft.Client/ServerPlayer.cpp

  Purpose: Hardcore death behavior on server

  - die(): If the level is hardcore, switches the dead player to Adventure mode (so they can't
  interact if somehow respawned).
  - Minor: Two comment lines changed // → /// (no functional change).

  ---
  Minecraft.Client/Windows64Media/strings.h

  Purpose: String IDs for hardcore UI text

  - Added 8 new string IDs (2286-2293): IDS_GAMEMODE_HARDCORE, IDS_HARDCORE, IDS_HARDCORE_TOOLTIP,
  IDS_HARDCORE_WARNING_TITLE, IDS_HARDCORE_WARNING_TEXT, IDS_HARDCORE_DEATH_MESSAGE,
  IDS_LABEL_HARDCORE, IDS_GAMEOPTION_HARDCORE.

  ---
  Minecraft.World/ConsoleSaveFileOriginal.cpp

  Purpose: Capture save folder name after first save (for new worlds)

  - SaveSaveDataCallback() (Windows64 only): After a successful save, if the app doesn't yet know the
  save folder name, attempts to capture it via StorageManager or by scanning Windows64\GameHDD\ for
  the newest folder. This handles the case where a newly-created hardcore world hasn't been saved yet
  when the folder name is needed.

  ---
  Minecraft.World/DisconnectPacket.h

  Purpose: Hardcore disconnect reason

  - Added eDisconnect_HardcoreDeath to the disconnect reason enum - used when kicking a player who
  died in hardcore multiplayer.

  ---
  Minecraft.World/LoginPacket.cpp & LoginPacket.h

  Purpose: Serialize hardcore flag in login packet

  - Added bool m_isHardcore member, initialized to false in both constructors.
  - Server→Client constructor now accepts bool isHardcore = false parameter.
  - read(): Reads m_isHardcore from the stream.
  - write(): Writes m_isHardcore to the stream.
  - getEstimatedSize(): Added sizeof(bool) for the new field.

  ---
  Minecraft.World/RespawnPacket.cpp & RespawnPacket.h

  Purpose: Serialize hardcore flag in respawn packet

  - Added bool m_isHardcore member, initialized to false.
  - Constructor now accepts bool isHardcore = false parameter.
  - read()/write(): Serialize m_isHardcore via readBoolean()/writeBoolean().
  - getEstimatedSize(): Changed from 13 to 14 bytes to account for the new boolean.
2026-03-13 06:56:46 -05:00
Prakhar Sharma 445567ddf7 Fix witches' bottle color (#1205)
* fix: witches' bottle is now the right color

* fix: add condition if item has mutiple layers
2026-03-13 11:41:47 +00:00
Ayush Thoren 32ddc6d967 Fix mounted minecarts not persisting across world reloads (#979)
* Fix mounted minecarts not persisting across world reloads

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>

* Apply patch

---------

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
2026-03-13 11:16:05 +00:00
MrTheShy 21c5d3d193 Fix joining servers in split screen, splitscreen fixes (#1031)
* Fix split-screen join failing when connecting to a remote host via UI

When a non-host client connected to a remote server through the in-game
UI (as opposed to the -ip/-port command line flags), the global variables
g_Win64MultiplayerIP and g_Win64MultiplayerPort were never updated from
their defaults ("127.0.0.1" and the default port). JoinSplitScreen()
relies on these globals to open a second TCP connection for the local
split-screen pad, so it would always attempt to connect to localhost,
failing immediately on any remote session.

Fix: update g_Win64MultiplayerIP and g_Win64MultiplayerPort inside
JoinGame() once the primary connection is established. This ensures
subsequent JoinSplitScreen() calls always reach the correct host
regardless of how the session was joined.

Additionally, guard PushFreeSmallId() against recycling smallIds in the
range [0, XUSER_MAX_COUNT), which are permanently reserved for the
host's local controller slots. Previously, if a host-side local pad
disconnected its smallId could re-enter the free pool and be handed
to an incoming remote client, causing that client's IQNetPlayer slot
to collide with a local pad slot on the non-host machine.

* Fix tutorial popup positioning in split-screen viewports

Replace the manual switch-case that computed viewport origin with the shared GetViewportRect/Fit16x9 helpers (from UISplitScreenHelpers.h). This ensures the tutorial popup is positioned and scaled consistently with the rest of the split-screen UI, fitting a 16:9 box inside each viewport and applying safezone offsets correctly.

Also adds missing default:break to safezone switch statements to silence compiler warnings.

Made-with: Cursor

* Prevent split-screen join when game window is not focused

Add g_KBMInput.IsWindowFocused() guard to the tryJoin condition so that gamepad input from background windows does not accidentally trigger a split-screen player join. This avoids phantom joins when the user is interacting with another application.

* Open debug overlay in fullscreen UI group during split-screen

Pass eUIGroup_Fullscreen to NavigateToScene when opening the debug overlay, so it spans the entire window instead of being confined to a single split-screen viewport. This makes the debug info readable regardless of the current split-screen layout.

* Fix non-host split-screen connections missing world updates

Previously, secondary (non-host) split-screen connections used isPrimaryConnection()
to gate nearly all world update packets, meaning the second local player would never
receive tile updates, entity movement, sounds, particles, explosions, etc.

The fix introduces per-connection tracking of which entities and chunks each
ClientConnection has loaded, and uses that information to decide whether a secondary
connection needs to process a given packet or if the primary connection already
handled it.

New members in ClientConnection:
- m_trackedEntityIds: set of entity IDs this connection has received AddEntity/AddMob/AddPlayer etc. for
- m_visibleChunks: set of chunk coordinates (packed into int64) this connection has marked visible
- Both sets are cleared on close(), respawn (dimension change), and destructor

New helpers:
- findPrimaryConnection(): walks the MultiPlayerLevel connection list to find the connection on the primary pad
- shouldProcessForEntity(id): secondary connection skips the packet only if the primary is already tracking that entity
- shouldProcessForPosition(x, z): secondary connection skips the packet only if the primary already has that chunk visible
- anyOtherConnectionHasChunk(x, z): used when a chunk becomes invisible to avoid hiding it from the level if another connection still needs it
- isTrackingEntity(id): public accessor used by shouldProcessForEntity on the primary connection

Packet handler changes:
- handleMoveEntity, handleMoveEntitySmall, handleSetEntityMotion, handleTakeItemEntity:
  replaced isPrimaryConnection() with shouldProcessForEntity() so secondary
  connections still process movement for entities they know about
- handleExplosion, handleLevelEvent:
  replaced isPrimaryConnection() with shouldProcessForPosition() so block
  destruction and level events fire for the correct connection based on chunks
- handleChunkTilesUpdate, handleBlockRegionUpdate, handleTileUpdate, handleSignUpdate,
  handleTileEntityData, handleTileEvent, handleTileDestruction, handleComplexItemData,
  handleSoundEvent, handleParticleEvent:
  removed the isPrimaryConnection() guard entirely -- these are world-state updates
  that all connections must process regardless of which pad is primary
- handleChunkVisibilityArea / handleChunkVisibility:
  now populate m_visibleChunks; on visibility=false, setChunkVisible(false) is
  only called on the level if no other connection still has that chunk loaded
- handleAddEntity, handleAddExperienceOrb, handleAddPainting, handleAddPlayer,
  handleAddMob: now insert into m_trackedEntityIds on arrival
- handleRemoveEntity: now erases from m_trackedEntityIds on removal
- handleLevelEvent: removed a duplicate levelEvent() call that was always firing
  regardless of the isPrimaryConnection() check above it (latent bug)

MultiPlayerLevel: added friend class ClientConnection to allow access to the
connections list without exposing it publicly.

* Fix fullscreen progress screen swallowing input before load completes

Two issues in UIScene_FullscreenProgress::handleInput:

1. The touchpad/button press that triggers movie skip or input forwarding
   had no guard on m_threadCompleted, so pressing a button during the loading
   phase would fire the skip/send logic before the background thread finished.
   Added the m_threadCompleted check so that path is only reachable once
   the load is actually done.

2. The `handled = true` assignment was missing from that branch, so input
   events were not being consumed and could fall through to other handlers.
   Added it unconditionally at the end of the block.

* Update player count decrement logic in PlatformNetworkManagerStub

Refactor the condition for decrementing the player count in CPlatformNetworkManagerStub::DoWork. The previous check was replaced with a while loop to ensure that the player count is only decremented when there are more than one player and the last player's custom data value is zero. This change improves the handling of player connections in the network manager.

* Refactor safe zone calculations in UI components for consistency

Updated the safe zone calculations across multiple UI components to ensure symmetry in split viewports. Removed unnecessary assignments and added comments for clarity. Modified the repositionHud function to include an additional parameter for better handling of HUD positioning in split-screen scenarios.

* Gui.cpp: fix F3 debug overlay in splitscreen + minor perf cleanup

The F3 debug screen was badly broken in splitscreen: it used the GUI
coordinate space which gets distorted by the splitscreen scaling, so
text appeared stretched, misaligned or completely off-screen depending
on the viewport layout.

Fixed by setting up a dedicated projection matrix using physical pixel
coordinates (g_rScreenWidth / g_rScreenHeight) each time the overlay is
drawn, completely decoupled from whatever transform the HUD is using.
The viewport dimensions are now computed per screen section so the ortho
projection matches the actual pixel area of each player's quadrant.
Version and branch strings are only shown for player 0 (iPad == 0) to
avoid repeating them across every splitscreen pane.

Also removed a few redundant calculations that were being done twice in
the same frame (atan for xRot, health halves, air supply scaled value).
These are minor and have negligible real-world impact; more substantial
per-frame caching work (safe zone calculations etc.) will follow in a
separate commit.
2026-03-13 01:32:18 -05:00
Revela 176a3db770 Merge branch 'smartcmd:main' into main 2026-03-12 18:42:37 -05:00
Revela c00375b72c Merge branch 'smartcmd:main' into main 2026-03-12 07:59:09 -05:00
Revela 0b3281d17f Enhance Fluxer server link presentation
Updated Fluxer server link with a centered image.
2026-03-12 06:13:02 -05:00
Revela 857155f3d6 Fix spelling and update Fluxer server link image 2026-03-12 06:09:38 -05:00
Revela e0e3a00a83 Fluxer link in readme
Updated Discord link and added information about Fluxer server.
2026-03-12 05:58:26 -05:00
Revela 812b3ea6af Merge branch 'main' of https://github.com/itsRevela/MinecraftConsoles 2026-03-12 05:20:44 -05:00
Revela b51fb18120 Merge branch 'smartcmd:main' into main 2026-03-12 05:20:21 -05:00
Revela b1c44c33bd set default values 2026-03-12 05:19:39 -05:00
Revela 330d764972 Update download link for Nightly Build 2026-03-12 00:10:36 -05:00
Revela 3caa5713e5 Gives option to remove the top-left watermark in ClientConstants.cpp:
Watermark on:
const bool ClientConstants::SHOW_VERSION_WATERMARK = true;

Watermark off:
const bool ClientConstants::SHOW_VERSION_WATERMARK = false;
2026-03-11 23:56:22 -05:00
Revela 0631aefec2 Fix portal cache key to use chunk coordinates 2026-03-11 22:12:03 -05:00
qwasdrizzel 255a18fe8e Fix crash by ensuring FOV is not less than 1 2026-03-05 22:20:39 -06:00
qwasdrizzel 06a5f103b4 Fix crash by ensuring FOV is not less than 1 2026-03-05 22:20:39 -06:00
qwasdrizzel cffe636e35 Merge branch 'smartcmd:main' into main 2026-03-05 22:18:36 -06:00
qwasdrizzel 53adf17cb2 Merge branch 'smartcmd:main' into main 2026-03-05 22:18:36 -06:00
qwasdrizzel d1eb09a4b9 Merge branch 'smartcmd:main' into main 2026-03-05 18:01:32 -06:00
qwasdrizzel a71a093235 Merge branch 'smartcmd:main' into main 2026-03-05 18:01:32 -06:00
qwasdrizzel 4b13b3345e Fix the angle problem with flying
Removed checks that limit flying to a 90 degree angle, which caused the problem.
2026-03-05 18:01:13 -06:00
qwasdrizzel 9eb77ec0ef Fix the angle problem with flying
Removed checks that limit flying to a 90 degree angle, which caused the problem.
2026-03-05 18:01:13 -06:00
qwasdrizzel 0666959d31 Merge branch 'smartcmd:main' into main 2026-03-05 17:17:45 -06:00
qwasdrizzel 28f9e89e59 Merge branch 'smartcmd:main' into main 2026-03-05 17:17:45 -06:00
qwasdrizzel 9370cbc7d8 Modify dispense behavior to set outcome as LEFT_ITEM 2026-03-05 00:02:17 -06:00
qwasdrizzel ee83ec8df9 Modify dispense behavior to set outcome as LEFT_ITEM 2026-03-05 00:02:17 -06:00
1325 changed files with 50915 additions and 77811 deletions
+3
View File
@@ -0,0 +1,3 @@
.github/workflows/docker-nightly.yml merge=ours
.github/workflows/nightly.yml merge=ours
docker-compose.dedicated-server.ghcr.yml merge=ours
Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 646 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 KiB

-31
View File
@@ -1,31 +0,0 @@
name: Build Minecraft Legacy Console Edition
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-2022
strategy:
matrix:
configuration: [Release, Debug]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Minecraft Legacy Console Edition
run: |
msbuild MinecraftConsoles.sln `
/p:Configuration=${{ matrix.configuration }} `
/p:Platform=Windows64 `
/m
- name: Upload Release + Debug Artifacts
uses: actions/upload-artifact@v4
with:
name: MinecraftClient-${{ matrix.configuration }}
path: x64/${{ matrix.configuration }}
-32
View File
@@ -1,32 +0,0 @@
name: MSBuild Debug Test
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/*.md'
push:
branches:
- 'main'
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/*.md'
jobs:
build:
name: Build Windows64 (DEBUG)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Build
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Debug /p:Platform="Windows64"
-160
View File
@@ -1,160 +0,0 @@
name: Docker Nightly Dedicated Server
on:
workflow_dispatch:
push:
branches:
- "main"
- 'feature/dedicated-server'
paths-ignore:
- ".gitignore"
- "*.md"
- ".github/*.md"
permissions:
contents: read
packages: write
concurrency:
group: docker-nightly-dedicated-server
cancel-in-progress: true
jobs:
build-runtime:
name: Build Dedicated Server Runtime
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Build Dedicated Server Runtime Only
shell: pwsh
run: |
MSBuild.exe Minecraft.World\Minecraft.World.vcxproj /p:Configuration=Release /p:Platform=x64 /m
MSBuild.exe Minecraft.Server\Minecraft.Server.vcxproj /p:Configuration=Release /p:Platform=x64 /m
- name: Stage dedicated server runtime
shell: pwsh
run: |
$serverOut = "Minecraft.Server/x64/Minecraft.Server/Release"
$stage = ".artifacts/dedicated-server-runtime"
if (Test-Path $stage) {
Remove-Item -Path $stage -Recurse -Force
}
New-Item -ItemType Directory -Path (Join-Path $stage "Windows64") -Force | Out-Null
# Minimum required runtime files
$required = @(
"Minecraft.Server.exe",
"iggy_w64.dll",
"Common"
)
foreach ($entry in $required) {
$src = Join-Path $serverOut $entry
if (-not (Test-Path $src)) {
throw "Missing required runtime path: $src"
}
}
# Copy required files
Copy-Item -Path (Join-Path $serverOut "Minecraft.Server.exe") -Destination (Join-Path $stage "Minecraft.Server.exe") -Force
Copy-Item -Path (Join-Path $serverOut "iggy_w64.dll") -Destination (Join-Path $stage "iggy_w64.dll") -Force
Copy-Item -Path (Join-Path $serverOut "Common") -Destination (Join-Path $stage "Common") -Recurse -Force
if (Test-Path (Join-Path $serverOut "Windows64")) {
Copy-Item -Path (Join-Path $serverOut "Windows64/*") -Destination (Join-Path $stage "Windows64") -Recurse -Force
} else {
Write-Host "Windows64 directory is not present in build output; staging without it."
}
Get-ChildItem -Path $stage -Recurse -File | Select-Object -First 20 | ForEach-Object {
Write-Host "Staged: $($_.FullName)"
}
- name: Upload dedicated server runtime to artifacts
uses: actions/upload-artifact@v4
with:
name: dedicated-server-runtime
if-no-files-found: error
path: |
.artifacts/dedicated-server-runtime/**
docker-publish:
name: Build and Push Docker Image
runs-on: ubuntu-latest
needs: build-runtime
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download dedicated server runtime from artifacts
uses: actions/download-artifact@v4
with:
name: dedicated-server-runtime
path: .artifacts/runtime
- name: Prepare Docker runtime directory
shell: bash
run: |
set -euo pipefail
rm -rf runtime
mkdir -p runtime
cp .artifacts/runtime/Minecraft.Server.exe runtime/Minecraft.Server.exe
cp .artifacts/runtime/iggy_w64.dll runtime/iggy_w64.dll
cp -R .artifacts/runtime/Common runtime/Common
mkdir -p runtime/Windows64
if [[ -d ".artifacts/runtime/Windows64" ]]; then
cp -R .artifacts/runtime/Windows64/. runtime/Windows64/
fi
test -f runtime/Minecraft.Server.exe
test -f runtime/iggy_w64.dll
test -d runtime/Common
test -d runtime/Windows64
- 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
+342 -47
View File
@@ -1,69 +1,364 @@
name: Nightly Releases
name: Nightly Release
on:
workflow_dispatch:
push:
branches:
- 'main'
- 'feature/dedicated-server'
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/*.md'
workflow_dispatch:
permissions:
contents: write
id-token: write
attestations: write
concurrency:
group: nightly
cancel-in-progress: true
jobs:
build:
name: Build Windows64
build-client:
name: Build Client
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Release /p:Platform="Windows64"
- name: Setup CMake
uses: lukka/get-cmake@latest
- name: Run CMake
uses: lukka/run-cmake@v10
env:
VCPKG_ROOT: ""
with:
configurePreset: windows64
buildPreset: windows64-release
buildPresetAdditionalArgs: "['--target', 'Minecraft.Client']"
- name: Zip Build
run: 7z a -r LCEWindows64.zip ./x64/Release/*
shell: pwsh
run: |
$source = "./build/windows64/Minecraft.Client/Release"
$zip = "LCE-Revelations-Client-Win64.zip"
$topLevel = "LCE-Revelations-Client-Win64"
- name: Zip Dedicated Server Build
run: 7z a -r LCEServerWindows64.zip ./x64/Minecraft.Server/Release/*
# Collect files, excluding unwanted extensions
$files = Get-ChildItem -Path $source -Recurse -File |
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj' }
- name: Update Client release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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/
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
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: client-build
path: staging/*
- name: Update Dedicated Server release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-server:
name: Build Server
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Setup CMake
uses: lukka/get-cmake@latest
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
tag_name: nightly-dedicated-server
name: Nightly Dedicated Server Release
body: |
Dedicated Server runtime for Windows64.
global-json-file: global.json
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
- name: Run CMake
uses: lukka/run-cmake@v10
env:
VCPKG_ROOT: ""
with:
configurePreset: windows64
buildPreset: windows64-release
buildPresetAdditionalArgs: "['--target', 'Minecraft.Server', '--target', 'Minecraft.Server.FourKit']"
- 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' }
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' }
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: actions/upload-artifact@v6
with:
name: server-build
path: staging/*
release-server:
name: Release Server
needs: build-server
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download server artifacts
uses: actions/download-artifact@v7
with:
name: server-build
path: artifacts
- name: Attest artifacts
uses: actions/attest-build-provenance@v2
with:
subject-path: |
artifacts/LCE-Revelations-Server-Win64.zip
artifacts/LCE-Revelations-Server-Win64-FourKit.zip
- name: Get short SHA
id: sha
run: echo "short=$(echo '${{ github.sha }}' | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Delete old release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release delete Nightly-Dedicated-Server --yes || true
- name: Delete old tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh api repos/${{ github.repository }}/git/refs/tags/Nightly-Dedicated-Server --method DELETE || true
- name: Import GPG key
uses: 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-Dedicated-Server -m "Nightly server release ${{ steps.sha.outputs.short }}"
git push origin Nightly-Dedicated-Server --force
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create Nightly-Dedicated-Server artifacts/* \
--title "Server: ${{ steps.sha.outputs.short }}" \
--notes "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." \
--latest=false
release-client:
name: Release Client
needs: [build-client, release-server]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download client artifacts
uses: actions/download-artifact@v7
with:
name: client-build
path: artifacts
- name: Attest artifacts
uses: actions/attest-build-provenance@v2
with:
subject-path: |
artifacts/LCE-Revelations-Client-Win64.zip
artifacts/Minecraft.Client.exe
- name: Get short SHA
id: sha
run: echo "short=$(echo '${{ github.sha }}' | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Delete old release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release delete Nightly --yes || true
- name: Delete old tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh api repos/${{ github.repository }}/git/refs/tags/Nightly --method DELETE || true
- name: Import GPG key
uses: 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 `Minecraft.Client.pdb` and copy them over to your existing LCE-Revelations-Client-Win64 build (overwrite your old version of Minecraft.Client.exe and Minecraft.Client.pdb).
**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
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create Nightly artifacts/* \
--title "Client: ${{ steps.sha.outputs.short }}" \
--notes-file notes.md
cleanup:
needs: [release-client, release-server]
if: always()
runs-on: ubuntu-latest
steps:
- name: Cleanup artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
client-build
server-build
+37
View File
@@ -0,0 +1,37 @@
name: Pull Request Build
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/*.md'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Setup CMake
uses: lukka/get-cmake@latest
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Run CMake
uses: lukka/run-cmake@v10
env:
VCPKG_ROOT: "" # Disable vcpkg for CI builds
with:
configurePreset: windows64
buildPreset: windows64-debug
+18 -32
View File
@@ -26,6 +26,7 @@ mono_crash.*
[Rr]elease/
[Rr]eleases/
x64/
x64_*/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
@@ -407,39 +408,24 @@ enc_temp_folder/
Minecraft.Client/Schematics/
Minecraft.Client/Windows64/GameHDD/
# Intermediate build files (per-project)
Minecraft.Client/x64/
Minecraft.Client/Debug/
Minecraft.Client/x64_Debug/
Minecraft.Client/Release/
Minecraft.Client/x64_Release/
Minecraft.World/x64/
Minecraft.World/Debug/
Minecraft.World/x64_Debug/
Minecraft.World/Release/
Minecraft.World/x64_Release/
Minecraft.Server/x64/
Minecraft.Server/Debug/
Minecraft.Server/x64_Debug/
Minecraft.Server/Release/
Minecraft.Server/x64_Release/
build/*
# Existing build output files
!x64/**/Effects.msscmp
!x64/**/iggy_w64.dll
!x64/**/mss64.dll
!x64/**/redist64/
# Local saves
Minecraft.Client/Saves/
# CMake build output
build/
# Server data
tmp*/
_server_asset_probe/
server-data/
# Visual Studio Per-User Config
*.user
/out
# Tools build artifacts and intermediates
tools/*.class
tools/*.swf
tools/staging/
tools/server-monitor/
# Nix
result
result-*
.direnv/
.xwin-cache/
.xwin/
+94 -219
View File
@@ -1,244 +1,119 @@
cmake_minimum_required(VERSION 3.24)
project(MinecraftConsoles LANGUAGES C CXX RC ASM_MASM)
project(LCE-Revelations 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)
message(FATAL_ERROR "This CMake build currently supports Windows only.")
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.")
endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message(FATAL_ERROR "Use a 64-bit generator/toolchain (x64).")
endif()
set(CMAKE_CONFIGURATION_TYPES
"Debug"
"Release"
CACHE STRING "" FORCE
)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
function(configure_msvc_target target)
target_compile_options(${target} PRIVATE
$<$<AND:$<NOT:$<CONFIG:Release>>,$<COMPILE_LANGUAGE:C,CXX>>:/W3>
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/W0>
$<$<COMPILE_LANGUAGE:C,CXX>:/MP>
$<$<COMPILE_LANGUAGE:C,CXX>:/FS>
$<$<COMPILE_LANGUAGE:CXX>:/EHsc>
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL /O2 /Oi /GT /GF>
)
function(configure_compiler_target target)
# MSVC and compatible compilers (like Clang-cl)
if (MSVC)
target_compile_options(${target} PRIVATE
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:/W3>
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/W0>
$<$<COMPILE_LANGUAGE:C,CXX>:/MP>
$<$<COMPILE_LANGUAGE:C,CXX>:/FS>
$<$<COMPILE_LANGUAGE:C,CXX>:/GS>
$<$<COMPILE_LANGUAGE:CXX>:/EHsc>
$<$<COMPILE_LANGUAGE:CXX>:/GR>
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:/Od>
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/O2 /Oi /GT /GF>
)
endif()
# MSVC
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(${target} PRIVATE
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL>
)
target_link_options(${target} PRIVATE
$<$<CONFIG:Release>:/LTCG:incremental>
)
endif()
# Clang
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${target} PRIVATE
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:-O0 -Wall>
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:-O2 -w -flto>
)
target_link_options(${target} PRIVATE
$<$<CONFIG:Release>:-flto>
)
endif()
endfunction()
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/WorldSources.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ClientSources.cmake")
list(TRANSFORM MINECRAFT_WORLD_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/")
list(TRANSFORM MINECRAFT_CLIENT_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/")
list(APPEND MINECRAFT_CLIENT_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Xbox/MinecraftWindows.rc"
# ---
# Configuration
# ---
set(MINECRAFT_SHARED_DEFINES
_LARGE_WORLDS
_DEBUG_MENUS_ENABLED
$<$<CONFIG:Debug>:_DEBUG>
_CRT_NON_CONFORMING_SWPRINTFS
_CRT_SECURE_NO_WARNINGS
_HAS_STD_BYTE=0
)
add_library(MinecraftWorld STATIC ${MINECRAFT_WORLD_SOURCES})
target_include_directories(MinecraftWorld PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/x64headers"
)
target_compile_definitions(MinecraftWorld PRIVATE
$<$<CONFIG:Debug>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
$<$<NOT:$<CONFIG:Debug>>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
)
if(MSVC)
configure_msvc_target(MinecraftWorld)
# 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.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()
add_executable(MinecraftClient WIN32 ${MINECRAFT_CLIENT_SOURCES})
target_include_directories(MinecraftClient PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/include"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Xbox/Sentient/Include"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/x64headers"
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
)
target_compile_definitions(MinecraftClient PRIVATE
$<$<CONFIG:Debug>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
$<$<NOT:$<CONFIG:Debug>>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
)
if(MSVC)
configure_msvc_target(MinecraftClient)
target_link_options(MinecraftClient PRIVATE
$<$<CONFIG:Release>:/LTCG /INCREMENTAL:NO>
)
endif()
# ---
# Build versioning
# ---
set(BUILDVER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/GenerateBuildVer.cmake")
set(BUILDVER_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/Common/BuildVer.h")
set_target_properties(MinecraftClient PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:MinecraftClient>"
)
target_link_libraries(MinecraftClient PRIVATE
MinecraftWorld
d3d11
XInput9_1_0
wsock32
legacy_stdio_definitions
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggy_w64.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggyperfmon_w64.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggyexpruntime_w64.lib"
$<$<CONFIG:Debug>:
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC_d.lib"
>
$<$<NOT:$<CONFIG:Debug>>:
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC.lib"
>
)
set(MINECRAFT_SERVER_SOURCES ${MINECRAFT_CLIENT_SOURCES})
list(APPEND MINECRAFT_SERVER_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Windows64/ServerMain.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Access/Access.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Access/BanManager.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Access/WhitelistManager.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/ServerCli.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/ServerCliInput.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/ServerCliParser.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/ServerCliEngine.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/ServerCliRegistry.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/ban/CliCommandBan.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/ban-ip/CliCommandBanIp.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/ban-list/CliCommandBanList.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/help/CliCommandHelp.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/pardon/CliCommandPardon.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/pardon-ip/CliCommandPardonIp.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/stop/CliCommandStop.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/list/CliCommandList.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/tp/CliCommandTp.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/whitelist/CliCommandWhitelist.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/gamemode/CliCommandGamemode.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/time/CliCommandTime.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/weather/CliCommandWeather.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/give/CliCommandGive.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/enchant/CliCommandEnchant.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/kill/CliCommandKill.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/defaultgamemode/CliCommandDefaultGamemode.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Console/commands/experience/CliCommandExperience.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Common/FileUtils.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Common/StringUtils.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/ServerLogger.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/ServerLogManager.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/ServerProperties.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/vendor/linenoise/linenoise.c"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/WorldManager.cpp"
)
add_executable(MinecraftServer ${MINECRAFT_SERVER_SOURCES})
target_include_directories(MinecraftServer PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/include"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Xbox/Sentient/Include"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/x64headers"
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Server/Windows64"
)
target_compile_definitions(MinecraftServer PRIVATE
$<$<CONFIG:Debug>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;MINECRAFT_SERVER_BUILD>
$<$<NOT:$<CONFIG:Debug>>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;MINECRAFT_SERVER_BUILD>
)
if(MSVC)
configure_msvc_target(MinecraftServer)
target_link_options(MinecraftServer PRIVATE
$<$<CONFIG:Release>:/LTCG /INCREMENTAL:NO>
)
endif()
set_target_properties(MinecraftServer PROPERTIES
OUTPUT_NAME "Minecraft.Server"
VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:MinecraftServer>"
VS_DEBUGGER_COMMAND_ARGUMENTS "-port 25565 -bind 0.0.0.0 -name DedicatedServer"
)
target_link_libraries(MinecraftServer PRIVATE
MinecraftWorld
d3d11
XInput9_1_0
wsock32
legacy_stdio_definitions
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggy_w64.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggyperfmon_w64.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggyexpruntime_w64.lib"
$<$<CONFIG:Debug>:
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC_d.lib"
>
$<$<NOT:$<CONFIG:Debug>>:
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC.lib"
>
)
if(CMAKE_HOST_WIN32)
message(STATUS "Starting redist copy...")
execute_process(
COMMAND robocopy.exe
"${CMAKE_CURRENT_SOURCE_DIR}/x64/Release"
"${CMAKE_CURRENT_BINARY_DIR}"
/S /MT /R:0 /W:0 /NP
)
message(STATUS "Starting asset copy...")
execute_process(
COMMAND robocopy.exe
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client"
"${CMAKE_CURRENT_BINARY_DIR}"
/S /MT /R:0 /W:0 /NP
/XF "*.cpp" "*.c" "*.h" "*.hpp" "*.asm"
"*.xml" "*.lang" "*.vcxproj" "*.vcxproj.*" "*.sln"
"*.docx" "*.xls"
"*.bat" "*.cmd" "*.ps1" "*.py"
"*Test*"
/XD "Durango*" "Orbis*" "PS*" "Xbox"
)
message(STATUS "Patching Windows64Media...")
execute_process(
COMMAND robocopy.exe
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/DurangoMedia"
"${CMAKE_CURRENT_BINARY_DIR}/Windows64Media"
/S /MT /R:0 /W:0 /NP
/XF "*.h" "*.xml" "*.lang" "*.bat"
)
elseif(CMAKE_HOST_UNIX)
message(STATUS "Starting redist copy...")
execute_process(
COMMAND rsync -av "${CMAKE_CURRENT_SOURCE_DIR}/x64/Release/" "${CMAKE_CURRENT_BINARY_DIR}/"
)
message(STATUS "Starting asset copy...")
execute_process(
COMMAND rsync -av
"--exclude=*.cpp" "--exclude=*.c" "--exclude=*.h" "--exclude=*.hpp" "--exclude=*.asm"
"--exclude=*.xml" "--exclude=*.lang" "--exclude=*.vcxproj" "--exclude=*.vcxproj.*" "--exclude=*.sln"
"--exclude=*.docx" "--exclude=*.xls"
"--exclude=*.bat" "--exclude=*.cmd" "--exclude=*.ps1" "--exclude=*.py"
"--exclude=*Test*"
"--exclude=Durango*" "--exclude=Orbis*" "--exclude=PS*" "--exclude=Xbox"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/" "${CMAKE_CURRENT_BINARY_DIR}/"
)
message(STATUS "Patching Windows64Media...")
execute_process(
COMMAND rsync -av
"--exclude=*.h" "--exclude=*.xml" "--exclude=*.lang" "--exclude=*.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/DurangoMedia/" "${CMAKE_CURRENT_BINARY_DIR}/Windows64Media/"
)
else()
message(FATAL_ERROR "Redist and asset copying is only supported on Windows (Robocopy) and Unix systems (rsync).")
endif()
add_custom_command(TARGET MinecraftServer POST_BUILD
COMMAND "${CMAKE_COMMAND}"
-DPROJECT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
-DOUTPUT_DIR="$<TARGET_FILE_DIR:MinecraftServer>"
-DCONFIGURATION=$<CONFIG>
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyServerAssets.cmake"
add_custom_target(GenerateBuildVer
COMMAND ${CMAKE_COMMAND}
"-DOUTPUT_FILE=${BUILDVER_OUTPUT}"
-P "${BUILDVER_SCRIPT}"
COMMENT "Generating BuildVer.h..."
VERBATIM
)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MinecraftServer)
add_dependencies(Minecraft.World GenerateBuildVer)
add_dependencies(Minecraft.Client GenerateBuildVer)
if(PLATFORM_NAME STREQUAL "Windows64")
add_dependencies(Minecraft.Server GenerateBuildVer)
endif()
# ---
# Project organisation
# ---
# Set the startup project for Visual Studio
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT Minecraft.Client)
# Setup folders for Visual Studio, just hides the build targets under a sub folder
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(TARGET GenerateBuildVer PROPERTY FOLDER "Build")
+94
View File
@@ -0,0 +1,94 @@
{
"version": 5,
"configurePresets": [
{
"name": "base",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build/${presetName}",
"hidden": true
},
{
"name": "windows64",
"displayName": "Windows64",
"inherits": "base",
"cacheVariables": {
"PLATFORM_DEFINES": "_WINDOWS64",
"PLATFORM_NAME": "Windows64",
"IGGY_LIBS": "iggy_w64.lib;iggyperfmon_w64.lib;iggyexpruntime_w64.lib"
}
},
{
"name": "durango",
"displayName": "Durango",
"inherits": "base",
"toolchainFile": "${sourceDir}/cmake/toolchains/durango.cmake",
"cacheVariables": {
"PLATFORM_DEFINES": "_DURANGO;_XBOX_ONE",
"PLATFORM_NAME": "Durango",
"IGGY_LIBS": "iggy_durango.lib;iggyperfmon_durango.lib"
}
},
{
"name": "orbis",
"displayName": "ORBIS",
"inherits": "base",
"toolchainFile": "${sourceDir}/cmake/toolchains/orbis.cmake",
"cacheVariables": {
"PLATFORM_DEFINES": "__ORBIS__",
"PLATFORM_NAME": "Orbis",
"IGGY_LIBS": "libiggy_orbis.a;libiggyperfmon_orbis.a"
}
},
{
"name": "ps3",
"displayName": "PS3",
"inherits": "base",
"toolchainFile": "${sourceDir}/cmake/toolchains/ps3.cmake",
"cacheVariables": {
"PLATFORM_DEFINES": "__PS3__",
"PLATFORM_NAME": "PS3",
"IGGY_LIBS": "libiggy_ps3.a;libiggyperfmon_ps3.a;libiggyexpruntime_ps3.a"
}
},
{
"name": "psvita",
"displayName": "PSVita",
"inherits": "base",
"toolchainFile": "${sourceDir}/cmake/toolchains/psvita.cmake",
"cacheVariables": {
"PLATFORM_DEFINES": "__PSVITA__",
"PLATFORM_NAME": "PSVita",
"IGGY_LIBS": "libiggy_psp2.a;libiggyperfmon_psp2.a"
}
},
{
"name": "xbox360",
"displayName": "Xbox 360",
"inherits": "base",
"toolchainFile": "${sourceDir}/cmake/toolchains/xbox360.cmake",
"cacheVariables": {
"PLATFORM_DEFINES": "_XBOX",
"PLATFORM_NAME": "Xbox"
}
}
],
"buildPresets": [
{ "name": "windows64-debug", "displayName": "Windows64 - Debug", "configurePreset": "windows64", "configuration": "Debug" },
{ "name": "windows64-release", "displayName": "Windows64 - Release", "configurePreset": "windows64", "configuration": "Release" },
{ "name": "durango-debug", "displayName": "Durango - Debug", "configurePreset": "durango", "configuration": "Debug" },
{ "name": "durango-release", "displayName": "Durango - Release", "configurePreset": "durango", "configuration": "Release" },
{ "name": "orbis-debug", "displayName": "ORBIS - Debug", "configurePreset": "orbis", "configuration": "Debug" },
{ "name": "orbis-release", "displayName": "ORBIS - Release", "configurePreset": "orbis", "configuration": "Release" },
{ "name": "ps3-debug", "displayName": "PS3 - Debug", "configurePreset": "ps3", "configuration": "Debug" },
{ "name": "ps3-release", "displayName": "PS3 - Release", "configurePreset": "ps3", "configuration": "Release" },
{ "name": "psvita-debug", "displayName": "PSVita - Debug", "configurePreset": "psvita", "configuration": "Debug" },
{ "name": "psvita-release", "displayName": "PSVita - Release", "configurePreset": "psvita", "configuration": "Release" },
{ "name": "xbox360-debug", "displayName": "Xbox 360 - Debug", "configurePreset": "xbox360", "configuration": "Debug" },
{ "name": "xbox360-release", "displayName": "Xbox 360 - Release", "configurePreset": "xbox360", "configuration": "Release" }
]
}
+138 -28
View File
@@ -1,26 +1,55 @@
# Compile Instructions
## Visual Studio (`.sln`)
## Prerequisites
1. Open `MinecraftConsoles.sln` in Visual Studio 2022.
2. Set Startup Project:
- Client: `Minecraft.Client`
- Dedicated server: `Minecraft.Server`
3. Select configuration:
- `Debug` (recommended), or
- `Release`
4. Select platform: `Windows64`.
5. Build and run:
- `Build > Build Solution` (or `Ctrl+Shift+B`)
- Start debugging with `F5`.
- **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.
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.
### Dedicated server debug arguments
- Default debugger arguments for `Minecraft.Server`:
- Default debugger arguments for both `Minecraft.Server` and `Minecraft.Server.FourKit`:
- `-port 25565 -bind 0.0.0.0 -name DedicatedServer`
- You can override arguments in:
- `Project Properties > Debugging > Command Arguments`
- `Minecraft.Server` post-build copies only the dedicated-server asset set:
- Both server targets post-build copy the dedicated-server asset set:
- `Common/Media/MediaWindows64.arc`
- `Common/res`
- `Windows64/GameHDD`
@@ -29,50 +58,131 @@
Configure (use your VS Community instance explicitly):
Open `Developer PowerShell for VS` and run:
```powershell
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_INSTANCE="C:/Program Files/Microsoft Visual Studio/2022/Community"
cmake --preset windows64
```
Build Debug:
```powershell
cmake --build build --config Debug --target MinecraftClient
cmake --build --preset windows64-debug --target Minecraft.Client
```
Build Release:
```powershell
cmake --build build --config Release --target MinecraftClient
cmake --build --preset windows64-release --target Minecraft.Client
```
Build Dedicated Server (Debug):
Build vanilla Dedicated Server (Debug):
```powershell
cmake --build build --config Debug --target MinecraftServer
cmake --build --preset windows64-debug --target Minecraft.Server
```
Build Dedicated Server (Release):
Build vanilla Dedicated Server (Release):
```powershell
cmake --build build --config Release --target MinecraftServer
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
cd .\build\Debug
.\MinecraftClient.exe
cd .\build\windows64\Minecraft.Client\Debug
.\Minecraft.Client.exe
```
Run dedicated server:
Run vanilla dedicated server:
```powershell
cd .\build\Debug
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 `MinecraftClient` in CMake (Debug and Release variants).
- 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
+2 -2
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"
+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"
+2 -2
View File
@@ -1,6 +1,6 @@
#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"
+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
+97
View File
@@ -0,0 +1,97 @@
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Durango.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/ORBIS.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/PS3.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/PSVita.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Windows.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Xbox360.cmake")
include("${CMAKE_SOURCE_DIR}/cmake/CommonSources.cmake")
include("${CMAKE_SOURCE_DIR}/cmake/Utils.cmake")
# Combine all source files into a single variable for the target
# We cant use CMAKE_CONFIGURE_PRESET here as VS doesn't set it, so just rely on the folder
set(MINECRAFT_CLIENT_SOURCES
${MINECRAFT_CLIENT_COMMON}
$<$<STREQUAL:${PLATFORM_NAME},Durango>:${MINECRAFT_CLIENT_DURANGO}>
$<$<STREQUAL:${PLATFORM_NAME},Orbis>:${MINECRAFT_CLIENT_ORBIS}>
$<$<STREQUAL:${PLATFORM_NAME},PS3>:${MINECRAFT_CLIENT_PS3}>
$<$<STREQUAL:${PLATFORM_NAME},PSVita>:${MINECRAFT_CLIENT_PSVITA}>
$<$<STREQUAL:${PLATFORM_NAME},Windows64>:${MINECRAFT_CLIENT_WINDOWS}>
$<$<STREQUAL:${PLATFORM_NAME},Xbox>:${MINECRAFT_CLIENT_XBOX360}>
${SOURCES_COMMON}
)
add_executable(Minecraft.Client ${MINECRAFT_CLIENT_SOURCES})
# Only define executable on windows
if(PLATFORM_NAME STREQUAL "Windows64")
set_target_properties(Minecraft.Client PROPERTIES WIN32_EXECUTABLE TRUE)
endif()
target_include_directories(Minecraft.Client PRIVATE
"${CMAKE_BINARY_DIR}/generated/" # This is for the generated BuildVer.h
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/Iggy/include"
"${CMAKE_SOURCE_DIR}/include/"
)
target_compile_definitions(Minecraft.Client PRIVATE
${MINECRAFT_SHARED_DEFINES}
)
target_precompile_headers(Minecraft.Client PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:stdafx.h>")
set_source_files_properties(compat_shims.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON) # This redefines internal MSVC CRT symbols which will cause an issue with PCH
configure_compiler_target(Minecraft.Client)
set_target_properties(Minecraft.Client PROPERTIES
OUTPUT_NAME "Minecraft.Client"
VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:Minecraft.Client>"
)
target_link_libraries(Minecraft.Client PRIVATE
Minecraft.World
d3d11
dxgi
d3dcompiler
XInput9_1_0
wsock32
legacy_stdio_definitions
$<$<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
foreach(lib IN LISTS IGGY_LIBS)
target_link_libraries(Minecraft.Client PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/Iggy/lib/${lib}")
endforeach()
# ---
# Asset / redist copy
# ---
include("${CMAKE_SOURCE_DIR}/cmake/CopyAssets.cmake")
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}")
# Copy redist files
add_copyredist_target(Minecraft.Client)
# Make sure GameHDD exists on Windows
if(PLATFORM_NAME STREQUAL "Windows64")
add_gamehdd_target(Minecraft.Client)
endif()
+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;
+29 -12
View File
@@ -2,10 +2,11 @@
#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 "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;
@@ -14,7 +15,12 @@ wstring ChatScreen::s_historyDraft;
bool ChatScreen::isAllowedChatChar(wchar_t c)
{
return c >= 0x20 && (c == L'\u00A7' || allowedChars.empty() || allowedChars.find(c) != wstring::npos);
if (c < 0x20) return false;
// Block Unicode bidirectional override characters that can be used to
// spoof chat messages or impersonate players.
if (c >= 0x202A && c <= 0x202E) return false; // LRE, RLE, PDF, LRO, RLO
if (c >= 0x2066 && c <= 0x2069) return false; // LRI, RLI, FSI, PDI
return true;
}
ChatScreen::ChatScreen()
@@ -93,6 +99,9 @@ void ChatScreen::keyPressed(wchar_t ch, int eventKey)
if (eventKey == Keyboard::KEY_RETURN)
{
wstring trim = trimString(message);
{ char buf[64]; sprintf_s(buf, "[CHAT] Sending (%d chars): ", (int)trim.length()); OutputDebugStringA(buf); }
OutputDebugStringW(trim.c_str());
OutputDebugStringA("\n");
if (trim.length() > 0)
{
if (!minecraft->handleClientSideCommand(trim))
@@ -135,6 +144,7 @@ void ChatScreen::keyPressed(wchar_t ch, int eventKey)
{
message.insert(cursorIndex, 1, ch);
cursorIndex++;
{ char buf[64]; sprintf_s(buf, "[CHAT] Char U+%04X accepted (%d chars)\n", (unsigned)ch, (int)message.length()); OutputDebugStringA(buf); }
}
}
@@ -145,14 +155,21 @@ void ChatScreen::render(int xm, int ym, float a)
int x = 4;
drawString(font, prefix, x, height - 12, 0xe0e0e0);
x += font->width(prefix);
wstring beforeCursor = message.substr(0, cursorIndex);
wstring afterCursor = message.substr(cursorIndex);
drawStringLiteral(font, beforeCursor, x, height - 12, 0xe0e0e0);
x += font->widthLiteral(beforeCursor);
// Shape the full message as one unit so letter connections and word order
// are correct. Track where the logical cursor maps in the visual string.
int visualCursorPos = 0;
wstring shaped = shapeArabicText(message, cursorIndex, &visualCursorPos);
// Render the full shaped message without re-shaping it
drawStringPreshaped(font, shaped, x, height - 12, 0xe0e0e0);
// Place the cursor at the correct visual position
wstring beforeCursorVisual = shaped.substr(0, visualCursorPos);
int cursorX = x + font->widthPreshaped(beforeCursorVisual);
if (frame / 6 % 2 == 0)
drawString(font, L"_", x, height - 12, 0xe0e0e0);
x += font->width(L"_");
drawStringLiteral(font, afterCursor, x, height - 12, 0xe0e0e0);
drawString(font, L"_", cursorX, height - 12, 0xe0e0e0);
Screen::render(xm, ym, a);
}
+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);
+7 -7
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"
+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;
+269 -55
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,16 +56,41 @@
#include "DLCTexturePack.h"
#ifdef _WINDOWS64
#include "Xbox\Network\NetworkPlayerXbox.h"
#include "Common\Network\PlatformNetworkManagerStub.h"
#include "Xbox/Network/NetworkPlayerXbox.h"
#include "Common/Network/PlatformNetworkManagerStub.h"
#include "Windows64/Network/WinsockNetLayer.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.
@@ -110,6 +135,7 @@ ClientConnection::ClientConnection(Minecraft *minecraft, Socket *socket, int iUs
started = false;
savedDataStorage = new SavedDataStorage(nullptr);
maxPlayers = 20;
m_isForkServer = false;
this->minecraft = minecraft;
@@ -342,7 +368,7 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
Level *dimensionLevel = minecraft->getLevel( packet->dimension );
if( dimensionLevel == nullptr )
{
level = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, false, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty);
level = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty);
// 4J Stu - We want to share the SavedDataStorage between levels
int otherDimensionId = packet->dimension == 0 ? -1 : 0;
@@ -377,6 +403,7 @@ 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
@@ -411,7 +438,7 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
activeLevel = minecraft->getLevel(otherDimensionId);
}
MultiPlayerLevel *dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, false, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty);
MultiPlayerLevel *dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty);
dimensionLevel->savedDataStorage = activeLevel->savedDataStorage;
@@ -447,6 +474,7 @@ 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
@@ -917,6 +945,36 @@ 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
@@ -946,6 +1004,7 @@ 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))
@@ -1083,33 +1142,35 @@ void ClientConnection::handleMoveEntitySmall(shared_ptr<MoveEntityPacketSmall> p
void ClientConnection::handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packet)
{
#ifdef _WINDOWS64
if (!g_NetworkManager.IsHost())
// 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())
{
for (int i = 0; i < packet->ids.length; i++)
{
shared_ptr<Entity> entity = getEntity(packet->ids[i]);
if (entity != nullptr && entity->GetType() == eTYPE_PLAYER)
if (entity != nullptr)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(entity);
if (player != nullptr)
{
PlayerUID xuid = player->getXuid();
INetworkPlayer* np = g_NetworkManager.GetPlayerByXuid(xuid);
if (np != nullptr)
for (int s = 1; s < MINECRAFT_NET_MAX_PLAYERS; ++s)
{
NetworkPlayerXbox* npx = (NetworkPlayerXbox*)np;
IQNetPlayer* qp = npx->GetQNetPlayer();
if (qp != nullptr)
IQNetPlayer* qp = &IQNet::m_player[s];
if (qp->GetCustomDataValue() != 0 &&
_wcsicmp(qp->m_gamertag, player->getName().c_str()) == 0)
{
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;
}
}
}
@@ -2870,7 +2931,7 @@ void ClientConnection::handleRespawn(shared_ptr<RespawnPacket> packet)
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->getLevel( packet->dimension );
if( dimensionLevel == nullptr )
{
dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->mapSeed, packet->playerGameType, false, minecraft->level->getLevelData()->isHardcore(), packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty);
dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->mapSeed, packet->playerGameType, false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty);
// 4J Stu - We want to shared the savedDataStorage between both levels
//if( dimensionLevel->savedDataStorage != nullptr )
@@ -3315,7 +3376,9 @@ void ClientConnection::handleTileEditorOpen(shared_ptr<TileEditorOpenPacket> pac
void ClientConnection::handleSignUpdate(shared_ptr<SignUpdatePacket> packet)
{
app.DebugPrintf("ClientConnection::handleSignUpdate - ");
app.DebugPrintf("[SIGN] handleSignUpdate at (%d, %d, %d):\n", packet->x, packet->y, packet->z);
for (int i = 0; i < MAX_SIGN_LINES; i++)
app.DebugPrintf("[SIGN] Line%d: \"%ls\"\n", i+1, packet->lines[i].c_str());
if (minecraft->level->hasChunkAt(packet->x, packet->y, packet->z))
{
shared_ptr<TileEntity> te = minecraft->level->getTileEntity(packet->x, packet->y, packet->z);
@@ -3329,7 +3392,7 @@ void ClientConnection::handleSignUpdate(shared_ptr<SignUpdatePacket> packet)
ste->SetMessage(i,packet->lines[i]);
}
app.DebugPrintf("verified = %d\tCensored = %d\n",packet->m_bVerified,packet->m_bCensored);
app.DebugPrintf("[SIGN] verified=%d censored=%d\n", packet->m_bVerified, packet->m_bCensored);
ste->SetVerified(packet->m_bVerified);
ste->SetCensored(packet->m_bCensored);
@@ -3337,12 +3400,12 @@ void ClientConnection::handleSignUpdate(shared_ptr<SignUpdatePacket> packet)
}
else
{
app.DebugPrintf("dynamic_pointer_cast<SignTileEntity>(te) == nullptr\n");
app.DebugPrintf("[SIGN] ERROR: tile entity is not a SignTileEntity\n");
}
}
else
{
app.DebugPrintf("hasChunkAt failed\n");
app.DebugPrintf("[SIGN] ERROR: chunk not loaded at position\n");
}
}
@@ -3729,6 +3792,158 @@ 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);
@@ -4036,6 +4251,9 @@ 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();
@@ -4045,10 +4263,6 @@ 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);
}
}
+2 -1
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,6 +48,7 @@ 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); }
+8
View File
@@ -1,5 +1,13 @@
#include "stdafx.h"
#include "ClientConstants.h"
#include "Common/BuildVer.h"
const wstring ClientConstants::VERSION_STRING = wstring(L"Minecraft LCE ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING;
const wstring ClientConstants::BRANCH_STRING = VER_BRANCHVERSION_STR_W;
// Default value for the toggle. If BuildVer defines VER_SHOW_VERSION_WATERMARK, use that.
#ifdef VER_SHOW_VERSION_WATERMARK
const bool ClientConstants::SHOW_VERSION_WATERMARK = (VER_SHOW_VERSION_WATERMARK != 0);
#else
const bool ClientConstants::SHOW_VERSION_WATERMARK = false;
#endif
+3
View File
@@ -15,5 +15,8 @@ public:
static const wstring VERSION_STRING;
static const wstring BRANCH_STRING;
// Toggle to show/hide the version/branch watermark in the debug overlay
static const bool SHOW_VERSION_WATERMARK;
static const bool DEADMAU5_CAMERA_CHEATS = false;
};
+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"
+3
View File
@@ -45,6 +45,7 @@
#define GAME_HOST_OPTION_BITMASK_DOTILEDROPS 0x08000000
#define GAME_HOST_OPTION_BITMASK_NATURALREGEN 0x10000000
#define GAME_HOST_OPTION_BITMASK_DODAYLIGHTCYCLE 0x20000000
#define GAME_HOST_OPTION_BITMASK_HARDCORE 0x40000000 // 4J Added - for hardcore mode
#define GAME_HOST_OPTION_BITMASK_ALL 0xFFFFFFFF
#define GAME_HOST_OPTION_BITMASK_WORLDSIZE_BITSHIFT 20
@@ -104,6 +105,8 @@ 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
+6 -1
View File
@@ -178,6 +178,9 @@ enum eGameSetting
// PSVita
eGameSetting_PSVita_NetworkModeAdhoc,
// PC
eGameSetting_VSync,
eGameSetting_ExclusiveFullscreen,
};
@@ -648,6 +651,7 @@ enum eGameHostOption
eGameHostOption_DoTileDrops,
eGameHostOption_NaturalRegeneration,
eGameHostOption_DoDaylightCycle,
eGameHostOption_Hardcore, // 4J Added - for hardcore mode
};
// 4J-PB - If any new DLC items are added to the TMSFiles, this array needs updated
@@ -878,7 +882,8 @@ enum EControllerActions
MINECRAFT_ACTION_SPAWN_CREEPER,
MINECRAFT_ACTION_CHANGE_SKIN,
MINECRAFT_ACTION_FLY_TOGGLE,
MINECRAFT_ACTION_RENDER_DEBUG
MINECRAFT_ACTION_RENDER_DEBUG,
MINECRAFT_ACTION_SCREENSHOT
};
enum eMCLang
@@ -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
+168 -89
View File
@@ -1,20 +1,22 @@
#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 "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 "../../MultiPlayerGameMode.h"
#include "../../Minecraft.World/LevelSettings.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"
@@ -25,7 +27,7 @@
#include <vector>
#include <memory>
#include <mutex>
#include <lce_filesystem\lce_filesystem.h>
#include <lce_filesystem/lce_filesystem.h>
#ifdef __ORBIS__
#include <audioout.h>
@@ -114,6 +116,9 @@ const char *SoundEngine::m_szStreamFileA[eStream_Max]=
"hal4",
"nuance1",
"nuance2",
"piano1",
"piano2",
"piano3",
#ifndef _XBOX
"creative1",
@@ -128,10 +133,6 @@ const char *SoundEngine::m_szStreamFileA[eStream_Max]=
"menu4",
#endif
"piano1",
"piano2",
"piano3",
// Nether
"nether1",
"nether2",
@@ -409,6 +410,13 @@ 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;
@@ -468,65 +476,69 @@ 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);
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++)
// Check path cache first to avoid expensive filesystem probing
auto cacheIt = m_soundPathCache.find(iSound);
if (cacheIt != m_soundPathCache.end())
{
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;
}
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());
}
if (!found)
else
{
int count = 0;
// 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)
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
{
for (size_t i = 1; i < 32; i++)
char basePlusExt[256];
sprintf_s(basePlusExt, "%s%s", basePath, extensions[extIdx]);
DWORD attr = GetFileAttributesA(basePlusExt);
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(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++)
{
count = 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))
{
validPaths.push_back(numberedPath);
}
}
}
}
if (count > 0)
m_soundPathCache[iSound] = validPaths;
if (validPaths.empty())
{
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);
}
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());
}
}
@@ -546,7 +558,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_ASYNC,
MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC,
nullptr,
nullptr,
&s->sound) != MA_SUCCESS)
@@ -602,24 +614,40 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
sprintf_s(basePath, "Windows64Media/Sound/Minecraft/UI/%s", ConvertSoundPathToName(name));
char finalPath[256];
sprintf_s(finalPath, "%s.wav", basePath);
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++)
// Check UI sound path cache first
auto cacheIt = m_uiSoundPathCache.find(iSound);
if (cacheIt != m_uiSoundPathCache.end())
{
sprintf_s(finalPath, "%s%s", basePath, extensions[i]);
if (FileExists(finalPath))
if (cacheIt->second.empty())
{
found = true;
break;
app.DebugPrintf("No sound file found for UI sound (cached): %s\n", basePath);
return;
}
sprintf_s(finalPath, "%s", cacheIt->second.c_str());
}
if (!found)
else
{
app.DebugPrintf("No sound file found for UI sound: %s\n", basePath);
return;
// 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;
}
MiniAudioSound* s = new MiniAudioSound();
@@ -633,7 +661,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
if (ma_sound_init_from_file(
&m_engine,
finalPath,
MA_SOUND_FLAG_ASYNC,
MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC,
nullptr,
nullptr,
&s->sound) != MA_SUCCESS)
@@ -786,6 +814,46 @@ 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
@@ -793,29 +861,33 @@ int SoundEngine::GetRandomishTrack(int iStart,int iEnd)
/////////////////////////////////////////////
int SoundEngine::getMusicID(int iDomain)
{
int iRandomVal=0;
int result=-1;
Minecraft *pMinecraft=Minecraft::GetInstance();
// Before the game has started?
if(pMinecraft==nullptr)
{
// any track from the overworld
return GetRandomishTrack(m_iStream_Overworld_Min,m_iStream_Overworld_Max);
#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
}
if(pMinecraft->skins->isUsingDefaultSkin())
else 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
return m_iStream_End_Min;
result = m_iStream_End_Min;
break;
case LevelData::DIMENSION_NETHER:
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);
result = GetRandomishTrack(m_iStream_Nether_Min,m_iStream_Nether_Max);
break;
default: //overworld
//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);
result = getOverworldMusicID(pMinecraft);
break;
}
}
else
@@ -824,15 +896,22 @@ int SoundEngine::getMusicID(int iDomain)
switch(iDomain)
{
case LevelData::DIMENSION_END:
return GetRandomishTrack(m_iStream_End_Min,m_iStream_End_Max);
result = GetRandomishTrack(m_iStream_End_Min,m_iStream_End_Max);
break;
case LevelData::DIMENSION_NETHER:
//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);
result = GetRandomishTrack(m_iStream_Nether_Min,m_iStream_Nether_Max);
break;
default: //overworld
//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);
result = getOverworldMusicID(pMinecraft);
break;
}
}
#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;
}
/////////////////////////////////////////////
@@ -1497,4 +1576,4 @@ char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpac
return buf;
}
#endif
#endif
+14 -4
View File
@@ -1,10 +1,13 @@
#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;
@@ -23,8 +26,10 @@ 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,
@@ -36,9 +41,6 @@ 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,
@@ -134,6 +136,7 @@ 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();
@@ -185,8 +188,15 @@ 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 -22
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,
@@ -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
@@ -1,28 +0,0 @@
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
@@ -1,115 +0,0 @@
<?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>
@@ -1,136 +0,0 @@
<?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
//--------------------------------------------------------------------------------------
+158 -54
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,7 +69,7 @@
#include <save_data_dialog.h>
#endif
#include "..\Common\Leaderboards\LeaderboardManager.h"
#include "../Common/Leaderboards/LeaderboardManager.h"
//CMinecraftApp app;
unsigned int CMinecraftApp::m_uiLastSignInData = 0;
@@ -187,6 +187,7 @@ CMinecraftApp::CMinecraftApp()
#endif
ZeroMemory(m_playerColours,MINECRAFT_NET_MAX_PLAYERS);
ZeroMemory(m_playerMapIcons,MINECRAFT_NET_MAX_PLAYERS);
m_iDLCOfferC=0;
m_bAllDLCContentRetrieved=true;
@@ -206,6 +207,8 @@ CMinecraftApp::CMinecraftApp()
m_dwRequiredTexturePackID=0;
m_bResetNether=false;
m_seedOverride = 0;
m_hasSeedOverride = false;
#ifdef _XBOX
// m_bTransferSavesToXboxOne=false;
@@ -1382,6 +1385,7 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad)
ActionGameSettings(iPad,eGameSetting_AnimatedCharacter);
ActionGameSettings(iPad,eGameSetting_PS3_EULA_Read);
ActionGameSettings(iPad,eGameSetting_VSync);
}
@@ -1617,6 +1621,22 @@ 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;
}
}
@@ -2328,6 +2348,38 @@ 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;
}
}
@@ -2463,6 +2515,12 @@ 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;
}
@@ -8084,6 +8142,16 @@ void CMinecraftApp::SetGameHostOption(unsigned int &uiHostSettings, eGameHostOpt
uiHostSettings&=~GAME_HOST_OPTION_BITMASK_WORLDSIZE;
uiHostSettings|=(GAME_HOST_OPTION_BITMASK_WORLDSIZE & (uiVal<<GAME_HOST_OPTION_BITMASK_WORLDSIZE_BITSHIFT));
break;
case eGameHostOption_Hardcore: // 4J Added - for hardcore mode
if(uiVal!=0)
{
uiHostSettings |= GAME_HOST_OPTION_BITMASK_HARDCORE;
}
else
{
uiHostSettings &= ~GAME_HOST_OPTION_BITMASK_HARDCORE;
}
break;
case eGameHostOption_All:
uiHostSettings=uiVal;
break;
@@ -8185,6 +8253,9 @@ unsigned int CMinecraftApp::GetGameHostOption(unsigned int uiHostSettings, eGame
case eGameHostOption_DoDaylightCycle:
return !(uiHostSettings&GAME_HOST_OPTION_BITMASK_DODAYLIGHTCYCLE);
break;
case eGameHostOption_Hardcore: // 4J Added - for hardcore mode
return (uiHostSettings&GAME_HOST_OPTION_BITMASK_HARDCORE) ? 1 : 0;
break;
}
return false;
@@ -8463,6 +8534,39 @@ 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)
{
+26 -11
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
{
@@ -706,6 +706,8 @@ private:
bool m_bGameNewWorldSizeUseMoat;
unsigned int m_GameNewHellScale;
#endif
int64_t m_seedOverride;
bool m_hasSeedOverride;
unsigned int FromBigEndian(unsigned int uiValue);
public:
@@ -723,6 +725,10 @@ 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();
@@ -747,10 +753,14 @@ 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);
@@ -805,6 +815,10 @@ public:
void SetCorruptSaveDeleted(bool bVal) {m_bCorruptSaveDeleted=bVal;}
bool GetCorruptSaveDeleted(void) {return m_bCorruptSaveDeleted;}
// 4J Added: Store save folder name for hardcore world deletion on Win64
void SetCurrentSaveFolderName(const wstring& name) { m_currentSaveFolderName = name; }
const wstring& GetCurrentSaveFolderName() const { return m_currentSaveFolderName; }
void EnterSaveNotificationSection();
void LeaveSaveNotificationSection();
private:
@@ -826,6 +840,7 @@ private:
CRITICAL_SECTION csAdditionalSkinBoxes;
CRITICAL_SECTION csAnimOverrideBitmask;
bool m_bCorruptSaveDeleted;
wstring m_currentSaveFolderName; // 4J Added: for hardcore world deletion on Win64
DWORD m_dwAdditionalModelParts[XUSER_MAX_COUNT];
+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)
{
+49 -11
View File
@@ -3,13 +3,14 @@
#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",
@@ -387,41 +388,65 @@ 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=*(unsigned int *)pbData;
unsigned int uiVersion=readUInt32(pbData, false);
uiCurrentByte+=sizeof(int);
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);
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);
return false;
}
pack->SetDataPointer(pbData);
unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte];
unsigned int uiParameterCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
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);
unsigned int uiFileCount=*(unsigned int *)&pbData[uiCurrentByte];
if (bXMLVersion)
{
uiCurrentByte += sizeof(int);
}
unsigned int uiFileCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
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];
}
@@ -430,6 +455,13 @@ 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;
@@ -445,12 +477,18 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
}
// Params
uiParameterCount=*(unsigned int *)pbTemp;
uiParameterCount=readUInt32(pbTemp, bSwapEndian);
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);
+26 -1
View File
@@ -31,7 +31,8 @@ public:
{
e_DLCParamType_Invalid = -1,
e_DLCParamType_DisplayName = 0,
e_DLCParamType_XMLVersion = 0,
e_DLCParamType_DisplayName,
e_DLCParamType_ThemeName,
e_DLCParamType_Free, // identify free skins
e_DLCParamType_Credit, // legal credits for DLC
@@ -94,6 +95,30 @@ 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);
+1 -1
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)
{
+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()
{
@@ -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;
@@ -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()
{

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