Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* */ package me.flobgaming.BardBuffs;
- /* */
- /* */ import com.massivecraft.factions.FPlayer;
- /* */ import com.massivecraft.factions.FPlayers;
- /* */ import com.massivecraft.factions.Faction;
- /* */ import java.util.Collection;
- /* */ import java.util.HashMap;
- /* */ import java.util.Iterator;
- /* */ import org.bukkit.Bukkit;
- /* */ import org.bukkit.ChatColor;
- /* */ import org.bukkit.Location;
- /* */ import org.bukkit.Material;
- /* */ import org.bukkit.Server;
- /* */ import org.bukkit.entity.Player;
- /* */ import org.bukkit.event.EventHandler;
- /* */ import org.bukkit.event.Listener;
- /* */ import org.bukkit.event.player.PlayerInteractEvent;
- /* */ import org.bukkit.event.player.PlayerQuitEvent;
- /* */ import org.bukkit.inventory.ItemStack;
- /* */ import org.bukkit.inventory.PlayerInventory;
- /* */ import org.bukkit.plugin.PluginManager;
- /* */ import org.bukkit.plugin.java.JavaPlugin;
- /* */ import org.bukkit.potion.PotionEffect;
- /* */ import org.bukkit.potion.PotionEffectType;
- /* */ import org.bukkit.scheduler.BukkitRunnable;
- /* */
- /* */ public class Main extends JavaPlugin
- /* */ implements Listener
- /* */ {
- /* 29 */ private HashMap<String, Integer> factionCdWheat = new HashMap();
- /* 30 */ private HashMap<String, Integer> factionCdSpider = new HashMap();
- /* 31 */ private HashMap<String, Integer> factionCdSugar = new HashMap();
- /* 32 */ private HashMap<String, Integer> factionCdBlaze = new HashMap();
- /* 33 */ private HashMap<String, Integer> factionCdFeather = new HashMap();
- /* 34 */ private HashMap<String, Integer> factionCdIron = new HashMap();
- /* 35 */ private HashMap<String, Integer> factionCdGhast = new HashMap();
- /* 36 */ private HashMap<String, Integer> factionCdMagma = new HashMap();
- /* 37 */ private HashMap<String, Integer> factionCdSugar2 = new HashMap();
- /* 38 */ private HashMap<String, Integer> factionCdFeather2 = new HashMap();
- /* 39 */ private HashMap<String, String> playerFaction = new HashMap();
- /* 40 */ private HashMap<String, String> speedTimer = new HashMap();
- /* */
- /* */ public void onEnable()
- /* */ {
- /* 44 */ getServer().getPluginManager().registerEvents(this, this);
- /* */
- /* 46 */ new BukkitRunnable()
- /* */ {
- /* */ public void run()
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 51 */ int j = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 52 */ for (int i = 0; i < j; i++)
- /* */ {
- /* 54 */ Player pl = arrayOfPlayer[i];
- /* 55 */ FPlayer player = FPlayers.getInstance().getByPlayer(pl);
- /* 56 */ Faction pF = player.getFaction();
- /* 57 */ Main.this.playerFaction.put(pl.getName(), pF.getTag());
- /* */ }
- /* */ }
- /* */ }
- /* 60 */ .runTaskTimer(this, 20L, 20L);
- /* */ }
- /* */
- /* */ public void onDisable() {
- /* */ }
- /* */
- /* */ public void startCooldown(final String player, Integer time, final HashMap<String, Integer> map) {
- /* 67 */ map.put(player, time);
- /* */
- /* 69 */ new BukkitRunnable()
- /* */ {
- /* */ public void run()
- /* */ {
- /* 73 */ if (map.containsKey(player))
- /* */ {
- /* 75 */ if (((Integer)map.get(player)).intValue() - 1 != 0)
- /* */ {
- /* 77 */ map.put(player, Integer.valueOf(((Integer)map.get(player)).intValue() - 1));
- /* */ }
- /* */ else
- /* */ {
- /* 81 */ map.remove(player);
- /* 82 */ cancel();
- /* */ }
- /* */ }
- /* */ else
- /* 86 */ cancel();
- /* */ }
- /* */ }
- /* 89 */ .runTaskTimer(this, 20L, 20L);
- /* */ }
- /* */
- /* */ @EventHandler
- /* */ public void onPlayerQuit(PlayerQuitEvent evt)
- /* */ {
- /* 95 */ this.playerFaction.remove(evt.getPlayer().getName());
- /* */ }
- /* */
- /* */ @EventHandler
- /* */ public void onInteract(PlayerInteractEvent evt)
- /* */ {
- /* 101 */ final Player player = evt.getPlayer();
- /* 102 */ if (this.playerFaction.containsKey(player.getName()))
- /* */ {
- /* 104 */ String playerfaction = (String)this.playerFaction.get(player.getName());
- /* 105 */ if ((evt.getItem() != null) && (player.getInventory().getHelmet() != null) && (player.getInventory().getChestplate() != null) && (player.getInventory().getLeggings() != null) && (player.getInventory().getBoots() != null))
- /* */ {
- /* */ PotionEffect pe;
- /* 110 */ if ((player.getInventory().getHelmet().getType().equals(Material.GOLD_HELMET)) && (player.getInventory().getChestplate().getType().equals(Material.GOLD_CHESTPLATE)) && (player.getInventory().getLeggings().getType().equals(Material.GOLD_LEGGINGS)) && (player.getInventory().getBoots().getType().equals(Material.GOLD_BOOTS)))
- /* */ {
- /* 113 */ if (evt.getItem().getType().equals(Material.WHEAT))
- /* */ {
- /* 115 */ if (this.factionCdWheat.containsKey(playerfaction))
- /* */ {
- /* 117 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdWheat.get(playerfaction) + " more seconds.");
- /* 118 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 122 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 123 */ for (int i = 0; i < m; i++)
- /* */ {
- /* 125 */ Player pl = arrayOfPlayer[i];
- /* 126 */ if ((player.getName() != pl.getName()) &&
- /* 127 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 128 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 129 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 131 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 200, 2));
- /* 132 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used wheat to give you the saturation effect.");
- /* */ }
- /* */ }
- /* 135 */ player.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 200, 2));
- /* 136 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully gave your faction members saturation.");
- /* 137 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 138 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 140 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 142 */ player.updateInventory();
- /* 143 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdWheat);
- /* */ }
- /* 145 */ evt.setCancelled(true);
- /* 146 */ return;
- /* */ }
- /* 148 */ if (evt.getItem().getType().equals(Material.SPIDER_EYE))
- /* */ {
- /* 150 */ if (this.factionCdSpider.containsKey(playerfaction))
- /* */ {
- /* 152 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdSpider.get(playerfaction) + " more seconds.");
- /* 153 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 157 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 158 */ for (int i = 0; i < m; i++)
- /* */ {
- /* 160 */ Player pl = arrayOfPlayer[i];
- /* 161 */ if ((player.getName() != pl.getName()) &&
- /* 162 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 164 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 200, 2));
- /* 165 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used a spider eye to give you the wither effect.");
- /* */ }
- /* */ }
- /* 168 */ player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 200, 2));
- /* 169 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully withered everybody within 15 blocks of you.");
- /* 170 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 171 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 173 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 175 */ player.updateInventory();
- /* 176 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdSpider);
- /* */ }
- /* 178 */ evt.setCancelled(true);
- /* 179 */ return;
- /* */ }
- /* 181 */ if (evt.getItem().getType().equals(Material.SUGAR))
- /* */ {
- /* 183 */ if (this.factionCdSugar.containsKey(playerfaction))
- /* */ {
- /* 185 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdSugar.get(playerfaction) + " more seconds.");
- /* 186 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 190 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 191 */ for (int i = 0; i < m; i++)
- /* */ {
- /* 193 */ final Player pl = arrayOfPlayer[i];
- /* 194 */ if ((player.getName() != pl.getName()) &&
- /* 195 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 196 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 197 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 199 */ if (pl.hasPotionEffect(PotionEffectType.SPEED)) {
- /* 200 */ for (Iterator localIterator = pl.getActivePotionEffects().iterator(); localIterator.hasNext(); ) { pe = (PotionEffect)localIterator.next();
- /* 201 */ if (pe.getType().equals(PotionEffectType.SPEED))
- /* */ {
- /* 203 */ this.speedTimer.put(pl.getName(), pe.getDuration() / 20 + ":" + pe.getAmplifier());
- /* 204 */ pl.removePotionEffect(PotionEffectType.SPEED);
- /* 205 */ new BukkitRunnable()
- /* */ {
- /* */ public void run()
- /* */ {
- /* 209 */ String[] splitter = ((String)Main.this.speedTimer.get(pl.getName())).split(":");
- /* 210 */ int duration = Integer.parseInt(splitter[0]);
- /* 211 */ int amplifier = Integer.parseInt(splitter[1]);
- /* 212 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, duration * 20, amplifier));
- /* 213 */ Main.this.speedTimer.remove(pl.getName());
- /* */ }
- /* */ }
- /* 215 */ .runTaskLater(this, 220L);
- /* */ }
- /* */ }
- /* */ }
- /* 219 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 2));
- /* 220 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used sugar to give you the speed effect.");
- /* */ }
- /* */ }
- /* 223 */ if (player.hasPotionEffect(PotionEffectType.SPEED)) {
- /* 224 */ for (PotionEffect pe : player.getActivePotionEffects()) {
- /* 225 */ if (pe.getType().equals(PotionEffectType.SPEED))
- /* */ {
- /* 227 */ this.speedTimer.put(player.getName(), pe.getDuration() / 20 + ":" + pe.getAmplifier());
- /* 228 */ player.removePotionEffect(PotionEffectType.SPEED);
- /* 229 */ new BukkitRunnable()
- /* */ {
- /* */ public void run()
- /* */ {
- /* 233 */ String[] splitter = ((String)Main.this.speedTimer.get(player.getName())).split(":");
- /* 234 */ int duration = Integer.parseInt(splitter[0]);
- /* 235 */ int amplifier = Integer.parseInt(splitter[1]);
- /* 236 */ player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, duration * 20, amplifier));
- /* 237 */ Main.this.speedTimer.remove(player.getName());
- /* */ }
- /* */ }
- /* 239 */ .runTaskLater(this, 220L);
- /* */ }
- /* */ }
- /* */ }
- /* 243 */ player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 2));
- /* 244 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully gave your faction members speed.");
- /* 245 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 246 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 248 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 250 */ player.updateInventory();
- /* 251 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdSugar);
- /* */ }
- /* 253 */ evt.setCancelled(true);
- /* 254 */ return;
- /* */ }
- /* 256 */ if (evt.getItem().getType().equals(Material.BLAZE_POWDER))
- /* */ {
- /* 258 */ if (this.factionCdBlaze.containsKey(playerfaction))
- /* */ {
- /* 260 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdBlaze.get(playerfaction) + " more seconds.");
- /* 261 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 265 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 266 */ for (int j = 0; j < m; j++)
- /* */ {
- /* 268 */ Player pl = arrayOfPlayer[j];
- /* 269 */ if ((player.getName() != pl.getName()) &&
- /* 270 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 271 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 272 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 274 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0));
- /* 275 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used blaze powder to give you the strength effect.");
- /* */ }
- /* */ }
- /* 278 */ player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 0));
- /* 279 */ player.sendMessage(ChatColor.DARK_GREEN + "You gave your faction members strength.");
- /* 280 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 281 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 283 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 285 */ player.updateInventory();
- /* 286 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdBlaze);
- /* */ }
- /* 288 */ evt.setCancelled(true);
- /* 289 */ return;
- /* */ }
- /* 291 */ if (evt.getItem().getType().equals(Material.FEATHER))
- /* */ {
- /* 293 */ if (this.factionCdFeather.containsKey(playerfaction))
- /* */ {
- /* 295 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdFeather.get(playerfaction) + " more seconds.");
- /* 296 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 300 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 301 */ for (int j = 0; j < m; j++)
- /* */ {
- /* 303 */ Player pl = arrayOfPlayer[j];
- /* 304 */ if ((player.getName() != pl.getName()) &&
- /* 305 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 306 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 307 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 309 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 200, 1));
- /* 310 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used a feather to give you the jump effect.");
- /* */ }
- /* */ }
- /* 313 */ player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 200, 1));
- /* 314 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully gave your faction members jump.");
- /* 315 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 316 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 318 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 320 */ player.updateInventory();
- /* 321 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdFeather);
- /* */ }
- /* 323 */ evt.setCancelled(true);
- /* 324 */ return;
- /* */ }
- /* 326 */ if (evt.getItem().getType().equals(Material.IRON_INGOT))
- /* */ {
- /* 328 */ if (this.factionCdIron.containsKey(playerfaction))
- /* */ {
- /* 330 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdIron.get(playerfaction) + " more seconds.");
- /* 331 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 335 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 336 */ for (int j = 0; j < m; j++)
- /* */ {
- /* 338 */ Player pl = arrayOfPlayer[j];
- /* 339 */ if ((player.getName() != pl.getName()) &&
- /* 340 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 341 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 342 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 344 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 1));
- /* 345 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used a iron ingot to give you the resistance effect.");
- /* */ }
- /* */ }
- /* 348 */ player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 1));
- /* 349 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully gave your faction members resistance.");
- /* 350 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 351 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 353 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 355 */ player.updateInventory();
- /* 356 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdIron);
- /* */ }
- /* 358 */ evt.setCancelled(true);
- /* 359 */ return;
- /* */ }
- /* 361 */ if (evt.getItem().getType().equals(Material.GHAST_TEAR))
- /* */ {
- /* 363 */ if (this.factionCdGhast.containsKey(playerfaction))
- /* */ {
- /* 365 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdGhast.get(playerfaction) + " more seconds.");
- /* 366 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 370 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 371 */ for (int j = 0; j < m; j++)
- /* */ {
- /* 373 */ Player pl = arrayOfPlayer[j];
- /* 374 */ if ((player.getName() != pl.getName()) &&
- /* 375 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 376 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 377 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 379 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 1));
- /* 380 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used a ghast tear to give you the regeneration effect.");
- /* */ }
- /* */ }
- /* 383 */ player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 1));
- /* 384 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You gave your faction members regeneration.");
- /* 385 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 386 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 388 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 390 */ player.updateInventory();
- /* 391 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdGhast);
- /* */ }
- /* 393 */ evt.setCancelled(true);
- /* 394 */ return;
- /* */ }
- /* 396 */ if (evt.getItem().getType().equals(Material.MAGMA_CREAM))
- /* */ {
- /* 398 */ if (this.factionCdMagma.containsKey(playerfaction))
- /* */ {
- /* 400 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdMagma.get(playerfaction) + " more seconds.");
- /* 401 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 405 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 406 */ for (int j = 0; j < m; j++)
- /* */ {
- /* 408 */ Player pl = arrayOfPlayer[j];
- /* 409 */ if ((player.getName() != pl.getName()) &&
- /* 410 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 411 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 412 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 414 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0));
- /* 415 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used some magma cream to give you the fire resistance effect.");
- /* */ }
- /* */ }
- /* 418 */ player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0));
- /* 419 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully gave your faction members fire resistance.");
- /* 420 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 421 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 423 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 425 */ player.updateInventory();
- /* 426 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdMagma);
- /* */ }
- /* 428 */ evt.setCancelled(true);
- /* */ }
- /* */ }
- /* 431 */ else if ((player.getInventory().getHelmet().getType().equals(Material.LEATHER_HELMET)) && (player.getInventory().getChestplate().getType().equals(Material.LEATHER_CHESTPLATE)) &&
- /* 432 */ (player.getInventory().getLeggings().getType().equals(Material.LEATHER_LEGGINGS)) && (player.getInventory().getBoots().getType().equals(Material.LEATHER_BOOTS)))
- /* */ {
- /* 434 */ if (evt.getItem().getType().equals(Material.SUGAR))
- /* */ {
- /* 436 */ if (this.factionCdSugar2.containsKey(playerfaction))
- /* */ {
- /* 438 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdSugar2.get(playerfaction) + " more seconds.");
- /* 439 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 443 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* */ PotionEffect pe;
- /* 444 */ for (int j = 0; j < m; j++)
- /* */ {
- /* 446 */ final Player pl = arrayOfPlayer[j];
- /* 447 */ if ((player.getName() != pl.getName()) &&
- /* 448 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 449 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 450 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 452 */ if (pl.hasPotionEffect(PotionEffectType.SPEED)) {
- /* 453 */ for (pe = pl.getActivePotionEffects().iterator(); pe.hasNext(); ) { pe = (PotionEffect)pe.next();
- /* 454 */ if (pe.getType().equals(PotionEffectType.SPEED))
- /* */ {
- /* 456 */ this.speedTimer.put(pl.getName(), pe.getDuration() / 20 + ":" + pe.getAmplifier());
- /* 457 */ pl.removePotionEffect(PotionEffectType.SPEED);
- /* 458 */ new BukkitRunnable()
- /* */ {
- /* */ public void run()
- /* */ {
- /* 462 */ String[] splitter = ((String)Main.this.speedTimer.get(pl.getName())).split(":");
- /* 463 */ int duration = Integer.parseInt(splitter[0]);
- /* 464 */ int amplifier = Integer.parseInt(splitter[1]);
- /* 465 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, duration * 20, amplifier));
- /* 466 */ Main.this.speedTimer.remove(pl.getName());
- /* */ }
- /* */ }
- /* 468 */ .runTaskLater(this, 220L);
- /* */ }
- /* */ }
- /* */ }
- /* 472 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 3));
- /* 473 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used sugar to give you the speed effect.");
- /* */ }
- /* */ }
- /* 476 */ if (player.hasPotionEffect(PotionEffectType.SPEED)) {
- /* 477 */ for (PotionEffect pe : player.getActivePotionEffects()) {
- /* 478 */ if (pe.getType().equals(PotionEffectType.SPEED))
- /* */ {
- /* 480 */ this.speedTimer.put(player.getName(), pe.getDuration() / 20 + ":" + pe.getAmplifier());
- /* 481 */ player.removePotionEffect(PotionEffectType.SPEED);
- /* 482 */ new BukkitRunnable()
- /* */ {
- /* */ public void run()
- /* */ {
- /* 486 */ String[] splitter = ((String)Main.this.speedTimer.get(player.getName())).split(":");
- /* 487 */ int duration = Integer.parseInt(splitter[0]);
- /* 488 */ int amplifier = Integer.parseInt(splitter[1]);
- /* 489 */ player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, duration * 20, amplifier));
- /* 490 */ Main.this.speedTimer.remove(player.getName());
- /* */ }
- /* */ }
- /* 492 */ .runTaskLater(this, 220L);
- /* */ }
- /* */ }
- /* */ }
- /* 496 */ player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 3));
- /* 497 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully gave yourself the speed effect.");
- /* 498 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 499 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 501 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 503 */ player.updateInventory();
- /* 504 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdSugar2);
- /* */ }
- /* 506 */ evt.setCancelled(true);
- /* 507 */ return;
- /* */ }
- /* 509 */ if (evt.getItem().getType().equals(Material.FEATHER))
- /* */ {
- /* 511 */ if (this.factionCdFeather2.containsKey(playerfaction))
- /* */ {
- /* 513 */ player.sendMessage(ChatColor.RED + "ERROR: You are still in a cooldown for " + this.factionCdFeather2.get(playerfaction) + " more seconds.");
- /* 514 */ evt.setCancelled(true);
- /* */ }
- /* */ else
- /* */ {
- /* */ Player[] arrayOfPlayer;
- /* 518 */ int m = (arrayOfPlayer = Bukkit.getOnlinePlayers()).length;
- /* 519 */ for (int k = 0; k < m; k++)
- /* */ {
- /* 521 */ Player pl = arrayOfPlayer[k];
- /* 522 */ if ((player.getName() != pl.getName()) &&
- /* 523 */ (this.playerFaction.containsKey(pl.getName())) &&
- /* 524 */ (((String)this.playerFaction.get(pl.getName())).equalsIgnoreCase(playerfaction)) &&
- /* 525 */ (pl.getLocation().distance(player.getLocation()) <= 15.0D))
- /* */ {
- /* 527 */ pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 200, 1));
- /* 528 */ pl.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.YELLOW + player.getName() + ChatColor.DARK_GREEN + " used a feather to give you the jump effect.");
- /* */ }
- /* */ }
- /* 531 */ player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 200, 1));
- /* 532 */ player.sendMessage(ChatColor.DARK_GREEN + "[" + ChatColor.YELLOW + "BardBuff" + ChatColor.DARK_GREEN + "] " + ChatColor.DARK_GREEN + "You successfully gave yourself the jump effect.");
- /* 533 */ if (player.getInventory().getItemInHand().getAmount() != 1)
- /* 534 */ player.getInventory().getItemInHand().setAmount(player.getInventory().getItemInHand().getAmount() - 1);
- /* */ else {
- /* 536 */ player.getInventory().remove(player.getInventory().getItemInHand());
- /* */ }
- /* 538 */ player.updateInventory();
- /* 539 */ startCooldown(playerfaction, Integer.valueOf(20), this.factionCdFeather2);
- /* */ }
- /* 541 */ evt.setCancelled(true);
- /* 542 */ return;
- /* */ }
- /* */ }
- /* */ }
- /* */ }
- /* */ }
- /* */ }
- /* Location: /Users/jasontalkst3ch/Desktop/current/Bard.jar
- * Qualified Name: me.flobgaming.BardBuffs.Main
- * JD-Core Version: 0.6.2
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement