예제 #1
0
  /**
   * Return a random firework effect.
   *
   * @param boolean allowCreeperType if true, creeper shaped firework explosion types are allowed.
   * @return a FireworkEffect instance.
   */
  protected FireworkEffect randomFireworkFffect(boolean allowCreeperType) {
    FireworkEffect.Builder builder = FireworkEffect.builder();
    if (Math.random() < 0.3) {
      builder.withFlicker();
    }
    if (Math.random() < 0.3) {
      builder.withTrail();
    }

    final FireworkEffect.Type[] TYPES =
        allowCreeperType ? FireworkEffect.Type.values() : NON_CREEPER_FIREWORK_TYPES;
    builder.with(TYPES[random(0, TYPES.length - 1)]);

    final int primaryColors = random(1, 4);
    for (int i = 0; i < primaryColors; ++i) {
      builder.withColor(Color.fromRGB(random(0, 255), random(0, 255), random(0, 255)));
    }

    final int fadeColors = random(1, 4);
    for (int i = 0; i < fadeColors; ++i) {
      builder.withFade(Color.fromRGB(random(0, 255), random(0, 255), random(0, 255)));
    }

    return builder.build();
  }
예제 #2
0
  @Override
  public boolean onDamageOther(EntityDamageByEntityEvent e, Player p, int level) {
    if (e.getEntity() instanceof LivingEntity) {
      LivingEntity le = (LivingEntity) e.getEntity();

      try {
        fireworks.playFirework(
            le.getWorld(),
            le.getLocation(),
            FireworkEffect.builder().with(Type.BURST).withColor(Color.WHITE).build());
      } catch (Exception ex) {
        Logger.getLogger(Burst.class.getName()).log(Level.SEVERE, null, ex);
      }

      Vector unitVector =
          le.getLocation().toVector().subtract(e.getDamager().getLocation().toVector()).normalize();

      unitVector.setY(0.55 / level);

      le.setVelocity(unitVector.multiply(level * 2));

      e.setCancelled(true);

      return true;
    }
    return false;
  }
예제 #3
0
  private static void spawnFireworks(Player player) {
    int power = (int) (Math.random() * 3) + 1;
    int type = (int) (Math.random() * 5) + 1;

    Type typen = Type.BALL;
    if (type == 1) typen = Type.BALL;
    if (type == 2) typen = Type.BALL_LARGE;
    if (type == 3) typen = Type.BURST;
    if (type == 4) typen = Type.CREEPER;
    if (type == 5) typen = Type.STAR;

    Firework fireworks =
        (Firework) player.getWorld().spawnEntity(player.getLocation(), EntityType.FIREWORK);
    FireworkMeta fireworkmeta = fireworks.getFireworkMeta();
    FireworkEffect effect =
        FireworkEffect.builder()
            .flicker(Misc.getRandom().nextBoolean())
            .withColor(colorchoose())
            .withFade(colorchoose())
            .with(typen)
            .trail(Misc.getRandom().nextBoolean())
            .build();
    fireworkmeta.addEffect(effect);
    fireworkmeta.setPower(power);
    fireworks.setFireworkMeta(fireworkmeta);
  }
예제 #4
0
 public FireworkEffect getFireworkEffect(
     Color one, Color two, Color three, Color four, Color five, Type type) {
   return FireworkEffect.builder()
       .flicker(false)
       .withColor(one, two, three, four)
       .withFade(five)
       .with(type)
       .trail(true)
       .build();
 }
 private void launchExplodeFirework(Location loc) {
   FireworkEffect fe =
       FireworkEffect.builder()
           .withColor(Color.ORANGE)
           .withColor(Color.YELLOW)
           .flicker(true)
           .with(Type.BURST)
           .build();
   TaskMaster.syncTask(new FireWorkTask(fe, loc.getWorld(), loc, 3), 0);
 }
예제 #6
0
  public void fancyDestroyStructureBlocks() {
    for (BlockCoord coord : this.structureBlocks.keySet()) {

      if (CivGlobal.getStructureChest(coord) != null) {
        continue;
      }

      if (CivGlobal.getStructureSign(coord) != null) {
        continue;
      }

      if (ItemManager.getId(coord.getBlock()) == CivData.BEDROCK
          || ItemManager.getId(coord.getBlock()) == CivData.AIR) {
        // Be a bit more careful not to destroy any of the item frames..
        continue;
      }

      Random rand = new Random();

      // Each block has a 10% chance to turn into gravel
      if (rand.nextInt(100) <= 10) {
        ItemManager.setTypeId(coord.getBlock(), CivData.GRAVEL);
        continue;
      }

      // Each block has a 50% chance of starting a fire
      if (rand.nextInt(100) <= 50) {
        ItemManager.setTypeId(coord.getBlock(), CivData.FIRE);
        continue;
      }

      // Each block has a 1% chance of launching an explosion effect
      if (rand.nextInt(100) <= 1) {
        FireworkEffect effect =
            FireworkEffect.builder()
                .with(org.bukkit.FireworkEffect.Type.BURST)
                .withColor(Color.ORANGE)
                .withColor(Color.RED)
                .withTrail()
                .withFlicker()
                .build();
        FireworkEffectPlayer fePlayer = new FireworkEffectPlayer();
        for (int i = 0; i < 3; i++) {
          try {
            fePlayer.playFirework(coord.getBlock().getWorld(), coord.getLocation(), effect);
          } catch (Exception e) {
            e.printStackTrace();
          }
        }
      }
    }
  }
예제 #7
0
 public static void shootFirework(Player p) {
   Firework fw = (Firework) p.getWorld().spawn(p.getLocation(), Firework.class);
   FireworkMeta fwMeta = fw.getFireworkMeta();
   boolean flicker = Math.random() < 0.5;
   boolean trail = Math.random() < 0.5;
   fwMeta.addEffect(
       FireworkEffect.builder()
           .withColor(colors[new Random().nextInt(colors.length)])
           .flicker(flicker)
           .trail(trail)
           .build());
   fw.setFireworkMeta(fwMeta);
 }
예제 #8
0
  protected void spawnFirework(Location location) {
    List<Location> smokeLocations = new ArrayList<Location>();
    smokeLocations.add(location);
    smokeLocations.add(location.clone().add(0, 1, 0));
    SmokeUtil.spawnCloudRandom(smokeLocations, 3);

    Firework fw = (Firework) location.getWorld().spawnEntity(location, EntityType.FIREWORK);
    FireworkMeta fwm = fw.getFireworkMeta();

    fwm.addEffect(FireworkEffect.builder().withColor(Color.BLACK).with(Type.BURST).build());
    fwm.setPower(1);
    fw.setFireworkMeta(fwm);
  }
  @Override
  public void run() {
    timesRan++;

    Location lFx = l;
    lFx.add(0, 2 * timesRan, 0);

    if (timesRan == 0) {

    } else if (timesRan == 5) {
      try {
        fireworks.playFirework(
            lFx.getWorld(),
            lFx,
            FireworkEffect.builder()
                .with(FireworkEffect.Type.CREEPER)
                .withColor(Color.GREEN)
                .build());
      } catch (Exception ex) {
        // Gracefully downgrade
      }

      plugin.bossManager.hatchBossAtLocation(l);

      this.cancel();

      return;
    }

    try {
      fireworks.playFirework(
          lFx.getWorld(),
          lFx,
          FireworkEffect.builder().with(FireworkEffect.Type.BALL).withColor(Color.PURPLE).build());
    } catch (Exception ex) {
      // Gracefully downgrade
    }
  }
  private void launchExplodeFirework(Location loc) {
    Random rand = new Random();
    int rand1 = rand.nextInt(100);

    if (rand1 > 90) {
      FireworkEffect fe =
          FireworkEffect.builder()
              .withColor(Color.ORANGE)
              .withColor(Color.YELLOW)
              .flicker(true)
              .with(Type.BURST)
              .build();
      TaskMaster.syncTask(new FireWorkTask(fe, loc.getWorld(), loc, 3), 0);
    }
  }
예제 #11
0
  /**
   * Generates a Firework with random colors/velocity and the given Firework Type
   *
   * @param type The type of firework
   */
  public void fireWorkRandomColors(FireworkEffect.Type type, Location location) {
    Firework firework = (Firework) location.getWorld().spawnEntity(location, EntityType.FIREWORK);
    FireworkMeta fireworkMeta = firework.getFireworkMeta();

    // Generate the colors
    int rdmInt1 = plugin.getRandom().nextInt(255);
    int rdmInt2 = plugin.getRandom().nextInt(255);
    int rdmInt3 = plugin.getRandom().nextInt(255);
    Color mainColor = Color.fromRGB(rdmInt1, rdmInt2, rdmInt3);

    FireworkEffect fwEffect = FireworkEffect.builder().withColor(mainColor).with(type).build();
    fireworkMeta.addEffect(fwEffect);
    fireworkMeta.setPower(1);
    firework.setFireworkMeta(fireworkMeta);
  }
예제 #12
0
 public static void fireWork(Location loc) {
   Firework fw = loc.getWorld().spawn(loc, Firework.class);
   FireworkMeta fm = fw.getFireworkMeta();
   fm.addEffects(
       FireworkEffect.builder()
           .with(FireworkEffect.Type.BALL_LARGE)
           .withColor(Color.RED)
           .withColor(Color.AQUA)
           .withColor(Color.ORANGE)
           .withColor(Color.YELLOW)
           .trail(false)
           .flicker(false)
           .build());
   fm.setPower(0);
   fw.setFireworkMeta(fm);
   detonate(fw);
 }
예제 #13
0
 public static void detonateFirework(
     Location loc,
     boolean flicker,
     boolean trail,
     FireworkEffect.Type type,
     Iterable<Color> colours,
     Iterable<Color> fades) {
   detonateFirework(
       loc,
       FireworkEffect.builder()
           .flicker(flicker)
           .trail(trail)
           .with(type)
           .withColor(colours)
           .withFade(fades)
           .build());
 }
예제 #14
0
 public static void shootRandomFirework(Location loc, int height) {
   Firework f = (Firework) loc.getWorld().spawnEntity(loc, EntityType.FIREWORK);
   FireworkMeta fm = f.getFireworkMeta();
   fm.setPower(height);
   int effectAmount = random.nextInt(3) + 1;
   for (int i = 0; i < effectAmount; i++) {
     Builder b = FireworkEffect.builder();
     int colorAmount = random.nextInt(3) + 1;
     for (int ii = 0; ii < colorAmount; ii++) {
       b.withColor(Color.fromBGR(random.nextInt(256), random.nextInt(256), random.nextInt(256)));
     }
     b.with(Type.values()[random.nextInt(Type.values().length)]);
     b.flicker(random.nextInt(2) == 0 ? false : true);
     b.trail(random.nextInt(2) == 0 ? false : true);
     fm.addEffect(b.build());
   }
   f.setFireworkMeta(fm);
 }
예제 #15
0
	@Override
	public boolean applyResult(final Player player) {
		if (player == null)
			return false;

		final Location loc = (target.equals("player")) ? player.getLocation() : player.getWorld().getSpawnLocation();

		final Firework fw = (Firework) loc.getWorld().spawnEntity(loc, EntityType.FIREWORK);
		final FireworkMeta fwm = fw.getFireworkMeta();
		final FireworkEffect effect = FireworkEffect.builder().withColor(colour).with(type).build();

		fwm.addEffect(effect);
		fwm.setPower(power);

		fw.setFireworkMeta(fwm);

		player.teleport(location);
		return location != null;
	}
 @Override
 public void createFireworksExplosion(
     Location location,
     boolean flicker,
     boolean trail,
     int type,
     int[] colors,
     int[] fadeColors,
     int flightDuration) {
   FireworkEffect.Type t = Type.BALL;
   if (type == 1) {
     t = Type.BALL_LARGE;
   } else if (type == 2) {
     t = Type.STAR;
   } else if (type == 3) {
     t = Type.CREEPER;
   } else if (type == 4) {
     t = Type.BURST;
   }
   Color[] c1 = new Color[colors.length];
   for (int i = 0; i < colors.length; i++) {
     c1[i] = Color.fromRGB(colors[i]);
   }
   Color[] c2 = new Color[fadeColors.length];
   for (int i = 0; i < fadeColors.length; i++) {
     c2[i] = Color.fromRGB(fadeColors[i]);
   }
   FireworkEffect effect =
       FireworkEffect.builder()
           .flicker(flicker)
           .trail(trail)
           .with(t)
           .withColor(c1)
           .withFade(c2)
           .build();
   Firework firework = location.getWorld().spawn(location, Firework.class);
   FireworkMeta meta = firework.getFireworkMeta();
   meta.addEffect(effect);
   meta.setPower(flightDuration < 1 ? 1 : flightDuration);
   firework.setFireworkMeta(meta);
 }
 @Override
 public void run() {
   if ((Boolean) Setting.BEACONS.getSetting()) {
     if (game == null || game.getFakeBeaconThread() != this) {
       cancel();
       return;
     }
     if (game.getActiveMysteryChest() == null) {
       List<MysteryBox> chests = game.getObjectsOfType(MysteryBox.class);
       if (chests.size() > 0) {
         game.setActiveMysteryChest(chests.get(rand.nextInt(chests.size())));
       }
     }
     if (game.hasStarted() && game.getActiveMysteryChest() != null) {
       if (active == null
           || !BukkitUtility.locationMatch(
               game.getActiveMysteryChest().getLocation(), active.getLocation())) {
         active = game.getActiveMysteryChest();
         fireLocations = getFiringLocations(active.getLocation());
       }
       for (Location l : fireLocations) {
         Builder effect =
             FireworkEffect.builder()
                 .trail(true)
                 .flicker(false)
                 .withColor(Color.BLUE)
                 .with(Type.BURST);
         Firework work = l.getWorld().spawn(l, Firework.class);
         EntityExplode.preventExplosion(work.getUniqueId(), true);
         FireworkMeta meta = work.getFireworkMeta();
         meta.addEffect(effect.build());
         meta.setPower(5);
         work.setFireworkMeta(meta);
       }
     }
   }
 }
예제 #18
0
 public FireworkEffect getEffect() {
   return FireworkEffect.builder().flicker(flicker).with(getType()).withColor(getColor()).build();
 }
예제 #19
0
  @Override
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (cmd.getName().equalsIgnoreCase("entitymanager") || cmd.getName().equalsIgnoreCase("em")) {
      if (sender.hasPermission("entitymanager.use")) {
        if (args.length == 1) {
          if (args[0].equalsIgnoreCase("findduplicate") || args[0].equalsIgnoreCase("fd")) {
            World world = getWorld(sender);

            if (world == null) {
              message(sender, "&cCould not get world.");
              return true;
            }

            List<UUID> entityUUIDs = new ArrayList<UUID>();
            Map<UUID, Location> duplicateEntities = new HashMap<UUID, Location>();
            for (LivingEntity le : world.getLivingEntities()) {
              if (entityUUIDs.contains(le.getUniqueId())) {
                duplicateEntities.put(le.getUniqueId(), le.getLocation());
              }
              entityUUIDs.add(le.getUniqueId());
            }

            if (duplicateEntities.isEmpty()) {
              sender.sendMessage(ChatColor.RED + "Could not find any duplicate entities.");
            } else {
              String message = "";
              for (Entry<UUID, Location> e : duplicateEntities.entrySet()) {
                message +=
                    "Entity "
                        + e.getKey()
                        + " at x:"
                        + (int) e.getValue().getX()
                        + ", y:"
                        + (int) e.getValue().getY()
                        + ", z:"
                        + (int) e.getValue().getZ()
                        + "\n";
              }

              sender.sendMessage(ChatColor.GREEN + "Duplicate entities:\n" + message);
            }

            return true;
          }
        }

        if (args.length >= 2) {
          if (args[0].equalsIgnoreCase("get")) {
            UUID uuid = UUID.fromString(args[1]);
            if (uuid == null) {
              sender.sendMessage(ChatColor.RED + "Invalid UUID.");
            } else {
              World world = getWorld(sender);

              if (world == null) {
                message(sender, "&cCould not get world.");
                return true;
              }

              for (LivingEntity le : world.getLivingEntities()) {
                if (le.getUniqueId().equals(uuid)) {
                  Location loc = le.getLocation();
                  selectedEntity = le;
                  message(
                      sender,
                      "&aEntity location: x:"
                          + (int) loc.getX()
                          + ", y:"
                          + loc.getY()
                          + ", z:"
                          + loc.getZ());
                  return true;
                }
              }

              message(sender, "&cNo valid entity found.");
            }
          } else if (args[0].equalsIgnoreCase("highlight") || args[0].equalsIgnoreCase("h")) {
            if (selectedEntity == null) {
              message(sender, "&cNo entity selected.");
            } else {
              Firework firework =
                  selectedEntity.getWorld().spawn(selectedEntity.getLocation(), Firework.class);
              FireworkMeta data = (FireworkMeta) firework.getFireworkMeta();
              data.addEffects(
                  FireworkEffect.builder().withColor(Color.LIME).with(Type.BALL).build());
              data.setPower(0);
              firework.setFireworkMeta(data);
              message(sender, "&aEntity highlighted.");
            }
          }
        } else {
          message(sender, "&cInvalid subcommand.");
        }

      } else {
        sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
      }

      return true;
    }

    return false;
  }
예제 #20
0
  public void onControlBlockDestroy(
      ControlPoint cp, World world, Player player, StructureBlock hit) {
    // Should always have a resident and a town at this point.
    Resident attacker = CivGlobal.getResident(player);

    ItemManager.setTypeId(hit.getCoord().getLocation().getBlock(), CivData.AIR);
    world.playSound(hit.getCoord().getLocation(), Sound.ANVIL_BREAK, 1.0f, -1.0f);
    world.playSound(hit.getCoord().getLocation(), Sound.EXPLODE, 1.0f, 1.0f);

    FireworkEffect effect =
        FireworkEffect.builder()
            .with(Type.BURST)
            .withColor(Color.YELLOW)
            .withColor(Color.RED)
            .withTrail()
            .withFlicker()
            .build();
    FireworkEffectPlayer fePlayer = new FireworkEffectPlayer();
    for (int i = 0; i < 3; i++) {
      try {
        fePlayer.playFirework(world, hit.getCoord().getLocation(), effect);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    boolean allDestroyed = true;
    for (ControlPoint c : this.controlPoints.values()) {
      if (c.isDestroyed() == false) {
        allDestroyed = false;
        break;
      }
    }
    CivMessage.sendTownSound(hit.getTown(), Sound.AMBIENCE_CAVE, 1.0f, 0.5f);

    if (allDestroyed) {

      if (this.getTown().getCiv().getCapitolName().equals(this.getTown().getName())) {
        CivMessage.global(
            CivColor.LightBlue
                + ChatColor.BOLD
                + "The civilization of "
                + this.getTown().getCiv().getName()
                + " has been conquered by "
                + attacker.getCiv().getName()
                + "!");
        for (Town town : this.getTown().getCiv().getTowns()) {
          town.defeated = true;
        }

        War.transferDefeated(this.getTown().getCiv(), attacker.getTown().getCiv());
        WarStats.logCapturedCiv(attacker.getTown().getCiv(), this.getTown().getCiv());
        War.saveDefeatedCiv(this.getCiv(), attacker.getTown().getCiv());

        if (CivGlobal.isCasualMode()) {
          HashMap<Integer, ItemStack> leftovers =
              player
                  .getInventory()
                  .addItem(
                      this.getCiv()
                          .getRandomLeaderSkull("Victory Over " + this.getCiv().getName() + "!"));
          for (ItemStack stack : leftovers.values()) {
            player.getWorld().dropItem(player.getLocation(), stack);
          }
        }

      } else {
        CivMessage.global(
            CivColor.Yellow
                + ChatColor.BOLD
                + "The town of "
                + getTown().getName()
                + " in "
                + this.getCiv().getName()
                + " has been conquered by "
                + attacker.getCiv().getName()
                + "!");
        // this.getTown().onDefeat(attacker.getTown().getCiv());
        this.getTown().defeated = true;
        // War.defeatedTowns.put(this.getTown().getName(), attacker.getTown().getCiv());
        WarStats.logCapturedTown(attacker.getTown().getCiv(), this.getTown());
        War.saveDefeatedTown(this.getTown().getName(), attacker.getTown().getCiv());
      }

    } else {
      CivMessage.sendTown(
          hit.getTown(),
          CivColor.Rose + "One of our Town Hall's Control Points has been destroyed!");
      CivMessage.sendCiv(
          attacker.getTown().getCiv(),
          CivColor.LightGreen
              + "We've destroyed a control block in "
              + hit.getTown().getName()
              + "!");
      CivMessage.sendCiv(
          hit.getTown().getCiv(),
          CivColor.Rose + "A control block in " + hit.getTown().getName() + " has been destroyed!");
    }
  }
예제 #21
0
  /**
   * Sends a display of item information to the specified command sender
   *
   * @param item the item to display, cannot be null
   * @param sender the command sender to send the display to, cannot be null
   */
  public static void showInformation(ItemStack item, CommandSender sender) {
    if (item == null || sender == null) throw new IllegalArgumentException();

    StringBuilder builder = new StringBuilder();
    builder.append(ChatColor.BOLD).append(getName(item)).append(" ");
    if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()) {
      builder.append(ChatColor.ITALIC).append("(").append(getName(item, true)).append(") ");
    }
    builder.append(ChatColor.BLUE).append("x").append(item.getAmount());
    DumbAuction.getInstance().sendMessage(sender, ChatColor.AQUA + builder.toString().trim());

    // Display durability
    if (item.getType().getMaxDurability() > 0 && item.getDurability() != 0) {
      double durability =
          1 - ((double) item.getDurability() / (double) item.getType().getMaxDurability());
      int percent = (int) Math.round(durability * 100);
      DumbAuction.getInstance()
          .sendMessage(
              sender, ChatColor.GRAY + "Durability: " + ChatColor.AQUA + "" + percent + "%");
    }

    Potion pot = null;
    try {
      pot = Potion.fromItemStack(item);
    } catch (Exception e) {
    } // Consume error
    List<String> metaMessage = new ArrayList<String>();
    if (item.hasItemMeta() || pot != null) {
      ItemMeta meta = item.getItemMeta();
      if (meta.hasLore()) {
        List<String> lore = meta.getLore();
        metaMessage.add(ChatColor.LIGHT_PURPLE + "Lore: ");
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
        for (String l : lore) {
          metaMessage.add(ChatColor.GRAY + l);
        }
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
      }
      if (meta.hasEnchants() || meta instanceof EnchantmentStorageMeta) {
        metaMessage.add(ChatColor.LIGHT_PURPLE + "Enchants: ");
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
        if (meta.hasEnchants()) {
          Map<Enchantment, Integer> enchants = meta.getEnchants();
          for (Enchantment e : enchants.keySet()) {
            int level = enchants.get(e);
            String strLevel =
                integerToRomanNumeral(level) + " " + ChatColor.GRAY + "(" + level + ")";
            metaMessage.add(ChatColor.AQUA + getEnchantmentName(e) + " " + strLevel);
          }
        }
        if (meta instanceof EnchantmentStorageMeta) {
          EnchantmentStorageMeta emeta = (EnchantmentStorageMeta) meta;
          if (emeta.hasStoredEnchants()) {
            Map<Enchantment, Integer> enchants = emeta.getStoredEnchants();
            for (Enchantment e : enchants.keySet()) {
              int level = enchants.get(e);
              String strLevel =
                  integerToRomanNumeral(level) + " " + ChatColor.GRAY + "(" + level + ")";
              metaMessage.add(ChatColor.AQUA + getEnchantmentName(e) + " " + strLevel);
            }
          }
        }
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
      }
      if (meta instanceof BookMeta) {
        BookMeta book = (BookMeta) meta;
        if (book.hasTitle())
          metaMessage.add(ChatColor.GRAY + "Book Title: " + ChatColor.AQUA + book.getTitle());
        if (book.hasAuthor())
          metaMessage.add(ChatColor.GRAY + "Book Author: " + ChatColor.AQUA + book.getAuthor());
      }
      List<FireworkEffect> effects = new ArrayList<FireworkEffect>();
      int fireworkPower = -1;
      if (meta instanceof FireworkEffectMeta) {
        FireworkEffectMeta firework = (FireworkEffectMeta) meta;
        if (firework.hasEffect()) {
          effects.add(firework.getEffect());
        }
      }
      if (meta instanceof FireworkMeta) {
        FireworkMeta firework = (FireworkMeta) meta;
        if (firework.hasEffects()) {
          effects.addAll(firework.getEffects());
        }
        fireworkPower = firework.getPower();
      }
      if (effects.size() > 0) {
        metaMessage.add(ChatColor.LIGHT_PURPLE + "Firework Effects: ");
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
        for (FireworkEffect effect : effects) {
          metaMessage.add(ChatColor.AQUA + getFireworkTypeName(effect.getType()));
          if (effect.getColors().size() > 0) {
            builder = new StringBuilder();
            for (Color color : effect.getColors()) {
              ChatColor chat =
                  ChatColorPalette.matchColor(color.getRed(), color.getGreen(), color.getBlue());
              String name = getChatName(chat);
              builder.append(chat).append(name).append(ChatColor.GRAY).append(", ");
            }
            metaMessage.add(
                ChatColor.GRAY
                    + "    Colors: "
                    + builder.toString().substring(0, builder.toString().length() - 2));
          }
          if (effect.getFadeColors().size() > 0) {
            builder = new StringBuilder();
            for (Color color : effect.getFadeColors()) {
              ChatColor chat =
                  ChatColorPalette.matchColor(color.getRed(), color.getGreen(), color.getBlue());
              String name = getChatName(chat);
              builder.append(chat).append(name).append(ChatColor.GRAY).append(", ");
            }
            metaMessage.add(
                ChatColor.GRAY
                    + "    Fade Colors: "
                    + builder.toString().substring(0, builder.toString().length() - 2));
          }
        }
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
      }
      if (fireworkPower >= 0) {
        metaMessage.add(ChatColor.GRAY + "Firework Power: " + ChatColor.AQUA + "" + fireworkPower);
      }
      if (meta instanceof LeatherArmorMeta) {
        LeatherArmorMeta leather = (LeatherArmorMeta) meta;
        if (!leather
            .getColor()
            .equals(
                DumbAuction.getInstance().getServer().getItemFactory().getDefaultLeatherColor())) {
          ChatColor chat =
              ChatColorPalette.matchColor(
                  leather.getColor().getRed(),
                  leather.getColor().getGreen(),
                  leather.getColor().getBlue());
          metaMessage.add(ChatColor.GRAY + "Leather Color: " + chat + getChatName(chat));
        }
      }
      if (meta instanceof SkullMeta) {
        SkullMeta skull = (SkullMeta) meta;
        if (skull.hasOwner()) {
          metaMessage.add(ChatColor.GRAY + "Skull Player: " + ChatColor.AQUA + skull.getOwner());
        }
      }
      if (meta instanceof PotionMeta || pot != null) {
        metaMessage.add(ChatColor.LIGHT_PURPLE + "Potion Effects: ");
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
        if (pot != null) {
          for (PotionEffect effect : pot.getEffects()) {
            int amplifier = effect.getAmplifier() + 1;
            int time = effect.getDuration() / 20;
            metaMessage.add(
                ChatColor.AQUA
                    + getPotionEffectName(effect.getType())
                    + " "
                    + integerToRomanNumeral(amplifier)
                    + " "
                    + ChatColor.GRAY
                    + "("
                    + amplifier
                    + ") for "
                    + ChatColor.AQUA
                    + toTime(time));
          }
        }
        if (meta instanceof PotionMeta) {
          PotionMeta potion = (PotionMeta) meta;
          if (potion.hasCustomEffects()) {
            for (PotionEffect effect : potion.getCustomEffects()) {
              int amplifier = effect.getAmplifier() + 1;
              int time = effect.getDuration() / 20;
              metaMessage.add(
                  ChatColor.AQUA
                      + getPotionEffectName(effect.getType())
                      + " "
                      + integerToRomanNumeral(amplifier)
                      + " "
                      + ChatColor.GRAY
                      + "("
                      + amplifier
                      + ") for "
                      + ChatColor.AQUA
                      + toTime(time));
            }
          }
        }
        metaMessage.add(ChatColor.DARK_GRAY + "-------------");
      }
      // Note: MapMeta is useless and not used
    }

    for (String s : metaMessage) {
      DumbAuction.getInstance().sendMessage(sender, s);
    }
  }