▶️ ЗАБЕРИ СВОИ 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.4

SLib 0.0.4

Release13.07.2026

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

Patch 0.0.4

Fixes

  • Fixed Slib UI labels following ModernUI (or similar) preferred-typeface overrides of minecraft:default. Widgets no longer draw raw strings through the vanilla default face alone. All library text goes through Fonts and Style.withFont(slib:*) so Slib FontSets stay on screen even when ModernUI replaces the global default.
  • Fixed width and layout measurement still calling vanilla Font.width(String) / default face while the actual glyphs were drawn with Slib fonts. SearchBar, Sidebar, TabBar, Slider, Stepper, Tooltip and WarningScreen wrap now measure with the same Fonts role used for draw, so hit-boxes and line breaks match the painted text.
  • Fixed null Style constructors on Toggle, SearchBar, Dropdown, Slider and Stepper. The old pattern did this.style = style == null ? Style.GOLD : style and then still called style.animationMs() / style.easing() / style.togglePillRatio() on the original parameter, so new Widget(null, ...) NPEd after the “null-safe” assignment. Constructors resolve a local Style s first and use only that.
  • Fixed Dropdown list selection. Open options are drawn below the closed widget height, but selection went through super.mouseClicked → isMouseOver on the closed bounds only. Clicks on rows never called indexAt / setSelected. mouseClicked now handles header, list and outside-click close explicitly.
  • Fixed Dropdown hit-testing during open animation using the full list height while the scissor only showed openProgress of the list, so invisible rows were already clickable. Hit height now tracks animated visible height.
  • Fixed Dropdown.setSelected ignoring a click on the already-selected row (menu stayed open). Selecting any list row always closes the menu; onChange still fires only when the index changes.
  • Fixed Dropdown open animation fallback: valueOr(id, newOpen ? 1 : 0) inverted the start value so open/close could snap. Fallback is now newOpen ? 0 : 1.
  • Fixed Dropdown chevron drawing gfx.fill(px, py, px, py, col) (zero-area rect → invisible). Chevron is drawn as a real V made of 1-px spans.
  • Fixed Dropdown list border using an enlarged filled rounded box under the panel instead of a true outline. List border uses Rounded.drawOutline.
  • Fixed SDF rounded shader never loading. rounded.json listed stages as slib:shaders/core/rounded.{vsh,fsh}, which Forge resolves under assets/slib/shaders/core/ again (double path + double extension). Stages are now slib:rounded / slib:rounded. Without this, every rounded draw fell back to flat quads.
  • Fixed SDF outline uniforms missing from rounded.json (OutlineThickness, IsOutline), so even with a working shader binds no-oped and outlines were filled enlarged boxes. Both uniforms are declared with defaults.
  • Fixed outline quad pad too small for feather AA: pad is now halfThickness + edge + 1/pixelScale so soft outline edges are not clipped.
  • Fixed PlayerPreviewModel.dispose() treating every RemotePlayer as synthetic (synthetic = player instanceof RemotePlayer). Online other players are RemotePlayers; calling dispose after byUuid(onlineId) discarded them from the client level. Ownership is now an explicit ownedSynthetic flag set only when Slib constructs a local fake for preview.
  • Fixed PlayerPreviewModel auto-rotate using Minecraft.getFrameTime() (partial tick in ~[0,1]) as if it were seconds, so degrees-per-second was wrong. Rotation advances from wall-clock delta between frames, clamped to avoid spikes.
  • Fixed PlayerPreviewModel dividing GUI coordinates by guiScale and ignoring the parent PoseStack, which mis-placed the model at GUI scale 2×/3×/4× and under scroll transforms. Render uses GUI-space translation on the passed pose and restores RenderSystem.setShaderColor(1,1,1,1) in a finally block after applying ARGB alpha.
  • Fixed the config API: ConfigSection.bool/integer/decimal/string called builder.define(...) but threw away the returned ForgeConfigSpec.ConfigValue. ConfigKey only stored path/default/comment with no way to read the live value. Keys now hold the ConfigValue and expose get(), set() and value().
  • Fixed SnapshotGuard counting every non-compound/list/string tag as a flat 16 bytes. TAG_BYTE_ARRAY / TAG_INT_ARRAY / TAG_LONG_ARRAY now size by real payload length (length, 4 * ints, 8 * longs) so multi‑MB array bombs cannot pass the default max-bytes limit.
  • Fixed Boost.scheduleForPlayer using the same map key as global schedule (module::scheduleId). Player B scheduling the same id cancelled player A; logout of A cancelled B’s future. Player schedules use module::scheduleId::playerId and are cancelled only for that player.
  • Fixed SBS FrameMonitor feeding mc.getFrameTime() * 1e9 as frame duration. Partial tick is not milliseconds; samples looked like multi-hundred-ms frames and tripped “frame degraded” every tick. Frame time is measured as wall-clock nanos between client ticks, with a 2s throttle on the degrade warn log.
  • Fixed network protocol version not being enforced. NetworkRegistry.newSimpleChannel used s -> true on both sides, so PROTOCOL_VERSION was decorative. Acceptors are now PROTOCOL_VERSION::equals so mismatched Slib builds fail the channel handshake instead of desyncing packets.
  • Fixed SearchBar long queries: text always started at textX and scissor only clipped, so the caret could leave the visible field with no way to see the end of the string. Horizontal scrollX tracks the caret inside the text max width.
  • Fixed SearchBar click-to-caret ignoring scrollX, so after scrolling the caret jumped to the wrong character. Hit-test uses mouseX - textX + scrollX.
  • Fixed SearchBar paste accepting newlines and control characters (broke single-line layout). Insert strips \n / \r / \t and other controls.
  • Fixed hover animations on SearchBar, Toggle, Dropdown and Sidebar re-registering Animation.of(from, target, fullDuration) every render frame while target != value(), which reset elapsedMs and prevented a real ease. They now match Slider: re-register only when the target changes or the current anim is finished/missing.
  • Fixed Fonts.force applying withFont only to the root Component. Siblings kept their own styles and fell back to ModernUI/default. Force rebuilds via plainCopy and recursively forces each sibling, while preserving protected non-default / non-slib fonts (icon fonts).
  • Fixed RippleEffect double-easing: Animation already eased value(), then render called style.easing().apply(t) again, so radius/alpha overshot. Render maps the animation value linearly to radius and alpha.
  • Fixed Toast.dismiss leaving the slide-in animation running. Progress was slideIn * slideOut, so a mid-entry dismiss could jump opacity/offset. Dismiss cancels slide-in, then registers slide-out from the current held value.
  • Fixed Toast / Tooltip concurrent mutation: plain ArrayList / ArrayDeque threw CME when dismiss() ran during tick / renderAll. Queues are CopyOnWriteArrayList with snapshot ticks.
  • Fixed Modal.isOpen / Drawer.isOpen / trapsClick reading animation value only. Right after open(), elapsedMs == 0 so value() == 0 and input leaked for a tick. Explicit openIntent (and per-drawer intent keys) gates interaction immediately.
  • Fixed Drawer.toggle using value > 0.5 mid-animation (could flip the wrong way). Toggle now opens if closed and closes if open by intent.
  • Fixed KeyboardShortcut.handle iterating a live HashMap (CME if handlers unbind) and firing on release/repeat. Handler list is snapshotted; only ACTION_PRESS is handled.
  • Fixed Binding.set re-entrancy: a listener calling set nested fire() and double-notified. Nested sets while firing are ignored for notification.
  • Fixed AnimationTicker advancing Toast/Tooltip/Ripple with a fixed 50ms while AnimationRunner used wall-clock delta, so lifetime and slide animations drifted under lag. UX ticks use AnimationRunner.lastDeltaMs().
  • Fixed TabBar.Justify.DISTRIBUTE being a no-op (same layout as START). Leftover width is distributed into gaps between tabs.
  • Fixed TabBar.indexAt accepting clicks anywhere in the full SafeArea height, not only the tab strip. Hit test uses Theme.TAB_HEIGHT.
  • Fixed ProgressBar showValue doing nothing (value text always drawn when valueText != null). Value text is drawn only when showValue is true; measureHeight(boolean hasLabel) accounts for an under-bar label.
  • Fixed ItemIcon.renderCountInto placing the count near the top of the icon because Fonts.lineHeight() (≥12) made size - lineHeight ≈ 0 on 16px icons. Count is anchored to the bottom-right with a fixed 8px band.
  • Fixed Card.bodyOffsetY() always returning 52 even without a subtitle (wasted space / divider mismatch). bodyOffsetY(boolean hasSubtitle) returns 42 / 54.
  • Fixed Sidebar hover animation ids keyed on identityHashCode(gfx), which is not stable across frames. Ids key on the items array instance instead.
  • Fixed ScrollContainer scissor begin/end with no exception safety (imbalance if content throws). renderContent(Runnable) pushes clip and always pops in finally.
  • Fixed WarningScreen blur/resource dispose only on ESC onClose(). The dismiss button called setScreen and skipped cleanup. Dispose runs once from close() and removed().
  • Fixed Permissions.isOp only checking playerList.getOps().get(profile) != null. Singleplayer hosts and permission-level ops often have no ops-map entry. Op checks also accept hasPermissions(2).
  • Fixed Render.runOnRenderThread never being drained: tasks queued forever and never ran. SbsClient drains the queue on RenderGuiEvent.Post with the GUI PoseStack.
  • Fixed NodeRuntime.hasCycle returning true when DFS depth exceeded maxDepth, so a deep acyclic graph was reported as cyclic and execute failed with “graph has a cycle”. Depth overflow is no longer treated as a cycle; only stack re-entry is.
  • Fixed Tooltip.render calling mc.getWindow() without a null guard when Minecraft.getInstance() is null.
  • Fixed WarningScreen outline scissor push without try/finally, so an exception mid-draw left GL scissor and the clip stack unbalanced.
  • Fixed FontSets with a single TTF and no fallback: missing codepoints became tofu. All EN/RU FontSets reference minecraft:include/space and minecraft:default after the brand TTF so uncovered glyphs still resolve.

Improvements

  • Added en.antinimus.slib.api.ui.Fonts as the single text entry point for the library: roles (TITLE, BUTTON, BODY, BOLD, LABEL, MUTED, REGULAR), literal / force / apply, draw / drawCentered, width, lineHeight, EN/RU pack selection via options.languageCode, isModernUiLoaded, describeActiveTypefaces.
  • Locale font packs: EN titles/buttons use Plus Jakarta Sans SemiBold; body uses Instrument Sans SemiBold. RU titles/buttons use Manrope SemiBold; body uses Noto Sans Regular. Packs switch live for Fonts.draw; source TTFs live under assets/slib/fonts/en|ru with OFL licenses; runtime FontSets under assets/slib/font/en_* and ru_*.
  • Added FontWidgets for opt-in vanilla button labeling only (button / create / buttonLabel / setMessage / restyleButton). Slib does not auto-rewrite every AbstractButton on every screen (that broke ModernUI icons). Consumers wire their own buttons through FontWidgets or keep drawing with Fonts.
  • Hardened multipayer-facing paths in the same pass: real NBT array size accounting, per-player schedule isolation, protocol version equality, and render-queue drain.

UI / Sync

  • Fonts is wired through RoundedButton, SearchBar, Dropdown, Slider, Stepper, TabBar, Sidebar, Card, SectionHeader, StatRow, ProgressBar, ItemIcon, Toast, Tooltip, Modal and SBS WarningScreen.
  • Dropdown open interaction, TabBar distribute, SDF outline path, and modal/drawer input trapping are aligned with the rest of the UI engine after the audit pass.
  • No intentional public API break for normal consumers. Prefer dependencies.slib range [0.0.1, 0.1.0) or pin 0.0.4 for this patch. ConfigKey now exposes live config access (get / set / value) which the previous descriptor-only type lacked. Use FontWidgets when creating vanilla Buttons that should use Slib typefaces.

Файлы

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

Метаданные

Канал релиза

Release

Номер версии

0.0.4

Загрузчики

Forge

Версии игры

1.20.1–1.20.6

Загрузок

41

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

13.07.2026

Загрузил

ID версии

Главная