Tabnine Logo
ItemStackList.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
slimeknights.mantle.util.ItemStackList

Best Java code snippets using slimeknights.mantle.util.ItemStackList.create (Showing top 5 results out of 315)

origin: SlimeKnights/TinkersConstruct

 @Override
 protected ItemStackList getDemoTools(ItemStack[][] inputItems) {
  if(inputItems.length == 0) {
   return ItemStackList.create();
  }

  ItemStackList demo = super.getDemoTools(inputItems);

  ItemStackList out = ItemStackList.create();

  for(int i = 0; i < inputItems[0].length; i++) {
   if(inputItems[0][i].getItem() == TinkerTools.sharpeningKit) {
    Material material = TinkerTools.sharpeningKit.getMaterial(inputItems[0][i]);
    IModifier modifier = TinkerRegistry.getModifier("fortify" + material.getIdentifier());
    if(modifier != null) {
     ItemStack stack = demo.get(i % demo.size()).copy();
     modifier.apply(stack);
     out.add(stack);
    }
   }
  }

  return out;
 }
}
origin: SlimeKnights/Mantle

/**
 * Create an ItemStackList from the given elements.
 */
public static ItemStackList of(ItemStack... element) {
 ItemStackList itemStackList = create();
 itemStackList.addAll(Arrays.asList(element));
 return itemStackList;
}
origin: SlimeKnights/Mantle

/**
 * Create an ItemStackList from the given elements.
 */
public static ItemStackList of(Collection<ItemStack> boringList) {
 ItemStackList itemStackList = create();
 itemStackList.addAll(boringList);
 return itemStackList;
}
origin: SlimeKnights/Mantle

/**
 * Creates a new list with the same content. ItemStacks are shared between lists!
 * @param fixed If true the list will have fixed size
 */
public ItemStackList copy(boolean fixed) {
 ItemStackList copy = fixed ? withSize(this.size()) : create();
 for(int i = 0; i < size(); i++) {
  copy.set(i, get(i));
 }
 return copy;
}
origin: SlimeKnights/Mantle

 /**
  * Creates a new list with the same content, but Itemstacks are copied too,
  * meaning changes to the copy will not affect the itemstacks in the original list.
  * @param fixed If true the list will have fixed size
  */
 public ItemStackList deepCopy(boolean fixed) {
  ItemStackList copy = fixed ? withSize(this.size()) : create();
  for(int i = 0; i < size(); i++) {
   copy.set(i, get(i).copy());
  }
  return copy;
 }
}
slimeknights.mantle.utilItemStackListcreate

Popular methods of ItemStackList

  • add
  • get
  • set
  • size
  • withSize
    Create an empty ItemStackList with the given size
  • <init>
  • addAll
  • of
    Create an ItemStackList from the given elements.

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
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