How jrbudda/minecrift works
Main Components
• Build/Installation Workflow – Represent the various scripts (install.bat/.py/.sh, build.bat, getchanges, applychanges) and how they interact with the code repositories.
• Patch Management System – Include both the “mcppatches” folder (for patching the deobfuscated Minecraft code) and the “patches” folder (for ongoing modifications). Show that changes are generated (using getchanges) and then applied (via applychanges).
• Source Code and VR-Specific Logic – Display the “src” folder structure with its primary packages:
– com.mtbs3d.minecrift (for VR integration, gameplay modifications, settings, control interfaces, and GUI)
– jopenvr (the Java wrappers for interfacing with OpenVR and native VR components)
• External Dependencies and Environment Setup – Include components like the MCP (downloaded and extracted into “mcp908”), external libraries, Java JDK, and Python 2.7 that are necessary for the build process.
Relationships and Interactions
• Data Flow in the Build Process:
– The “install” scripts download MCP and external dependencies.
– The downloaded MCP provides a decompiled and deobfuscated base (located in mcp908, even if not visible directly in the repo, it is central per the README).
– Patches from “mcppatches” are applied first to generate a near-vanilla Minecraft source.
– Next, further modifications from “patches” are layered on top.
– Then, custom Vivecraft code from “src” is merged in to form the final VR-enabled source code.
– The build process (triggered via build.bat and related scripts) then creates a jar and uses installer configurations (in the “installer” folder) to package the final executable installer.
• Version control and update mechanism:
– A process using “getchanges.bat” compares current changes against the original unmodified decompiled code, generating new patches.
– “applychanges.bat” can reapply these patches to update the codebase after pulling new changes from GitHub.
Architectural Patterns and Design Principles
• Layered/Pipeline Architecture – The overall process works as a sequential pipeline: environment setup → MCP decompilation → patch application → source code injection → packaging/installer build.
• Extensibility – By using patch files instead of directly distributing Minecraft’s code, the system allows easier updates to the underlying game while preserving Vivecraft modifications.
Technologies and Frameworks
• Java – Core language for Vivecraft’s source code, installer, and launch4j wrapper.
• Python (scripts like install.py, build.py, etc.) – Utilized in the build and patch application process.
• Shell and Batch Scripts – Part of the cross-platform build workflow.
• Launch4j – For wrapping the Java application as a Windows executable installer.
• OpenVR integration via the jopenvr package.