Removed AliArrows from the core

Moved to AliPresents
This commit is contained in:
alisolarflare 2016-10-22 17:46:53 -04:00
parent 3fcd3d3776
commit 24fe5320bc
4 changed files with 0 additions and 116 deletions

View file

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

View file

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

View file

@ -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(){
}
}

View file

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