ItemBuilder.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:SupaCommons 作者:
/**
 * Adds {@link FireworkEffect}s to this item, assuming it is a firework or firework charge.
 * <p />
 * <b>UNSAFE</b>
 *
 * @param effects effects to add
 *
 * @return this item builder instance, for chaining
 */
public ItemBuilder fireworkAdd(@Nonnull FireworkEffect... effects) {
  if (effects == null) {
    if (!this.failSilently) {
      throw new IllegalArgumentException("effects cannot be null.");
    }
    return this;
  }
  boolean b = false;
  try {
    b = isFireworkEffectMeta();
  } catch (IllegalStateException ignored) {
  }
  if (b || isFireworkMeta()) {
    try {
      if (b) {
        ((FireworkEffectMeta) this.itemMeta).setEffect(effects[0]);
      } else {
        ((FireworkMeta) this.itemMeta).addEffects(effects);
      }
    } catch (Exception e) {
      if (!this.failSilently) {
        e.printStackTrace();
      }
    }
  }
  return this;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号