KubeJS Curios avatar

KubeJS Curios [1.21.1] [1.20.1]

Интеграция Curios для KubeJS

С помощью данного мода возможно:

  1. Получать CuriosHelper из LivingEntity

  2. Создавать пользовательские Curios

  3. Добавлять возможности Curios к предметам

  4. Регистрировать или удалять рендер Curios

  5. Добавлять события CuriosJS

Curios Helper для LivingEntity

Регистрация Curios & Модификация предметов (Startup)

StartupEvents.registry('item', event => {
    event.create('test')
        .attachCuriosCapability(
            CuriosJSCapabilityBuilder.create()
                .curioTick((slotContext, stack) => { })
                .onEquip((slotContext, oldStack, newStack) => { })
                .onUnequip((slotContext, oldStack, newStack) => { })
                .canEquip((slotContext, stack) => true)
                .canUnequip((slotContext, stack) => true)
                .modifySlotsTooltip((tooltips, stack) => tooltips)
                .addAttribute(
                    "minecraft:generic.max_health",
                    UUID,
                    20,
                    'addition'
                )
                .modifyAttribute(attributeModificationContext => {
                    let { slotContext, UUID, stack, modifiers } = attributeModificationContext
                    attributeModificationContext.modify(
                        "minecraft:generic.armor",
                        "identifier",
                        20,
                        'addition'
                    )
                })
                .canDrop((slotContext, source, lootingLevel, recentlyHit, stack) => true)
                .modifyAttributesTooltip((tooltips, stack) => tooltips)
                .modifyFortuneLevel((slotContext, lootContext, stack) => 0)
                .modifyLootingLevel((slotContext, source, target, baseLooting, stack) => 0)
                .makesPiglinsNeutral((slotContext, stack) => false)
                .canWalkOnPowderedSnow((slotContext, stack) => false)
                .isEnderMask((slotContext, enderMan, stack) => false)
        )
        .maxStackSize(1)
        .tag("curios:head")
})

ItemEvents.modification(event => {
    event.modify('apple', item => {
        item.attachCuriosCapability(
            CuriosJSCapabilityBuilder.create()
                .curioTick((slotContext, stack) => { })
                .onEquip((slotContext, oldStack, newStack) => { })
                .onUnequip((slotContext, oldStack, newStack) => { })
                .canEquip((slotContext, stack) => true)
                .canUnequip((slotContext, stack) => true)
                .modifySlotsTooltip((tooltips, stack) => tooltips)
                .addAttribute(
                    "minecraft:generic.max_health",
                    "identifier",
                    20,
                    'addition'
                )
                .modifyAttribute(attributeModificationContext => {
                    let { slotContext, UUID, stack, modifiers } = attributeModificationContext
                    attributeModificationContext.modify(
                        "minecraft:generic.armor",
                        UUID,
                        20,
                        'addition'
                    )
                })
                .canDrop((slotContext, source, lootingLevel, recentlyHit, stack) => true)
                .modifyAttributesTooltip((tooltips, stack) => tooltips)
                .modifyFortuneLevel((slotContext, lootContext, stack) => 0)
                .modifyLootingLevel((slotContext, source, target, baseLooting, stack) => 0)
                .makesPiglinsNeutral((slotContext, stack) => false)
                .canWalkOnPowderedSnow((slotContext, stack) => false)
                .isEnderMask((slotContext, enderMan, stack) => false)
        )
    })
})

Рендер (Клиентская часть)

CuriosJSEvents.registerRenderer(event => {
    // удаление рендера curios
    event.remove('test')

    // регистрация рендера curios
    event.register(
        'apple',
        context => {
            let {
                stack,
                slotContext,
                matrixStack,
                renderLayerParent,
                renderTypeBuffer,
                light,
                limbSwing,
                limbSwingAmount,
                partialTicks,
                ageInTicks,
                netHeadYaw,
                headPitch
            } = context
            let { modelManager } = Client
            let entity = slotContext.entity()
            let model = modelManager.getModel(new ModelResourceLocation(stack.id, 'inventory'))
            matrixStack.pushPose()
            CuriosRenderer.translateIfSneaking(matrixStack, entity)
            matrixStack.mulPose(new Quaternionf().rotateZ(JavaMath.toRadians(180)))
            matrixStack.mulPose(RotationAxis.YP.deg(-netHeadYaw))
            matrixStack.mulPose(RotationAxis.XP.deg(-headPitch))
            Client.itemRenderer.render(
                stack,
                'head',
                false,
                matrixStack,
                renderTypeBuffer,
                light,
                OverlayTexture.NO_OVERLAY,
                model
            )
            matrixStack.popPose()
        }
    )
})

Требуемые зависимости

Curios API (Forge/NeoForge) avatarCurios API (Forge/NeoForge)TheIllusiveC4
KubeJS avatarKubeJSLatvianModder

Скачать KubeJS Curios

 
Тип Скачать Версия Загрузчик Обновлено Размер
Releasekubejs_curios_forge_1.20.1-1.0.4.jar1.20.1Forge29 июля 202541,3 КБ
Releasekubejs_curios_neoforge_1.21.1-1.0.4.jar1.21.1NeoForge29 июля 202540,2 КБ
Releasekubejs_curios_forge_1.20.1-1.0.3.jar1.20.1Forge23 июня 202530,1 КБ
Releasekubejs_curios_forge_1.20.1-1.0.2fix.jar1.20.1Forge3 мая 202530 КБ
Releasekubejs_curios_neoforge_1.21.1-1.0.2fix.jar1.21.1NeoForge3 мая 202529,1 КБ
Releasekubejs_curios_forge_1.20.1-1.0.1.jar1.20.1Forge2 мая 202529,5 КБ
Releasekubejs_curios_neoforge_1.21.1-1.0.1.jar1.21.1NeoForge2 мая 202528,6 КБ
Releasekubejs_curios_forge_1.20.1-1.0.0.jar1.20.1Forge30 апреля 202529,1 КБ
Releasekubejs_curios_neoforge_1.21.1-1.0.0.jar1.21.1NeoForge30 апреля 202528,3 КБ
Пожалуйста авторизуйтесь, чтобы оставить свой комментарий.