Warning: file_put_contents(/www/wwwroot/nmbt.106988770/cache/modrinth_versions_KxPzx0b9.json): Failed to open stream: Permission denied in /www/wwwroot/nmbt.106988770/resource_detail.php on line 53
libFirework - 墨喵 Minecraft 资源
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.

下载与版本
评论(0)
请 登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

赞助作者

请 登录 后赞助作者。

🔥 相关推荐
dpt

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

查看详情
Modernized Mekanism

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

查看详情
Super SMP modpack

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

查看详情
Kai Fixes Quartz

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

查看详情