[Fast Static Entity]
模组大小仅为约 11KB
一款轻量级的客户端优化模组,用于减少装饰性实体在视觉状态未发生变化时的不必要渲染准备。
该模组不会每帧执行完整的渲染状态提取,而是在安全时复用实体之前提取的渲染状态。实体仍会正常渲染且不会被剔除;仅跳过渲染前的准备工作。
特性
-
缓存渲染状态
对符合条件的装饰性实体复用之前的渲染状态,而不是每帧重复提取其姿态、装备、模型、物品、地图及其他视觉数据。
-
最小化缓存更新
当缓存命中时,仅更新需要保持最新的值:ageInTicks 和 distanceToCameraSq。这确保了小型动画和依赖距离的渲染行为正常工作。
-
按实体缓存
缓存直接存储在每个实体上,而非全局映射中。当实体卸载时,其缓存状态也会随之自动释放,避免不必要的全局内存占用及潜在的内存泄漏。
-
事件驱动的失效机制
当相关的实体数据、装备、损伤状态、方块/光照数据或资源发生变化时,缓存会被失效。该模组不依赖持续的基于刻(tick)轮询来检测变化。
-
位置与旋转追踪
直接检查实体的位置和旋转变化,以防止在实体实际移动或改变朝向时复用过期的渲染状态。
优化的实体包括盔甲架、物品展示框、发光物品展示框、画作、具有固定 billboard 特性的显示实体,以及源自 BlockAttachedEntity 的兼容装饰性实体。
对于具有动态视觉条件的实体(如名称标签、计分板、发光轮廓、火焰、阴影、拴绳、乘客、载具或处于活跃准星瞄准状态的实体),在必要时会从缓存中排除。
完全独立运行,无需额外依赖。实现中不包含任何不必要的注释代码或死代码。
在单人游戏和多人游戏中均可安全使用。该模组仅在客户端侧运行,不会修改服务器端的游戏玩法或机制。
[Fast Static Entity]
THE MODS SIZE IS ONLY ABOUT 11KB
A lightweight client-side optimization mod that reduces unnecessary render preparation for decorative entities whose visual state has not changed.
Instead of performing full render state extraction every frame, the mod reuses the entity's previously extracted render state when it is safe to do so. The entity is still rendered normally and is never culled; only the preparation work before rendering is skipped.
Features
-
Cached Render States
Reuses the previous render state for eligible decorative entities instead of repeatedly extracting their pose, equipment, model, item, map, and other visual data every frame.
-
Minimal Cache Updates
On a cache hit, only the values that need to remain current are updated: ageInTicks and distanceToCameraSq. This keeps small animations and distance-dependent rendering behavior working correctly.
-
Per-Entity Caching
The cache is stored directly on each entity rather than in a global map. When an entity is unloaded, its cached state is automatically released with it, avoiding unnecessary global memory usage and potential memory leaks.
-
Event-Driven Invalidation
Caches are invalidated when relevant entity data, equipment, damage states, block/light data, or resources change. The mod does not rely on constant tick-based polling to detect changes.
-
Position and Rotation Tracking
Entity position and rotation changes are checked directly to prevent stale render states from being reused when an entity actually moves or changes orientation.
Optimized entities include Armor Stands, Item Frames, Glow Item Frames, Paintings, Display Entities with fixed billboarding, and compatible decorative entities derived from BlockAttachedEntity.
Entities with dynamic visual conditions such as nametags, scoreboards, glow outlines, fire, shadows, leashes, passengers, vehicles, or active crosshair targeting are excluded from caching when necessary.
Fully standalone with no additional dependencies required. The implementation contains no unnecessary commented-out code or dead code.
Safe to use in both singleplayer and multiplayer. The mod operates entirely on the client side and does not modify server-side gameplay or mechanics.
评论 0
登录后参与评分
还没有评论,来抢沙发吧