libFirework 图标

libFirework

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.0.0
本资源为搬运资源,原资源地址: https://modrinth.com/mod/libfirework
资源信息

Minecraft 版本: 1.19 1.19.1 1.19.2 1.19.3

平台: fabric

标签: library utility

资源介绍

libFirework

libFirework


A Minecraft library to create custom fireworks. What used to be a simple shitpost about amogus in minecraft evolved into this.

How to use

To use the library, just add it as a gradle dependency

repositories {
    exclusiveContent {
        forRepository {
            maven {
                name = "Modrinth"
                url = "https://api.modrinth.com/maven"
            }
        }
        filter {
            includeGroup "maven.modrinth"
        }
    }
}

dependencies {
    ...
    modImplementation 'maven.modrinth:libfirework:1.0.0'
}

Then you can register CustomRocketTypes using com.github.libfirework.LibFirework.registerCustomRocketType(). If you don't want to implement a CustomRocketTypes all by yourself you should really use com.github.libfirework.types.simple.CustomRocketTypeBuilder. You can use it like this

    @Override
    public void onInitialize() {
        LibFirework.registerCustomRocketType(new CustomRocketTypeBuilder(new Identifier("libfirework", "triangle"), Items.NETHERITE_INGOT).drawLines(new double[][]{{0.0, 1.0}, {1.0, 0.0}, {-1.0, 0.0}, {0.0, 1.0}}, 50).build());
        LibFirework.registerCustomRocketType(new CustomRocketTypeBuilder(new Identifier("libfirework", "ball"), Items.SNOWBALL).fillBall(5, 1).build());
        LibFirework.registerCustomRocketType(new CustomRocketTypeBuilder(new Identifier("libfirework", "burst"), Items.FIRE_CHARGE).burst(100).build());
        LibFirework.registerCustomRocketType(new CustomRocketTypeBuilder(new Identifier("libfirework", "amogus"), Items.REDSTONE).explodeSvg(TestLibfirework.class.getClassLoader().getResourceAsStream("amogus.svg"), "amogus.svg", 5.f, 1/500.f, new float[]{-0.8f, 1.f}).build());
    }

These examples are used straight from here

Custom svgs

drawing

If you want to use custom svgs, you can use the CustomRocketTypeBuilder.explodeSvg(). To do this, you have to supply it with an input stream of the svg. The svg should only contain one path and it should be the first child of the root. You also have to supply pointDistance, scale, and origin. The pointDistance regulate the number of particles that are generated. The scale and origin define how big the svg is drawn and what direction it moves to.

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
No Pumpkin Blur Effect

价格:0 墨喵币
下载量:0

查看详情
DeathFinder

价格:0 墨喵币
下载量:0

查看详情
Bare Hammers (Bare Bones x Just Hammers)

价格:0 墨喵币
下载量:0

查看详情
BMW Boat Pack

价格:0 墨喵币
下载量:0

查看详情