create-optimized-trains-1.3.1.jar
Curse Maven Snippet
What's new
v1.3.1
Focus
- Movement smoothness, simulation distance, LOD chunk radius, and rendering correctness
- Rendering fixes target entity visibility and depth layering with Oculus/Embeddium + Flywheel OIT
- Chunk loading and directional filtering improved for smoother train travel
- Distant Horizons compatibility groundwork added
New Features
Train Simulation Distance
- New
simulationconfig section:simulationDistance(0–128 chunks) extends the directional chunk lookahead beyond the previous hardcoded 10-chunk limit maxForcedChunks(20–400): configurable global cap for force-loaded chunks- Designed for use with Distant Horizons for smooth far-train visibility
Per-LOD Carriage Chunk Radius
- New
lod_radiusconfig section:radiusFull,radiusMedium,radiusLow,radiusGhost - Load a larger or smaller chunk area around carriages depending on their LOD level
- Replaces the single
CARRIAGE_CHUNK_RADIUSoption with fine-grained per-LOD control
Distant Horizons Compatibility
- Added
DistantHorizonsCompatto detect DH and coordinate chunk loading so the two systems do not conflict - Added
ShaderCompatfor lightweight detection of active shader packs (used by LOD and render decisions)
Player Train Tracker
- Added
PlayerTrainTrackerutility to track which players are currently riding which trains - Used by chunk loading and LOD systems for proximity-aware decisions
Improvements
Movement Smoothness
- Chunk boundary grace period is now adaptive: 5 ticks while moving, 20 ticks while stopped
- Eliminates JourneyMap position lag and entity freeze at chunk boundaries
ContraptionTickThrottleMixinadded to throttletickContraption()safely without visual desync
Chunk Loading
ChunkMapMixin: added a 5-chunk minimum radius — directional filtering is now disabled entirely when the player is close to the train, preventing nearby chunks from being skippedChunkLoadManager: global forced-chunk cap increased from 30 to 60; lookahead cap increased from 6 to 10TrainEventHandler: startup delay reduced from 100 to 40 ticks; ramp-up batch increased from 2 to 5DirectionalChunkShaper: direction response made faster (smooth factor 0.3 → 0.5)- Default
sideChunksincreased from 3 to 5 inModConfig
LOD System
- LOD distances restored to v1.2.0 baseline (
shaderLodShiftdefault back to 0) - Fixed
resolveCarriagePositionto usepositionAnchoras a fallback when a carriage entity is not yet available shouldAnimatenow allowsLOWLOD to animate; onlyGHOSTskips animationshouldSkipRenderthreshold lowered from 40 to 20 FPS
Rendering Performance
- Removed Flywheel frame skipping from
RenderOptimizer— positions now update every frame, eliminating position drift under load CarriageRendererMixin: culling distance increased from 256 to 512 blocks
Bug Fixes
Camera Shake
- Removed the
isActiveChunkOrLoadedInManageRedirect that was causing camera shake when sitting in a moving carriage
Visual Throttle
- Added
NEAR_VISUAL_SKIP_RADIUS_SQproximity guard so the visual throttle never fires for trains near the player/camera
Collision Throttle Intervals
TrainMixin: reduced collision throttle tick intervals from 4/8/12 to 2/4/8, making collisions more responsive
Chunk Grace Periods
CarriageMixin: chunk grace period reduced from 60 to 20 ticksCarriageEntityMixin: bind grace period reduced from 40 to 15 ticks
Entity Visibility Through Contraption Glass (Oculus/Embeddium)
- Entities were invisible when viewed through glass blocks on contraptions (trains with glass windows/doors)
- Root cause: Flywheel's OIT pipeline writes its glass composite to the
itemEntityTargetFBO. With Oculus, entity rendering is deferred intoFullyBufferedMultiBufferSource— entities were not in the framebuffer whencomposite()ran - Fix: inject a flush of the Iris/Oculus batched entity source at
popPush("blockentities")(priority 500, before Flywheel's priority 1000 hook), so entities are in the framebuffer when OIT composites the glass tint
Copycats+ Door Not Following Camera
- Animated doors from Copycats+ were moving with the camera when mounted in a contraption
- Root cause:
translucentMovingBlockwas routed throughbufferSource(), which Oculus replaces withFullyBufferedMultiBufferSource. The Iris source is flushed at a different time, causing the door geometry to be drawn relative to camera movement - Fix:
ContraptionBufferSourceWrappernow routestranslucentMovingBlocktoBufferSourceResolver.getRawMainBufferSource()— the vanilla rawBufferSourcenot replaced by Oculus — avoiding the infinite recursion that the Oculus getter substitution would otherwise cause
Entity Ghost / Wrong Layer Effect
- Entities appeared ghost-like or at the wrong depth layer relative to block entities rendered after them
- Root cause: the early entity flush was using
depthMask(false), so entities did not write their own depth to the main FBO. Block entities rendered after Flywheel's OIT hook would pass the depth test where they shouldn't, appearing on top of entities - Fix: removed
depthMask(false)from the entity flush — entities now write correct depth, giving proper layering
Copycats+ Door Wrong Depth Layer
- With the entity flush corrected, the door remained at the wrong layer relative to contraption solid blocks
- Root cause: the door was flushed with
depthMask(false)before OIT, then OITprepare()overwrote the item entity FBO depth — the door had no depth information when Iris compositeditemEntityTargetonto the main FBO - Fix: the door is now flushed by
OitFramebufferMixinat@HEADofcomposite()(withdepthMask(true)by default) and byLevelRendererPostFlywheelMixin(priority 1500) as a fallback when no OIT is active
Entities Invisible Through Copycats+ Door + Glass Combination
- When a contraption had both Copycats+ doors and glass blocks, all entities seen through the door were invisible
- Root cause: flushing the door to
ITEM_ENTITY_TARGETbeforeprepare()withdepthMask(true)wrote door depth into the item entity FBO, interfering with the shared depth texture between the OIT FBO and item entity FBO - Fix:
OitFramebufferMixin @HEADflush fires afterprepare()has already run, so the item entity FBO depth is clean before the door writes its own depth
Technical Details (Rendering)
- Added
BufferSourceResolver(reflection-based) to accessRenderBuffers.f_110094_directly, bypassing the Oculus getter substitution - Added
ContraptionBufferSourceWrapperto centralisetranslucentMovingBlockandtranslucentrerouting during contraption render - Added
FullyBufferedMultiBufferSourceMixin(@Pseudo) targeting bothnet.irisshadersandnet.coderbotnamespaces OitDepthMixin: cancelsrenderDepthFromTransmittance()to prevent Flywheel OIT from writing synthetic glass depthsoit_composite_fix.jscoremod: patchesOitFramebuffer.composite()fromdepthMask(true)todepthMask(false)
Configuration
New config sections in create_optimized_trains-common.toml:
[simulation]—simulationDistance,maxForcedChunks[lod_radius]—radiusFull,radiusMedium,radiusLow,radiusGhostsideChunksdefault changed from 3 to 5shaderLodShiftdefault restored to 0
💚❇️Thank you so much to all of you for making this mod a success! And let's keep growing!
This mod has no additional files