All Mods Resource Packs Data Packs Shaders Modpacks Plugins
DC Render API

DC Render API

by Yifei061004 β€’ Downloads: 0 β€’ Followers: 0
Description
Gallery
Changelog
Versions

DC Render API

License: MIT GitHub CurseForge Modrinth Platform Minecraft Main Mod

DC Render API is an advanced particle rendering & animation library for Minecraft mods. It exposes a complete, production-ready visual system for controllable particles, particle groups, emitters, styles, barrages, display entities, easing timelines and a lightweight event bus β€” and ships with a built-in mitigation strategy against aggressive addParticle culling from client-side optimization mods such as Embeddium / Rubidium / Inventory Particles. The project maintains Forge 1.20.1 / Fabric 1.20.1 / NeoForge 1.21.1 with full feature parity across all three loaders.

跳转至中文文摣: README.md


Platform Support

Loader Minecraft Version Mod Artifact JDK Kotlin Language Adapter
Minecraft Forge 1.20.1 0.2.0-1.20.1Forge JDK 17+ Kotlin-for-Forge-*-1.20.1.jar (by thedarkcolour)
Fabric 1.20.1 0.2.0-1.20.1Fabric JDK 17+ fabric-language-kotlin-* (by FabricMC)
NeoForge 1.21.1 1.0.0-1.21.1NeoForge JDK 21+ Kotlin-for-Forge-*-1.21.1-NeoForge.jar (by thedarkcolour)

⚠ Mandatory three-jar setup for every loader: install the Kotlin language adapter + DC Render API jar + the main mod that consumes it (e.g. Dragon Curse Chronicles). Missing any one of the three will crash at load.


Core Features

Main Capabilities

  • Controllable Particle System: Particle instances tracked by stable id with explicit lifecycle & dead flag.
  • Particle Animation System: Circle orbit, spiral orbit, wave motion, random walk, easing functions, and timeline keyframe interpolation.
  • Server-Client Particle Sync: Two dedicated network packets (ParticleGroupPacket, ParticleSyncPacket) guarantee a consistent view across clients.
  • Particle Group Management: ServerParticleGroupManager / ClientParticleGroupManager for batched create / tick / destroy.
  • Particle Emitter System: ParticleEmitter interface + ParticleEmitterManager with rate & velocity settings.
  • Particle Style System: ParticleStyle for size / alpha / RGB / lifetime; createStyle + applyStyleToParticle.
  • Barrage System: BarrageManager supports complex patterns including circular barrages.
  • Display Entity System: Lightweight wrapper around Minecraft Display Entities: DisplayEntity + DisplayEntityManager.
  • Effect System: Effect + EffectManager combines multiple particles + animations into one reusable unit.
  • Event System: Lightweight EventBus + ParticleEventBus; hooks for collision, hit, on-ground, liquid-entry.
  • Noise System: PerlinNoise for natural-looking randomness.
  • Smart Particle Dispatcher (pioneered in NeoForge host mod): Frame-aware batching + LOD falloff + object pooling + progressive emission + long-distance packet bypass; works around aggressive culling from client particle mods.

Animation Effects

  • Circular Orbit
  • Spiral Orbit
  • Wave Motion
  • Random Walk
  • Easing functions (Linear, Quad, Cubic, Quart, Quint, Sine, Expo, Circ, Back, Elastic, Bounce …)
  • Timeline interpolation (position, scale, rotation, color)
  • Composition / layered animation

Project Structure

DC Render API/                                  # Standalone monorepo (this directory)
β”œβ”€β”€ src/                                        # Forge 1.20.1 sources
β”‚   └── main/
β”‚       β”œβ”€β”€ java/com/qituo/dcrapi/              # Java layer: mod entry, items, network, particles, platform
β”‚       β”‚   β”œβ”€β”€ DcRenderApi.java                #   Forge @Mod entry
β”‚       β”‚   β”œβ”€β”€ items/ParticleTesterItem.java   #   in-game particle debugger
β”‚       β”‚   β”œβ”€β”€ network/*                       #   server β†’ client sync packets
β”‚       β”‚   β”œβ”€β”€ particles/
β”‚       β”‚   β”‚   β”œβ”€β”€ emitters/*                  #   Emitter interface + manager
β”‚       β”‚   β”‚   β”œβ”€β”€ style/*                     #   Style interface + manager
β”‚       β”‚   β”‚   β”œβ”€β”€ DcRenderApiParticleManager.java  # Thread-safe particle registry
β”‚       β”‚   β”‚   β”œβ”€β”€ ControlableParticle.java
β”‚       β”‚   β”‚   └── ServerParticleGroup*.java
β”‚       β”‚   └── platform/DcRenderApiServices.java
β”‚       └── kotlin/com/qituo/dcrapi/            # Kotlin layer: animation, barrage, color, config, display, effect, event, math, noise, render, shape, commands, builder, composition
β”‚           β”œβ”€β”€ animation/timeline/             #   Timeline: Eases.kt, Timeline.kt, DoubleConstTimeAnimator, ValueConstTimeAnimator
β”‚           β”œβ”€β”€ barrages/ color/ config/ display/ effects/ event/ math/ noise/
β”‚           β”œβ”€β”€ particles/builder/ParticleGroupBuilder.kt  # Recommended builder API
β”‚           β”œβ”€β”€ particles/command/  particles/composition/  particles/emitters/  particles/style/
β”‚           └── render/ shapes/
β”œβ”€β”€ fabric/DC Render API/                       # Fabric 1.20.1 sources (feature parity)
β”‚   β”œβ”€β”€ src/main/java/                          #   Fabric particles, network, items, mixin, client initializer
β”‚   β”œβ”€β”€ src/main/kotlin/                        #   Same Kotlin subsystem layout as Forge
β”‚   β”œβ”€β”€ src/main/resources/fabric.mod.json      #   Fabric metadata
β”‚   └── build.gradle / gradle.properties
β”œβ”€β”€ neoforge/                                   # NeoForge 1.21.1 sources (feature parity)
β”‚   β”œβ”€β”€ src/main/java + kotlin/                 #   Ported to 1.21.1 DataComponents / Holder / Codec / NeoForge.EVENT_BUS
β”‚   └── build.gradle / gradle.properties
β”œβ”€β”€ LICENSE.md                                  # MIT License (mirrors the standalone GitHub repo)
β”œβ”€β”€ build.gradle                                # Forge 1.20.1 build; registers 'sourcesJar' task
β”œβ”€β”€ gradle.properties                           # mod_version=0.2.0, mod_id=dcrapi, mod_license=MIT
β”œβ”€β”€ gradlew / gradlew.bat / gradle/             # Gradle Wrapper
└── settings.gradle

Installation (Player Side)

Forge 1.20.1

  1. Install Minecraft Forge 1.20.1 (47.x or newer).
  2. Download all three jars and drop them into your mods/ folder:
    • Kotlin adapter: Kotlin-for-Forge-*-1.20.1.jar (CurseForge / Modrinth)
    • DC Render API: dcrapi-0.2.0-1.20.1Forge.jar
    • The consuming mod (e.g. Dragon Curse Chronicles Forge edition)
  3. Launch the game.

Fabric 1.20.1

  1. Install Fabric Loader 0.16.13+ and Fabric API 0.92.11+1.20.1.
  2. Download all three jars and drop them into your mods/ folder:
    • Kotlin adapter: fabric-language-kotlin-* (CurseForge / Modrinth)
    • DC Render API: dcrapi-0.2.0-1.20.1Fabric.jar
    • The consuming mod (e.g. Dragon Curse Chronicles Fabric edition)
  3. Launch the game.

NeoForge 1.21.1

  1. Install NeoForge 21.1.248+ for Minecraft 1.21.1.
  2. Download all three jars and drop them into your mods/ folder:
    • Kotlin adapter: Kotlin-for-Forge-*-1.21.1-NeoForge.jar (thedarkcolour)
    • DC Render API: dcrapi-1.0.0-1.21.1NeoForge.jar
    • The consuming mod (e.g. Dragon Curse Chronicles NeoForge edition)
  3. Launch the game.

Quick Start (Integrate into a Custom Mod)

Requirements Matrix

Loader Requirements
Forge 1.20.1 Forge 47.x / JDK 17+ / Kotlin for Forge
Fabric 1.20.1 Fabric Loader 0.16.13+ / Fabric API / fabric-language-kotlin / JDK 17+
NeoForge 1.21.1 NeoForge 21.1.248+ / Kotlin for Forge NeoForge / JDK 21+

Building Artifacts for All Three Loaders

# ============ Forge 1.20.1 ============
cd "DC Render API"
./gradlew build               # outputs β†’ build/libs/dcrapi-0.2.0-1.20.1Forge.jar and -sources.jar

# ============ Fabric 1.20.1 ============
cd "DC Render API/fabric/DC Render API"
./gradlew build               # outputs β†’ build/libs/dcrapi-0.2.0-1.20.1Fabric.jar and -sources.jar

# ============ NeoForge 1.21.1 ============
cd "DC Render API/neoforge"
./gradlew build               # outputs β†’ build/libs/dcrapi-1.0.0-1.21.1NeoForge.jar and -sources.jar

All three build.gradle scripts register a sourcesJar task, so a -sources.jar is produced automatically on every build.


Core Usage (Java Modders)

1. Create a Particle Group with Builder (Recommended)

import com.qituo.dcrapi.particles.builder.ParticleGroupBuilder;
import com.qituo.dcrapi.particles.ServerParticleGroup;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.phys.Vec3;

ServerLevel level = ...;
Vec3 pos = player.position();

ServerParticleGroup group = new ParticleGroupBuilder()
    .position(pos)
    .world(level)
    .scale(2.0)
    .visibleRange(128.0)
    .maxTick(200)
    .buildAndRegister();

2. Create a Controllable Particle (Server β†’ Client Synced)

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

int pid = DcRenderApiParticleManager.createParticle(
    ParticleTypes.FLAME,
    ParticleTypes.FLAME.get(),
    new Vec3(0, 64, 0)
);

3. Circle & Spiral Orbit Animations

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

Vec3 center = player.position();
Vec3 orbitPos  = ParticleAnimation.createCircleOrbit(center, 2.0, 0.1, tick);
Vec3 spiralPos = ParticleAnimation.createSpiralOrbit(center, 1.0, 3.0, 0.1, tick);

4. Particle Hit Event (Deal Damage)

import com.qituo.dcrapi.event.ParticleEventBus;
import com.qituo.dcrapi.event.ParticleEvents.ParticleHitEntityEvent;

ParticleEventBus.INSTANCE.register(ParticleHitEntityEvent.class, ev -> {
    ev.getTarget().hurt(ev.getTarget().level().damageSources().magic(), 5.0F);
});

Event Types: | Event Class | Trigger | |---|---| | ParticleCollideEvent | Particle collides with a block | | ParticleHitEntityEvent | Particle hits a living entity | | ParticleOnGroundEvent | Particle lands on the ground | | ParticleOnLiquidEvent | Particle enters a liquid |

5. Particle Style System

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

int styleId = ParticleStyleManager.createStyle(
    1.0F,    // size
    0.5F,    // alpha
    new Vec3(1, 0, 0), // color (RGB)
    2.0      // lifetime in seconds
);
ParticleStyleManager.applyStyleToParticle(pid, styleId);

6. Timeline & Easing (Kotlin-friendly, Java works too)

import com.qituo.dcrapi.animation.timeline.Timeline;
import com.qituo.dcrapi.animation.timeline.Eases;

Timeline tl = new Timeline();
tl.addPositionAnimation(startPos, endPos, 200, Eases.INSTANCE.getEaseInOutCubic());
tl.addScaleAnimation(1.0F, 2.0F, 200, Eases.INSTANCE.getEaseOutBounce());
tl.start();

7. Config File (config/dcrapi_config.properties)

maxParticleGroups=1000       # Upper bound on active particle groups
defaultVisibleRange=64.0     # Fallback visible range in blocks
particleTickRate=1            # Tick frequency
enableParticleEvents=true     # Enables ParticleEventBus dispatching
enableDebugLogging=false      # Verbose log output

Performance & Thread Safety

Performance Tips

  1. Tune visibleRange: keep it between 32 and 128 blocks; larger values blow up bandwidth and draw cost quickly.
  2. Frame-batched / progressive emission: for burst effects with >1000 particles, use a SmartParticleDispatcher-style queue pattern (see NeoForge Dragon Curse Chronicles reference implementation) instead of spawning everything in one tick.
  3. Clean up promptly: schedule periodic ServerParticleGroupManager.clear() to reap dead groups.
  4. Keep handlers light: never do I/O or heavy computation inside ParticleEventBus callbacks.

Thread-Safety Guarantees (in code)

  • ConcurrentHashMap<Integer, ControlableParticle> backing DcRenderApiParticleManager.PARTICLES.
  • AtomicInteger nextParticleId to avoid races during id allocation.
  • CopyOnWriteArrayList for ParticleEventBus handler lists; safe to iterate while registering.
  • Batch-remove pattern on tick: collect dead particle ids to a list, then removeAll at once β€” avoids the ConcurrentHashMap iterator weak-consistency gotcha.
  • Per-particle try/catch: one misbehaving particle or packet handler can never abort an entire tick.

In-Game Debug Tool

All three loaders register a Particle Tester creative item:

  • Right-click: Spawn a standard demo particle group (orbit + style + event hook).
  • Sneak + Right-click: Cycle debug mode: Basic β†’ Builder β†’ Event β†’ Basic …
  • Storage: the active test mode is now saved on the item stack itself (CustomData / NBT) instead of a JVM-static field β€” fixes cross-hand / cross-player state pollution.

Compatibility Matrix

Feature Forge 1.20.1 Fabric 1.20.1 NeoForge 1.21.1
MC Version βœ… βœ… βœ…
Java 17 17 21
Kotlin Adapter Kotlin-for-Forge fabric-language-kotlin Kotlin-for-Forge (NeoForge)
Particle Group Sync βœ… βœ… βœ…
Particle Tester Item βœ… βœ… βœ…
Auto sourcesJar Task βœ… βœ… βœ…

Build Dependency Snippets (build.gradle)

// Forge 1.20.1:
dependencies {
    implementation fg.deobf("com.qituo:dcrapi:0.2.0-1.20.1Forge")
}

// Fabric 1.20.1:
dependencies {
    modImplementation("com.qituo:dcrapi:0.2.0-1.20.1Fabric")
}

// NeoForge 1.21.1:
dependencies {
    implementation("com.qituo:dcrapi:1.0.0-1.21.1NeoForge")
}

Maven coordinates are the target format; if not yet uploaded to a Maven repo, drop the jars into a local libs/ folder and use files(...) as a dependency.


Known Consumer / Real-World Usage

Dragon Curse Chronicles is the first-party reference consumer of DC Render API:

  • Pig Talisman laser / Dragon Talisman fireball β†’ circular orbit + wave particle trails
  • Uncle's Dried Puffer Fish laser β†’ ~1200 particles with two counter-rotating gradient helices, dispatched progressively via SmartParticleDispatcher
  • Origin Aura / Talisman activation effects β†’ particle groups + timeline easing

Migration Guide (0.1.x β†’ 0.2.x)

Before (0.1.x):

ServerParticleGroup group = new ServerParticleGroup();
group.initServerGroup(pos, world);
group.scale = 1.5;
ServerParticleGroupManager.addParticleGroup(group, pos, world);

After (0.2.x, Builder):

ServerParticleGroup group = new ParticleGroupBuilder()
    .position(pos).world(world).scale(1.5).visibleRange(64.0).maxTick(100)
    .buildAndRegister();

Highlights of the 0.2.0 release:

  • mod_version=0.2.0, MIT license explicitly declared in gradle.properties + standalone LICENSE.md.
  • All three loader builds register a sourcesJar task; -sources.jar is produced on every build.
  • ParticleTesterItem: test-mode state moved from a static JVM field into item stack CustomData / NBT; eliminates cross-player state pollution.
  • DcRenderApiParticleManager: nextParticleId changed from plain int β†’ AtomicInteger; tick removal switched to batch-remove pattern for stronger consistency.

License & Authors

Released under the MIT License β€” see the official standalone license blob at LICENSE.md on GitHub.

How to Install DC Render API (Mod)

DC Render API by Yifei061004 is verified for Fabric, Forge, Neoforge across Minecraft versions 1.20.1, 1.21.1 (latest release: 1.0.0, file size: 393 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.20.1, 1.21.1) and platform (Fabric, Forge, Neoforge).
  2. Make sure you have the compatible loader or environment installed for Fabric, Forge, Neoforge.
  3. Move the downloaded DC Render API file into your Minecraft .minecraft/mods folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.21.1
Neoforge
3mo ago 1
1.20.1
Fabric
3mo ago 1
1.20.1
Forge
3mo ago 1
1.20.1
Fabric
3mo ago 1
1.20.1
Fabric
3mo ago 1
1.20.1
Forge
7mo ago 1
1.20.1
Forge
7mo ago 1
DC Render API Icon
Download DC Render API
Select game version
Select platform