Class CompatibilityParticleEnum

java.lang.Object
dev.cwhead.GravesX.compatibility.CompatibilityParticleEnum

public final class CompatibilityParticleEnum extends Object
Handles compatibility for Particle enums to prevent runtime errors across versions.
  • Constructor Details

    • CompatibilityParticleEnum

      public CompatibilityParticleEnum()
  • Method Details

    • valueOf

      public static org.bukkit.Particle valueOf(String particleName)
      Retrieves the Particle value associated with the given particle name.

      For modern versions, this calls Particle.valueOf(String) via reflection. If the particle is not present on the running server, the method logs the error and returns null.

      Parameters:
      particleName - The particle name (e.g., "FLAME", "angry_villager").
      Returns:
      The corresponding Particle value, or null if not found or an error occurs.