From 24fe5320bc1414cc64ba5dfacc355f47eb8c2563 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 22 Oct 2016 17:46:53 -0400 Subject: [PATCH] Removed AliArrows from the core Moved to AliPresents --- .../java/buttondevteam/bucket/MainPlugin.java | 5 -- .../aliarrow/AliArrowListener.java | 46 ------------------- .../aliarrow/AliArrowSubPlugin.java | 25 ---------- .../alisolarflare/aliarrow/AliArrowTask.java | 40 ---------------- 4 files changed, 116 deletions(-) delete mode 100644 src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java delete mode 100644 src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowSubPlugin.java delete mode 100644 src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java diff --git a/src/main/java/buttondevteam/bucket/MainPlugin.java b/src/main/java/buttondevteam/bucket/MainPlugin.java index a200d6b..6d78583 100644 --- a/src/main/java/buttondevteam/bucket/MainPlugin.java +++ b/src/main/java/buttondevteam/bucket/MainPlugin.java @@ -2,11 +2,9 @@ package buttondevteam.bucket; import java.util.logging.Logger; -import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; -import buttondevteam.bucket.alisolarflare.aliarrow.AliArrowSubPlugin; import buttondevteam.bucket.core.CoreSubPlugin; public class MainPlugin extends JavaPlugin { @@ -14,7 +12,6 @@ public class MainPlugin extends JavaPlugin { private PluginDescriptionFile pdfFile; private Logger logger; - private AliArrowSubPlugin aliArrowSubPlugin; private CoreSubPlugin playerSubPlugin; public void onEnable() { @@ -32,8 +29,6 @@ public class MainPlugin extends JavaPlugin { } private void registerSubPlugins() { - aliArrowSubPlugin = new AliArrowSubPlugin(this); - aliArrowSubPlugin.register(); playerSubPlugin = new CoreSubPlugin(this); playerSubPlugin.register(); } diff --git a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java b/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java deleted file mode 100644 index 992ba18..0000000 --- a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowListener.java +++ /dev/null @@ -1,46 +0,0 @@ -package buttondevteam.bucket.alisolarflare.aliarrow; - -import org.bukkit.entity.Arrow; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Projectile; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileLaunchEvent; - -import buttondevteam.bucket.MainPlugin; - -public class AliArrowListener implements Listener { - private final MainPlugin plugin; - - public AliArrowListener(MainPlugin plugin){ - this.plugin = plugin; - } - - @SuppressWarnings("deprecation") - @EventHandler - public void onProjectileLaunch(ProjectileLaunchEvent event){ - try{ - if(!(event.getEntity().getType() == EntityType.ARROW)){ - return; - } - Projectile projectile = event.getEntity(); - Arrow arrow = (Arrow) projectile; - if (!(arrow.isCritical())){ - return; - } - if (projectile.getShooter().equals(plugin.getServer().getPlayer("alisolarflare"))){ - AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare"); - aliArrowTask.runTaskTimer(plugin, 2, 1); - return; - }else if (projectile.getShooter().equals(plugin.getServer().getPlayer("Zanthr"))){ - AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"zanthr"); - aliArrowTask.runTaskTimer(plugin, 2, 1); - return; - } - return; - - }catch(Exception e){ - return; - } - } -} \ No newline at end of file diff --git a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowSubPlugin.java b/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowSubPlugin.java deleted file mode 100644 index 0ea4e36..0000000 --- a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowSubPlugin.java +++ /dev/null @@ -1,25 +0,0 @@ -package buttondevteam.bucket.alisolarflare.aliarrow; - -import java.util.logging.Level; - -import buttondevteam.bucket.MainPlugin; - -public class AliArrowSubPlugin { - private MainPlugin plugin; - - public AliArrowSubPlugin(MainPlugin plugin){ - this.plugin = plugin; - } - public void register(){ - registerEvents(); - registerCommands(); - plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!"); - } - private void registerEvents(){ - plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin); - - } - private void registerCommands(){ - - } -} diff --git a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java b/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java deleted file mode 100644 index a5d430e..0000000 --- a/src/main/java/buttondevteam/bucket/alisolarflare/aliarrow/AliArrowTask.java +++ /dev/null @@ -1,40 +0,0 @@ -package buttondevteam.bucket.alisolarflare.aliarrow; - -import org.bukkit.Particle; -import org.bukkit.entity.Arrow; -import org.bukkit.scheduler.BukkitRunnable; - -import buttondevteam.bucket.MainPlugin; - -public class AliArrowTask extends BukkitRunnable{ - MainPlugin plugin; - String name; - Arrow arrow; - - - - public AliArrowTask(MainPlugin plugin, Arrow arrow, String name){ - this.name = name; - this.plugin = plugin; - this.arrow = arrow; - } - - @Override - public void run() { - if (arrow.isOnGround() || arrow.isDead()){ - this.cancel(); - } - if (name.equalsIgnoreCase("alisolarflare")){ - arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); - } - if (name.equalsIgnoreCase("Zanthr")){ - arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); - arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); - - } - - - - } - -}