
StartupEvents.registry('particle_type', e => {
    global.rocketPlumeSupplier = e.create('flame').overrideLimiter(true);
})
// kjs注册栗子，除了这里还有client，asset的两个，总计四个地方要填
if (Platform.isClientEnvironment()) {
    let sapConstructor = Java.loadClass("net.minecraft.client.particle.SimpleAnimatedParticle").__javaObject__.declaredConstructors[0];
    sapConstructor.setAccessible(true);
    let zero = Java.loadClass("java.lang.Float").valueOf(0);
    
    global.registerParticleProvider = (event) => {
        event.registerSpriteSet(global.rocketPlumeSupplier.get(), set => {
            return (particleOptions, clientLevel, x, y, z, xSpeed, ySpeed, zSpeed) => {
                let plume = sapConstructor.newInstance(clientLevel, x, y, z, set, zero);
                // Initialize particle's values
                plume.setParticleSpeed(xSpeed, ySpeed, zSpeed); // 调用的时候传入用来控制栗子移动的吧，大概，应该还有一个默认的重力/动量一类的属性
                plume.scale(5); // 多大
                plume.setLifetime(65); // 活多久，消散时间吧应该是叫
                plume.setSpriteFromAge(set); // 能不能用动画
                return plume
            }
        })
    }
    
    ForgeModEvents.onEvent('net.minecraftforge.client.event.RegisterParticleProvidersEvent', e => global.registerParticleProvider(e));
}