- Add mod_assets for weaveloader.api:missing_block and missing_item
- CopyModAssets target to deploy placeholders to mods/WeaveLoader.API/assets/
- WorldIdRemap: use placeholder icons instead of bedrock/apple
- Clear invalid block IDs before setTile to prevent setTileAndData crashes
- Add CompressedTileStorage::set for direct block write when Tile::tiles[old] is null
- Use missing block placeholder with API-resolved IDs instead of bedrock
- Work around raw_pdb GetRecordAtOffset removal via ForEachSymbol iteration
- Add hook implementations for custom pickaxe tier support
- Hooked_PickaxeItemGetDestroySpeed: use CustomPickaxeRegistry destroy speed for configured pickaxes when mining effective blocks
- Hooked_PickaxeItemCanDestroySpecial: use CustomPickaxeRegistry effective blocks and harvest level (obsidian requires level 3)
- Add TryReadItemIdFromPickaxe and TryReadTileId helpers for reading item/tile IDs from native pointers
Add managed item use hooks, server-authoritative summon support, and side-aware use item context.
Include IdHelper mappings, example ruby wand usage, and related runtime/crash-handler updates.
- add runtime hooks for texture bind/load and stitched UV sampling
- extend symbol resolution for texture and atlas entry points
- add per-icon atlas page routing and pending-page state
- build mod block/item atlas pages and virtual atlas outputs
- route terrain/item atlas requests through virtual paths for mod icons
- keep creative injection changes and hook plumbing in sync with new routing
Introduce a managed custom item API with mine-block callbacks and cancellation semantics, plus native runtime support for registering pickaxe items.
Key changes:
- add WeaveLoader.API Item base/PickaxeItem and dispatcher plumbing
- register managed item instances in ItemRegistry
- add native export for pickaxe registration and wire through GameObjectFactory
- resolve/hook item mineBlock paths (ItemInstance/Item/DiggerItem) and dispatch to managed host
- expose managed OnItemMineBlock entry in WeaveLoader.Core and DotNetHost
- add Ruby Pickaxe example item + placeholder texture
- keep logger usable even before managed handler setup via native fallback
- Skip UpdateTabPageCounts when no mod items injected (prevents TabSpec
corruption and crash when .NET fails to load)
- Add assembly/config existence checks with clear error messages
- Log which managed entry point fails to resolve
- Log hostfxr and load_assembly error codes for debugging
Instead of backing up and overwriting vanilla terrain.png/items.png,
hook CreateFileW to redirect file opens to merged atlases in
mods/ModLoader/generated/. The hook is active only during init and
removed once textures are loaded into GPU memory. Vanilla game files
are never modified.
CMinecraftApp::GetString is inlined by the MSVC linker at call sites like
Item::getHoverName, so the MinHook-based GetString hook never fires for
item name lookups. The game's StringTable::getString(int) does a simple
vector index lookup, and mod IDs (10000+) are beyond the vector size,
returning empty strings.
Fix: parse the GetString function's x64 machine code before hooking to
locate the RIP-relative reference to app.m_stringTable, then after mods
register their strings, resize m_stringsVec and inject mod strings at the
correct indices. Also adds GetString fallback to CConsoleMinecraftApp
variant and diagnostic logging.
- Inject items before Original_CreativeStaticCtor so TabSpec constructors
include mod items when calculating m_staticItems and m_pages
- Add UpdateTabPageCounts() to recalculate TabSpec page counts after
staticCtor as safety measure (handles different binary layouts)
- Resolve specs symbol for TabSpec array access
- Add diagnostic logging for ItemInstance vtable, shared_ptr, vector sizes
Mod Atlas (ModAtlas.cpp/h):
- Build merged terrain.png and items.png from mod assets (blocks/*.png, items/*.png)
- Scan vanilla atlas for empty (fully transparent) cells; place mod textures only there
- Install merged atlases over game files before Minecraft::init; restore originals after
- Hook loadUVs to create SimpleIcon objects for mod textures
- Hook registerIcon to return mod icons when requested by name
- FixupModIcons: copy field_0x48 (source-image ptr) from vanilla icons after init
Mod Strings (ModStrings.cpp/h):
- Store mod display names by description ID
- Hook GetString to serve mod names for blocks/items
API changes:
- BlockProperties/ItemProperties: .Name(displayName), namespaced .Icon()
- NativeInterop: displayName params, native_allocate_description_id, native_register_string
- Registry.Assets for string registration
- Output: mods/LegacyForge.API/, mods/ExampleMod/ (per-mod folders)
Mod discovery:
- Scan mods/*/ for mod folders; load DLLs from each
- LegacyForge.API as mod in mods/LegacyForge.API/
ExampleMod:
- Ruby ore block and ruby item with custom textures and names
- Assets: blocks/ruby_ore.png, items/ruby.png, lang files
- Furnace recipe: ruby_ore -> ruby
Runtime: loadUVs, registerIcon, getResourceAsStream, GetString hooks; stb_image for PNG
- Add PdbParser::BuildAddressIndex() to build a sorted RVA->name table
from public and module symbols before closing the PDB file
- Add PdbParser::FindNameByRVA() for O(log n) reverse lookup at crash time
- Update crash handler to resolve Minecraft.Client.exe addresses to
decorated function names (e.g. Minecraft.Client.exe!?tick@Minecraft+0x30)
- Resolve the faulting address itself in the crash report header
- Add vectored exception handler (CrashHandler) installed from DllMain to
reliably catch crashes before game CRT/SEH can override it, with x64
stack walking via RtlVirtualUnwind and re-entrancy protection
- Hook OutputDebugStringA to capture game debug output into game_debug.log
- Move all log files into a logs/ subdirectory (legacyforge.log,
game_debug.log, crash.log)
- Add millisecond-precision timestamps to all log entries
- Replace all raw printf calls with LogUtil::Log across every source file
for consistent timestamped, file-persisted logging
- Replace dbghelp with raw_pdb library for cross-platform PDB symbol resolution
- Add main menu branding overlay via C4JRender::Present hook
- Add creative inventory item injection from mods
- Add file-based logging (LogUtil) alongside console output
- Fix mod discovery with custom AssemblyLoadContext for proper type identity
- Add file dialog for game path selection in launcher
- Add CreativeTab enum and block/item creative tab assignment
- Unify build output to single ModLoader/build directory
Verified all hook targets exist in the compiled game's PDB:
- ?MinecraftWorld_RunStaticCtors@@YAXXZ
- ?tick@Minecraft@@QEAAX_N0@Z
- ?init@Minecraft@@QEAAXXZ
- ?ExitGame@CConsoleMinecraftApp@@UEAAXXZ (replaces destroy which is inlined)
Minecraft::destroy/run_end/stop are not public symbols (likely inlined),
so the shutdown hook now targets CConsoleMinecraftApp::ExitGame instead.
SKSE-style external mod loader with zero game source modifications.
- LegacyForge.Launcher: C# console app that injects runtime DLL into game process
- LegacyForgeRuntime: C++ DLL with PDB symbol resolution, MinHook function hooking, and .NET CoreCLR hosting
- LegacyForge.Core: C# mod discovery and lifecycle management
- LegacyForge.API: Fabric-style mod API with namespaced string IDs, fluent property builders, and event system
- ExampleMod: Sample mod demonstrating block/item registration