跳到正文

Strut

作者:Sandyy_sandy

一款基于 Geckolib 4、为 1.21.1 Fabric 打造的轻量级客户端与服务端动画引擎。支持网格、骨架、由服务器向各客户端发送资源等功能,并经过优化,可充分利用 GPU。

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Strut

Strut is a library mod for animated models in Minecraft: Java Edition, for Fabric on 1.21.1. Players only need it when another mod requires it: place it in the mods folder.

For mod developers, it is an animation and model engine, forked from GeckoLib.

Origin

Strut is a hard fork of GeckoLib 4.9.3. It keeps the parts of GeckoLib that already work well: bones, Molang, easings and animation controllers. Everything around them has been rebuilt. The code lives in its own com.sandymandy.strut package, so it does not conflict with GeckoLib. It supports only Fabric and Minecraft 1.21.1.

Additions

  • Server-owned animation. Code on the server says which animation to play, and every client derives the same pose from a shared clock. Late joiners, lag and reconnects need no extra handling.
  • Events that run once. Keyframes can run gameplay code on the server and sounds or particles on clients, without duplicates or skips.
  • Meshes and skeletons. Models are not limited to cubes. Meshes with armatures, skinning and deformation are supported, in a compact binary format (.strutmodel and .strutanim).
  • A Blockbench plugin for authoring those models, with a physics tab, armour setup and event markers on the timeline.
  • Physics. Jiggle bones, hair, cloth, flesh and ragdolls, with collision against the world, other models and players.
  • Player bodies. A player can be drawn as a Strut model without a second entity, with armour and held items.
  • Armour as a separate model per slot, bound to the wearer by bone name.
  • Scenes. Several entities animated together, for cutscenes and paired animations.
  • Asset sync. A server can send its models, textures and sounds to players on join, without a resource pack.
  • A GPU renderer that works with Iris shader packs, including shadows, with per-model shading styles and lighting from the sun, the moon and nearby light sources.
  • Render hooks. Other mods can add their own shader code, coloured lights and per-model values.
  • Minimal boilerplate. An entity is a class with no body and a single registration line.

For developers

Add the Modrinth Maven repository and the dependency to build.gradle:

repositories {
	exclusiveContent {
		forRepository {
			maven {
				name = "Modrinth"
				url = "" rel="noopener nofollow" target="_blank">https://api.modrinth.com/maven"
			}
		}
		filter {
			includeGroup "maven.modrinth"
		}
	}
}

dependencies {
	modImplementation "maven.modrinth:strut:1.0.0"
}

Then declare it in fabric.mod.json:

"depends": {
	"strut": "*"
}

Getting started goes from nothing to an animated entity, and the migration guide lists every renamed class and what can be deleted when moving from GeckoLib. One change affects ported mods: animation decisions move to the server, which changes how a GeckoLib mod behaves.

Requirements

Minecraft 1.21.1, Fabric Loader 0.17 or newer, Fabric API and Java 21. The GPU renderer needs OpenGL 4.3, so macOS is not supported. Iris is optional.

Links

Status

The project is in early development. The API may still change, and some rough edges are to be expected. Bug reports are welcome.

Some of the code in this project was written with the help of AI tools. The design and direction are the author’s, and the build runs a large test suite.

Licensed under MIT. Strut contains GeckoLib code, which is under its own MIT license.

常见问题

Strut 支持哪些 Minecraft 版本?

Strut 支持 Minecraft Java 版 1.21.1,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

Strut 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分