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

How to use
DryingRecipe
in
slimeknights.tconstruct.library

Best Java code snippets using slimeknights.tconstruct.library.DryingRecipe (Showing top 10 results out of 315)

origin: SlimeKnights/TinkersConstruct

/**
 * Gets the result for a drying recipe
 *
 * @param input Input ItemStack
 * @return Output A copy of the output ItemStack, or Itemstack.EMPTY if no recipe is found
 */
public static ItemStack getDryingResult(ItemStack input) {
 for(DryingRecipe r : dryingRegistry) {
  if(r.matches(input)) {
   return r.getResult();
  }
 }
 return ItemStack.EMPTY;
}
origin: SlimeKnights/TinkersConstruct

public DryingRecipeWrapper(DryingRecipe recipe) {
 this.input = ImmutableList.of(recipe.input.getInputs());
 this.output = ImmutableList.of(recipe.getResult());
 this.time = recipe.getTime();
}
origin: SlimeKnights/TinkersConstruct

/**
 * Gets the drying time for a drying recipe
 *
 * @param input Input ItemStack
 * @return Output drying time, or -1 if no recipe is found
 */
public static int getDryingTime(ItemStack input) {
 for(DryingRecipe r : dryingRegistry) {
  if(r.matches(input)) {
   return r.getTime();
  }
 }
 return -1;
}
origin: SlimeKnights/TinkersConstruct

public static void addDryingRecipe(DryingRecipe recipe) {
 if(new TinkerRegisterEvent.DryingRackRegisterEvent(recipe).fire()) {
  dryingRegistry.add(recipe);
 }
 else {
  try {
   String input = recipe.input.getInputs().stream().findFirst().map(ItemStack::getUnlocalizedName).orElse("?");
   String output = recipe.getResult().getUnlocalizedName();
   log.debug("Registration of drying rack recipe for " + output + " from " + input + " has been cancelled by event");
  } catch(Exception e) {
   log.error("Error when logging drying rack event", e);
  }
 }
}
origin: SlimeKnights/TinkersConstruct

/**
 * Adds a new drying recipe
 *
 * @param input  Input ItemStack
 * @param output Output ItemStack
 * @param time   Recipe time in ticks
 */
public static void registerDryingRecipe(ItemStack input, ItemStack output, int time) {
 if(output.isEmpty() || input.isEmpty()) {
  return;
 }
 addDryingRecipe(new DryingRecipe(new RecipeMatch.Item(input, 1), output, time));
}
origin: jaredlll08/ModTweaker

  @SubscribeEvent
  public void onTinkerRegister(TinkerRegisterEvent.DryingRackRegisterEvent event) {
    if(event.getRecipe() instanceof DryingRecipeTweaker) {
      return;
    }
    for(Map.Entry<IItemStack, IItemStack> ent : DRYING_RECIPES.entrySet()) {
      if(ent.getKey().matches(InputHelper.toIItemStack(event.getRecipe().getResult()))) {
        if(ent.getValue() != null) {
          if(event.getRecipe().input.matches(NonNullList.withSize(1, (ItemStack) ent.getValue().getInternal())).isPresent()) {
            event.setCanceled(true);
          }
        } else
          event.setCanceled(true);
      }
    }
  }
}
origin: SlimeKnights/TinkersConstruct

/**
 * Adds a new drying recipe
 *
 * @param oredict Input ore dictionary entry
 * @param output  Output ItemStack
 * @param time    Recipe time in ticks
 */
public static void registerDryingRecipe(String oredict, ItemStack output, int time) {
 if(output.isEmpty() || oredict == null) {
  return;
 }
 addDryingRecipe(new DryingRecipe(new RecipeMatch.Oredict(oredict, 1), output, time));
}
origin: SlimeKnights/TinkersConstruct

/**
 * Adds a new drying recipe
 *
 * @param input  Input Item
 * @param output Output ItemStack
 * @param time   Recipe time in ticks
 */
public static void registerDryingRecipe(Item input, ItemStack output, int time) {
 if(output.isEmpty() || input == null) {
  return;
 }
 ItemStack stack = new ItemStack(input, 1, OreDictionary.WILDCARD_VALUE);
 addDryingRecipe(new DryingRecipe(new RecipeMatch.Item(stack, 1), output, time));
}
origin: SlimeKnights/TinkersConstruct

/**
 * Adds a new drying recipe
 *
 * @param input  Input Item
 * @param output Output Item
 * @param time   Recipe time in ticks
 */
public static void registerDryingRecipe(Item input, Item output, int time) {
 if(output == null || input == null) {
  return;
 }
 ItemStack stack = new ItemStack(input, 1, OreDictionary.WILDCARD_VALUE);
 addDryingRecipe(new DryingRecipe(new RecipeMatch.Item(stack, 1), new ItemStack(output), time));
}
origin: SlimeKnights/TinkersConstruct

/**
 * Adds a new drying recipe
 *
 * @param input  Input Block
 * @param output Output Block
 * @param time   Recipe time in ticks
 */
public static void registerDryingRecipe(Block input, Block output, int time) {
 if(output == null || input == null) {
  return;
 }
 ItemStack stack = new ItemStack(input, 1, OreDictionary.WILDCARD_VALUE);
 addDryingRecipe(new DryingRecipe(new RecipeMatch.Item(stack, 1), new ItemStack(output), time));
}
slimeknights.tconstruct.libraryDryingRecipe

Most used methods

  • getResult
  • <init>
  • getTime
  • matches

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 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