moire

模组

· 作者 Ghost

polymer-virtual-entity 的 Kotlin DSL

0 本站下载 0 关注 更新于 1 年前

需要前置:Polymer

最新 0.4.6 · 1.21.4 · Fabric

一键开服(送7天)

moire

moire 是一个 Kotlin 库,为 polymer-virtual-entity 提供了扩展函数和 DSL。使用 moire,你可以轻松地创建和管理 ElementHolder 实例。

注意: API 在 1.0.0 版本之前可能会发生不兼容的变更。请注意潜在的更改。

Gradle 配置

Groovy

repositories {
    maven { url 'https://maven.nucleoid.xyz/' }
    maven { url 'https://api.modrinth.com/maven' }
}

dependencies {
    modImplementation 'eu.pb4:polymer-virtual-entity:POLYMER_VERSION'
    modImplementation 'maven.modrinth:moire:MOIRE_VERSION'
}

Kotlin DSL

repositories {
    maven("https://maven.nucleoid.xyz/")
    maven("https://api.modrinth.com/maven")
}

dependencies {
    modImplementation("eu.pb4:polymer-virtual-entity:POLYMER_VERSION")
    modImplementation("maven.modrinth:moire:MOIRE_VERSION")
}

用法

以下是一个简单的示例。

import jp.fishmans.moire.elements.*
import jp.fishmans.moire.matrices.rotateLocalYDegrees
import net.minecraft.item.Items

fun create() = elementHolder {
    itemDisplayElement {
        transformation {
            scaleLocal(0.5f)
        }

        onTick {
            transform {
                rotateLocalYDegrees(11.25f)
            }

            startInterpolationIfDirty(1)
        }

        item = Items.TNT.defaultStack
        teleportDuration = 1
    }
}

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源