diff --git a/main/src/main/java/me/blackvein/quests/particle/PreBuiltParticle.java b/main/src/main/java/me/blackvein/quests/particle/PreBuiltParticle.java index 3460d50e0..e755c636d 100644 --- a/main/src/main/java/me/blackvein/quests/particle/PreBuiltParticle.java +++ b/main/src/main/java/me/blackvein/quests/particle/PreBuiltParticle.java @@ -12,10 +12,6 @@ package me.blackvein.quests.particle; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; - import org.bukkit.util.Vector; public enum PreBuiltParticle { @@ -33,12 +29,6 @@ public enum PreBuiltParticle { SPLASH("splash", 0, 0, 0, 1, 4, new Vector(0, .5, 0)), SMOKE("smoke", 0, 1, 0, 1, 20); - private static Map FROM_IDENTIFIER = new HashMap<>(); - - static { - Stream.of(values()).forEach(p -> FROM_IDENTIFIER.put(p.identifier, p)); - } - private String identifier; private float offsetX, offsetY, offsetZ, speed; private int count; @@ -99,6 +89,6 @@ public enum PreBuiltParticle { * @return the PreBuiltParticle represented by the specified identifier */ public static PreBuiltParticle fromIdentifier(String identifier) { - return FROM_IDENTIFIER.get(identifier); + return valueOf(identifier); } } diff --git a/main/src/main/java/me/blackvein/quests/tasks/NpcEffectThread.java b/main/src/main/java/me/blackvein/quests/tasks/NpcEffectThread.java index 1d6438fc7..c8b3a9507 100644 --- a/main/src/main/java/me/blackvein/quests/tasks/NpcEffectThread.java +++ b/main/src/main/java/me/blackvein/quests/tasks/NpcEffectThread.java @@ -67,7 +67,11 @@ public class NpcEffectThread implements Runnable { if (plugin.getDependencies().getCitizens() != null) { Location eyeLoc = npc.getEntity().getLocation(); eyeLoc.setY(eyeLoc.getY() + 2); - ParticleProvider.sendToPlayer(player, eyeLoc, effectType.toUpperCase()); + try { + ParticleProvider.sendToPlayer(player, eyeLoc, effectType.toUpperCase()); + } catch (NoClassDefFoundError e) { + // Unsupported Minecraft version + } } } }