From 36b4220839e557ca68f65403bcfaa5b2975540dd Mon Sep 17 00:00:00 2001 From: PikaMug Date: Tue, 9 Apr 2019 15:16:05 -0400 Subject: [PATCH] Inform console of invalid npc-effect on 1.8 protocol, fixes #765 --- main/src/main/java/me/blackvein/quests/NpcEffectThread.java | 3 +-- .../java/me/blackvein/quests/particle/ParticleProvider.java | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/NpcEffectThread.java b/main/src/main/java/me/blackvein/quests/NpcEffectThread.java index 18b322de3..06e81c20e 100644 --- a/main/src/main/java/me/blackvein/quests/NpcEffectThread.java +++ b/main/src/main/java/me/blackvein/quests/NpcEffectThread.java @@ -19,7 +19,7 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import me.blackvein.quests.particle.ParticleProvider; - +import me.blackvein.quests.particle.PreBuiltParticle; import net.citizensnpcs.api.npc.NPC; public class NpcEffectThread implements Runnable { @@ -63,5 +63,4 @@ public class NpcEffectThread implements Runnable { eyeLoc.setY(eyeLoc.getY() + 1.5); ParticleProvider.sendToPlayer(player, eyeLoc, effectType); } - } \ No newline at end of file diff --git a/main/src/main/java/me/blackvein/quests/particle/ParticleProvider.java b/main/src/main/java/me/blackvein/quests/particle/ParticleProvider.java index f58d633e7..f5a6259c3 100644 --- a/main/src/main/java/me/blackvein/quests/particle/ParticleProvider.java +++ b/main/src/main/java/me/blackvein/quests/particle/ParticleProvider.java @@ -18,6 +18,8 @@ import org.bukkit.Location; import org.bukkit.Particle; import org.bukkit.entity.Player; +import net.md_5.bungee.api.plugin.Plugin; + public abstract class ParticleProvider { private static ParticleProvider loaded; @@ -100,6 +102,8 @@ public abstract class ParticleProvider { } else { try { loaded.spawnParticle(player, location, Particle.valueOf(particleId), 0, 0, 0, 1, 3, null); + } catch (NoClassDefFoundError e1) { + Bukkit.getLogger().severe("[Quests] This protocol does not support npc-effect: " + particleId); } catch (IllegalArgumentException exception) { // Fail silently }