ParticleData

Pure resolution of a configured particle into a Particle plus any extra data it needs — extracted from FileConfig so it can be unit-tested without a server.

Regression guard: the effect used to call spawnParticle with no data, which threw for any data-bearing particle (DUST, BLOCK, ITEM, …). This resolves and validates the data once, up front: data-less particles get null, DUST-style particles are built from a colour + size, and anything needing data this plugin doesn't model (or an unknown key) falls back to DEFAULT_PARTICLE with a warning instead of crashing at spawn time.

Types

Link copied to clipboard
data class Resolved(val particle: Particle, val data: Any?, val warning: String?)

The resolved particle, its spawn data (or null), and an optional warning to log.

Properties

Link copied to clipboard
val DEFAULT_PARTICLE: Particle
Link copied to clipboard

Functions

Link copied to clipboard
fun parseColor(hex: String?): Color

Parses a #RRGGBB (or RRGGBB) hex colour; falls back to white on any error.

Link copied to clipboard
fun resolve(key: String, colorHex: String?, dustSize: Double): ParticleData.Resolved