From f215bca7a45ac8d024c3cdae763a23fca1f82ddb Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Thu, 12 Mar 2015 21:03:15 -0400 Subject: [PATCH] Update for Spigot 1.8.3 --- pom.xml | 19 ++- .../me/blackvein/quests/NpcEffectThread.java | 123 ++++++++++++++++++ 2 files changed, 135 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index d9accdca5..ffd34d2a9 100644 --- a/pom.xml +++ b/pom.xml @@ -31,28 +31,33 @@ org.bukkit - craftbukkit - 1.8-R0.1-SNAPSHOT - system - ${project.basedir}/lib/craftbukkit-1.8.jar + bukkit + 1.8.3-R0.1-SNAPSHOT + provided org.bukkit - craftbukkit1 + bukkit + 1.8-R0.1-SNAPSHOT + provided + + + org.bukkit + bukkit1710 1.7.10-R0.1 system ${project.basedir}/lib/craftbukkit-1.7.10-R0.1.jar org.bukkit - craftbukkit3 + bukkit179 1.7.9-R0.3 system ${project.basedir}/lib/craftbukkit-1.7.9-R0.3.jar org.bukkit - craftbukkit2 + bukkit172 1.7.2-R0.4 system ${project.basedir}/lib/craftbukkit-1.7.2-R0.4.jar diff --git a/src/main/java/me/blackvein/quests/NpcEffectThread.java b/src/main/java/me/blackvein/quests/NpcEffectThread.java index bafbcc872..851c4371d 100644 --- a/src/main/java/me/blackvein/quests/NpcEffectThread.java +++ b/src/main/java/me/blackvein/quests/NpcEffectThread.java @@ -7,6 +7,7 @@ import java.util.List; import me.blackvein.particles.Eff_1_7_R1; import me.blackvein.particles.Eff_1_7_R4; import me.blackvein.particles.Eff_1_8_R1; +import me.blackvein.particles.Eff_1_8_R2; import net.citizensnpcs.api.npc.NPC; import org.bukkit.Bukkit; @@ -65,6 +66,128 @@ public class NpcEffectThread implements Runnable { showEffect_R4(player, npc); } else if (Bukkit.getBukkitVersion().contains("1.8")) { showEffect_1_8_R1(player, npc); + } else if (Bukkit.getBukkitVersion().contains("1.8.3")) { + showEffect_1_8_R2(player, npc); + } + } + + private static void showEffect_1_8_R2(Player player, NPC npc) { + + //Get and set eye location, because npc.getBukkitEntity() is deprecated. + Location eyeLoc = npc.getEntity().getLocation(); + eyeLoc.setY(eyeLoc.getY() + 1.5); + + if (Quests.effect.equalsIgnoreCase("enchant")) { + + try { + Eff_1_8_R2.ENCHANTMENT_TABLE.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 10, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("crit")) { + + try { + Eff_1_8_R2.CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("spell")) { + + try { + Eff_1_8_R2.INSTANT_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("magiccrit")) { + + try { + Eff_1_8_R2.MAGIC_CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("mobspell")) { + + try { + Eff_1_8_R2.MOB_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("note")) { + + try { + Location old = eyeLoc; + Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ()); + Eff_1_8_R2.NOTE.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("portal")) { + + try { + Eff_1_8_R2.PORTAL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 5, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("dust")) { + + try { + Location newLoc = new Location(player.getWorld(), eyeLoc.getX(), eyeLoc.getY() + (float) 0.5, eyeLoc.getZ()); + Eff_1_8_R2.RED_DUST.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("witch")) { + + try { + Eff_1_8_R2.WITCH_MAGIC.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("snowball")) { + + try { + Location old = eyeLoc; + Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ()); + Eff_1_8_R2.SNOWBALL_POOF.sendToPlayer(player, newLoc, 0, 0, 0, 1, 3, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("splash")) { + + try { + Location old = eyeLoc; + Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ()); + Eff_1_8_R2.SPLASH.sendToPlayer(player, newLoc, 0, 0, 0, 1, 4, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else if (Quests.effect.equalsIgnoreCase("smoke")) { + + try { + Eff_1_8_R2.TOWN_AURA.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 20, null); + } catch (Exception e) { + e.printStackTrace(); + } + + } else { + + try { + Eff_1_8_R2.valueOf(Quests.effect).sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null); + } catch (Exception e) { + Quests.getInstance().getLogger().info(Quests.effect + " is not a valid effect name!"); + e.printStackTrace(); + } } }