package me.willis62501.ShovelsPlus;  import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.entity.Snowball; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin;  public class Main extends JavaPlugin implements Listener{ 	 	  public void onEnable() { 		  System.out.println("Willis Shovels Plus Plugin!"); 	        Bukkit.getServer().getPluginManager().registerEvents(this, this); 	} 	  	    @EventHandler 	    public void onPlayerInteract(PlayerInteractEvent e) { 	        if (!(e.getAction() == Action.RIGHT_CLICK_AIR)); 	        	        if (e.getItem().getType() == Material.IRON_SPADE){ 	        	e.getPlayer().launchProjectile(Snowball.class); 	                //do shooting stuff; 	        } 	       	} 	  	    @EventHandler 	    public void onEntityDamage(EntityDamageByEntityEvent e) { 	        if (e.getDamager() instanceof Snowball) { 	                Snowball s = (Snowball) e.getDamager(); 	                if (s.getShooter() instanceof Player) { 	                        Player shooter = (Player) s.getShooter(); 	                        if (shooter.getItemInHand().getType() == Material.IRON_SPADE) { 	                                shooter.getItemInHand().setDurability((short) (shooter.getItemInHand().getDurability() - Short.valueOf((short) -2))); 	                                e.setDamage(7.5); 	                        } 	                    } 	                } 	            } 	                @EventHandler 	                public void onPlayerInteract1(PlayerInteractEvent e) { 	                    if (!(e.getAction() == Action.RIGHT_CLICK_AIR)); 	                    	                    if (e.getItem().getType() == Material.GOLD_SPADE) { 	                    	e.getPlayer().launchProjectile(Snowball.class); 	                        //do shooting stuff; 	                    } 	 	                } 	  	                @EventHandler 	                public void onEntityDamage1(EntityDamageByEntityEvent e) { 	                    if (e.getDamager() instanceof Snowball) { 	                            Snowball s = (Snowball) e.getDamager(); 	                            if (s.getShooter() instanceof Player) { 	                                    Player shooter = (Player) s.getShooter(); 	                                    if (shooter.getItemInHand().getType() == Material.GOLD_SPADE) { 	                                        shooter.getItemInHand().setDurability((short) (shooter.getItemInHand().getDurability() - Short.valueOf((short) -1))); 	                                            e.setDamage(8.0); 	                            } 	                        } 	                    } 	                } 	                            @EventHandler 	                            public void onPlayerInteract2(PlayerInteractEvent e) { 	                                if (!(e.getAction() == Action.RIGHT_CLICK_AIR)); 	                                	                                if (e.getItem().getType() == Material.DIAMOND_SPADE) { 	                                	e.getPlayer().launchProjectile(Snowball.class); 	                                        //do shooting stuff; 	                                } 	    	                            } 	  	                            @EventHandler 	                            public void onEntityDamage2(EntityDamageByEntityEvent e) { 	                                if (e.getDamager() instanceof Snowball) { 	                                        Snowball s = (Snowball) e.getDamager(); 	                                        if (s.getShooter() instanceof Player) { 	                                                Player shooter = (Player) s.getShooter(); 	                                                if (shooter.getItemInHand().getType() == Material.DIAMOND_SPADE) { 	                                                        shooter.getItemInHand().setDurability((short) (shooter.getItemInHand().getDurability() - Short.valueOf((short) -3))); 	                                                        e.setDamage(10.0); 	                                    } 	                                  } 	                               } 	                            } 	                                        @EventHandler 	                                        public void onPlayerInteract3(PlayerInteractEvent e) { 	                                            if (!(e.getAction() == Action.RIGHT_CLICK_AIR)); 	                                            	                                            if (!(e.getItem().getType() == Material.STONE_SPADE)) { 	                                            	e.getPlayer().launchProjectile(Snowball.class); 	                                                //do shooting stuff; 	                                            } 	                                        } 	                          	  	                                        @EventHandler 	                                        public void onEntityDamage3(EntityDamageByEntityEvent e) { 	                                            if (e.getDamager() instanceof Snowball) { 	                                                    Snowball s = (Snowball) e.getDamager(); 	                                                    if (s.getShooter() instanceof Player) { 	                                                            Player shooter = (Player) s.getShooter(); 	                                                            if (shooter.getItemInHand().getType() == Material.STONE_SPADE) { 	                                                                shooter.getItemInHand().setDurability((short) (shooter.getItemInHand().getDurability() - Short.valueOf((short) -2))); 	                                                                    e.setDamage(5.0); 	                                                } 	                                              } 	                                           } 	                                        } 	                                                    @EventHandler 	                                                    public void onPlayerInteract4(PlayerInteractEvent e) { 	                                                        if (!(e.getAction() == Action.RIGHT_CLICK_AIR)); 	                                                        	                                                        if (e.getItem().getType() == Material.WOOD_SPADE) { 	                                                        	e.getPlayer().launchProjectile(Snowball.class); 	                                                                //do shooting stuff; 	                                                        } 	                                                    } 	                                      	  	                                                    @EventHandler 	                                                    public void onEntityDamage4(EntityDamageByEntityEvent e) { 	                                                        if (e.getDamager() instanceof Snowball) { 	                                                                Snowball s = (Snowball) e.getDamager(); 	                                                                if (s.getShooter() instanceof Player) { 	                                                                        Player shooter = (Player) s.getShooter(); 	                                                                        if (shooter.getItemInHand().getType() == Material.WOOD_SPADE) { 	                                                                                shooter.getItemInHand().setDurability((short) (shooter.getItemInHand().getDurability() - Short.valueOf((short) -1))); 	                                                                                e.setDamage(3.0); 	               } 	            } 	        } 	    } }