Inform console of invalid npc-effect on 1.8 protocol, fixes #765

This commit is contained in:
PikaMug 2019-04-09 15:16:05 -04:00
parent 7cae9d8560
commit 36b4220839
2 changed files with 5 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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
}