DC Render API

Quick rating

DC Render API

No reviews yet

DC Render API: Custom graphics API powering exclusive visual effects for Dragon Curse Chronicles.

API/Library
Mod Loaders
Forge
Fabric
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Required
Server Required

About

Project Details

Type
Mod
License
MIT License
Latest Version
dcrapi-0.1.1-1.20.1Fabric.jar
Authors
CurseForge
Modrinth

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

DC Render API

DC Render API is a Minecraft Forge mod that provides advanced particle rendering and animation systems, offering powerful particle effect creation tools for mod developers.

跳转至中文介绍: README.md

Features

Core Features

  • Controllable Particle System: Create and manage controllable particle instances
  • Particle Animation System: Built-in multiple preset animation effects and timeline system
  • Server-side Particle Synchronization: Achieve particle state synchronization between client and server
  • Particle Group Management: Batch management of particle effects
  • Particle Emitter System: Create and manage particle emission sources
  • Particle Style System: Customize particle appearance and behavior
  • Barrage System: Create complex barrage effects
  • Display Entity System: Manage and render display entities
  • Effect System: Combine multiple particle and animation effects
  • Event System: Respond to game events and particle lifecycle
  • Noise System: Generate natural random effects

Animation Effects

  • Circular orbit animation
  • Spiral orbit animation
  • Wave motion animation
  • Random walk animation
  • Ease animation
  • Timeline animation
  • Combined animation

Project Structure

DC Render API/
├── src/
│   └── main/
│       ├── java/com/qituo/dcrapi/
│       │   ├── DcRenderApi.java             # Main mod class
│       │   ├── network/                      # Network related classes
│       │   │   ├── DcRenderApiNetwork.java   # Network packet registration
│       │   │   ├── ParticleGroupPacket.java  # Particle group synchronization packet
│       │   │   └── ParticleSyncPacket.java   # Particle synchronization packet
│       │   ├── particles/                    # Particle related classes
│       │   │   ├── emitters/                 # Particle emitters
│       │   │   │   ├── ParticleEmitter.java      # Particle emitter interface
│       │   │   │   └── ParticleEmitterManager.java # Particle emitter manager
│       │   │   ├── style/                    # Particle styles
│       │   │   │   ├── ParticleStyle.java         # Particle style interface
│       │   │   │   └── ParticleStyleManager.java  # Particle style manager
│       │   │   ├── ClientParticleGroupManager.java  # Client particle group management
│       │   │   ├── ControlableParticle.java         # Controllable particle interface
│       │   │   ├── DcRenderApiParticleManager.java  # Particle manager
│       │   │   ├── ParticleAnimationExample.java    # Particle animation examples
│       │   │   ├── ServerParticleGroup.java         # Server-side particle group
│       │   │   └── ServerParticleGroupManager.java  # Server-side particle group management
│       │   └── platform/                     # Platform related classes
│       │       └── DcRenderApiServices.java  # Service interface
│       └── kotlin/com/qituo/dcrapi/          # Kotlin implementation
│           ├── animation/                    # Animation system
│           │   ├── timeline/                 # Timeline system
│           │   │   ├── DoubleConstTimeAnimator.kt
│           │   │   ├── Ease.kt
│           │   │   ├── Eases.kt
│           │   │   ├── Timeline.kt
│           │   │   └── ValueConstTimeAnimator.kt
│           │   ├── Animate.kt
│           │   └── AnimateManager.kt
│           ├── barrages/                     # Barrage system
│           │   ├── Barrage.kt
│           │   └── BarrageManager.kt
│           ├── color/                        # Color system
│           │   └── Color.kt
│           ├── config/                       # Configuration system
│           │   ├── Config.kt
│           │   └── ConfigManager.kt
│           ├── display/                      # Display entity system
│           │   ├── DisplayEntity.kt
│           │   └── DisplayEntityManager.kt
│           ├── effects/                      # Effect system
│           │   ├── Effect.kt
│           │   └── EffectManager.kt
│           ├── event/                        # Event system
│           │   ├── Event.kt
│           │   ├── EventBus.kt
│           │   └── Events.kt
│           ├── math/                         # Math utilities
│           │   └── Vec3.kt
│           ├── noise/                        # Noise system
│           │   ├── Noise.kt
│           │   └── PerlinNoise.kt
│           ├── particles/                    # Particle system
│           │   ├── emitters/                 # Particle emitter implementation
│           │   │   └── BasicParticleEmitter.kt
│           │   ├── style/                    # Particle style implementation
│           │   │   └── BasicParticleStyle.kt
│           │   └── ParticleAnimation.kt      # Particle animation implementation
│           ├── render/                       # Render system
│           │   ├── Render.kt
│           │   └── RenderManager.kt
│           └── shapes/                       # Shape system
│               ├── Circle.kt
│               └── Shape.kt
├── build.gradle                              # Gradle build file
├── gradle.properties                         # Gradle properties
└── settings.gradle                           # Gradle settings

Quick Start

Requirements

  • Minecraft 1.20.1+
  • Forge 47.4.17+
  • Java 17+

Installation

  1. Place the mod JAR file into the mods folder of your Minecraft game directory
  2. Start the game, and the mod will load automatically

API Usage Examples

Creating Controllable Particles

import com.qituo.dcrapi.particles.DcRenderApiParticleManager;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.phys.Vec3;

// Create a controllable particle
Vec3 position = new Vec3(0, 0, 0);
int particleId = DcRenderApiParticleManager.createParticle(
    ParticleTypes.FLAME, 
    ParticleTypes.FLAME.get(), 
    position
);

Using Particle Animations

import com.qituo.dcrapi.particles.ParticleAnimation;
import net.minecraft.world.phys.Vec3;

// Create circular orbit animation
Vec3 center = new Vec3(0, 0, 0);
Vec3 animatedPosition = ParticleAnimation.createCircleOrbit(
    center,    // Center point
    2.0,       // Radius
    0.1,       // Speed
    tick       // Current tick
);

// Create spiral orbit animation
Vec3 spiralPosition = ParticleAnimation.createSpiralOrbit(
    center,    // Center point
    1.0,       // Radius
    3.0,       // Height
    0.1,       // Speed
    tick       // Current tick
);

Server-side Particles

import com.qituo.dcrapi.particles.DcRenderApiParticleManager;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.phys.Vec3;

// Create server-side particle
ServerLevel level = ...;
Vec3 position = new Vec3(0, 0, 0);
DcRenderApiParticleManager.createServerParticle(
    level,
    ParticleTypes.FLAME, 
    ParticleTypes.FLAME.get(), 
    position
);

Particle Group Management

Creating Particle Groups

import com.qituo.dcrapi.particles.ServerParticleGroupManager;
import net.minecraft.world.phys.Vec3;

// Create particle group
Vec3 position = new Vec3(0, 0, 0);
int groupId = ServerParticleGroupManager.createGroup(position);

// Add particle to group
ServerParticleGroupManager.addParticleToGroup(
    groupId, 
    ParticleTypes.FLAME, 
    ParticleTypes.FLAME.get()
);

// Start group animation
ServerParticleGroupManager.startGroupAnimation(
    groupId, 
    "circle",  // Animation type
    2.0,       // Radius
    0.1        // Speed
);

Particle Emitter System

Creating Particle Emitters

import com.qituo.dcrapi.particles.emitters.ParticleEmitterManager;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.phys.Vec3;

// Create particle emitter
Vec3 position = new Vec3(0, 0, 0);
int emitterId = ParticleEmitterManager.createEmitter(
    position,
    ParticleTypes.FLAME,
    10,  // Particles per second
    2.0  // Particle speed
);

// Start emitter
ParticleEmitterManager.startEmitter(emitterId);

// Stop emitter
ParticleEmitterManager.stopEmitter(emitterId);

Particle Style System

Creating Custom Particle Styles

import com.qituo.dcrapi.particles.style.ParticleStyleManager;
import net.minecraft.world.phys.Vec3;

// Create particle style
int styleId = ParticleStyleManager.createStyle(
    1.0,    // Size
    0.5,    // Alpha
    new Vec3(1, 0, 0),  // Color (red)
    2.0     // Lifetime
);

// Apply style to particle
ParticleStyleManager.applyStyleToParticle(particleId, styleId);

Barrage System

Creating Barrages

import com.qituo.dcrapi.barrages.BarrageManager;
import net.minecraft.world.phys.Vec3;

// Create barrage
Vec3 position = new Vec3(0, 0, 0);
int barrageId = BarrageManager.createBarrage(
    position,
    "circle",  // Barrage type
    10,        // Barrage count
    2.0,       // Barrage speed
    1.0        // Barrage radius
);

// Start barrage
BarrageManager.startBarrage(barrageId);

Timeline Animation

Creating Timeline Animations

import com.qituo.dcrapi.animation.timeline.Timeline;
import com.qituo.dcrapi.animation.timeline.Eases;
import net.minecraft.world.phys.Vec3;

// Create timeline
Timeline timeline = new Timeline();

// Add position animation
Vec3 startPos = new Vec3(0, 0, 0);
Vec3 endPos = new Vec3(10, 5, 0);
timeline.addPositionAnimation(
    startPos,
    endPos,
    200,  // Duration (ticks)
    Eases.easeInOutCubic  // Ease function
);

// Add scale animation
timeline.addScaleAnimation(
    1.0,
    2.0,
    200,
    Eases.easeOutBounce
);

// Start timeline
timeline.start();

Effect System

Creating Composite Effects

import com.qituo.dcrapi.effects.EffectManager;
import net.minecraft.world.phys.Vec3;

// Create effect
Vec3 position = new Vec3(0, 0, 0);
int effectId = EffectManager.createEffect(position);

// Add particle to effect
EffectManager.addParticleToEffect(effectId, ParticleTypes.FLAME);

// Add animation to effect
EffectManager.addAnimationToEffect(effectId, "spiral", 2.0, 0.1);

// Start effect
EffectManager.startEffect(effectId);

Development Guide

Dependency Configuration

Add the following dependency to your mod's build.gradle file:

dependencies {
    implementation fg.deobf("com.qituo:dcrapi:1.0.0")
}

Registering Particle Types

import com.qituo.dcrapi.particles.DcRenderApiParticleManager;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraftforge.registries.RegistryObject;

// Register custom particle type
public static final RegistryObject<SimpleParticleType> CUSTOM_PARTICLE = 
    DcRenderApiParticleManager.PARTICLE_TYPES.register(
        "custom_particle",
        () -> new SimpleParticleType(false)
    );

Custom Particle Emitters

import com.qituo.dcrapi.particles.emitters.ParticleEmitter;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.phys.Vec3;

// Create custom particle emitter
public class CustomEmitter implements ParticleEmitter {
    private Vec3 position;
    private int particleCount;

    public CustomEmitter(Vec3 position, int particleCount) {
        this.position = position;
        this.particleCount = particleCount;
    }

    @Override
    public void emit() {
        // Custom emission logic
        for (int i = 0; i < particleCount; i++) {
            // Calculate emission position
            Vec3 emitPos = position.add(
                (Math.random() - 0.5) * 2,
                (Math.random() - 0.5) * 2,
                (Math.random() - 0.5) * 2
            );

            // Emit particle
            // Here you can use DcRenderApiParticleManager.createParticle
        }
    }

    @Override
    public void update() {
        // Custom update logic
    }

    @Override
    public boolean isAlive() {
        // Custom alive logic
        return true;
    }
}

Custom Particle Styles

import com.qituo.dcrapi.particles.style.ParticleStyle;
import net.minecraft.world.phys.Vec3;

// Create custom particle style
public class CustomStyle implements ParticleStyle {
    private float size;
    private float alpha;
    private Vec3 color;
    private float lifetime;

    public CustomStyle(float size, float alpha, Vec3 color, float lifetime) {
        this.size = size;
        this.alpha = alpha;
        this.color = color;
        this.lifetime = lifetime;
    }

    @Override
    public float getSize() {
        return size;
    }

    @Override
    public float getAlpha() {
        return alpha;
    }

    @Override
    public Vec3 getColor() {
        return color;
    }

    @Override
    public float getLifetime() {
        return lifetime;
    }

    @Override
    public void update() {
        // Custom update logic
        size *= 0.99f;
        alpha *= 0.95f;
    }
}

Custom Animations

import com.qituo.dcrapi.animation.Animate;
import net.minecraft.world.phys.Vec3;

// Create custom animation
public class CustomAnimation implements Animate {
    private Vec3 startPos;
    private Vec3 endPos;
    private int duration;
    private int ticks;

    public CustomAnimation(Vec3 startPos, Vec3 endPos, int duration) {
        this.startPos = startPos;
        this.endPos = endPos;
        this.duration = duration;
        this.ticks = 0;
    }

    @Override
    public Vec3 animate() {
        float progress = (float) ticks / duration;
        progress = Math.min(progress, 1.0f);

        // Custom animation logic
        return startPos.add(endPos.subtract(startPos).scale(progress));
    }

    @Override
    public boolean isDone() {
        return ticks >= duration;
    }

    @Override
    public void tick() {
        ticks++;
    }
}

License

This project is licensed under the QSUP License. See the LICENSE.md file for details.

Contributing

Welcome to submit Issues and Pull Requests to improve this project!

Contact

DC Render API

DC Render API is a Minecraft Forge mod that provides advanced particle rendering and animation systems, offering powerful particle effect creation tools for mod developers.

README.md

Features

Core Features

  • Controllable Particle System: Create and manage controllable particle instances
  • Particle Animation System: Built-in multiple preset animation effects and timeline system
  • Server-side Particle Synchronization: Achieve particle state synchronization between client and server
  • Particle Group Management: Batch management of particle effects
  • Particle Emitter System: Create and manage particle emission sources
  • Particle Style System: Customize particle appearance and behavior
  • Barrage System: Create complex barrage effects
  • Display Entity System: Manage and render display entities
  • Effect System: Combine multiple particle and animation effects
  • Event System: Respond to game events and particle lifecycle
  • Noise System: Generate natural random effects

Animation Effects

  • Circular orbit animation
  • Spiral orbit animation
  • Wave motion animation
  • Random walk animation
  • Ease animation
  • Timeline animation
  • Combined animation

Project Structure

DC Render API/
├── src/
│   └── main/
│       ├── java/com/qituo/dcrapi/
│       │   ├── DcRenderApi.java             # Main mod class
│       │   ├── network/                      # Network related classes
│       │   │   ├── DcRenderApiNetwork.java   # Network packet registration
│       │   │   ├── ParticleGroupPacket.java  # Particle group synchronization packet
│       │   │   └── ParticleSyncPacket.java   # Particle synchronization packet
│       │   ├── particles/                    # Particle related classes
│       │   │   ├── emitters/                 # Particle emitters
│       │   │   │   ├── ParticleEmitter.java      # Particle emitter interface
│       │   │   │   └── ParticleEmitterManager.java # Particle emitter manager
│       │   │   ├── style/                    # Particle styles
│       │   │   │   ├── ParticleStyle.java         # Particle style interface
│       │   │   │   └── ParticleStyleManager.java  # Particle style manager
│       │   │   ├── ClientParticleGroupManager.java  # Client particle group management
│       │   │   ├── ControlableParticle.java         # Controllable particle interface
│       │   │   ├── DcRenderApiParticleManager.java  # Particle manager
│       │   │   ├── ParticleAnimationExample.java    # Particle animation examples
│       │   │   ├── ServerParticleGroup.java         # Server-side particle group
│       │   │   └── ServerParticleGroupManager.java  # Server-side particle group management
│       │   └── platform/                     # Platform related classes
│       │       └── DcRenderApiServices.java  # Service interface
│       └── kotlin/com/qituo/dcrapi/          # Kotlin implementation
│           ├── animation/                    # Animation system
│           │   ├── timeline/                 # Timeline system
│           │   │   ├── DoubleConstTimeAnimator.kt
│           │   │   ├── Ease.kt
│           │   │   ├── Eases.kt
│           │   │   ├── Timeline.kt
│           │   │   └── ValueConstTimeAnimator.kt
│           │   ├── Animate.kt
│           │   └── AnimateManager.kt
│           ├── barrages/                     # Barrage system
│           │   ├── Barrage.kt
│           │   └── BarrageManager.kt
│           ├── color/                        # Color system
│           │   └── Color.kt
│           ├── config/                       # Configuration system
│           │   ├── Config.kt
│           │   └── ConfigManager.kt
│           ├── display/                      # Display entity system
│           │   ├── DisplayEntity.kt
│           │   └── DisplayEntityManager.kt
│           ├── effects/                      # Effect system
│           │   ├── Effect.kt
│           │   └── EffectManager.kt
│           ├── event/                        # Event system
│           │   ├── Event.kt
│           │   ├── EventBus.kt
│           │   └── Events.kt
│           ├── math/                         # Math utilities
│           │   └── Vec3.kt
│           ├── noise/                        # Noise system
│           │   ├── Noise.kt
│           │   └── PerlinNoise.kt
│           ├── particles/                    # Particle system
│           │   ├── emitters/                 # Particle emitter implementation
│           │   │   └── BasicParticleEmitter.kt
│           │   ├── style/                    # Particle style implementation
│           │   │   └── BasicParticleStyle.kt
│           │   └── ParticleAnimation.kt      # Particle animation implementation
│           ├── render/                       # Render system
│           │   ├── Render.kt
│           │   └── RenderManager.kt
│           └── shapes/                       # Shape system
│               ├── Circle.kt
│               └── Shape.kt
├── build.gradle                              # Gradle build file
├── gradle.properties                         # Gradle properties
└── settings.gradle                           # Gradle settings

Quick Start

Requirements

  • Minecraft 1.20.1+
  • Forge 47.4.17+
  • Java 17+

Installation

  1. Place the mod JAR file into the mods folder of your Minecraft game directory
  2. Start the game, and the mod will load automatically

API Usage Examples

Creating Controllable Particles

import com.qituo.dcrapi.particles.DcRenderApiParticleManager;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.phys.Vec3;

// Create a controllable particle
Vec3 position = new Vec3(0, 0, 0);
int particleId = DcRenderApiParticleManager.createParticle(
    ParticleTypes.FLAME, 
    ParticleTypes.FLAME.get(), 
    position
);

Using Particle Animations

import com.qituo.dcrapi.particles.ParticleAnimation;
import net.minecraft.world.phys.Vec3;

// Create circular orbit animation
Vec3 center = new Vec3(0, 0, 0);
Vec3 animatedPosition = ParticleAnimation.createCircleOrbit(
    center,    // Center point
    2.0,       // Radius
    0.1,       // Speed
    tick       // Current tick
);

// Create spiral orbit animation
Vec3 spiralPosition = ParticleAnimation.createSpiralOrbit(
    center,    // Center point
    1.0,       // Radius
    3.0,       // Height
    0.1,       // Speed
    tick       // Current tick
);

Server-side Particles

import com.qituo.dcrapi.particles.DcRenderApiParticleManager;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.phys.Vec3;

// Create server-side particle
ServerLevel level = ...;
Vec3 position = new Vec3(0, 0, 0);
DcRenderApiParticleManager.createServerParticle(
    level,
    ParticleTypes.FLAME, 
    ParticleTypes.FLAME.get(), 
    position
);

Particle Group Management

Creating Particle Groups

import com.qituo.dcrapi.particles.ServerParticleGroupManager;
import net.minecraft.world.phys.Vec3;

// Create particle group
Vec3 position = new Vec3(0, 0, 0);
int groupId = ServerParticleGroupManager.createGroup(position);

// Add particle to group
ServerParticleGroupManager.addParticleToGroup(
    groupId, 
    ParticleTypes.FLAME, 
    ParticleTypes.FLAME.get()
);

// Start group animation
ServerParticleGroupManager.startGroupAnimation(
    groupId, 
    "circle",  // Animation type
    2.0,       // Radius
    0.1        // Speed
);

Particle Emitter System

Creating Particle Emitters

import com.qituo.dcrapi.particles.emitters.ParticleEmitterManager;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.phys.Vec3;

// Create particle emitter
Vec3 position = new Vec3(0, 0, 0);
int emitterId = ParticleEmitterManager.createEmitter(
    position,
    ParticleTypes.FLAME,
    10,  // Particles per second
    2.0  // Particle speed
);

// Start emitter
ParticleEmitterManager.startEmitter(emitterId);

// Stop emitter
ParticleEmitterManager.stopEmitter(emitterId);

Particle Style System

Creating Custom Particle Styles

import com.qituo.dcrapi.particles.style.ParticleStyleManager;
import net.minecraft.world.phys.Vec3;

// Create particle style
int styleId = ParticleStyleManager.createStyle(
    1.0,    // Size
    0.5,    // Alpha
    new Vec3(1, 0, 0),  // Color (red)
    2.0     // Lifetime
);

// Apply style to particle
ParticleStyleManager.applyStyleToParticle(particleId, styleId);

Barrage System

Creating Barrages

import com.qituo.dcrapi.barrages.BarrageManager;
import net.minecraft.world.phys.Vec3;

// Create barrage
Vec3 position = new Vec3(0, 0, 0);
int barrageId = BarrageManager.createBarrage(
    position,
    "circle",  // Barrage type
    10,        // Barrage count
    2.0,       // Barrage speed
    1.0        // Barrage radius
);

// Start barrage
BarrageManager.startBarrage(barrageId);

Timeline Animation

Creating Timeline Animations

import com.qituo.dcrapi.animation.timeline.Timeline;
import com.qituo.dcrapi.animation.timeline.Eases;
import net.minecraft.world.phys.Vec3;

// Create timeline
Timeline timeline = new Timeline();

// Add position animation
Vec3 startPos = new Vec3(0, 0, 0);
Vec3 endPos = new Vec3(10, 5, 0);
timeline.addPositionAnimation(
    startPos,
    endPos,
    200,  // Duration (ticks)
    Eases.easeInOutCubic  // Ease function
);

// Add scale animation
timeline.addScaleAnimation(
    1.0,
    2.0,
    200,
    Eases.easeOutBounce
);

// Start timeline
timeline.start();

Effect System

Creating Composite Effects

import com.qituo.dcrapi.effects.EffectManager;
import net.minecraft.world.phys.Vec3;

// Create effect
Vec3 position = new Vec3(0, 0, 0);
int effectId = EffectManager.createEffect(position);

// Add particle to effect
EffectManager.addParticleToEffect(effectId, ParticleTypes.FLAME);

// Add animation to effect
EffectManager.addAnimationToEffect(effectId, "spiral", 2.0, 0.1);

// Start effect
EffectManager.startEffect(effectId);

Development Guide

Dependency Configuration

Add the following dependency to your mod's build.gradle file:

dependencies {
    implementation fg.deobf("com.qituo:dcrapi:1.0.0")
}

Registering Particle Types

import com.qituo.dcrapi.particles.DcRenderApiParticleManager;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraftforge.registries.RegistryObject;

// Register custom particle type
public static final RegistryObject<SimpleParticleType> CUSTOM_PARTICLE = 
    DcRenderApiParticleManager.PARTICLE_TYPES.register(
        "custom_particle",
        () -> new SimpleParticleType(false)
    );

Custom Particle Emitters

import com.qituo.dcrapi.particles.emitters.ParticleEmitter;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.phys.Vec3;

// Create custom particle emitter
public class CustomEmitter implements ParticleEmitter {
    private Vec3 position;
    private int particleCount;
    
    public CustomEmitter(Vec3 position, int particleCount) {
        this.position = position;
        this.particleCount = particleCount;
    }
    
    @Override
    public void emit() {
        // Custom emission logic
        for (int i = 0; i < particleCount; i++) {
            // Calculate emission position
            Vec3 emitPos = position.add(
                (Math.random() - 0.5) * 2,
                (Math.random() - 0.5) * 2,
                (Math.random() - 0.5) * 2
            );
            
            // Emit particle
            // Here you can use DcRenderApiParticleManager.createParticle
        }
    }
    
    @Override
    public void update() {
        // Custom update logic
    }
    
    @Override
    public boolean isAlive() {
        // Custom alive logic
        return true;
    }
}

Custom Particle Styles

import com.qituo.dcrapi.particles.style.ParticleStyle;
import net.minecraft.world.phys.Vec3;

// Create custom particle style
public class CustomStyle implements ParticleStyle {
    private float size;
    private float alpha;
    private Vec3 color;
    private float lifetime;
    
    public CustomStyle(float size, float alpha, Vec3 color, float lifetime) {
        this.size = size;
        this.alpha = alpha;
        this.color = color;
        this.lifetime = lifetime;
    }
    
    @Override
    public float getSize() {
        return size;
    }
    
    @Override
    public float getAlpha() {
        return alpha;
    }
    
    @Override
    public Vec3 getColor() {
        return color;
    }
    
    @Override
    public float getLifetime() {
        return lifetime;
    }
    
    @Override
    public void update() {
        // Custom update logic
        size *= 0.99f;
        alpha *= 0.95f;
    }
}

Custom Animations

import com.qituo.dcrapi.animation.Animate;
import net.minecraft.world.phys.Vec3;

// Create custom animation
public class CustomAnimation implements Animate {
    private Vec3 startPos;
    private Vec3 endPos;
    private int duration;
    private int ticks;
    
    public CustomAnimation(Vec3 startPos, Vec3 endPos, int duration) {
        this.startPos = startPos;
        this.endPos = endPos;
        this.duration = duration;
        this.ticks = 0;
    }
    
    @Override
    public Vec3 animate() {
        float progress = (float) ticks / duration;
        progress = Math.min(progress, 1.0f);
        
        // Custom animation logic
        return startPos.add(endPos.subtract(startPos).scale(progress));
    }
    
    @Override
    public boolean isDone() {
        return ticks >= duration;
    }
    
    @Override
    public void tick() {
        ticks++;
    }
}

License

This project is licensed under the QSUP License. See the LICENSE.md file for details.

Contributing

Welcome to submit Issues and Pull Requests to improve this project!

Contact

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Total Downloads
CurseForge
<1,000
Modrinth
<1,000
Last Updated
CurseForge
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works