Package dev.cwhead.GravesX.compatibility
Class CompatibilityParticleEnum
java.lang.Object
dev.cwhead.GravesX.compatibility.CompatibilityParticleEnum
Handles compatibility for Particle enums to prevent runtime errors across versions.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CompatibilityParticleEnum
public CompatibilityParticleEnum()
-
-
Method Details
-
valueOf
Retrieves theParticlevalue 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 returnsnull.- Parameters:
particleName- The particle name (e.g., "FLAME", "angry_villager").- Returns:
- The corresponding
Particlevalue, ornullif not found or an error occurs.
-