Skip to content

First Parse

Use DaisySeries when config-like input needs to become real Bukkit values without a pile of plugin-local helpers.

This is the exact kind of plugin data DaisySeries is meant for:

  • config strings
  • admin-editable YAML
  • loadout/setup files
  • text values that later become real Bukkit or Paper types
val icon = DaisyMaterials.parse("diamond sword")
val sound = DaisySounds.parse("entity player levelup")
val flags = DaisyItemFlags.parseMany(listOf("hide enchants", "hide attributes"))
val enchantment = DaisyEnchantments.parse("sharpness")
val effect = DaisyPotions.parse("slow falling")
val biome = DaisyBiomes.parse("cherry grove")
val profession = DaisyVillagerProfessions.parse("tool smith")
val attribute = DaisyAttributes.parse("attack damage")
val entity = DaisyEntities.parse("zombie villager")
val gameMode = DaisyGameModes.parse("surv")
val difficulty = DaisyDifficulties.parse("hard")
val facing = DaisyBlockFaces.parse("north-east")
val damageCause = DaisyDamageCauses.parse("entity attack")
val operation = DaisyOperations.parse("multiply scalar 1")
val pattern = DaisyPatternTypes.parse("straight cross")
val particle = DaisyParticles.parse("totem")
val statistic = DaisyStatistics.parse("player kills")
logger.info("Icon: ${DaisyMaterials.displayName(icon)} (${DaisyMaterials.key(icon)})")
logger.info("Sound: ${DaisySounds.displayName(sound)}")
logger.info("Flags: ${flags.joinToString { DaisyItemFlags.displayName(it) }}")
logger.info("Enchant: ${DaisyEnchantments.displayName(enchantment)}")
logger.info("Effect: ${DaisyPotions.displayName(effect)}")
logger.info("Profession: ${DaisyVillagerProfessions.displayName(profession)}")
logger.info("Attribute: ${DaisyAttributes.displayName(attribute)}")
logger.info("Damage cause: ${DaisyDamageCauses.displayName(damageCause)}")
logger.info("Operation: ${DaisyOperations.displayName(operation)}")
logger.info("Pattern: ${DaisyPatternTypes.displayName(pattern)}")
  • strict parse(...)
  • nullable parseOrNull(...)
  • canonical key(...)
  • UI-friendly displayName(...)
  • curated aliases(...)

The goal is not just parsing. The goal is replacing all the repetitive plugin-local helpers like:

  • Material.valueOf(...) wrappers
  • lowercase normalization
  • kebab-case handling
  • ad hoc alias maps
  • hand-written display-name formatting
  • scattered serialization key logic