Tabnine Logo
Package
Code IndexAdd Tabnine to your IDE (free)

How to use
Package
in
net.buycraft.plugin.data

Best Java code snippets using net.buycraft.plugin.data.Package (Showing top 7 results out of 315)

origin: BuycraftPlugin/BuycraftX

public List<String> format(Currency currency, Package p) {
  NumberFormat format = NumberFormat.getCurrencyInstance(Locale.US);
  format.setCurrency(currency);
  List<String> formatted = new ArrayList<>();
  for (String line : lines) {
    formatted.add(line.replace("%name%", abbreviate(p.getName(), 16))
        .replace("%price%", format.format(p.getEffectivePrice())));
  }
  return formatted;
}
origin: BuycraftPlugin/BuycraftX

@Override
public int compareTo(Package o) {
  Objects.requireNonNull(o, "package");
  return Integer.compare(order, o.getOrder());
}
origin: BuycraftPlugin/BuycraftX

private void sendPaginatedMessage(Node node, CommandSource source) {
  PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
  PaginationList.Builder builder = paginationService.builder();
  List<Text> contents = node.getSubcategories().stream()
      .map(category -> Text.builder("> " + category.getName()).color(TextColors.GRAY).onClick(TextActions.executeCallback(commandSource -> {
        if (commandSource instanceof Player) {
          sendPaginatedMessage(node.getChild(category), source);
        }
      })).build()).collect(Collectors.toList());
  for (Package p : node.getPackages()) {
    contents.add(Text.builder(p.getName()).color(TextColors.WHITE).append(Text.builder(" - ").color(TextColors.GRAY).build())
        .append(Text.builder("$x".replace("$", plugin.getServerInformation().getAccount().getCurrency().getSymbol())
            .replace("x", "" + p.getEffectivePrice())).color(TextColors.GREEN).build())
        .onClick(TextActions.executeCallback(commandSource -> {
          if (commandSource instanceof Player) {
            plugin.getPlatform().executeAsync(new SendCheckoutLinkTask(plugin, p.getId(), (Player) commandSource));
          }
        })).build());
  }
  builder.title(Text.builder(plugin.getI18n().get("sponge_listing")).color(TextColors.AQUA).build()).contents(contents).padding(Text.of("-")).sendTo(source);
}
origin: BuycraftPlugin/BuycraftX

Package p = packages.get(i);
String gui_item = p.getGui_item();
meta.setDisplayName(ChatColor.GREEN + p.getName());
    ChatColor.DARK_GREEN +
    ChatColor.BOLD +
    format.format(p.getEffectivePrice());
lore.add(price);
if (p.getSale() != null && p.getSale().isActive()) {
  lore.add(ChatColor.RED + plugin.getI18n().get("amount_off", format.format(p.getSale().getDiscount())));
origin: BuycraftPlugin/BuycraftX

if (aPackage.getName().equals(ChatColor.stripColor(displayName))) {
  GUIUtil.closeInventoryLater(player);
  if (plugin.getBuyNowSignListener().getSettingUpSigns().containsKey(player.getUniqueId())) {
    plugin.getBuyNowSignListener().doSignSetup(player, aPackage);
  } else {
    plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new SendCheckoutLink(plugin, aPackage.getId(), player));
origin: BuycraftPlugin/BuycraftX

  private Package doSearch(int id, Category category) {
    for (Package aPackage : category.getPackages()) {
      if (aPackage.getId() == id)
        return aPackage;
    }

    for (Category sub : category.getSubcategories()) {
      Package p = doSearch(id, sub);
      if (p != null)
        return p;
    }

    return null;
  }
}
origin: BuycraftPlugin/BuycraftX

  public void doSignSetup(Player player, Package p) {
    SerializedBlockLocation sbl = settingUpSigns.remove(player.getUniqueId());
    if (sbl == null)
      return;

    Block b = BukkitSerializedBlockLocation.toBukkit(sbl).getBlock();

    if (!(b.getType() == Material.WALL_SIGN || b.getType() == Material.SIGN_POST))
      return;

    plugin.getBuyNowSignStorage().addSign(new SavedBuyNowSign(sbl, p.getId()));
    plugin.getServer().getScheduler().runTask(plugin, new BuyNowSignUpdater(plugin));
  }
}
net.buycraft.plugin.dataPackage

Most used methods

  • getEffectivePrice
  • getId
  • getName
  • getGui_item
  • getOrder
  • getSale

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • JLabel (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now