▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
SLib

SLib

Slib is a closed-source infrastructure library for Forge 1.20.1 mods. It unifies advanced networking mechanics and security guards, ensuring total stability for all dependent mods without the need for constant maintenance updates.

Оцените первым
699
0
Все версии→SLib 0.0.5

SLib 0.0.5

Release20.07.2026

Список изменений

Patch 0.0.5

Fixes

  • Fixed network packet id allocation depending on mod load order. Collision resolution used “first namespace wins preferred base”, so client and dedicated server could map the same consumer packet to different wire ids while PROTOCOL_VERSION still matched. Packet ids are now a pure FNV-1a of modId + packetName (stable, order-independent); real hash collisions fail loud at register time.
  • Fixed network protocol version still being decorative for consumer packet maps. Channel protocol bumped to 1.1 with the deterministic id scheme so mismatched Slib builds refuse the handshake instead of silently mis-dispatching.
  • Fixed Network.registerSafe holding INSTANCE_LOCK across Forge messageBuilder(...).add(). That reintroduced the dedicated-server / Refresh Trades style deadlock class the earlier “register outside Slib locks” hardening claimed to remove. Forge registration runs without Slib locks again.
  • Fixed nextId committing ID_TO_* maps before channel registration. A failed add() left permanent id holes and “registered” log lines for packets that never existed on the channel. Registration is now reserve → Forge add → commit, with full rollback on failure.
  • Fixed safe C2S handlers being unable to see ServerPlayer. The recommended Consumer<T> path dropped sender after the null-sender check, so real auth/rate-limit code was forced onto the unsafe Netty-thread overload. Added Network.ServerPlayerHandler<T> and a typed registerClientToServer(..., ServerPlayerHandler) that still enqueueWorks on the main thread and re-checks the sender is alive.
  • Fixed freezeRegistration never being called by Slib. Late/asymmetric consumer registration could still skew maps after common setup. Freeze now runs on FMLLoadCompleteEvent. unfreezeRegistration is gated behind -Dslib.network.allowUnfreeze=true (debug only).
  • Fixed sendToAllTracking NPE when the supplier returned null, and added sendToAllTrackingAndSelf for tracking sets that exclude the entity itself.
  • Fixed sendToChunk documentation drift: code correctly uses getChunkNow (no force-load); unloaded chunks drop the packet instead of pulling chunks.
  • Fixed PacketGuard.tryAcquire rate/cooldown TOCTOU. Concurrent Netty/main-thread calls could both pass check-then-put. Rate and cooldown now use atomic ConcurrentHashMap.compute, with rollback of a same-tick rate commit if cooldown rejects.
  • Fixed PacketGuard.DEFAULT_MAX_DISTANCE_SQ name lying about units (value was linear blocks, then squared). Renamed to DEFAULT_MAX_DISTANCE (legacy constant kept deprecated) and sanitize non-finite constructor distances.
  • Fixed PacketGuard.markRefreshed never calling maybeCleanup (docs claimed both paths cleaned).
  • Fixed SnapshotGuard.sanitizeNbt ignoring maxBytes / depth fail flags and fully copying unbounded byte/int/long arrays. Over-limit tags now reject to empty; arrays are capped; depth is hard-capped at 512.
  • Fixed JSON open-string / open-bracket bypass of string-length and malformed checks, and fail-open helpers (depth < 1 / bytes < 1 used to return true).
  • Fixed SnapshotGuard depth walks doing unbounded width work before size reject (CPU DoS in the guard). Size is checked first; depth walks are iterative with node budget and map/list caps.
  • Fixed Permissions.isOp treating any ops-list entry as OP (including level 1). Ops-list fallback now requires entry level ≥ 2 (still accepts hasPermissions(2)).
  • Fixed UI animations running only on ClientTickEvent (~20 Hz), so hover/slide felt stepped. AnimationTicker advances on RenderTickEvent with wall-clock delta.
  • Fixed AnimationRunner.cancel wiping or not flushing the current value. Cancel now freezes the live value into LAST; full wipe is forget (Toast/Ripple dispose use forget).
  • Fixed Drawer.toggle keying off visibility mid-close (could re-close instead of re-open). Toggle uses open-intent only.
  • Fixed Toast first-tick lifetime skew, invisible entries holding queue slots after near-zero dismiss, and Binding mid-fire double-notify / permanent bind listener leaks (unbind + emit snapshot).
  • Fixed Layout.stack ignoring section padding (used only minHeight).
  • Fixed Slider/Stepper inverted min/max and zero step leaving steppers dead.
  • Fixed ScrollContainer kinetic step treating deltaMs == 0 as a full step, and content not translating with scroll offset (renderContent(GuiGraphics, ...)).
  • Fixed Modal being a singleton without Esc/key trap. Modal is now a stack with close / closeAll, trapsKey, and Esc handling.
  • Fixed EventBus.off leaving empty handler lists forever (map growth on long-lived buses).
  • Fixed foliage grass impulse spam: continuous disturbance applied punch every frame and exploded spring energy. Blades only punch on rising force deltas.
  • Fixed foliage wind height boost unbounded with world Y (high trees/canopies got insane amplitude). Height contribution is capped; entity push uses a separate entity-safe sample path without foliage height stacking.
  • Fixed WindUv ignoring WindField.gustiness / turbulence (gust was hard-coded 0.55; turbulence unused). Shader/UV path now matches field parameters and clamps amplitude.
  • Fixed leaf ground contact hardcoded at y = 0.02 (leaves “landed” mid-air or through terrain). LeafCard.groundY is set from heightmap via Canopy.groundY(...); expired settled leaves can be culled via isExpired.
  • Fixed canopy per-tick groundY = min(groundY, y - radius) which ratcheted ground into the canopy / blocks. That clamp was removed; terrain height is authoritative.
  • Fixed foliage disturbance list races and step spam from render-tick walk tracking. Pulses use COW list, nearby step/dash pulses merge, and player step is distance+cooldown throttled.
  • Fixed foliage full O(n log n) distance sort every frame. Sort is dirty/every-8-frames; far LOD skips; frame budget hard-caps work.
  • Fixed double wind authority: server WorldWind no longer stomps Foliage.global().wind(); only the client drive path pushes foliage targets. Server wind is per-dimension (Map<ResourceKey, WorldWind>), not one shared singleton multi-ticked by every ServerLevel.
  • Fixed client/server wind seed divergence ("client".hashCode() vs "server".hashCode()). Weather macro now uses world/dimension seed material, not side string.
  • Fixed wind direction wander rewriting targets every tick (permanent heading random walk). Integration only blends current dir toward weather targets.
  • Fixed light-animal “strange flight”: living entities were pushed by both LivingTickEvent and blowNearby (and again under multi-player AABBs). Single even-tick blowNearby path only; once-per-entity-per-gameTime gate; air scale reduced; living vy / horizontal caps; rabbit no longer fakes setOnGround(false); hurtMarked removed from wind.
  • Fixed item drop physics stacking: join no longer force-ticks motion (track only); items excluded from living light-entity path; multi-player de-dupe; softer ground friction (0.92 vs 0.72×vanilla); wind skipped when settled; flat render only when truly on ground (not slow free-fall); 3D item models no longer paper-flat on XP=90°.
  • Fixed foliage “doing nothing in world”: sim was API-only with no spawn/render. WorldFoliageBridge auto-registers grass/canopies near the player; overlay + debris renderers draw results; dimension change clears sim caches.
  • Fixed Boost cancelling all schedules on any single LevelEvent.Unload (nether hop wiped overworld work). Unload is scoped: client only clears tick-batcher/frame samples when fully leaving a world (mc.level == null); player logout cancels only that player’s schedules.
  • Fixed Boost schedule map races: future removed by identity when the timer fires, so a re-entrant schedule(same key) cannot leave a stale future or drop a newer one. Player schedules keep reverse indexes (schedulesByPlayer / playersBySchedule) and drop them on fire, cancel, and logout.
  • Fixed Boost.offload swallowing Failover skips as success. Isolated modules complete exceptionally with ModuleSkippedException; real crashes still go through Failover.handleCrash and hop work onto the worker pool (scheduler never runs heavy work).
  • Fixed TickBatcher.shouldRun always returning true (no batch gate). shouldRun is now once-per-tick (batch=1); shouldRunEvery keeps N-tick cadence. Composite keys use \0 separators; map is access-order LRU + TTL eviction.
  • Fixed FrameMonitor health using raw last sample / wrong partial-tick feed. Samples are wall-clock nanos between RenderLevelStageEvent.AFTER_SKY frames; health/degraded use p95 against ~18ms / ~28ms budgets; running sum avoids O(n) average recompute.
  • Fixed Registry disconnect cleanups holding a single Runnable per player (second register overwrote first). Cleanups are a multi-list; clearPlayerState runs every registered cleanup and every PacketGuard.clearPlayer.
  • Fixed PacketGuard.dispose leaving rate/cooldown maps populated after unregister. Dispose now clearAlls then unregisters.
  • Fixed WindSync sticky remote authority after leaving multiplayer (client kept server wind forever) and per-dimension send throttle never cleaning up. Logout/LoggingOut clears remote authority + foliage; dim unload and server stop clear LAST_SEND.
  • Fixed double-send wind snapshot when sendDimension was called twice on the same gameTime (broken & 7 re-send path). Same-tick send is skipped once only.
  • Fixed SBS Failover game-time only advancing from client ticks / ad-hoc callers. ServerBootstrap ends each server tick with Failover.updateGameTime(server tick count) so cooldowns expire on dedicated servers.
  • Fixed ScissorClip vs deferred GuiGraphics batching: text/fills escaped clip after pop. Added push/pop(GuiGraphics, …) that flush() before changing GL scissor; SearchBar/Dropdown/Drawer/Scroll/Ripple/WarningScreen use it. Framebuffer scissor is clamped to FB bounds.
  • Fixed Modal ghost trap after last close(): residual backdrop/panel anim kept isOpen/trapsClick/trapsKey true with empty stack. Input now gates on blocksInput() / open-intent + stack; paint uses a closing snapshot until anim ends; Esc/keys only while blocking.
  • Fixed “stupid slider”: drag/click set value immediately (no ease lag); programmatic setValue still eases. Hover stays hot while dragging; NaN clamped.
  • Fixed Dropdown outside-click swallowing the event (return true); now closes and return false like SearchBar. SearchBar/Dropdown respect active/visible.
  • Fixed RoundedButton flat gfx.fill + radius()==0 + dead primaryWithHoverOutline. Buttons use SDF Rounded.draw / outline / soft hover glow and real corner radius from Style / Theme.RADIUS_BUTTON.
  • Fixed Sidebar null Style NPE and dead onSelect (added handleClick); hover anim ids keyed on label content, not ephemeral array identity.
  • Fixed AnimationTicker inventing 16ms when runner delta is 0 (Toast/Tooltip/Ripple ran faster than animations). Shared wall-clock: skip UX tick when delta is 0. Animation callback exceptions no longer abort the whole runner tick.
  • Fixed Toast off-screen queue entries burning durationMs never shown: only the first MAX_VISIBLE slots age; waiting entries hold until a slot frees. Near-invisible progress no longer occupies a paint slot.
  • Fixed ScrollContainer renderContent(Runnable) path without pose translate and unpaired scissor risk; translate when GuiGraphics is present; content hit helpers toContentX/Y / toViewX/Y; velocity from actual offset; scrollBy kills fling.
  • Fixed Drawer lacking trap/Esc/Bounds API; open-intent gates input; scissor flush path for content.
  • Fixed SDF rounded outline UV/pad and thin-ring alpha; fill AA pad; Metrics.pixelScaleF no longer hard-caps 1–4; Fonts.lineHeight(Role) uses role metrics (TITLE/BUTTON 16, BODY 13, …).
  • Fixed Style.withEasing(null) NPE path.
  • Fixed keyboard access on Slider (arrows/Home/End), Toggle (Space/Enter), Stepper (± keys), Dropdown (Esc/Enter/arrows + wheel scroll).
  • Fixed Dropdown long lists overflowing the screen: max visible rows, scroll offset, flip above header near bottom edge; defensive options copy.
  • Fixed SearchBar missing max length (default 256), shift-click / drag selection, caret blink reset on re-focus.
  • Fixed Stepper dead value animation / no hold-to-repeat; min width; NaN clamp.
  • Fixed Binding same-value re-fire dirty loop and setSilent mid-fire; observe registers after successful init.
  • Fixed RippleEffect concurrent list (COW + snapshot tick).
  • Fixed StateMachine re-entrancy from enter/exit (pending queue), reset lifecycle, Objects.equals state compare, null guards.
  • Fixed KeyboardShortcut bind not normalizing modifiers; null handler rejected; Binding public modifiers()/key()/toString().
  • Fixed Layout: explicit gap>=0 honored (auto min gap only when gap<0); real bottomReserve; DISTRIBUTE leftover into gaps; null sections; clamp min>max.
  • Fixed SafeArea splitHorizontal negative gap; ProgressBar partial-fill contrast + scissor fill; Card/StatRow font-metric layout / overflow scissor.
  • Stripped UTF-8 BOM from all assets/slib/font/*.json FontSets.

Improvements

  • Added en.antinimus.slib.api.physics — foliage + world wind + light entity/item motion (not a full rigid-body engine).
    • WindField / WorldWind (rolling gusts, weather blend, wetness, per-dimension server state)
    • WindSync (slib:wind S2C) — server broadcasts strength/dir/gust/turb/wet/phase every 10 ticks; client snaps to authority in MP
    • WindPush — soft slide for light living entities (rabbits, chickens, bees, silverfish, endermites, small animals)
    • ItemPhysics + FlatItemEntityRenderer — ground settle, no perpetual spin, optional wind slide
    • GrassBlade / GrassClump (spring-damper bend, tip lag, squash, stomp, base Y, biome grass tint)
    • LeafCard / Canopy (attached → loose → falling → settled, biome leaf color, shed)
    • FoliageDisturbance (step / dash / burst / explosion)
    • FoliageSim + Foliage facade (global sim, quality, weather, walk, punch, overlay toggles)
    • WindUv pure helpers for vertex/shader paths (shaderUniforms, vertexWindX/Z, grassWave, leafFlutter)
    • FoliageTicker auto client render-tick (focus, walk, auto quality)
    • FoliageBudget / FoliageFocus LOD + per-frame caps
    • WorldFoliageBridge — auto-scan grass/leaves near player; Falling Leaves / leavestorm / etc. detected → Slib does not shed or draw competing debris
    • FoliageAtlas + textured renderers — block-atlas grass/leaf sprites (cross-plane blades, tinted leaves; not solid-color “soap”)
    • FoliageOverlayRenderer / LeafDebrisRenderer — world-visible bent grass and falling/loose/settled leaves
  • Network: registrationFingerprint(), modId namespace validation, safer tracking send helpers.
  • UX: Modal stack, Binding unbind, Scroll translate helper, StateMachine self-transition side-effect fix.
  • Boost/Bootstrap: Boost.shutdown on ServerStoppingEvent (pools + schedules), scoped client unload, multi disconnect cleanups, frame samples on real frames not ticks, Failover server-tick clock.

UI / Sync

  • Slib main channel protocol is 1.1. Client and server must both run 0.0.5+ for slib:main.
  • Additional slib:wind channel for world-wind snapshots (independent of packet allocator slots; does not use Network.namespace("slib") which remains reserved).
  • Consumer packet registration order no longer affects wire ids on slib:main; register the same (modId, packet class simple name + [C2S|S2C]) pair on both sides.
  • Prefer dependencies.slib range [0.0.5,0.1.0) if you need foliage physics, deterministic packet ids, wind sync, or the network/security hardenings above. [0.0.1,0.1.0) still loads older consumers that only need earlier API, but mixed 0.0.4/0.0.5 main-channel ends will fail handshake on purpose.
  • Foliage auto-tick is client-only and disabled while paused / no level. Consumers can Foliage.setAutoTick(false) and drive Foliage.tick(dt) themselves.
  • World foliage auto-spawn/shed: Foliage.setWorldFoliageAuto / Foliage.setSlibLeafShed / Foliage.setOverlayEnabled. Overlay uses vanilla block-atlas textures + biome tints so it stays sharp under ModernUI and does not require Sodium/Iris vertex hooks (those remain optional future work).

Файлы

slib-0.0.5.jar(1.15 MiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

0.0.5

Загрузчики

Forge

Версии игры

1.20.1–1.20.6

Загрузок

129

Дата публикации

20.07.2026

Загрузил

ID версии

Главная