Commits

Jenkins Builder  committed be5e81c

Added final godPowers 3.0 code

  • Participants
  • Parent commits 131c366

Comments (0)

Files changed (31)

File .DS_Store

Binary file modified.

File godPowers/bin/3.1changelog

+- Added /poseidon

File godPowers/bin/com/FriedTaco/taco/godPowers/DupeCommand.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/GodPowersCommand.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/MedusaCommand.class

Binary file added.

File godPowers/bin/com/FriedTaco/taco/godPowers/MedusaPlayer.class

Binary file added.

File godPowers/bin/com/FriedTaco/taco/godPowers/OnOneSecond.class

Binary file added.

File godPowers/bin/com/FriedTaco/taco/godPowers/Updater$UpdateResult.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/Updater$UpdateRunnable.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/Updater$UpdateType.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/Updater.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/godModeCommand$1.class

Binary file added.

File godPowers/bin/com/FriedTaco/taco/godPowers/godModeCommand.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/godPowers$1.class

Binary file added.

File godPowers/bin/com/FriedTaco/taco/godPowers/godPowers.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/godPowersPlayerListener$1$1.class

Binary file added.

File godPowers/bin/com/FriedTaco/taco/godPowers/godPowersPlayerListener$1.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/godPowersPlayerListener.class

Binary file modified.

File godPowers/bin/com/FriedTaco/taco/godPowers/poseidonCommand.class

Binary file added.

File godPowers/plugin.yml

     bless:
         description: Enchants all items in inv.
         usage: /bless
+    bless:
+        description: Enchants all items in inv.
+        usage: /bless
     fusrodah:
         description: Puts knockback lvl 10 on held item.
         usage: /fusrodah
     dupe:
         description: Duplicates the item in your hand
         usage: /dupe <amount>
+    medusa:
+        description: Curses you with he ability to turn people to stone
+        usage: /medusa
+    poseidon:
+        description: Gives you poseidon like powers while in water
+        usage: /poseidon
 permissions:
     godpowers.*:
         description: Gives access to all godpowers commands.
             godpowers.godtools: true
             godpowers.bless: true
             godpowers.fusrodah: true
+            godpowers.medusa: true
+            godpowers.dupe: true
+            godpowers.medusa: true
+            godpowers.poseidon: true
     godpowers.godmodeonlogin:
         description: Allows godmode upon login.
         default: op
     godpowers.dupe:
         description: Gives permission to relevant command.
         default: op
+    godpowers.medusa:
+        description: Gives permission to relevant command.
+        default: op
+    godpowers.poseidon:
+        description: Gives permission to relevant command.
+        default: op
     
        

File godPowers/src/3.1changelog

+- Added /poseidon

File godPowers/src/com/FriedTaco/taco/godPowers/DupeCommand.java

 public class DupeCommand implements CommandExecutor
 {
 	private Player player;
-	private final godPowers plugin;
     public DupeCommand(godPowers instance) 
     {
-        plugin = instance;
     }
     @Override
     public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
     		if(player.hasPermission("godpowers.dupe"))
     		{
     			if(split.length == 0){
-    				player.sendMessage(ChatColor.BLUE + "The gods have decided to multiply your items.");	
     				int amount = 64;
+    				if(player.getItemInHand().getTypeId() != 0){
+    					player.sendMessage(ChatColor.BLUE + "The gods have decided to multiply your items.");    	
+    				Inventory inv = player.getInventory();
+    				ItemStack item = player.getItemInHand();
+    				ItemStack newitem = new ItemStack(item.getType(),amount,(short)item.getDurability());
+    				newitem.setData(item.getData());
+    				newitem.setItemMeta(item.getItemMeta());
+    				newitem.addEnchantments(item.getEnchantments());
+    				newitem.setType(item.getType());
+    				newitem.setTypeId(item.getTypeId());  		
+    				inv.addItem(newitem);
+    				}else{
+    					player.sendMessage(ChatColor.DARK_RED + "The gods cannot multiply nothing.");	
+    				}
     			}else if(split.length == 1){
     				if(player.getItemInHand().getTypeId() != 0){
     					player.sendMessage(ChatColor.BLUE + "The gods have decided to multiply your items.");    	

File godPowers/src/com/FriedTaco/taco/godPowers/GodPowersCommand.java

 				player.sendMessage(ChatColor.DARK_AQUA+"About the "+ChatColor.DARK_GREEN+"godPowers"+ChatColor.DARK_AQUA+" Project:");		
 				player.sendMessage(ChatColor.GOLD+"godPowers is an "+ChatColor.RED+"Open Source"+ChatColor.GOLD+" plugin created in December 2011");	
 				player.sendMessage(ChatColor.GOLD+"by "+ChatColor.BLUE+"FriedTaco"+ChatColor.GOLD+". It is currently developed by "+ChatColor.BLUE+"Swift"+ChatColor.GOLD+".");
-				player.sendMessage(ChatColor.GOLD+"The goal is to provide a set of commands to give users powers based on greek mythology.");	
+				player.sendMessage(ChatColor.GOLD+"The goal is to provide a set of commands to give users powers based on greek and roman mythology.");	
 				player.sendMessage(ChatColor.DARK_AQUA+"Tips:");	
 				player.sendMessage(ChatColor.GOLD+"- "+ChatColor.GREEN+"Use "+ChatColor.RED+"/godpowers commands"+ChatColor.GREEN+" to see all commands");
 				player.sendMessage(ChatColor.GOLD+"- "+ChatColor.GREEN+"Use "+ChatColor.RED+"/godpowers update"+ChatColor.GREEN+" to manually install updates");
 						player.sendMessage(ChatColor.GREEN+"godPowers: "+ChatColor.GOLD+"There is currently no updates available.");		
 					}else if(updater.getResult().equals(Updater.UpdateResult.UPDATE_AVAILABLE)){
 						player.sendMessage(ChatColor.GREEN+"godPowers: "+ChatColor.GOLD+"There is currently an update available, downloading now...");	
+						@SuppressWarnings("unused")
 						Updater updater2 = new Updater(plugin, "godpowers", plugin.file, Updater.UpdateType.DEFAULT, true);	
 					}
 				}
+				if(args[0].equalsIgnoreCase("credits")){
+					player.sendMessage(ChatColor.DARK_AQUA+"Credits:");	
+					player.sendMessage(ChatColor.GOLD+"- "+ChatColor.GREEN+"UnceCrafter"+ChatColor.BLUE+" (/poseidon)");	
+				}
 				}
 				else
 				{

File godPowers/src/com/FriedTaco/taco/godPowers/MedusaCommand.java

+package com.FriedTaco.taco.godPowers;
+
+import java.util.ListIterator;
+
+import org.bukkit.ChatColor;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public class MedusaCommand implements CommandExecutor
+{
+	private Player player;
+	private final godPowers plugin;
+    public MedusaCommand(godPowers instance) 
+    {
+        plugin = instance;
+    }
+
+    public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
+    {
+    	String[] split = args;
+    	if(sender instanceof Player)
+    	{
+    		player = (Player) sender;
+    		if(player.hasPermission("godpowers.medusa"))
+    		{
+    			if(split.length > 0)
+    			{
+    				player.sendMessage(ChatColor.RED + "Incorrect syntax. Correct usage: '/medusa'");
+    				return true;
+    			}
+    			else
+    			{
+    				if(plugin.isMedusa.contains(player.getName()) == false){
+        				player.sendMessage(ChatColor.GREEN+"The gods have cursed you with the power to turn people to stone.");
+        				plugin.isMedusa.add(player.getName());
+    				}else{
+    					player.sendMessage(ChatColor.GREEN+"The gods have lifted the curse upon you.");
+        				plugin.isMedusa.remove(player.getName());
+        				ListIterator<MedusaPlayer> it = plugin.isUnderMedusaInfluence.listIterator();
+        				if(it.hasNext()){
+        				MedusaPlayer mplayer = it.next();
+        				if(mplayer.getMedusa().equals(player)){
+        				Player player = mplayer.getPlayer();
+        				player.sendMessage(ChatColor.AQUA+"Medusa has suddenly disappeared, you can move again.");
+        				plugin.isUnderMedusaInfluence.remove(mplayer);
+        				}       			
+        				}
+    				}
+    				return true;
+    			}
+    		}
+    		else
+    		{
+    			player.sendMessage(ChatColor.DARK_RED + "The gods prevent you from using this command.");
+    		}
+    	}
+		return false;
+    }
+}

File godPowers/src/com/FriedTaco/taco/godPowers/MedusaPlayer.java

+package com.FriedTaco.taco.godPowers;
+
+import org.bukkit.entity.Player;
+
+public class MedusaPlayer {
+private Player player;
+private int timeLeft;
+private Player medusa;
+
+public MedusaPlayer(Player player, int timeLeft, Player medusa){
+this.player = player;
+this.timeLeft = timeLeft;
+this.medusa = medusa;
+}
+public void setTimeLeft(int timeLeft){
+this.timeLeft = timeLeft;
+}
+public Player getPlayer(){
+return this.player;	
+}
+public int getTimeLeft(){
+return this.timeLeft;	
+}
+public Player getMedusa(){
+return this.medusa;	
+}
+}

File godPowers/src/com/FriedTaco/taco/godPowers/OnOneSecond.java

+package com.FriedTaco.taco.godPowers;
+
+import java.util.ListIterator;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+import org.bukkit.scheduler.BukkitRunnable;
+
+public class OnOneSecond extends BukkitRunnable {
+	//Extends BukkitRunnable to create a run method
+	 
+	private final godPowers plugin;
+	//Declares your plugin variable
+	 
+	public OnOneSecond(godPowers plugin) {
+	this.plugin = plugin;
+	}
+	//This is called from your main class and sets your plugin variable
+	 
+	public void run() {
+	ListIterator<MedusaPlayer> it = plugin.isUnderMedusaInfluence.listIterator();
+	if(it.hasNext()){
+	MedusaPlayer mplayer = it.next();
+	if(mplayer.getTimeLeft() == 1){
+	Player player = mplayer.getPlayer();
+	player.sendMessage(ChatColor.GREEN+"You feel your skin beginning to crack and suddenly you can move again.");
+	plugin.isUnderMedusaInfluence.remove(mplayer);	
+	}else{
+	mplayer.setTimeLeft(mplayer.getTimeLeft()-1);	
+	}
+	}
+	}	
+	}

File godPowers/src/com/FriedTaco/taco/godPowers/Updater.java

 package com.FriedTaco.taco.godPowers;
 
 import java.io.*;
-import java.lang.IllegalThreadStateException;
 import java.lang.Runnable;
 import java.lang.Thread;
 import java.net.MalformedURLException;

File godPowers/src/com/FriedTaco/taco/godPowers/godModeCommand.java

 package com.FriedTaco.taco.godPowers;
 
 //import org.bukkit.World;
+import java.io.IOException;
+
 import org.bukkit.ChatColor;
 import org.bukkit.command.Command;
 import org.bukkit.command.CommandExecutor;
     		{
 	    		if(split.length == 0)
 	    		{
+	    			try{
+		    	    Metrics metrics = new Metrics(plugin);
+			    	 // Plot the total amount of protections
+			    	    metrics.addCustomData(new Metrics.Plotter("Total Players using Godmode") {
+
+			    	        @Override
+			    	        public int getValue() {
+			    	            return plugin.godmodeEnabled.size();
+			    	        }
+
+			    	    });
+			    	    metrics.start();
+			    	    System.out.println("[GodPowers] Successfully sent stats to MCStats/Metrics ");
+			    	} catch (IOException e) {
+			    		System.out.println("[GodPowers] Failed to send stats to MCStats/Metrics :-(");
+			    	    // Failed to submit the stats :-(
+			    	}
 	    			if(plugin.godmodeEnabled.contains(player.getName()))
 	    			{
 	    				if(command.getName().equalsIgnoreCase("godmodeon"))

File godPowers/src/com/FriedTaco/taco/godPowers/godPowers.java

 
 
 
-	import java.io.BufferedReader;
+import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import org.bukkit.ChatColor;
 import org.bukkit.Location;
 import org.bukkit.World;
-import org.bukkit.configuration.file.FileConfiguration;
 import org.bukkit.enchantments.Enchantment;
 import org.bukkit.entity.Arrow;
 import org.bukkit.entity.Entity;
 import org.bukkit.plugin.PluginDescriptionFile;
 import org.bukkit.plugin.java.JavaPlugin;
 import org.bukkit.plugin.PluginManager;
+import org.bukkit.scheduler.BukkitTask;
 import org.bukkit.util.Vector;
 
 
 	    public HashMap<String,Integer> curse = new HashMap<String,Integer>();
 		public ArrayList<String> godmodeEnabled = new ArrayList<String>();
 		public ArrayList<String> isJesus = new ArrayList<String>();
+		public ArrayList<MedusaPlayer> isUnderMedusaInfluence = new ArrayList<MedusaPlayer>();
 		public ArrayList<String> isInferno = new ArrayList<String>();
+		public ArrayList<String> isPoseidon = new ArrayList<String>();
+		public ArrayList<String> isMedusa = new ArrayList<String>();
 		public ArrayList<String> superJumper = new ArrayList<String>();
 		public ArrayList<String> arrowKill = new ArrayList<String>();
 		public ArrayList<String> burn = new ArrayList<String>();
 		public boolean godTools = true;
 		public boolean autoUpdate = true;
 		public boolean checkUpdate = true;
+		public int medusaFreezeTime = 10;
 		public File file;
 		 public void loadConfig(){
 			 try{
 	            	this.getConfig().set("AutoUpdateEnabled", false);
 	            if(!this.getConfig().contains("CheckUpdateEnabled"))
 	            	this.getConfig().set("CheckUpdateEnabled", true);
+	            if(!this.getConfig().contains("MedusaFreezeTime"))
+	            	this.getConfig().set("MedusaFreezeTime", 10);
 	            checkUpdate = this.getConfig().getBoolean("CheckUpdateEnabled",true);
 	            autoUpdate = this.getConfig().getBoolean("AutoUpdateEnabled",false);
 	            title = this.getConfig().getString("GodModeTitle", "");
 	            godModeOnLogin = this.getConfig().getBoolean("GodModeOnLogin", true);
 	            DemiModifier= this.getConfig().getDouble("DemiGodDamageModifier", 0.2);
-	            godTools = this.getConfig().getBoolean("GodToolsEnabled",true);	            
+	            godTools = this.getConfig().getBoolean("GodToolsEnabled",true);	    
+	            medusaFreezeTime = this.getConfig().getInt("MedusaFreezeTime",10); 
 	            this.saveConfig();
 			 } catch(Exception e){
 				 
 	    @Override
 	    public void onEnable() {
 	    	file = this.getFile();
+	    	@SuppressWarnings("unused")
+			BukkitTask TaskName = new OnOneSecond(this).runTaskTimer(this, 25, 25);
 	    	try {
 	    	    Metrics metrics = new Metrics(this);
+	    	 // Plot the total amount of protections
+	    	    metrics.addCustomData(new Metrics.Plotter("Total Players using Godmode") {
+
+	    	        @Override
+	    	        public int getValue() {
+	    	            return godmodeEnabled.size();
+	    	        }
+
+	    	    });
 	    	    metrics.start();
 	    	    System.out.println("[GodPowers] Successfully sent stats to MCStats/Metrics ");
 	    	} catch (IOException e) {
 	    	    // Failed to submit the stats :-(
 	    	}
 	    	if(autoUpdate == true){
-	    		Updater updater = new Updater(this, "godpowers", this.getFile(), Updater.UpdateType.DEFAULT, false);	
+	    		@SuppressWarnings("unused")
+				Updater updater = new Updater(this, "godpowers", this.getFile(), Updater.UpdateType.DEFAULT, false);	
 	    	}
 	    	if(checkUpdate == true){
 	    		String str2 = null;
 	    	} catch(Exception e) {
 	    		System.out.println(error + "dupe.");
 	    	}
+	        try{
+    		getCommand("medusa").setExecutor(new MedusaCommand(this));
+    		System.out.println(message + "medusa.");
+    		list.put("medusa", "- Become cursed by the gods, and turn anyone you look at to stone.");
+    	    } catch(Exception e) {
+    		    System.out.println(error + "medusa.");
+    	    }
+	        try{
+	    	getCommand("poseidon").setExecutor(new poseidonCommand(this));
+	    	System.out.println(message + "poseidon.");
+	    	list.put("poseidon", "- Gives you Poseidon like powers while in water.");
+	    	} catch(Exception e) {
+	    		System.out.println(error + "poseidon.");
+	    	}
 	    	loadConfig();
 	        PluginManager pm = getServer().getPluginManager();
 	        pm.registerEvents(new godPowersEntityListener(this), this);

File godPowers/src/com/FriedTaco/taco/godPowers/godPowersPlayerListener.java

 package com.FriedTaco.taco.godPowers;
 
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.ListIterator;
 
 import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
 import org.bukkit.Effect;
 import org.bukkit.Location;
+import org.bukkit.Material;
 import org.bukkit.World;
 import org.bukkit.block.Block;
 import org.bukkit.entity.Entity;
 import org.bukkit.event.Listener;
 import org.bukkit.event.block.Action;
 import org.bukkit.event.block.BlockBreakEvent;
-import org.bukkit.event.entity.EntityDamageEvent;
-import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
 import org.bukkit.event.player.PlayerAnimationEvent;
 import org.bukkit.event.player.PlayerAnimationType;
 import org.bukkit.event.player.PlayerInteractEvent;
 import org.bukkit.event.player.PlayerMoveEvent;
 import org.bukkit.event.player.PlayerQuitEvent;
 import org.bukkit.inventory.ItemStack;
-import org.bukkit.metadata.MetadataValue;
+import org.bukkit.potion.PotionEffect;
+import org.bukkit.potion.PotionEffectType;
+import org.bukkit.util.BlockIterator;
 import org.bukkit.util.Vector;
 
 import com.FriedTaco.taco.godPowers.Jesus.Raft;
     public void onPlayerJoin(PlayerJoinEvent event) 
     {
     	final Player player = event.getPlayer();
+    	if(player.getDisplayName().equalsIgnoreCase("goldgamermc")){
+    	plugin.getServer().broadcastMessage(ChatColor.DARK_GREEN+"[godPowers] "+ChatColor.GOLD+"The developer of godPowers has joined the game.");	
+    	}
     	if(plugin.godModeOnLogin && player.hasPermission("godpowers.godmodeonlogin"))
     	{
     		plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
                 public void run() {
+        	    	try {
+        	    	    Metrics metrics = new Metrics(plugin);
+        	    	 // Plot the total amount of protections
+        	    	    metrics.addCustomData(new Metrics.Plotter("Total Players using Godmode") {
+
+        	    	        @Override
+        	    	        public int getValue() {
+        	    	            return plugin.godmodeEnabled.size();
+        	    	        }
+
+        	    	    });
+        	    	    metrics.start();
+        	    	    System.out.println("[GodPowers] Successfully sent stats to MCStats/Metrics ");
+        	    	} catch (IOException e) {
+        	    		System.out.println("[GodPowers] Failed to send stats to MCStats/Metrics :-(");
+        	    	    // Failed to submit the stats :-(
+        	    	}
                 	player.sendMessage("As you enter the world, you feel your godly powers returning.");
                 	player.setDisplayName(plugin.title + player.getDisplayName());
                 	plugin.godmodeEnabled.add(player.getName());
         	jesus.destroyJesusRaft(event.getPlayer());
         }
     }
-    @EventHandler()
-    public void onPlayerDamage(final EntityDamageEvent event) {
-    Entity e = event.getEntity();
-    if(e instanceof Player){
-    Player player = (Player)e;
-    if(event.getCause().equals(DamageCause.DROWNING)){
-    	if(plugin.godmodeEnabled.contains(player.getName()) && player.getRemainingAir() > 10)
-    	{
-    		player.setRemainingAir(9001);
-    	}	
-    }
-    }
-    }
     @EventHandler
     public void onPlayerMove(PlayerMoveEvent event) 
     {
     		event.getTo().getBlock().getRelative(0,-1,0).setTypeId(89);
     	}
     	*/
+    	if(plugin.isPoseidon.contains(event.getPlayer().getName())){
+    	    Material m = event.getPlayer().getLocation().getBlock().getType();
+    	    if (m == Material.STATIONARY_WATER || m == Material.WATER) {
+    	    event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,120,2));
+    	    event.getPlayer().setRemainingAir(300);
+    	    }	
+    	}
+    	if(plugin.godmodeEnabled.contains(event.getPlayer().getName())){
+    	    Material m = event.getPlayer().getLocation().getBlock().getType();
+    	    if (m == Material.STATIONARY_WATER || m == Material.WATER) {
+    	    event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,120,2));
+    	    event.getPlayer().setRemainingAir(300);
+    	    }	
+    	}
+    	if(plugin.isMedusa.contains(event.getPlayer().getName()))
+		{
+    	if(getTarget(event.getPlayer()) != null){
+        Player target = getTarget(event.getPlayer());
+    	Player player = event.getPlayer();
+    	boolean isAlreadyUnder = false;
+    	for(MedusaPlayer mplayer : plugin.isUnderMedusaInfluence){
+    	if(mplayer.getMedusa().equals(player) && mplayer.getPlayer().equals(target)){
+    	isAlreadyUnder = true;	
+    	}
+    	}
+    	if(isAlreadyUnder == false){
+        	plugin.isUnderMedusaInfluence.add(new MedusaPlayer(target,plugin.medusaFreezeTime,player));
+        	target.sendMessage(ChatColor.GREEN+"Medusa has looked at you, you feel your skin turning to stone. You cannot move for "+plugin.medusaFreezeTime+" seconds.");
+    	}  
+    	}
+		}
+    	ListIterator<MedusaPlayer> it = plugin.isUnderMedusaInfluence.listIterator();
+		if(it.hasNext()){
+		MedusaPlayer mplayer = it.next();
+		if(mplayer.getPlayer().equals(event.getPlayer())){
+		Player p = event.getPlayer();		
+        Location from = event.getFrom();
+        double xfrom = event.getFrom().getX();
+        double yfrom = event.getFrom().getY();
+        double zfrom = event.getFrom().getZ();
+        double xto = event.getTo().getX();
+        double yto = event.getTo().getY();
+        double zto = event.getTo().getZ();
+        if (!(xfrom == xto && yfrom == yto && zfrom == zto)) {
+            p.teleport(from);
+    		event.getPlayer().sendMessage(ChatColor.RED+"You cannot move while you are under Medusa's spell.");
+        }
+		}
+		}
     	if(plugin.godmodeEnabled.contains(event.getPlayer().getName()) && event.getPlayer().getFireTicks() > 1)
     	{
     		event.getPlayer().setFireTicks(0);
 				p.getWorld().playEffect(b.getLocation(), Effect.SMOKE, x);
 		}
     }
-    public Object getMetadata(Player player, String key) {
-  	  List<MetadataValue> values = player.getMetadata(key);  
-      for (MetadataValue value : values) {
-        if (value.getOwningPlugin().getDescription().getName().equals(plugin.getDescription().getName())) {
-          return value.value();
+    public Player getTarget(Player player) {
+        List<Entity> nearbyE = player.getNearbyEntities(10, 10, 10);
+        ArrayList<Player> nearPlayers = new ArrayList<Player>();
+        for (Entity e : nearbyE) {
+            if (e instanceof Player) {
+                nearPlayers.add((Player) e);
+            }
+        }
+        Player target = null;
+        BlockIterator bItr = new BlockIterator(player, 10);
+        Block block;
+        Location loc;
+        int bx, by, bz;
+        double ex, ey, ez;
+        while (bItr.hasNext()) {
+ 
+            block = bItr.next();
+            bx = block.getX();
+            by = block.getY();
+            bz = block.getZ();
+            for (Player e : nearPlayers) {
+                loc = e.getLocation();
+                ex = loc.getX();
+                ey = loc.getY();
+                ez = loc.getZ();
+                if ((bx - .75 <= ex && ex <= bx + 1.75) && (bz - .75 <= ez && ez <= bz + 1.75) && (by - 1 <= ey && ey <= by + 2.5)) {
+                    target = e;
+                    break;
+ 
+                }
+            }
+ 
         }
-      }
-      return Boolean.valueOf(false);
+        return target;
+ 
     }
    }

File godPowers/src/com/FriedTaco/taco/godPowers/poseidonCommand.java

+package com.FriedTaco.taco.godPowers;
+
+import org.bukkit.ChatColor;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public class poseidonCommand implements CommandExecutor
+{
+	private Player player;
+	private final godPowers plugin;
+    public poseidonCommand(godPowers instance) 
+    {
+        plugin = instance;
+    }
+    @Override
+    public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
+    {
+    	String[] split = args;
+    	if(sender instanceof Player)
+    	{
+    		player = (Player) sender;
+    		if(player.hasPermission("godpowers.poseidon"))
+    		{
+	    		if(split.length == 0)
+	    		{	    	
+	    			if(plugin.isPoseidon.contains(player.getName()))
+	    			{
+	    				plugin.godmodeEnabled.remove(player.getName());
+	    				player.sendMessage(ChatColor.BLUE + "You feel your Poseidon like powers flowing away like water.");
+	    				return true;
+	    			}
+	    			else
+	    			{
+	    				player.sendMessage(ChatColor.BLUE + "You suddenly feel a watery rush overcome you.");
+	    				plugin.isPoseidon.add(player.getName());
+	    				return true;
+	        		}
+	    		}
+	    		else
+	    		{
+						player.sendMessage(ChatColor.RED + "Please use '/poseidon' to activate your powers.");				
+					return true;
+	    		}
+    		}
+    		else
+    		{
+    			player.sendMessage(ChatColor.DARK_RED + "The gods prevent you from using this command.");
+    			return true;
+    		}
+    	}        
+        return false;
+    }
+}